|
|
@@ -6,11 +6,13 @@ 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.JSONArray;
|
|
|
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.DigitalRmbSubjectBankInfo;
|
|
|
import com.juxin.client.websocket.ppojo.DigitalRmbSubjectResult;
|
|
|
import com.juxin.client.websocket.ppojo.WebsocketInfo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -237,6 +239,10 @@ public class FindTask {
|
|
|
System.out.println("digitalRmbSubjectCommit 数字人民币主体提交1111111" + "*********************************************");
|
|
|
result = digitalRmbSubjectCommitTask(reqJson);
|
|
|
break;
|
|
|
+ case "digitalRmbCommit":
|
|
|
+ System.out.println("digitalRmbCommit 数字人民币提交1111111" + "*********************************************");
|
|
|
+ result = digitalRmbCommitTask(reqJson);
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
@@ -385,6 +391,7 @@ public class FindTask {
|
|
|
req.put("recordId", jsonObject.get("groupId"));
|
|
|
req.put("groupId", jsonObject.get("groupId"));
|
|
|
String jobState = status[RandomUtil.randomInt(0, 6)];
|
|
|
+// jobState = "success";
|
|
|
req.put("jobState", jobState);
|
|
|
if (Objects.equals(jobState, "success")) {
|
|
|
List<Map<String, String>> split = new ArrayList<>();
|
|
|
@@ -492,7 +499,7 @@ public class FindTask {
|
|
|
List<Map<String, String>> split = new ArrayList<>();
|
|
|
List<Map<String, String>> list = jsonObject.get("list", List.class);
|
|
|
String jobState = status[RandomUtil.randomInt(0, 6)];
|
|
|
- jobState = "success";
|
|
|
+// jobState = "success";
|
|
|
req.put("jobState", jobState);
|
|
|
if (Objects.equals(jobState, "success")) {
|
|
|
list.forEach(e -> {
|
|
|
@@ -501,6 +508,8 @@ public class FindTask {
|
|
|
map.put("bankName", e.get("bankName"));
|
|
|
map.put("result", "0000");
|
|
|
map.put("account", e.get("walletId"));
|
|
|
+ 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("digitalRmbSubjectSplits", split);
|
|
|
@@ -511,6 +520,40 @@ public class FindTask {
|
|
|
return JSONUtil.toJsonStr(result);
|
|
|
}
|
|
|
|
|
|
+ public String digitalRmbCommitTask(Object reqJson) {
|
|
|
+ JSONObject jsonObject = JSONUtil.parseObj(reqJson);
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ result.put("infoType", "over");
|
|
|
+ result.put("postType", "python");
|
|
|
+ result.put("methodType", "digitalRmbCommit");
|
|
|
+ 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)];
|
|
|
+// jobState = "fail";
|
|
|
+ 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("bankName", e.get("bankName"));
|
|
|
+ map.put("result", "0000");
|
|
|
+ map.put("account", e.get("walletId"));
|
|
|
+ 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("digitalRmbSplits", split);
|
|
|
+ } else {
|
|
|
+ req.put("errorMsg", ERR_MSG[RandomUtil.randomInt(0, 6)]);
|
|
|
+ }
|
|
|
+ result.put("reqJson", req);
|
|
|
+ return JSONUtil.toJsonStr(result);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 回捞任务
|
|
|
*
|
|
|
@@ -550,9 +593,13 @@ public class FindTask {
|
|
|
case "digitalRmbSubjectResult":
|
|
|
System.out.println("digitalRmbSubjectResult 数字人民币主体结果回捞" + "--------------------------------------");
|
|
|
Thread.sleep(1000 * 30);
|
|
|
-
|
|
|
result = digitalRmbSubjectResultTask(reqJson);
|
|
|
break;
|
|
|
+ case "digitalRmbResult":
|
|
|
+ System.out.println("digitalRmbResult 数字人民币结果回捞" + "--------------------------------------");
|
|
|
+ Thread.sleep(1000 * 3);
|
|
|
+ result = digitalRmbResultTask(reqJson);
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
@@ -620,20 +667,24 @@ public class FindTask {
|
|
|
result.put("infoType", "result");
|
|
|
result.put("postType", "python");
|
|
|
result.put("methodType", "serialResult");
|
|
|
+ result.put("combineSearchFlag", "是");
|
|
|
+ result.put("combineSearchStart", "2025-03-05");
|
|
|
+ result.put("combineSearchEnd", "2025-05-05");
|
|
|
Map<String, Object> req = new HashMap<>();
|
|
|
req.put("applicationId", param.get("applicationid"));
|
|
|
String splitResult = SPLIT_RESULT[RandomUtil.randomInt(0, 10)];
|
|
|
+// splitResult = "机构已反馈";
|
|
|
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.copy(FileUtil.file("E:\\workspace\\jx\\workSpace\\rpaClient\\client\\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.copy(FileUtil.file("E:\\workspace\\jx\\workSpace\\rpaClient\\client\\excel\\流水号查询结果空文件.xlsx")
|
|
|
, FileUtil.file(Objects.toString(param.get("file_path")))
|
|
|
, true);
|
|
|
}
|
|
|
@@ -653,6 +704,7 @@ public class FindTask {
|
|
|
Map<String, Object> req = new HashMap<>();
|
|
|
req.put("applicationId", param.get("applicationid"));
|
|
|
String splitResult = SPLIT_RESULT[RandomUtil.randomInt(0, 10)];
|
|
|
+// splitResult = "机构已反馈";
|
|
|
String filePath = "E:\\workspace\\jx\\workSpace\\rpaClient\\client\\excel\\第三方全账户.xlsx";
|
|
|
req.put("status", splitResult);
|
|
|
if (Objects.equals(splitResult, "机构已反馈")) {
|
|
|
@@ -684,19 +736,20 @@ public class FindTask {
|
|
|
Map<String, Object> req = new HashMap<>();
|
|
|
req.put("applicationId", param.get("applicationid"));
|
|
|
String splitResult = SPLIT_RESULT[RandomUtil.randomInt(0, 10)];
|
|
|
+// splitResult="机构已反馈";
|
|
|
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.copy(FileUtil.file("E:\\workspace\\jx\\workSpace\\rpaClient\\client\\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);
|
|
|
+ FileUtil.copy(FileUtil.file("E:\\workspace\\jx\\workSpace\\rpaClient\\client\\excel\\银行卡全账户空文件.xlsx")
|
|
|
+ , FileUtil.file(Objects.toString(param.get("file_path")))
|
|
|
+ , true);
|
|
|
}
|
|
|
return JSONUtil.toJsonStr(result);
|
|
|
}
|
|
|
@@ -825,7 +878,7 @@ public class FindTask {
|
|
|
Map<String, Object> req = new HashMap<>();
|
|
|
req.put("applicationId", param.get("applicationid"));
|
|
|
String splitResult = SPLIT_RESULT[RandomUtil.randomInt(0, 10)];
|
|
|
- splitResult = "机构已反馈";
|
|
|
+// splitResult = "机构已反馈";
|
|
|
req.put("status", splitResult);
|
|
|
if (Objects.equals(splitResult, "机构已反馈")) {
|
|
|
req.put("valueCount", RandomUtil.randomInt(0, 10000));
|
|
|
@@ -837,7 +890,7 @@ public class FindTask {
|
|
|
digitalRmbSubjectResult.setQueryResult("1");
|
|
|
digitalRmbSubjectResult.setMac("xx");
|
|
|
digitalRmbSubjectResult.setCustomerName("张三");
|
|
|
- digitalRmbSubjectResult.setWalletName("数字钱包 001");
|
|
|
+ digitalRmbSubjectResult.setWalletName("数字钱包");
|
|
|
digitalRmbSubjectResult.setWalletType("01");
|
|
|
digitalRmbSubjectResult.setWalletOpenTime("2024-01-01 10:00:00");
|
|
|
digitalRmbSubjectResult.setWalletOrgCode("ORG001");
|
|
|
@@ -850,8 +903,12 @@ public class FindTask {
|
|
|
digitalRmbSubjectResult.setParentWalletId("111");
|
|
|
digitalRmbSubjectResult.setFrozenAmount("0.00");
|
|
|
digitalRmbSubjectResult.setOpenMethod("01");
|
|
|
- digitalRmbSubjectResult.setBoundBankCardJson("{}");
|
|
|
- digitalRmbSubjectResult.setRegisteredBankCardJson("{}");
|
|
|
+
|
|
|
+ DigitalRmbSubjectBankInfo info= new DigitalRmbSubjectBankInfo("中国银行","112","借记卡","2026");
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
+ jsonArray.add(info);
|
|
|
+ digitalRmbSubjectResult.setBoundBankCardJson(JSONUtil.toJsonStr( jsonArray));
|
|
|
+ digitalRmbSubjectResult.setRegisteredBankCardJson(JSONUtil.toJsonStr( jsonArray));
|
|
|
|
|
|
digitalRmbSubjectResult.setWalletOrgCode("ORG001");
|
|
|
|
|
|
@@ -868,6 +925,35 @@ public class FindTask {
|
|
|
return JSONUtil.toJsonStr(result);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public String digitalRmbResultTask(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", "digitalRmbResult");
|
|
|
+ Map<String, Object> req = new HashMap<>();
|
|
|
+ req.put("applicationId", param.get("applicationid"));
|
|
|
+ String splitResult = SPLIT_RESULT[RandomUtil.randomInt(0, 10)];
|
|
|
+// splitResult = "机构反馈失败,失败原因1";
|
|
|
+ req.put("status", splitResult);
|
|
|
+ if (Objects.equals(splitResult, "机构已反馈")) {
|
|
|
+ req.put("valueCount", RandomUtil.randomInt(0, 10000));
|
|
|
+ result.put("reqJson", req);
|
|
|
+ FileUtil.copy(FileUtil.file("E:\\workspace\\jx\\workSpace\\rpaClient\\client\\excel\\数字人民币结果.xlsx")
|
|
|
+ , FileUtil.file(Objects.toString(param.get("file_path")))
|
|
|
+ , true);
|
|
|
+ } else {
|
|
|
+ req.put("valueCount", 0);
|
|
|
+ result.put("reqJson", req);
|
|
|
+ FileUtil.copy(FileUtil.file("E:\\workspace\\jx\\workSpace\\rpaClient\\client\\excel\\数字人民币查询空结果.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")
|