Commit 86d26e98 by 林永健

Merge remote-tracking branch 'origin/v2.0.1' into v2.0.1

2 parents 5250bb00 e6379388
...@@ -88,18 +88,19 @@ public class ControllerDisTasksDemo { ...@@ -88,18 +88,19 @@ public class ControllerDisTasksDemo {
System.out.println("入参" + JSONObject.toJSONString(multiValueMap)); System.out.println("入参" + JSONObject.toJSONString(multiValueMap));
post = SopHelper.post(multiValueMap, Object.class, ConfigUtils.getProperty("scrm.baseurl")+baseurl, method); post = SopHelper.post(multiValueMap, Object.class, ConfigUtils.getProperty("scrm.baseurl")+baseurl, method);
System.out.println("返回" + JSONObject.toJSONString(post)); System.out.println("返回" + JSONObject.toJSONString(post));
map.put("sendTask",post); map.put("sendTaskRes",post);
// 新增任务记录 // 新增任务记录
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
Object o = restTemplate.postForObject(ConfigUtils.getProperty("scrm.sopurl")+taskUrl, sopNodeTaskInfoList, Object.class); Object o = restTemplate.postForObject(ConfigUtils.getProperty("scrm.sopurl")+taskUrl, sopNodeTaskInfoList, Object.class);
map.put("sendTask",post); map.put("sendTaskLogRes",o);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); e.printStackTrace();
map.put("errMessage",e.getMessage());
} }
return (JSONObject) JSONObject.toJSON(post);
} }
return null; map.put("message","未找到匹配客户");
return (JSONObject) JSONObject.toJSON(map);
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -42,11 +42,9 @@ public class ControllerGetEntCusDemo { ...@@ -42,11 +42,9 @@ public class ControllerGetEntCusDemo {
try { try {
String merchantId = SopHelper.getValueFromJsonString(instParam, String merchantId = SopHelper.getValueFromJsonString(instParam,
"merchantId"); "merchantId");
String instDefalutName = SopHelper.getValueFromJsonString(instParam, "stages", "stage1",
"value");
multiValueMap.add("merchantId",merchantId); multiValueMap.add("merchantId",merchantId);
multiValueMap.add("instId",sopInst.getInstId()); multiValueMap.add("instId",sopInst.getInstId());
multiValueMap.add("instDefalutName",instDefalutName); multiValueMap.add("instDefalutName","初始化阶段");
System.out.println("入参" + JSONObject.toJSONString(multiValueMap)); System.out.println("入参" + JSONObject.toJSONString(multiValueMap));
post = SopHelper.post(multiValueMap, Object.class, ConfigUtils.getProperty("scrm.baseurl")+ baseurl, method); post = SopHelper.post(multiValueMap, Object.class, ConfigUtils.getProperty("scrm.baseurl")+ baseurl, method);
System.out.println("返回" + JSONObject.toJSONString(post)); System.out.println("返回" + JSONObject.toJSONString(post));
......
...@@ -30,11 +30,9 @@ public class ControllerGetGrCusDemo { ...@@ -30,11 +30,9 @@ public class ControllerGetGrCusDemo {
try { try {
String merchantId = SopHelper.getValueFromJsonString(instParam, String merchantId = SopHelper.getValueFromJsonString(instParam,
"merchantId"); "merchantId");
String instDefalutName = SopHelper.getValueFromJsonString(instParam, "stages", "stage1",
"value");
multiValueMap.add("merchantId",merchantId); multiValueMap.add("merchantId",merchantId);
multiValueMap.add("instId",sopInst.getInstId()); multiValueMap.add("instId",sopInst.getInstId());
multiValueMap.add("instDefalutName",instDefalutName); multiValueMap.add("instDefalutName","初始化阶段");
System.out.println("入参" + JSONObject.toJSONString(multiValueMap)); System.out.println("入参" + JSONObject.toJSONString(multiValueMap));
post = SopHelper.post(multiValueMap, Object.class, ConfigUtils.getProperty("scrm.baseurl")+ baseurl, method); post = SopHelper.post(multiValueMap, Object.class, ConfigUtils.getProperty("scrm.baseurl")+ baseurl, method);
System.out.println("返回" + JSONObject.toJSONString(post)); System.out.println("返回" + JSONObject.toJSONString(post));
......
...@@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSON; ...@@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -35,60 +36,68 @@ public class ControllerSendMessageDemo { ...@@ -35,60 +36,68 @@ public class ControllerSendMessageDemo {
public static JSON execute(JSON param) { public static JSON execute(JSON param) {
// 将JSON字符串转换为Map // 将JSON字符串转换为Map
// 将Map中的数据放入MultiValueMap中 // 将Map中的数据放入MultiValueMap中
Map map = new HashMap();
Object post = null; Object post = null;
MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>(); try {
SopExecutorResult excustorParam = SopHelper.getExcustorParam(param); MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>();
Map<String, Object> resultData = excustorParam.getResultData(); SopExecutorResult excustorParam = SopHelper.getExcustorParam(param);
SopInst sopInst = excustorParam.getSopInst(); Map<String, Object> resultData = excustorParam.getResultData();
SopInstNode sopInstNode = excustorParam.getSopInstNode(); SopInst sopInst = excustorParam.getSopInst();
String nodeParam = sopInstNode.getNodeParam(); SopInstNode sopInstNode = excustorParam.getSopInstNode();
String nodeParam = sopInstNode.getNodeParam();
List<CustomerInfo> customerInfoList = SopHelper.getMeetWithCustomer(sopInstNode, resultData); List<CustomerInfo> customerInfoList = SopHelper.getMeetWithCustomer(sopInstNode, resultData);
// 营销的客户存在 // 营销的客户存在
if (CollectionUtils.isNotEmpty(customerInfoList)) { if (CollectionUtils.isNotEmpty(customerInfoList)) {
// 获取营销类型 1.短信发送 2.企微群发 3.企微朋友圈 // 获取营销类型 1.短信发送 2.企微群发 3.企微朋友圈
String sendType = SopHelper.getValueFromJsonString(nodeParam, "taskType"); String sendType = SopHelper.getValueFromJsonString(nodeParam, "taskType");
if (StringUtils.isNotEmpty(sendType)) { if (StringUtils.isNotEmpty(sendType)) {
List<CustomerTouchModel> customerTouchModels = new ArrayList<>(); List<CustomerTouchModel> customerTouchModels = new ArrayList<>();
Map<String, List<CustomerInfo>> collect = customerInfoList.stream() Map<String, List<CustomerInfo>> collect = customerInfoList.stream()
.collect(Collectors.groupingBy(CustomerInfo::getUserId)); .collect(Collectors.groupingBy(CustomerInfo::getUserId));
Iterator<Entry<String, List<CustomerInfo>>> iterator = collect.entrySet().iterator(); Iterator<Entry<String, List<CustomerInfo>>> iterator = collect.entrySet().iterator();
CustomerTouchModel customerTouchModel = new CustomerTouchModel(); CustomerTouchModel customerTouchModel = new CustomerTouchModel();
while (iterator.hasNext()) { while (iterator.hasNext()) {
List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels = new ArrayList<>(); List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels = new ArrayList<>();
Entry<String, List<CustomerInfo>> next = iterator.next(); Entry<String, List<CustomerInfo>> next = iterator.next();
String key = next.getKey(); String key = next.getKey();
List<CustomerInfo> value = next.getValue(); List<CustomerInfo> value = next.getValue();
switch (sendType) { switch (sendType) {
case "10": case "10":
buildMessageParam(customerTouchModel, value, nodeParam, sopInst, sopInstNode, buildMessageParam(customerTouchModel, value, nodeParam, sopInst, sopInstNode,
sopTaskExecuteStaffModels); sopTaskExecuteStaffModels);
customerTouchModel.setSendType(1); customerTouchModel.setSendType(1);
break; break;
case "8": case "8":
buildMassParam(customerTouchModel, key, value, nodeParam, sopInst, sopInstNode, buildMassParam(customerTouchModel, key, value, nodeParam, sopInst, sopInstNode,
sopTaskExecuteStaffModels); sopTaskExecuteStaffModels);
customerTouchModel.setChatType("single"); customerTouchModel.setChatType("single");
customerTouchModel.setSendType(2); customerTouchModel.setSendType(2);
break; break;
case "9": case "9":
buildMassParam(customerTouchModel, key, value, nodeParam, sopInst, sopInstNode, buildMassParam(customerTouchModel, key, value, nodeParam, sopInst, sopInstNode,
sopTaskExecuteStaffModels); sopTaskExecuteStaffModels);
customerTouchModel.setSendType(3); customerTouchModel.setSendType(3);
break; break;
default: default:
break; break;
}
} }
RestTemplate restTemplate = new RestTemplate();
System.out.println("发送消息参数" + JSONObject.toJSONString(customerTouchModel));
post = restTemplate.postForObject(
ConfigUtils.getProperty("sop.baseurl") + sendCustomerUrl,
customerTouchModel, Object.class);
System.out.println("发送消息参数结果" + JSONObject.toJSONString(post));
return (JSONObject) JSONObject.toJSON(collect);
} }
RestTemplate restTemplate = new RestTemplate();
System.out.println("发送消息参数" + JSONObject.toJSONString(customerTouchModel));
post = restTemplate.postForObject(ConfigUtils.getProperty("sop.baseurl") + sendCustomerUrl,
customerTouchModel, Object.class);
System.out.println("发送消息参数结果" + JSONObject.toJSONString(post));
return (JSONObject) JSONObject.toJSON(collect);
} }
map.put("message","未找到匹配客户");
} catch (Exception e) {
e.printStackTrace();
map.put("errMessage", e.getMessage());
} }
return null; return (JSONObject) JSONObject.toJSON(map);
} }
/** /**
...@@ -106,7 +115,7 @@ public class ControllerSendMessageDemo { ...@@ -106,7 +115,7 @@ public class ControllerSendMessageDemo {
List<CustomerInfo> value, String nodeParam, SopInst sopInst, SopInstNode sopInstNode, List<CustomerInfo> value, String nodeParam, SopInst sopInst, SopInstNode sopInstNode,
List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels) { List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels) {
buildDefaultParam(customerTouchModel, sopInst, sopInstNode, nodeParam, buildDefaultParam(customerTouchModel, sopInst, sopInstNode, nodeParam,
sopTaskExecuteStaffModels); sopTaskExecuteStaffModels, false);
List<String> collect = value.stream() List<String> collect = value.stream()
.filter(index -> StringUtils.isNotEmpty(index.getCustomerPhone())) .filter(index -> StringUtils.isNotEmpty(index.getCustomerPhone()))
.map(CustomerInfo::getExternalUserId).collect( .map(CustomerInfo::getExternalUserId).collect(
...@@ -120,21 +129,24 @@ public class ControllerSendMessageDemo { ...@@ -120,21 +129,24 @@ public class ControllerSendMessageDemo {
private static void buildDefaultParam(CustomerTouchModel customerTouchModel, SopInst sopInst, private static void buildDefaultParam(CustomerTouchModel customerTouchModel, SopInst sopInst,
SopInstNode sopInstNode, String nodeParam, SopInstNode sopInstNode, String nodeParam,
List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels) { List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels, boolean flag) {
String taskParam = SopHelper.getListValueFromJsonString(nodeParam, "taskParam"); String taskParam = SopHelper.getListValueFromJsonString(nodeParam, "taskParam");
String contentlists = SopHelper.getListValueFromJsonString(taskParam, "attachments"); String contentlists = SopHelper.getListValueFromJsonString(taskParam, "attachments");
customerTouchModel.setInstId(sopInst.getInstId()); customerTouchModel.setInstId(sopInst.getInstId());
customerTouchModel.setNodeId(sopInstNode.getNodeId()); customerTouchModel.setNodeId(sopInstNode.getNodeId());
String supMerchantNo = SopHelper.getValueFromJsonString(sopInst.getInstParam(),"customData", "supMerchantNo"); String supMerchantNo = SopHelper.getValueFromJsonString(sopInst.getInstParam(), "customData",
"supMerchantNo");
String merchantId = SopHelper.getValueFromJsonString(sopInst.getInstParam(), "merchantId"); String merchantId = SopHelper.getValueFromJsonString(sopInst.getInstParam(), "merchantId");
String merchantName = SopHelper.getValueFromJsonString(sopInst.getInstParam(), "merchantName");
customerTouchModel.setMerchantId(Integer.parseInt(merchantId)); customerTouchModel.setMerchantId(Integer.parseInt(merchantId));
setConverContentList(contentlists, customerTouchModel, sopInst.getInstId(), setConverContentList(contentlists, customerTouchModel, sopInst.getInstId(),
sopInstNode.getNodeId(), merchantId); sopInstNode.getNodeId(), merchantId, merchantName, flag);
customerTouchModel.setSupMerchantNo(Integer.parseInt(supMerchantNo)); customerTouchModel.setSupMerchantNo(Integer.parseInt(supMerchantNo));
} }
private static void setConverContentList(String contentlists, private static void setConverContentList(String contentlists,
CustomerTouchModel customerTouchModel, String instId, Integer nodeId, String merchantId) { CustomerTouchModel customerTouchModel, String instId, Integer nodeId, String merchantId,
String merchantName, boolean flag) {
List<CustomerTouchSourceModel> customerTouchSourceModels = JSONObject.parseArray(contentlists, List<CustomerTouchSourceModel> customerTouchSourceModels = JSONObject.parseArray(contentlists,
CustomerTouchSourceModel.class); CustomerTouchSourceModel.class);
if (CollectionUtils.isNotEmpty(customerTouchSourceModels)) { if (CollectionUtils.isNotEmpty(customerTouchSourceModels)) {
...@@ -146,6 +158,15 @@ public class ControllerSendMessageDemo { ...@@ -146,6 +158,15 @@ public class ControllerSendMessageDemo {
.replace("{3}", instId); .replace("{3}", instId);
customerTouchSourceModel.setAttContent(replace); customerTouchSourceModel.setAttContent(replace);
} }
if (1 == attType.intValue()) {
String attContent = customerTouchSourceModel.getAttContent();
if (flag) {
String replace = "【" + merchantName + "】" + attContent;
customerTouchSourceModel.setAttContent(replace);
} else {
customerTouchSourceModel.setAttContent(attContent);
}
}
} }
} }
customerTouchModel.setContentList(customerTouchSourceModels); customerTouchModel.setContentList(customerTouchSourceModels);
...@@ -165,7 +186,7 @@ public class ControllerSendMessageDemo { ...@@ -165,7 +186,7 @@ public class ControllerSendMessageDemo {
List<CustomerInfo> value, String nodeParam, SopInst sopInst, SopInstNode sopInstNode, List<CustomerInfo> value, String nodeParam, SopInst sopInst, SopInstNode sopInstNode,
List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels) { List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels) {
buildDefaultParam(customerTouchModel, sopInst, sopInstNode, nodeParam, buildDefaultParam(customerTouchModel, sopInst, sopInstNode, nodeParam,
sopTaskExecuteStaffModels); sopTaskExecuteStaffModels, true);
List<String> phones = value.stream() List<String> phones = value.stream()
.filter(index -> StringUtils.isNotEmpty(index.getCustomerPhone())) .filter(index -> StringUtils.isNotEmpty(index.getCustomerPhone()))
.map(CustomerInfo::getCustomerPhone).collect( .map(CustomerInfo::getCustomerPhone).collect(
......
...@@ -38,73 +38,87 @@ public class ControllerSendRemindDemo { ...@@ -38,73 +38,87 @@ public class ControllerSendRemindDemo {
public static JSON execute(JSON param) { public static JSON execute(JSON param) {
// 将JSON字符串转换为Map // 将JSON字符串转换为Map
// 将Map中的数据放入MultiValueMap中 // 将Map中的数据放入MultiValueMap中
Map map=new HashMap();
Object post = null; Object post = null;
MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>(); try {
SopExecutorResult excustorParam = SopHelper.getExcustorParam(param); MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>();
Map<String, Object> resultData = excustorParam.getResultData(); SopExecutorResult excustorParam = SopHelper.getExcustorParam(param);
SopInst sopInst = excustorParam.getSopInst(); Map<String, Object> resultData = excustorParam.getResultData();
SopInstNode sopInstNode = excustorParam.getSopInstNode(); SopInst sopInst = excustorParam.getSopInst();
SopInstNodeBatch nodeBatch = excustorParam.getNodeBatch(); SopInstNode sopInstNode = excustorParam.getSopInstNode();
SopInstBatch batch = excustorParam.getBatch(); SopInstNodeBatch nodeBatch = excustorParam.getNodeBatch();
String nodeParam = sopInstNode.getNodeParam(); SopInstBatch batch = excustorParam.getBatch();
String nodeParam = sopInstNode.getNodeParam();
List<CustomerInfo> customerInfoList = SopHelper.getMeetWithCustomer(sopInstNode, resultData); List<CustomerInfo> customerInfoList = SopHelper.getMeetWithCustomer(sopInstNode, resultData);
// 营销的客户存在 // 营销的客户存在
if (CollectionUtils.isNotEmpty(customerInfoList)) { if (CollectionUtils.isNotEmpty(customerInfoList)) {
List<String> filterUserList = null; List<String> filterUserList = null;
// 获取营销类型 发送提醒 // 获取营销类型 发送提醒
String sendType = SopHelper.getValueFromJsonString(nodeParam, "taskType"); String sendType = SopHelper.getValueFromJsonString(nodeParam, "taskType");
String taskParam = SopHelper.getListValueFromJsonString(nodeParam, "taskParam"); String taskParam = SopHelper.getListValueFromJsonString(nodeParam, "taskParam");
String userIds = SopHelper.getValueFromJsonString(taskParam, "staffUserIds"); String userIds = SopHelper.getValueFromJsonString(taskParam, "staffUserIds");
if (StringUtils.isNotEmpty(userIds)) { if (StringUtils.isNotEmpty(userIds)) {
filterUserList = Arrays.asList(userIds.split(",")); filterUserList = Arrays.asList(userIds.split(","));
} }
if (StringUtils.isNotEmpty(sendType)) { if (StringUtils.isNotEmpty(sendType)) {
Map<String, List<CustomerInfo>> collect = customerInfoList.stream() Map<String, List<CustomerInfo>> collect = customerInfoList.stream()
.collect(Collectors.groupingBy(CustomerInfo::getUserId)); .collect(Collectors.groupingBy(CustomerInfo::getUserId));
Iterator<Entry<String, List<CustomerInfo>>> iterator = collect.entrySet().iterator(); Iterator<Entry<String, List<CustomerInfo>>> iterator = collect.entrySet().iterator();
List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels=new ArrayList<>(); List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels = new ArrayList<>();
SopTaskToStaffExecuteModel customerTouchModel = new SopTaskToStaffExecuteModel(); SopTaskToStaffExecuteModel customerTouchModel = new SopTaskToStaffExecuteModel();
while (iterator.hasNext()) { while (iterator.hasNext()) {
SopTaskExecuteStaffModel sopTaskExecuteStaffModel=new SopTaskExecuteStaffModel(); SopTaskExecuteStaffModel sopTaskExecuteStaffModel = new SopTaskExecuteStaffModel();
Entry<String, List<CustomerInfo>> next = iterator.next(); Entry<String, List<CustomerInfo>> next = iterator.next();
String key = next.getKey(); String key = next.getKey();
List<CustomerInfo> value = next.getValue(); List<CustomerInfo> value = next.getValue();
// 过滤条件为空,或者过滤条件存在 // 过滤条件为空,或者过滤条件存在
if (CollectionUtils.isEmpty(filterUserList) || (CollectionUtils.isNotEmpty(filterUserList) if (CollectionUtils.isEmpty(filterUserList) || (
&& filterUserList.contains(key))) { CollectionUtils.isNotEmpty(filterUserList)
List<String> externalUserList = value.stream() && filterUserList.contains(key))) {
.filter(index -> StringUtils.isNotEmpty(index.getExternalUserId())) List<String> externalUserList = value.stream()
.map(CustomerInfo::getExternalUserId).collect( .filter(index -> StringUtils.isNotEmpty(index.getExternalUserId()))
Collectors.toList()); .map(CustomerInfo::getExternalUserId).collect(
sopTaskExecuteStaffModel.setSendUserId(key); Collectors.toList());
sopTaskExecuteStaffModel.setSendExternalUserId(externalUserList); sopTaskExecuteStaffModel.setSendUserId(key);
sopTaskExecuteStaffModels.add(sopTaskExecuteStaffModel); sopTaskExecuteStaffModel.setSendExternalUserId(externalUserList);
sopTaskExecuteStaffModels.add(sopTaskExecuteStaffModel);
}
}
if(CollectionUtils.isNotEmpty(sopTaskExecuteStaffModels)) {
customerTouchModel.setExecuteStaffRequestList(sopTaskExecuteStaffModels); customerTouchModel.setExecuteStaffRequestList(sopTaskExecuteStaffModels);
buildDefaultParam(customerTouchModel, sopInst, sopInstNode, nodeParam,nodeBatch.getNodeBatchNo(),batch.getBatchNo()); buildDefaultParam(customerTouchModel, sopInst, sopInstNode, nodeParam,
nodeBatch.getNodeBatchNo(), batch.getBatchNo());
RestTemplate restTemplate = new RestTemplate();
System.out.println("发送提醒参数" + JSONObject.toJSONString(customerTouchModel));
post = restTemplate.postForObject(ConfigUtils.getProperty("sop.baseurl") + sendStaffUrl,
customerTouchModel, Object.class);
System.out.println("发送提醒参数结果" + JSONObject.toJSONString(customerTouchModel));
return (JSONObject) JSONObject.toJSON(collect);
} }
map.put("message","未找到匹配客户");
} }
RestTemplate restTemplate = new RestTemplate();
System.out.println("发送提醒参数"+JSONObject.toJSONString(customerTouchModel));
post = restTemplate.postForObject(ConfigUtils.getProperty("sop.baseurl")+sendStaffUrl, customerTouchModel, Object.class);
System.out.println("发送提醒参数结果"+JSONObject.toJSONString(customerTouchModel));
return (JSONObject) JSONObject.toJSON(collect);
} }
map.put("message","未找到匹配客户");
} catch (Exception e) {
e.printStackTrace();
map.put("errMessage",e.getMessage());
} }
return null; return (JSONObject) JSONObject.toJSON(map);
} }
/** /**
* 构建发送提醒链接 * 构建发送提醒链接
* *
* @param customerTouchModel 客户信息 * @param customerTouchModel 客户信息
* @param sopInst 实例 * @param sopInst 实例
* @param sopInstNode 节点 * @param sopInstNode 节点
* @param nodeParam 节点参数 * @param nodeParam 节点参数
* @param notebatchNo 节点批次号 * @param notebatchNo 节点批次号
* @param batchNo 实例批次号 * @param batchNo 实例批次号
*/ */
private static void buildDefaultParam(SopTaskToStaffExecuteModel customerTouchModel, SopInst sopInst, private static void buildDefaultParam(SopTaskToStaffExecuteModel customerTouchModel,
SopInst sopInst,
SopInstNode sopInstNode, String nodeParam, String notebatchNo, String batchNo) { SopInstNode sopInstNode, String nodeParam, String notebatchNo, String batchNo) {
String taskParam = SopHelper.getListValueFromJsonString(nodeParam, "taskParam"); String taskParam = SopHelper.getListValueFromJsonString(nodeParam, "taskParam");
String noticeContent = SopHelper.getValueFromJsonString(taskParam, "content"); String noticeContent = SopHelper.getValueFromJsonString(taskParam, "content");
...@@ -113,15 +127,20 @@ public class ControllerSendRemindDemo { ...@@ -113,15 +127,20 @@ public class ControllerSendRemindDemo {
int size = sopTaskExecuteStaffModel.getSendExternalUserId().size(); int size = sopTaskExecuteStaffModel.getSendExternalUserId().size();
String replace = noticeContent.replace("{客户人数}", size + ""); String replace = noticeContent.replace("{客户人数}", size + "");
// 链接追加参数 // 链接追加参数
customerTouchModel.setUrl(ConfigUtils.getProperty("notict.url")+"?notebatchNo="+notebatchNo+"&batchNo="+ customerTouchModel.setUrl(
batchNo+"&nodeId="+sopInstNode.getNodeId()+"&userId="+sopTaskExecuteStaffModel.getSendUserId()+"&noticeContent="+replace); ConfigUtils.getProperty("notict.url") + "?notebatchNo=" + notebatchNo + "&batchNo=" +
batchNo + "&nodeId=" + sopInstNode.getInstNodeId() + "&userId="
+ sopTaskExecuteStaffModel.getSendUserId() + "&noticeContent=" + replace);
customerTouchModel.setTitle("客户跟进提醒"); customerTouchModel.setTitle("客户跟进提醒");
customerTouchModel.setDescription("您有"+sopTaskExecuteStaffModel.getSendExternalUserId().size()+"位客户的待跟进,请及时跟进。"); customerTouchModel.setDescription(
"您有" + sopTaskExecuteStaffModel.getSendExternalUserId().size()
+ "位客户的待跟进,请及时跟进。");
String msgtype = SopHelper.getValueFromJsonString(nodeParam, "msgtype"); String msgtype = SopHelper.getValueFromJsonString(nodeParam, "msgtype");
customerTouchModel.setInstId(sopInst.getInstId()); customerTouchModel.setInstId(sopInst.getInstId());
customerTouchModel.setType("textcard"); customerTouchModel.setType("textcard");
customerTouchModel.setNodeId(sopInstNode.getNodeId()); customerTouchModel.setNodeId(sopInstNode.getNodeId());
String supMerchantNo = SopHelper.getValueFromJsonString(sopInst.getInstParam(),"customData", "supMerchantNo"); String supMerchantNo = SopHelper.getValueFromJsonString(sopInst.getInstParam(), "customData",
"supMerchantNo");
String merchantId = SopHelper.getValueFromJsonString(sopInst.getInstParam(), "merchantId"); String merchantId = SopHelper.getValueFromJsonString(sopInst.getInstParam(), "merchantId");
customerTouchModel.setMerchantId(Integer.parseInt(merchantId)); customerTouchModel.setMerchantId(Integer.parseInt(merchantId));
customerTouchModel.setSupMerchantNo(Integer.parseInt(supMerchantNo)); customerTouchModel.setSupMerchantNo(Integer.parseInt(supMerchantNo));
......
...@@ -85,7 +85,7 @@ public class JavaNodeTestApplication { ...@@ -85,7 +85,7 @@ public class JavaNodeTestApplication {
customerInfo.setCustomerPhone("13476670746"); customerInfo.setCustomerPhone("13476670746");
customerInfo.setFollowStaffPhone("13476670746"); customerInfo.setFollowStaffPhone("13476670746");
customerInfo.setSopJourneyStage("潜客"); customerInfo.setSopJourneyStage("潜客");
customerInfo.setSopJourneyStageEnterTime(DateUtils.parse("2024-01-04")); customerInfo.setSopJourneyStageEnterTime(DateUtils.parse("2024-01-07"));
resultData.put("user2", Arrays.asList(customerInfo)); resultData.put("user2", 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);
...@@ -260,6 +260,7 @@ public class JavaNodeTestApplication { ...@@ -260,6 +260,7 @@ public class JavaNodeTestApplication {
String ControllerSendMessageDemo = JavaFileToString.getString( String ControllerSendMessageDemo = JavaFileToString.getString(
"F:\\360MoveData\\Users\\11\\Desktop\\企微SAAS\\2023\\12\\sop\\process\\platform-process-server\\platform-process\\src\\main\\java\\cn\\com\\glsx\\process\\modules\\sop\\java\\example\\ControllerSendMessageDemo.java", "F:\\360MoveData\\Users\\11\\Desktop\\企微SAAS\\2023\\12\\sop\\process\\platform-process-server\\platform-process\\src\\main\\java\\cn\\com\\glsx\\process\\modules\\sop\\java\\example\\ControllerSendMessageDemo.java",
"ControllerSendMessageDemo"); "ControllerSendMessageDemo");
System.out.println(ControllerSendMessageDemo);
SopTplNodeProto sopTplNodeProto=new SopTplNodeProto(); SopTplNodeProto sopTplNodeProto=new SopTplNodeProto();
sopTplNodeProto.setId(7); sopTplNodeProto.setId(7);
sopTplNodeProto.setNodeContentDef(ControllerSendMessageDemo); sopTplNodeProto.setNodeContentDef(ControllerSendMessageDemo);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!