Commit c4601204 authored by 刘林's avatar 刘林

fix(jg):修改使用登记作废-气瓶导入作废,修改气瓶导入

parent 5e8fe742
...@@ -43,10 +43,7 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; ...@@ -43,10 +43,7 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.CategoryOtherInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.OtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.SuperviseInfoMapper;
import com.yeejoin.amos.component.feign.utils.FeignUtil; import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
...@@ -273,6 +270,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -273,6 +270,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private SafetyProblemTracingMapper safetyProblemTracingMapper; private SafetyProblemTracingMapper safetyProblemTracingMapper;
@Autowired @Autowired
private RedisTemplate<String, String> redisTemplate; private RedisTemplate<String, String> redisTemplate;
@Autowired
private TzBaseEnterpriseInfoMapper baseEnterpriseInfoMapper;
/** /**
* 将对象的属性由驼峰转为纯大写下划线格式 * 将对象的属性由驼峰转为纯大写下划线格式
...@@ -1781,7 +1780,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1781,7 +1780,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 转化施工类型 // 转化施工类型
String constructionType = dto2.get(CONSTRUCTIONTYPE).toString(); String constructionType = dto2.get(CONSTRUCTIONTYPE).toString();
if (!ValidationUtil.isEmpty(constructionType)) { if (!ValidationUtil.isEmpty(constructionType)) {
List<String> constructionTypeList = Arrays.asList(constructionType.split(",")); String[] constructionTypeList = constructionType.split(",");
List<String> statusList = new ArrayList<>(); List<String> statusList = new ArrayList<>();
for (String cType : constructionTypeList) { for (String cType : constructionTypeList) {
Integer integer = Integer.valueOf(cType); Integer integer = Integer.valueOf(cType);
...@@ -2452,7 +2451,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2452,7 +2451,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
otherInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("OTHERINFO_SEQ"))); otherInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("OTHERINFO_SEQ")));
if (isCopy) { if (isCopy) {
// 复制且有无96333识别码选择 无 96333码置空 // 复制且有无96333识别码选择 无 96333码置空
if("2".equals(otherInfo.getCode96333Type())){ if ("2".equals(otherInfo.getCode96333Type())) {
otherInfo.setCode96333(""); otherInfo.setCode96333("");
} }
// 监管码置空 // 监管码置空
...@@ -2462,7 +2461,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2462,7 +2461,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
otherInfo.setInformationManageCode(""); otherInfo.setInformationManageCode("");
} }
// 编辑时,如果选择<无96333识别码>,则把已经入库的数据清除掉 // 编辑时,如果选择<无96333识别码>,则把已经入库的数据清除掉
if(OPERATEEDIT.equals(operateType) && "2".equals(otherInfo.getCode96333Type())){ if (OPERATEEDIT.equals(operateType) && "2".equals(otherInfo.getCode96333Type())) {
otherInfo.setCode96333(""); otherInfo.setCode96333("");
} }
iIdxBizJgOtherInfoService.saveOrUpdateData(otherInfo); iIdxBizJgOtherInfoService.saveOrUpdateData(otherInfo);
...@@ -2860,19 +2859,19 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2860,19 +2859,19 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
List<String> prefixes = Collections.unmodifiableList(Arrays.asList("容", "锅", "管", "瓶", "梯", "起", "索", "游", "车")); List<String> prefixes = Collections.unmodifiableList(Arrays.asList("容", "锅", "管", "瓶", "梯", "起", "索", "游", "车"));
//容15鲁G00302(12) //容15鲁G00302(12)
if (useRegistrationCode.length() == 14 && prefixes.stream().anyMatch(key::startsWith)) { if (useRegistrationCode.length() == 14 && prefixes.stream().anyMatch(key::startsWith)) {
if (redisUtils.hasKey(useRegistrationCode.substring(0, 5))){
String prefix = useRegistrationCode.substring(0, 3);
// 如果 prefix 不等于 "瓶31" 或 "瓶32" 则继续执行逻辑 // 如果 prefix 不等于 "瓶31" 或 "瓶32" 则继续执行逻辑
ValueOperations<String, String> valueOps = redisTemplate.opsForValue(); ValueOperations<String, String> valueOps = redisTemplate.opsForValue();
String currentSequenceStr = valueOps.get(key); String currentSequenceStr = valueOps.get(key);
if (Stream.of("瓶31", "瓶32").noneMatch(prefix::equals) && currentSequenceStr != null) {
String extractedValue = useRegistrationCode.substring(5, 10); String extractedValue = useRegistrationCode.substring(5, 10);
String extractedYearStr = useRegistrationCode.substring(useRegistrationCode.indexOf('(') + 1, useRegistrationCode.indexOf(')')); String extractedYearStr = useRegistrationCode.substring(useRegistrationCode.indexOf('(') + 1, useRegistrationCode.indexOf(')'));
int currentYearLastTwoDigits = LocalDate.now().getYear() % 100; int currentYearLastTwoDigits = LocalDate.now().getYear() % 100;
try {
// 提取年份 // 提取年份
int extractedYear = Integer.parseInt(extractedYearStr); int extractedYear = Integer.parseInt(extractedYearStr);
if(currentYearLastTwoDigits == extractedYear){ if (currentYearLastTwoDigits == extractedYear) {
if (redisUtils.hasKey(useRegistrationCode.substring(0, 5))) {
String prefix = useRegistrationCode.substring(0, 3);
if (Stream.of("瓶31", "瓶32").noneMatch(prefix::equals) && currentSequenceStr != null) {
try {
if (Character.isLetter(extractedValue.charAt(0))) { if (Character.isLetter(extractedValue.charAt(0))) {
// 提取字母部分并比较 // 提取字母部分并比较
char extractedLetter = extractedValue.charAt(0); char extractedLetter = extractedValue.charAt(0);
...@@ -2882,7 +2881,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2882,7 +2881,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
char redisLetter = currentSequenceStr.charAt(0); char redisLetter = currentSequenceStr.charAt(0);
//redis中不是字母开头,输入的是字母开头 //redis中不是字母开头,输入的是字母开头
if (!Character.isLetter(redisLetter) ) { if (!Character.isLetter(redisLetter)) {
throw new BadRequest("登记证编号不能使用系统还未生成编号!"); throw new BadRequest("登记证编号不能使用系统还未生成编号!");
} }
int redisNumber = Integer.parseInt(currentSequenceStr.substring(1)); int redisNumber = Integer.parseInt(currentSequenceStr.substring(1));
...@@ -2897,7 +2896,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2897,7 +2896,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
throw new BadRequest("登记证编号不能使用系统还未生成编号!"); throw new BadRequest("登记证编号不能使用系统还未生成编号!");
} }
} }
}
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throw new BadRequest("数据格式错误"); throw new BadRequest("数据格式错误");
} }
...@@ -2907,6 +2905,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2907,6 +2905,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
} }
} }
}
String record = UUID.randomUUID().toString(); String record = UUID.randomUUID().toString();
jgRelationEquip.setEquId(record); jgRelationEquip.setEquId(record);
...@@ -3229,11 +3228,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3229,11 +3228,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
jgUseRegistrationManage.setIsDelete(Boolean.FALSE); jgUseRegistrationManage.setIsDelete(Boolean.FALSE);
jgUseRegistrationManage.setEquUseAddress(""); jgUseRegistrationManage.setEquUseAddress("");
jgUseRegistrationManage.setManageType("unit"); jgUseRegistrationManage.setManageType("unit");
jgUseRegistrationManage.setUseUnitAddress(company.getAddress()); jgUseRegistrationManage.setUseUnitAddress(!ValidationUtil.isEmpty(baseEnterpriseInfoMapper.selectByUseUnit(company.getCompanyName())) ? baseEnterpriseInfoMapper.selectByUseUnit(company.getCompanyName()).getAddress() : "");
jgUseRegistrationManage.setUseRegistrationCode(equipInfoDto.getUseOrgCode()); jgUseRegistrationManage.setUseRegistrationCode(equipInfoDto.getUseOrgCode());
jgUseRegistrationManage.setUseUnitName(CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyName().split("_")[1] : company.getCompanyName());
jgUseRegistrationManage.setUseUnitCreditCode(CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ? jgUseRegistrationManage.setUseUnitCreditCode(CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] : company.getCompanyCode()); company.getCompanyCode().split("_")[1] : company.getCompanyCode());
jgUseRegistrationManage.setUseUnitName(company.getCompanyName());
jgUseRegistrationManage.setReceiveCompanyCode(equipInfoDto.getReceiveOrgCode()); jgUseRegistrationManage.setReceiveCompanyCode(equipInfoDto.getReceiveOrgCode());
jgUseRegistrationManage.setCertificateNo(generateCertificateNo(equipInfoDto, new Date(), equipInfoDto.getReceiveOrgCode())); jgUseRegistrationManage.setCertificateNo(generateCertificateNo(equipInfoDto, new Date(), equipInfoDto.getReceiveOrgCode()));
jgUseRegistrationManageService.save(jgUseRegistrationManage); jgUseRegistrationManageService.save(jgUseRegistrationManage);
...@@ -3349,7 +3349,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3349,7 +3349,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
checkNotBlank(data.getCylinderCategory(), "气瓶分类不能为空;", result); checkNotBlank(data.getCylinderCategory(), "气瓶分类不能为空;", result);
checkFactoryNumUnique(data.getFactoryNum(), company.getCompanyCode(), result); checkFactoryNumUnique(data.getFactoryNum(), company.getCompanyCode(), result);
}else{ } else {
checkFactoryNumUniquenessForVehicleCylinder(data.getFactoryNum(), result); checkFactoryNumUniquenessForVehicleCylinder(data.getFactoryNum(), result);
} }
checkNotBlank(data.getProduceDate(), "制造日期不能为空;", result); checkNotBlank(data.getProduceDate(), "制造日期不能为空;", result);
......
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