Browse Source

Merge remote-tracking branch 'origin/master'

zhenghao 1 month ago
parent
commit
0aae589bfb

+ 167 - 105
src/main/java/com/juxin/client/websocket/FindTask.java

@@ -85,7 +85,7 @@ public class FindTask {
     }
 
 
-    @Scheduled(cron = "*/5 * * * * ?")
+    @Scheduled(cron = "*/20 * * * * ?")
     public void findTask() {
         if (client == null || client.getUserSession() == null) {
             return;
@@ -209,21 +209,24 @@ public class FindTask {
         Map<String, Object> req = new HashMap<>();
         req.put("recordId", jsonObject.get("groupId"));
         req.put("groupId", jsonObject.get("groupId"));
-        req.put("jobState", status[RandomUtil.randomInt(0, 6)]);
-        List<Map<String, String>> split = new ArrayList<>();
-        List<Map<String, String>> list = jsonObject.get("list", List.class);
-        list.forEach(e -> {
-            Map<String, String> map = new HashMap<>();
-            map.put("applicationid", IdUtil.fastSimpleUUID());
-            map.put("bankCard", e.get("bankCard"));
-            map.put("result", "0000");
-            map.put("maninBodyType", e.get("maninBodyType"));
-            map.put("bankName", Objects.toString(jsonObject.get("bankname")));
-            map.put("splitTime", DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN) + "-"
-                    + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN));
-            split.add(map);
-        });
-        req.put("bankSplits", split);
+        String jobState = status[RandomUtil.randomInt(0, 6)];
+        req.put("jobState", jobState);
+        if (Objects.equals(jobState, "success")) {
+            List<Map<String, String>> split = new ArrayList<>();
+            List<Map<String, String>> list = jsonObject.get("list", List.class);
+            list.forEach(e -> {
+                Map<String, String> map = new HashMap<>();
+                map.put("applicationid", IdUtil.fastSimpleUUID());
+                map.put("bankCard", e.get("bankCard"));
+                map.put("result", "0000");
+                map.put("maninBodyType", e.get("maninBodyType"));
+                map.put("bankName", Objects.toString(jsonObject.get("bankname")));
+                map.put("splitTime", DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN) + "-"
+                        + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN));
+                split.add(map);
+            });
+            req.put("bankSplits", split);
+        }
         result.put("reqJson", req);
         return JSONUtil.toJsonStr(result);
     }
@@ -237,21 +240,24 @@ public class FindTask {
         Map<String, Object> req = new HashMap<>();
         req.put("recordId", jsonObject.get("groupId"));
         req.put("groupId", jsonObject.get("groupId"));
-        req.put("jobState", "success");
-        List<Map<String, String>> split = new ArrayList<>();
-        List<Map<String, String>> list = jsonObject.get("list", List.class);
-        list.forEach(e -> {
-            Map<String, String> map = new HashMap<>();
-            map.put("applicationid", IdUtil.fastSimpleUUID());
-            map.put("data", e.get("accountNo"));
-            map.put("searchAgency", Objects.toString(jsonObject.get("searchAgency")));
-            map.put("result", "0000");
-            map.put("accountSearchType", e.get("accountSearchType"));
-            map.put("splitTime", DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN) + "-"
-                    + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN));
-            split.add(map);
-        });
-        req.put("thirdFundsSplits", split);
+        String jobState = status[RandomUtil.randomInt(0, 6)];
+        req.put("jobState", jobState);
+        if (Objects.equals(jobState, "success")) {
+            List<Map<String, String>> split = new ArrayList<>();
+            List<Map<String, String>> list = jsonObject.get("list", List.class);
+            list.forEach(e -> {
+                Map<String, String> map = new HashMap<>();
+                map.put("applicationid", IdUtil.fastSimpleUUID());
+                map.put("data", e.get("accountNo"));
+                map.put("searchAgency", Objects.toString(jsonObject.get("searchAgency")));
+                map.put("result", "0000");
+                map.put("accountSearchType", e.get("accountSearchType"));
+                map.put("splitTime", DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN) + "-"
+                        + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN));
+                split.add(map);
+            });
+            req.put("thirdFundsSplits", split);
+        }
         result.put("reqJson", req);
         return JSONUtil.toJsonStr(result);
     }
@@ -265,20 +271,23 @@ public class FindTask {
         Map<String, Object> req = new HashMap<>();
         req.put("recordId", jsonObject.get("groupId"));
         req.put("groupId", jsonObject.get("groupId"));
-        req.put("jobState", status[RandomUtil.randomInt(0, 6)]);
-        List<Map<String, String>> split = new ArrayList<>();
-        List<Map<String, String>> list = jsonObject.get("list", List.class);
-        list.forEach(e -> {
-            Map<String, String> map = new HashMap<>();
-            map.put("applicationid", IdUtil.fastSimpleUUID());
-            map.put("data", e.get("accountNo"));
-            map.put("searchAgency", Objects.toString(jsonObject.get("searchAgency")));
-            map.put("result", "0000");
-            map.put("splitTime", DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN) + "-"
-                    + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN));
-            split.add(map);
-        });
-        req.put("serialNumberSplits", split);
+        String jobState = status[RandomUtil.randomInt(0, 6)];
+        req.put("jobState", jobState);
+        if (Objects.equals(jobState, "success")) {
+            List<Map<String, String>> split = new ArrayList<>();
+            List<Map<String, String>> list = jsonObject.get("list", List.class);
+            list.forEach(e -> {
+                Map<String, String> map = new HashMap<>();
+                map.put("applicationid", IdUtil.fastSimpleUUID());
+                map.put("data", e.get("accountNo"));
+                map.put("searchAgency", Objects.toString(jsonObject.get("searchAgency")));
+                map.put("result", "0000");
+                map.put("splitTime", DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN) + "-"
+                        + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN));
+                split.add(map);
+            });
+            req.put("serialNumberSplits", split);
+        }
         result.put("reqJson", req);
         return JSONUtil.toJsonStr(result);
     }
@@ -292,22 +301,25 @@ public class FindTask {
         Map<String, Object> req = new HashMap<>();
         req.put("recordId", jsonObject.get("groupId"));
         req.put("groupId", jsonObject.get("groupId"));
-        req.put("jobState", "success");
-        List<Map<String, String>> split = new ArrayList<>();
-        List<Map<String, String>> list = jsonObject.get("list", List.class);
-        list.forEach(e -> {
-            Map<String, String> map = new HashMap<>();
-            map.put("applicationid", IdUtil.fastSimpleUUID());
-            map.put("data", e.get("accountNo"));
-            map.put("searchAgency", Objects.toString(jsonObject.get("searchAgency")));
-            map.put("peopleName", e.get("peopleName"));
-            map.put("result", "0000");
-            map.put("accountSearchType", e.get("accountSearchType"));
-            map.put("splitTime", DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN) + "-"
-                    + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN));
-            split.add(map);
-        });
-        req.put("allAccountSplits", split);
+        String jobState = status[RandomUtil.randomInt(0, 6)];
+        req.put("jobState", jobState);
+        if (Objects.equals(jobState, "success")) {
+            List<Map<String, String>> split = new ArrayList<>();
+            List<Map<String, String>> list = jsonObject.get("list", List.class);
+            list.forEach(e -> {
+                Map<String, String> map = new HashMap<>();
+                map.put("applicationid", IdUtil.fastSimpleUUID());
+                map.put("data", e.get("accountNo"));
+                map.put("searchAgency", Objects.toString(jsonObject.get("searchAgency")));
+                map.put("peopleName", e.get("peopleName"));
+                map.put("result", "0000");
+                map.put("accountSearchType", e.get("accountSearchType"));
+                map.put("splitTime", DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN) + "-"
+                        + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN));
+                split.add(map);
+            });
+            req.put("allAccountSplits", split);
+        }
         result.put("reqJson", req);
         return JSONUtil.toJsonStr(result);
     }
@@ -321,22 +333,25 @@ public class FindTask {
         Map<String, Object> req = new HashMap<>();
         req.put("recordId", jsonObject.get("groupId"));
         req.put("groupId", jsonObject.get("groupId"));
-        req.put("jobState", status[RandomUtil.randomInt(0, 6)]);
-        List<Map<String, String>> split = new ArrayList<>();
-        List<Map<String, String>> list = jsonObject.get("list", List.class);
-        list.forEach(e -> {
-            Map<String, String> map = new HashMap<>();
-            map.put("applicationid", IdUtil.fastSimpleUUID());
-            map.put("result", "0000");
-            map.put("maninBodyType", e.get("maninBodyType"));
-            map.put("accountNo", e.get("accountNo"));
-            map.put("accountName", e.get("accountName"));
-            map.put("bankName", Objects.toString(jsonObject.get("bankname")));
-            map.put("splitTime", DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN) + "-"
-                    + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN));
-            split.add(map);
-        });
-        req.put("bankAllAccountSplits", split);
+        String jobState = status[RandomUtil.randomInt(0, 6)];
+        req.put("jobState", jobState);
+        if (Objects.equals(jobState, "success")) {
+            List<Map<String, String>> split = new ArrayList<>();
+            List<Map<String, String>> list = jsonObject.get("list", List.class);
+            list.forEach(e -> {
+                Map<String, String> map = new HashMap<>();
+                map.put("applicationid", IdUtil.fastSimpleUUID());
+                map.put("result", "0000");
+                map.put("maninBodyType", e.get("maninBodyType"));
+                map.put("accountNo", e.get("accountNo"));
+                map.put("accountName", e.get("accountName"));
+                map.put("bankName", Objects.toString(jsonObject.get("bankname")));
+                map.put("splitTime", DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN) + "-"
+                        + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN));
+                split.add(map);
+            });
+            req.put("bankAllAccountSplits", split);
+        }
         result.put("reqJson", req);
         return JSONUtil.toJsonStr(result);
     }
@@ -419,12 +434,21 @@ public class FindTask {
         result.put("methodType", "bankResult");
         Map<String, Object> req = new HashMap<>();
         req.put("applicationId", param.get("applicationid"));
-        req.put("status", SPLIT_RESULT[RandomUtil.randomInt(0, 10)]);
-        req.put("valueCount", RandomUtil.randomInt(0, 10000));
-        result.put("reqJson", req);
-        FileUtil.copy(FileUtil.file("excel/6226890438342486.xlsx")
-                , FileUtil.file(Objects.toString(param.get("file_path")))
-                , true);
+        String splitResult = SPLIT_RESULT[RandomUtil.randomInt(0, 10)];
+        req.put("status", splitResult);
+        if (Objects.equals(splitResult, "机构已反馈")) {
+            req.put("valueCount", RandomUtil.randomInt(0, 10000));
+            result.put("reqJson", req);
+            FileUtil.copy(FileUtil.file("excel/流水文件.xlsx")
+                    , FileUtil.file(Objects.toString(param.get("file_path")))
+                    , true);
+        } else {
+            req.put("valueCount", 0);
+            result.put("reqJson", req);
+            FileUtil.copy(FileUtil.file("excel/流水空文件.xlsx")
+                    , FileUtil.file(Objects.toString(param.get("file_path")))
+                    , true);
+        }
         return JSONUtil.toJsonStr(result);
     }
 
@@ -437,12 +461,21 @@ public class FindTask {
         result.put("methodType", "thirdResult");
         Map<String, Object> req = new HashMap<>();
         req.put("applicationId", param.get("applicationid"));
-        req.put("status", SPLIT_RESULT[RandomUtil.randomInt(0, 10)]);
-        req.put("valueCount", RandomUtil.randomInt(0, 10000));
-        result.put("reqJson", req);
-        FileUtil.copy(FileUtil.file("excel/6226890438342486.xlsx")
-                , FileUtil.file(Objects.toString(param.get("file_path")))
-                , true);
+        String splitResult = SPLIT_RESULT[RandomUtil.randomInt(0, 10)];
+        req.put("status", splitResult);
+        if (Objects.equals(splitResult, "机构已反馈")) {
+            req.put("valueCount", RandomUtil.randomInt(0, 10000));
+            result.put("reqJson", req);
+            FileUtil.copy(FileUtil.file("excel/流水文件.xlsx")
+                    , FileUtil.file(Objects.toString(param.get("file_path")))
+                    , true);
+        } else {
+            req.put("valueCount", 0);
+            result.put("reqJson", req);
+            FileUtil.copy(FileUtil.file("excel/流水空文件.xlsx")
+                    , FileUtil.file(Objects.toString(param.get("file_path")))
+                    , true);
+        }
         return JSONUtil.toJsonStr(result);
     }
 
@@ -455,12 +488,21 @@ public class FindTask {
         result.put("methodType", "serialResult");
         Map<String, Object> req = new HashMap<>();
         req.put("applicationId", param.get("applicationid"));
-        req.put("status", SPLIT_RESULT[RandomUtil.randomInt(0, 10)]);
-        req.put("valueCount", RandomUtil.randomInt(0, 10000));
-        result.put("reqJson", req);
-        FileUtil.copy(FileUtil.file("excel/6226890438342486.xlsx")
-                , FileUtil.file(Objects.toString(param.get("file_path")))
-                , true);
+        String splitResult = SPLIT_RESULT[RandomUtil.randomInt(0, 10)];
+        req.put("status", splitResult);
+        if (Objects.equals(splitResult, "机构已反馈")) {
+            req.put("valueCount", RandomUtil.randomInt(0, 10000));
+            result.put("reqJson", req);
+            FileUtil.copy(FileUtil.file("excel/流水文件.xlsx")
+                    , FileUtil.file(Objects.toString(param.get("file_path")))
+                    , true);
+        } else {
+            req.put("valueCount", 0);
+            result.put("reqJson", req);
+            FileUtil.copy(FileUtil.file("excel/流水空文件.xlsx")
+                    , FileUtil.file(Objects.toString(param.get("file_path")))
+                    , true);
+        }
         return JSONUtil.toJsonStr(result);
     }
 
@@ -476,12 +518,21 @@ public class FindTask {
         result.put("combineSearchEnd", "2025-05-05");
         Map<String, Object> req = new HashMap<>();
         req.put("applicationId", param.get("applicationid"));
-        req.put("status","机构已反馈");
-        req.put("valueCount", RandomUtil.randomInt(0, 10000));
-        result.put("reqJson", req);
-//        FileUtil.copy(FileUtil.file("excel/6226890438342486.xlsx")
-//                , FileUtil.file(Objects.toString(param.get("file_path")))
-//                , true);
+        String splitResult = SPLIT_RESULT[RandomUtil.randomInt(0, 10)];
+        req.put("status", splitResult);
+        if (Objects.equals(splitResult, "机构已反馈")) {
+            req.put("valueCount", RandomUtil.randomInt(0, 10000));
+            result.put("reqJson", req);
+            FileUtil.copy(FileUtil.file("excel/第三方全账户.xlsx")
+                    , FileUtil.file(Objects.toString(param.get("file_path")))
+                    , true);
+        } else {
+            req.put("valueCount", 0);
+            result.put("reqJson", req);
+            FileUtil.copy(FileUtil.file("excel/第三方全账户空文件.xlsx")
+                    , FileUtil.file(Objects.toString(param.get("file_path")))
+                    , true);
+        }
         return JSONUtil.toJsonStr(result);
     }
 
@@ -497,10 +548,21 @@ public class FindTask {
         result.put("combineSearchEnd", "2025-05-05");
         Map<String, Object> req = new HashMap<>();
         req.put("applicationId", param.get("applicationid"));
-        req.put("status", "机构已反馈");
-        req.put("valueCount", RandomUtil.randomInt(0, 10000));
-        result.put("reqJson", req);
-
+        String splitResult = SPLIT_RESULT[RandomUtil.randomInt(0, 10)];
+        req.put("status", splitResult);
+        if (Objects.equals(splitResult, "机构已反馈")) {
+            req.put("valueCount", RandomUtil.randomInt(0, 10000));
+            result.put("reqJson", req);
+            FileUtil.copy(FileUtil.file("excel/银行卡全账户.xlsx")
+                    , FileUtil.file(Objects.toString(param.get("file_path")))
+                    , true);
+        } else {
+            req.put("valueCount", 0);
+            result.put("reqJson", req);
+            FileUtil.copy(FileUtil.file("excel/银行卡全账户空文件.xlsx")
+                    , FileUtil.file(Objects.toString(param.get("file_path")))
+                    , true);
+        }
         return JSONUtil.toJsonStr(result);
     }
 

BIN
src/main/resources/excel/6226890438342486.xlsx