|
|
|
@ -634,13 +634,13 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
|
|
|
|
|
if (ObjectUtil.isEmpty(one)) {//未发起交班流程 判断是否提醒交班
|
|
|
|
|
Long differMinute = DateUtils.getDifferMinute(calculateDate(entity, classEntity, OperationalConstants.DutyRecTypeEnum.HAND_REC.getVal())); |
|
|
|
|
if (differMinute == -OperationalConstants.MessageRecTypeEnum.HAND_REC_MESSAGE.getVal()) { // 提醒交班
|
|
|
|
|
remondingHeadV2(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()) {//延时交班提醒
|
|
|
|
|
//提醒站长 接班人 交班人
|
|
|
|
|
User admin = userClient.userByAccount(entity.getTenantId(), "admin").getData(); |
|
|
|
|
remondingStationV2(admin, userName, classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长
|
|
|
|
|
remondingCarryV2(OperationalConstants.RecTypeEnum.HAND_DELAY.getVal(), carryManagerId, userName, classEntity, null, carryTenantId, carryCreateDept, carryMainentity.getId(), carryMainentity.getCreateUser());//提醒接班人
|
|
|
|
|
remondingHeadV2(OperationalConstants.RecTypeEnum.HAND_DELAY.getVal(), groupEntityManagerId, userName, entity.getTenantId(), entity.getCreateDept(), entity.getId(), entity.getCreateUser());//提醒交班人
|
|
|
|
|
remondingStationV2(carryMainentity.getDutyDate(),admin, userName, classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长
|
|
|
|
|
remondingCarryV2(carryMainentity.getDutyDate(),OperationalConstants.RecTypeEnum.HAND_DELAY.getVal(), carryManagerId, userName, classEntity, null, carryTenantId, carryCreateDept, carryMainentity.getId(), carryMainentity.getCreateUser());//提醒接班人
|
|
|
|
|
remondingHeadV2(carryMainentity.getDutyDate(),OperationalConstants.RecTypeEnum.HAND_DELAY.getVal(), groupEntityManagerId, userName, entity.getTenantId(), entity.getCreateDept(), entity.getId(), entity.getCreateUser());//提醒交班人
|
|
|
|
|
} |
|
|
|
|
} else {//已发起接班流程 判断是否提醒接班
|
|
|
|
|
ImsDutyClassEntity carryClassEntity = imsDutyClassService.getById(carryMainentity.getClassId()); |
|
|
|
@ -648,8 +648,8 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
|
|
|
|
|
if (differMinute > 0 && one.getDelayStatus() == 0) { |
|
|
|
|
//提醒站长 接班人 交班人
|
|
|
|
|
User admin = userClient.userByAccount(entity.getTenantId(), "admin").getData(); |
|
|
|
|
remondingStationV2(admin, admin.getName(), classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长
|
|
|
|
|
remondingCarryV2(2, carryManagerId, user.getData().getName(), classEntity, null, carryTenantId, carryCreateDept, carryMainentity.getId(), carryMainentity.getCreateUser());//提醒接班人
|
|
|
|
|
remondingStationV2(carryMainentity.getDutyDate(),admin, admin.getName(), classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长
|
|
|
|
|
remondingCarryV2(carryMainentity.getDutyDate(),2, carryManagerId, user.getData().getName(), classEntity, null, carryTenantId, carryCreateDept, carryMainentity.getId(), carryMainentity.getCreateUser());//提醒接班人
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -947,7 +947,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
|
|
|
|
|
classEntity) { |
|
|
|
|
req.setTitle("交接班"); |
|
|
|
|
req.setType(DutyRecProcessConstant.MESSAGE_CLASS_TYPE_DUTY_REC); |
|
|
|
|
req.setBusinessClassify(OperationalConstants.MessageClassifyEnum.MESSAGE_REMINDSY.getVal()); |
|
|
|
|
req.setBusinessClassify(MessageConstants.BusinessClassifyEnum.DUTY.getKey()); |
|
|
|
|
req.setPushAlert(userName + " 负责人 值班日期为:(" + classEntity.getStartTime() + "-" + classEntity.getEndTime() + ") 目前已交班延迟,请尽快联系该负责人进行交班工作"); |
|
|
|
|
messagePushClient.sendMessage(admin.getId().toString(), req, admin.getTenantId(), admin.getCreateDept(), admin.getCreateUser()); |
|
|
|
|
} |
|
|
|
@ -955,10 +955,12 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
|
|
|
|
|
/** |
|
|
|
|
* 消息提醒站长 |
|
|
|
|
*/ |
|
|
|
|
private void remondingStationV2(User admin, String userName, ImsDutyClassEntity |
|
|
|
|
private void remondingStationV2(Date dutydate,User admin, String userName, ImsDutyClassEntity |
|
|
|
|
classEntity, String tenantId, Long taskId, Long createDept, Long createUser) { |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
String datyTime = format.format(dutydate); |
|
|
|
|
MessagePushRecordDto messagePushRecordDto = new MessagePushRecordDto(); |
|
|
|
|
messagePushRecordDto.setBusinessClassify(OperationalConstants.MessageClassifyEnum.MESSAGE_REMINDSY.getVal()); |
|
|
|
|
messagePushRecordDto.setBusinessClassify(MessageConstants.BusinessClassifyEnum.DUTY.getKey()); |
|
|
|
|
messagePushRecordDto.setBusinessKey(MessageConstants.BusinessClassifyEnum.DUTY.getKey()); |
|
|
|
|
messagePushRecordDto.setSubject(MessageConstants.BusinessClassifyEnum.DUTY.getDescription()); |
|
|
|
|
messagePushRecordDto.setTaskId(taskId); |
|
|
|
@ -966,7 +968,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
|
|
|
|
|
messagePushRecordDto.setPusher(admin.getId().toString()); |
|
|
|
|
messagePushRecordDto.setPusherName(userName); |
|
|
|
|
messagePushRecordDto.setAccount(admin.getId().toString()); |
|
|
|
|
messagePushRecordDto.setContent(userName + " 负责人 值班日期为:(" + classEntity.getStartTime() |
|
|
|
|
messagePushRecordDto.setContent(userName + " 负责人"+datyTime+ " 的值班,时间段为:(" + classEntity.getStartTime() |
|
|
|
|
+ "-" + classEntity.getEndTime() + ") 目前已交班延迟,请尽快联系该负责人进行交班工作"); |
|
|
|
|
messagePushRecordDto.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH)); |
|
|
|
|
messagePushRecordDto.setPushType(MessageConstants.IMMEDIATELY); |
|
|
|
@ -987,7 +989,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
|
|
|
|
|
private void remondingHead(PushExtrasReq req, int type, Long managerId, String tenantId, Long createDept, Long createUser) { |
|
|
|
|
req.setTitle("交接班"); |
|
|
|
|
req.setType(DutyRecProcessConstant.MESSAGE_CLASS_TYPE_DUTY_REC); |
|
|
|
|
req.setBusinessClassify(OperationalConstants.MessageClassifyEnum.MESSAGE_REMINDSY.getVal()); |
|
|
|
|
req.setBusinessClassify(MessageConstants.BusinessClassifyEnum.DUTY.getKey()); |
|
|
|
|
if (type == OperationalConstants.RecTypeEnum.HAND_REMIND.getVal()) { |
|
|
|
|
req.setPushAlert("您距离本次值班结束时间只剩 15 分钟,请尽快进行交班工作"); |
|
|
|
|
} else if (type == OperationalConstants.RecTypeEnum.HAND_DELAY.getVal()) { |
|
|
|
@ -1000,9 +1002,11 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
|
|
|
|
|
/** |
|
|
|
|
* 消息提醒交班人 |
|
|
|
|
*/ |
|
|
|
|
private void remondingHeadV2(int type, Long managerId, String userName, String tenantId, Long createDept, Long taskId, Long createUser) { |
|
|
|
|
private void remondingHeadV2(Date dutydate,int type, Long managerId, String userName, String tenantId, Long createDept, Long taskId, Long createUser) { |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
String datyTime = format.format(dutydate); |
|
|
|
|
MessagePushRecordDto messagePushRecordDto = new MessagePushRecordDto(); |
|
|
|
|
messagePushRecordDto.setBusinessClassify(OperationalConstants.MessageClassifyEnum.MESSAGE_REMINDSY.getVal()); |
|
|
|
|
messagePushRecordDto.setBusinessClassify(MessageConstants.BusinessClassifyEnum.DUTY.getKey()); |
|
|
|
|
messagePushRecordDto.setBusinessKey(MessageConstants.BusinessClassifyEnum.DUTY.getKey()); |
|
|
|
|
messagePushRecordDto.setSubject(MessageConstants.BusinessClassifyEnum.DUTY.getDescription()); |
|
|
|
|
messagePushRecordDto.setTaskId(taskId); |
|
|
|
@ -1011,9 +1015,9 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
|
|
|
|
|
messagePushRecordDto.setPusherName(userName); |
|
|
|
|
messagePushRecordDto.setAccount(managerId.toString()); |
|
|
|
|
if (type == OperationalConstants.RecTypeEnum.HAND_REMIND.getVal()) { |
|
|
|
|
messagePushRecordDto.setContent("您距离本次值班结束时间只剩 15 分钟,请尽快进行交班工作"); |
|
|
|
|
messagePushRecordDto.setContent("您距离"+datyTime+"的值班任务结束时间只剩 15 分钟,请尽快进行交班工作"); |
|
|
|
|
} else if (type == OperationalConstants.RecTypeEnum.HAND_DELAY.getVal()) { |
|
|
|
|
messagePushRecordDto.setContent("您已交班延迟,请尽快进行交班工作"); |
|
|
|
|
messagePushRecordDto.setContent("您"+datyTime+"的值班已交班延迟,请尽快进行交班工作"); |
|
|
|
|
} |
|
|
|
|
messagePushRecordDto.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH)); |
|
|
|
|
messagePushRecordDto.setDeptId(createDept); |
|
|
|
@ -1032,11 +1036,11 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
|
|
|
|
|
classEntity, String date, String tenantId, Long createDept, Long createUser) { |
|
|
|
|
req.setTitle("交接班"); |
|
|
|
|
req.setType(DutyRecProcessConstant.MESSAGE_CLASS_TYPE_DUTY_REC); |
|
|
|
|
req.setBusinessClassify(OperationalConstants.MessageClassifyEnum.MESSAGE_REMINDSY.getVal()); |
|
|
|
|
req.setBusinessClassify(MessageConstants.BusinessClassifyEnum.DUTY.getKey()); |
|
|
|
|
if (type == OperationalConstants.RecTypeEnum.HAND_REMIND.getVal()) { |
|
|
|
|
req.setPushAlert(userName + " 于 " + date + " 时已提交交班工作"); |
|
|
|
|
} else if (type == OperationalConstants.RecTypeEnum.HAND_DELAY.getVal()) { |
|
|
|
|
req.setPushAlert(userName + " 值班日期为(" + classEntity.getStartTime() + " - " + classEntity.getEndTime() + "),目前已延迟交班"); |
|
|
|
|
req.setPushAlert(userName + "值班日期为(" + classEntity.getStartTime() + " - " + classEntity.getEndTime() + "),目前已延迟交班"); |
|
|
|
|
} else if (type == OperationalConstants.RecTypeEnum.REMIND_HAND_PERSON.getVal()) { |
|
|
|
|
req.setPushAlert("您已交班延迟,请尽快进行交班工作"); |
|
|
|
|
} |
|
|
|
@ -1046,10 +1050,12 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
|
|
|
|
|
/** |
|
|
|
|
* 消息提醒接班人 |
|
|
|
|
*/ |
|
|
|
|
private void remondingCarryV2(int type, Long managerId, String userName, ImsDutyClassEntity |
|
|
|
|
private void remondingCarryV2(Date dutydate,int type, Long managerId, String userName, ImsDutyClassEntity |
|
|
|
|
classEntity, String date, String tenantId, Long createDept, Long taskId, Long createUser) { |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
String datyTime = format.format(dutydate); |
|
|
|
|
MessagePushRecordDto messagePushRecordDto = new MessagePushRecordDto(); |
|
|
|
|
messagePushRecordDto.setBusinessClassify(OperationalConstants.MessageClassifyEnum.MESSAGE_REMINDSY.getVal()); |
|
|
|
|
messagePushRecordDto.setBusinessClassify(MessageConstants.BusinessClassifyEnum.DUTY.getKey()); |
|
|
|
|
messagePushRecordDto.setBusinessKey(MessageConstants.BusinessClassifyEnum.DUTY.getKey()); |
|
|
|
|
messagePushRecordDto.setSubject(MessageConstants.BusinessClassifyEnum.DUTY.getDescription()); |
|
|
|
|
messagePushRecordDto.setTaskId(taskId); |
|
|
|
@ -1058,11 +1064,11 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
|
|
|
|
|
messagePushRecordDto.setPusherName(userName); |
|
|
|
|
messagePushRecordDto.setAccount(managerId.toString()); |
|
|
|
|
if (type == OperationalConstants.RecTypeEnum.HAND_REMIND.getVal()) { |
|
|
|
|
messagePushRecordDto.setContent(userName + " 于 " + date + " 时已提交交班工作"); |
|
|
|
|
messagePushRecordDto.setContent(userName + " 于 " + date + " 时已提交("+datyTime+")的交班工作"); |
|
|
|
|
} else if (type == OperationalConstants.RecTypeEnum.HAND_DELAY.getVal()) { |
|
|
|
|
messagePushRecordDto.setContent(userName + " 值班日期为(" + classEntity.getStartTime() + " - " + classEntity.getEndTime() + "),目前已延迟交班"); |
|
|
|
|
messagePushRecordDto.setContent(userName +"("+ datyTime+")的值班,时间段为(" + classEntity.getStartTime() + " - " + classEntity.getEndTime() + "),目前已延迟交班"); |
|
|
|
|
} else if (type == OperationalConstants.RecTypeEnum.REMIND_HAND_PERSON.getVal()) { |
|
|
|
|
messagePushRecordDto.setContent("您已交班延迟,请尽快进行交班工作"); |
|
|
|
|
messagePushRecordDto.setContent("您("+ datyTime+")的值班已交班延迟,请尽快进行交班工作"); |
|
|
|
|
} |
|
|
|
|
messagePushRecordDto.setPushType(MessageConstants.IMMEDIATELY); |
|
|
|
|
messagePushRecordDto.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH)); |
|
|
|
|