|
@@ -11,6 +11,7 @@ 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.rwcommon.base.exception.CustomException;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -32,27 +33,19 @@ public class ZhcxLowaltitudeDebtfreeCheckServiceImpl extends ServiceImpl<ZhcxLow
|
|
|
private ZhcxProjectManageService projectManageService;
|
|
|
@Autowired
|
|
|
private ZhcxLowaltitudeDebtfreeCheckDetailService zhcxLowaltitudeDebtfreeCheckDetailService;
|
|
|
-// @Autowired
|
|
|
-// private ZhcxLowaltitudeDebtfreeCheckDetailDo zhcxLowaltitudeDebtfreeCheckDetailDo;
|
|
|
|
|
|
@Autowired
|
|
|
private ZhcxLowaltitudeDebtfreeBaseInfoDetailService zhcxLowaltitudeDebtfreeBaseInfoDetailService;
|
|
|
-// @Autowired
|
|
|
-// private ZhcxLowaltitudeDebtfreeCheckSubcontractorDo zhcxLowaltitudeDebtfreeCheckSubcontractorDo;
|
|
|
@Autowired
|
|
|
private ZhcxLowaltitudeDebtfreeCheckSubcontractorService zhcxLowaltitudeDebtfreeCheckSubcontractorService;
|
|
|
-// @Autowired
|
|
|
-// private ZhcxLowaltitudeDebtfreeBaseInfoDo zhcxLowaltitudeDebtfreeBaseInfoDo;
|
|
|
-// @Autowired
|
|
|
-// private ZhcxLowaltitudeDebtfreeBaseInfoDo ZhcxLowaltitudeDebtfreeBaseInfo;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ZhcxLowaltitudeDebtfreeBaseInfoService zhcxLowaltitudeDebtfreeBaseInfoService;
|
|
|
|
|
|
@Autowired
|
|
|
private ZhcxLowaltitudeDebtfreeCheckDao dao;
|
|
|
|
|
|
-// @Autowired
|
|
|
-// private ZhcxLowaltitudeDebtfreeBaseInfoDetailDo zhcxLowaltitudeDebtfreeBaseInfoDetailDo;
|
|
|
+
|
|
|
private static final HashMap<String, List<String>> PLATE_CLASSIFICATION_MAP = new HashMap<String, List<String>>() {{
|
|
|
put("电装板块", Arrays.asList("电装"));
|
|
|
put("涂装板块", Arrays.asList("后大梁", "前大梁", "梯形架及整机整改"));
|
|
@@ -114,6 +107,9 @@ public class ZhcxLowaltitudeDebtfreeCheckServiceImpl extends ServiceImpl<ZhcxLow
|
|
|
.eq(ZhcxLowaltitudeDebtfreeCheckDo::getMachinenoid, req.getMachineNoId())
|
|
|
.eq(ZhcxLowaltitudeDebtfreeCheckDo::getDeleted, "0");
|
|
|
List<ZhcxLowaltitudeDebtfreeCheckDo> existsList = list(queryWrapper);
|
|
|
+ //如果获取到的数据plate字段有 ("电装板块", "涂装板块", "安装板块", "装配板块") 就报错
|
|
|
+
|
|
|
+
|
|
|
//判断获取到的列表中的plate 板块 (添加 电装板块 涂装板块 安装板块 装配板块)不在其中的
|
|
|
List<String> validPlates = Arrays.asList("电装板块", "涂装板块", "安装板块", "装配板块");
|
|
|
|
|
@@ -122,6 +118,14 @@ public class ZhcxLowaltitudeDebtfreeCheckServiceImpl extends ServiceImpl<ZhcxLow
|
|
|
.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)) {
|
|
@@ -158,18 +162,8 @@ public class ZhcxLowaltitudeDebtfreeCheckServiceImpl extends ServiceImpl<ZhcxLow
|
|
|
newRecord.setAltitude(req.getAltitude());
|
|
|
String completionStatus = "0/" + baseInfoDetails.size();
|
|
|
newRecord.setCompletionstatus(completionStatus);
|
|
|
-// newRecord.setAltitude(req)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-// QueryWrapper<ZhcxLowaltitudeDebtfreeCheckDetailDo> wrapper = new QueryWrapper<>();
|
|
|
-// wrapper.eq("ZHCX_LOWALTITUDE_DEBTFREE_CHECK_DETAIL.DELETED", "0")
|
|
|
-// .exists("SELECT * FROM ZHCX_LOWALTITUDE_DEBTFREE_CHECK WHERE ZHCX_LOWALTITUDE_DEBTFREE_CHECK_DETAIL.CHECKID = ID AND DELETED = '0' AND PROJECTID = " + req.getProjectId() + " AND MACHINENO = " + req.getMachineNo());
|
|
|
-// List<ZhcxLowaltitudeDebtfreeCheckDetailDo> baseInfoDetails1 = zhcxLowaltitudeDebtfreeCheckDetailService.list(wrapper);
|
|
|
-
|
|
|
- ZhcxLowaltitudeDebtfreeCheckDo queryEntity = new ZhcxLowaltitudeDebtfreeCheckDo();
|
|
|
+ ZhcxLowaltitudeDebtfreeCheckDo queryEntity = new ZhcxLowaltitudeDebtfreeCheckDo();
|
|
|
queryEntity.setProjectid(req.getProjectId());
|
|
|
queryEntity.setMachineno(req.getMachineNo());
|
|
|
List<ZhcxLowaltitudeDebtfreeCheckDetailDo> baseInfoDetails1 = dao.getListHistory(queryEntity);
|
|
@@ -224,7 +218,6 @@ public class ZhcxLowaltitudeDebtfreeCheckServiceImpl extends ServiceImpl<ZhcxLow
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
if (baseInfo != null) {
|
|
|
// 将数据保存到 ZHCX_LOWALTITUDE_DEBTFREE_CHECK_DETAIL 表
|
|
|
for (ZhcxLowaltitudeDebtfreeBaseInfoDetailDo detail : baseInfoDetails) {
|
|
@@ -277,8 +270,11 @@ public class ZhcxLowaltitudeDebtfreeCheckServiceImpl extends ServiceImpl<ZhcxLow
|
|
|
// 如果加的 是 电装板块 明细分类塞 电装 ZHCX_LOWALTITUDE_DEBTFREE_CHECK_SUBCONTRACTOR classify*/
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
//如果加的 是 电装板块 分包商 表明细分类塞 电装
|
|
|
//如果加的 是 涂装板块 明细分类塞 后大梁 前大梁 梯形架及整机整改
|
|
|
//如果加的 是 安装板块 明细分类塞 安装
|
|
|
-//如果加的 是 装配板块 明细分类塞 起升机构 俯仰机构 小车机构 其他辅助机构 机房外 机房内 机房围棚 主小车
|
|
|
+//如果加的 是 装配板块 明细分类塞 起升机构 俯仰机构 小车机构 其他辅助机构 机房外 机房内 机房围棚 主小车
|
|
|
+
|
|
|
+//更新逻辑 更新项目下的机号的所属板块的所有
|