|
@@ -43,6 +43,7 @@ import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
import com.google.common.collect.ImmutableMap;
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -212,9 +213,9 @@ public class IotMaintainServiceImpl implements IotMaintainService {
|
|
validateIotMaintainExists(updateReqVO.getMaintain().getId());
|
|
validateIotMaintainExists(updateReqVO.getMaintain().getId());
|
|
// 更新
|
|
// 更新
|
|
IotMaintainDO updateObj = BeanUtils.toBean(updateReqVO.getMaintain(), IotMaintainDO.class);
|
|
IotMaintainDO updateObj = BeanUtils.toBean(updateReqVO.getMaintain(), IotMaintainDO.class);
|
|
- if ("out".equals(updateObj.getType())&&updateObj.getAuditStatus()==20){
|
|
|
|
|
|
+ //if ("out".equals(updateObj.getType())&&updateObj.getAuditStatus()==20){
|
|
updateObj.setStatus("finished");
|
|
updateObj.setStatus("finished");
|
|
- }
|
|
|
|
|
|
+ //}
|
|
iotMaintainMapper.updateById(updateObj);
|
|
iotMaintainMapper.updateById(updateObj);
|
|
//删除工单bom及物料
|
|
//删除工单bom及物料
|
|
iotMaintainBomMapper.delete("maintain_id", String.valueOf(updateObj.getId()));
|
|
iotMaintainBomMapper.delete("maintain_id", String.valueOf(updateObj.getId()));
|
|
@@ -256,6 +257,12 @@ public class IotMaintainServiceImpl implements IotMaintainService {
|
|
String msg = "【PMS】有新的委外维修流程, 请前往系统审批";
|
|
String msg = "【PMS】有新的委外维修流程, 请前往系统审批";
|
|
sendMessage(BeanUtils.toBean(updateReqVO, IotMaintainDO.class), "maintain-out", msg);
|
|
sendMessage(BeanUtils.toBean(updateReqVO, IotMaintainDO.class), "maintain-out", msg);
|
|
}
|
|
}
|
|
|
|
+ //故障上报处理转为工单已完成-orderfinished
|
|
|
|
+ if (StringUtils.isNotBlank(updateReqVO.getMaintain().getFailureId())){
|
|
|
|
+ IotFailureReportDO iotFailureReportDO = iotFailureReportMapper.selectById(updateReqVO.getMaintain().getFailureId());
|
|
|
|
+ iotFailureReportDO.setStatus("orderfinished");
|
|
|
|
+ iotFailureReportMapper.updateById(iotFailureReportDO);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -357,4 +364,11 @@ public class IotMaintainServiceImpl implements IotMaintainService {
|
|
return iotMaintainMapper.selectPage(pageReqVO, ids);
|
|
return iotMaintainMapper.selectPage(pageReqVO, ids);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void syncWordOrderData(List<Long> deviceIds, Long deptId) {
|
|
|
|
+ List<IotMaintainDO> maintainDOS = iotMaintainMapper.selectByStatusAndAuditStatusAndDeviceId("finished", 20, deviceIds);
|
|
|
|
+ maintainDOS.forEach(maintainDO -> maintainDO.setDeptId(deptId));
|
|
|
|
+ iotMaintainMapper.updateBatch(maintainDOS);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|