Commit fd42717c authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_tzs_bugfix' into develop_tzs_bugfix

parents c5de589a 6526deb1
......@@ -292,6 +292,7 @@
jri.PRODUCT_PHOTO as productPhoto,
jri.BRAND_NAME as brandName,
jri.EQU_PRICE as equPrice,
jri.CAR_NUMBER as carNumber,
jfi.FACTORY_NUM as factoryNum,
jfi.PRODUCE_UNIT_NAME as produceUnitName,
date_format(jfi.PRODUCE_DATE,'%Y-%m-%d') as produceDate,
......
......@@ -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("车牌号已存在,请重新输入!");
}
}
}
......
......@@ -122,6 +122,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private static final String COUNTY = "COUNTY";
private static final String REGION = "REGION";
private static final String STREET = "STREET";
public static final String carNumber = "carNumber";
private ApplicationContext applicationContext;
@Autowired
RedisUtils redisUtils;
......@@ -3204,6 +3205,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
//使用登记证编号判断是否使用未来系统生成编号
idxBizJgRegisterInfoService.checkUseRegistrationCode(useRegistrationCode, "set");
// 场车设备校验车牌号的唯一性
if (EquipmentClassifityEnum.CC.getCode().equals(map.get("EQU_LIST_CODE"))) {
Integer count = idxBizJgRegisterInfoService.lambdaQuery()
.eq(IdxBizJgRegisterInfo::getCarNumber, map.get(carNumber))
.ne(!com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(equipId), IdxBizJgRegisterInfo::getRecord, equipId)
.count();
if (count > 0) {
throw new BadRequest("车牌号已存在,请重新输入!");
}
}
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
CompanyBo company = reginParams.getCompany();
// 使用登记信息
......@@ -3347,6 +3359,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
registerInfo.setProductPhoto(JSONObject.toJSONString(map.get("productPhoto")));
registerInfo.setOtherAccessoriesReg(JSONObject.toJSONString(map.get("otherAccessoriesReg")));
registerInfo.setInstallationIsComplete(map.getOrDefault("installationIsComplete", "1").toString());
if (EquipmentClassifityEnum.CC.getCode().equals(map.get("EQU_LIST_CODE"))) {
registerInfo.setCarNumber((String) map.get(carNumber));
}
idxBizJgRegisterInfoMapper.updateById(registerInfo);
// 设计信息
......
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