Commit 2396cca9 authored by 李成龙's avatar 李成龙

修改:放开管道编号唯一性校验,管道编号可以重复

parent 24f901ff
......@@ -60,9 +60,10 @@ public class SingleProjectEquipChangeProcess implements IEquipChangeDataProcessS
List<FieldChangeMeta> allChangeColumns = new ArrayList<>();
List<PipelineChangeItemDto> items = insertOrEditPieLines.toJavaList(PipelineChangeItemDto.class);
// 1.设备技术参数入库前校验,约束:同一个装置下的管道编号不能重复
if (items.size() != items.stream().map(TechParamsPipelineChangeFieldDto::getPipelineNumber).distinct().count()) {
throw new BadRequest("同一工程装置下管道编号不能重复!");
}
// 同一工程装置下管道编号不能重复校验
// if (items.size() != items.stream().map(TechParamsPipelineChangeFieldDto::getPipelineNumber).distinct().count()) {
// throw new BadRequest("同一工程装置下管道编号不能重复!");
// }
List<PipelineChangeItemDto> newPipelines = new ArrayList<>();
List<PipelineChangeItemDto> updatePipelines = new ArrayList<>();
List<PipelineChangeItemDto> deletePipelines = new ArrayList<>();
......
......@@ -1524,11 +1524,12 @@ public class EquipClaimServiceImpl {
CompanyBo company = getSelectedOrgInfo().getCompany();
// 管道校验
//同一工程装置下管道编号不能重复校验
List<Map<String, Object>> pipelineList = (List<Map<String, Object>>) equipInfo.get(PIPELINE_LIST);
if (CollectionUtils.isEmpty(pipelineList) || pipelineList.size() != pipelineList.stream()
.map(v -> (String) v.get("pipelineNumber")).distinct().count()) {
throw new BadRequest(CollectionUtils.isEmpty(pipelineList) ? "请填写管道信息!" : "同一工程装置下管道编号不能重复!");
}
// if (CollectionUtils.isEmpty(pipelineList) || pipelineList.size() != pipelineList.stream()
// .map(v -> (String) v.get("pipelineNumber")).distinct().count()) {
// throw new BadRequest(CollectionUtils.isEmpty(pipelineList) ? "请填写管道信息!" : "同一工程装置下管道编号不能重复!");
// }
// 需要融合的判断融合后的管道编号是否重复
String proConNo = equipInfo.getString(PROJECT_CONTRAPTION_NO);
IdxBizJgProjectContraption oldProCon = idxBizJgProjectContraptionService.getBaseMapper().selectOne(new LambdaQueryWrapper<IdxBizJgProjectContraption>()
......
......@@ -535,11 +535,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 单位类型
Map<String, Object> companyInfoMap = jgInstallationNoticeService.getCompanyType();
String companyTypeStr = companyInfoMap.get("companyType").toString();
if (CollectionUtils.isEmpty(pipelineList) || pipelineList.size() != pipelineList.stream()
.map(v -> (String) v.get("pipelineNumber")).distinct().count()) {
throw new BadRequest(CollectionUtils.isEmpty(pipelineList) ? "请填写管道信息!" : "同一工程装置下管道编号不能重复!");
}
//去掉同一装置管道编号唯一性校验
// if (CollectionUtils.isEmpty(pipelineList) || pipelineList.size() != pipelineList.stream()
// .map(v -> (String) v.get("pipelineNumber")).distinct().count()) {
// throw new BadRequest(CollectionUtils.isEmpty(pipelineList) ? "请填写管道信息!" : "同一工程装置下管道编号不能重复!");
// }
// 工程装置信息
IdxBizJgProjectContraption projectContraption = JSON.parseObject(toJSONString(equipmentInfoForm), IdxBizJgProjectContraption.class);
......
......@@ -251,7 +251,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
String equSeq = !EquipmentClassifityEnum.YLGD.getCode().equals(notice.getEquListCode()) ? SEQUENCE_NBR : RECORD;
List<Map<String, Object>> deviceList = noticeDto.getDeviceList();
// 管道校验管道编号不重复
this.verifyThatThePipeNumberIsUnique(notice.getEquListCode(), deviceList);
//去掉同一工程装置下管道编号不能重复校验
//this.verifyThatThePipeNumberIsUnique(notice.getEquListCode(), deviceList);
List<String> records = Optional.ofNullable(deviceList)
.orElse(Collections.emptyList())
.stream()
......@@ -504,7 +505,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
String equSeq = !EquipmentClassifityEnum.YLGD.getCode().equals(equListCode) ? SEQUENCE_NBR : RECORD;
// 管道校验管道编号不重复
this.verifyThatThePipeNumberIsUnique(equListCode, deviceList);
//去掉同一工程装置下管道编号不能重复校验
//this.verifyThatThePipeNumberIsUnique(equListCode, deviceList);
// 提交时对设备状态进行校验(处理并发问题,一个未被使用的设备同时被多个使用这打开,同时提交发起申请) todo 回滚异常未写
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
if (CollectionUtils.isEmpty(deviceList)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment