Commit 49ae2857 authored by 刘林's avatar 刘林

fix(Statistics):企业管理列表接口修改

parent 0ddc9f1f
......@@ -301,4 +301,7 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
@ApiModelProperty(value = "企业标签信息")
private String regulatoryLabels;
@ApiModelProperty(value = "单位所在城市Code")
private String cityCode;
}
......@@ -40,6 +40,7 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
*/
TzBaseEnterpriseInfo selectByUseUnit(String useUnit);
String getOrgCodeByCompanyCode(String companyCode);
IPage<TzBaseEnterpriseInfoDto> page(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto);
......
......@@ -155,4 +155,8 @@
select * from tz_base_enterprise_info where use_unit = #{useUnit}
</select>
<select id="getOrgCodeByCompanyCode" resultType="java.lang.String">
select org_code from privilege_company where company_code = #{companyCode} limit 1
</select>
</mapper>
......@@ -38,12 +38,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.ParseException;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
/**
......@@ -90,6 +89,8 @@ public class TzBaseEnterpriseInfoServiceImpl
@Autowired
StartPlatformTokenService platformTokenService;
private static final Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
/**
* 企业管理员变更缓存key前缀
*/
......@@ -122,10 +123,23 @@ public class TzBaseEnterpriseInfoServiceImpl
}
}
}
if (tzBaseEnterpriseInfoDto.getCityCode() != null){
orgCodeList.add(this.getAndSetOrgCode(tzBaseEnterpriseInfoDto.getCityCode()));
}
return this.baseMapper.pageList(page, tzBaseEnterpriseInfoDto, orgCodeList);
}
public String getAndSetOrgCode(String cityCode) {
String orgCode = regionCodeOrgCodeMap.get(cityCode);
if (orgCode == null) {
orgCode = this.baseMapper.getOrgCodeByCompanyCode(cityCode);
if (orgCode != null) {
regionCodeOrgCodeMap.put(cityCode, orgCode);
}
}
return orgCode;
}
@Override
public TzBaseEnterpriseInfoDto detail(Long id) {
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = new TzBaseEnterpriseInfoDto();
......
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