|
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.rongwei.bscommon.sys.service.ZhcxInsideInspectionDispatchService;
|
|
|
import com.rongwei.bscommon.sys.service.ZhcxInsideInspectionOperLogService;
|
|
|
+import com.rongwei.bscommon.sys.service.ZhcxItpProjectNodeStateService;
|
|
|
import com.rongwei.bscommon.sys.utils.ZhcxCommon;
|
|
|
import com.rongwei.bsentity.domain.*;
|
|
|
import com.rongwei.bscommon.sys.dao.ZhcxInsideInspectionDao;
|
|
@@ -84,6 +85,10 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
@Autowired
|
|
|
private SysFileItemService sysFileItemService;
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ZhcxItpProjectNodeStateService itpProjectNodeStateService;
|
|
|
+
|
|
|
@Value("${temp.filepath:#{null}}")
|
|
|
private String filepath;
|
|
|
|
|
@@ -274,6 +279,11 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
|
|
|
//发送提醒
|
|
|
zhcxCommon.sendMsg(notifyList);
|
|
|
+
|
|
|
+ // 写入ZHCX_ITP_PROJECT_NODE_STATE表
|
|
|
+ for (ZhcxInsideInspectionDo row : inspectionList) {
|
|
|
+ saveResultToNodeState(row, "10");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -578,18 +588,22 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
if(ObjectUtil.isEmpty(req.getInsideIdList())) {
|
|
|
throw new CustomException("请联系管理员,暂无报验单");
|
|
|
}
|
|
|
-
|
|
|
+ // 20: 拒收 50: 接收 60: 有条件接收
|
|
|
+ String es = "";
|
|
|
OperDto operDto;
|
|
|
//接收
|
|
|
if("10".equals(req.getConclusion())) {
|
|
|
+ es = "50";
|
|
|
operDto = getOper("50");
|
|
|
}
|
|
|
//拒收
|
|
|
else if("20".equals(req.getConclusion())) {
|
|
|
+ es = "20";
|
|
|
operDto = getOper("20");
|
|
|
}
|
|
|
//有条件接收
|
|
|
else if("30".equals(req.getConclusion())) {
|
|
|
+ es = "60";
|
|
|
operDto = getOper("60");
|
|
|
}
|
|
|
else {
|
|
@@ -657,6 +671,11 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
//操作日志
|
|
|
operLogService.saveOperLog(req, operDto, Collections.emptyMap());
|
|
|
}
|
|
|
+
|
|
|
+ // 写入ZHCX_ITP_PROJECT_NODE_STATE表
|
|
|
+ for (ZhcxInsideInspectionDo row : inspectionList) {
|
|
|
+ saveResultToNodeState(row, es);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1381,4 +1400,55 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
sysSerialVo.setInitValue(0L);
|
|
|
return serialNumberService.getCodeByTemplate(sysSerialVo);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存数据到ZHCX_ITP_PROJECT_NODE_STATE(项目各机号报验点状态)表
|
|
|
+ * @param operType 操作类型 10: 取消 20: 拒收 30: 派单 40: 转派 50: 接收 60: 有条件接收 70:修改检验开始结束时间
|
|
|
+ */
|
|
|
+ private void saveResultToNodeState(ZhcxInsideInspectionDo itpDoPa, String operType) {
|
|
|
+ ZhcxInsideInspectionDo itpDo = getById(itpDoPa.getId());
|
|
|
+
|
|
|
+ if("unitp".equals(itpDo.getLaunchtype())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String machineNo = itpDo.getMachineno();
|
|
|
+ if (StringUtils.isBlank(machineNo)) {
|
|
|
+ machineNo = itpDo.getStructuremachineno();
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(machineNo)) {
|
|
|
+ log.error("{}-{}:总装机号和结构机号都没有", itpDo.getId(), itpDo.getInspectioncode());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String[] machinenos = machineNo.split(",");
|
|
|
+ List<ZhcxItpProjectNodeStateResultDto> list = new ArrayList<>(machinenos.length);
|
|
|
+ for (String mn : machinenos) {
|
|
|
+ LambdaQueryWrapper<ZhcxItpProjectNodeStateDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(ZhcxItpProjectNodeStateDo::getPrjid, itpDo.getProjectid())
|
|
|
+ .eq(ZhcxItpProjectNodeStateDo::getMathinecode, mn)
|
|
|
+ .eq(ZhcxItpProjectNodeStateDo::getNodeid, itpDo.getInspectioncontentid());
|
|
|
+ ZhcxItpProjectNodeStateDo stateDo = itpProjectNodeStateService.getOne(queryWrapper);
|
|
|
+
|
|
|
+ ZhcxItpProjectNodeStateDo entity = new ZhcxItpProjectNodeStateDo();
|
|
|
+ if(ObjectUtil.isNull(stateDo)) {
|
|
|
+ entity.setId(SecurityUtil.getUUID());
|
|
|
+ entity.setMathinecode(mn);
|
|
|
+ entity.setPrjid(itpDo.getProjectid());
|
|
|
+ entity.setNodeid(itpDo.getInspectioncontentid());
|
|
|
+ entity.setDeleted("0");
|
|
|
+ entity.setInstate(operType);
|
|
|
+ entity.setIncompletetime(itpDoPa.getInspectioncomplatetime());
|
|
|
+ entity.setIntimes(itpDo.getInspectioncount());
|
|
|
+ entity.setCreatedate(new Date());
|
|
|
+ entity.setModifydate(new Date());
|
|
|
+// itpProjectNodeStateService.save(entity);
|
|
|
+ } else {
|
|
|
+ stateDo.setInstate(operType);
|
|
|
+ stateDo.setIncompletetime(itpDoPa.getInspectioncomplatetime());
|
|
|
+ stateDo.setIntimes(itpDo.getInspectioncount());
|
|
|
+ stateDo.setModifydate(new Date());
|
|
|
+// itpProjectNodeStateService.updateById(stateDo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|