Commit c7c3ad9c authored by tianyiming's avatar tianyiming

fix(tcm): 企业查询列表officeRegion查询

parent 40a95b1a
...@@ -320,6 +320,9 @@ public class TzBaseEnterpriseInfoDto extends BaseDto { ...@@ -320,6 +320,9 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
@ApiModelProperty(value = "省内办公地址省#市#区") @ApiModelProperty(value = "省内办公地址省#市#区")
private List<Integer> officeRegion; private List<Integer> officeRegion;
@ApiModelProperty(value = "省内办公地址省#市#区")
private String officeRegionStr;
@ApiModelProperty(value = "省内详细办公地址") @ApiModelProperty(value = "省内详细办公地址")
private String officeAddress; private String officeAddress;
......
...@@ -50,7 +50,7 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI ...@@ -50,7 +50,7 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
IPage<TzBaseEnterpriseInfoDto> page(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto); IPage<TzBaseEnterpriseInfoDto> page(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto);
IPage<TzBaseEnterpriseInfoDto> pageList(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto, List orgCodeList, @Param("sort") SortVo sortMap); IPage<TzBaseEnterpriseInfoDto> pageList(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto, String orgCode, @Param("sort") SortVo sortMap,String officeRegion);
/** /**
* 查询未生成二维码的企业 * 查询未生成二维码的企业
......
...@@ -107,6 +107,18 @@ ...@@ -107,6 +107,18 @@
<if test="tzBaseEnterpriseInfoDto.unitType!=null and tzBaseEnterpriseInfoDto.unitType!='' "> <if test="tzBaseEnterpriseInfoDto.unitType!=null and tzBaseEnterpriseInfoDto.unitType!='' ">
AND unit_type LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.unitType},'%') AND unit_type LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.unitType},'%')
</if> </if>
<choose>
<when test="( tzBaseEnterpriseInfoDto.unitType == '检验机构'
or tzBaseEnterpriseInfoDto.unitType == '检测机构'
or tzBaseEnterpriseInfoDto.unitType == ''
or tzBaseEnterpriseInfoDto.unitType == null ) and tzBaseEnterpriseInfoDto.orgCode!= '' ">
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%'))
or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{regionCode}, '%')))
</when>
<otherwise>
and supervise_org_code LIKE CONCAT(#{orgCode}, '%')
</otherwise>
</choose>
<if test="tzBaseEnterpriseInfoDto.unitTypeList != null and !tzBaseEnterpriseInfoDto.unitTypeList.isEmpty()"> <if test="tzBaseEnterpriseInfoDto.unitTypeList != null and !tzBaseEnterpriseInfoDto.unitTypeList.isEmpty()">
AND ( AND (
<foreach collection="tzBaseEnterpriseInfoDto.unitTypeList" item="unit" separator=" OR "> <foreach collection="tzBaseEnterpriseInfoDto.unitTypeList" item="unit" separator=" OR ">
...@@ -139,6 +151,18 @@ ...@@ -139,6 +151,18 @@
AND contact_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.contactPhone},'%') AND contact_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.contactPhone},'%')
</if> </if>
<if test="tzBaseEnterpriseInfoDto.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' "> <if test="tzBaseEnterpriseInfoDto.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' ">
<choose>
<when test="tzBaseEnterpriseInfoDto.unitType == '检验机构'
or tzBaseEnterpriseInfoDto.unitType == '检测机构'
or tzBaseEnterpriseInfoDto.unitType == ''
or tzBaseEnterpriseInfoDto.unitType == null">
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{tzBaseEnterpriseInfoDto.superviseOrgCode}, '%'))
or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{tzBaseEnterpriseInfoDto.OfficeRegionStr}, '%')))
</when>
<otherwise>
and supervise_org_code LIKE CONCAT(#{orgCode}, '%')
</otherwise>
</choose>
AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.superviseOrgCode},'%') AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.superviseOrgCode},'%')
</if> </if>
<if test="tzBaseEnterpriseInfoDto.address!=null and tzBaseEnterpriseInfoDto.address!='' "> <if test="tzBaseEnterpriseInfoDto.address!=null and tzBaseEnterpriseInfoDto.address!='' ">
......
...@@ -205,26 +205,36 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -205,26 +205,36 @@ public class TzBaseEnterpriseInfoServiceImpl
@Override @Override
public IPage<TzBaseEnterpriseInfoDto> page(PageParam pageParam, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto, String sort) { public IPage<TzBaseEnterpriseInfoDto> page(PageParam pageParam, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto, String sort) {
try { try {
List<String> orgCodeList = new ArrayList<>(); // List<String> orgCodeList = new ArrayList<>();
if (tzBaseEnterpriseInfoDto.getSuperviseKey() != null) { if (tzBaseEnterpriseInfoDto.getSuperviseKey() != null) {
FeignClientResult<CompanyModel> result = Privilege.companyClient FeignClientResult<CompanyModel> result = Privilege.companyClient
.seleteOne(Long.valueOf(tzBaseEnterpriseInfoDto.getSuperviseKey())); .seleteOne(Long.valueOf(tzBaseEnterpriseInfoDto.getSuperviseKey()));
if (result.getResult() != null) { if (result.getResult() != null) {
tzBaseEnterpriseInfoDto.setSuperviseOrgCode(result.getResult().getOrgCode()); tzBaseEnterpriseInfoDto.setSuperviseOrgCode(result.getResult().getOrgCode());
TzBaseEnterpriseInfo tzBaseEnterpriseInfo = this.baseMapper.selectOne(new QueryWrapper<TzBaseEnterpriseInfo>().lambda().eq(TzBaseEnterpriseInfo::getOrgCode, result.getResult().getOrgCode()));
tzBaseEnterpriseInfoDto.setOfficeRegionStr(tzBaseEnterpriseInfo.getOfficeRegion());
} }
} }
Page<TzBaseEnterpriseInfoDto> page = new Page<>(pageParam.getCurrent(), pageParam.getSize()); Page<TzBaseEnterpriseInfoDto> page = new Page<>(pageParam.getCurrent(), pageParam.getSize());
List<JSONObject> companyType1 = equipmentCategoryService.getCompanyType(); List<JSONObject> companyType1 = equipmentCategoryService.getCompanyType();
String orgCode = null;
String officeRegion = null;
if (!ValidationUtil.isEmpty(companyType1)) { if (!ValidationUtil.isEmpty(companyType1)) {
for (JSONObject jsonObject : companyType1) { JSONObject companyTypeJson = companyType1.get(0);
String orgCode = jsonObject.getString("orgCode"); orgCode = companyTypeJson.getString("orgCode");
if (!ValidationUtil.isEmpty(orgCode)) { TzBaseEnterpriseInfo tzBaseEnterpriseInfo = this.baseMapper.selectOne(new QueryWrapper<TzBaseEnterpriseInfo>().lambda().eq(TzBaseEnterpriseInfo::getOrgCode, orgCode));
orgCodeList.add(orgCode); if(!ObjectUtils.isEmpty(tzBaseEnterpriseInfo)) officeRegion = tzBaseEnterpriseInfo.getOfficeRegion();
}
}
} }
// if (!ValidationUtil.isEmpty(companyType1)) {
// for (JSONObject jsonObject : companyType1) {
// String orgCode = jsonObject.getString("orgCode");
// if (!ValidationUtil.isEmpty(orgCode)) {
// orgCodeList.add(orgCode);
// }
// }
// }
SortVo sortMap = userInfoService.sortFieldConversion(sort); SortVo sortMap = userInfoService.sortFieldConversion(sort);
return this.baseMapper.pageList(page, tzBaseEnterpriseInfoDto, orgCodeList, sortMap); return this.baseMapper.pageList(page, tzBaseEnterpriseInfoDto, orgCode, sortMap, officeRegion);
} catch (Exception ex) { } catch (Exception ex) {
String msg = ex.getMessage() == null ? "" : ex.getMessage(); String msg = ex.getMessage() == null ? "" : ex.getMessage();
if (msg.contains("eyibc decrypt error") if (msg.contains("eyibc decrypt error")
......
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