Commit db353bbc by HlQ

[fix] 处理解析合同文件 Json 数据异常

1 parent 60d82bad
...@@ -651,7 +651,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont ...@@ -651,7 +651,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
var jsonArrR = jobR.path("result").withArray("list"); var jsonArrR = jobR.path("result").withArray("list");
var fileListR = StreamSupport.stream(jsonArrR.spliterator(), false) var fileListR = StreamSupport.stream(jsonArrR.spliterator(), false)
.map(v -> { .map(v -> {
var fileArr = v.path("data").withArray("file_1"); var fileArr = JsonUtil.parseTree(v.path("data").path("file_1").asText());
var contractNo = v.path("data").path("serialNo").asText(); var contractNo = v.path("data").path("serialNo").asText();
return (JsonNode) JsonUtil.createObj().put("contractNo", contractNo).set("fileArr", fileArr); return (JsonNode) JsonUtil.createObj().put("contractNo", contractNo).set("fileArr", fileArr);
}).toList(); }).toList();
...@@ -670,7 +670,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont ...@@ -670,7 +670,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
for (JsonNode entries : fileList) { for (JsonNode entries : fileList) {
var contractNo = entries.path("contractNo").asText(); var contractNo = entries.path("contractNo").asText();
ArrayNode fileArr = entries.withArray("fileArr"); var fileArr = entries.path("fileArr");
if (ObjUtil.isNull(fileArr) || fileArr.isEmpty()) { if (ObjUtil.isNull(fileArr) || fileArr.isEmpty()) {
log.info("合同:{},没有文件", contractNo); log.info("合同:{},没有文件", contractNo);
continue; continue;
...@@ -689,7 +689,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont ...@@ -689,7 +689,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
try { try {
bytes = HttpDownloader.downloadBytes(o.path("attachIndex").asText()); bytes = HttpDownloader.downloadBytes(o.path("attachIndex").asText());
} catch (Exception e) { } catch (Exception e) {
log.error("合同:{},[{}] 文件同步失败", contractNo, filename); log.error("合同:{},[{}] 文件同步失败", contractNo, filename, e);
continue; continue;
} }
var sha256 = SecureUtil.sha256().digestHex(bytes).toUpperCase(); var sha256 = SecureUtil.sha256().digestHex(bytes).toUpperCase();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!