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

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

parent ab6b10e0
......@@ -94,6 +94,7 @@ import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
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.VehicleApanageEnum.XIAN_YANG;
......@@ -176,6 +177,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private static final String IS_COPY = "isCopy";
private static final String ATTACHMENT_UPLOAD = "attachmentUpload";
private static final Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
public static final String CAR_NUMBER = "CAR_NUMBER";
// 需要转化成jsonObject的附件字段
public static String[] jsonFields = {"insOtherAccessories", "installContractAttachment", "installProxyStatementAttachment"};
private final List<String> resultError = new ArrayList<>();
......@@ -777,8 +779,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
checkFactoryNumUniqueWithGasCylinder(equipmentInfoForm, record);
// 历史(车用气瓶)设备校验使用登记证编号 VIN 全库唯一
hisEquCheckUseRegCodeAndVINUniqueness(equipmentInfoForm, record);
// 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
// checkIsSanHanData(equipmentInfoForm);
// 历史有使用登记证的场车设备校验车牌号的唯一性
checkCarNumberUniquenessWithHisCC(equipmentInfoForm, record, dataSource);
} catch (Exception e) {
handleError(e, null);
}
......@@ -833,35 +835,19 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
/**
* 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
*
* @param equipmentInfoForm 入参
* 历史有使用登记证的场车设备校验车牌号的唯一性
* @param equipmentInfoForm
* @param record
* @param dataSource
*/
private void checkIsSanHanData(LinkedHashMap<?, ?> equipmentInfoForm) {
// 是否车用气瓶
if ("2000".equals(equipmentInfoForm.get(EQU_LIST)) && "2300".equals(equipmentInfoForm.get(EQU_CATEGORY))
&& "23T0".equals(equipmentInfoForm.get(EQU_DEFINE))
&& "1".equals(equipmentInfoForm.get(WHETHER_VEHICLE_CYLINDER))) {
String carNum = (String) equipmentInfoForm.get("USE_INNER_CODE");
String equCode = (String) equipmentInfoForm.get("EQU_CODE");
// 判断 设备代码EQU_CODE 和 单位内编号(车牌号)USE_INNER_CODE
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("原三环系统数据,请直接认领!");
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))) {
Integer count = idxBizJgRegisterInfoService.lambdaQuery()
.eq(IdxBizJgRegisterInfo::getCarNumber, equipmentInfoForm.get(CAR_NUMBER))
.ne(!StringUtils.isEmpty(record), IdxBizJgRegisterInfo::getRecord, record)
.count();
if (count > 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