|
@@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.platform.common.cache.ConfigCache;
|
|
|
import com.platform.common.exception.BusinessException;
|
|
|
import com.platform.common.exception.DeniedException;
|
|
|
-import com.platform.common.model.UserInfo;
|
|
|
import com.platform.common.util.*;
|
|
|
import com.platform.dao.dto.repair.RepairApplicationFormDTO;
|
|
|
import com.platform.dao.dto.upms.SysUserDTO;
|
|
@@ -30,8 +29,41 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
|
|
|
@Override
|
|
|
public RepairApplicationForm callRepair(RepairApplicationFormDTO model) {
|
|
|
+ // 指定派单人角色
|
|
|
RepairApplicationForm form = super.callRepair(model);
|
|
|
repairApplicationFormMapper.insert(form);
|
|
|
+ SysUserDTO sysUserDTO = new SysUserDTO();
|
|
|
+ sysUserDTO.setUserId(form.getDispatchUserId());
|
|
|
+ SysUserVO userVO = sysUserService.selectUserVO(form.getDispatchUserId());
|
|
|
+ List<SysUserVO> sysUserVOList = CollectionUtil.toList(userVO);
|
|
|
+ List<String> openIds = new ArrayList<>();
|
|
|
+ List<String> userIds = new ArrayList<>();
|
|
|
+ List<String> mails = new ArrayList<>();
|
|
|
+ if (CollectionUtil.isNotEmpty(sysUserVOList)) {
|
|
|
+ for (SysUserVO sysUserVO : sysUserVOList) {
|
|
|
+ // 站内信需要用户id
|
|
|
+ userIds.add(sysUserVO.getUserId());
|
|
|
+ if (StringUtils.isNotBlank(sysUserVO.getWxOpenId())) {
|
|
|
+ // 微信id
|
|
|
+ openIds.add(sysUserVO.getWxOpenId());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(sysUserVO.getEmail())) {
|
|
|
+ // 邮箱
|
|
|
+ mails.add(sysUserVO.getEmail());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ model = BeanConverterUtil.copyObjectProperties(form,RepairApplicationFormDTO.class);
|
|
|
+ SbInfo sb = sbInfoService.getModelById(model.getSbId());
|
|
|
+ // 推送站内信和邮箱,根据业务需要
|
|
|
+ sendWorkplaceAndEmail(mails,userIds,model,sb);
|
|
|
+ // 推送微信
|
|
|
+ sendWechat(openIds,model,sb);
|
|
|
+ return form;
|
|
|
+
|
|
|
+ // 以下是平均派单的模式
|
|
|
+ /*RepairApplicationForm form = super.callRepair(model);
|
|
|
+ repairApplicationFormMapper.insert(form);
|
|
|
// 根据自身需要将任务推送通知还是派送到具体主管手上
|
|
|
SysUserDTO query = new SysUserDTO();
|
|
|
query.setOrderByFlag(1);
|
|
@@ -102,7 +134,7 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
sendSms(receiverList,model,sb);
|
|
|
// 启动超时监控
|
|
|
overTimeListen(form.getId());
|
|
|
- return form;
|
|
|
+ return form;*/
|
|
|
}
|
|
|
|
|
|
@Override
|