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

fix(jg):单位查询时将个人主体当作使用单位;个人添加设备过滤失败问题

parent 2a0eb86e
......@@ -2,12 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper">
<select id="getUnitListByType" resultType="java.util.Map">
SELECT use_code useCode,
SELECT use_unit_code useCode,
use_unit useUnit
FROM tz_base_enterprise_info
WHERE is_delete = '0'
<if test="type != null and type != 'all'">
and unit_type LIKE CONCAT('%', #{type}, '%')
<choose>
<when test="type == '使用单位'">
and ( unit_type = '个人主体' OR unit_type LIKE CONCAT('%', #{type}, '%') )
</when>
<otherwise>
and unit_type LIKE CONCAT('%', #{type}, '%')
</otherwise>
</choose>
</if>
</select>
......
......@@ -139,7 +139,7 @@
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = re.equ_id
LEFT JOIN idx_biz_jg_inspection_detection_info idi ON idi.record = re.equ_id
LEFT JOIN idx_biz_jg_use_info ui ON ui.record = re.equ_id
LEFT JOIN tz_base_enterprise_info useUnit ON useUnit.use_code = isn.use_unit_credit_code
LEFT JOIN tz_base_enterprise_info useUnit ON useUnit.use_unit_code = isn.use_unit_credit_code
LEFT JOIN tz_base_enterprise_info installUnit ON installUnit.use_code = isn.install_unit_credit_code
LEFT JOIN amos_tzs_biz.tz_equipment_category tec ON ri."EQU_CATEGORY"::text = tec.code::text
LEFT JOIN amos_tzs_biz.tz_equipment_category tec1 ON ri."EQU_LIST"::text = tec1.code::text
......
......@@ -1113,6 +1113,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (!ValidationUtil.isEmpty(type) && type.contains("安装改造维修单位")) {
map.put("USC_UNIT_CREDIT_CODE", companyCode);
}
if (!ValidationUtil.isEmpty(type) && type.contains("个人主体")) {
map.put("USE_UNIT_CREDIT_CODE", companyCode);
}
}
// 默认条件【STATUS==="" || null】
......@@ -1379,7 +1382,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
useInfo.setDataSource("jg");
useInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("USEINFO_SEQ")));
if(companyTypeStr.contains(CompanyTypeEnum.USE.getCode())) {
if(companyTypeStr.contains(CompanyTypeEnum.USE.getCode()) || companyTypeStr.contains(CompanyTypeEnum.INDIVIDUAL.getCode())) {
useInfo.setUseUnitCreditCode(companyType.get("creditCode").toString());
useInfo.setUseUnitName(companyType.get("companyTypeName").toString());
}
......
......@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
......
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