Commit a912c344 authored by 韩桐桐's avatar 韩桐桐

Merge remote-tracking branch 'refs/remotes/origin/develop_tzs_bugfix' into develop_tzs_register

# Conflicts: # amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
parents 55841d42 11ce7833
...@@ -494,7 +494,7 @@ public class XiAnDataDockServiceImpl { ...@@ -494,7 +494,7 @@ public class XiAnDataDockServiceImpl {
//checkNotBlank(data.getWallThickness_YLGD(), "公称壁厚不能为空;", rowError); //checkNotBlank(data.getWallThickness_YLGD(), "公称壁厚不能为空;", rowError);
//checkNotBlank(data.getNominalDiameter(), "公称直径不能为空;", rowError); //checkNotBlank(data.getNominalDiameter(), "公称直径不能为空;", rowError);
checkNotBlank(data.getPipeLength(), "管道长度不能为空;", rowError); checkNotBlank(data.getPipeLength(), "管道长度不能为空;", rowError);
checkNotBlank(data.getPressure(), "压力不能为空;", rowError); // checkNotBlank(data.getPressure(), "压力不能为空;", rowError);
//checkNotBlank(data.getMedium_YLGD(), "介质不能为空;", rowError); //checkNotBlank(data.getMedium_YLGD(), "介质不能为空;", rowError);
//checkNotBlank(data.getTemperature_YLGD(), "温度不能为空;", rowError); //checkNotBlank(data.getTemperature_YLGD(), "温度不能为空;", rowError);
//checkNotBlank(data.getPipelineNumber(), "管道编号不能为空;", rowError); //checkNotBlank(data.getPipelineNumber(), "管道编号不能为空;", rowError);
......
...@@ -203,5 +203,25 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -203,5 +203,25 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
*/ */
Integer countBizNumAfterUseReg(@Param("record") String record); Integer countBizNumAfterUseReg(@Param("record") String record);
/**
* 车用气瓶-使用登记证编号全库唯一校验
*
* @param useRegistrationCode 使用登记证编号
* @param record 设备record
* @return 匹配到的数据,包含设备的企业信息
*/
List<Map<String, String>> useRegCertAccountUniqueWithVehGasCyl(@Param("useRegistrationCode") String useRegistrationCode,
@Param("record") String record);
/**
* 车用气瓶-车辆VIN全库唯一校验
*
* @param VIN 车辆VIN码
* @param record 设备record
* @return 匹配到的数据,包含设备的企业信息
*/
List<Map<String, String>> VINAccountUniqueWithVehGasCyl(@Param("VIN") String VIN,
@Param("record") String record);
} }
...@@ -2516,4 +2516,38 @@ ...@@ -2516,4 +2516,38 @@
ne.record = #{record} ne.record = #{record}
) )
</select> </select>
<select id="useRegCertAccountUniqueWithVehGasCyl" resultType="java.util.Map">
SELECT jui."USE_UNIT_CREDIT_CODE" as useUnitCreditCode
FROM idx_biz_jg_register_info jri
LEFT JOIN idx_biz_jg_other_info joi ON joi."RECORD" = jri."RECORD"
LEFT JOIN idx_biz_jg_use_info jui ON jui."RECORD" = jri."RECORD"
<where>
<if test="useRegistrationCode != null and useRegistrationCode != ''">
jri."USE_ORG_CODE" = #{useRegistrationCode}
</if>
<if test="record != null and record != ''">
AND jri."RECORD" != #{record}
</if>
AND joi.CLAIM_STATUS = '已认领'
</where>
</select>
<select id="VINAccountUniqueWithVehGasCyl" resultType="java.util.Map">
SELECT jui."USE_UNIT_CREDIT_CODE" as useUnitCreditCode
FROM idx_biz_jg_register_info jri
LEFT JOIN idx_biz_jg_use_info jui ON jui."RECORD" = jri."RECORD"
LEFT JOIN idx_biz_jg_other_info joi ON joi."RECORD" = jri."RECORD"
LEFT JOIN idx_biz_jg_tech_params_vessel jtpv ON jtpv."RECORD" = jri."RECORD"
<where>
<if test="VIN != null and VIN != ''">
AND jtpv."VIN" = #{VIN}
</if>
<if test="record != null and record != ''">
AND jri."RECORD" != #{record}
</if>
AND joi.CLAIM_STATUS = '已认领'
</where>
</select>
</mapper> </mapper>
...@@ -677,6 +677,7 @@ ...@@ -677,6 +677,7 @@
ui."USE_INNER_CODE" useInnerCode, ui."USE_INNER_CODE" useInnerCode,
ri."EQU_CODE" equCode, ri."EQU_CODE" equCode,
ri."EQU_LIST" equList, ri."EQU_LIST" equList,
ri."USE_ORG_CODE" useOrgCode,
(select name from tz_equipment_category where code = ri."EQU_LIST") equListName, (select name from tz_equipment_category where code = ri."EQU_LIST") equListName,
ri."EQU_CATEGORY" equCategory, ri."EQU_CATEGORY" equCategory,
(select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName, (select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName,
...@@ -691,6 +692,7 @@ ...@@ -691,6 +692,7 @@
(select name from cb_data_dictionary where code = pv."CHARGING_MEDIUM" and type = 'FILLING_MEDIUM') chargingMedium, (select name from cb_data_dictionary where code = pv."CHARGING_MEDIUM" and type = 'FILLING_MEDIUM') chargingMedium,
pv."NOMINAL_WORKING_PRESSURE" nominalWorkingPressure, pv."NOMINAL_WORKING_PRESSURE" nominalWorkingPressure,
pv."SINGLE_BOTTLE_VOLUME" singleBottleVolume, pv."SINGLE_BOTTLE_VOLUME" singleBottleVolume,
pv."VIN" vin,
to_char((select INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY REC_DATE DESC limit 1), 'YYYY-MM-DD') inspectDate, to_char((select INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY REC_DATE DESC limit 1), 'YYYY-MM-DD') inspectDate,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY REC_DATE DESC limit 1), 'YYYY-MM-DD') nextInspectDate to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY REC_DATE DESC limit 1), 'YYYY-MM-DD') nextInspectDate
FROM FROM
...@@ -749,6 +751,12 @@ ...@@ -749,6 +751,12 @@
<if test="jsonObject.record != null and jsonObject.record != ''"> <if test="jsonObject.record != null and jsonObject.record != ''">
and ui."RECORD" = #{jsonObject.record} and ui."RECORD" = #{jsonObject.record}
</if> </if>
<if test="jsonObject.useRegistrationCode != null and jsonObject.useRegistrationCode != ''">
and ri."USE_ORG_CODE" = #{jsonObject.useRegistrationCode}
</if>
<if test="jsonObject.identificationCode != null and jsonObject.identificationCode != ''">
and pv."VIN" = #{jsonObject.identificationCode}
</if>
<if test="jsonObject.record == null"> <if test="jsonObject.record == null">
and not exists(SELECT 1 FROM tzs_jg_vehicle_information v, tzs_jg_vehicle_information_eq ve WHERE and not exists(SELECT 1 FROM tzs_jg_vehicle_information v, tzs_jg_vehicle_information_eq ve WHERE
v.sequence_nbr = ve.vehicle_id AND ve.equ_id = ui."RECORD" and v.status !='使用单位待提交' and v.status v.sequence_nbr = ve.vehicle_id AND ve.equ_id = ui."RECORD" and v.status !='使用单位待提交' and v.status
......
...@@ -2,36 +2,29 @@ package com.yeejoin.amos.boot.module.jg.biz.controller; ...@@ -2,36 +2,29 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sun.org.apache.xpath.internal.operations.Bool; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto; import com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage; import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.entity.ShCar; import com.yeejoin.amos.boot.module.jg.api.entity.ShCar;
import com.yeejoin.amos.boot.module.jg.api.entity.ShCarEqu;
import com.yeejoin.amos.boot.module.jg.api.service.IShCarService; import com.yeejoin.amos.boot.module.jg.api.service.IShCarService;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationManageServiceImpl; import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationManageServiceImpl;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.ShCarEquServiceImpl; import com.yeejoin.amos.boot.module.jg.biz.service.impl.ShCarEquServiceImpl;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.ShCarServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.ApiOperation; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import io.swagger.annotations.Api; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.ShCarServiceImpl;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List;
import org.springframework.web.bind.annotation.*; import java.util.Map;
import java.util.Optional;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.util.*;
/** /**
* @author system_generator * @author system_generator
...@@ -180,7 +173,11 @@ public class ShCarController extends BaseController { ...@@ -180,7 +173,11 @@ public class ShCarController extends BaseController {
@GetMapping(value = "/searchForSanHanAllParams") @GetMapping(value = "/searchForSanHanAllParams")
public ResponseModel<ShCar> searchForSanHan(@ApiParam(name = "使用登记证编号") @RequestParam String useRegistrationCode, public ResponseModel<ShCar> searchForSanHan(@ApiParam(name = "使用登记证编号") @RequestParam String useRegistrationCode,
@ApiParam(name = "车牌号") @RequestParam String carNumber, @ApiParam(name = "车牌号") @RequestParam String carNumber,
@ApiParam(name = "单位内编号") @RequestParam(value = "USE_INNER_CODE", required = false) String useInnerCode,
@ApiParam(name = "车辆VIN码") @RequestParam String identificationCode) { @ApiParam(name = "车辆VIN码") @RequestParam String identificationCode) {
if (StringUtils.isEmpty(carNumber) && !StringUtils.isEmpty(useInnerCode)) {
carNumber = useInnerCode;
}
if (StringUtils.isEmpty(useRegistrationCode) || StringUtils.isEmpty(carNumber) || StringUtils.isEmpty(identificationCode)) if (StringUtils.isEmpty(useRegistrationCode) || StringUtils.isEmpty(carNumber) || StringUtils.isEmpty(identificationCode))
return ResponseHelper.buildResponse(new ShCar()); return ResponseHelper.buildResponse(new ShCar());
LambdaQueryWrapper<ShCar> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ShCar> wrapper = new LambdaQueryWrapper<>();
......
...@@ -445,8 +445,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -445,8 +445,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
check96333Code(equipmentInfoForm); check96333Code(equipmentInfoForm);
// 气瓶 校验制造单位统一信用代码与出场编码唯一 // 气瓶 校验制造单位统一信用代码与出场编码唯一
checkFactoryNumUniqueWithGasCylinder(equipmentInfoForm, record); checkFactoryNumUniqueWithGasCylinder(equipmentInfoForm, record);
// 历史(车用气瓶)设备校验使用登记证编号全库唯一 // 历史(车用气瓶)设备校验使用登记证编号 VIN 全库唯一
hisEquCheckUseRegistrationCodeUniqueness(equipmentInfoForm); hisEquCheckUseRegCodeAndVINUniqueness(equipmentInfoForm, record);
// 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来 // 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
// checkIsSanHanData(equipmentInfoForm); // checkIsSanHanData(equipmentInfoForm);
} catch (Exception e) { } catch (Exception e) {
...@@ -504,6 +504,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -504,6 +504,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
/** /**
* 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来 * 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
*
* @param equipmentInfoForm 入参 * @param equipmentInfoForm 入参
*/ */
private void checkIsSanHanData(LinkedHashMap<?, ?> equipmentInfoForm) { private void checkIsSanHanData(LinkedHashMap<?, ?> equipmentInfoForm) {
...@@ -564,15 +565,39 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -564,15 +565,39 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
} }
private void hisEquCheckUseRegistrationCodeUniqueness(LinkedHashMap<?, ?> equipmentInfoForm) { private void hisEquCheckUseRegCodeAndVINUniqueness(LinkedHashMap<?, ?> equipmentInfoForm, String record) {
// 历史(车用气瓶)设备校验使用登记证编号全库唯一 // 历史(车用气瓶)设备校验使用登记证编号 VIN 全库唯一
String dataSource = (String) equipmentInfoForm.get(DATA_SOURCE); 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 record = (String) equipmentInfoForm.get(RECORD); String dataSource = (String) equipmentInfoForm.get(DATA_SOURCE);
String useRegistrationCode = (String) equipmentInfoForm.get("useRegistrationCode"); if (ValidationUtil.isEmpty(dataSource)) {
if (!ValidationUtil.isEmpty(dataSource) && dataSource.contains("his") && !ValidationUtil.isEmpty(useRegistrationCode)) { throw new BadRequest("参数异常!");
Boolean unique = commonService.useRegistrationCertificateAccountUnique(useRegistrationCode, ValidationUtil.isEmpty(record) ? null : record); }
if (unique) { if (dataSource.contains("his")) {
throw new BadRequest("使用登记证编号已存在,请重新输入!"); String VIN = (String) equipmentInfoForm.get("identificationCode");
String useRegistrationCode = (String) equipmentInfoForm.get("useRegistrationCode");
if (ValidationUtil.isEmpty(VIN) || ValidationUtil.isEmpty(useRegistrationCode)) {
throw new BadRequest("参数异常!");
}
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
String companyType = reginParams.getCompany().getCompanyType();
String companyCode = "个人主体".equals(companyType) ? reginParams.getCompany().getCompanyCode().split("_")[1] : reginParams.getCompany().getCompanyCode();
// 匹配使用登记证编号
List<Map<String, String>> useRegMapList = commonMapper.useRegCertAccountUniqueWithVehGasCyl(useRegistrationCode, record);
boolean hasUseReg = !useRegMapList.isEmpty();
boolean certificateOfTheEnterprise = hasUseReg ? JSON.toJSONString(useRegMapList).contains(companyCode) : Boolean.FALSE;
// 匹配车辆VIN码
List<Map<String, String>> VINMapList = commonMapper.VINAccountUniqueWithVehGasCyl(VIN, record);
boolean hasVIN = !VINMapList.isEmpty();
boolean VINOfTheEnterprise = hasVIN ? JSON.toJSONString(useRegMapList).contains(companyCode) : Boolean.FALSE;
// 无证无VIN 和 本企业的证本企业的VIN 两种情况可以放行
if (!((!hasUseReg && !hasVIN) || (certificateOfTheEnterprise && VINOfTheEnterprise))) {
if (log.isDebugEnabled()) {
log.info("历史车用气瓶==输入的==>使用登记证编号:{},车辆VIN码:{}", useRegistrationCode, VIN);
log.info("历史车用气瓶==匹配到的==>使用登记证编号:{},车辆VIN码:{}", JSON.toJSONString(useRegMapList), JSON.toJSONString(VINMapList));
log.info("历史车用气瓶====>是否本企业使用登记证编号:{},是否本企业车辆VIN码:{}", certificateOfTheEnterprise, VINOfTheEnterprise);
}
throw new BadRequest("使用登记证号和车辆VIN码数据异常,请联系管理员!");
}
} }
} }
} }
...@@ -596,7 +621,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -596,7 +621,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
throw new BadRequest(e.getMessage()); throw new BadRequest(e.getMessage());
} }
private void checkForEquipEdit(String record) { private void checkForEquipEdit(String record) {
// 标识编辑 // 标识编辑
if (!ValidationUtil.isEmpty(record)) { if (!ValidationUtil.isEmpty(record)) {
Integer inUseTime = commonService.countEquipInUseTimesForEdit(record); Integer inUseTime = commonService.countEquipInUseTimesForEdit(record);
...@@ -987,7 +1012,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -987,7 +1012,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
useInfoMap.put("USE_ADDRESS", useInfo.getAddress()); useInfoMap.put("USE_ADDRESS", useInfo.getAddress());
useInfoMap.put("FULL_ADDRESS", useInfo.getAddress()); useInfoMap.put("FULL_ADDRESS", useInfo.getAddress());
} }
//bug--22325 一码通过来的数据去掉【DATA_SOURCE】,保存设备时 【batchSubmitOrUpdate方法】 会对 DATA_SOURCE字段进行处理 // bug--22325 一码通过来的数据去掉【DATA_SOURCE】,保存设备时 【batchSubmitOrUpdate方法】 会对 DATA_SOURCE字段进行处理
// 一码通数据:"must": [ // 一码通数据:"must": [
// { // {
// "term": { // "term": {
...@@ -1652,7 +1677,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1652,7 +1677,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 历史设备且做过历史登记 // 历史设备且做过历史登记
BoolQueryBuilder hisBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder hisBuilder = QueryBuilders.boolQuery();
hisBuilder.must(QueryBuilders.prefixQuery("DATA_SOURCE", "jg_his")); hisBuilder.must(QueryBuilders.prefixQuery("DATA_SOURCE", "jg_his"));
hisBuilder.mustNot(QueryBuilders.prefixQuery("DATA_SOURCE", "jg_his_ymt"));//排除一码通设备 hisBuilder.mustNot(QueryBuilders.prefixQuery("DATA_SOURCE", "jg_his_ymt"));// 排除一码通设备
hisBuilder.must(QueryBuilders.termQuery("EQU_STATE", EquimentEnum.ZAIYONG.getCode())); hisBuilder.must(QueryBuilders.termQuery("EQU_STATE", EquimentEnum.ZAIYONG.getCode()));
dBuilder.should(hisBuilder); dBuilder.should(hisBuilder);
// 或新设备 // 或新设备
...@@ -1688,7 +1713,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1688,7 +1713,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 查询 使用登记【可选设备列表】【(EQU_STATUS=== null || "" ) && (USE_ORG_CODE(使用登记证编号) ==="" || null)】 // 查询 使用登记【可选设备列表】【(EQU_STATUS=== null || "" ) && (USE_ORG_CODE(使用登记证编号) ==="" || null)】
BoolQueryBuilder syBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder syBuilder = QueryBuilders.boolQuery();
syBuilder.mustNot(QueryBuilders.existsQuery("EQU_STATE")); syBuilder.mustNot(QueryBuilders.existsQuery("EQU_STATE"));
//syBuilder.mustNot(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*")); // syBuilder.mustNot(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*"));
boolMust.must(syBuilder); boolMust.must(syBuilder);
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "useRegistration"); this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "useRegistration");
} else if (ValidationUtil.equals(queryType, "FINISH_SY")) { } else if (ValidationUtil.equals(queryType, "FINISH_SY")) {
......
...@@ -184,9 +184,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -184,9 +184,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
EventPublisher eventPublisher; EventPublisher eventPublisher;
/** /**
* 安装改造维修单位吱资质类型:1234 * 安装改造维修单位吱资质类型:1234-安改维、1236-制造单位
*/ */
@Value("${company.type.notice:1234}") @Value("${company.type.notice:1234,1236}")
private String companyType; private String companyType;
/** /**
...@@ -620,7 +620,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -620,7 +620,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
String useCode = String.valueOf(informObj.get("installUnitCreditCode")); String useCode = String.valueOf(informObj.get("installUnitCreditCode"));
LambdaQueryWrapper<TzBaseUnitLicence> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TzBaseUnitLicence> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TzBaseUnitLicence::getUnitCode, useCode); wrapper.eq(TzBaseUnitLicence::getUnitCode, useCode);
wrapper.eq(TzBaseUnitLicence::getCertTypeCode, companyType); // 资质支持多个显示and (certTypeCode = 'xx1' or certTypeCode = 'xx2')
wrapper.and(w-> {
String[] certTypeCodes = companyType.split(",");
for(String certTypeCode: certTypeCodes){
w.or().eq(TzBaseUnitLicence::getCertTypeCode, certTypeCode);
}
});
wrapper.orderByDesc(TzBaseUnitLicence::getExpiryDate); wrapper.orderByDesc(TzBaseUnitLicence::getExpiryDate);
wrapper.orderByDesc(TzBaseUnitLicence::getRecDate); wrapper.orderByDesc(TzBaseUnitLicence::getRecDate);
// 去重显示3个 // 去重显示3个
......
...@@ -8,8 +8,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -8,8 +8,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
...@@ -17,6 +18,7 @@ import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity; ...@@ -17,6 +18,7 @@ import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
...@@ -1767,25 +1769,44 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -1767,25 +1769,44 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
@GlobalTransactional(rollbackFor = Exception.class) @GlobalTransactional(rollbackFor = Exception.class)
public List<JgVehicleInformation> saveOrUpdateHisData(JSONObject map) { public List<JgVehicleInformation> saveOrUpdateHisData(JSONObject map) {
// 使用登记证编号 // 使用登记证编号
String useRegistrationCode1 = String.valueOf(map.get("useRegistrationCode")).trim(); String useRegistrationCode = String.valueOf(map.get("useRegistrationCode")).trim();
// 车辆VIN码
String identificationCode = String.valueOf(map.get("identificationCode")).trim();
String equipId = String.valueOf(map.get("equipId")); String equipId = String.valueOf(map.get("equipId"));
//校验使用登记证编号的唯一性 // 表单设备列表
Boolean used = commonService.useRegistrationCertificateAccountUnique(useRegistrationCode1, equipId); List<Map<String, Object>> equipmentLists = new ObjectMapper()
if (used){ .convertValue(map.get("equipmentLists"), new TypeReference<List<Map<String, Object>>>() {
throw new BadRequest("使用登记证编号已存在!"); });
} // 设备列表判空 + 选择同一充装介质的设备
Optional.ofNullable(equipmentLists)
.filter(list -> !list.isEmpty())
.filter(list -> list.stream().map(v -> (String) v.get("chargingMedium")).distinct().count() == 1)
.orElseThrow(() -> new BadRequest(CollectionUtils.isEmpty(equipmentLists) ? "请选择设备信息!" : "请选择相同充装介质设备!"));
// 确保车用气瓶使用信息中填写的【使用登记证编号】【车辆VIN】与列表所选择设备的一致
Optional.of(equipmentLists)
.filter(eqLists -> {
boolean isSameChargingMedium = eqLists.stream().map(v -> (String) v.get("useOrgCode")).distinct().count() == 1;
boolean isSameVin = eqLists.stream().map(v -> (String) v.get("vin")).distinct().count() == 1;
String firstUseOrgCode = (String) eqLists.stream().findFirst().orElseThrow(() -> new BadRequest("设备列表为空,无法获取第一个设备信息")).get("useOrgCode");
String firstVin = (String) eqLists.stream().findFirst().orElseThrow(() -> new BadRequest("设备列表为空,无法获取第一个设备信息")).get("vin");
boolean isOrgCodeConsistent = useRegistrationCode.equals(firstUseOrgCode);
boolean isVinConsistent = identificationCode.equals(firstVin);
return isSameChargingMedium && isSameVin && isOrgCodeConsistent && isVinConsistent;
})
.orElseThrow(() -> new BadRequest("使用登记证号、车辆VIN码与所选设备不一致,请重新选择设备!"));
// 校验使用登记证编号的唯一性 ====> 20241202 任务ID 32776 将校验前置到了新增历史设备阶段
// Boolean used = commonService.useRegistrationCertificateAccountUnique(useRegistrationCode, equipId);
// if (used){
// throw new BadRequest("使用登记证编号已存在!");
// }
// 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来 // 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
// this.checkIsSanSystemHanData(map); // this.checkIsSanSystemHanData(map);
//使用登记证编号判断是否使用未来系统生成编号 //使用登记证编号判断是否使用未来系统生成编号
idxBizJgRegisterInfoService.checkUseRegistrationCode(useRegistrationCode1,"vehicle"); idxBizJgRegisterInfoService.checkUseRegistrationCode(useRegistrationCode, "vehicle");
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())) + "", ReginParams.class); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())) + "", ReginParams.class);
JgVehicleInformationDto vehicleInfoDto = JSON.parseObject(JSON.toJSONString(map), JgVehicleInformationDto.class); JgVehicleInformationDto vehicleInfoDto = JSON.parseObject(JSON.toJSONString(map), JgVehicleInformationDto.class);
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) map.get("equipmentLists");
if (CollectionUtils.isEmpty(equipmentLists) ||
equipmentLists.stream().map(v -> (String) v.get("chargingMedium")).distinct().count() != 1) {
throw new BadRequest(CollectionUtils.isEmpty(equipmentLists) ? "请选择设备信息!" : "请选择相同充装介质设备!");
}
List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList = idxBizJgInspectionDetectionInfoService.checkInspectionInfo( List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList = idxBizJgInspectionDetectionInfoService.checkInspectionInfo(
equipmentLists.stream() equipmentLists.stream()
...@@ -1932,13 +1953,13 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -1932,13 +1953,13 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
lambda.eq(JgVehicleInformationEq::getVehicleId, vehicleInformation.getSequenceNbr()); lambda.eq(JgVehicleInformationEq::getVehicleId, vehicleInformation.getSequenceNbr());
jgVehicleInformationEqService.getBaseMapper().delete(lambda); jgVehicleInformationEqService.getBaseMapper().delete(lambda);
this.getBaseMapper().updateById(vehicleInformation); this.getBaseMapper().updateById(vehicleInformation);
JgUseRegistrationManage useRegistrationCode = jgUseRegistrationManageService.lambdaQuery() JgUseRegistrationManage useRegistrationManage = jgUseRegistrationManageService.lambdaQuery()
.eq(JgUseRegistrationManage::getUseRegistrationCode, vehicleInformation.getUseRegistrationCode()) .eq(JgUseRegistrationManage::getUseRegistrationCode, vehicleInformation.getUseRegistrationCode())
.eq(JgUseRegistrationManage::getIsDelete, 0) .eq(JgUseRegistrationManage::getIsDelete, 0)
.one(); .one();
if (useRegistrationCode != null) { if (useRegistrationManage != null) {
useRegistrationCode.setCarNumber(vehicleInformation.getCarNumber()); useRegistrationManage.setCarNumber(vehicleInformation.getCarNumber());
jgUseRegistrationManageService.updateById(useRegistrationCode); jgUseRegistrationManageService.updateById(useRegistrationManage);
} }
} }
......
...@@ -76,7 +76,7 @@ public class ShCarEquServiceImpl extends BaseService<ShCarEqu, ShCarEqu, ShCarEq ...@@ -76,7 +76,7 @@ public class ShCarEquServiceImpl extends BaseService<ShCarEqu, ShCarEqu, ShCarEq
shCarDto.setUseUnitAddress(reginParams.getCompany().getAddress()); shCarDto.setUseUnitAddress(reginParams.getCompany().getAddress());
} }
} }
if ("false".equals(claimOneself)){//帮别人认领 取 原三环数据填充表单 if ("false".equals(claimOneself) || "监管机构".equals(companyType)) {// 帮别人认领 取 原三环数据填充表单
shCarDto.setUseUnitName(shCar.getOwner()); shCarDto.setUseUnitName(shCar.getOwner());
shCarDto.setUseUnitCreditCode(shCar.getOwner()); shCarDto.setUseUnitCreditCode(shCar.getOwner());
shCarDto.setUseUnitAddress(shCar.getAddress()); shCarDto.setUseUnitAddress(shCar.getAddress());
......
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