对接接口方法:1.获取token2.更新案件状态3.上传文件4.推送案件附件信息

This commit is contained in:
wangqiong
2024-03-28 18:54:08 +08:00
parent b0f71c6e3a
commit 08f4aca27c
11 changed files with 781 additions and 11 deletions
@@ -0,0 +1,69 @@
package com.ruoyi.web.controller.tool;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.PushCaseStatusEnum;
import com.ruoyi.system.service.impl.BeiMingInterfaceService;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseStatusInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.File;
import static com.ruoyi.common.utils.EncryptUtils.sm4Decrypt;
import static com.ruoyi.common.utils.EncryptUtils.sm4Encrypt;
@RestController
@RequestMapping("/beiming/api")
public class TestApiController {
@Autowired
BeiMingInterfaceService beiMingInterfaceService;
@Value("${beimingprivatekey}")
public String privateKey;
@GetMapping("/test")
@Anonymous
public AjaxResult selectCaseFlow() {
String token = beiMingInterfaceService.getApiToken("BWT_MEDIATION", "86251b190e3a40f3942v215d1762c663", System.currentTimeMillis());
// token = "f910e1441fc56e49d3f31396e8d9aa04228045815ee986a9587d7a5cb7312f9d11c7f80041745f38ec686ea1f819c8b8227f9c03196c6dd004f89215c4805c24355be4b57abeddb7b9d2cbda45fae74c49f4a83fb6496d84302ca8c07245786d682ecb68aed966fcbda3188b9c4d4376089471bb5aee371a62073b0ce15d72dccd6fbc8fd13957e2fb7aa018cb5937938bfc9773e570ac06ac633617cea8405759cf609c832074aaa03f972c0a6a93cde531da0d91d07770c037fdea1368ee5772941ba2a55ef155979d1ed8222faad92ed342530ef04f3746aa96499dee6ea4869ce46bd0dcfe7a69e7db49eb2aec388c47824c201b49825f24ffe82dde41b5";
System.out.println("toke:" + token);
//解密
if (token != null && !token.isEmpty()) {
JSONObject jsonObject = JSON.parseObject(token);
String tokenString = jsonObject.getString("data");
System.out.println("data信息:" + tokenString);
String tokenstr = sm4Decrypt(tokenString, privateKey);
System.out.println("解密后的字符串:" + tokenstr);
if (tokenstr != null && !tokenstr.isEmpty()) {
JSONObject tokenObject = JSON.parseObject(tokenstr);
String resultToken = tokenObject.getString("token");
MsCaseStatusInfo info = MsCaseStatusInfo.builder().caseNo("zc2024032700012").statusCode(PushCaseStatusEnum.MEDIATE.getCode()).caseClosureExplanation(PushCaseStatusEnum.MEDIATE.getName()).build();
JSONObject result = beiMingInterfaceService.submitCaseStatusInfo(resultToken, "zc2024032700012", "BWT_MEDIATION", info);
System.out.println("jieguo:" + result.toString());
if (result != null) {
String data = result.getString("data");
String datastr = sm4Decrypt(data, privateKey);
System.out.println("最终解密后的字符串:" + datastr);
}
}
}
return AjaxResult.success();
}
@GetMapping("/testfile")
@Anonymous
public AjaxResult testfile() {
// File file = new File("D:/WorkDoc/TJ/File/证据1.png");
File file = new File("D:/WorkDoc/TJ/File/证据3.png");
JSONObject jsonObject1 = beiMingInterfaceService.pushAttachmentInfo("BWT_MEDIATION", "86251b190e3a40f3942v215d1762c663", file, "123abc", "BWT_MEDIATION", "zc2024032700012");
System.out.println("fanhui:" + jsonObject1.toString());
return AjaxResult.success();
}
}
+14 -11
View File
@@ -90,7 +90,7 @@ spring:
max-wait: -1ms
web:
resources:
static-locations: file:/home/ruoyi/
static-locations: file:/home/ruoyi/
mail:
host: smtp.163.com
port: 25
@@ -196,17 +196,20 @@ signSealCallbackConfig:
url: http://121.40.189.20:7001/mssignSeal/signSeaalCaseApplicaCallback
# onlyOffice系统url配置
onlyOfficeConfig:
# url: http://172.16.0.254:9090/files/upload
# url: http://172.16.0.254:9090/files/upload
url: http://121.40.189.20:9090/files/upload
#jodconverter:
# local:
# host: 121.40.189.20
#jodconverter:
# local:
# host: 121.40.189.20
#暂时关闭预览,启动时会有点慢
# enabled: true
# enabled: true
#设置libreoffice主目录 linux地址如:/usr/lib64/libreoffice
# office-home: /usr/lib64/libreoffice/
# office-home: D:\app\libreOffice\
#开启多个libreoffice进程,每个端口对应一个进程
# port-numbers: 8100
#libreoffice进程重启前的最大进程数
# office-home: /usr/lib64/libreoffice/
# office-home: D:\app\libreOffice\
#开启多个libreoffice进程,每个端口对应一个进程
# port-numbers: 8100
#libreoffice进程重启前的最大进程数
# max-tasks-per-process: 100
beimingapihost: https://zj.odrcloud.cn
beimingapiprefix: /onestop/sync
beimingprivatekey: d7724e72c4be93196a35203e8379ded5