|
@@ -102,6 +102,9 @@ public class DingService {
|
|
HashSet<String> phones = new HashSet<>();
|
|
HashSet<String> phones = new HashSet<>();
|
|
|
|
|
|
OaData oaData = getOaData(repairLog);
|
|
OaData oaData = getOaData(repairLog);
|
|
|
|
+ if(oaData == null){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if(oaData.getSysUserId() != null){
|
|
if(oaData.getSysUserId() != null){
|
|
Long sysUserId = oaData.getSysUserId();
|
|
Long sysUserId = oaData.getSysUserId();
|
|
SysUser sysUser = sysUserService.getById(sysUserId);
|
|
SysUser sysUser = sysUserService.getById(sysUserId);
|
|
@@ -135,7 +138,8 @@ public class DingService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(phones.size() <=0){
|
|
if(phones.size() <=0){
|
|
- throw new BusinessException(ResultCode.DING_SEND_ERROR);
|
|
|
|
|
|
+ log.info("send-dingding:repairLog:{},phone:{}",repairLog,phones);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
DingMsgReq dingMsgReq = new DingMsgReq();
|
|
DingMsgReq dingMsgReq = new DingMsgReq();
|
|
dingMsgReq.setAgent_id(dingConfig.getAgentId());
|
|
dingMsgReq.setAgent_id(dingConfig.getAgentId());
|
|
@@ -163,6 +167,7 @@ public class DingService {
|
|
fileContent = fileContent.replaceAll("\\{warrantyTypeStr}",oaData.getWarrantyTypeStr());
|
|
fileContent = fileContent.replaceAll("\\{warrantyTypeStr}",oaData.getWarrantyTypeStr());
|
|
fileContent = fileContent.replaceAll("\\{repairStatusStr}",oaData.getRepairStatusStr());
|
|
fileContent = fileContent.replaceAll("\\{repairStatusStr}",oaData.getRepairStatusStr());
|
|
fileContent = fileContent.replaceAll("\\{description}",oaData.getDescription());
|
|
fileContent = fileContent.replaceAll("\\{description}",oaData.getDescription());
|
|
|
|
+ fileContent = fileContent.replaceAll("\\{sendDate}",oaData.getSendDate());
|
|
dingMsgReq.setUserid_list(userIds);
|
|
dingMsgReq.setUserid_list(userIds);
|
|
dingMsgReq.setMsg(JSONObject.parseObject(fileContent));
|
|
dingMsgReq.setMsg(JSONObject.parseObject(fileContent));
|
|
dingMsgReq.setTo_all_user(false);
|
|
dingMsgReq.setTo_all_user(false);
|
|
@@ -189,6 +194,9 @@ public class DingService {
|
|
RepairLogVo repairLogVo = new RepairLogVo();
|
|
RepairLogVo repairLogVo = new RepairLogVo();
|
|
BeanUtils.copyProperties(repairLog,repairLogVo);
|
|
BeanUtils.copyProperties(repairLog,repairLogVo);
|
|
RepairLogVo nextStepVo = repairInfoService.getNextStepVo(repairLogVo);
|
|
RepairLogVo nextStepVo = repairInfoService.getNextStepVo(repairLogVo);
|
|
|
|
+ if(nextStepVo == null){
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
oaData.setDescription(nextStepVo.getSubTitle());
|
|
oaData.setDescription(nextStepVo.getSubTitle());
|
|
oaData.setSysUserId(nextStepVo.getSysUserId());
|
|
oaData.setSysUserId(nextStepVo.getSysUserId());
|
|
return oaData;
|
|
return oaData;
|