Browse Source

# 消息推送修改

zhongwei
haungxing 2 years ago
parent
commit
45cf2ea2a2
  1. 4
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskRemindManager.java
  2. 7
      hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java
  3. 7
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java
  4. 18
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java

4
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));
}
}

7
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<List<UnreadMessageVO>> getPersonalAppUnreadMessage() {
List<UnreadMessageVO> personalUnreadMessage = messagePushRecordService.getPersonalAppUnreadMessage();
return R.data(personalUnreadMessage);
}
}

7
hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java

@ -77,4 +77,11 @@ public interface IMessagePushRecordService extends BaseService<MessagePushRecord
**/
List<UnreadMessageVO> getPersonalUnreadMessage();
/** @Author hx
* @Description 获取当前登录人APP待办消息
* @Date 2023/4/19 18:20
* @return
**/
List<UnreadMessageVO> getPersonalAppUnreadMessage();
}

18
hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java

@ -295,7 +295,23 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl<MessagePushRec
QueryWrapper<MessagePushRecordEntity> 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<Map<String, Object>> 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<UnreadMessageVO> getPersonalAppUnreadMessage() {
QueryWrapper<MessagePushRecordEntity> 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<Map<String, Object>> list = noAurhScopeMapper.selectMaps(query);
return list.stream().map(map -> {

Loading…
Cancel
Save