Commit 8d51d7f7 authored by 刘林's avatar 刘林

fix(jg):历史管道导入作废Bug修改

parent 358309a5
......@@ -1545,7 +1545,7 @@ public class DataDockServiceImpl {
if (useRegistrationList.stream().filter(map -> !"1".equals(map.getRegType())).count() > 1) {
throw new BadRequest("该使用登记证编号已由系统自动生成,不能导入,请确认使用登记证编号是否正确!");
}
if (useRegistrationList.stream().filter(map -> !paramsDto.getCompanyCode().equals(map.getUseUnitCreditCode())).count() > 1) {
if (useRegistrationList.stream().anyMatch(map -> !paramsDto.getCompanyCode().equals(map.getUseUnitCreditCode()))) {
throw new BadRequest("该使用登记证编号在其他企业使用,不能导入,请确认使用登记证编号是否正确!");
}
haveUseRegistration = true;
......
......@@ -132,6 +132,8 @@ public class TzBaseEnterpriseInfoServiceImpl
COMPANY_TYPE_CERT_TYPE_MAP.put("检验检测机构", "1233-1,1233-2");
// 安装改造维修单位身份资质:充装单位-1231 制造单位-1236 设计单位-1235 安装改造维修单位-1234
COMPANY_TYPE_CERT_TYPE_MAP.put("安装改造维修单位", "1231,1234,1235,1236");
// 充装单位
COMPANY_TYPE_CERT_TYPE_MAP.put("充装单位", "1202");
}
/**
......@@ -729,15 +731,16 @@ public class TzBaseEnterpriseInfoServiceImpl
}
private void removeLicenceDataBeforeSave(ReginParams reginParams, TzBaseEnterpriseInfo tzBaseEnterpriseInfo) {
if (tzBaseEnterpriseInfo == null) return;
String companyType = reginParams.getCompany().getCompanyType();
String useCode = tzBaseEnterpriseInfo.getUseCode();
String certTypeCodes = COMPANY_TYPE_CERT_TYPE_MAP.getOrDefault(companyType, "");
if (useCode == null || certTypeCodes.isEmpty()) return;
LambdaQueryWrapper<BaseUnitLicence> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BaseUnitLicence::getUnitCode,tzBaseEnterpriseInfo.getUseCode());
wrapper.and(w-> {
String[] certTypeCodeArray = COMPANY_TYPE_CERT_TYPE_MAP.get(companyType).split(",");
for(String certTypeCode: certTypeCodeArray){
w.or().likeRight(BaseUnitLicence::getCertTypeCode, certTypeCode);
}
});
wrapper.eq(BaseUnitLicence::getUnitCode, useCode);
wrapper.and(w -> Arrays.stream(certTypeCodes.split(","))
.forEach(certTypeCode -> w.or().likeRight(BaseUnitLicence::getCertTypeCode, certTypeCode)));
baseUnitLicenceService.remove(wrapper);
}
......
......@@ -551,17 +551,6 @@
AND a.is_delete = 0
AND ( a.notice_status != '6617')
GROUP BY c.project_contraption_id
UNION
SELECT
a.project_contraption_id,
COUNT(1) AS inUseNumber
FROM tz_jyjc_inspection_application a
WHERE a.project_contraption_id in
<foreach collection="projectContraptionIdList" item="projectContraptionId" index='index' open="(" close= ")" separator=",">
#{projectContraptionId}
</foreach>
AND ( a.status != '6617')
GROUP BY a.project_contraption_id
) GROUP BY project_contraption_id
</select>
</mapper>
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