|
|
|
@ -106,6 +106,11 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
String intDBUsername = "wsjc"; |
|
|
|
|
String intDBPassword = "wsjc9985"; |
|
|
|
|
|
|
|
|
|
// // 测试数据库连接信息
|
|
|
|
|
// String intDBUrl = "jdbc:mysql://localhost:3306/dlp_inspection?characterEncoding=utf8&serverTimezone=Asia/Shanghai";
|
|
|
|
|
// String intDBUsername = "root";
|
|
|
|
|
// String intDBPassword = "123456";
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 构建委托材料检验结果字符串 |
|
|
|
|
* |
|
|
|
@ -1089,7 +1094,7 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean pushSuspectDetectionResult(String entrustmentId, DLPUser user) { |
|
|
|
|
public boolean pushSuspectDetectionResult(String entrustmentId) { |
|
|
|
|
// 参数校验
|
|
|
|
|
if (StringUtils.isBlank(entrustmentId)) { |
|
|
|
|
throw new IllegalArgumentException("entrustmentId不能为空"); |
|
|
|
@ -1100,10 +1105,6 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
if (entrustment == null) { |
|
|
|
|
throw new IllegalArgumentException("未找到委托信息:" + entrustmentId); |
|
|
|
|
} |
|
|
|
|
boolean push = false; |
|
|
|
|
|
|
|
|
|
// 推送数据至省厅系统
|
|
|
|
|
push = this.pushQualitativeReportData(entrustment, user); |
|
|
|
|
|
|
|
|
|
// 获取案件信息
|
|
|
|
|
CaseEvent caseEvent = caseEventService.getById(entrustment.getCaseId()); |
|
|
|
@ -1127,9 +1128,6 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
.list(); |
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(suspects)) { |
|
|
|
|
if (push) { |
|
|
|
|
throw new RuntimeException("推送数据至省厅系统成功,但未找到嫌疑人信息,请检查案件信息!"); |
|
|
|
|
} else |
|
|
|
|
throw new IllegalArgumentException("未找到嫌疑人信息:" + entrustmentId + ",请先添加嫌疑人信息!"); |
|
|
|
|
} |
|
|
|
|
// 构造物证材料映射
|
|
|
|
@ -1146,7 +1144,7 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
.sorted(Comparator.comparingInt(EntrustMaterialCheckoutResultVO::getOrderNo)) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
push = pushToDatabase(suspects, resultVOS, entrustment, caseEvent, user); |
|
|
|
|
boolean push = pushToDatabase(suspects, resultVOS, entrustment, caseEvent); |
|
|
|
|
|
|
|
|
|
if (push) { |
|
|
|
|
entrustment.setPlatformFlag(true); |
|
|
|
@ -1177,7 +1175,7 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
.list(); |
|
|
|
|
String flag = "AppraisalDocument" + ":true"; |
|
|
|
|
for (Entrustment entrust : entrusts) { |
|
|
|
|
if (this.pushQualitativeReportData(entrust, user)) { |
|
|
|
|
if (this.pushQualitativeReportData(entrust)) { |
|
|
|
|
// 处理 PushFlag,防止 null,并确保 flag 至少存在一次
|
|
|
|
|
List<String> flagList = Optional.ofNullable(StrUtil.split(entrust.getPushFlag(), StrUtil.COMMA)) |
|
|
|
|
.orElse(new ArrayList<>()); |
|
|
|
@ -1228,7 +1226,7 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean pushToDatabase(List<Suspect> suspects, List<EntrustMaterialCheckoutResultVO> resultVOS, Entrustment entrustment, CaseEvent caseEvent, DLPUser user) { |
|
|
|
|
private boolean pushToDatabase(List<Suspect> suspects, List<EntrustMaterialCheckoutResultVO> resultVOS, Entrustment entrustment, CaseEvent caseEvent) { |
|
|
|
|
|
|
|
|
|
try (Connection connection = DriverManager.getConnection(intDBUrl, intDBUsername, intDBPassword)) { |
|
|
|
|
|
|
|
|
@ -1254,7 +1252,7 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
pstmt.setString(10, caseEvent.getCaseBrief()); |
|
|
|
|
pstmt.setDate(11, java.sql.Date.valueOf(caseEvent.getHappenTime())); |
|
|
|
|
pstmt.setTimestamp(12, Timestamp.valueOf(LocalDateTime.now())); |
|
|
|
|
pstmt.setString(13, user.getName()); |
|
|
|
|
pstmt.setString(13, "管理员"); |
|
|
|
|
System.out.println(entrustment); |
|
|
|
|
pstmt.setDate(14, java.sql.Date.valueOf(entrustment.getAcceptTime().toLocalDate())); |
|
|
|
|
pstmt.setString(15, entrustment.getClientOrgName()); |
|
|
|
@ -1297,8 +1295,8 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public boolean pushQualitativeReportData(Entrustment entrust, DLPUser dlpUser) { |
|
|
|
|
JSONObject jsonObject = this.buildQualitativeReportJsonPayload(entrust, dlpUser); |
|
|
|
|
public boolean pushQualitativeReportData(Entrustment entrust) { |
|
|
|
|
JSONObject jsonObject = this.buildQualitativeReportJsonPayload(entrust); |
|
|
|
|
String type = entrust.getEntrustmentType() == 0 ? "常规毒品" : "生物样本"; |
|
|
|
|
log.info("推送" + type + "定性报告数据, 受理编号: {}, 请求数据: {}", entrust.getAcceptNo(), jsonObject); |
|
|
|
|
try { |
|
|
|
@ -1345,7 +1343,7 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
* @param entrust 委托信息 |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private JSONObject buildQualitativeReportJsonPayload(Entrustment entrust, DLPUser dlpUser) { |
|
|
|
|
private JSONObject buildQualitativeReportJsonPayload(Entrustment entrust) { |
|
|
|
|
|
|
|
|
|
boolean ret = false; |
|
|
|
|
if (!StringUtils.isNotBlank(entrust.getId())) { |
|
|
|
@ -1356,8 +1354,8 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
|
|
|
|
|
jsonObject.set("jiandingwenshuhao", String.format("[%s]%s号", splitAcceptNo[0], splitAcceptNo[1])); // 鉴定文书号
|
|
|
|
|
jsonObject.set("jyy1qm", dlpUser.getName()); // 检测人
|
|
|
|
|
jsonObject.set("jyyr2qm", dlpUser.getName()); // 检测人
|
|
|
|
|
jsonObject.set("jyy1qm", "管理员"); // 检测人
|
|
|
|
|
jsonObject.set("jyyr2qm", "管理员"); // 检测人
|
|
|
|
|
jsonObject.set("jyy1zc", "#NULL#"); // 检验人1专业技术资格或职称
|
|
|
|
|
jsonObject.set("jyy2zc", "#NULL#"); // 检验人2专业技术资格或职称
|
|
|
|
|
jsonObject.set("qfrq", "#NULL#"); |
|
|
|
@ -1627,7 +1625,7 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
List<EntrustMaterialCheckoutResultVO> vos = resutlMap.get(entrust.getId()); |
|
|
|
|
List<Suspect> suspects = susMap.get(entrust.getId()); |
|
|
|
|
CaseEvent caseEvent = caseMap.get(entrust.getCaseId()); |
|
|
|
|
boolean ret = this.pushToDatabase(suspects, vos, entrust, caseEvent, dlpUser); |
|
|
|
|
boolean ret = this.pushToDatabase(suspects, vos, entrust, caseEvent); |
|
|
|
|
if (!ret) { |
|
|
|
|
return R.failed("推送失败"); |
|
|
|
|
} |
|
|
|
@ -2149,7 +2147,7 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus |
|
|
|
|
entrust.setClientOrgName(datum.get("委托单位")); |
|
|
|
|
int type = datum.get("类型").equals("常规毒品") ? 0 : 1; |
|
|
|
|
entrust.setEntrustmentType(type); |
|
|
|
|
if (this.pushQualitativeReportData(entrust, dlpUser)) { |
|
|
|
|
if (this.pushQualitativeReportData(entrust)) { |
|
|
|
|
successCount++; |
|
|
|
|
} else { |
|
|
|
|
failCount++; |
|
|
|
|