diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskRemindManager.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskRemindManager.java index 035bab3..64e1cf0 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskRemindManager.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskRemindManager.java @@ -242,6 +242,7 @@ public class TaskRemindManager { XxlJobLogger.log(task.getId()+"巡检任务已完成,无需推送短信"); return; } + XxlJobLogger.log(task.getId()+"开始推送消息!"); // 移动端消息推送 : 使用 用户id做TAG,前端注册用户id为TAG PushInfoVO pushInfoVO = new PushInfoVO(); pushInfoVO.setTenantId(task.getTenantId()); @@ -275,6 +276,7 @@ public class TaskRemindManager { log.info("------------ 发送短信 用户手机号 = " + userPhone); String finalTemplateCode = templateCode; + XxlJobLogger.log(task.getId()+"开始推送短信!"); HzThreadPool.getFixedThreadExecutor().execute(new Runnable() { @Override public void run() { @@ -291,7 +293,7 @@ public class TaskRemindManager { //把已发送的数据移除 - redisTemplate.opsForZSet().remove(key, task); + // redisTemplate.opsForZSet().remove(key, task); log.info("已推送、发送短信后 --------------- key = " + key + " ---- size = " + redisTemplate.opsForZSet().size(key)); } } diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java index a09551f..eab19df 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java @@ -100,4 +100,11 @@ public class MessagePushRecordController extends BladeController { return R.data(personalUnreadMessage); } + @GetMapping("/getPersonalAppUnreadMessage") + @ApiOperation("获取当前登录人APP待办消息") + @ApiOperationSupport(order = 9) + public R> getPersonalAppUnreadMessage() { + List personalUnreadMessage = messagePushRecordService.getPersonalAppUnreadMessage(); + return R.data(personalUnreadMessage); + } } diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java index 60d9ecc..40e5e03 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java @@ -77,4 +77,11 @@ public interface IMessagePushRecordService extends BaseService getPersonalUnreadMessage(); + /** @Author hx + * @Description 获取当前登录人APP待办消息 + * @Date 2023/4/19 18:20 + * @return + **/ + List getPersonalAppUnreadMessage(); + } diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java index f398de0..9237990 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java @@ -295,7 +295,23 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl query = Wrappers.query(); query.select("business_classify businessClassify,count(0) todoNum"); query.eq("account", AuthUtil.getUserId()); - query.in("status", Lists.newArrayList(MessageConstants.PUSH_SUCCESS,MessageConstants.CONFIRM)); + query.in("status", Lists.newArrayList(MessageConstants.PUSH_SUCCESS)); + query.groupBy("business_classify"); + List> list = noAurhScopeMapper.selectMaps(query); + return list.stream().map(map -> { + UnreadMessageVO unreadMessageVO = Func.toBean(map, UnreadMessageVO.class); + unreadMessageVO.setBusinessName(DictCache.getValue("businessClassify", unreadMessageVO.getBusinessClassify())); + return unreadMessageVO; + }).collect(Collectors.toList()); + } + + @Override + public List getPersonalAppUnreadMessage() { + QueryWrapper query = Wrappers.query(); + query.select("business_classify businessClassify,count(0) todoNum"); + query.eq("account", AuthUtil.getUserId()); + query.eq("type", MessageConstants.APP_PUSH); + query.in("status", Lists.newArrayList(MessageConstants.PUSH_SUCCESS)); query.groupBy("business_classify"); List> list = noAurhScopeMapper.selectMaps(query); return list.stream().map(map -> {