Commit ac232cd34b57790a54038b88b9526cfbe007706d

Authored by 陈威
1 parent dfe1a991
Exists in dev

钉钉通知模板修改

zr-cloud/zr-auth/src/main/resources/bootstrap.yml
... ... @@ -90,11 +90,11 @@ spring:
90 90 - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
91 91 group: zr-insight
92 92 username: nacos
93   - password: nacos
  93 + password: 0618@Rst
94 94 namespace: develop-namespace
95 95 server-addr: 172.17.56.37:8848
96 96 discovery:
97 97 group: zr-insight
98 98 username: nacos
99   - password: nacos
  99 + password: 0618@Rst
100 100 namespace: develop-namespace
... ...
zr-cloud/zr-gateway/src/main/resources/bootstrap.yml
... ... @@ -90,11 +90,11 @@ spring:
90 90 - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
91 91 group: zr-insight
92 92 username: nacos
93   - password: nacos
  93 + password: 0618@Rst
94 94 namespace: develop-namespace
95 95 server-addr: 172.17.56.37:8848
96 96 discovery:
97 97 group: zr-insight
98 98 username: nacos
99   - password: nacos
  99 + password: 0618@Rst
100 100 namespace: develop-namespace
... ...
zr-cloud/zr-modules/zr-codegen/src/main/resources/bootstrap.yml
... ... @@ -102,11 +102,11 @@ spring:
102 102 - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
103 103 group: zr-insight
104 104 username: nacos
105   - password: nacos
  105 + password: 0618@Rst
106 106 namespace: develop-namespace
107 107 server-addr: 172.17.56.37:8848
108 108 discovery:
109 109 group: zr-insight
110 110 username: nacos
111   - password: nacos
  111 + password: 0618@Rst
112 112 namespace: develop-namespace
... ...
zr-cloud/zr-modules/zr-insight/src/main/resources/bootstrap.yml
... ... @@ -112,11 +112,11 @@ spring:
112 112 # group: application
113 113 group: zr-insight
114 114 username: nacos
115   - password: nacos
  115 + password: 0618@Rst
116 116 namespace: develop-namespace
117 117 server-addr: 172.17.56.37:8848
118 118 discovery:
119 119 group: zr-insight
120 120 username: nacos
121   - password: nacos
  121 + password: 0618@Rst
122 122 namespace: develop-namespace
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/domain/notice/McConstructionTemplate.java
... ... @@ -11,14 +11,11 @@ public class McConstructionTemplate {
11 11 this.mcConstruction = mcConstruction;
12 12 }
13 13 public String getNoticemarkdown() {
14   - return "###### 市场化收费-施工通知 \n " +
15   - "村/小区:" + mcConstruction.getVlgOrCmty() + " \n " +
16   - "当前状态:" + mcConstruction.getStatusName() + " \n " +
17   - "维护操作:点击链接进入维护页面:[https://schsf.chinagasholdings.com](https://schsf.chinagasholdings.com) \n " +
18   - "---" +
19   - " \n " +
20   - "通知日期: " + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm")) + " \n " +
21   - "温馨提醒: 请按时完成维护,保障业务顺畅。 \n ";
  14 + return "##### 市场化收费-施工通知 \n " +
  15 + "###### 村/小区: **" + mcConstruction.getVlgOrCmty() + "** \n " +
  16 + "###### 当前状态: **" + mcConstruction.getStatusName() + "** \n " +
  17 + "###### 维护操作: **点击链接进入维护页面:[https://schsf.chinagasholdings.com](https://schsf.chinagasholdings.com)** \n " +
  18 + "###### 通知时间: **" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm")) + "** \n";
22 19 }
23 20  
24 21 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/domain/notice/McIgnitionTemplate.java
... ... @@ -13,15 +13,12 @@ public class McIgnitionTemplate {
13 13 }
14 14  
15 15 public String getNoticemarkdown() {
16   - return "###### 市场化收费-点火通知 \n " +
17   - "用户信息:" + mcIgnition.getUserName()+"(" +mcIgnition.getUserPhone()+ ") \n " +
18   - "村/小区:" + mcIgnition.getVlgOrCmty() + " \n " +
19   - "当前状态:" + mcIgnition.getStatusName() + "(客服) \n " +
20   - "维护操作:点击链接进入维护页面:[https://schsf.chinagasholdings.com](https://schsf.chinagasholdings.com) \n " +
21   - "---" +
22   - " \n " +
23   - "通知日期: " + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm")) + " \n " +
24   - "温馨提醒: 请按时完成维护,保障业务顺畅。 \n ";
  16 + return "##### 市场化收费-点火通知 \n " +
  17 + "###### 用户信息: **" + mcIgnition.getUserName()+"(" +mcIgnition.getUserPhone()+ ")** \n " +
  18 + "###### 村/小区: **" + mcIgnition.getVlgOrCmty() + "** \n " +
  19 + "###### 当前状态: **" + mcIgnition.getStatusName() + "(客服)** \n " +
  20 + "###### 维护操作: **点击链接进入维护页面:[https://schsf.chinagasholdings.com](https://schsf.chinagasholdings.com)** \n " +
  21 + "###### 通知时间: **" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm")) + "** \n";
25 22 }
26 23  
27 24 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/domain/notice/McVisitTemplate.java
... ... @@ -24,15 +24,12 @@ public class McVisitTemplate {
24 24 }
25 25 }
26 26 }
27   - return "###### 市场化收费通知 \n " +
28   - "工单单号: " + mcVisit.getTicketNumber() + " \n " +
29   - "工单类型:" + ticketTypeName + " \n " +
30   - "当前状态:" + mcVisit.getStatusName() + "(" + mcVisit.getStatusNodeName() + ") \n " +
31   - "维护操作:点击链接进入维护页面:[https://schsf.chinagasholdings.com](https://schsf.chinagasholdings.com) \n " +
32   - "---" +
33   - " \n " +
34   - "通知日期: " + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm")) + " \n " +
35   - "温馨提醒: 请按时完成维护,保障业务顺畅。 \n ";
  27 + return "##### 市场化收费-拜访单 \n " +
  28 + "###### 工单单号: **" + mcVisit.getTicketNumber() + "** \n " +
  29 + "###### 工单类型: **" + ticketTypeName + "** \n " +
  30 + "###### 当前状态: **" + mcVisit.getStatusName() + "(" + mcVisit.getStatusNodeName() + ")** \n " +
  31 + "###### 维护操作: **点击链接进入维护页面:[https://schsf.chinagasholdings.com](https://schsf.chinagasholdings.com)** \n " +
  32 + "###### 通知时间: **" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm")) + "** \n";
36 33 }
37 34  
38 35 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/DingtalkServiceImpl.java
... ... @@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
4 4 import com.chinagas.common.core.exceptions.ServiceException;
5 5 import com.chinagas.common.core.utils.StringUtils;
6 6 import com.chinagas.modules.schsf.constant.DingtalkConstant;
7   -import com.chinagas.modules.schsf.exception.OApiException;
8 7 import com.chinagas.modules.schsf.service.DingtalkService;
9 8 import com.dingtalk.api.DefaultDingTalkClient;
10 9 import com.dingtalk.api.DingTalkClient;
... ... @@ -16,18 +15,20 @@ import com.dingtalk.open.client.api.model.corp.JsapiTicket;
16 15 import com.dingtalk.open.client.api.service.corp.CorpConnectionService;
17 16 import com.dingtalk.open.client.api.service.corp.JsapiService;
18 17 import com.taobao.api.ApiException;
  18 +import lombok.extern.slf4j.Slf4j;
19 19 import org.springframework.beans.factory.annotation.Autowired;
20 20 import org.springframework.stereotype.Service;
21 21  
22   -import java.security.MessageDigest;
23   -import java.util.Formatter;
  22 +import java.util.ArrayList;
24 23 import java.util.List;
25 24  
  25 +@Slf4j
26 26 @Service
27 27 public class DingtalkServiceImpl implements DingtalkService {
28 28  
29 29 @Autowired
30 30 private DingtalkConstant dingtalkConstant;
  31 + final int MAX_USERID_LIST_SIZE = 100;
31 32  
32 33 @Override
33 34 public String getAccessToken() {
... ... @@ -69,30 +70,51 @@ public class DingtalkServiceImpl implements DingtalkService {
69 70  
70 71 @Override
71 72 public void sendMarketFeeNotification(List<String> userIds, String title, String markdown) {
72   - DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
73   - OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request();
74   - request.setAgentId(Long.valueOf(dingtalkConstant.getAgentId()));
75   - request.setUseridList(String.join(",", userIds));
76   - request.setToAllUser(false);
77   - OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
78   - msg.setActionCard(new OapiMessageCorpconversationAsyncsendV2Request.ActionCard());
79   - msg.getActionCard().setTitle(title);
80   - msg.getActionCard().setMarkdown(markdown);
81   - if (StringUtils.isNotEmpty(dingtalkConstant.getAppUrl())) {
82   - msg.getActionCard().setSingleTitle("点击查看");
83   - msg.getActionCard().setSingleUrl("dingtalk://dingtalkclient/action/openapp?" +
84   - "corpid=" +dingtalkConstant.getCorpId()+
85   - "&container_type=work_platform" +
86   - "&app_id=0_" +dingtalkConstant.getAgentId()+
87   - "&redirect_type=jump" +
88   - "&redirect_url=" + dingtalkConstant.getAppUrl());
89   - msg.setMsgtype("action_card");
  73 + log.info("钉钉通知,通知标题:{}", title);
  74 + log.info("钉钉通知,通知内容:{}", markdown);
  75 + log.info("钉钉通知,通知用户id:{},通知用户数量:{}", userIds, userIds.size());
  76 + // 分割用户ID列表为多个不超过100的子列表
  77 + List<String> userIdSubList = new ArrayList<>();
  78 + List<List<String>> splitUserIds = new ArrayList<>();
  79 + for (String userId : userIds) {
  80 + userIdSubList.add(userId);
  81 + if (userIdSubList.size() == MAX_USERID_LIST_SIZE) {
  82 + splitUserIds.add(new ArrayList<>(userIdSubList));
  83 + userIdSubList.clear(); // 准备下一个子列表
  84 + }
90 85 }
91   - request.setMsg(msg);
92   - try {
93   - OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(request, getAccessToken());
94   - } catch (ApiException e) {
95   - throw new RuntimeException(e);
  86 + // 如果最后的子列表非空,也要加进去
  87 + if (!userIdSubList.isEmpty()) {
  88 + splitUserIds.add(userIdSubList);
  89 + }
  90 + log.info("钉钉通知,将用户分组数:{}", splitUserIds.size());
  91 + for (List<String> uids : splitUserIds) {
  92 + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
  93 + OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request();
  94 + request.setAgentId(Long.valueOf(dingtalkConstant.getAgentId()));
  95 + request.setUseridList(String.join(",", uids));
  96 + request.setToAllUser(false);
  97 + OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
  98 + msg.setActionCard(new OapiMessageCorpconversationAsyncsendV2Request.ActionCard());
  99 + msg.getActionCard().setTitle(title);
  100 + msg.getActionCard().setMarkdown(markdown);
  101 + if (StringUtils.isNotEmpty(dingtalkConstant.getAppUrl())) {
  102 + msg.getActionCard().setSingleTitle("点击查看");
  103 + msg.getActionCard().setSingleUrl("dingtalk://dingtalkclient/action/openapp?" +
  104 + "corpid=" + dingtalkConstant.getCorpId() +
  105 + "&container_type=work_platform" +
  106 + "&app_id=0_" + dingtalkConstant.getAgentId() +
  107 + "&redirect_type=jump" +
  108 + "&redirect_url=" + dingtalkConstant.getAppUrl());
  109 + msg.setMsgtype("action_card");
  110 + }
  111 + request.setMsg(msg);
  112 + try {
  113 + OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(request, getAccessToken());
  114 + log.info("钉钉通知,通知结果:{}", rsp);
  115 + } catch (ApiException e) {
  116 + throw new RuntimeException(e);
  117 + }
96 118 }
97 119 }
98 120  
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McConstructionServiceImpl.java
... ... @@ -19,6 +19,7 @@ import com.chinagas.modules.schsf.mapper.McConstructionMapper;
19 19 import com.chinagas.modules.schsf.service.DingtalkService;
20 20 import com.chinagas.modules.schsf.service.IMcConstructionService;
21 21 import com.chinagas.modules.schsf.service.IMcOperationLogService;
  22 +import lombok.extern.slf4j.Slf4j;
22 23 import org.springframework.beans.factory.annotation.Autowired;
23 24 import org.springframework.stereotype.Service;
24 25 import org.springframework.transaction.annotation.Transactional;
... ... @@ -34,6 +35,7 @@ import java.util.stream.Collectors;
34 35 * @author cw
35 36 * @date 2024-05-30
36 37 */
  38 +@Slf4j
37 39 @Transactional
38 40 @Service
39 41 public class McConstructionServiceImpl implements IMcConstructionService {
... ... @@ -132,10 +134,10 @@ public class McConstructionServiceImpl implements IMcConstructionService {
132 134 mcConstruction.setCompanyCode(mcBasicCmty.getCompanyCode());
133 135 mcConstruction.setCompanyName(mcBasicCmty.getCompanyName());
134 136  
135   - mcConstruction.setProvince(mcBasicCmty.getProvince()==null?"":mcBasicCmty.getProvince());
136   - mcConstruction.setCity(mcBasicCmty.getCity()==null?"":mcBasicCmty.getCity());
137   - mcConstruction.setDistrict(mcBasicCmty.getDistrict()==null?"":mcBasicCmty.getDistrict());
138   - mcConstruction.setStreet(mcBasicCmty.getStreet()==null?"":mcBasicCmty.getStreet());
  137 + mcConstruction.setProvince(mcBasicCmty.getProvince() == null ? "" : mcBasicCmty.getProvince());
  138 + mcConstruction.setCity(mcBasicCmty.getCity() == null ? "" : mcBasicCmty.getCity());
  139 + mcConstruction.setDistrict(mcBasicCmty.getDistrict() == null ? "" : mcBasicCmty.getDistrict());
  140 + mcConstruction.setStreet(mcBasicCmty.getStreet() == null ? "" : mcBasicCmty.getStreet());
139 141  
140 142 mcConstruction.setVlgOrCmty(mcBasicCmty.getVlgOrCmty());
141 143 List<McConstruction> mcConstructions = mcConstructionMapper.selectMcConstructionByData(mcConstruction);
... ... @@ -166,15 +168,15 @@ public class McConstructionServiceImpl implements IMcConstructionService {
166 168 if (StringUtils.isEmpty(projectTypeName)) {
167 169 return null;
168 170 }
169   - if (projectTypeName.contains("已通气项目零散开发")){
  171 + if (projectTypeName.contains("已通气项目零散开发")) {
170 172 return "0";
171   - } else if (projectTypeName.contains("扫雷行动项目") && projectTypeName.contains("市政中压已覆盖")){
  173 + } else if (projectTypeName.contains("扫雷行动项目") && projectTypeName.contains("市政中压已覆盖")) {
172 174 return "1";
173   - } else if (projectTypeName.contains("扫雷行动项目") && projectTypeName.contains("市政中压未覆盖")){
  175 + } else if (projectTypeName.contains("扫雷行动项目") && projectTypeName.contains("市政中压未覆盖")) {
174 176 return "2";
175   - } else if (projectTypeName.contains("新增空白项目") && projectTypeName.contains("市政中压已覆盖")){
  177 + } else if (projectTypeName.contains("新增空白项目") && projectTypeName.contains("市政中压已覆盖")) {
176 178 return "3";
177   - } else if (projectTypeName.contains("新增空白项目") && projectTypeName.contains("市政中压未覆盖")){
  179 + } else if (projectTypeName.contains("新增空白项目") && projectTypeName.contains("市政中压未覆盖")) {
178 180 return "4";
179 181 }
180 182 return "0";
... ... @@ -216,7 +218,7 @@ public class McConstructionServiceImpl implements IMcConstructionService {
216 218  
217 219 iMcOperationLogService.insertMcOperationLog("mc_construction", mcConstruction_param.getId(), "schsf:mcConstruction:engineering",
218 220 "工程维护", "1", null, JSON.toJSONString(mcConstruction_old), JSON.toJSONString(mcConstruction_new));
219   - if (i>0){
  221 + if (i > 0) {
220 222 this.sendNotification(mcConstruction_param.getId());
221 223 }
222 224 return i;
... ... @@ -262,6 +264,7 @@ public class McConstructionServiceImpl implements IMcConstructionService {
262 264  
263 265 /**
264 266 * 发送施工维护通知
  267 + *
265 268 * @param mcVisit
266 269 */
267 270 @Override
... ... @@ -284,15 +287,30 @@ public class McConstructionServiceImpl implements IMcConstructionService {
284 287 }
285 288  
286 289 private void sendNotification(Long id) {
287   - McConstruction construction = mcConstructionMapper.selectMcConstructionById(id);
288   - if (BeanUtil.isEmpty(construction)) {
289   - throw new ServiceException("未查询到记录");
290   - }
291   - List<NodeUsersDto> nodeUsersDtos = this.selectMcConstructionNodeUserList(construction.getId());
292   - if (nodeUsersDtos != null && nodeUsersDtos.size()>0) {
293   - List<String> userIds = nodeUsersDtos.stream().filter(mcVisitNodeUsersDto -> StringUtils.isNotEmpty(mcVisitNodeUsersDto.getDingTalkUserId())).map(NodeUsersDto::getDingTalkUserId).collect(Collectors.toList());
294   - dingtalkService.sendMarketFeeNotification(userIds, "市场化收费-施工维护", new McConstructionTemplate(construction).getNoticemarkdown());
295   - }
  290 + Thread thread = new Thread(() -> {
  291 + log.info("钉钉通知,施工维护通知:参数id{}", id);
  292 + try {
  293 + McConstruction construction = mcConstructionMapper.selectMcConstructionById(id);
  294 + if (BeanUtil.isEmpty(construction)) {
  295 + throw new ServiceException("未查询到记录");
  296 + }
  297 + log.info("钉钉通知,施工维护通知:施工参数对象{}", construction);
  298 + List<NodeUsersDto> nodeUsersDtos = this.selectMcConstructionNodeUserList(construction.getId());
  299 + if (nodeUsersDtos != null && nodeUsersDtos.size() > 0) {
  300 + List<String> userIds = nodeUsersDtos.stream().filter(mcVisitNodeUsersDto -> StringUtils.isNotEmpty(mcVisitNodeUsersDto.getDingTalkUserId())).map(NodeUsersDto::getDingTalkUserId).collect(Collectors.toList());
  301 + dingtalkService.sendMarketFeeNotification(userIds, "市场化收费-施工维护", new McConstructionTemplate(construction).getNoticemarkdown());
  302 + }
  303 + return;
  304 + } catch (Exception e) {
  305 + // 异常处理
  306 + e.printStackTrace();
  307 + log.error("钉钉通知,施工维护通知:通知失败{}", e.getMessage());
  308 + }
  309 + });
  310 + // 当主线程结束时,这个线程也自动结束
  311 + thread.setDaemon(true);
  312 + thread.start();
  313 + log.info("钉钉通知,施工维护通知结束");
296 314 }
297 315  
298 316 @Override
... ... @@ -302,10 +320,10 @@ public class McConstructionServiceImpl implements IMcConstructionService {
302 320 throw new ServiceException("未查询到记录");
303 321 }
304 322 if (mcConstruction.getStatusCode().equals(ConstructionStatusEnums.MAINTENANCE_SG.getCode())) {
305   - //待工程维护 schsf:mcConstruction:engineering
  323 + //待工程维护 schsf:mcConstruction:engineering
306 324 return mcConstructionMapper.selectMcConstructionNodeUserList(String.valueOf(id), "schsf:mcConstruction:engineering");
307   - }else if (mcConstruction.getStatusCode().equals(ConstructionStatusEnums.MAINTENANCE_YY.getCode())){
308   - //待运营维护 schsf:mcConstruction:operations
  325 + } else if (mcConstruction.getStatusCode().equals(ConstructionStatusEnums.MAINTENANCE_YY.getCode())) {
  326 + //待运营维护 schsf:mcConstruction:operations
309 327 return mcConstructionMapper.selectMcConstructionNodeUserList(String.valueOf(id), "schsf:mcConstruction:operations");
310 328 }
311 329 return Collections.emptyList();
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McIgnitionServiceImpl.java
... ... @@ -267,16 +267,33 @@ public class McIgnitionServiceImpl implements IMcIgnitionService {
267 267 * @param id
268 268 */
269 269 private void sendMcIgnitionNotification(Long id) {
270   - McIgnition mcIgnition = mcIgnitionMapper.selectMcIgnitionById(id);
271   - log.info("点火维护-钉钉通知,点火信息对象:{}", mcIgnition);
272   - if (BeanUtil.isEmpty(mcIgnition)) {
273   - throw new ServiceException("未查询到记录");
274   - }
275   - //发送通知
276   - List<NodeUsersDto> mcVisitNodeUsersDtos = this.selectMcIgnitionNodeUserList(id);
277   - if (mcVisitNodeUsersDtos != null) {
278   - List<String> userIds = mcVisitNodeUsersDtos.stream().filter(mcVisitNodeUsersDto -> StringUtils.isNotEmpty(mcVisitNodeUsersDto.getDingTalkUserId())).map(NodeUsersDto::getDingTalkUserId).collect(Collectors.toList());
279   - dingtalkService.sendMarketFeeNotification(userIds, "市场化收费-点火维护", new McIgnitionTemplate(mcIgnition).getNoticemarkdown());
280   - }
  270 +
  271 + Thread thread = new Thread(() -> {
  272 + log.info("点火维护-钉钉通知,点火信息:参数id{}", id);
  273 + try {
  274 +
  275 + McIgnition mcIgnition = mcIgnitionMapper.selectMcIgnitionById(id);
  276 + log.info("点火维护-钉钉通知,点火信息对象:{}", mcIgnition);
  277 + if (BeanUtil.isEmpty(mcIgnition)) {
  278 + throw new ServiceException("未查询到记录");
  279 + }
  280 + //发送通知
  281 + List<NodeUsersDto> mcVisitNodeUsersDtos = this.selectMcIgnitionNodeUserList(id);
  282 + if (mcVisitNodeUsersDtos != null) {
  283 + List<String> userIds = mcVisitNodeUsersDtos.stream().filter(mcVisitNodeUsersDto -> StringUtils.isNotEmpty(mcVisitNodeUsersDto.getDingTalkUserId())).map(NodeUsersDto::getDingTalkUserId).collect(Collectors.toList());
  284 + dingtalkService.sendMarketFeeNotification(userIds, "市场化收费-点火维护", new McIgnitionTemplate(mcIgnition).getNoticemarkdown());
  285 + }
  286 +
  287 + } catch (Exception e) {
  288 + // 异常处理
  289 + e.printStackTrace();
  290 + log.error("点火维护-钉钉通知,点火通知:通知失败{}", e.getMessage());
  291 + }
  292 + });
  293 + // 当主线程结束时,这个线程也自动结束
  294 + thread.setDaemon(true);
  295 + thread.start();
  296 + log.info("点火维护-钉钉通知,点火通知结束");
  297 +
281 298 }
282 299 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McVisitServiceImpl.java
... ... @@ -632,15 +632,31 @@ public class McVisitServiceImpl implements IMcVisitService {
632 632 * @param id
633 633 */
634 634 private void sendMcVisitNotification(Long id) {
635   - McVisit mcVisit = mcVisitMapper.selectMcVisitById(id);
636   - log.info("拜访工单-钉钉通知,拜访单对象信息:{}", mcVisit);
637   - if (BeanUtil.isEmpty(mcVisit)) {throw new ServiceException("未查询到记录");}
638   - //发送通知
639   - List<NodeUsersDto> mcVisitNodeUsersDtos = this.selectStatusNodeUserList(id);
640   - if (mcVisitNodeUsersDtos != null) {
641   - List<String> userIds = mcVisitNodeUsersDtos.stream().filter(mcVisitNodeUsersDto -> StringUtils.isNotEmpty(mcVisitNodeUsersDto.getDingTalkUserId())).map(NodeUsersDto::getDingTalkUserId).collect(Collectors.toList());
642   - dingtalkService.sendMarketFeeNotification(userIds, "市场化收费", new McVisitTemplate(mcVisit).getNoticemarkdown());
643   - }
  635 + Thread thread = new Thread(() -> {
  636 + log.info("钉钉通知,拜访通知:参数id{}", id);
  637 + try {
  638 + McVisit mcVisit = mcVisitMapper.selectMcVisitById(id);
  639 + log.info("钉钉通知,拜访通知,拜访单对象信息:{}", mcVisit);
  640 + if (BeanUtil.isEmpty(mcVisit)) {
  641 + throw new ServiceException("未查询到记录");
  642 + }
  643 + //发送通知
  644 + List<NodeUsersDto> mcVisitNodeUsersDtos = this.selectStatusNodeUserList(id);
  645 + if (mcVisitNodeUsersDtos != null) {
  646 + List<String> userIds = mcVisitNodeUsersDtos.stream().filter(mcVisitNodeUsersDto -> StringUtils.isNotEmpty(mcVisitNodeUsersDto.getDingTalkUserId())).map(NodeUsersDto::getDingTalkUserId).collect(Collectors.toList());
  647 + dingtalkService.sendMarketFeeNotification(userIds, "市场化收费", new McVisitTemplate(mcVisit).getNoticemarkdown());
  648 + }
  649 +
  650 + } catch (Exception e) {
  651 + // 异常处理
  652 + e.printStackTrace();
  653 + log.error("钉钉通知,拜访通知:通知失败{}", e.getMessage());
  654 + }
  655 + });
  656 + // 当主线程结束时,这个线程也自动结束
  657 + thread.setDaemon(true);
  658 + thread.start();
  659 + log.info("钉钉通知,拜访通知结束");
644 660 }
645 661  
646 662 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/resources/bootstrap.yml
... ... @@ -98,11 +98,11 @@ spring:
98 98 group: application
99 99 group: zr-insight
100 100 username: nacos
101   - password: nacos
  101 + password: 0618@Rst
102 102 namespace: develop-namespace
103 103 server-addr: 172.17.56.37:8848
104 104 discovery:
105 105 group: zr-insight
106 106 username: nacos
107   - password: nacos
  107 + password: 0618@Rst
108 108 namespace: develop-namespace
... ...
zr-cloud/zr-modules/zr-system/src/main/resources/bootstrap.yml
... ... @@ -96,11 +96,11 @@ spring:
96 96 group: application
97 97 group: zr-insight
98 98 username: nacos
99   - password: nacos
  99 + password: 0618@Rst
100 100 namespace: develop-namespace
101 101 server-addr: 172.17.56.37:8848
102 102 discovery:
103 103 group: zr-insight
104 104 username: nacos
105   - password: nacos
  105 + password: 0618@Rst
106 106 namespace: develop-namespace
... ...