|
@@ -4,14 +4,18 @@ import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.rongwei.bscommon.sys.service.*;
|
|
|
+import com.rongwei.bscommon.sys.utils.ConstantUtil;
|
|
|
import com.rongwei.bsentity.domain.*;
|
|
|
import com.rongwei.bscommon.sys.dao.ZhcxLowaltitudeDebtfreeCheckDao;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.rongwei.bsentity.dto.lowaltitude.AddHoistingPlanDateRequest;
|
|
|
+import com.rongwei.bsentity.dto.lowaltitude.SaveCheckDetailDto;
|
|
|
+import com.rongwei.bsentity.dto.lowaltitude.SaveCheckRequest;
|
|
|
+import com.rongwei.rwadmincommon.system.service.SysGeneralCRUDService;
|
|
|
import com.rongwei.rwcommon.base.exception.CustomException;
|
|
|
+import com.rongwei.rwcommon.vo.generalsql.GeneralUpdateVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -43,25 +47,92 @@ public class ZhcxLowaltitudeDebtfreeCheckServiceImpl extends ServiceImpl<ZhcxLow
|
|
|
private ZhcxLowaltitudeDebtfreeBaseInfoService zhcxLowaltitudeDebtfreeBaseInfoService;
|
|
|
|
|
|
@Autowired
|
|
|
- private ZhcxLowaltitudeDebtfreeCheckDao dao;
|
|
|
-
|
|
|
-
|
|
|
- private static final HashMap<String, List<String>> PLATE_CLASSIFICATION_MAP = new HashMap<String, List<String>>() {{
|
|
|
- put("电装板块", Arrays.asList("电装"));
|
|
|
- put("涂装板块", Arrays.asList("后大梁", "前大梁", "梯形架及整机整改"));
|
|
|
- put("安装板块", Arrays.asList("安装"));
|
|
|
- put("装配板块", Arrays.asList("起升机构", "俯仰机构", "小车机构", "其他辅助机构", "机房外", "机房内", "机房围棚", "主小车"));
|
|
|
- }};
|
|
|
-
|
|
|
- // 添加明细记录
|
|
|
- private ZhcxLowaltitudeDebtfreeCheckSubcontractorDo createDetailRecord(String checkId, String classify) {
|
|
|
- return new ZhcxLowaltitudeDebtfreeCheckSubcontractorDo()
|
|
|
- .setCheckid(checkId)
|
|
|
- .setClassify(classify)
|
|
|
- .setId(UUID.randomUUID().toString());
|
|
|
+ private ZhcxLowaltitudeDebtfreeCheckMainService lowaltitudeDebtfreeCheckMainService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SysGeneralCRUDService generalCRUDService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加吊装日期
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void addHoistingPlanDate(AddHoistingPlanDateRequest req) {
|
|
|
+ final ZhcxProjectManageDo project = projectManageService.getById(req.getProjectId());
|
|
|
+
|
|
|
+ final String mainId = lowaltitudeDebtfreeCheckMainService.saveMain(req, project);
|
|
|
+
|
|
|
+ //如果获取到的数据plate字段有 ("电装板块", "涂装板块", "安装板块", "装配板块") 就报错
|
|
|
+ final List<String> savePlates = getSavePlates(mainId, req, project);
|
|
|
+
|
|
|
+ if(ObjectUtil.isEmpty(savePlates)) {
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 遍历有效板块,检查是否存在,缺失则新增
|
|
|
+ for (String plate : savePlates) {
|
|
|
+
|
|
|
+ //标准库
|
|
|
+ LambdaQueryWrapper<ZhcxLowaltitudeDebtfreeBaseInfoDo> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper1.eq(ZhcxLowaltitudeDebtfreeBaseInfoDo::getPlate, plate)
|
|
|
+ .eq(ZhcxLowaltitudeDebtfreeBaseInfoDo::getState, "有效")
|
|
|
+ .eq(ZhcxLowaltitudeDebtfreeBaseInfoDo::getDeleted, "0");
|
|
|
+ ZhcxLowaltitudeDebtfreeBaseInfoDo baseInfo = zhcxLowaltitudeDebtfreeBaseInfoService.getOne(queryWrapper1);
|
|
|
+
|
|
|
+ if(ObjectUtil.isNull(baseInfo)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ //标准库明细
|
|
|
+ LambdaQueryWrapper<ZhcxLowaltitudeDebtfreeBaseInfoDetailDo> queryWrapper2 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper2.eq(ZhcxLowaltitudeDebtfreeBaseInfoDetailDo::getPid, baseInfo.getId())
|
|
|
+ .eq(ZhcxLowaltitudeDebtfreeBaseInfoDetailDo::getStatus, "有效")
|
|
|
+ .eq(ZhcxLowaltitudeDebtfreeBaseInfoDetailDo::getDeleted, "0");
|
|
|
+ // 根据 baseInfo 的 id 查找 ZHCX_LOWALTITUDE_DEBTFREE_BASE_INFO_DETAIL 中的数据
|
|
|
+ List<ZhcxLowaltitudeDebtfreeBaseInfoDetailDo> baseInfoDetails =
|
|
|
+ zhcxLowaltitudeDebtfreeBaseInfoDetailService.list(queryWrapper2);
|
|
|
+
|
|
|
+ // 创建新的记录
|
|
|
+ ZhcxLowaltitudeDebtfreeCheckDo newRecord = new ZhcxLowaltitudeDebtfreeCheckDo();
|
|
|
+ newRecord.setMainid(mainId);
|
|
|
+
|
|
|
+ newRecord.setPlate(plate);
|
|
|
+ newRecord.setDeleted("0");
|
|
|
+ newRecord.setId(UUID.randomUUID().toString());
|
|
|
+ newRecord.setSectordebtratio("0.00%");
|
|
|
+ String completionStatus = "0/" + baseInfoDetails.size();
|
|
|
+ newRecord.setCompletionstatus(completionStatus);
|
|
|
+ newRecord.setQualitystatus("assembling");
|
|
|
+ newRecord.setElectromechanicalstatus("assembling");
|
|
|
+
|
|
|
+ // 保存新记录到 ZHCX_LOWALTITUDE_DEBTFREE_CHECK 表
|
|
|
+ save(newRecord);
|
|
|
+
|
|
|
+ Set<String> classfySet = new HashSet<>();
|
|
|
+ for(ZhcxLowaltitudeDebtfreeBaseInfoDetailDo baseDetail : baseInfoDetails) {
|
|
|
+ classfySet.add(baseDetail.getClassify());
|
|
|
+ }
|
|
|
+
|
|
|
+ //分包商
|
|
|
+ zhcxLowaltitudeDebtfreeCheckSubcontractorService.saveSubcontractor(newRecord.getId(), plate, classfySet);
|
|
|
+
|
|
|
+ // 明细
|
|
|
+ SaveCheckDetailDto saveCheckDetailDto = SaveCheckDetailDto.builder()
|
|
|
+ .baseId(baseInfo.getId())
|
|
|
+ .mainId(mainId)
|
|
|
+ .checkId(newRecord.getId())
|
|
|
+ .build();
|
|
|
+ zhcxLowaltitudeDebtfreeCheckDetailService.saveCheckDetail(saveCheckDetailDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ //重新计算机台不欠债率
|
|
|
+ lowaltitudeDebtfreeCheckMainService.updateMachineById(req.getProjectId(), req.getMachineNoId(), mainId);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- public void LiftingBatchAdd(Map<String, Object> map){
|
|
|
+
|
|
|
+ public void liftingBatchAdd(Map<String, Object> map){
|
|
|
|
|
|
//参数解析成条数据调用addHoistingPlanDate方法
|
|
|
// 获取包含多条记录的列表
|
|
@@ -81,6 +152,11 @@ public class ZhcxLowaltitudeDebtfreeCheckServiceImpl extends ServiceImpl<ZhcxLow
|
|
|
req.setHoistingPlanDate(dateTime);
|
|
|
}
|
|
|
|
|
|
+ if(ObjectUtil.isNotNull(record.get("FINALASSEMBLEDATE"))) {
|
|
|
+ final DateTime dateTime = DateUtil.parse(record.get("FINALASSEMBLEDATE").toString(), "yyyy-MM-dd HH:mm:ss");
|
|
|
+ req.setFinalassembledate(dateTime);
|
|
|
+ }
|
|
|
+
|
|
|
req.setMachineNo((String) record.get("MACHINENO"));
|
|
|
req.setAltitude((String) record.get("ALTITUDE"));
|
|
|
|
|
@@ -90,191 +166,114 @@ public class ZhcxLowaltitudeDebtfreeCheckServiceImpl extends ServiceImpl<ZhcxLow
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
- * 添加吊装日期
|
|
|
+ * 修改检查
|
|
|
*
|
|
|
* @param req
|
|
|
*/
|
|
|
@Override
|
|
|
- public void addHoistingPlanDate(AddHoistingPlanDateRequest req) {
|
|
|
- final ZhcxProjectManageDo project = projectManageService.getById(req.getProjectId());
|
|
|
- //根据 项目id和机号id获取 已有数据
|
|
|
- LambdaQueryWrapper<ZhcxLowaltitudeDebtfreeCheckDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.eq(ZhcxLowaltitudeDebtfreeCheckDo::getProjectid, req.getProjectId())
|
|
|
- .eq(ZhcxLowaltitudeDebtfreeCheckDo::getMachinenoid, req.getMachineNoId())
|
|
|
- .eq(ZhcxLowaltitudeDebtfreeCheckDo::getDeleted, "0");
|
|
|
- List<ZhcxLowaltitudeDebtfreeCheckDo> existsList = list(queryWrapper);
|
|
|
- //如果获取到的数据plate字段有 ("电装板块", "涂装板块", "安装板块", "装配板块") 就报错
|
|
|
+ public void updateCheck(SaveCheckRequest req) {
|
|
|
|
|
|
+ final ZhcxLowaltitudeDebtfreeCheckDo checkDo = getById(req.getId());
|
|
|
|
|
|
- //判断获取到的列表中的plate 板块 (添加 电装板块 涂装板块 安装板块 装配板块)不在其中的
|
|
|
- List<String> validPlates = Arrays.asList("电装板块", "涂装板块", "安装板块", "装配板块");
|
|
|
+ //改check
|
|
|
+ updateCheckObj(req, checkDo);
|
|
|
|
|
|
- // 获取 existsList 中已经存在的板块
|
|
|
- Set<String> existingPlates = existsList.stream()
|
|
|
- .map(ZhcxLowaltitudeDebtfreeCheckDo::getPlate)
|
|
|
- .collect(Collectors.toSet());
|
|
|
-
|
|
|
-
|
|
|
- boolean containsAll = existingPlates.containsAll(validPlates);//如果为真 就报错 为假就继续
|
|
|
- if (containsAll) {
|
|
|
- throw new CustomException("此机号下已有板块");
|
|
|
-
|
|
|
- }else {
|
|
|
-
|
|
|
-
|
|
|
- // 遍历有效板块,检查是否存在,缺失则新增
|
|
|
- for (String plate : validPlates) {
|
|
|
- if (!existingPlates.contains(plate)) {
|
|
|
-
|
|
|
- LambdaQueryWrapper<ZhcxLowaltitudeDebtfreeBaseInfoDo> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
- queryWrapper1.eq(ZhcxLowaltitudeDebtfreeBaseInfoDo::getPlate, plate)
|
|
|
- .eq(ZhcxLowaltitudeDebtfreeBaseInfoDo::getState, "有效")
|
|
|
- .eq(ZhcxLowaltitudeDebtfreeBaseInfoDo::getDeleted, "0");
|
|
|
- ZhcxLowaltitudeDebtfreeBaseInfoDo baseInfo = zhcxLowaltitudeDebtfreeBaseInfoService.getOne(queryWrapper1);
|
|
|
- LambdaQueryWrapper<ZhcxLowaltitudeDebtfreeBaseInfoDetailDo> queryWrapper2 = Wrappers.lambdaQuery();
|
|
|
- queryWrapper2.eq(ZhcxLowaltitudeDebtfreeBaseInfoDetailDo::getPid, baseInfo.getId())
|
|
|
- .eq(ZhcxLowaltitudeDebtfreeBaseInfoDetailDo::getStatus, "有效")
|
|
|
- .eq(ZhcxLowaltitudeDebtfreeBaseInfoDetailDo::getDeleted, "0");
|
|
|
- // 根据 baseInfo 的 id 查找 ZHCX_LOWALTITUDE_DEBTFREE_BASE_INFO_DETAIL 中的数据
|
|
|
- List<ZhcxLowaltitudeDebtfreeBaseInfoDetailDo> baseInfoDetails =
|
|
|
- zhcxLowaltitudeDebtfreeBaseInfoDetailService.list(queryWrapper2);
|
|
|
-
|
|
|
-
|
|
|
- // 创建新的记录
|
|
|
- ZhcxLowaltitudeDebtfreeCheckDo newRecord = new ZhcxLowaltitudeDebtfreeCheckDo();
|
|
|
- newRecord.setProjectid(req.getProjectId());
|
|
|
- newRecord.setProjectcode(project.getProjectCode());
|
|
|
- newRecord.setProjectname(project.getProjectName());
|
|
|
- newRecord.setProjectename(project.getProjectEname());
|
|
|
- newRecord.setMachinenoid(req.getMachineNoId());
|
|
|
- newRecord.setMachineno(req.getMachineNo());
|
|
|
- newRecord.setHoistingplandate(req.getHoistingPlanDate());
|
|
|
-
|
|
|
- newRecord.setPlate(plate);
|
|
|
- newRecord.setDeleted("0");
|
|
|
- newRecord.setFinalassembledate(req.getHoistingPlanDate());
|
|
|
- newRecord.setId(UUID.randomUUID().toString());
|
|
|
- newRecord.setSectordebtratio("0.00%");
|
|
|
- newRecord.setAltitude(req.getAltitude());
|
|
|
- String completionStatus = "0/" + baseInfoDetails.size();
|
|
|
- newRecord.setCompletionstatus(completionStatus);
|
|
|
-
|
|
|
- ZhcxLowaltitudeDebtfreeCheckDo queryEntity = new ZhcxLowaltitudeDebtfreeCheckDo();
|
|
|
- queryEntity.setProjectid(req.getProjectId());
|
|
|
- queryEntity.setMachineno(req.getMachineNo());
|
|
|
- List<ZhcxLowaltitudeDebtfreeCheckDetailDo> baseInfoDetails1 = dao.getListHistory(queryEntity);
|
|
|
-
|
|
|
- int completeCount = 0;
|
|
|
-
|
|
|
- for (ZhcxLowaltitudeDebtfreeCheckDetailDo row : baseInfoDetails1) {
|
|
|
- if ("✓".equals(row.getCheckresult()) || ("✕".equals(row.getCheckresult()) && "✓".equals(row.getRectifyesult()))) {
|
|
|
- completeCount++;
|
|
|
- }
|
|
|
+ //分包商
|
|
|
+ //明细
|
|
|
+ try {
|
|
|
+ if(ObjectUtil.isNotEmpty(req.getSubcontractorList())) {
|
|
|
+ for (GeneralUpdateVo generalUpdateVo : req.getSubcontractorList()) {
|
|
|
+ generalCRUDService.generalUpdate(generalUpdateVo);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- // 过滤不需要的记录
|
|
|
- List<ZhcxLowaltitudeDebtfreeCheckDetailDo> resData = new ArrayList<>();
|
|
|
- for (ZhcxLowaltitudeDebtfreeCheckDetailDo ev : resData) {
|
|
|
- if (!"/".equals(ev.getCheckresult()) && !"/".equals(ev.getRectifyesult())) {
|
|
|
- resData.add(ev);
|
|
|
- }
|
|
|
+ if(ObjectUtil.isNotEmpty(req.getDetailList())) {
|
|
|
+ for (GeneralUpdateVo generalUpdateVo : req.getDetailList()) {
|
|
|
+ generalCRUDService.generalUpdate(generalUpdateVo);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("保存失败: {}", e);
|
|
|
+ throw new CustomException("保存失败");
|
|
|
+ }
|
|
|
|
|
|
- // 计算机器比率
|
|
|
- String machineRatio;
|
|
|
- int totalCount = resData.size();
|
|
|
- if (totalCount == 0) {
|
|
|
- machineRatio = "0.00%"; // 避免除以零
|
|
|
- } else {
|
|
|
- double ratio = (double) completeCount / totalCount * 100;
|
|
|
- machineRatio = String.format("%.2f%%", ratio);
|
|
|
- }
|
|
|
+ //保存主数据
|
|
|
+ lowaltitudeDebtfreeCheckMainService.saveMain(req, checkDo.getMainid());
|
|
|
+ }
|
|
|
|
|
|
- newRecord.setMachinedebtratio(machineRatio);
|
|
|
- // 保存新记录到 ZHCX_LOWALTITUDE_DEBTFREE_CHECK 表
|
|
|
- save(newRecord);
|
|
|
-
|
|
|
- // 根据板块类型新增明细数据到 ZHCX_LOWALTITUDE_DEBTFREE_CHECK_SUBCONTRACTOR 表
|
|
|
- List<ZhcxLowaltitudeDebtfreeCheckSubcontractorDo> detailRecords = new ArrayList<>();
|
|
|
- List<String> classifications = PLATE_CLASSIFICATION_MAP.get(plate);
|
|
|
-
|
|
|
- if (classifications != null) {
|
|
|
- for (String classify : classifications) {
|
|
|
-// detailRecords.add(createDetailRecord(newRecord.getId(), classify));
|
|
|
- ZhcxLowaltitudeDebtfreeCheckSubcontractorDo record = createDetailRecord(newRecord.getId(), classify);
|
|
|
- record.setDeleted("0"); // 手动设置 deleted 字段
|
|
|
- detailRecords.add(record);
|
|
|
- }
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 更新检查表
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private void updateCheckObj(SaveCheckRequest req, ZhcxLowaltitudeDebtfreeCheckDo checkDo) {
|
|
|
+ ZhcxLowaltitudeDebtfreeCheckDo entity = new ZhcxLowaltitudeDebtfreeCheckDo();
|
|
|
+ entity.setId(req.getId());
|
|
|
+ entity.setCheckdate(req.getCheckdate());
|
|
|
+ entity.setSectordebtratio(req.getSectordebtratio());
|
|
|
+ entity.setCompletionstatus(req.getCompletionstatus());
|
|
|
+ //只有保存才会进入下一步
|
|
|
+ if("default".equals(req.getSaveBehavior())) {
|
|
|
+ entity.setQualitystatus(getStepStatus(checkDo));
|
|
|
+ }
|
|
|
+ updateById(entity);
|
|
|
+ }
|
|
|
|
|
|
- // 批量保存明细记录
|
|
|
- for (ZhcxLowaltitudeDebtfreeCheckSubcontractorDo detailRecord : detailRecords) {
|
|
|
- zhcxLowaltitudeDebtfreeCheckSubcontractorService.save(detailRecord);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 获取状态
|
|
|
+ *
|
|
|
+ * @param checkDo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String getStepStatus(ZhcxLowaltitudeDebtfreeCheckDo checkDo) {
|
|
|
+ if(ObjectUtil.isEmpty(checkDo.getQualitystatus())) {
|
|
|
+ checkDo.setQualitystatus("assembling");
|
|
|
+ }
|
|
|
|
|
|
+ if("done".equals(checkDo.getQualitystatus())) {
|
|
|
+ return checkDo.getQualitystatus();
|
|
|
+ }
|
|
|
|
|
|
- if (baseInfo != null) {
|
|
|
- // 将数据保存到 ZHCX_LOWALTITUDE_DEBTFREE_CHECK_DETAIL 表
|
|
|
- for (ZhcxLowaltitudeDebtfreeBaseInfoDetailDo detail : baseInfoDetails) {
|
|
|
- ZhcxLowaltitudeDebtfreeCheckDetailDo newDetail = new ZhcxLowaltitudeDebtfreeCheckDetailDo();
|
|
|
- newDetail.setCheckid(newRecord.getId()); // 关联 ZHCX_LOWALTITUDE_DEBTFREE_CHECK 表的 id
|
|
|
- newDetail.setClassify(detail.getClassify());
|
|
|
- newDetail.setPart(detail.getPart());
|
|
|
- newDetail.setContent(detail.getContent());
|
|
|
- newDetail.setResume(detail.getResume());
|
|
|
- newDetail.setStandart(detail.getStandart());
|
|
|
- newDetail.setSquno(detail.getSquno());
|
|
|
- newDetail.setId(UUID.randomUUID().toString());
|
|
|
- newDetail.setDeleted("0"); // 默认未删除
|
|
|
- zhcxLowaltitudeDebtfreeCheckDetailService.save(newDetail); // 保存到 ZHCX_LOWALTITUDE_DEBTFREE_CHECK_DETAIL 表
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
+ final int index = ConstantUtil.LOWER_STEP_STATUS.indexOf(checkDo.getQualitystatus());
|
|
|
+
|
|
|
+ return ConstantUtil.LOWER_STEP_STATUS.get(index + 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取需要生成低空不欠债板块
|
|
|
+ *
|
|
|
+ * @param mainId
|
|
|
+ * @param req
|
|
|
+ * @param project
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<String> getSavePlates(String mainId, AddHoistingPlanDateRequest req, ZhcxProjectManageDo project) {
|
|
|
+ //判断获取到的列表中的plate 板块 (添加 电装板块 涂装板块 安装板块 装配板块)不在其中的
|
|
|
+ List<String> validPlates = Arrays.asList("电装板块", "涂装板块", "安装板块", "装配板块");
|
|
|
|
|
|
+ LambdaQueryWrapper<ZhcxLowaltitudeDebtfreeCheckDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(ZhcxLowaltitudeDebtfreeCheckDo::getMainid, mainId)
|
|
|
+ .eq(ZhcxLowaltitudeDebtfreeCheckDo::getDeleted, "0");
|
|
|
+ List<ZhcxLowaltitudeDebtfreeCheckDo> existsList = list(queryWrapper);
|
|
|
+ // 获取 existsList 中已经存在的板块
|
|
|
+ Set<String> existingPlates = existsList.stream()
|
|
|
+ .map(ZhcxLowaltitudeDebtfreeCheckDo::getPlate)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
|
|
|
- } /*else {
|
|
|
- // 更新总装日期
|
|
|
- updateFinalAssembleDate(plate, req.getHoistingPlanDate());
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-/*
|
|
|
-// 遍历有效板块,检查是否存在,缺失则新增
|
|
|
- for (String plate : validPlates) {
|
|
|
- if (!existingPlates.contains(plate)) {
|
|
|
- //根据plate 查出ZHCX_LOWALTITUDE_DEBTFREE_BASE_INFO中的数据 根据这条数据的id 查出ZHCX_LOWALTITUDE_DEBTFREE_BASE_INFO_DETAIL的数据 把数据塞到 ZHCX_LOWALTITUDE_DEBTFREE_CHECK_DETAIL表给生成uuid
|
|
|
- // 创建新的记录
|
|
|
- ZhcxLowaltitudeDebtfreeCheckDo newRecord = new ZhcxLowaltitudeDebtfreeCheckDo();
|
|
|
- newRecord.setProjectid(req.getProjectId());
|
|
|
- newRecord.setMachinenoid(req.getMachineNoId());
|
|
|
- newRecord.setPlate(plate); // 设置为当前缺失的板块
|
|
|
- newRecord.setDeleted("0"); // 设置为未删除
|
|
|
- newRecord.setFinalassembledate(req.getHoistingPlanDate());
|
|
|
-// newRecord.setStandardlibid();//标准库id 通过 plate 获取 根据标准库id获取
|
|
|
- //获取检查内容
|
|
|
-
|
|
|
- newRecord.setProjectcode();
|
|
|
- // 保存新记录
|
|
|
- save(newRecord);
|
|
|
- }else {
|
|
|
- //更新总装日期
|
|
|
+ List<String> result = new ArrayList<>();
|
|
|
+ for(String plate : validPlates) {
|
|
|
+ if(!existingPlates.contains(plate)) {
|
|
|
+ result.add(plate);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 如果加的 是 电装板块 明细分类塞 电装 ZHCX_LOWALTITUDE_DEBTFREE_CHECK_SUBCONTRACTOR classify*/
|
|
|
+ if(ObjectUtil.isEmpty(result)) {
|
|
|
+ throw new CustomException(project.getProjectEname().concat("下").concat(req.getMachineNo()).concat("全部板块已生成低空不欠债"));
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|
|
|
-//如果加的 是 电装板块 分包商 表明细分类塞 电装
|
|
|
-//如果加的 是 涂装板块 明细分类塞 后大梁 前大梁 梯形架及整机整改
|
|
|
-//如果加的 是 安装板块 明细分类塞 安装
|
|
|
-//如果加的 是 装配板块 明细分类塞 起升机构 俯仰机构 小车机构 其他辅助机构 机房外 机房内 机房围棚 主小车
|
|
|
-
|
|
|
-//更新逻辑 更新项目下的机号的所属板块的所有
|