|
@@ -71,15 +71,15 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
|
|
|
// 发送短信通知给所有维修,且必须是正式环境
|
|
|
SysUserDTO sysUserDTO = new SysUserDTO();
|
|
|
- sysUserDTO.setRoleCode(SysRoleCodeEnum.Maintenance.name());
|
|
|
+ sysUserDTO.setRoleCode(SysRoleCodeEnum.REPAIR_DISPATCH.name());
|
|
|
List<SysUserVO> sysUserVOList = sysUserService.getDeptChildrenRoleUser(sysUserDTO);
|
|
|
if (CollectionUtil.isNotEmpty(sysUserVOList)) {
|
|
|
for (SysUserVO sysUserVO : sysUserVOList) {
|
|
|
// 站内信需要用户id
|
|
|
userIds.add(sysUserVO.getUserId());
|
|
|
- if (StringUtils.isNotBlank(sysUserVO.getWxOpenid())) {
|
|
|
+ if (StringUtils.isNotBlank(sysUserVO.getWxOpenId())) {
|
|
|
// 微信id
|
|
|
- openIds.add(sysUserVO.getWxOpenid());
|
|
|
+ openIds.add(sysUserVO.getWxOpenId());
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(sysUserVO.getPhone())) {
|
|
|
// 手机
|
|
@@ -185,6 +185,11 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
return applicationForm;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 拒绝
|
|
|
+ * @param model
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public RepairApplicationFormDTO verifyRefused(RepairApplicationFormDTO model) {
|
|
|
RepairApplicationFormDTO dto = super.verifyRefused(model);
|
|
@@ -231,13 +236,31 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
applicationForm.setStatus(RepairApplicationFormStatusEnum.PROCESSING.getValue());
|
|
|
applicationForm.setRepairStartTime(LocalDateTime.now());
|
|
|
applicationForm.setUpdateTime(LocalDateTime.now());
|
|
|
- // 转派其他人要将维修结束时间置空'
|
|
|
+ // 转派其他人要将维修结束时间置空
|
|
|
repairApplicationFormMapper.updateForRepairDispatch(applicationForm);
|
|
|
|
|
|
SysUser repairUser = sysUserService.getModelById(model.getRepairUserId());
|
|
|
- SpringContextHolder.publishEvent(new WorkplaceBacklogEvent(WorkplaceBacklogTypeEnum.REPAIR.getValue(), WorkplaceBacklogDetailTypeEnum.REPAIR_DISPATCH.getValue(),
|
|
|
+ /*SpringContextHolder.publishEvent(new WorkplaceBacklogEvent(WorkplaceBacklogTypeEnum.REPAIR.getValue(), WorkplaceBacklogDetailTypeEnum.REPAIR_DISPATCH.getValue(),
|
|
|
applicationForm.getId(), MessageTemplateUtil.getRepairDispatch(applicationForm.getNo()),
|
|
|
- applicationForm.getId(), ListUtils.newArrayList(model.getRepairUserId()), ListUtils.newArrayList(repairUser.getEmail())));
|
|
|
+ applicationForm.getId(), ListUtils.newArrayList(model.getRepairUserId()), ListUtils.newArrayList(repairUser.getEmail())));*/
|
|
|
+ List<String> openIds = new ArrayList<>();
|
|
|
+ List<String> userIds = new ArrayList<>();
|
|
|
+ List<String> mails = new ArrayList<>();
|
|
|
+ List<String> receiverList = new ArrayList<>();
|
|
|
+
|
|
|
+ // 发送短信通知给所有维修,且必须是正式环境
|
|
|
+ userIds.add(repairUser.getUserId());
|
|
|
+ openIds.add(repairUser.getWxOpenId());
|
|
|
+ receiverList.add(repairUser.getPhone());
|
|
|
+ mails.add(repairUser.getEmail());
|
|
|
+
|
|
|
+ // 推送站内信和邮箱,根据业务需要
|
|
|
+ SbInfo sb = sbInfoService.getModelById(model.getSbId());
|
|
|
+ sendWorkplaceAndEmail(mails,userIds,model,sb);
|
|
|
+ // 推送微信
|
|
|
+ sendWechat(openIds,model,sb);
|
|
|
+ // 短信
|
|
|
+ sendSms(receiverList,model,sb);
|
|
|
return model;
|
|
|
}
|
|
|
}
|