|
@@ -33,6 +33,7 @@ import com.rongwei.rwadmincommon.system.service.PagePartService;
|
|
|
import com.rongwei.rwadmincommon.system.service.SysGeneralCRUDService;
|
|
|
import com.rongwei.rwadmincommon.system.service.SysUserService;
|
|
|
import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
|
+import com.rongwei.rwcommon.base.R;
|
|
|
import com.rongwei.rwcommon.base.exception.CustomException;
|
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
|
import com.rongwei.rwcommon.utils.StringUtils;
|
|
@@ -200,7 +201,10 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
inspection.setCheckercontact(StringUtils.toString(updateColsMap.get("CHECKERCONTACT"), ""));
|
|
|
}
|
|
|
//生成空派单信息
|
|
|
- dispatchService.genDispatch(inspection);
|
|
|
+ final ZhcxInsideInspectionDispatchDo dispatch = dispatchService.genDispatch(inspection);
|
|
|
+
|
|
|
+ //拆单
|
|
|
+ splitOrderByPoint(inspection, dispatch);
|
|
|
}
|
|
|
//重新报验
|
|
|
else if("reInspection".equals(req.getOperType())) {
|
|
@@ -361,7 +365,10 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
//生成报验单号
|
|
|
updateInspection(inspectionDo, req);
|
|
|
//生成空派单信息
|
|
|
- dispatchService.genDispatch(inspectionDo);
|
|
|
+ final ZhcxInsideInspectionDispatchDo dispatch = dispatchService.genDispatch(inspectionDo);
|
|
|
+
|
|
|
+ //拆单
|
|
|
+ splitOrderByPoint(inspectionDo, dispatch);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -446,9 +453,6 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
ZhcxInsideInspectionDo inside = new ZhcxInsideInspectionDo();
|
|
|
inside.setId(insideId);
|
|
|
inside.setInspectionstatus("40");
|
|
|
- //取消的时候清空
|
|
|
- inside.setCheckername("");
|
|
|
-
|
|
|
inspectionList.add(inside);
|
|
|
|
|
|
NotifyDto notify = getMailInfo4Cancel(inOper, req);
|
|
@@ -1131,6 +1135,124 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
doDeletedPoint(project.getId());
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R getSeqReportResult(String projectCode, String inspectionPoint) {
|
|
|
+ //根据INSPECTIONCOMPLATETIM 取最新的一条数据
|
|
|
+ LambdaQueryWrapper<ZhcxInsideInspectionDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(ZhcxInsideInspectionDo::getProjectcode, projectCode)
|
|
|
+ .eq(ZhcxInsideInspectionDo::getInspectioncontent, inspectionPoint)
|
|
|
+ .eq(ZhcxInsideInspectionDo::getInspectionstatus, "30")
|
|
|
+ .orderByDesc(ZhcxInsideInspectionDo::getInspectioncomplatetime)
|
|
|
+ .last("limit 1");
|
|
|
+
|
|
|
+ ZhcxInsideInspectionDo inside = this.getOne(queryWrapper);
|
|
|
+
|
|
|
+ //如果不是空去获取报验结论
|
|
|
+ if (ObjectUtil.isNotEmpty(inside)){
|
|
|
+ //根据inside ID 获取报验结论
|
|
|
+ LambdaQueryWrapper<ZhcxInsideInspectionDispatchDo> disQueryWrapper = Wrappers.lambdaQuery();
|
|
|
+ disQueryWrapper.eq(ZhcxInsideInspectionDispatchDo::getInsideid, inside.getId());
|
|
|
+ ZhcxInsideInspectionDispatchDo dispatchDo = dispatchService.getOne(disQueryWrapper);
|
|
|
+
|
|
|
+ if (ObjectUtil.isNotEmpty(dispatchDo)) {
|
|
|
+ Map<String, Object> data = new HashMap<>();
|
|
|
+ data.put("projectcode", inside.getProjectcode());
|
|
|
+ data.put("inspectionpoint", inside.getInspectioncontent());
|
|
|
+ data.put("inspectioncode", inside.getInspectioncode());
|
|
|
+ data.put("result", dispatchDo.getInspectionconclusion());
|
|
|
+ return R.ok(data);
|
|
|
+ }else {
|
|
|
+ //如果没有查到完工报验结果 返回-2
|
|
|
+ return R.ok("-2","未查到完工报验结果");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //如果没有查到inside 返回 -1
|
|
|
+ return R.ok("-1","未查到报验内容");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过报验点拆单
|
|
|
+ *
|
|
|
+ * @param inside
|
|
|
+ * @param dispatch
|
|
|
+ */
|
|
|
+ private void splitOrderByPoint(ZhcxInsideInspectionDo inside, ZhcxInsideInspectionDispatchDo dispatch) {
|
|
|
+ if(inside.getSplitflag() == 2) { //不拆单
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ final String[] inspectionContents = inside.getInspectioncontent().split(","); // 报验点
|
|
|
+ if(inspectionContents.length <= 1) { //只选择了一个报验点不需要拆单
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ final String[] inspectionContentIds = inside.getInspectioncontentid().split(","); // 报验点
|
|
|
+
|
|
|
+ //第一个单据
|
|
|
+ ZhcxInsideInspectionDo source = new ZhcxInsideInspectionDo();
|
|
|
+ source.setInspectioncontent(inspectionContents[0]);
|
|
|
+ source.setInspectioncontentid(inspectionContentIds[0]);
|
|
|
+ String inspectionPoint = inspectionContents[0].replace(inside.getStructurename().concat("-"), "");
|
|
|
+ source.setInspectionpoint(inspectionPoint);
|
|
|
+
|
|
|
+ source.setId(inside.getId());
|
|
|
+ updateById(source);
|
|
|
+
|
|
|
+ //其他单据 复制第一个单据
|
|
|
+ List<ZhcxInsideInspectionDo> insertInsideList = new ArrayList<>(inspectionContents.length - 1);
|
|
|
+ List<ZhcxInsideInspectionDispatchDo> insertDispatchList = new ArrayList<>(inspectionContents.length - 1);
|
|
|
+ for(int m = 1, n = inspectionContents.length; m < n; m++) {
|
|
|
+
|
|
|
+ inspectionPoint = inspectionContents[m].replace(inside.getStructurename().concat("-"), "");
|
|
|
+ //报验单
|
|
|
+ ZhcxInsideInspectionDo insideEntity = new ZhcxInsideInspectionDo();
|
|
|
+ BeanUtil.copyProperties(inside, insideEntity);
|
|
|
+ insideEntity.setId(SecurityUtil.getUUID());
|
|
|
+ insideEntity.setInspectioncode(genCode());
|
|
|
+ insideEntity.setInspectioncontent(inspectionContents[m]);
|
|
|
+ insideEntity.setInspectioncontentid(inspectionContentIds[m]);
|
|
|
+ insideEntity.setInspectionpoint(inspectionPoint);
|
|
|
+ insertInsideList.add(insideEntity);
|
|
|
+
|
|
|
+ //派单明细
|
|
|
+ ZhcxInsideInspectionDispatchDo dispatchEntity = new ZhcxInsideInspectionDispatchDo();
|
|
|
+ BeanUtil.copyProperties(dispatch, dispatchEntity);
|
|
|
+ dispatchEntity.setId(SecurityUtil.getUUID());
|
|
|
+ dispatchEntity.setInsideid(insideEntity.getId());
|
|
|
+ insertDispatchList.add(dispatchEntity);
|
|
|
+
|
|
|
+ // 核心检验
|
|
|
+ final LambdaUpdateWrapper<ZhcxInsideInspectionCoreIndicatorsDo> updateCoreWrapper = Wrappers.lambdaUpdate();
|
|
|
+ updateCoreWrapper.eq(ZhcxInsideInspectionCoreIndicatorsDo::getInsideid, inside.getId())
|
|
|
+ .eq(ZhcxInsideInspectionCoreIndicatorsDo::getInspectionid, inspectionContentIds[m])
|
|
|
+ .set(ZhcxInsideInspectionCoreIndicatorsDo::getInsideid, insideEntity.getId());
|
|
|
+ insideInspectionCoreIndicatorsService.update(updateCoreWrapper);
|
|
|
+// insideInspectionCoreIndicatorsService.updateInsideIdByInsideId(insideEntity.getId(), inspectionContentIds[m], inside.getId());
|
|
|
+ //细节完善项目
|
|
|
+ final LambdaUpdateWrapper<ZhcxInsideInspectionDetailImprovementItemDo> updateDetailWrapper = Wrappers.lambdaUpdate();
|
|
|
+ updateDetailWrapper.eq(ZhcxInsideInspectionDetailImprovementItemDo::getInsideid, inside.getId())
|
|
|
+ .eq(ZhcxInsideInspectionDetailImprovementItemDo::getInspectionid, inspectionContentIds[m])
|
|
|
+ .set(ZhcxInsideInspectionDetailImprovementItemDo::getInsideid, insideEntity.getId());
|
|
|
+ insideInspectionDetailImprovementItemService.update(updateDetailWrapper);
|
|
|
+// insideInspectionDetailImprovementItemService.updateInsideIdByInsideId(insideEntity.getId(), inspectionContentIds[m], inspectionPoint, inside.getId());
|
|
|
+ //标书要点
|
|
|
+ final LambdaUpdateWrapper<ZhcxInsideInspectionBiddingDocPointDo> updateBiddingWrapper = Wrappers.lambdaUpdate();
|
|
|
+ updateBiddingWrapper.eq(ZhcxInsideInspectionBiddingDocPointDo::getInsideid, inside.getId())
|
|
|
+ .eq(ZhcxInsideInspectionBiddingDocPointDo::getInspectionid, inspectionContentIds[m])
|
|
|
+ .set(ZhcxInsideInspectionBiddingDocPointDo::getInsideid, insideEntity.getId());
|
|
|
+ insideInspectionBiddingDocPointService.update(updateBiddingWrapper);
|
|
|
+// insideInspectionBiddingDocPointService.updateInsideIdByInsideId(insideEntity.getId(), inspectionContentIds[m], inside.getId());
|
|
|
+
|
|
|
+ //操作日志
|
|
|
+ operLogService.copyByInsideId(inside.getId(), Arrays.asList(new String[] {insideEntity.getId()}));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ saveBatch(insertInsideList);
|
|
|
+ dispatchService.saveBatch(insertDispatchList);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 报验单list转map
|
|
|
*
|
|
@@ -2285,6 +2407,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
ZhcxInsideInspectionDo entity = new ZhcxInsideInspectionDo();
|
|
|
entity.setId(inspectionDo.getId());
|
|
|
entity.setInspectioncode(genCode());
|
|
|
+ entity.setInspectionpoint(inspectionDo.getInspectioncontent().replace(inspectionDo.getStructurename().concat("-"), ""));
|
|
|
updateById(entity);
|
|
|
|
|
|
//生成操作记录
|
|
@@ -2357,26 +2480,25 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
return ;
|
|
|
}
|
|
|
|
|
|
- ZhcxInsideInspectionDo inside = inOper.getInspection();
|
|
|
+ ZhcxInsideInspectionDo itpDo = inOper.getInspection();
|
|
|
String machineNo = inOper.getInspection().getMachineno();
|
|
|
if (StringUtils.isBlank(machineNo)) {
|
|
|
machineNo = inOper.getInspection().getStructuremachineno();
|
|
|
}
|
|
|
if (StringUtils.isBlank(machineNo)) {
|
|
|
- log.error("{}-{}:总装机号和结构机号都没有", inside.getId(), inside.getInspectioncode());
|
|
|
+ log.error("{}-{}:总装机号和结构机号都没有", itpDo.getId(), itpDo.getInspectioncode());
|
|
|
return;
|
|
|
}
|
|
|
- String[] machinenos = machineNo.split(","); //机号
|
|
|
- final String[] nodeIds = inside.getInspectioncontentid().split(","); //报验点id
|
|
|
+ String[] machinenos = machineNo.split(",");
|
|
|
+ for (String mn : machinenos) {
|
|
|
|
|
|
- for(String nodeId : nodeIds) { // 报验点
|
|
|
- for (String mn : machinenos) { // 机号
|
|
|
+ final String[] inspectionIds = itpDo.getInspectioncontentid().split(",");
|
|
|
|
|
|
- //查询报验点状态表中
|
|
|
+ for(String inspectionId : inspectionIds) {
|
|
|
LambdaQueryWrapper<ZhcxItpProjectNodeStateDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.eq(ZhcxItpProjectNodeStateDo::getPrjid, inside.getProjectid())
|
|
|
+ queryWrapper.eq(ZhcxItpProjectNodeStateDo::getPrjid, itpDo.getProjectid())
|
|
|
.eq(ZhcxItpProjectNodeStateDo::getMathinecode, mn)
|
|
|
- .eq(ZhcxItpProjectNodeStateDo::getNodeid, nodeId);
|
|
|
+ .eq(ZhcxItpProjectNodeStateDo::getNodeid, inspectionId);
|
|
|
List<ZhcxItpProjectNodeStateDo> stateList = itpProjectNodeStateService.list(queryWrapper);
|
|
|
ZhcxItpProjectNodeStateDo stateDo = BusinessFunUtils.getPrjNodeState(stateList);
|
|
|
|
|
@@ -2384,8 +2506,8 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
stateDo = new ZhcxItpProjectNodeStateDo();
|
|
|
stateDo.setId(SecurityUtil.getUUID());
|
|
|
stateDo.setMathinecode(mn);
|
|
|
- stateDo.setPrjid(inside.getProjectid());
|
|
|
- stateDo.setNodeid(nodeId);
|
|
|
+ stateDo.setPrjid(itpDo.getProjectid());
|
|
|
+ stateDo.setNodeid(inspectionId);
|
|
|
stateDo.setDeleted("0");
|
|
|
|
|
|
stateDo.setCreatedate(inOper.getOperTime());
|
|
@@ -2406,10 +2528,10 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
ZhcxItpProjectNodeStateInsideDo stateInside = new ZhcxItpProjectNodeStateInsideDo();
|
|
|
stateInside.setId(SecurityUtil.getUUID());
|
|
|
stateInside.setDeleted("0");
|
|
|
- stateInside.setInsideid(inside.getId());
|
|
|
+ stateInside.setInsideid(itpDo.getId());
|
|
|
stateInside.setStateid(stateDo.getId());
|
|
|
- stateInside.setInspectioncode(inside.getInspectioncode());
|
|
|
- stateInside.setLaunchtype(inside.getLaunchtype());
|
|
|
+ stateInside.setInspectioncode(itpDo.getInspectioncode());
|
|
|
+ stateInside.setLaunchtype(itpDo.getLaunchtype());
|
|
|
stateInside.setStateid(stateDo.getId());
|
|
|
nodeStateBo.getInsideStateList().add(stateInside);
|
|
|
}
|