Commit 6de5b9ce authored by 韩桐桐's avatar 韩桐桐

fix(jg):历史有使用登记证的场车设备可以添加车牌号

parent ab6b10e0
...@@ -94,6 +94,7 @@ import java.util.*; ...@@ -94,6 +94,7 @@ import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import static com.alibaba.fastjson.JSON.toJSONString; import static com.alibaba.fastjson.JSON.toJSONString;
import static com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum.SPECIAL_CYLINDER; import static com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum.SPECIAL_CYLINDER;
import static com.yeejoin.amos.boot.module.jg.api.enums.VehicleApanageEnum.XIAN_YANG; import static com.yeejoin.amos.boot.module.jg.api.enums.VehicleApanageEnum.XIAN_YANG;
...@@ -176,6 +177,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -176,6 +177,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private static final String IS_COPY = "isCopy"; private static final String IS_COPY = "isCopy";
private static final String ATTACHMENT_UPLOAD = "attachmentUpload"; private static final String ATTACHMENT_UPLOAD = "attachmentUpload";
private static final Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>(); private static final Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
public static final String CAR_NUMBER = "CAR_NUMBER";
// 需要转化成jsonObject的附件字段 // 需要转化成jsonObject的附件字段
public static String[] jsonFields = {"insOtherAccessories", "installContractAttachment", "installProxyStatementAttachment"}; public static String[] jsonFields = {"insOtherAccessories", "installContractAttachment", "installProxyStatementAttachment"};
private final List<String> resultError = new ArrayList<>(); private final List<String> resultError = new ArrayList<>();
...@@ -777,8 +779,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -777,8 +779,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
checkFactoryNumUniqueWithGasCylinder(equipmentInfoForm, record); checkFactoryNumUniqueWithGasCylinder(equipmentInfoForm, record);
// 历史(车用气瓶)设备校验使用登记证编号 VIN 全库唯一 // 历史(车用气瓶)设备校验使用登记证编号 VIN 全库唯一
hisEquCheckUseRegCodeAndVINUniqueness(equipmentInfoForm, record); hisEquCheckUseRegCodeAndVINUniqueness(equipmentInfoForm, record);
// 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来 // 历史有使用登记证的场车设备校验车牌号的唯一性
// checkIsSanHanData(equipmentInfoForm); checkCarNumberUniquenessWithHisCC(equipmentInfoForm, record, dataSource);
} catch (Exception e) { } catch (Exception e) {
handleError(e, null); handleError(e, null);
} }
...@@ -833,35 +835,19 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -833,35 +835,19 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
/** /**
* 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来 * 历史有使用登记证的场车设备校验车牌号的唯一性
* * @param equipmentInfoForm
* @param equipmentInfoForm 入参 * @param record
* @param dataSource
*/ */
private void checkIsSanHanData(LinkedHashMap<?, ?> equipmentInfoForm) { private void checkCarNumberUniquenessWithHisCC(LinkedHashMap<?, ?> equipmentInfoForm, String record, String dataSource) {
// 是否车用气瓶 if (dataSource.contains("his") && EquipmentClassifityEnum.CC.getCode().equals(equipmentInfoForm.get(EQU_LIST)) && !ValidationUtil.isEmpty(equipmentInfoForm.get(CAR_NUMBER))) {
if ("2000".equals(equipmentInfoForm.get(EQU_LIST)) && "2300".equals(equipmentInfoForm.get(EQU_CATEGORY)) Integer count = idxBizJgRegisterInfoService.lambdaQuery()
&& "23T0".equals(equipmentInfoForm.get(EQU_DEFINE)) .eq(IdxBizJgRegisterInfo::getCarNumber, equipmentInfoForm.get(CAR_NUMBER))
&& "1".equals(equipmentInfoForm.get(WHETHER_VEHICLE_CYLINDER))) { .ne(!StringUtils.isEmpty(record), IdxBizJgRegisterInfo::getRecord, record)
String carNum = (String) equipmentInfoForm.get("USE_INNER_CODE"); .count();
String equCode = (String) equipmentInfoForm.get("EQU_CODE"); if (count > 0) {
// 判断 设备代码EQU_CODE 和 单位内编号(车牌号)USE_INNER_CODE throw new BadRequest("车牌号已存在,请重新输入!");
Integer carCount = shCarService.getBaseMapper()
.selectCount(new LambdaQueryWrapper<ShCar>()
.eq(ShCar::getCarNumber, carNum)
.eq(ShCar::getClaimedFlag, Boolean.FALSE));
Integer equCount = shCarEquService.getBaseMapper()
.selectList(new LambdaQueryWrapper<ShCarEqu>()
.eq(ShCarEqu::getEquCode, equCode))
.stream()
.findFirst()
.map(equ -> shCarService.getBaseMapper().selectList(new LambdaQueryWrapper<ShCar>()
.eq(ShCar::getSequenceNbr, equ.getCarId())
.eq(ShCar::getClaimedFlag, Boolean.FALSE))
.size()
).orElse(0);
if (carCount > 0 || equCount > 0) {
throw new BadRequest("原三环系统数据,请直接认领!");
} }
} }
} }
......
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