Browse Source

优化值班消息中心提醒的逻辑

zhongwei
tyty 2 years ago
parent
commit
b3b32f34fb
  1. 5
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java
  2. 21
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java

5
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java

@ -46,8 +46,9 @@ public class OperationalConstants {
*/ */
CARRY_REC_MESSAGE(30, "接班巡视时间"), CARRY_REC_MESSAGE(30, "接班巡视时间"),
DELAYED_HAND_REC_MESSAGE(1, "延时交班提醒"); DELAYED_HAND_REC_MESSAGE(1, "延时交班提醒"),
//最迟延迟交班提醒
DELAYED_HAND_REC_MESSAGE_LAST(15, "延时交班提醒");
@Getter @Getter
private int val; private int val;
@Getter @Getter

21
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java

@ -639,9 +639,11 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
R<User> user = userClient.userInfoById(carryManagerId); R<User> user = userClient.userInfoById(carryManagerId);
if (ObjectUtil.isEmpty(one)) {//未发起交班流程 判断是否提醒交班 if (ObjectUtil.isEmpty(one)) {//未发起交班流程 判断是否提醒交班
Long differMinute = DateUtils.getDifferMinute(calculateDate(entity, classEntity, OperationalConstants.DutyRecTypeEnum.HAND_REC.getVal())); Long differMinute = DateUtils.getDifferMinute(calculateDate(entity, classEntity, OperationalConstants.DutyRecTypeEnum.HAND_REC.getVal()));
if (differMinute == -OperationalConstants.MessageRecTypeEnum.HAND_REC_MESSAGE.getVal()) { // 提醒交班 //如果时间差小于15分钟,大于1分钟
if (differMinute> -OperationalConstants.MessageRecTypeEnum.HAND_REC_MESSAGE.getVal()&& differMinute<-OperationalConstants.MessageRecTypeEnum.DELAYED_HAND_REC_MESSAGE.getVal()) { // 提醒交班
remondingHeadV2(carryMainentity.getDutyDate(),OperationalConstants.RecTypeEnum.HAND_REMIND.getVal(), groupEntityManagerId, userName, entity.getTenantId(), entity.getCreateDept(), entity.getId(), entity.getCreateUser()); remondingHeadV2(carryMainentity.getDutyDate(),OperationalConstants.RecTypeEnum.HAND_REMIND.getVal(), groupEntityManagerId, userName, entity.getTenantId(), entity.getCreateDept(), entity.getId(), entity.getCreateUser());
} else if (differMinute == OperationalConstants.MessageRecTypeEnum.DELAYED_HAND_REC_MESSAGE.getVal()) {//延时交班提醒 //如果延迟的时间差超过1分钟到15分钟
} else if (differMinute>OperationalConstants.MessageRecTypeEnum.DELAYED_HAND_REC_MESSAGE.getVal()&&differMinute<OperationalConstants.MessageRecTypeEnum.DELAYED_HAND_REC_MESSAGE_LAST.getVal()) {//延时交班提醒
//提醒站长 接班人 交班人 //提醒站长 接班人 交班人
User admin = userClient.userByAccount(entity.getTenantId(), "admin").getData(); User admin = userClient.userByAccount(entity.getTenantId(), "admin").getData();
remondingStationV2(carryMainentity.getDutyDate(),admin, userName, classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长 remondingStationV2(carryMainentity.getDutyDate(),admin, userName, classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长
@ -987,7 +989,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
messagePushRecordDto.setCreateDept(createDept); messagePushRecordDto.setCreateDept(createDept);
messagePushRecordDto.setCreateUser(createUser); messagePushRecordDto.setCreateUser(createUser);
R<Boolean> booleanR = messageClient.sendMessage(messagePushRecordDto); R<Boolean> booleanR = messageClient.sendMessage(messagePushRecordDto);
System.out.println(booleanR.toString()); log.info(booleanR.toString());
} }
/** /**
@ -1030,10 +1032,13 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
messagePushRecordDto.setDeptId(createDept); messagePushRecordDto.setDeptId(createDept);
messagePushRecordDto.setPushType(MessageConstants.IMMEDIATELY); messagePushRecordDto.setPushType(MessageConstants.IMMEDIATELY);
R<String> deptName = sysClient.getDeptName(createDept); R<String> deptName = sysClient.getDeptName(createDept);
messagePushRecordDto.setDeptName(deptName.getData()); if(deptName.isSuccess()) {
messagePushRecordDto.setDeptName(deptName.getData());
}
messagePushRecordDto.setCreateDept(createDept); messagePushRecordDto.setCreateDept(createDept);
messagePushRecordDto.setCreateUser(createUser); messagePushRecordDto.setCreateUser(createUser);
messageClient.sendMessage(messagePushRecordDto); R<Boolean> booleanR = messageClient.sendMessage(messagePushRecordDto);
log.info(booleanR.toString());
} }
/** /**
@ -1081,11 +1086,13 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
messagePushRecordDto.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH)); messagePushRecordDto.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
messagePushRecordDto.setDeptId(createDept); messagePushRecordDto.setDeptId(createDept);
R<String> deptName = sysClient.getDeptName(createDept); R<String> deptName = sysClient.getDeptName(createDept);
messagePushRecordDto.setDeptName(deptName.getData()); if(deptName.isSuccess()) {
messagePushRecordDto.setDeptName(deptName.getData());
}
messagePushRecordDto.setCreateDept(createDept); messagePushRecordDto.setCreateDept(createDept);
messagePushRecordDto.setCreateUser(createUser); messagePushRecordDto.setCreateUser(createUser);
R<Boolean> booleanR = messageClient.sendMessage(messagePushRecordDto); R<Boolean> booleanR = messageClient.sendMessage(messagePushRecordDto);
System.out.println(booleanR.toString()); log.info(booleanR.toString());
} }
//新增巡检计划 获取巡检任务ID //新增巡检计划 获取巡检任务ID

Loading…
Cancel
Save