|
@@ -1,5 +1,6 @@
|
|
package com.platform.service.repair.strategy.impl;
|
|
package com.platform.service.repair.strategy.impl;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
import com.platform.common.cache.ConfigCache;
|
|
import com.platform.common.cache.ConfigCache;
|
|
import com.platform.common.constant.CommonConstants;
|
|
import com.platform.common.constant.CommonConstants;
|
|
import com.platform.common.exception.DeniedException;
|
|
import com.platform.common.exception.DeniedException;
|
|
@@ -82,23 +83,22 @@ public class LongYanPlanRepairStrategy extends AbstractRepairBaseStrategy {
|
|
// 报修人
|
|
// 报修人
|
|
form.setActualUser(SecurityUtils.getUserInfo().getUsername());
|
|
form.setActualUser(SecurityUtils.getUserInfo().getUsername());
|
|
form.setUserId(SecurityUtils.getUserInfo().getUserId());
|
|
form.setUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
|
+ // 同时也是维修人
|
|
|
|
+ form.setRepairUserId(form.getUserId());
|
|
|
|
+ form.setRepairUserName(form.getActualUser());
|
|
// 区域负责人
|
|
// 区域负责人
|
|
form.setReportLeaderId(getReportLeaderId(model.getSbId()));
|
|
form.setReportLeaderId(getReportLeaderId(model.getSbId()));
|
|
|
|
+ // 状态修改为待审核
|
|
|
|
+ form.setStatus(RepairApplicationFormStatusEnum.CALLER_REPAIR_VERIFYING_ONE.getValue());
|
|
repairApplicationFormMapper.insert(form);
|
|
repairApplicationFormMapper.insert(form);
|
|
// 记录维修状态跟踪
|
|
// 记录维修状态跟踪
|
|
- addRepairStatusRecord(form,"报修");
|
|
|
|
|
|
+ String statusRemark = "计划性维修";
|
|
|
|
+ if(model.getCategory() == CommonConstants.NORMAL){
|
|
|
|
+ statusRemark = "日常维修";
|
|
|
|
+ }
|
|
|
|
+ addRepairStatusRecord(form,statusRemark);
|
|
// 给相关的工程师推送信息
|
|
// 给相关的工程师推送信息
|
|
sendMessageToRepairManger(form,sysUserVOList,CommonConstants.CALL_REPAIR_NOTICE);
|
|
sendMessageToRepairManger(form,sysUserVOList,CommonConstants.CALL_REPAIR_NOTICE);
|
|
- // 给该部门班组长推送信息
|
|
|
|
- List<SysUserVO> banzuzhangs = getRepairMangers(repairDeptId,null,SysRoleCodeEnum.Maintenance_Leader.name());
|
|
|
|
- if(banzuzhangs != null && banzuzhangs.size() > 0){
|
|
|
|
- sendMessageToRepairManger(form,banzuzhangs,CommonConstants.CALL_REPAIR_NOTICE);
|
|
|
|
- }
|
|
|
|
- // 给二十四小时人员发送信息
|
|
|
|
- String everyWhereUsers = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_TWENTY_FOUR_USER.name());
|
|
|
|
- if(StringUtils.isNotBlank(everyWhereUsers)){
|
|
|
|
- sendMessageToRepairManger(form,getUserVOs(everyWhereUsers.trim()),CommonConstants.CALL_REPAIR_NOTICE);
|
|
|
|
- }
|
|
|
|
return form;
|
|
return form;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -122,15 +122,6 @@ public class LongYanPlanRepairStrategy extends AbstractRepairBaseStrategy {
|
|
return sbPositionMapper.getById(positionId).getUserId();
|
|
return sbPositionMapper.getById(positionId).getUserId();
|
|
}
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
- Map<String,String> maps = new HashMap<>();
|
|
|
|
- maps.put("13410011001","12121,2323,2323");
|
|
|
|
- maps.put("13410011002","12121,2323,2323");
|
|
|
|
- System.out.println(JsonUtils.objectToJson(maps));
|
|
|
|
- Map<String,String> covertMap = JsonUtils.jsonToMap("{\"13410011002\":\"12121,2323,2323\",\"13410011001\":\"12121,2323,2323\"}");
|
|
|
|
- System.out.println(covertMap.get("13410011001"));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 获取当前用户的角色集合
|
|
* 获取当前用户的角色集合
|
|
* @return
|
|
* @return
|
|
@@ -394,7 +385,7 @@ public class LongYanPlanRepairStrategy extends AbstractRepairBaseStrategy {
|
|
// 3、状态记录表
|
|
// 3、状态记录表
|
|
addRepairStatusRecord(updRepair,"维修上报");
|
|
addRepairStatusRecord(updRepair,"维修上报");
|
|
// 4、通知你上报的人
|
|
// 4、通知你上报的人
|
|
- sendMessageToReportLeader(form,BeanConverterUtil.copyObjectProperties(sysUserMapper.selectByPrimaryKey(model.getReportLeaderId()),SysUserVO.class));
|
|
|
|
|
|
+ sendMessageToReportLeader(form,BeanConverterUtil.copyObjectProperties(sysUserMapper.selectByPrimaryKey(model.getReportLeaderId()),SysUserVO.class),CommonConstants.MM_REPAIR_UP);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -465,7 +456,7 @@ public class LongYanPlanRepairStrategy extends AbstractRepairBaseStrategy {
|
|
form.setStatus(RepairApplicationFormStatusEnum.MM_REPAIR_FAIL.getValue());
|
|
form.setStatus(RepairApplicationFormStatusEnum.MM_REPAIR_FAIL.getValue());
|
|
}
|
|
}
|
|
// 上报通知
|
|
// 上报通知
|
|
- sendMessageToReportLeader(existForm,BeanConverterUtil.copyObjectProperties(sysUserMapper.selectByPrimaryKey(leaderId),SysUserVO.class));
|
|
|
|
|
|
+ sendMessageToReportLeader(existForm,BeanConverterUtil.copyObjectProperties(sysUserMapper.selectByPrimaryKey(leaderId),SysUserVO.class),CommonConstants.MM_REPAIR_UP);
|
|
}
|
|
}
|
|
repairApplicationFormMapper.updateLongYan(form);
|
|
repairApplicationFormMapper.updateLongYan(form);
|
|
// 添加状态记录
|
|
// 添加状态记录
|
|
@@ -478,6 +469,169 @@ public class LongYanPlanRepairStrategy extends AbstractRepairBaseStrategy {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 经理审核报修
|
|
|
|
+ * @param model
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void verifyRepairByMM(RepairApplicationFormDTO model) {
|
|
|
|
+ // 判断是否具有权限
|
|
|
|
+ String roles = getCurrentRoles();
|
|
|
|
+ if(!roles.contains(SysRoleCodeEnum.MM.name())){
|
|
|
|
+ throw new DeniedException("对不起,您不具有审核权限");
|
|
|
|
+ }
|
|
|
|
+ String produceUser = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.PRODUCE_VERIFY_USERS.name());
|
|
|
|
+ if(StringUtils.isBlank(produceUser)){
|
|
|
|
+ throw new DeniedException("生产审核人员为空,请先配置!");
|
|
|
|
+ }
|
|
|
|
+ RepairApplicationForm form = repairApplicationFormMapper.selectById(model.getId());
|
|
|
|
+ // 修改工单状态
|
|
|
|
+ RepairApplicationForm updForm = new RepairApplicationForm();
|
|
|
|
+ updForm.setId(form.getId());
|
|
|
|
+ updForm.setStatus(RepairApplicationFormStatusEnum.CALLER_REPAIR_VERIFYING_THREE.getValue());
|
|
|
|
+ repairApplicationFormMapper.updateByPrimaryKeySelective(updForm);
|
|
|
|
+ // 添加跟踪状态
|
|
|
|
+ addRepairStatusRecord(form,"经理审核");
|
|
|
|
+ // 添加审核记录
|
|
|
|
+ addRepairVerifyRecord(model,CommonConstants.STATUS_VERIFY_PASS, CommonConstants.TYPE_PLAN_MM_VERIFY);
|
|
|
|
+ List<String> userNames = JSONArray.parseArray(produceUser,String.class);
|
|
|
|
+ List<SysUser> users = ListUtils.newArrayList();
|
|
|
|
+ userNames.forEach(item -> {
|
|
|
|
+ users.add(sysUserService.selectByUsername(item));
|
|
|
|
+ });
|
|
|
|
+ // 通知生产审核
|
|
|
|
+ sendMessageToProducer(model,CommonConstants.SB_CALL_REPAIR,users);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 经理审核报修不通过
|
|
|
|
+ * @param model
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void verifyRefusedByMM(RepairApplicationFormDTO model) {
|
|
|
|
+ // 判断是否具有权限
|
|
|
|
+ String roles = getCurrentRoles();
|
|
|
|
+ if(!roles.contains(SysRoleCodeEnum.MM.name())){
|
|
|
|
+ throw new DeniedException("对不起,您不具有审核权限");
|
|
|
|
+ }
|
|
|
|
+ RepairApplicationForm form = repairApplicationFormMapper.selectById(model.getId());
|
|
|
|
+ // 修改工单状态
|
|
|
|
+ RepairApplicationForm updForm = new RepairApplicationForm();
|
|
|
|
+ updForm.setId(form.getId());
|
|
|
|
+ updForm.setStatus(RepairApplicationFormStatusEnum.CALLER_REPAIR_VERIFY_FAIL_TWO.getValue());
|
|
|
|
+ repairApplicationFormMapper.updateByPrimaryKeySelective(updForm);
|
|
|
|
+ // 添加跟踪状态
|
|
|
|
+ addRepairStatusRecord(form,"经理审核不通过");
|
|
|
|
+ // 添加审核记录
|
|
|
|
+ addRepairVerifyRecord(model,CommonConstants.STATUS_VERIFY_REFUSED, CommonConstants.TYPE_PLAN_MM_VERIFY);
|
|
|
|
+ // 通知报修人报修人审核被拒
|
|
|
|
+ sendMessageToRepairCaller(model,CommonConstants.CALL_REPAIR_REFUSED);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 生产审核报修
|
|
|
|
+ * @param model
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void verifyRepairByProduce(RepairApplicationFormDTO model) {
|
|
|
|
+ // 判断是否具有权限
|
|
|
|
+ String roles = getCurrentRoles();
|
|
|
|
+ if(!roles.contains(SysRoleCodeEnum.SB_CALLER_VERIFY.name())){
|
|
|
|
+ throw new DeniedException("对不起,您不具有审核权限");
|
|
|
|
+ }
|
|
|
|
+ RepairApplicationForm form = repairApplicationFormMapper.selectById(model.getId());
|
|
|
|
+ // 修改工单状态
|
|
|
|
+ RepairApplicationForm updForm = new RepairApplicationForm();
|
|
|
|
+ updForm.setId(form.getId());
|
|
|
|
+ updForm.setStatus(RepairApplicationFormStatusEnum.PROCESSING.getValue());
|
|
|
|
+ // 生产审核人
|
|
|
|
+ updForm.setProduceVerifyUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
|
+ repairApplicationFormMapper.updateByPrimaryKeySelective(updForm);
|
|
|
|
+ // 添加跟踪状态
|
|
|
|
+ addRepairStatusRecord(form,"生产审核通过");
|
|
|
|
+ // 添加审核记录
|
|
|
|
+ addRepairVerifyRecord(model,CommonConstants.STATUS_VERIFY_PASS, CommonConstants.TYPE_CALLER_VERIFY);
|
|
|
|
+ // 添加追踪状态
|
|
|
|
+ addRepairStatusRecord(form,"维修中");
|
|
|
|
+ // 添加维修记录
|
|
|
|
+ model.setRepairUserId(form.getRepairUserId());
|
|
|
|
+ model.setRepairUserName(form.getRepairUserName());
|
|
|
|
+ addRepairRecord(model);
|
|
|
|
+ // 通知维修人可以进行维修
|
|
|
|
+ sendMessageToRepairer(model);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 生产审核报修不通过
|
|
|
|
+ * @param model
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void verifyRefusedByProduce(RepairApplicationFormDTO model) {
|
|
|
|
+ // 判断是否具有权限
|
|
|
|
+ String roles = getCurrentRoles();
|
|
|
|
+ if(!roles.contains(SysRoleCodeEnum.SB_CALLER_VERIFY.name())){
|
|
|
|
+ throw new DeniedException("对不起,您不具有审核权限");
|
|
|
|
+ }
|
|
|
|
+ RepairApplicationForm form = repairApplicationFormMapper.selectById(model.getId());
|
|
|
|
+ // 修改工单状态
|
|
|
|
+ RepairApplicationForm updForm = new RepairApplicationForm();
|
|
|
|
+ updForm.setId(form.getId());
|
|
|
|
+ updForm.setStatus(RepairApplicationFormStatusEnum.CALLER_REPAIR_VERIFY_FAIL_THREE.getValue());
|
|
|
|
+ repairApplicationFormMapper.updateByPrimaryKeySelective(updForm);
|
|
|
|
+ // 添加跟踪状态
|
|
|
|
+ addRepairStatusRecord(form,"生产审核不通过");
|
|
|
|
+ // 添加审核记录
|
|
|
|
+ addRepairVerifyRecord(model,CommonConstants.STATUS_VERIFY_REFUSED, CommonConstants.TYPE_CALLER_VERIFY);
|
|
|
|
+ // 通知经理和工程师审核被拒
|
|
|
|
+ SysUserVO leaderVO = sysUserService.selectUserVO(form.getReportLeaderId());
|
|
|
|
+ sendMessageToReportLeader(form,leaderVO,CommonConstants.PRODUCE_REFUSED);
|
|
|
|
+ // 通知工程师
|
|
|
|
+ List<SysUserVO> managers = ListUtils.newArrayList();
|
|
|
|
+ managers.add(sysUserService.selectUserVO(form.getDispatchUserId()));
|
|
|
|
+ sendMessageToRepairManger(form,managers,CommonConstants.PRODUCE_REFUSED_MANAGER);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void applyVerify(RepairApplicationFormDTO model) {
|
|
|
|
+ // 判断是否具有权限
|
|
|
|
+ String roles = getCurrentRoles();
|
|
|
|
+ if(!roles.contains(SysRoleCodeEnum.REPAIR_MANAGE.name())){
|
|
|
|
+ throw new DeniedException("对不起,您不具有权限");
|
|
|
|
+ }
|
|
|
|
+ String produceUser = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.PRODUCE_VERIFY_USERS.name());
|
|
|
|
+ if(StringUtils.isBlank(produceUser)){
|
|
|
|
+ throw new DeniedException("生产审核人员为空,请先配置!");
|
|
|
|
+ }
|
|
|
|
+ RepairApplicationForm form = repairApplicationFormMapper.selectByPrimaryKey(model.getId());
|
|
|
|
+ RepairApplicationForm updForm = new RepairApplicationForm();
|
|
|
|
+ updForm.setId(form.getId());
|
|
|
|
+ updForm.setStatus(RepairApplicationFormStatusEnum.CALLER_REPAIR_VERIFYING_THREE.getValue());
|
|
|
|
+ // 添加跟踪状态
|
|
|
|
+ addRepairStatusRecord(form,"再次发起审核");
|
|
|
|
+ // 添加审核记录
|
|
|
|
+ addRepairVerifyRecord(model,CommonConstants.STATUS_VERIFY_PASS, CommonConstants.TYPE_REPAIR_MANAGER_VERIFY);
|
|
|
|
+ List<String> userNames = JSONArray.parseArray(produceUser,String.class);
|
|
|
|
+ List<SysUser> users = ListUtils.newArrayList();
|
|
|
|
+ userNames.forEach(item -> {
|
|
|
|
+ users.add(sysUserService.selectByUsername(item));
|
|
|
|
+ });
|
|
|
|
+ // 通知生产审核
|
|
|
|
+ sendMessageToProducer(model,CommonConstants.SB_CALL_REPAIR,users);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void nonPlanTransferToPlan(RepairApplicationFormDTO model) {
|
|
|
|
+ // 修改工单类型以及级别
|
|
|
|
+ // 班组长-工程师-经理具有这个权限-暂时放开
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void recoverRepair(RepairApplicationFormDTO model) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 维修人提交维修完成
|
|
* 维修人提交维修完成
|
|
* @param dto
|
|
* @param dto
|
|
@@ -602,36 +756,43 @@ public class LongYanPlanRepairStrategy extends AbstractRepairBaseStrategy {
|
|
public void verifyRepair(RepairApplicationFormDTO model) {
|
|
public void verifyRepair(RepairApplicationFormDTO model) {
|
|
// 判断是否具有权限
|
|
// 判断是否具有权限
|
|
String roles = getCurrentRoles();
|
|
String roles = getCurrentRoles();
|
|
- if(!roles.contains(SysRoleCodeEnum.REPAIR_EXAMINE.name())){
|
|
|
|
|
|
+ if(!roles.contains(SysRoleCodeEnum.REPAIR_MANAGE.name())){
|
|
throw new DeniedException("对不起,您不具有审核权限");
|
|
throw new DeniedException("对不起,您不具有审核权限");
|
|
}
|
|
}
|
|
- super.verifyRepair(model);
|
|
|
|
RepairApplicationForm form = repairApplicationFormMapper.selectById(model.getId());
|
|
RepairApplicationForm form = repairApplicationFormMapper.selectById(model.getId());
|
|
|
|
+ // 修改工单状态
|
|
|
|
+ RepairApplicationForm updForm = new RepairApplicationForm();
|
|
|
|
+ updForm.setId(form.getId());
|
|
|
|
+ updForm.setStatus(RepairApplicationFormStatusEnum.CALLER_REPAIR_VERIFYING_TWO.getValue());
|
|
|
|
+ repairApplicationFormMapper.updateByPrimaryKeySelective(updForm);
|
|
// 添加跟踪状态
|
|
// 添加跟踪状态
|
|
- addRepairStatusRecord(form,"维修完成");
|
|
|
|
|
|
+ addRepairStatusRecord(form,"工程师审核");
|
|
// 添加审核记录
|
|
// 添加审核记录
|
|
- addRepairVerifyRecord(model,CommonConstants.STATUS_VERIFY_PASS, CommonConstants.TYPE_CALLER_VERIFY);
|
|
|
|
- // 通知主管,是否通知维修人
|
|
|
|
- SysUserVO vo = BeanConverterUtil.copyObjectProperties(sysUserMapper.selectByPrimaryKey(form.getDispatchUserId()),SysUserVO.class);
|
|
|
|
- //sendMessageToRepairManger(form,vo,CommonConstants.CALL_REPAIR_FINISH);
|
|
|
|
|
|
+ addRepairVerifyRecord(model,CommonConstants.STATUS_VERIFY_PASS, CommonConstants.TYPE_REPAIR_MANAGER_VERIFY);
|
|
|
|
+ // 通知经理审核
|
|
|
|
+ SysUserVO vo = sysUserService.selectUserVO(form.getReportLeaderId());
|
|
|
|
+ sendMessageToReportLeader(form,vo,CommonConstants.MM_REPAIR_CALLER);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public RepairApplicationFormDTO verifyRefused(RepairApplicationFormDTO model) {
|
|
public RepairApplicationFormDTO verifyRefused(RepairApplicationFormDTO model) {
|
|
// 判断是否具有权限
|
|
// 判断是否具有权限
|
|
String roles = getCurrentRoles();
|
|
String roles = getCurrentRoles();
|
|
- if(!roles.contains(SysRoleCodeEnum.REPAIR_EXAMINE.name())){
|
|
|
|
|
|
+ if(!roles.contains(SysRoleCodeEnum.REPAIR_MANAGE.name())){
|
|
throw new DeniedException("对不起,您不具有审核权限");
|
|
throw new DeniedException("对不起,您不具有审核权限");
|
|
}
|
|
}
|
|
- super.verifyRefused(model);
|
|
|
|
RepairApplicationForm form = repairApplicationFormMapper.selectById(model.getId());
|
|
RepairApplicationForm form = repairApplicationFormMapper.selectById(model.getId());
|
|
|
|
+ // 修改工单状态
|
|
|
|
+ RepairApplicationForm updForm = new RepairApplicationForm();
|
|
|
|
+ updForm.setId(form.getId());
|
|
|
|
+ updForm.setStatus(RepairApplicationFormStatusEnum.CALLER_REPAIR_VERIFY_FAIL_ONE.getValue());
|
|
|
|
+ repairApplicationFormMapper.updateByPrimaryKeySelective(updForm);
|
|
// 添加跟踪状态
|
|
// 添加跟踪状态
|
|
- addRepairStatusRecord(form,"生产驳回");
|
|
|
|
|
|
+ addRepairStatusRecord(form,"工程师审核不通过");
|
|
// 添加审核记录
|
|
// 添加审核记录
|
|
- addRepairVerifyRecord(model,CommonConstants.STATUS_VERIFY_REFUSED, CommonConstants.TYPE_CALLER_VERIFY);
|
|
|
|
- // 通知主管,再次派工维修
|
|
|
|
- SysUserVO vo = BeanConverterUtil.copyObjectProperties(sysUserMapper.selectByPrimaryKey(form.getDispatchUserId()),SysUserVO.class);
|
|
|
|
- //sendMessageToRepairManger(form,vo,CommonConstants.CALL_REPAIR_FAIL);
|
|
|
|
|
|
+ addRepairVerifyRecord(model,CommonConstants.STATUS_VERIFY_REFUSED, CommonConstants.TYPE_REPAIR_MANAGER_VERIFY);
|
|
|
|
+ // 通知报修人报修人审核被拒
|
|
|
|
+ sendMessageToRepairCaller(model,CommonConstants.CALL_REPAIR_REFUSED);
|
|
return model;
|
|
return model;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -777,6 +938,37 @@ public class LongYanPlanRepairStrategy extends AbstractRepairBaseStrategy {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ private void sendMessageToProducer(RepairApplicationFormDTO model,String type,List<SysUser> users){
|
|
|
|
+ List<String> emails = ListUtils.newArrayList();
|
|
|
|
+ List<String> phones = ListUtils.newArrayList();
|
|
|
|
+ List<String> openIds = ListUtils.newArrayList();
|
|
|
|
+ List<String> userIds = ListUtils.newArrayList();
|
|
|
|
+ users.forEach(item -> {
|
|
|
|
+ emails.add(item.getEmail());
|
|
|
|
+ phones.add(item.getPhone());
|
|
|
|
+ openIds.add(item.getWxOpenId());
|
|
|
|
+ userIds.add(item.getUserId());
|
|
|
|
+ });
|
|
|
|
+ String messageInfo = ""; // 通知内容
|
|
|
|
+ Integer detailType = WorkplaceBacklogDetailTypeEnum.SB_CALLER_REPAIR.getValue();
|
|
|
|
+ String[] values = null; // 微信填充内容
|
|
|
|
+ String wechatTemplateId = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_RECEIVE_SUCCESS_WECHAT_TEMPLATE_ID.name()); // 微信模板ID
|
|
|
|
+ String detailUrl = "pages/service-detail/service-detail?id=" + model.getId(); // 微信跳转url
|
|
|
|
+ switch (type){
|
|
|
|
+ case CommonConstants.SB_CALL_REPAIR:
|
|
|
|
+ messageInfo = MessageTemplateUtil.getRepairStart(model.getNo());
|
|
|
|
+ values = new String[]{"设备部提交报修审核!",model.getNo(),"待审核",DateUtils.dateToString(LocalDateTime.now()),"请知悉"};
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ // 1、站内信和email
|
|
|
|
+ sendWorkplaceAndEmailNew(emails,userIds,model.getId(),messageInfo, detailType);
|
|
|
|
+ // 2、微信
|
|
|
|
+ SendMessageUtils.sendWechatNew(openIds,detailUrl,values,wechatTemplateId);
|
|
|
|
+ // 3、短信
|
|
|
|
+ SendMessageUtils.sendCommonSms(phones,messageInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 给相关领导发送消息
|
|
* 给相关领导发送消息
|
|
* @param model
|
|
* @param model
|
|
@@ -870,6 +1062,10 @@ public class LongYanPlanRepairStrategy extends AbstractRepairBaseStrategy {
|
|
values = new String[]{"维修主管派单消息!",form.getNo(),sbInfo.getName(),form.getContent(),form.getSbCph(),"请知悉"};
|
|
values = new String[]{"维修主管派单消息!",form.getNo(),sbInfo.getName(),form.getContent(),form.getSbCph(),"请知悉"};
|
|
detailType = WorkplaceBacklogDetailTypeEnum.REPAIR_REPORT_LEADER_TRANSFER.getValue();
|
|
detailType = WorkplaceBacklogDetailTypeEnum.REPAIR_REPORT_LEADER_TRANSFER.getValue();
|
|
break;
|
|
break;
|
|
|
|
+ case CommonConstants.PRODUCE_REFUSED_MANAGER:
|
|
|
|
+ values = new String[]{"报修生产审核拒绝!",form.getNo(),sbInfo.getName(),form.getContent(),form.getSbCph(),"请知悉"};
|
|
|
|
+ detailType = WorkplaceBacklogDetailTypeEnum.PRODUCE_VERIFY_REFUSED.getValue();
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
Map<String,List<String>> maps = getPushReceivers(userVOs);
|
|
Map<String,List<String>> maps = getPushReceivers(userVOs);
|
|
// 1、站内信
|
|
// 1、站内信
|
|
@@ -884,17 +1080,36 @@ public class LongYanPlanRepairStrategy extends AbstractRepairBaseStrategy {
|
|
* 维修上报通知
|
|
* 维修上报通知
|
|
* @param form
|
|
* @param form
|
|
* @param userVOs
|
|
* @param userVOs
|
|
|
|
+ * @param type
|
|
*/
|
|
*/
|
|
- private void sendMessageToReportLeader(RepairApplicationForm form,SysUserVO userVOs){
|
|
|
|
|
|
+ private void sendMessageToReportLeader(RepairApplicationForm form,SysUserVO userVOs,String type){
|
|
SbInfo sbInfo = sbInfoService.getModelById(form.getSbId());
|
|
SbInfo sbInfo = sbInfoService.getModelById(form.getSbId());
|
|
String domain = getAndCheckPcDomain();
|
|
String domain = getAndCheckPcDomain();
|
|
String repairUrl = domain + "repair/form?no=" + form.getNo();
|
|
String repairUrl = domain + "repair/form?no=" + form.getNo();
|
|
String info = MessageTemplateUtil.getVmHtmlContent(repairUrl,
|
|
String info = MessageTemplateUtil.getVmHtmlContent(repairUrl,
|
|
BeanConverterUtil.copyObjectProperties(form,RepairApplicationFormDTO.class), sbInfo);
|
|
BeanConverterUtil.copyObjectProperties(form,RepairApplicationFormDTO.class), sbInfo);
|
|
Integer detailType = WorkplaceBacklogDetailTypeEnum.REPAIR_REPORT_LEADER.getValue();
|
|
Integer detailType = WorkplaceBacklogDetailTypeEnum.REPAIR_REPORT_LEADER.getValue();
|
|
- String[] values = new String[]{"有一条新的维修上报消息!",form.getNo(),sbInfo.getName(),form.getContent(),form.getSbCph(),"请知悉"};
|
|
|
|
|
|
+ String[] values = null;
|
|
String wechatTemplateId = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_SEND_SUCCESS_WECHAT_TEMPLATE_ID.name());;
|
|
String wechatTemplateId = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_SEND_SUCCESS_WECHAT_TEMPLATE_ID.name());;
|
|
String detailUrl = "pages/service-detail/service-detail?id=" + form.getId();
|
|
String detailUrl = "pages/service-detail/service-detail?id=" + form.getId();
|
|
|
|
+ switch (type){
|
|
|
|
+ case CommonConstants.MM_CLOSE_REPAIR:
|
|
|
|
+ values = new String[]{"工单关闭消息!",form.getNo(),sbInfo.getName(),form.getContent(),form.getSbCph(),"请知悉"};
|
|
|
|
+ detailType = WorkplaceBacklogDetailTypeEnum.REPAIR_REPORT_CLOSE.getValue();
|
|
|
|
+ break;
|
|
|
|
+ case CommonConstants.MM_REPAIR_UP:
|
|
|
|
+ values = new String[]{"维修上报消息!",form.getNo(),sbInfo.getName(),form.getContent(),form.getSbCph(),"请知悉"};
|
|
|
|
+ detailType = WorkplaceBacklogDetailTypeEnum.REPAIR_REPORT_LEADER.getValue();
|
|
|
|
+ break;
|
|
|
|
+ case CommonConstants.MM_REPAIR_CALLER:
|
|
|
|
+ values = new String[]{"报修审核消息!",form.getNo(),sbInfo.getName(),form.getContent(),form.getSbCph(),"请知悉"};
|
|
|
|
+ detailType = WorkplaceBacklogDetailTypeEnum.REPAIR_REPORT_CALLER_VERIFY.getValue();
|
|
|
|
+ break;
|
|
|
|
+ case CommonConstants.PRODUCE_REFUSED:
|
|
|
|
+ values = new String[]{"报修审核被拒消息!",form.getNo(),sbInfo.getName(),form.getContent(),form.getSbCph(),"请知悉"};
|
|
|
|
+ detailType = WorkplaceBacklogDetailTypeEnum.PRODUCE_VERIFY_REFUSED.getValue();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
// 1、站内信
|
|
// 1、站内信
|
|
sendWorkplaceAndEmailNew(ListUtils.newArrayList(userVOs.getEmail()),ListUtils.newArrayList(userVOs.getUserId()),form.getId(),info, detailType);
|
|
sendWorkplaceAndEmailNew(ListUtils.newArrayList(userVOs.getEmail()),ListUtils.newArrayList(userVOs.getUserId()),form.getId(),info, detailType);
|
|
// 2、微信
|
|
// 2、微信
|