Commit b9073974 by zhouhaibao

[+]新增java节点

1 parent 9de13885
Showing 19 changed files with 277 additions and 93 deletions
......@@ -2,8 +2,12 @@ package cn.com.glsx.process.modules.mapper;
import cn.com.glsx.process.modules.entity.SopInstNodeBatch;
import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SopInstNodeBatchMapper extends CommonBaseMapper<SopInstNodeBatch> {
List<SopInstNodeBatch> findByCondition(@Param("sopInstNodeBatch") SopInstNodeBatch sopInstNodeBatch);
}
\ No newline at end of file
......@@ -18,7 +18,7 @@ public interface SopInstNodeMapper extends CommonBaseMapper<SopInstNode> {
int resetInstNodeDailyCount(@Param("instId") String instId);
PageInfo<SopTaskDTO> findPageListByInstId(@Param("instId")String instId);
List<SopTaskDTO> findPageListByInstId(@Param("instId")String instId);
int updateNodeParamById(@Param("instNodeId") Integer instNodeId, @Param("nodeParam") Map<String, Object> nodeParam);
}
\ No newline at end of file
package cn.com.glsx.process.modules.model.task;
import cn.hutool.db.Page;
import java.io.Serializable;
import lombok.Data;
@Data
public class SopTaskSearch extends Page {
public class SopTaskSearch extends Page implements Serializable {
/**
......
......@@ -77,12 +77,12 @@
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<!-- <dependency>
<groupId>com.github.kuhn-he</groupId>
<artifactId>elastic-job-lite-spring-boot-starter</artifactId>
<version>2.1.5</version>
</dependency>
-->
<!-- xxl-job依赖,maven仓库有该依赖,不需要手动安装 -->
<dependency>
<groupId>com.xuxueli</groupId>
......@@ -156,6 +156,11 @@
<groupId>com.glsx</groupId>
<artifactId>rest-admin-office</artifactId>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.3.2</version>
</dependency>
</dependencies>
<build>
......
......@@ -108,8 +108,8 @@ public class SopInstController extends BaseController {
}
@Operation(summary = "查询任务详情", description = "查询任务详情")
@GetMapping("/getTaskList")
public PageInfo<SopTaskDTO> getTaskList(@RequestParam SopTaskSearch search) {
@PostMapping("/getTaskList")
public PageInfo<SopTaskDTO> getTaskList(@RequestBody SopTaskSearch search) {
return sopInstService.getTaskList(search);
}
......
......@@ -67,7 +67,7 @@ public class SopInstNodeBatchService {
* @return
*/
public List<SopInstNodeBatch> findByCondition(SopInstNodeBatch sopInstNodeBatch) {
return sopInstNodeBatchMapper.selectByExample(
return sopInstNodeBatchMapper.findByCondition(
sopInstNodeBatch);
}
}
......@@ -554,15 +554,16 @@ public class SopInstService {
public PageInfo<SopTaskDTO> getTaskList(SopTaskSearch search) {
PageHelper.startPage(search.getPageNumber(), search.getPageSize());
PageInfo<SopTaskDTO> sopInstNodeList=sopInstNodeMapper.findPageListByInstId(search.getInstId());
List<SopTaskDTO> sopTaskDTOList = sopInstNodeList.getList();
List<SopTaskDTO> sopTaskDTOList=sopInstNodeMapper.findPageListByInstId(search.getInstId());
if(org.apache.commons.collections.CollectionUtils.isNotEmpty(sopTaskDTOList)){
List<Integer> collect = sopTaskDTOList.stream().map(SopTaskDTO::getNodeId)
.collect(Collectors.toList());
SopNodeTaskSearch sopNodeTaskSearch=new SopNodeTaskSearch();
sopNodeTaskSearch.setInstId(search.getInstId());
sopNodeTaskSearch.setNodeIds(collect);
List<SopNodeTaskStaticModel> list = sopInstNodeTaskApiClient.findList(sopNodeTaskSearch);
Result<List<SopNodeTaskStaticModel>> sopInstNodeTaskApiClientList = sopInstNodeTaskApiClient.findList(
sopNodeTaskSearch);
List<SopNodeTaskStaticModel> list = sopInstNodeTaskApiClientList.getData();
sopTaskDTOList.forEach(index->{
String nodeParam = index.getNodeParam();
String day = SopHelper.getValueFromJsonString(nodeParam, "day");
......@@ -572,7 +573,7 @@ public class SopInstService {
index.setTaskType(Integer.parseInt(taskType));
if(org.apache.commons.collections.CollectionUtils.isNotEmpty(list)){
List<SopNodeTaskStaticModel> sopNodeTaskStaticModelList = list.stream()
.filter(ind -> ind.getNodeId().equals(index.getInstId())).collect(
.filter(ind -> ind.getNodeId().equals(index.getNodeId())).collect(
Collectors.toList());
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(sopNodeTaskStaticModelList)){
SopNodeTaskStaticModel sopNodeTaskStaticModel = sopNodeTaskStaticModelList.get(
......@@ -585,7 +586,7 @@ public class SopInstService {
}
});
}
return sopInstNodeList;
return new PageInfo<>(sopTaskDTOList);
}
/**
......@@ -607,10 +608,10 @@ public class SopInstService {
sopInstNodeBatch);
if(!CollectionUtils.isEmpty(byCondition)){
String snapshot = byCondition.get(0).getSnapshot();
String valueFromJsonString = SopHelper.getValueFromJsonString(snapshot, "resultMap",
String valueFromJsonString = SopHelper.getValueListFromJsonString(snapshot, "resultMap",
nodeKey);
if(org.apache.commons.lang3.StringUtils.isNotEmpty(valueFromJsonString)) {
Map map = JSONObject.parseObject(snapshot, Map.class);
Map map = JSONObject.parseObject(valueFromJsonString, Map.class);
Object o = map.get(sopNoticeDetailSearch.getUserId());
return Result.success(o);
}
......
......@@ -91,4 +91,6 @@ public class CustomerInfo {
* scrm的oneid
*/
private String scrmOneId;
private String carNumber;
}
......@@ -246,6 +246,18 @@ public class SopHelper {
}
return null;
}
public static String getValueListFromJsonString(String jsonString, String objectName, String fieldName) {
try {
ObjectMapper objectMapper = new ObjectMapper();
JsonNode rootNode = objectMapper.readTree(jsonString);
JsonNode objectNode = rootNode.get(objectName);
JsonNode fieldNode = objectNode.get(fieldName);
return objectMapper.writeValueAsString(fieldNode);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static String getValueFromJsonString(String jsonString, String objectName, String objectNameTwo, String fieldName) {
try {
......@@ -276,6 +288,21 @@ public class SopHelper {
}
return null;
}
public static String getListValueFromJsonString(String jsonString, String fieldName) {
try {
ObjectMapper objectMapper = new ObjectMapper();
JsonNode rootNode = objectMapper.readTree(jsonString);
JsonNode fieldNode = rootNode.get(fieldName);
if (fieldNode != null) {
return objectMapper.writeValueAsString(fieldNode);
} else {
return null;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static <T> T post(MultiValueMap<String, String> paramsMap, Class<T> responseType, String baseurl, String method) throws Exception {
addBaseParam(paramsMap, method);
......
package cn.com.glsx.process.modules.sop.java.example;
import cn.com.glsx.process.modules.entity.SopInst;
import cn.com.glsx.process.modules.sop.ConfigUtils;
import cn.com.glsx.process.modules.sop.SopExecutorResult;
import cn.com.glsx.process.modules.sop.SopHelper;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
/**
* java执行器使用demo,rop请求,类名Controller,方法名execute 获取门店的国任客户
*/
public class ControllerGetGrCusDemo {
private final static String baseurl = "/rop-scrm-shopmall/router";
private final static String method = "entmicro.api.customer.sendCustomerToSop";
public static JSON execute(JSON param) {
// 将JSON字符串转换为Map
// 将Map中的数据放入MultiValueMap中
Object post = null;
MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>();
SopExecutorResult excustorParam = SopHelper.getExcustorParam(param);
SopInst sopInst = excustorParam.getSopInst();
String instParam = sopInst.getInstParam();
try {
String instDefalutName = SopHelper.getValueFromJsonString(instParam, "stages", "stage1",
"value");
multiValueMap.add("merchantId",sopInst.getGrantId()+"");
multiValueMap.add("instId",sopInst.getInstId());
multiValueMap.add("instDefalutName",instDefalutName);
System.out.println("入参" + JSONObject.toJSONString(multiValueMap));
post = SopHelper.post(multiValueMap, Object.class, ConfigUtils.getProperty("scrm.baseurl")+ baseurl, method);
System.out.println("返回" + JSONObject.toJSONString(post));
} catch (Exception e) {
throw new RuntimeException(e);
}
return (JSONObject) JSONObject.toJSON(post);
}
}
\ No newline at end of file
......@@ -8,9 +8,11 @@ import cn.com.glsx.process.modules.sop.SopExecutorResult;
import cn.com.glsx.process.modules.sop.SopHelper;
import cn.com.glsx.process.modules.sop.java.model.CustomerTouchModel;
import cn.com.glsx.process.modules.sop.java.model.CustomerTouchSourceModel;
import cn.com.glsx.process.modules.sop.java.model.SopTaskExecuteStaffModel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
......@@ -45,44 +47,44 @@ public class ControllerSendMessageDemo {
// 营销的客户存在
if (CollectionUtils.isNotEmpty(customerInfoList)) {
// 获取营销类型 1.短信发送 2.企微群发 3.企微朋友圈
String sendType = SopHelper.getValueFromJsonString(nodeParam, "sendType");
String sendType = SopHelper.getValueFromJsonString(nodeParam, "taskType");
if (StringUtils.isNotEmpty(sendType)) {
List<CustomerTouchModel> customerTouchModels = new ArrayList<>();
Map<String, List<CustomerInfo>> collect = customerInfoList.stream()
.collect(Collectors.groupingBy(CustomerInfo::getUserId));
Iterator<Entry<String, List<CustomerInfo>>> iterator = collect.entrySet().iterator();
while (iterator.hasNext()) {
CustomerTouchModel customerTouchModel = new CustomerTouchModel();
while (iterator.hasNext()) {
List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels=new ArrayList<>();
customerTouchModel.setSendType(Integer.parseInt(sendType));
Entry<String, List<CustomerInfo>> next = iterator.next();
String key = next.getKey();
List<CustomerInfo> value = next.getValue();
switch (sendType) {
case "1":
buildMessageParam(customerTouchModel, value, nodeParam, sopInst, sopInstNode);
buildMessageParam(customerTouchModel, value, nodeParam, sopInst, sopInstNode,sopTaskExecuteStaffModels);
break;
case "2":
buildMassParam(customerTouchModel, key, value, nodeParam, sopInst, sopInstNode,sopTaskExecuteStaffModels);
customerTouchModel.setChatType("single");
break;
case "3":
buildMassParam(customerTouchModel, key, value, nodeParam, sopInst, sopInstNode);
buildMassParam(customerTouchModel, key, value, nodeParam, sopInst, sopInstNode,sopTaskExecuteStaffModels);
break;
default:
break;
}
customerTouchModels.add(customerTouchModel);
}
RestTemplate restTemplate = new RestTemplate();
post = restTemplate.postForObject(ConfigUtils.getProperty("scrm.sopurl")+sendCustomerUrl, customerTouchModels, Object.class);
System.out.println("发送消息参数"+JSONObject.toJSONString(customerTouchModel));
post = restTemplate.postForObject(ConfigUtils.getProperty("sop.baseurl") + sendCustomerUrl,
customerTouchModel, Object.class);
}
return (JSONObject) JSONObject.toJSON(post);
}
return null;
}
private static void buildMonmentParam(CustomerTouchModel customerTouchModel, String key,
List<CustomerInfo> value, String nodeParam, SopInst sopInst, SopInstNode sopInstNode) {
}
/**
* 构建短信参数
*
......@@ -92,48 +94,56 @@ public class ControllerSendMessageDemo {
* @param nodeParam 节点入参信息
* @param sopInst 实例信息
* @param sopInstNode 实例节点信息
* @param sopTaskExecuteStaffModels
*/
private static void buildMassParam(CustomerTouchModel customerTouchModel, String key,
List<CustomerInfo> value, String nodeParam, SopInst sopInst, SopInstNode sopInstNode) {
buildDefaultParam(customerTouchModel, sopInst, sopInstNode, nodeParam);
List<CustomerInfo> value, String nodeParam, SopInst sopInst, SopInstNode sopInstNode,
List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels) {
buildDefaultParam(customerTouchModel, sopInst, sopInstNode, nodeParam,
sopTaskExecuteStaffModels);
List<String> collect = value.stream()
.filter(index -> StringUtils.isNotEmpty(index.getCustomerPhone()))
.map(CustomerInfo::getExternalUserId).collect(
Collectors.toList());
customerTouchModel.setSendExternalUserId(collect);
customerTouchModel.setSendUserId(key);
SopTaskExecuteStaffModel sopTaskExecuteStaffModel=new SopTaskExecuteStaffModel();
sopTaskExecuteStaffModel.setSendExternalUserId(collect);
sopTaskExecuteStaffModel.setSendUserId(key);
sopTaskExecuteStaffModels.add(sopTaskExecuteStaffModel);
customerTouchModel.setExecuteStaffRequestList(sopTaskExecuteStaffModels);
}
private static void buildDefaultParam(CustomerTouchModel customerTouchModel, SopInst sopInst,
SopInstNode sopInstNode, String nodeParam) {
String contentlists = SopHelper.getValueFromJsonString(nodeParam, "contentlists");
SopInstNode sopInstNode, String nodeParam,
List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels) {
String contentlists = SopHelper.getListValueFromJsonString(nodeParam, "contentlists");
customerTouchModel.setInstId(sopInst.getInstId());
customerTouchModel.setMerchantNo(sopInst.getGrantId());
customerTouchModel.setNodeId(sopInstNode.getNodeId());
customerTouchModel.setContentlists(JSONObject.parseArray(contentlists,
customerTouchModel.setContentList(JSONObject.parseArray(contentlists,
CustomerTouchSourceModel.class));
String valueFromJsonString = SopHelper.getValueFromJsonString(sopInst.getInstSnapshot(),
"initMap", "supMerchantNo");
customerTouchModel.setSupMerchantNo(Integer.parseInt(valueFromJsonString));
String supMerchantNo = SopHelper.getValueFromJsonString(sopInst.getInstParam(), "supMerchantNo");
String merchantId = SopHelper.getValueFromJsonString(sopInst.getInstParam(), "merchantId");
customerTouchModel.setMerchantId(Integer.parseInt(merchantId));
customerTouchModel.setSupMerchantNo(Integer.parseInt(supMerchantNo));
}
/**
* 构建短信参数
*
* @param customerTouchModel 参数
* @param key 员工id
* @param value
* @param nodeParam 节点入参信息
* @param sopInst 实例信息
* @param sopInstNode 实例节点信息
* @param sopTaskExecuteStaffModels
*/
private static void buildMessageParam(CustomerTouchModel customerTouchModel,
List<CustomerInfo> value, String nodeParam, SopInst sopInst, SopInstNode sopInstNode) {
buildDefaultParam(customerTouchModel, sopInst, sopInstNode, nodeParam);
List<CustomerInfo> value, String nodeParam, SopInst sopInst, SopInstNode sopInstNode,
List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels) {
buildDefaultParam(customerTouchModel, sopInst, sopInstNode, nodeParam,sopTaskExecuteStaffModels);
List<String> phones = value.stream()
.filter(index -> StringUtils.isNotEmpty(index.getCustomerPhone()))
.map(CustomerInfo::getCustomerPhone).collect(
Collectors.toList());
customerTouchModel.setSendPhone(phones);
customerTouchModel.setSendPhoneList(phones);
}
}
\ No newline at end of file
......@@ -9,6 +9,8 @@ import cn.com.glsx.process.modules.sop.CustomerInfo;
import cn.com.glsx.process.modules.sop.SopExecutorResult;
import cn.com.glsx.process.modules.sop.SopHelper;
import cn.com.glsx.process.modules.sop.java.model.CustomerTouchModel;
import cn.com.glsx.process.modules.sop.java.model.SopTaskExecuteStaffModel;
import cn.com.glsx.process.modules.sop.java.model.SopTaskToStaffExecuteModel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList;
......@@ -51,7 +53,7 @@ public class ControllerSendRemindDemo {
if (CollectionUtils.isNotEmpty(customerInfoList)) {
List<String> filterUserList = null;
// 获取营销类型 发送提醒
String sendType = SopHelper.getValueFromJsonString(nodeParam, "sendType");
String sendType = SopHelper.getValueFromJsonString(nodeParam, "taskType");
String userIds = SopHelper.getValueFromJsonString(nodeParam, "userIds");
if (StringUtils.isNotEmpty(userIds)) {
filterUserList = Arrays.asList(userIds.split(","));
......@@ -61,27 +63,30 @@ public class ControllerSendRemindDemo {
Map<String, List<CustomerInfo>> collect = customerInfoList.stream()
.collect(Collectors.groupingBy(CustomerInfo::getUserId));
Iterator<Entry<String, List<CustomerInfo>>> iterator = collect.entrySet().iterator();
List<SopTaskExecuteStaffModel> sopTaskExecuteStaffModels=new ArrayList<>();
SopTaskToStaffExecuteModel customerTouchModel = new SopTaskToStaffExecuteModel();
while (iterator.hasNext()) {
SopTaskExecuteStaffModel sopTaskExecuteStaffModel=new SopTaskExecuteStaffModel();
Entry<String, List<CustomerInfo>> next = iterator.next();
String key = next.getKey();
List<CustomerInfo> value = next.getValue();
// 过滤条件为空,或者过滤条件存在
if (CollectionUtils.isEmpty(filterUserList) || (CollectionUtils.isNotEmpty(filterUserList)
&& filterUserList.contains(key))) {
CustomerTouchModel customerTouchModel = new CustomerTouchModel();
buildDefaultParam(customerTouchModel, sopInst, sopInstNode, nodeParam,nodeBatch.getBatchNo(),batch.getBatchNo());
customerTouchModel.setSendType(Integer.parseInt(sendType));
customerTouchModel.setSendUserId(key);
List<String> externalUserList = value.stream()
.filter(index -> StringUtils.isNotEmpty(index.getExternalUserId()))
.map(CustomerInfo::getExternalUserId).collect(
Collectors.toList());
customerTouchModel.setSendExternalUserId(externalUserList);
customerTouchModels.add(customerTouchModel);
sopTaskExecuteStaffModel.setSendUserId(key);
sopTaskExecuteStaffModel.setSendExternalUserId(externalUserList);
sopTaskExecuteStaffModels.add(sopTaskExecuteStaffModel);
customerTouchModel.setExecuteStaffRequestList(sopTaskExecuteStaffModels);
buildDefaultParam(customerTouchModel, sopInst, sopInstNode, nodeParam,nodeBatch.getNodeBatchNo(),batch.getBatchNo());
}
}
RestTemplate restTemplate = new RestTemplate();
post = restTemplate.postForObject(ConfigUtils.getProperty("scrm.sopurl")+sendStaffUrl, customerTouchModels, Object.class);
System.out.println("发送提醒参数"+JSONObject.toJSONString(customerTouchModel));
post = restTemplate.postForObject(ConfigUtils.getProperty("sop.baseurl")+sendStaffUrl, customerTouchModel, Object.class);
return (JSONObject) JSONObject.toJSON(collect);
}
}
......@@ -98,26 +103,26 @@ public class ControllerSendRemindDemo {
* @param notebatchNo 节点批次号
* @param batchNo 实例批次号
*/
private static void buildDefaultParam(CustomerTouchModel customerTouchModel, SopInst sopInst,
private static void buildDefaultParam(SopTaskToStaffExecuteModel customerTouchModel, SopInst sopInst,
SopInstNode sopInstNode, String nodeParam, String notebatchNo, String batchNo) {
String noticeContent = SopHelper.getValueFromJsonString(nodeParam, "noticeContent");
int size = customerTouchModel.getSendExternalUserId().size();
SopTaskExecuteStaffModel sopTaskExecuteStaffModel = customerTouchModel.getExecuteStaffRequestList()
.get(0);
int size = sopTaskExecuteStaffModel.getSendExternalUserId().size();
noticeContent.replace("{客户人数}",size+"");
// 链接追加参数
Map map = new HashMap();
map.put("url",ConfigUtils.getProperty("notict.url")+"?notebatchNo="+notebatchNo+"&batchNo="+
batchNo+"&nodeId="+sopInstNode.getNodeId()+"&userId="+customerTouchModel.getSendUserId()+"&noticeContent="+noticeContent);
map.put("title","客户跟进提醒");
map.put("description","您有"+customerTouchModel.getSendExternalUserId().size()+"位客户的待跟进,请及时跟进。");
customerTouchModel.setUrl(ConfigUtils.getProperty("notict.url")+"?notebatchNo="+notebatchNo+"&batchNo="+
batchNo+"&nodeId="+sopInstNode.getNodeId()+"&userId="+sopTaskExecuteStaffModel.getSendUserId()+"&noticeContent="+noticeContent);
customerTouchModel.setTitle("客户跟进提醒");
customerTouchModel.setDescription("您有"+sopTaskExecuteStaffModel.getSendExternalUserId().size()+"位客户的待跟进,请及时跟进。");
String msgtype = SopHelper.getValueFromJsonString(nodeParam, "msgtype");
customerTouchModel.setInstId(sopInst.getInstId());
customerTouchModel.setNotice(JSONObject.toJSONString(map));
customerTouchModel.setMsgtype(msgtype);
customerTouchModel.setMerchantNo(sopInst.getGrantId());
customerTouchModel.setType("textcard");
customerTouchModel.setNodeId(sopInstNode.getNodeId());
String valueFromJsonString = SopHelper.getValueFromJsonString(sopInst.getInstSnapshot(),
"initMap", "supMerchantNo");
customerTouchModel.setSupMerchantNo(Integer.parseInt(valueFromJsonString));
String supMerchantNo = SopHelper.getValueFromJsonString(sopInst.getInstParam(), "supMerchantNo");
String merchantId = SopHelper.getValueFromJsonString(sopInst.getInstParam(), "merchantId");
customerTouchModel.setMerchantId(Integer.parseInt(merchantId));
customerTouchModel.setSupMerchantNo(Integer.parseInt(supMerchantNo));
}
}
\ No newline at end of file
package cn.com.glsx.process.modules.sop.java.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import lombok.Data;
......@@ -18,22 +20,13 @@ public class CustomerTouchModel {
/**
* 发送手机号
*/
private List<String> sendPhone;
private List<String> sendPhoneList;
/**
* 发送员工
*/
private String sendUserId;
/**
* 发送外部联系人
*/
private List<String> sendExternalUserId;
/**
* 商户号
*/
private Integer merchantNo;
private Integer merchantId;
/**
* 实例id
......@@ -50,19 +43,14 @@ public class CustomerTouchModel {
*/
private Integer supMerchantNo;
@JsonProperty("chatType")
@Schema(name = "chatType", description = "群发任务的类型 sendType为2时候必传,默认为single,表示发送给客户,group表示发送给客户群", allowableValues = {"single", "group"})
private String chatType;
/**
* 素材
*/
private List<CustomerTouchSourceModel> contentlists;
private List<CustomerTouchSourceModel> contentList;
/**
* 通知的素材
*/
private String notice;
/**
* 通知类型
*/
private String msgtype;
private List<SopTaskExecuteStaffModel> executeStaffRequestList;
}
package cn.com.glsx.process.modules.sop.java.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
@Data
public class SopTaskExecuteStaffModel implements Serializable {
private String sendUserId;
private List<String> sendExternalUserId;
}
package cn.com.glsx.process.modules.sop.java.model;
import cn.com.glsx.execute.modules.model.sopTask.SopTaskExecuteStaffRequest;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.List;
import javax.validation.constraints.NotNull;
import lombok.Data;
import org.codehaus.jackson.annotate.JsonProperty;
@Data
public class SopTaskToStaffExecuteModel implements Serializable {
@Schema(name = "executeStaffRequestList", description = "发送员工及客户")
private List<SopTaskExecuteStaffModel> executeStaffRequestList;
@JsonProperty("content")
@Schema(name = "content",description = "消息内容")
private String content;
@JsonProperty("description")
@Schema(name = "description",description = "描述")
private String description;
@JsonProperty("merchantId")
@Schema(name = "merchantId",description = "商户号")
private Integer merchantId;
@NotNull
private Integer supMerchantNo;
/**
* 实例id
*/
@NotNull
private String instId;
/**
* 节点id
*/
@NotNull
private Integer nodeId;
@JsonProperty("title")
@Schema(name = "title",description = "内容标题")
private String title;
@JsonProperty("type")
@Schema(name = "type",description = "1:text 2:image 3:voice 4:video 5:file 6:textCard 7:news 8:mpnews 9:markdown 10:miniprogram_notice")
private String type;
@JsonProperty("url")
@Schema(name = "url",description = "点击后跳转的链接")
private String url;
@JsonProperty("mediaId")
@Schema(name = "mediaId",description = "企微mediaId")
private String mediaId;
@JsonProperty("picurl")
@Schema(name = "picurl",description = "图片地址")
private String picurl;
@JsonProperty("btnTxt")
@Schema(name = "btnTxt",description = "按钮文字。 默认为“详情”, 不超过4个文字")
private String btnTxt;
}
scrm.baseurl=http://scrm.dev.glsx.com.cn
sop.baseurl=http://gateway.platform.dev.glsx.com.cn
notict.url=
\ No newline at end of file
sop.baseurl=http://192.168.3.122:9821
notict.url=http://xxxxxxx
\ No newline at end of file
......@@ -18,4 +18,10 @@
-->
node_batch_no, inst_node_id, batch_no, snapshot, create_time, update_time
</sql>
<select id="findByCondition"
resultMap="BaseResultMap">
SELECT * FROM sop_inst_node_batch WHERE node_batch_no=#{sopInstNodeBatch.nodeBatchNo}
AND inst_node_id=#{sopInstNodeBatch.instNodeId} AND batch_no=#{sopInstNodeBatch.batchNo}
</select>
</mapper>
\ No newline at end of file
......@@ -37,7 +37,7 @@
<select id="findPageListByInstId"
resultType="cn.com.glsx.process.modules.model.task.SopTaskDTO">
select inst_id as instId, node_id as nodeId,node_param as nodeParam from sop_inst_node where inst_id=#{instId} and node_param->'$.taskType' is not null
select inst_id as instId, node_id as nodeId,node_param as nodeParam from sop_inst_node where inst_id=#{instId} and node_param!='' and node_param->'$.taskType' is not null
</select>
<update id="resetInstNodeDailyCount">
......
package cn.com.glsx.test;
import cn.com.glsx.Application;
import cn.com.glsx.process.modules.entity.SopInstBatch;
import cn.com.glsx.process.modules.entity.SopInstNode;
import cn.com.glsx.process.modules.entity.SopInstNodeBatch;
import cn.com.glsx.process.modules.model.SopStruct;
import cn.com.glsx.process.modules.service.SopService;
import cn.com.glsx.process.modules.sop.CustomerInfo;
......@@ -149,16 +151,16 @@ public class JavaNodeTestApplication {
CustomerInfo customerInfo = new CustomerInfo();
customerInfo.setOneId("123456");
customerInfo.setCustomerPhone("13476670746");
customerInfo.setOrgId("123456");
customerInfo.setOrgId("44211227");
customerInfo.setVin("ceshi");
customerInfo.setMessageId("1");
customerInfo.setMessageContent("ceshi");
customerInfo.setSopJourneyId("xblc7");
customerInfo.setSopJourneyEnterTime(new Date());
customerInfo.setExternalUserId("wo-ZewEAAAKaTWUHns_kySCyh2EvmfbQ");
customerInfo.setUserId("wo-ZewEAAAKaTWUHns_kySCyh2EvmfbQ");
customerInfo.setExternalUserId("wm-ZewEAAA22dA72qtla54HxDPHBQfcg");
customerInfo.setUserId("wo-ZewEAAA3Ew-zJPQGZHxsU48lRzw-w");
customerInfo.setSopJourneyStage("潜客");
customerInfo.setSopJourneyStageEnterTime(DateUtils.parse("2023-09-23"));
customerInfo.setSopJourneyStageEnterTime(DateUtils.parse("2023-12-27"));
resultData.put("user1", Arrays.asList(customerInfo));
SopStruct sopStruct = sopService.loadSop("xblc7");
SopInstNode sopInstNode = sopStruct.getInstNodeMap().get(3);
......@@ -176,16 +178,16 @@ public class JavaNodeTestApplication {
CustomerInfo customerInfo = new CustomerInfo();
customerInfo.setOneId("123456");
customerInfo.setCustomerPhone("13476670746");
customerInfo.setOrgId("123456");
customerInfo.setOrgId("44211227");
customerInfo.setVin("ceshi");
customerInfo.setMessageId("1");
customerInfo.setMessageContent("ceshi");
customerInfo.setSopJourneyId("xblc7");
customerInfo.setSopJourneyEnterTime(new Date());
customerInfo.setExternalUserId("");
customerInfo.setUserId("");
customerInfo.setExternalUserId("wm-ZewEAAA22dA72qtla54HxDPHBQfcg");
customerInfo.setUserId("wo-ZewEAAA3Ew-zJPQGZHxsU48lRzw-w");
customerInfo.setSopJourneyStage("潜客");
customerInfo.setSopJourneyStageEnterTime(DateUtils.parse("2023-09-23"));
customerInfo.setSopJourneyStageEnterTime(DateUtils.parse("2023-12-27"));
resultData.put("user1", Arrays.asList(customerInfo));
SopStruct sopStruct = sopService.loadSop("xblc7");
SopInstNode sopInstNode = sopStruct.getInstNodeMap().get(3);
......@@ -193,6 +195,12 @@ public class JavaNodeTestApplication {
jsonObject.put("sopInst", sopStruct.getInst());
jsonObject.put("sopInstNode", sopInstNode);
jsonObject.put("instSnapshot", resultData);
SopInstBatch sopInstBatch=new SopInstBatch();
sopInstBatch.setBatchNo("693104751520509952");
SopInstNodeBatch sopInstNodeBatch=new SopInstNodeBatch();
sopInstNodeBatch.setNodeBatchNo("693129900839923712");
jsonObject.put("nodeBatch", sopInstNodeBatch);
jsonObject.put("instbatch", sopInstBatch);
JSON execute = ControllerSendRemindDemo.execute(jsonObject);
System.out.println(execute);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!