Commit 45736b39 by zhouhaibao

[+]旅程节点执行添加

1 parent d644d059
...@@ -19,11 +19,11 @@ public class CustomerInfo { ...@@ -19,11 +19,11 @@ public class CustomerInfo {
private Date sopJourneyEnterTime; private Date sopJourneyEnterTime;
private String sop_journey_stage; private String sopJourneyStage;
private Date sopJourneyStageEnterTime; private Date sopJourneyStageEnterTime;
private String followStaffUuid; private String followStaffPhone;
private String messageContent; private String messageContent;
......
...@@ -108,6 +108,7 @@ public class SopHelper { ...@@ -108,6 +108,7 @@ public class SopHelper {
return null; return null;
} }
if (CollectionUtils.isNotEmpty(customerInfoList)) { if (CollectionUtils.isNotEmpty(customerInfoList)) {
// 距离旅程相差天数过滤
return customerInfoList.stream().filter(index -> SopHelper.diffDay(index.getSopJourneyStageEnterTime(), Integer.parseInt(diffday))).collect(Collectors.toList()); return customerInfoList.stream().filter(index -> SopHelper.diffDay(index.getSopJourneyStageEnterTime(), Integer.parseInt(diffday))).collect(Collectors.toList());
} }
return null; return null;
...@@ -145,6 +146,20 @@ public class SopHelper { ...@@ -145,6 +146,20 @@ public class SopHelper {
} }
return null; return null;
} }
public static String getValueFromJsonString(String jsonString, String objectName, String objectNameTwo,String fieldName) {
try {
ObjectMapper objectMapper = new ObjectMapper();
JsonNode rootNode = objectMapper.readTree(jsonString);
JsonNode objectNode = rootNode.get(objectName);
JsonNode objectNodeTwo = objectNode.get(objectNameTwo);
JsonNode fieldNode = objectNodeTwo.get(fieldName);
return fieldNode.asText();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static String getValueFromJsonString(String jsonString, String fieldName) { public static String getValueFromJsonString(String jsonString, String fieldName) {
try { try {
......
...@@ -42,26 +42,28 @@ public class ControllerDisTasksDemo { ...@@ -42,26 +42,28 @@ public class ControllerDisTasksDemo {
if (CollectionUtils.isNotEmpty(customerInfoList)) { if (CollectionUtils.isNotEmpty(customerInfoList)) {
String instSnapshot = sopInst.getInstSnapshot(); String instSnapshot = sopInst.getInstSnapshot();
multiValueMap.add("requestList[0].activityId", SopHelper.getValueFromJsonString(instSnapshot, "initMap", "customData","activityId"));
multiValueMap.add("requestList[0].activityId", SopHelper.getValueFromJsonString(instSnapshot, "activityId"));
multiValueMap.add("requestList[0].nodeId", sopInstNode.getNodeId() + ""); multiValueMap.add("requestList[0].nodeId", sopInstNode.getNodeId() + "");
multiValueMap.add("requestList[0].nodeName", sopInstNode.getNodeName()); multiValueMap.add("requestList[0].nodeName", sopInstNode.getNodeName());
multiValueMap.add("requestList[0].stageId", SopHelper.getValueFromJsonString(nodeParam, "stage")); multiValueMap.add("requestList[0].stageId", SopHelper.getValueFromJsonString(nodeParam, "stage"));
multiValueMap.add("requestList[0].stageName", SopHelper.getValueFromJsonString(nodeParam, "stage")); multiValueMap.add("requestList[0].stageName", SopHelper.getValueFromJsonString(nodeParam, "stage"));
multiValueMap.add("requestList[0].taskId", sopInst.getInstId()); multiValueMap.add("requestList[0].sopId", sopInst.getInstId());
multiValueMap.add("requestList[0].taskName", sopInst.getInstName());
multiValueMap.add("requestList[0].taskType", SopHelper.getValueFromJsonString(nodeParam, "taskType")); multiValueMap.add("requestList[0].taskType", SopHelper.getValueFromJsonString(nodeParam, "taskType"));
for (int i = 0; i < customerInfoList.size(); i++) { for (int i = 0; i < customerInfoList.size(); i++) {
CustomerInfo customerInfo = customerInfoList.get(i); CustomerInfo customerInfo = customerInfoList.get(i);
multiValueMap.add("requestList[0].customerList[" + i + "].customerId", customerInfo.getOneId()); multiValueMap.add("requestList[0].customerList[" + i + "].customerId", customerInfo.getOneId());
multiValueMap.add("requestList[0].customerList[" + i + "].followStaffUuid", customerInfo.getFollowStaffUuid()); multiValueMap.add("requestList[0].customerList[" + i + "].followStaffPhone", customerInfo.getFollowStaffPhone());
multiValueMap.add("requestList[0].customerList[" + i + "].messageContent", customerInfo.getMessageContent()); multiValueMap.add("requestList[0].customerList[" + i + "].messageContent", customerInfo.getMessageContent());
if(customerInfo.getMessageId()!=null) {
multiValueMap.add("requestList[0].customerList[" + i + "].messageId", customerInfo.getMessageId()); multiValueMap.add("requestList[0].customerList[" + i + "].messageId", customerInfo.getMessageId());
}
if(customerInfo.getTalkId()!=null) {
multiValueMap.add("requestList[0].customerList[" + i + "].talkId", customerInfo.getTalkId()); multiValueMap.add("requestList[0].customerList[" + i + "].talkId", customerInfo.getTalkId());
} }
}
try { try {
System.out.println("入参" + JSONObject.toJSONString(multiValueMap)); System.out.println("入参" + JSONObject.toJSONString(multiValueMap));
......
...@@ -31,7 +31,7 @@ public class ControllerScreenPersonDemo { ...@@ -31,7 +31,7 @@ public class ControllerScreenPersonDemo {
List<CustomerInfo> customerInfoList = JSON.parseArray(JSON.toJSONString(resultData.get("users")), CustomerInfo.class); List<CustomerInfo> customerInfoList = JSON.parseArray(JSON.toJSONString(resultData.get("users")), CustomerInfo.class);
if (CollectionUtils.isNotEmpty(customerInfoList)) { if (CollectionUtils.isNotEmpty(customerInfoList)) {
List<CustomerInfo> collect = customerInfoList.stream().filter(index -> stage.equals(index.getSop_journey_stage())).collect(Collectors.toList()); List<CustomerInfo> collect = customerInfoList.stream().filter(index -> stage.equals(index.getSopJourneyStage())).collect(Collectors.toList());
return (JSONArray) JSONObject.toJSON(collect); return (JSONArray) JSONObject.toJSON(collect);
} }
return null; return null;
......
...@@ -45,7 +45,7 @@ public class JavaNodeTestApplication { ...@@ -45,7 +45,7 @@ public class JavaNodeTestApplication {
customerInfo.setSopJourneyId("xblc7"); customerInfo.setSopJourneyId("xblc7");
customerInfo.setSopJourneyEnterTime(new Date()); customerInfo.setSopJourneyEnterTime(new Date());
customerInfo.setCustomerPhone("13476670746"); customerInfo.setCustomerPhone("13476670746");
customerInfo.setSop_journey_stage("潜客"); customerInfo.setSopJourneyStage("潜客");
customerInfo.setSopJourneyStageEnterTime(new Date()); customerInfo.setSopJourneyStageEnterTime(new Date());
resultData.put("users", Arrays.asList(customerInfo)); resultData.put("users", Arrays.asList(customerInfo));
SopStruct sopStruct = sopService.loadSop("xblc7"); SopStruct sopStruct = sopService.loadSop("xblc7");
...@@ -71,8 +71,9 @@ public class JavaNodeTestApplication { ...@@ -71,8 +71,9 @@ public class JavaNodeTestApplication {
customerInfo.setSopJourneyId("xblc7"); customerInfo.setSopJourneyId("xblc7");
customerInfo.setSopJourneyEnterTime(new Date()); customerInfo.setSopJourneyEnterTime(new Date());
customerInfo.setCustomerPhone("13476670746"); customerInfo.setCustomerPhone("13476670746");
customerInfo.setSop_journey_stage("潜客"); customerInfo.setFollowStaffPhone("13476670746");
customerInfo.setSopJourneyStageEnterTime(DateUtils.parse("2023-09-22")); customerInfo.setSopJourneyStage("潜客");
customerInfo.setSopJourneyStageEnterTime(DateUtils.parse("2023-09-23"));
resultData.put("user1", Arrays.asList(customerInfo)); resultData.put("user1", Arrays.asList(customerInfo));
SopStruct sopStruct = sopService.loadSop("xblc7"); SopStruct sopStruct = sopService.loadSop("xblc7");
SopInstNode sopInstNode = sopStruct.getInstNodeMap().get(3); SopInstNode sopInstNode = sopStruct.getInstNodeMap().get(3);
...@@ -98,7 +99,7 @@ public class JavaNodeTestApplication { ...@@ -98,7 +99,7 @@ public class JavaNodeTestApplication {
customerInfo.setSopJourneyId("xblc7"); customerInfo.setSopJourneyId("xblc7");
customerInfo.setSopJourneyEnterTime(new Date()); customerInfo.setSopJourneyEnterTime(new Date());
customerInfo.setCustomerPhone("13476670746"); customerInfo.setCustomerPhone("13476670746");
customerInfo.setSop_journey_stage("潜在客户"); customerInfo.setSopJourneyStage("潜在客户");
customerInfo.setSopJourneyStageEnterTime(DateUtils.parse("2023-09-22")); customerInfo.setSopJourneyStageEnterTime(DateUtils.parse("2023-09-22"));
customerInfo.setVin("WAURFCF24MN013761"); customerInfo.setVin("WAURFCF24MN013761");
resultData.put("user1", Arrays.asList(customerInfo)); resultData.put("user1", Arrays.asList(customerInfo));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!