|
|
@@ -123,6 +123,10 @@ public class HandleData {
|
|
|
log.info("ready to analyse infectious report");
|
|
|
HandleInfectiousReport(retList);
|
|
|
}
|
|
|
+ if (lisTable.equals("V_JT_AdditionalRequest")){
|
|
|
+ log.info("ready to analyse additional request");
|
|
|
+ HandleAdditionalRequest(retList);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> cleanExistData(String lisTable, List<Map<String, Object>> lisList, List<Map<String, Object>> existList) {
|
|
|
@@ -199,6 +203,27 @@ public class HandleData {
|
|
|
String idStr = idObj == null ? null : idObj.toString();
|
|
|
if (!existIdSet.contains(idStr)) {
|
|
|
resultList.add(testMap);
|
|
|
+// log.info("not exist,add:"+testMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return resultList;
|
|
|
+ }
|
|
|
+ if (lisTable.equals("V_JT_AdditionalRequest")) {
|
|
|
+ // 1. 创建Set存储existList中所有 tiao_ma_hao_ 的值(转换为字符串形式)
|
|
|
+ Set<String> existIdSet = new HashSet<>();
|
|
|
+// log.info("existList:"+existList);
|
|
|
+// log.info("lisList:"+lisList);
|
|
|
+ for (Map<String, Object> existMap : existList) {
|
|
|
+ Object idObj = existMap.get("bian_zhi_shi_jian");
|
|
|
+ existIdSet.add(idObj == null ? null : idObj.toString());
|
|
|
+ }
|
|
|
+ // 2. 过滤lisList:只保留 SampleCode 不在 existIdSet 中的元素
|
|
|
+ List<Map<String, Object>> resultList = new ArrayList<>();
|
|
|
+ for (Map<String, Object> testMap : lisList) {
|
|
|
+ Object idObj = testMap.get("REGTIME");
|
|
|
+ String idStr = idObj == null ? null : idObj.toString();
|
|
|
+ if (!existIdSet.contains(idStr)) {
|
|
|
+ resultList.add(testMap);
|
|
|
// log.info("not exist,add:"+testMap);
|
|
|
}
|
|
|
}
|
|
|
@@ -524,6 +549,69 @@ public class HandleData {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void HandleAdditionalRequest(List<Map<String, Object>> retList){
|
|
|
+ if (retList.size() > 0) {
|
|
|
+ Timestamp currentTimestamp = getCurTime("yyyy-MM-dd HH:mm:ss");
|
|
|
+ long sequenceCounter = 0;
|
|
|
+ List<Map<String, Object>> insertList = new ArrayList<>();
|
|
|
+ for (Map<String, Object> retMap : retList) {
|
|
|
+ Map<String, Object> insertMap = new HashMap<>();
|
|
|
+ // 生成有序ID:时间戳+自增序列号
|
|
|
+ String orderedId = String.format("%d-%06d",
|
|
|
+ currentTimestamp.getTime(), // 使用时间戳
|
|
|
+ sequenceCounter++ // 自增序列号
|
|
|
+ );
|
|
|
+ insertMap.put("id_", orderedId);
|
|
|
+ insertMap.put("create_time_", currentTimestamp); // 直接使用Timestamp,避免字符串转换
|
|
|
+ String createUserInfo = ibpsRepository.getUserInfoByName(String.valueOf(retMap.get("REGUSER")));
|
|
|
+ String inUserInfo = ibpsRepository.getUserInfoByName(String.valueOf(retMap.get("INSPUSER")));
|
|
|
+ if(createUserInfo.contains("未找到")){
|
|
|
+ log.warn("createUserInfo:"+createUserInfo);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String workGroupID = ibpsRepository.getPosiByCode(retMap.get("REGLOCATION").toString());
|
|
|
+ if(workGroupID.contains("-1")){
|
|
|
+ log.warn("workGroupID:"+workGroupID);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ insertMap.put("create_by_", createUserInfo.split("@")[0]);
|
|
|
+ insertMap.put("bian_zhi_ren_", createUserInfo.split("@")[0]);
|
|
|
+ insertMap.put("bian_zhi_shi_jian", String.valueOf(retMap.get("REGTIME")));
|
|
|
+ insertMap.put("bian_zhi_bu_men_", workGroupID);
|
|
|
+ insertMap.put("di_dian_", ibpsRepository.getPosiByCode("LOCAL"));
|
|
|
+ insertMap.put("shi_fou_guo_shen_", "已完成");
|
|
|
+ insertMap.put("shen_qing_shi_jia", retMap.get("REQTIME"));
|
|
|
+ insertMap.put("shen_qing_ke_shi_", retMap.get("REQLOCATION"));
|
|
|
+ insertMap.put("shen_qing_ren_zh", retMap.get("REQUSER"));
|
|
|
+ insertMap.put("shen_qing_ren_", retMap.get("REQUSER"));
|
|
|
+ insertMap.put("yang_pin_bian_hao", retMap.get("SAMPLECODE"));
|
|
|
+ insertMap.put("nei_ron_zh", retMap.get("TESTCODE"));
|
|
|
+ insertMap.put("jian_yan_shi_xian", String.valueOf(retMap.get("ADDTIME")));
|
|
|
+ insertMap.put("ke_shi_lei_xing_", "外部");
|
|
|
+ insertMap.put("deng_ji_ren_yuan_", "受理");
|
|
|
+ insertMap.put("jie_shou_ren_yuan", inUserInfo.split("@")[0]);
|
|
|
+ insertMap.put("song_da_qing_kuan", "已送");
|
|
|
+ insertMap.put("song_da_ren_yuan_", retMap.get("RECUSER"));
|
|
|
+ insertMap.put("song_da_shi_jian_", String.valueOf(retMap.get("RECTIME")));
|
|
|
+ insertMap.put("bei_zhu_", retMap.get("REMARK"));
|
|
|
+
|
|
|
+ insertList.add(insertMap);
|
|
|
+ }
|
|
|
+ if (!insertList.isEmpty()) {
|
|
|
+ String res = ibpsRepository.saveToTable(insertList, "t_fjjysqdjb", "1");
|
|
|
+// String res = "success";
|
|
|
+ if ("success".equals(res)) {
|
|
|
+ log.info("table:t_fjjysqdjb success insert: {} datas", insertList.size());
|
|
|
+ } else {
|
|
|
+ log.error("fail insert t_fjjysqdjb");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ log.info("No New Additional Request exist!");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// 辅助方法:安全获取字符串值,避免空指针异常
|
|
|
private String getStringValue(Map<String, Object> map, String key) {
|