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

需求:35094 第六项

parent fcaec8e8
...@@ -135,6 +135,8 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -135,6 +135,8 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
*/ */
Integer useRegistrationCertificateAccountUnique(@Param("useRegistrationCode") String useRegistrationCode,@Param("equipId") String equipId); Integer useRegistrationCertificateAccountUnique(@Param("useRegistrationCode") String useRegistrationCode,@Param("equipId") String equipId);
String isRegistrationNumberUsedByOtherUnits(@Param("useRegistrationCode") String useRegistrationCode, @Param("companyCode") String companyCode);
/** /**
* 查询维保超期的设备 * 查询维保超期的设备
* */ * */
......
...@@ -979,6 +979,22 @@ ...@@ -979,6 +979,22 @@
</where> </where>
</select> </select>
<select id="isRegistrationNumberUsedByOtherUnits" resultType="java.lang.String">
SELECT jui."USE_UNIT_NAME"
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="companyCode != null and companyCode != ''">
AND jui."USE_UNIT_CREDIT_CODE" <![CDATA[ <> ]]> #{companyCode}
</if>
AND joi.CLAIM_STATUS = '已认领'
</where>
</select>
<select id="queryOutOfMaintenanceRecord" resultType="java.util.Map"> <select id="queryOutOfMaintenanceRecord" resultType="java.util.Map">
SELECT SELECT
tt."RECORD", tt."RECORD",
......
...@@ -245,6 +245,14 @@ public interface ICommonService { ...@@ -245,6 +245,14 @@ public interface ICommonService {
*/ */
Boolean useRegistrationCertificateAccountUnique(String useRegistrationCode, String equipId); Boolean useRegistrationCertificateAccountUnique(String useRegistrationCode, String equipId);
/**
* 判断使用登记证编号是否被其他单位使用
*
* @param useRegistrationCode
* @return 占用的使用单位名称
*/
String isRegistrationNumberUsedByOtherUnits(String useRegistrationCode);
List<EquipmentCategoryDto> equipmentClassificationNoPipeline(String type); List<EquipmentCategoryDto> equipmentClassificationNoPipeline(String type);
List<EquipmentCategoryDto> equipmentClassificationNoPipelineByParentCode(String type, String parentCode); List<EquipmentCategoryDto> equipmentClassificationNoPipelineByParentCode(String type, String parentCode);
......
...@@ -2755,4 +2755,15 @@ public List<EquipmentClassifyDto> getEquClassifyByCode(String parentCode) { ...@@ -2755,4 +2755,15 @@ public List<EquipmentClassifyDto> getEquClassifyByCode(String parentCode) {
} }
return false; return false;
} }
/**
* 判断使用登记证编号是否被其他单位使用
*
* @param useRegistrationCode 使用登记证编号
* @return
*/
public String isRegistrationNumberUsedByOtherUnits(String useRegistrationCode) {
String companyCode = getSelectedOrgInfo().getCompany().getCompanyCode();
return commonMapper.isRegistrationNumberUsedByOtherUnits(useRegistrationCode, companyCode);
}
} }
\ No newline at end of file
...@@ -780,6 +780,16 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -780,6 +780,16 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 校验使用登记证编号的唯一性 // 校验使用登记证编号的唯一性
if (!CylinderTypeEnum.CYLINDER.getCode().equals(equipmentInfoForm.get("EQU_CATEGORY")) && commonService.useRegistrationCertificateAccountUnique(useRegistrationCode, equipId)) { if (!CylinderTypeEnum.CYLINDER.getCode().equals(equipmentInfoForm.get("EQU_CATEGORY")) && commonService.useRegistrationCertificateAccountUnique(useRegistrationCode, equipId)) {
throw new BadRequest("使用登记证编号已存在!"); throw new BadRequest("使用登记证编号已存在!");
} else {
if (CylinderTypeEnum.CYLINDER.getCode().equals(equipmentInfoForm.get("EQU_CATEGORY"))) {
// 需求 35094 历史设备(有使用登记证)需按证录入。录入时先录入使用登记证编号。
// 需验证录入的使用登记证编号平台是否跟当前用户(使用单位类型)一致,如跟当前用户不一致,系统给出提示“该使用登记证编号”已被“单位名称“使用”,请确认后再录入”。
// 历史设备不限制使用登记证编号在一个单位重复录入,但需验证使用登记证编号+单位内编号唯一。(下面方法checkFactoryNumUniqueWithGasCylinder中已经校验)
String occupiedUseUnitName = commonService.isRegistrationNumberUsedByOtherUnits(useRegistrationCode);
if (!ValidationUtil.isEmpty(occupiedUseUnitName)) {
throw new BadRequest("该使用登记证编号已被【" + occupiedUseUnitName + "】使用,请确认后再录入!");
}
}
} }
String regType = Optional.ofNullable(equipmentInfoForm.get("EQU_LIST")) String regType = Optional.ofNullable(equipmentInfoForm.get("EQU_LIST"))
.filter(code -> CylinderTypeEnum.CYLINDER.getCode().equals(code)) .filter(code -> CylinderTypeEnum.CYLINDER.getCode().equals(code))
......
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