Browse Source

# 日常维护任务消息提醒功能修改

zhongwei
haungxing 11 months ago
parent
commit
4badb161a2
  1. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/RoleAliasConstants.java
  2. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskRemindHandler.java

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/RoleAliasConstants.java

@ -0,0 +1,8 @@
package com.hnac.hzims.operational.constants;
public interface RoleAliasConstants {
/**项目经理**/
String PROJECT_MANAGER = "projectManager";
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskRemindHandler.java

@ -7,6 +7,7 @@ import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO; import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.operational.constants.RedisKeyConstants; import com.hnac.hzims.operational.constants.RedisKeyConstants;
import com.hnac.hzims.operational.constants.RoleAliasConstants;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService;
import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.biz.model.ReturnT;
@ -90,7 +91,7 @@ public class MaintenanceTaskRemindHandler {
XxlJobLogger.log(taskEntity.getId() +"执行人消息推送失败!"); XxlJobLogger.log(taskEntity.getId() +"执行人消息推送失败!");
} }
// 任务执行人发送短信 // 任务执行人发送短信
R<List<User>> listR = userClient.userByDeptId(CommonConstant.TENANT_ID, taskEntity.getCreateDept()); R<List<User>> listR = userClient.relationUserListByRoleAlias(CommonConstant.TENANT_ID, taskEntity.getCreateDept(), RoleAliasConstants.PROJECT_MANAGER);
if(listR.isSuccess()) { if(listR.isSuccess()) {
request.setUserIds(listR.getData().stream().map(User::getId).map(String::valueOf).collect(Collectors.joining(","))); request.setUserIds(listR.getData().stream().map(User::getId).map(String::valueOf).collect(Collectors.joining(",")));
request.setContent("有一条待执行的日常维护任务【"+taskEntity.getTitle()+"】即将于"+ DateUtil.format(taskEntity.getPlanEndTime(),DateUtil.PATTERN_DATETIME) +"过期,请确认。"); request.setContent("有一条待执行的日常维护任务【"+taskEntity.getTitle()+"】即将于"+ DateUtil.format(taskEntity.getPlanEndTime(),DateUtil.PATTERN_DATETIME) +"过期,请确认。");

Loading…
Cancel
Save