diff --git a/pom.xml b/pom.xml index 4e9086c..ad680d1 100644 --- a/pom.xml +++ b/pom.xml @@ -108,11 +108,11 @@ ${activiti.version} - - - - - + + com.cm + cloud-central-control-client + 1.0.1-SNAPSHOT + diff --git a/src/main/java/com/cm/inspection/service/dingding/impl/DingDingMsgServiceImpl.java b/src/main/java/com/cm/inspection/service/dingding/impl/DingDingMsgServiceImpl.java index 37a4848..1c54fc8 100644 --- a/src/main/java/com/cm/inspection/service/dingding/impl/DingDingMsgServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/dingding/impl/DingDingMsgServiceImpl.java @@ -2,7 +2,9 @@ package com.cm.inspection.service.dingding.impl; import com.cm.common.config.properties.ApiPathProperties; import com.cm.common.constants.ISystemConstant; +import com.cm.common.plugin.IApiConsts; import com.cm.common.plugin.oauth.service.user.IUserService; +import com.cm.common.plugin.oauth.token.ClientTokenManager; import com.cm.common.plugin.pojo.bos.UserResourceBO; import com.cm.common.plugin.utils.RestTemplateUtil; import com.cm.inspection.pojo.dtos.check.CheckDTO; @@ -84,7 +86,12 @@ public class DingDingMsgServiceImpl extends BaseService implements IDingDingMsgS LOG.debug("通知网格员为空"); return; } + LOG.debug("获取网格员用户列表"); + List userResourceBOs = userService.listUserResourceByIds(userIds); + sendDingDingMessage(userResourceBOs, "您有超时的检查,请登录APP进行处理。"); + // 获取网格员领导userId列表 + /* Map> leaderUserMap = new HashMap<>(16); for (GridPersonnelDTO gridPersonnelDTO : gridPersonnelDTOs) { String userId = gridPersonnelDTO.getUserId().split("\\|")[0]; @@ -97,9 +104,6 @@ public class DingDingMsgServiceImpl extends BaseService implements IDingDingMsgS } gridPersonnelUserIdSet.add(userId); } - LOG.debug("获取网格员用户列表"); - List userResourceBOs = userService.listUserResourceByIds(userIds); - sendDingDingMessage(userResourceBOs, "您有超时的检查,请登录APP进行处理。"); LOG.debug("通知领导数量:{}", leaderUserMap.size()); if (!leaderUserMap.isEmpty()) { LOG.debug("获取领导用户列表"); @@ -110,6 +114,7 @@ public class DingDingMsgServiceImpl extends BaseService implements IDingDingMsgS List leaderUserResourceBOs = userService.listUserResourceByIds(leaderUserIds); sendDingDingMessage(leaderUserResourceBOs, "您的下级网格员有超时的检查项,请尽快处理。"); } + */ long endTime = System.currentTimeMillis(); LOG.debug(">>>> 整理超时案件 end,耗时:{}ms <<<<", endTime - startTime); } @@ -150,12 +155,11 @@ public class DingDingMsgServiceImpl extends BaseService implements IDingDingMsgS } phoneSB.append(userResourceBO.getUserPhone()); } - System.out.println(phoneSB.toString()); - /* Map params = new HashMap<>(10); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); params.put("phones", phoneSB.toString()); - String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_DYNAMIC_USER_INFO_BY_IDS, apiPathProperties.getUserCenter()), params); + params.put("content", content); + String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.SEND_DINGDING_MSG_BY_PHONES, apiPathProperties.getUserCenter()), params); LOG.debug("DingDing result: {}", result); if (result == null) { LOG.error("认证失败"); @@ -163,6 +167,5 @@ public class DingDingMsgServiceImpl extends BaseService implements IDingDingMsgS if (result.isEmpty()) { LOG.error("发送钉钉消息失败"); } - */ } }