|
@@ -1,5 +1,6 @@
|
|
|
package cn.iocoder.yudao.module.pms.service.failure;
|
|
package cn.iocoder.yudao.module.pms.service.failure;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
|
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
|
|
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
|
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
|
@@ -223,8 +224,32 @@ public class IotFailureReportServiceImpl implements IotFailureReportService {
|
|
|
iotFailureReportMapper.insert(iotFailureReport);
|
|
iotFailureReportMapper.insert(iotFailureReport);
|
|
|
} else {
|
|
} else {
|
|
|
iotFailureReport.setStatus("reporting");
|
|
iotFailureReport.setStatus("reporting");
|
|
|
|
|
+ String deviceCompany = iotDeviceService.getDeviceCompany(iotFailureReport.getDeviceId());
|
|
|
|
|
+ if ("rh".equals(deviceCompany)) {
|
|
|
|
|
+ //如果为瑞恒的话,就设置为上一级项目部的副经理
|
|
|
|
|
+ Long deptId = iotFailureReport.getDeptId();
|
|
|
|
|
+ DeptRespDTO dept = deptApi.getDept(deptId);
|
|
|
|
|
+ if (Objects.nonNull(dept)) {
|
|
|
|
|
+ Long parentId = dept.getParentId();
|
|
|
|
|
+ if (Objects.nonNull(parentId)) {
|
|
|
|
|
+ DeptRespDTO dept1 = deptApi.getDeptNoPermission(parentId);
|
|
|
|
|
+ if (Objects.nonNull(dept1)) {
|
|
|
|
|
+ if ("塔河项目部".equals(dept1.getName())){
|
|
|
|
|
+ iotFailureReport.setApprovalId("558");//窦文超
|
|
|
|
|
+ createReqVO.setApprovalId("558");//窦文超
|
|
|
|
|
+ } else if ("塔里木项目部".equals(dept1.getName())) {
|
|
|
|
|
+ iotFailureReport.setApprovalId("150");//焦芳功
|
|
|
|
|
+ createReqVO.setApprovalId("150");//焦芳功
|
|
|
|
|
+ } else if ("吐哈项目部".equals(dept1.getName())) {
|
|
|
|
|
+ iotFailureReport.setApprovalId("318");//王纯英
|
|
|
|
|
+ createReqVO.setApprovalId("318");//王纯英
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
if (StringUtils.isBlank(createReqVO.getApprovalId())||Objects.isNull(iotFailureReport.getApprovalId())) {
|
|
if (StringUtils.isBlank(createReqVO.getApprovalId())||Objects.isNull(iotFailureReport.getApprovalId())) {
|
|
|
- throw new ServiceException(new ErrorCode(111,"审批人未填"));
|
|
|
|
|
|
|
+ throw new ServiceException(new ErrorCode(111,"无对应故障审批人"));
|
|
|
}
|
|
}
|
|
|
iotFailureReport.setAuditStatus(FailureAuditStatusEnum.PROCESS.getStatus());
|
|
iotFailureReport.setAuditStatus(FailureAuditStatusEnum.PROCESS.getStatus());
|
|
|
iotFailureReportMapper.insert(iotFailureReport);
|
|
iotFailureReportMapper.insert(iotFailureReport);
|