Selaa lähdekoodia

#20250528 1 银行卡主体更新 2 删除多余项目

yanjunjie 1 kuukausi sitten
vanhempi
commit
53bc042cb7

+ 0 - 33
client/.gitignore

@@ -1,33 +0,0 @@
-HELP.md
-target/
-!.mvn/wrapper/maven-wrapper.jar
-!**/src/main/**/target/
-!**/src/test/**/target/
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-build/
-!**/src/main/**/build/
-!**/src/test/**/build/
-
-### VS Code ###
-.vscode/

+ 0 - 114
client/pom.xml

@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>com.juxin</groupId>
-    <artifactId>client</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-    <name>client</name>
-    <description>client</description>
-    <properties>
-        <java.version>1.8</java.version>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-        <spring-boot.version>2.6.13</spring-boot.version>
-    </properties>
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-websocket</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>cn.hutool</groupId>
-            <artifactId>hutool-all</artifactId>
-            <version>5.8.32</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-            <optional>true</optional>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-devtools</artifactId>
-        </dependency>
-
-    </dependencies>
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-dependencies</artifactId>
-                <version>${spring-boot.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.8.1</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                    <encoding>UTF-8</encoding>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>${spring-boot.version}</version>
-                <configuration>
-                    <mainClass>com.juxin.client.ClientApplication</mainClass>
-                    <skip>true</skip>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>repackage</id>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-
-
-            </plugin>
-
-
-                <plugin>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-maven-plugin</artifactId>
-                    <version>2.6.13</version><!--  自己的SpingBoot版本   -->
-                    <configuration>
-                        <!--  自己的启动类地址   -->
-                        <mainClass>com.juxin.client.ClientApplication</mainClass>
-                    </configuration>
-                    <executions>
-                        <execution>
-                            <id>repackage</id>
-                            <goals>
-                                <goal>repackage</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                </plugin>
-
-
-
-        </plugins>
-    </build>
-
-</project>

+ 0 - 15
client/src/main/java/com/juxin/client/ClientApplication.java

@@ -1,15 +0,0 @@
-package com.juxin.client;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.scheduling.annotation.EnableScheduling;
-
-@SpringBootApplication
-@EnableScheduling
-public class ClientApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(ClientApplication.class, args);
-    }
-
-}

+ 0 - 508
client/src/main/java/com/juxin/client/websocket/FindTask.java

@@ -1,508 +0,0 @@
-package com.juxin.client.websocket;
-
-import cn.hutool.core.date.DatePattern;
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.io.FileUtil;
-import cn.hutool.core.util.IdUtil;
-import cn.hutool.core.util.RandomUtil;
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-import com.juxin.client.websocket.constant.GfConstants;
-import com.juxin.client.websocket.enums.WebsocketTypeEnum;
-import com.juxin.client.websocket.ppojo.WebsocketInfo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-import org.springframework.util.StringUtils;
-import org.springframework.web.socket.client.WebSocketClient;
-
-import javax.annotation.PostConstruct;
-import javax.websocket.ContainerProvider;
-import javax.websocket.Session;
-import javax.websocket.WebSocketContainer;
-import java.net.URI;
-import java.util.*;
-
-@Component
-public class FindTask {
-    public static String Address1 = "ws://127.0.0.1:9990/pythonInteractive/websocket/pythonClient";
-
-    public static final String[] status = {"success", "success", "fail", "success", "success", "stop", "success"};
-    //机构已反馈 机构暂未反馈 机构反馈失败,失败原因xxx   国反异常,获取结果失败
-    public static final String[] SPLIT_RESULT =
-            {"机构已反馈", "机构暂未反馈", "机构反馈失败,失败原因1", "机构已反馈",
-                    "国反异常,获取结果失败", "机构已反馈",
-                    "机构反馈失败,失败原因2", "机构已反馈", "机构反馈失败,失败原因3", "机构已反馈", "机构已反馈"};
-
-    @Autowired
-    private com.juxin.client.websocket.WebSocketClient client;
-
-
-    public void init() {
-        try {
-            WebSocketContainer container = ContainerProvider.getWebSocketContainer();
-            client = new com.juxin.client.websocket.WebSocketClient();
-            Session session = container.connectToServer(client, new URI(Address1));
-            client.setUserSession(session);
-//            client.sendMessage("{ \"infoType\": \"heart\", \"postType\": \"python\", \"methodType\": \"heart\", \"reqJson\": { \"receiveJobStatus\": \"1\", \"msg\": \"ping\" } }");
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Scheduled(cron = "*/20 * * * * ?")
-    public void heart() throws Exception {
-        if (client == null || client.getUserSession() == null) {
-            init();
-        }
-        try {
-            // 发送消息
-            client.sendMessage("{ \"infoType\": \"heart\", \"postType\": \"python\", \"methodType\": \"heart\", \"reqJson\": { \"receiveJobStatus\": \"1\", \"msg\": \"ping\" } }");
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Scheduled(cron = "*/5 * * * * ?")
-    public void findResultTask() {
-        if (client == null || client.getUserSession() == null) {
-            return;
-        }
-        if (!GfConstants.FIND_RESULT_FLAG) {
-            System.out.println("不具备获取结果状态,获取任务标志为false,证明有回捞任务在运行中**********************************");
-            return;
-        }
-        try {
-            // 发送消息
-            client.sendMessage("{ \"infoType\": \"getResultQueueJob\", \"postType\": \"python\", \"methodType\": \"getResultQueueJob\" }");
-            GfConstants.FIND_RESULT_FLAG = false;
-            // 保持连接一段时间
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-
-    @Scheduled(cron = "*/20 * * * * ?")
-    public void findTask() {
-        if (client == null || client.getUserSession() == null) {
-            return;
-        }
-        if (!GfConstants.FIND_FLAG) {
-            System.out.println("不具备获取任务状态,获取任务标志为false,证明有任务在运行中**********************************");
-            return;
-        }
-        try {
-            // 发送消息
-            client.sendMessage("{ \"infoType\": \"getQueueJob\", \"postType\": \"python\", \"methodType\": \"getQueueJob\" }");
-            GfConstants.FIND_FLAG = false;
-            // 保持连接一段时间
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    public void dealTask(String message) {
-        try {
-            String result = "";
-            WebsocketInfo bean = JSONUtil.toBean(message, WebsocketInfo.class);
-            WebsocketTypeEnum enumByType = WebsocketTypeEnum.getEnumByType(bean.getInfoType());
-            int i = RandomUtil.randomInt(0, 3);
-            System.out.println("开始睡眠,睡眠时间" + i + "*********************************************");
-            //Thread.sleep(i * 1000);
-            switch (enumByType) {
-                case COMMIT_MSG:
-                    result = commitTask(bean);
-                    if (result == null || result == "") {
-                        GfConstants.FIND_FLAG = true;
-                    } else {
-                        try {
-                            client.sendMessage(result);
-                        } finally {
-                            GfConstants.FIND_FLAG = true;
-                        }
-                    }
-                    break;
-                case RESULT_LIST_MSG:
-                    result = searchTask(bean);
-                    if (result == "") {
-                        System.out.println("无回捞结果任务");
-                        return;
-                    }
-                    try {
-                        client.sendMessage(result);
-                    } finally {
-                        GfConstants.FIND_RESULT_FLAG = true;
-                    }
-                    break;
-                case GET_RESULT_QUEUE_JOB:
-                    result = searchTask(bean);
-                    if (result == "") {
-                        return;
-                    }
-                    break;
-                case ALARM_DATA:
-                    result = alarmWork(bean);
-                    if (result == "") {
-                        return;
-                    }
-                    break;
-                default:
-                    return;
-            }
-        } catch (Exception e) {
-            System.out.println("出现位置异常*******************:" + message);
-            throw new RuntimeException(e);
-        }
-
-    }
-
-    /**
-     * 提交任务
-     *
-     * @param bean
-     * @return
-     */
-    public String commitTask(WebsocketInfo bean) {
-        String result = "";
-        String methodType = bean.getMethodType();
-        Object reqJson = bean.getReqJson();
-        if (Objects.isNull(reqJson) || reqJson == "") {
-            return result;
-        }
-        if (StrUtil.isBlankIfStr(methodType) || StrUtil.isBlankIfStr(reqJson) || reqJson == "" || reqJson == null) {
-            return result;
-        }
-        switch (methodType) {
-            case "bankCommit":
-                result = bankCommitTask(reqJson);
-                break;
-            case "thirdCommit":
-                result = thirdCommitTask(reqJson);
-                break;
-            case "serialCommit":
-                result = serialCommitTask(reqJson);
-                break;
-            case "allAccountCommit":
-                result = allAccountCommitTask(reqJson);
-                break;
-            case "bankAllAccountCommit":
-                result = bankAllAccountCommitTask(reqJson);
-                break;
-            default:
-                break;
-        }
-        return result;
-    }
-
-    public String bankCommitTask(Object reqJson) {
-        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
-        Map<String, Object> result = new HashMap<>();
-        result.put("infoType", "over");
-        result.put("postType", "python");
-        result.put("methodType", "bankCommit");
-        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);
-        result.put("reqJson", req);
-        return JSONUtil.toJsonStr(result);
-    }
-
-    public String thirdCommitTask(Object reqJson) {
-        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
-        Map<String, Object> result = new HashMap<>();
-        result.put("infoType", "over");
-        result.put("postType", "python");
-        result.put("methodType", "thirdCommit");
-        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("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);
-    }
-
-    public String serialCommitTask(Object reqJson) {
-        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
-        Map<String, Object> result = new HashMap<>();
-        result.put("infoType", "over");
-        result.put("postType", "python");
-        result.put("methodType", "serialCommit");
-        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);
-        result.put("reqJson", req);
-        return JSONUtil.toJsonStr(result);
-    }
-
-    public String allAccountCommitTask(Object reqJson) {
-        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
-        Map<String, Object> result = new HashMap<>();
-        result.put("infoType", "over");
-        result.put("postType", "python");
-        result.put("methodType", "allAccountCommit");
-        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("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);
-    }
-
-    public String bankAllAccountCommitTask(Object reqJson) {
-        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
-        Map<String, Object> result = new HashMap<>();
-        result.put("infoType", "over");
-        result.put("postType", "python");
-        result.put("methodType", "bankAllAccountCommit");
-        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);
-        result.put("reqJson", req);
-        return JSONUtil.toJsonStr(result);
-    }
-
-    /**
-     * 回捞任务
-     *
-     * @param bean
-     * @return
-     */
-    public String searchTask(WebsocketInfo bean) {
-        String result = "";
-        String methodType = bean.getMethodType();
-        if (methodType == null || methodType.equals("")) {
-            return result;
-        }
-        Object reqJson = bean.getReqJson();
-        switch (methodType) {
-            case "bankResult":
-                result = bankResultTask(reqJson);
-                break;
-            case "thirdResult":
-                result = thirdResultTask(reqJson);
-                break;
-            case "serialResult":
-                result = serialResultTask(reqJson);
-                break;
-            case "allAccountResult":
-                result = allAccountResultTask(reqJson);
-                break;
-            case "bankAllAccountResult":
-                result = bankAllAccountResultTask(reqJson);
-                break;
-            default:
-                break;
-        }
-        return result;
-    }
-
-    public String bankResultTask(Object reqJson) {
-        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
-        JSONObject param = jsonObject.get("params", JSONObject.class);
-        Map<String, Object> result = new HashMap<>();
-        result.put("infoType", "result");
-        result.put("postType", "python");
-        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);
-        return JSONUtil.toJsonStr(result);
-    }
-
-    public String thirdResultTask(Object reqJson) {
-        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
-        JSONObject param = jsonObject.get("params", JSONObject.class);
-        Map<String, Object> result = new HashMap<>();
-        result.put("infoType", "result");
-        result.put("postType", "python");
-        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);
-        return JSONUtil.toJsonStr(result);
-    }
-
-    public String serialResultTask(Object reqJson) {
-        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
-        JSONObject param = jsonObject.get("params", JSONObject.class);
-        Map<String, Object> result = new HashMap<>();
-        result.put("infoType", "result");
-        result.put("postType", "python");
-        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);
-        return JSONUtil.toJsonStr(result);
-    }
-
-    public String allAccountResultTask(Object reqJson) {
-        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
-        JSONObject param = jsonObject.get("params", JSONObject.class);
-        Map<String, Object> result = new HashMap<>();
-        result.put("infoType", "result");
-        result.put("postType", "python");
-        result.put("methodType", "allAccountResult");
-        result.put("combineSearchFlag", Objects.toString(jsonObject.get("combineSearchFlag")));
-        result.put("combineSearchStart", Objects.toString(jsonObject.get("combineSearchStart")));
-        result.put("combineSearchEnd", Objects.toString(jsonObject.get("combineSearchEnd")));
-        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);
-        return JSONUtil.toJsonStr(result);
-    }
-
-    public String bankAllAccountResultTask(Object reqJson) {
-        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
-        JSONObject param = jsonObject.get("params", JSONObject.class);
-        Map<String, Object> result = new HashMap<>();
-        result.put("infoType", "result");
-        result.put("postType", "python");
-        result.put("methodType", "bankAllAccountResult");
-        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);
-        return JSONUtil.toJsonStr(result);
-    }
-
-    public static void main(String[] args) {
-        FileUtil.copy(FileUtil.file("excel/6226890438342486.xlsx")
-                , FileUtil.file("C:\\Users\\EDY\\Desktop\\需求\\银行卡查询\\test.xlsx")
-                , true);
-    }
-
-
-    public String alarmWork(WebsocketInfo bean) {
-        String methodType = bean.getMethodType();
-        if (methodType == null || methodType.equals("")) {
-            return "";
-        }
-        Object reqJson = bean.getReqJson();
-        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
-        Map<String, Object> result = new HashMap<>();
-        result.put("infoType", "alarmData");
-        result.put("postType", "python");
-        result.put("methodType", "bankCommit");
-        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);
-//        result.put("reqJson", req);
-        return JSONUtil.toJsonStr(result);
-    }
-}

+ 0 - 34
client/src/main/java/com/juxin/client/websocket/SpringUtil.java

@@ -1,34 +0,0 @@
-package com.juxin.client.websocket;
-
-
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.stereotype.Component;
-
-@Component
-public class SpringUtil implements ApplicationContextAware {
-    private static ApplicationContext applicationContext;
-
-    @Override
-    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
-        SpringUtil.applicationContext = applicationContext;
-    }
-
-    public static ApplicationContext getApplicationContext() {
-        return applicationContext;
-    }
-
-    public static Object getBean(String name) {
-        return applicationContext.getBean(name);
-    }
-
-    public static <T> T getBean(Class<T> clazz) {
-        try {
-            return (T)applicationContext.getBean(clazz);
-        }catch (BeansException e) {
-            return null;
-        }
-    }
-}

+ 0 - 71
client/src/main/java/com/juxin/client/websocket/WebSocketClient.java

@@ -1,71 +0,0 @@
-package com.juxin.client.websocket;
-
-
-import com.juxin.client.websocket.constant.GfConstants;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.stereotype.Component;
-
-import javax.websocket.*;
-import java.io.IOException;
-
-@ClientEndpoint
-@Component
-public class WebSocketClient {
-    private volatile Session userSession = null;
-
-    public Session getUserSession() {
-        return userSession;
-    }
-
-    public void setUserSession(Session userSession) {
-        this.userSession = userSession;
-    }
-
-    @OnOpen
-    public void onOpen(Session userSession) throws IOException {
-        System.out.println("Opening websocket");
-        this.userSession = userSession;
-        System.out.println("Connected to endpoint: " + userSession.getBasicRemote());
-    }
-
-    @OnClose
-    public void onClose(Session userSession, CloseReason reason) {
-        System.out.println("Closing websocket");
-        this.userSession = null;
-        GfConstants.FIND_FLAG = true;
-        GfConstants.FIND_RESULT_FLAG = true;
-        try {
-            // 发送消息
-            sendMessage("{ \"infoType\": \"getResultQueueJob\", \"postType\": \"python\", \"methodType\": \"getResultQueueJob\" }");
-            GfConstants.FIND_RESULT_FLAG = false;
-            // 保持连接一段时间
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    @OnMessage
-    public void onMessage(String message) {
-
-        System.out.println("Received message: " + message);
-        if(userSession == null) {
-            return;
-        }
-        try {
-            SpringUtil.getBean(FindTask.class).dealTask(message);
-        } finally {
-            GfConstants.FIND_FLAG = true;
-            GfConstants.FIND_RESULT_FLAG = true;
-        }
-
-    }
-
-    public void sendMessage(String message) throws InterruptedException {
-        Thread.sleep(200);
-        synchronized (WebSocketClient.class) {
-            this.userSession.getAsyncRemote().sendText(message);
-        }
-        System.out.println("send message: " + message);
-    }
-}

+ 0 - 22
client/src/main/java/com/juxin/client/websocket/constant/GfConstants.java

@@ -1,22 +0,0 @@
-package com.juxin.client.websocket.constant;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * GF常量类
- */
-@Component
-public class GfConstants {
-    /**
-     * 银行卡资金流水查询提交
-     */
-    public static boolean FIND_FLAG = true;
-
-    public static boolean FIND_RESULT_FLAG = true;
-
-
-}

+ 0 - 148
client/src/main/java/com/juxin/client/websocket/enums/CaseFlowEnum.java

@@ -1,148 +0,0 @@
-package com.juxin.client.websocket.enums;
-
-/**
- * 案件流程枚举
- */
-public enum CaseFlowEnum {
-
-    BANK_CARD_FUNDS_COMMIT("银行卡资金查询提交", 1, "rpa_bank_card_funds_case", "rpa_bank_card_funds_process"),
-    THIRD_PARTY_ALL_ACCOUNT_COMMIT("第三方全账户主体查询提交", 2, "rpa_third_party_all_account", "rpa_third_party_all_account_group"),
-    SERIAL_NUMBER_COMMIT("流水号资金查询提交", 3, "rpa_serial_number", "rpa_serial_number_group"),
-    THIRD_FUNDS_COMMIT("第三方资金查询提交", 4, "rpa_third_funds_commit_case", "rpa_third_funds_commit_group"),
-    BANK_CARD_FUNDS_SPLIT_RESULT("银行卡资金结果查询参数拆分", 5, "rpa_bank_card_funds_split", ""),
-    THIRD_FUNDS_SPLIT_RESULT("第三方资金结果查询参数拆分", 6, "rpa_third_funds_split", ""),
-    THIRD_PARTY_ALL_ACCOUNT_SPLIT_RESULT("第三方全账户资金结果查询参数拆分", 7, "rpa_third_party_all_account_split", ""),
-    SERIAL_NUMBER_SPLIT_RESULT("流水号资金结果查询参数拆分", 8, "rpa_serial_number_split", "");
-    /**
-     * 流程名称
-     */
-    private String processName;
-    /**
-     * 流程id
-     */
-    private Integer processId;
-    /**
-     * 主表名称
-     */
-    private String mainTable;
-    /**
-     * 分组表名称
-     */
-    private String groupTable;
-
-    CaseFlowEnum(String processName, Integer processId, String mainTable, String groupTable) {
-        this.processName = processName;
-        this.processId = processId;
-        this.mainTable = mainTable;
-        this.groupTable = groupTable;
-    }
-
-    public String getProcessName() {
-        return processName;
-    }
-
-    public void setProcessName(String processName) {
-        this.processName = processName;
-    }
-
-    public Integer getProcessId() {
-        return processId;
-    }
-
-    public void setProcessId(Integer processId) {
-        this.processId = processId;
-    }
-
-    public String getMainTable() {
-        return mainTable;
-    }
-
-    public void setMainTable(String mainTable) {
-        this.mainTable = mainTable;
-    }
-
-    public String getGroupTable() {
-        return groupTable;
-    }
-
-    public void setGroupTable(String groupTable) {
-        this.groupTable = groupTable;
-    }
-
-    /**
-     * 根据流程名获取流程id
-     *
-     * @param processName
-     * @return
-     */
-    public static Integer getProcessId(String processName) {
-        for (CaseFlowEnum flowEnum : CaseFlowEnum.values()) {
-            if (processName.equals(flowEnum.getProcessName())) {
-                return flowEnum.getProcessId();
-            }
-        }
-        return 0;
-    }
-
-    /**
-     * 根据流程id获取流程名
-     *
-     * @param processId
-     * @return
-     */
-    public static String getProcessName(Integer processId) {
-        for (CaseFlowEnum flowEnum : CaseFlowEnum.values()) {
-            if (processId == flowEnum.getProcessId()) {
-                return flowEnum.getProcessName();
-            }
-        }
-        return null;
-    }
-
-    public static CaseFlowEnum getCaseFlowEnum(Integer processId) {
-        for (CaseFlowEnum flowEnum : CaseFlowEnum.values()) {
-            if (processId == flowEnum.getProcessId()) {
-                return flowEnum;
-            }
-        }
-        return null;
-    }
-
-    public static CaseFlowEnum getCaseFlowEnumByName(String processName) {
-        for (CaseFlowEnum flowEnum : CaseFlowEnum.values()) {
-            if (processName.equals(flowEnum.getProcessName())) {
-                return flowEnum;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * 校验当前流程是否为提交查询流程
-     *
-     * @param processId
-     * @return
-     */
-    public static Boolean judgeProcessIsCommit(Integer processId) {
-        if (BANK_CARD_FUNDS_COMMIT.getProcessId() == processId ||
-                THIRD_PARTY_ALL_ACCOUNT_COMMIT.getProcessId() == processId ||
-                SERIAL_NUMBER_COMMIT.getProcessId() == processId ||
-                THIRD_FUNDS_COMMIT.getProcessId() == processId) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * 流程类型判断 1查询流程  2查询结果流程
-     * @return
-     */
-    public static int flowType(CaseFlowEnum flowEnum) {
-      if(flowEnum == BANK_CARD_FUNDS_COMMIT || flowEnum == THIRD_PARTY_ALL_ACCOUNT_COMMIT
-      || flowEnum == SERIAL_NUMBER_COMMIT || flowEnum == THIRD_FUNDS_COMMIT) {
-           return 1;
-      }else {
-          return 2;
-      }
-    }
-}

+ 0 - 85
client/src/main/java/com/juxin/client/websocket/enums/PythonJavaWebsocketEnum.java

@@ -1,85 +0,0 @@
-package com.juxin.client.websocket.enums;
-
-public enum PythonJavaWebsocketEnum {
-
-
-//    //    运行状态更新
-//    STATE_RUNNING_MSG("stateRunningMsg", "流程开始运行更新", -1),
-//    STATE_OVER_MSG("stateOverMsg", "流程运行状态更新", -1),
-
-    //资金查询流程启动
-    BANK_CARD_FUNDS_COMMIT("bankCommit", "提交银行卡流水查询", 1),
-    THIRD_PARTY_ALL_ACCOUNT_COMMIT("allAccountCommit", "提交第三方全账户查询", 2),
-    SERIAL_NUMBER_COMMIT("serialCommit", "提交流水号查询", 3),
-    THIRD_FUNDS_COMMIT("thirdCommit", "提交第三方账户查询", 4),
-    //    资金查询流程结束返回分割数据入库
-//    COMMIT_DATA_POST_BACK("commitDataPostBack", "查询提交切割数据返回", -1),
-
-    //     java发起查询列表 4
-    BANK_CARD_FUNDS_SEARCH_LIST("bankList", "获取银行卡查询提交列表", -1),
-    THIRD_FUNDS_SEARCH_LIST("thirdList", "获取第三方查询提交列表", -1),
-    SERIAL_NUMBER_SEARCH_LIST("serialList", "获取流水号查询提交列表", -1),
-    THIRD_PARTY_ALL_ACCOUNT_SEARCH_LIST("allAccountList", "获取第三方全账户查询提交列表", -1),
-
-    //java发起最终数据回捞 4
-    BANK_CARD_FUNDS_SPLIT_RESULT("bankResult", "银行卡资金数据回捞", 5),
-    THIRD_FUNDS_SPLIT_RESULT("thirdResult", "第三方资金数据回捞", 6),
-    THIRD_PARTY_ALL_ACCOUNT_SPLIT_RESULT("allAccountResult", "第三方全账户资金数据回捞", 7),
-    SERIAL_NUMBER_SPLIT_RESULT("serialResult", "流水号资金结果数据回捞", 8),
-//    SPLIT_DATA_POST_BACK("splitDataPostBack", "回捞结果数据返回", -1)
-//    java接收最终数据回捞结果 4
-    ;
-    /**
-     * websocket 识别标识
-     */
-    private String typeName;
-    /**
-     * 对应具体业务方法名称
-     */
-    private String methodName;
-
-    /**
-     * 流程id
-     */
-    private Integer processId;
-
-    PythonJavaWebsocketEnum(String typeName, String methodName, Integer processId) {
-        this.typeName = typeName;
-        this.methodName = methodName;
-        this.processId = processId;
-    }
-
-    public String getTypeName() {
-        return typeName;
-    }
-
-    public void setTypeName(String typeName) {
-        this.typeName = typeName;
-    }
-
-    public String getMethodName() {
-        return methodName;
-    }
-
-    public void setMethodName(String methodName) {
-        this.methodName = methodName;
-    }
-
-    public Integer getProcessId() {
-        return processId;
-    }
-
-    public void setProcessId(Integer processId) {
-        this.processId = processId;
-    }
-
-    public static PythonJavaWebsocketEnum getWebsocketEnumByType(String typeName) {
-        for (PythonJavaWebsocketEnum flowEnum : PythonJavaWebsocketEnum.values()) {
-            if (flowEnum.getTypeName().equals(typeName)) {
-                return flowEnum;
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 59
client/src/main/java/com/juxin/client/websocket/enums/WebsocketTypeEnum.java

@@ -1,59 +0,0 @@
-package com.juxin.client.websocket.enums;
-
-public enum WebsocketTypeEnum {
-
-    ONLINE_MSG("online","websocket上线消息"),
-    CONNECT_MSG("connect","websocket连接消息"),
-    HEART_MSG("heart","websocket心跳消息"),
-    COMMIT_MSG("commit", "提交查询流程"),
-    OVER_MSG("over", "结束查询流程"),
-    SEARCH_LIST_MSG("list", "查询列表流程"),
-    RESULT_LIST_MSG("result", "结果流程"),
-    LICENSE_MSG("license", "许可"),
-    CLOSE_PYTHON("closePython","关闭python服务"),
-    ALARM_DATA("alarmData","预警数据"),
-    STOP_PAY("stopPay","预警止付"),
-    STOP_PAY_UPDATE("stopPayUpdate","预警止付更新"),
-    LOG_MSG("logMsg", "日志传输"),
-    GET_QUEUE_JOB("getQueueJob","获取执行队列任务"),
-    GET_RESULT_QUEUE_JOB("getResultQueueJob","获取回捞结果任务")
-    ;
-    /**
-     * websocket 识别标识
-     */
-    private String typeName;
-    /**
-     * 对应具体业务方法名称
-     */
-    private String methodName;
-
-    WebsocketTypeEnum(String typeName, String methodName) {
-        this.typeName = typeName;
-        this.methodName = methodName;
-    }
-
-    public String getTypeName() {
-        return typeName;
-    }
-
-    public void setTypeName(String typeName) {
-        this.typeName = typeName;
-    }
-
-    public String getMethodName() {
-        return methodName;
-    }
-
-    public void setMethodName(String methodName) {
-        this.methodName = methodName;
-    }
-
-    public static WebsocketTypeEnum getEnumByType(String typeName) {
-        for (WebsocketTypeEnum typeEnum : WebsocketTypeEnum.values()) {
-            if (typeEnum.getTypeName().equals(typeName)) {
-                return typeEnum;
-            }
-        }
-        return null;
-    }
-}

+ 0 - 33
client/src/main/java/com/juxin/client/websocket/ppojo/WebsocketInfo.java

@@ -1,33 +0,0 @@
-package com.juxin.client.websocket.ppojo;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * websocket消息传输对象
- */
-@Data
-@Builder
-@AllArgsConstructor
-@NoArgsConstructor
-public class WebsocketInfo {
-    /**
-     * websocket 识别标识 消息类型
-     */
-    private String infoType;
-    /**
-     *  java 调用python  还是python调用 java
-     */
-    private String postType;
-    /**
-     * 流程方法类型
-     */
-    private String methodType;
-
-    /**
-     * 最终入参Json
-     */
-    private Object reqJson;
-}

+ 0 - 2
client/src/main/resources/application.yml

@@ -1,2 +0,0 @@
-server:
-  port: 9995

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


+ 0 - 13
client/src/test/java/com/juxin/client/ClientApplicationTests.java

@@ -1,13 +0,0 @@
-package com.juxin.client;
-
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-class ClientApplicationTests {
-
-    @Test
-    void contextLoads() {
-    }
-
-}

+ 0 - 261
client/src/test/java/com/juxin/client/websocket/FindTaskTest.java

@@ -1,261 +0,0 @@
-package com.juxin.client.websocket;
-
-import com.juxin.client.websocket.ppojo.WebsocketInfo;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-
-import javax.websocket.Session;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.*;
-
-@ExtendWith(MockitoExtension.class)
-class FindTaskTest {
-
-    @Mock
-    private WebSocketClient mockClient;
-
-    @InjectMocks
-    private FindTask findTaskUnderTest;
-
-    @Test
-    void testInit() {
-        // Setup
-        // Run the test
-        findTaskUnderTest.init();
-
-        // Verify the results
-        verify(mockClient).setUserSession(any(Session.class));
-    }
-
-    @Test
-    void testHeart() throws Exception {
-        // Setup
-        // Configure WebSocketClient.getUserSession(...).
-        final Session mockSession = mock(Session.class);
-        when(mockClient.getUserSession()).thenReturn(mockSession);
-
-        // Run the test
-        findTaskUnderTest.heart();
-
-        // Verify the results
-        verify(mockSession).close();
-        verify(mockClient).sendMessage(
-                "{ \"infoType\": \"heart\", \"postType\": \"python\", \"methodType\": \"heart\", \"reqJson\": { \"receiveJobStatus\": \"1\", \"msg\": \"ping\" } }");
-    }
-
-    @Test
-    void testHeart_WebSocketClientGetUserSessionReturnsNull() throws Exception {
-        // Setup
-        when(mockClient.getUserSession()).thenReturn(null);
-
-        // Run the test
-        findTaskUnderTest.heart();
-
-        // Verify the results
-        verify(mockClient).setUserSession(any(Session.class));
-        verify(mockClient).sendMessage(
-                "{ \"infoType\": \"heart\", \"postType\": \"python\", \"methodType\": \"heart\", \"reqJson\": { \"receiveJobStatus\": \"1\", \"msg\": \"ping\" } }");
-    }
-
-    @Test
-    void testHeart_WebSocketClientSendMessageThrowsInterruptedException() throws Exception {
-        // Setup
-        // Configure WebSocketClient.getUserSession(...).
-        final Session mockSession = mock(Session.class);
-        when(mockClient.getUserSession()).thenReturn(mockSession);
-
-        doThrow(InterruptedException.class).when(mockClient).sendMessage(
-                "{ \"infoType\": \"heart\", \"postType\": \"python\", \"methodType\": \"heart\", \"reqJson\": { \"receiveJobStatus\": \"1\", \"msg\": \"ping\" } }");
-
-        // Run the test
-        findTaskUnderTest.heart();
-
-        // Verify the results
-        verify(mockSession).close();
-    }
-
-    @Test
-    void testFindResultTask() throws Exception {
-        // Setup
-        // Configure WebSocketClient.getUserSession(...).
-        final Session mockSession = mock(Session.class);
-        when(mockClient.getUserSession()).thenReturn(mockSession);
-
-        // Run the test
-        findTaskUnderTest.findResultTask();
-
-        // Verify the results
-        verify(mockSession).close();
-        verify(mockClient).sendMessage(
-                "{ \"infoType\": \"getResultQueueJob\", \"postType\": \"python\", \"methodType\": \"getResultQueueJob\" }");
-    }
-
-    @Test
-    void testFindResultTask_WebSocketClientGetUserSessionReturnsNull() {
-        // Setup
-        when(mockClient.getUserSession()).thenReturn(null);
-
-        // Run the test
-        findTaskUnderTest.findResultTask();
-
-        // Verify the results
-    }
-
-    @Test
-    void testFindResultTask_WebSocketClientSendMessageThrowsInterruptedException() throws Exception {
-        // Setup
-        // Configure WebSocketClient.getUserSession(...).
-        final Session mockSession = mock(Session.class);
-        when(mockClient.getUserSession()).thenReturn(mockSession);
-
-        doThrow(InterruptedException.class).when(mockClient).sendMessage(
-                "{ \"infoType\": \"getResultQueueJob\", \"postType\": \"python\", \"methodType\": \"getResultQueueJob\" }");
-
-        // Run the test
-        findTaskUnderTest.findResultTask();
-
-        // Verify the results
-        verify(mockSession).close();
-    }
-
-    @Test
-    void testFindTask() throws Exception {
-        // Setup
-        // Configure WebSocketClient.getUserSession(...).
-        final Session mockSession = mock(Session.class);
-        when(mockClient.getUserSession()).thenReturn(mockSession);
-
-        // Run the test
-        findTaskUnderTest.findTask();
-
-        // Verify the results
-        verify(mockSession).close();
-        verify(mockClient).sendMessage(
-                "{ \"infoType\": \"getQueueJob\", \"postType\": \"python\", \"methodType\": \"getQueueJob\" }");
-    }
-
-    @Test
-    void testFindTask_WebSocketClientGetUserSessionReturnsNull() {
-        // Setup
-        when(mockClient.getUserSession()).thenReturn(null);
-
-        // Run the test
-        findTaskUnderTest.findTask();
-
-        // Verify the results
-    }
-
-    @Test
-    void testFindTask_WebSocketClientSendMessageThrowsInterruptedException() throws Exception {
-        // Setup
-        // Configure WebSocketClient.getUserSession(...).
-        final Session mockSession = mock(Session.class);
-        when(mockClient.getUserSession()).thenReturn(mockSession);
-
-        doThrow(InterruptedException.class).when(mockClient).sendMessage(
-                "{ \"infoType\": \"getQueueJob\", \"postType\": \"python\", \"methodType\": \"getQueueJob\" }");
-
-        // Run the test
-        findTaskUnderTest.findTask();
-
-        // Verify the results
-        verify(mockSession).close();
-    }
-
-    @Test
-    void testDealTask() throws Exception {
-        // Setup
-        // Run the test
-        findTaskUnderTest.dealTask("message");
-
-        // Verify the results
-        verify(mockClient).sendMessage("");
-    }
-
-    @Test
-    void testDealTask_WebSocketClientThrowsInterruptedException() throws Exception {
-        // Setup
-        doThrow(InterruptedException.class).when(mockClient).sendMessage("");
-
-        // Run the test
-        assertThatThrownBy(() -> findTaskUnderTest.dealTask("message")).isInstanceOf(RuntimeException.class);
-    }
-
-    @Test
-    void testCommitTask() {
-        // Setup
-        final WebsocketInfo bean = WebsocketInfo.builder()
-                .infoType("infoType")
-                .methodType("methodType")
-                .reqJson("reqJson")
-                .build();
-
-        // Run the test
-        final String result = findTaskUnderTest.commitTask(bean);
-
-        // Verify the results
-        assertThat(result).isEqualTo("");
-    }
-
-    @Test
-    void testBankCommitTask() {
-        assertThat(findTaskUnderTest.bankCommitTask("reqJson")).isEqualTo("result");
-    }
-
-    @Test
-    void testThirdCommitTask() {
-        assertThat(findTaskUnderTest.thirdCommitTask("reqJson")).isEqualTo("result");
-    }
-
-    @Test
-    void testSerialCommitTask() {
-        assertThat(findTaskUnderTest.serialCommitTask("reqJson")).isEqualTo("result");
-    }
-
-    @Test
-    void testAllAccountCommitTask() {
-        assertThat(findTaskUnderTest.allAccountCommitTask("reqJson")).isEqualTo("result");
-    }
-
-    @Test
-    void testSearchTask() {
-        // Setup
-        final WebsocketInfo bean = WebsocketInfo.builder()
-                .infoType("infoType")
-                .methodType("methodType")
-                .reqJson("reqJson")
-                .build();
-
-        // Run the test
-        final String result = findTaskUnderTest.searchTask(bean);
-
-        // Verify the results
-        assertThat(result).isEqualTo("");
-    }
-
-    @Test
-    void testBankResultTask() {
-        assertThat(findTaskUnderTest.bankResultTask("reqJson")).isEqualTo("result");
-    }
-
-    @Test
-    void testThirdResultTask() {
-        assertThat(findTaskUnderTest.thirdResultTask("reqJson")).isEqualTo("result");
-    }
-
-    @Test
-    void testSerialResultTask() {
-        assertThat(findTaskUnderTest.serialResultTask("reqJson")).isEqualTo("result");
-    }
-
-    @Test
-    void testAllAccountResultTask() {
-        assertThat(findTaskUnderTest.allAccountResultTask("reqJson")).isEqualTo("result");
-    }
-}

+ 117 - 25
src/main/java/com/juxin/client/websocket/FindTask.java

@@ -10,15 +10,12 @@ import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.juxin.client.websocket.constant.GfConstants;
 import com.juxin.client.websocket.enums.WebsocketTypeEnum;
+import com.juxin.client.websocket.ppojo.BankCardSubjectResult;
 import com.juxin.client.websocket.ppojo.WebsocketInfo;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
-import org.springframework.util.StringUtils;
-import org.springframework.web.socket.client.WebSocketClient;
 
-import javax.annotation.PostConstruct;
 import javax.websocket.ContainerProvider;
 import javax.websocket.Session;
 import javax.websocket.WebSocketContainer;
@@ -35,6 +32,28 @@ public class FindTask {
             {"机构已反馈", "机构暂未反馈", "机构反馈失败,失败原因1", "机构已反馈",
                     "国反异常,获取结果失败", "机构已反馈",
                     "机构反馈失败,失败原因2", "机构已反馈", "机构反馈失败,失败原因3", "机构已反馈", "机构已反馈"};
+    public static final String[] BANK_RESULT =
+            {"南京银行",
+                    "招商银行",
+                    "国丰银行",
+                    "国家开发银行",
+                    "国民银行",
+                    "建设银行",
+                    "工商银行",
+                    "农业银行",
+                    "安徽银行",
+                    "北京银行"};
+    public static final String[] NAME_LIST =
+            {"王一",
+                    "张二",
+                    "李三",
+                    "赵四",
+                    "刘六",
+                    "杜七",
+                    "钱八",
+                    "严九",
+                    "黄十",
+                    "武五"};
 
     @Autowired
     private com.juxin.client.websocket.WebSocketClient client;
@@ -194,6 +213,10 @@ public class FindTask {
             case "thirdSubjectCommit":
                 result = thirdSubjectCommitTask(reqJson);
                 break;
+            case "bankOwnerCommit":
+                System.out.println("开始bankOwnerCommit 银行卡主体提交1111111" + "*********************************************");
+                result = bankSubjectCommitTask(reqJson);
+                break;
             default:
                 break;
         }
@@ -358,6 +381,7 @@ public class FindTask {
 
     /**
      * 第三方主体 提交over接口
+     *
      * @param reqJson
      * @return
      */
@@ -387,6 +411,36 @@ public class FindTask {
         return JSONUtil.toJsonStr(result);
     }
 
+    public String bankSubjectCommitTask(Object reqJson) {
+        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
+        Map<String, Object> result = new HashMap<>();
+        result.put("infoType", "over");
+        result.put("postType", "python");
+        result.put("methodType", "bankOwnerCommit");
+        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);
+        String jobState = status[RandomUtil.randomInt(0, 6)];
+        req.put("jobState", jobState);
+        if (Objects.equals(jobState, "success")) {
+            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("mainBodyType", e.get("mainBodyType"));
+                map.put("bankName", Objects.toString(jsonObject.get("bankname")));
+                split.add(map);
+            });
+            req.put("bankSubjectSplits", split);
+        }
+        result.put("reqJson", req);
+        return JSONUtil.toJsonStr(result);
+    }
+
     /**
      * 回捞任务
      *
@@ -419,6 +473,10 @@ public class FindTask {
             case "thirdOwnerResult":
                 result = thirdSubjectResultTask(reqJson);
                 break;
+            case "bankOwnerResult":
+                System.out.println("开始bankOwnerResult 银行卡主体结果回捞" + "--------------------------------------");
+                result = bankSubjectResultTask(reqJson);
+                break;
             default:
                 break;
         }
@@ -568,11 +626,12 @@ public class FindTask {
 
     /**
      * 第三方主体 回捞结果 数据
+     *
      * @param reqJson
      * @return
      */
-   public String thirdSubjectResultTask(Object reqJson){
-        String thirdSubjectResult="    {\n" +
+    public String thirdSubjectResultTask(Object reqJson) {
+        String thirdSubjectResult = "    {\n" +
                 "     \n" +
                 "      \"applicationid\":\"0303A2002331253012019FZ2505151353210\",\n" +
                 "      \"result\":\"0000\",\n" +
@@ -615,27 +674,60 @@ public class FindTask {
                 "        }\n" +
                 "      ]\n" +
                 "    }";
-       JSONObject jsonObject = JSONUtil.parseObj(reqJson);
-       JSONObject param = jsonObject.get("params", JSONObject.class);
-       Map<String, Object> result = new HashMap<>();
-       result.put("infoType", "result");
-       result.put("postType", "python");
-       result.put("methodType", "thirdOwnerResult");
-       Map<String, Object> req = new HashMap<>();
-       req.put("applicationId", param.get("applicationid"));
-       req.put("accountSearchType",param.get("accountSearchType"));
-       req.put("status", SPLIT_RESULT[RandomUtil.randomInt(0, 10)]);
-       req.put("valueCount", RandomUtil.randomInt(0, 10000));
-       JSONObject thirdSubject=JSONUtil.parseObj(thirdSubjectResult);
-       thirdSubject.put("applicationid", param.get("applicationid"));
-       thirdSubject.put("data",param.get("data"));
-       req.put("thirdSubjectResult",thirdSubject);
-       result.put("reqJson", req);
-
-       System.out.println(result);
-       return JSONUtil.toJsonStr(result);
+        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
+        JSONObject param = jsonObject.get("params", JSONObject.class);
+        Map<String, Object> result = new HashMap<>();
+        result.put("infoType", "result");
+        result.put("postType", "python");
+        result.put("methodType", "thirdOwnerResult");
+        Map<String, Object> req = new HashMap<>();
+        req.put("applicationId", param.get("applicationid"));
+        req.put("accountSearchType", param.get("accountSearchType"));
+        req.put("status", SPLIT_RESULT[RandomUtil.randomInt(0, 10)]);
+        req.put("valueCount", RandomUtil.randomInt(0, 10000));
+        JSONObject thirdSubject = JSONUtil.parseObj(thirdSubjectResult);
+        thirdSubject.put("applicationid", param.get("applicationid"));
+        thirdSubject.put("data", param.get("data"));
+        req.put("thirdSubjectResult", thirdSubject);
+        result.put("reqJson", req);
+
+        System.out.println(result);
+        return JSONUtil.toJsonStr(result);
     }
 
+    public String bankSubjectResultTask(Object reqJson) {
+        JSONObject jsonObject = JSONUtil.parseObj(reqJson);
+        JSONObject param = jsonObject.get("params", JSONObject.class);
+        Map<String, Object> result = new HashMap<>();
+        result.put("infoType", "result");
+        result.put("postType", "python");
+        result.put("methodType", "bankOwnerResult");
+        Map<String, Object> req = new HashMap<>();
+        req.put("applicationId", param.get("applicationid"));
+        String splitResult = SPLIT_RESULT[RandomUtil.randomInt(0, 10)];
+        req.put("status", splitResult);
+        if (Objects.equals(splitResult, "机构已反馈")) {
+            req.put("valueCount", RandomUtil.randomInt(0, 10000));
+            BankCardSubjectResult bankCardSubjectResult = new BankCardSubjectResult();
+            bankCardSubjectResult.setApplicationid(String.valueOf(param.get("applicationid")));
+            String bankName = BANK_RESULT[RandomUtil.randomInt(0, 10)];
+            bankCardSubjectResult.setFeedbackorgname(bankName);
+            bankCardSubjectResult.setAccountcredentialnumber(String.valueOf(RandomUtil.randomInt(0, 10000)));
+            String name = NAME_LIST[RandomUtil.randomInt(0, 10)];
+            bankCardSubjectResult.setAccountsubjectname(name);
+            bankCardSubjectResult.setAccountcancellationbranch(bankName);
+            bankCardSubjectResult.setTelnumber(String.valueOf(RandomUtil.randomInt(0, 10000)));
+            bankCardSubjectResult.setCardnumber(String.valueOf(RandomUtil.randomInt(0, 10000)));
+            req.put("bankCardSubjectResult", bankCardSubjectResult);
+            result.put("reqJson", req);
+
+        } else {
+            req.put("valueCount", 0);
+            result.put("reqJson", req);
+
+        }
+        return JSONUtil.toJsonStr(result);
+    }
 
     public static void main(String[] args) {
         FileUtil.copy(FileUtil.file("excel/6226890438342486.xlsx")

+ 148 - 0
src/main/java/com/juxin/client/websocket/ppojo/BankCardSubjectResult.java

@@ -0,0 +1,148 @@
+package com.juxin.client.websocket.ppojo;
+
+import lombok.Data;
+
+/**
+ * 银行卡数据回捞 主体信息  主体
+ */
+@Data
+public class BankCardSubjectResult {
+
+    private Long id;
+
+    /**
+     * appId主键
+     */
+    private String applicationid;
+
+    /**
+     * 主体反馈结果
+     */
+
+//    private String searchResult;
+
+    /**
+     * 查询反馈说明
+     */
+//    private String feedbackremark;
+    /**
+     * 反馈机构名称
+     */
+    private String feedbackorgname;
+
+    /**
+     * 主账户名称
+     */
+    private String accountsubjectname;
+    /**
+     * 主账户
+     */
+    private String cardnumber;
+    /**
+     * 账户状态
+     */
+//    private String accountstatus;
+    /**
+     * 开户网点
+     */
+    private String depositbankbranch;
+    /**
+     * 开户网点代码
+     */
+    private String depositbankbranchcode;
+    /**
+     * 开户网点所属行政区划代码
+     */
+    private String depositbankadminiscode;
+    /**
+     * 开户日期
+     */
+    private String accountopentime;
+    /**
+     * 销户日期
+     */
+    private String accountcancellationtime;
+    /**
+     * 销户网点
+     */
+    private String accountcancellationbranch;
+    /**
+     * 证照类型
+     */
+//    private String accountcredentialtype;
+
+    /**
+     * 证照号码
+     */
+    private String accountcredentialnumber;
+
+    /**
+     * 查询主体名称
+     */
+    private String accountsubjectname2;
+    /**
+     * 联系手机
+     */
+    private String telnumber;
+
+    /**
+     * 住宅地址
+     */
+//    private String residentaddress;
+
+    /**
+     * 住宅电话
+     */
+//    private String residenttelnumber;
+
+    /**
+     * 工作单位
+     */
+    private String workcompanyname;
+
+    /**
+     * 单位地址
+     */
+    private String workaddress;
+
+    /**
+     * 单位电话
+     */
+    private String worktelnumber;
+
+
+    private String subjectCreateFlag;
+
+    /**
+     * 创建时间
+     */
+    private String createTime;
+
+    /**
+     * 修改时间
+     */
+    private String updateTime;
+
+//    private String applicationid = "A1002231218722836FZ2505150626060";
+    private String searchResult = "0000";
+    private String feedbackremark = "成功";
+//    private String feedbackorgname = "中国工商银行";
+    private String accountcredentialtype = "01";
+//    private String accountcredentialnumber = "622429199804150075";
+//    private String accountsubjectname = "张宁";
+//    private String telnumber =  "8618720210711";
+//    private String cardnumber = "6252470090818078";
+    private String residentaddress = "-";
+    private String residenttelnumber = "-";
+//    private String workcompanyname = "岷县电子商务中心";
+//    private String workaddress = "中国甘肃定西岷县岷县电子商务中心";
+//    private String worktelnumber = "09327723588";
+//    private String depositbankbranch = "工行甘肃省定西中华路支行";
+//    private String depositbankbranchcode = "0270700752(行内)";
+//    private String depositbankadminiscode = "621102";
+//    private String accountopentime = "20180427000000";
+//    private String accountcancellationtime = "99991231000000";
+//    private String accountcancellationbranch = "00752";
+    private String accountstatus = "正常";
+
+}