Commit 5bfaa780 authored by hezhuozhi's avatar hezhuozhi

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

parents c0ecc32c 8d51d7f7
...@@ -57,7 +57,7 @@ public interface JgChangeRegistrationReformMapper extends BaseMapper<JgChangeReg ...@@ -57,7 +57,7 @@ public interface JgChangeRegistrationReformMapper extends BaseMapper<JgChangeReg
IPage<IdxBizJgProjectContraption> queryJgProjectContraptionPage(Page<IdxBizJgProjectContraption> page,@Param("companyCode") String useUnitCreditCode,@Param("proIds") Set<String> proIds); IPage<IdxBizJgProjectContraption> queryJgProjectContraptionPage(Page<IdxBizJgProjectContraption> page,@Param("companyCode") String useUnitCreditCode,@Param("proIds") Set<String> proIds);
/** /**
* 查询指定装置下的管道,样式为汇总表样式 * 查询指定装置下的管道,样式为汇总表样式
* @param projectContraptionSeq 装置id * @param projectContraptionSeq 装置id
* @return List<Map<String, Object>> * @return List<Map<String, Object>>
*/ */
......
...@@ -377,7 +377,8 @@ ...@@ -377,7 +377,8 @@
pp."WORK_MEDIUM" AS workMedium, pp."WORK_MEDIUM" AS workMedium,
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectOrgName, (select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectOrgName,
(select name from cb_data_dictionary where type = 'JYJL' and code = (select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1)) inspectConclusion, (select name from cb_data_dictionary where type = 'JYJL' and code = (select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1)) inspectConclusion,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_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 INSPECT_DATE DESC limit 1), 'YYYY-MM-DD') nextInspectDate,
(select INSPECT_REPORT from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectReport
FROM FROM
idx_biz_jg_use_info ui idx_biz_jg_use_info ui
LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD" LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD"
......
...@@ -1545,7 +1545,7 @@ public class DataDockServiceImpl { ...@@ -1545,7 +1545,7 @@ public class DataDockServiceImpl {
if (useRegistrationList.stream().filter(map -> !"1".equals(map.getRegType())).count() > 1) { if (useRegistrationList.stream().filter(map -> !"1".equals(map.getRegType())).count() > 1) {
throw new BadRequest("该使用登记证编号已由系统自动生成,不能导入,请确认使用登记证编号是否正确!"); 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("该使用登记证编号在其他企业使用,不能导入,请确认使用登记证编号是否正确!"); throw new BadRequest("该使用登记证编号在其他企业使用,不能导入,请确认使用登记证编号是否正确!");
} }
haveUseRegistration = true; haveUseRegistration = true;
......
...@@ -1634,6 +1634,10 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -1634,6 +1634,10 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
IdxBizJgProjectContraption projectContraption = jgProjectContraptionService.getBaseMapper().selectById(projectContraptionSeq); IdxBizJgProjectContraption projectContraption = jgProjectContraptionService.getBaseMapper().selectById(projectContraptionSeq);
Map<String, Object> re = new HashMap<>(); Map<String, Object> re = new HashMap<>();
List<Map<String, Object>> equList = this.getBaseMapper().selectPieLineListByProjectId(projectContraptionSeq); List<Map<String, Object>> equList = this.getBaseMapper().selectPieLineListByProjectId(projectContraptionSeq);
// 检验报告数据格式化 转json
equList.stream().filter(e-> e.get("inspectReport") != null).forEach(item->{
item.put("inspectReport", JSON.parse(item.get("inspectReport").toString()));
});
re.put("equipmentLists", equList); re.put("equipmentLists", equList);
re.put("projectContraption", projectContraption.getProjectContraption()); re.put("projectContraption", projectContraption.getProjectContraption());
re.put("projectContraptionId", projectContraptionSeq); re.put("projectContraptionId", projectContraptionSeq);
......
...@@ -91,7 +91,10 @@ public class UseRegisterUpdateService { ...@@ -91,7 +91,10 @@ public class UseRegisterUpdateService {
jsonObject.put("pipelineLength", projectContraption.getPipelineLength()); jsonObject.put("pipelineLength", projectContraption.getPipelineLength());
jsonObject.put("projectContraption",projectContraption.getProjectContraption()); jsonObject.put("projectContraption",projectContraption.getProjectContraption());
jsonObject.put("projectContraptionNo", projectContraption.getProjectContraptionNo()); jsonObject.put("projectContraptionNo", projectContraption.getProjectContraptionNo());
jsonObject.put("equipmentLists", useRegistrationService.getBaseMapper().queryForUnitPipelineEquipment(records)); List<Map<String, Object>> equList = useRegistrationService.getBaseMapper().queryForUnitPipelineEquipment(records);
// 检验报告数据格式化 转json
equList.stream().filter(e-> e.get("inspectReport") != null).forEach(item-> item.put("inspectReport", JSON.parse(item.get("inspectReport").toString())));
jsonObject.put("equipmentLists", equList);
} }
} }
jsonObject.put("useRegistrationCode", jgUseRegistration.getUseRegistrationCode()); jsonObject.put("useRegistrationCode", jgUseRegistration.getUseRegistrationCode());
......
...@@ -132,6 +132,8 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -132,6 +132,8 @@ public class TzBaseEnterpriseInfoServiceImpl
COMPANY_TYPE_CERT_TYPE_MAP.put("检验检测机构", "1233-1,1233-2"); COMPANY_TYPE_CERT_TYPE_MAP.put("检验检测机构", "1233-1,1233-2");
// 安装改造维修单位身份资质:充装单位-1231 制造单位-1236 设计单位-1235 安装改造维修单位-1234 // 安装改造维修单位身份资质:充装单位-1231 制造单位-1236 设计单位-1235 安装改造维修单位-1234
COMPANY_TYPE_CERT_TYPE_MAP.put("安装改造维修单位", "1231,1234,1235,1236"); COMPANY_TYPE_CERT_TYPE_MAP.put("安装改造维修单位", "1231,1234,1235,1236");
// 充装单位
COMPANY_TYPE_CERT_TYPE_MAP.put("充装单位", "1202");
} }
/** /**
...@@ -729,15 +731,16 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -729,15 +731,16 @@ public class TzBaseEnterpriseInfoServiceImpl
} }
private void removeLicenceDataBeforeSave(ReginParams reginParams, TzBaseEnterpriseInfo tzBaseEnterpriseInfo) { private void removeLicenceDataBeforeSave(ReginParams reginParams, TzBaseEnterpriseInfo tzBaseEnterpriseInfo) {
if (tzBaseEnterpriseInfo == null) return;
String companyType = reginParams.getCompany().getCompanyType(); 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<>(); LambdaQueryWrapper<BaseUnitLicence> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BaseUnitLicence::getUnitCode,tzBaseEnterpriseInfo.getUseCode()); wrapper.eq(BaseUnitLicence::getUnitCode, useCode);
wrapper.and(w-> { wrapper.and(w -> Arrays.stream(certTypeCodes.split(","))
String[] certTypeCodeArray = COMPANY_TYPE_CERT_TYPE_MAP.get(companyType).split(","); .forEach(certTypeCode -> w.or().likeRight(BaseUnitLicence::getCertTypeCode, certTypeCode)));
for(String certTypeCode: certTypeCodeArray){
w.or().likeRight(BaseUnitLicence::getCertTypeCode, certTypeCode);
}
});
baseUnitLicenceService.remove(wrapper); baseUnitLicenceService.remove(wrapper);
} }
......
...@@ -551,17 +551,6 @@ ...@@ -551,17 +551,6 @@
AND a.is_delete = 0 AND a.is_delete = 0
AND ( a.notice_status != '6617') AND ( a.notice_status != '6617')
GROUP BY c.project_contraption_id 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 ) GROUP BY project_contraption_id
</select> </select>
</mapper> </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