|
@@ -20,6 +20,7 @@ import com.rongwei.bscommon.sys.dao.ZhcxInsideInspectionDao;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.rongwei.bsentity.dto.*;
|
|
|
import com.rongwei.bsentity.dto.inside.*;
|
|
|
+import com.rongwei.bsentity.dto.project.ProjectNodeStateBo;
|
|
|
import com.rongwei.bsentity.vo.ZhcxInsideInspectionVo;
|
|
|
import com.rongwei.commonservice.serial.service.SysSerialNumberService;
|
|
|
import com.rongwei.rwadmincommon.system.domain.SysRoleDo;
|
|
@@ -47,7 +48,6 @@ import java.io.*;
|
|
|
import java.net.URLEncoder;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -227,6 +227,12 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
List<ZhcxInsideInspectionDispatchDo> dispatchList = new ArrayList<>();
|
|
|
List<ZhcxInsideInspectionDo> inspectionList = new ArrayList<>();
|
|
|
List<NotifyDto> notifyList = new ArrayList<>();
|
|
|
+ ProjectNodeStateBo nodeStateBo = ProjectNodeStateBo.builder()
|
|
|
+ .insertList(new ArrayList<>())
|
|
|
+ .updateList(new ArrayList<>())
|
|
|
+ .insideStateList(new ArrayList<>())
|
|
|
+ .build();
|
|
|
+
|
|
|
|
|
|
for(String insideId : req.getInsideIdList()) {
|
|
|
InsideOperDto inOper = getInsideOperDto(insideId);
|
|
@@ -287,6 +293,8 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
|
|
|
NotifyDto notify = getMailInfo4Cancel(inOper, req);
|
|
|
notifyList.add(notify);
|
|
|
+
|
|
|
+ assembleResultToNodeState(inOper, nodeStateBo, null);
|
|
|
}
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(msgList)) {
|
|
@@ -304,10 +312,8 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
//发送提醒
|
|
|
zhcxCommon.sendMsg(notifyList);
|
|
|
|
|
|
- // 写入ZHCX_ITP_PROJECT_NODE_STATE表
|
|
|
- for (ZhcxInsideInspectionDo row : inspectionList) {
|
|
|
- saveResultToNodeState(row, "10");
|
|
|
- }
|
|
|
+ //保存报验点状态
|
|
|
+ itpProjectNodeStateService.saveNode(nodeStateBo);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -677,21 +683,17 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
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 {
|
|
@@ -701,6 +703,11 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
List<String> msgList = new ArrayList<>();
|
|
|
List<ZhcxInsideInspectionDispatchDo> dispatchList = new ArrayList<>();
|
|
|
List<ZhcxInsideInspectionDo> inspectionList = new ArrayList<>();
|
|
|
+ ProjectNodeStateBo nodeStateBo = ProjectNodeStateBo.builder()
|
|
|
+ .insertList(new ArrayList<>())
|
|
|
+ .updateList(new ArrayList<>())
|
|
|
+ .insideStateList(new ArrayList<>())
|
|
|
+ .build();
|
|
|
|
|
|
for(String insideId : req.getInsideIdList()) {
|
|
|
InsideOperDto inOper = getInsideOperDto(insideId);
|
|
@@ -754,6 +761,9 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
inspection.setInspectioncomplatetime(new Date());
|
|
|
}
|
|
|
inspectionList.add(inspection);
|
|
|
+
|
|
|
+ //报验点状态
|
|
|
+ assembleResultToNodeState(inOper, nodeStateBo, inspection.getInspectioncomplatetime());
|
|
|
}
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(msgList)) {
|
|
@@ -772,10 +782,8 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
operLogService.saveOperLog(req, operDto, Collections.emptyMap());
|
|
|
}
|
|
|
|
|
|
- // 写入ZHCX_ITP_PROJECT_NODE_STATE表
|
|
|
- for (ZhcxInsideInspectionDo row : inspectionList) {
|
|
|
- saveResultToNodeState(row, es);
|
|
|
- }
|
|
|
+ //保存报验点状态
|
|
|
+ itpProjectNodeStateService.saveNode(nodeStateBo);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1585,25 +1593,23 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
|
|
|
/**
|
|
|
* 保存数据到ZHCX_ITP_PROJECT_NODE_STATE(项目各机号报验点状态)表
|
|
|
- * @param operType 操作类型 10: 取消 20: 拒收 30: 派单 40: 转派 50: 接收 60: 有条件接收 70:修改检验开始结束时间
|
|
|
+ * operType 操作类型 10: 取消 20: 拒收 30: 派单 40: 转派 50: 接收 60: 有条件接收 70:修改检验开始结束时间
|
|
|
*/
|
|
|
- private void saveResultToNodeState(ZhcxInsideInspectionDo itpDoPa, String operType) {
|
|
|
- SysUserVo currUser = zhcxCommon.getCurrentUser();
|
|
|
- ZhcxInsideInspectionDo itpDo = getById(itpDoPa.getId());
|
|
|
-
|
|
|
- if(!"itp".equals(itpDo.getLaunchtype())) {
|
|
|
+ private void assembleResultToNodeState(InsideOperDto inOper, ProjectNodeStateBo nodeStateBo, Date complateTime) {
|
|
|
+ if(!"itp".equals(inOper.getInspection().getLaunchtype())) {
|
|
|
return;
|
|
|
}
|
|
|
- String machineNo = itpDo.getMachineno();
|
|
|
+ ZhcxInsideInspectionDo itpDo = inOper.getInspection();
|
|
|
+
|
|
|
+ String machineNo = inOper.getInspection().getMachineno();
|
|
|
if (StringUtils.isBlank(machineNo)) {
|
|
|
- machineNo = itpDo.getStructuremachineno();
|
|
|
+ machineNo = inOper.getInspection().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())
|
|
@@ -1619,65 +1625,73 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
stateDo.setPrjid(itpDo.getProjectid());
|
|
|
stateDo.setNodeid(itpDo.getInspectioncontentid());
|
|
|
stateDo.setDeleted("0");
|
|
|
-// entity.setIncompletetime(itpDoPa.getInspectioncomplatetime());
|
|
|
|
|
|
- //接收
|
|
|
- if("50".equals(operType)) {
|
|
|
- stateDo.setIncompletetime(itpDoPa.getInspectioncomplatetime());
|
|
|
- }
|
|
|
- //有条件接收
|
|
|
- else if ("60".equals(operType)) {
|
|
|
- stateDo.setIncompletetime(itpDoPa.getInspectioncomplatetime());
|
|
|
- }
|
|
|
+ stateDo.setCreatedate(inOper.getOperTime());
|
|
|
+ stateDo.setCreateuserid(inOper.getOperUser().getId());
|
|
|
+ stateDo.setCreateusername(inOper.getOperUser().getName());
|
|
|
+// entity.setIncompletetime(itpDoPa.getInspectioncomplatetime());
|
|
|
+ assembleUpdateNodeState(stateDo, inOper, complateTime);
|
|
|
|
|
|
- stateDo.setIntimes(itpDo.getInspectioncount());
|
|
|
- stateDo.setCreatedate(new Date());
|
|
|
- stateDo.setCreateuserid(currUser.getId());
|
|
|
- stateDo.setCreateusername(currUser.getName());
|
|
|
- updateNodeState(stateDo, operType);
|
|
|
- itpProjectNodeStateService.save(stateDo);
|
|
|
+ nodeStateBo.getInsertList().add(stateDo);
|
|
|
} else {
|
|
|
// stateDo.setIncompletetime(itpDoPa.getInspectioncomplatetime());
|
|
|
+ assembleUpdateNodeState(stateDo, inOper, complateTime);
|
|
|
|
|
|
- //接收
|
|
|
- if("50".equals(operType)) {
|
|
|
- stateDo.setIncompletetime(itpDoPa.getInspectioncomplatetime());
|
|
|
- }
|
|
|
- //有条件接收
|
|
|
- else if ("60".equals(operType)) {
|
|
|
- stateDo.setIncompletetime(itpDoPa.getInspectioncomplatetime());
|
|
|
- }
|
|
|
-
|
|
|
- stateDo.setIntimes(itpDo.getInspectioncount());
|
|
|
- updateNodeState(stateDo, operType);
|
|
|
- itpProjectNodeStateService.updateById(stateDo);
|
|
|
+ nodeStateBo.getUpdateList().add(stateDo);
|
|
|
}
|
|
|
+
|
|
|
+ // 报验点-内部报验单
|
|
|
+ ZhcxItpProjectNodeStateInsideDo stateInside = new ZhcxItpProjectNodeStateInsideDo();
|
|
|
+ stateInside.setId(SecurityUtil.getUUID());
|
|
|
+ stateInside.setDeleted("0");
|
|
|
+ stateInside.setInsideid(itpDo.getId());
|
|
|
+ stateInside.setStateid(stateDo.getId());
|
|
|
+ stateInside.setInspectioncode(itpDo.getInspectioncode());
|
|
|
+ stateInside.setLaunchtype(itpDo.getLaunchtype());
|
|
|
+ nodeStateBo.getInsideStateList().add(stateInside);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void updateNodeState(ZhcxItpProjectNodeStateDo entity, String operType) {
|
|
|
- SysUserVo currUser = zhcxCommon.getCurrentUser();
|
|
|
- entity.setModifydate(new Date());
|
|
|
- entity.setModifyuserid(currUser.getId());
|
|
|
- entity.setModifyusername(currUser.getName());
|
|
|
+ /**
|
|
|
+ * 组装
|
|
|
+ *
|
|
|
+ * @param entity
|
|
|
+ * @param inOper
|
|
|
+ * @param complateTime
|
|
|
+ */
|
|
|
+ private void assembleUpdateNodeState(ZhcxItpProjectNodeStateDo entity, InsideOperDto inOper, Date complateTime) {
|
|
|
+ entity.setModifydate(inOper.getOperTime());
|
|
|
+ entity.setModifyuserid(inOper.getOperUser().getId());
|
|
|
+ entity.setModifyusername(inOper.getOperUser().getName());
|
|
|
//取消
|
|
|
- if("10".equals(operType)) {
|
|
|
+ if("10".equals(inOper.getOperType())) {
|
|
|
entity.setInstate("40");
|
|
|
}
|
|
|
//拒收
|
|
|
- if("20".equals(operType)) {
|
|
|
+ if("20".equals(inOper.getOperType())) {
|
|
|
entity.setInstate("20");
|
|
|
}
|
|
|
|
|
|
//接收
|
|
|
- if("50".equals(operType)) {
|
|
|
+ if("50".equals(inOper.getOperType())) {
|
|
|
entity.setInstate("10");
|
|
|
}
|
|
|
|
|
|
//有条件接收
|
|
|
- if ("60".equals(operType)) {
|
|
|
+ if ("60".equals(inOper.getOperType())) {
|
|
|
entity.setInstate("30");
|
|
|
}
|
|
|
+
|
|
|
+ //接收
|
|
|
+ if("50".equals(inOper.getOperType())) {
|
|
|
+ entity.setIncompletetime(complateTime);
|
|
|
+ }
|
|
|
+ //有条件接收
|
|
|
+ else if ("60".equals(inOper.getOperType())) {
|
|
|
+ entity.setIncompletetime(complateTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ entity.setIntimes(inOper.getInspection().getInspectioncount());
|
|
|
}
|
|
|
|
|
|
}
|