Commit a3fcbbac authored by suhuiguang's avatar suhuiguang

1.大屏地图图列统计接口开发

parent 8d669ef2
...@@ -5,12 +5,15 @@ import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; ...@@ -5,12 +5,15 @@ import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.dto.LegendDataDto; import com.yeejoin.amos.boot.module.common.api.dto.LegendDataDto;
import com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto; import com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto;
import com.yeejoin.amos.boot.module.jg.api.enums.DPMapStatisticsItemEnum; import com.yeejoin.amos.boot.module.jg.api.enums.DPMapStatisticsItemEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto; import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipTechParamPipelineMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipTechParamPipelineMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
...@@ -33,6 +36,7 @@ import java.util.ArrayList; ...@@ -33,6 +36,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -54,6 +58,27 @@ public class DPStatisticsServiceImpl { ...@@ -54,6 +58,27 @@ public class DPStatisticsServiceImpl {
*/ */
private final static String EQU_CATEGORY_CYLINDER = "2300"; private final static String EQU_CATEGORY_CYLINDER = "2300";
/**
* 单位类型-使用单位
*/
private final static String COMPANY_TYPE_USE = "使用单位";
/**
* 单位类型-安装改造维修单位
*/
private final static String COMPANY_TYPE_MAINTENANCE = "安装改造维修单位";
/**
* 单位类型-制造单位
*/
private final static String COMPANY_TYPE_MANUFACTURE = "制造单位";
/**
* 单位类型-充装单位
*/
private final static String COMPANY_TYPE_FILLING = "充装单位";
private EquipmentCategoryMapper equipmentCategoryMapper; private EquipmentCategoryMapper equipmentCategoryMapper;
private JgUseRegistrationMapper useRegistrationMapper; private JgUseRegistrationMapper useRegistrationMapper;
...@@ -66,16 +91,27 @@ public class DPStatisticsServiceImpl { ...@@ -66,16 +91,27 @@ public class DPStatisticsServiceImpl {
private RestHighLevelClient restHighLevelClient; private RestHighLevelClient restHighLevelClient;
private TzBaseEnterpriseInfoMapper enterpriseInfoMapper;
private CommonMapper commonMapper;
private static List<EquipmentCategoryDto> equipmentCategoryDtos; private static List<EquipmentCategoryDto> equipmentCategoryDtos;
private TzsUserInfoMapper userInfoMapper;
public DPStatisticsServiceImpl(EquipmentCategoryMapper equipmentCategoryMapper, JgUseRegistrationMapper useRegistrationMapper, EquipTechParamPipelineMapper techParamsPipelineMapper, JgEnableDisableMapper enableDisableMapper, JgScrapCancelMapper scrapCancelMapper, RestHighLevelClient restHighLevelClient) { private static Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
public DPStatisticsServiceImpl(EquipmentCategoryMapper equipmentCategoryMapper, JgUseRegistrationMapper useRegistrationMapper, EquipTechParamPipelineMapper techParamsPipelineMapper, JgEnableDisableMapper enableDisableMapper, JgScrapCancelMapper scrapCancelMapper, RestHighLevelClient restHighLevelClient, TzBaseEnterpriseInfoMapper enterpriseInfoMapper, CommonMapper commonMapper, TzsUserInfoMapper userInfoMapper) {
this.equipmentCategoryMapper = equipmentCategoryMapper; this.equipmentCategoryMapper = equipmentCategoryMapper;
this.useRegistrationMapper = useRegistrationMapper; this.useRegistrationMapper = useRegistrationMapper;
this.techParamsPipelineMapper = techParamsPipelineMapper; this.techParamsPipelineMapper = techParamsPipelineMapper;
this.enableDisableMapper = enableDisableMapper; this.enableDisableMapper = enableDisableMapper;
this.scrapCancelMapper = scrapCancelMapper; this.scrapCancelMapper = scrapCancelMapper;
this.restHighLevelClient = restHighLevelClient; this.restHighLevelClient = restHighLevelClient;
this.enterpriseInfoMapper = enterpriseInfoMapper;
this.commonMapper = commonMapper;
this.userInfoMapper = userInfoMapper;
} }
@PostConstruct @PostConstruct
...@@ -182,13 +218,23 @@ public class DPStatisticsServiceImpl { ...@@ -182,13 +218,23 @@ public class DPStatisticsServiceImpl {
this.staticsCenterMapCountDataForCompany(result, dpFilterParamDto); this.staticsCenterMapCountDataForCompany(result, dpFilterParamDto);
//4.人员数量统计 //4.人员数量统计
this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto); this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto);
return null; return result;
} }
private void staticsCenterMapCountDataForPerson(Map<String, Object> result, DPFilterParamDto dpFilterParamDto) { private void staticsCenterMapCountDataForPerson(Map<String, Object> result, DPFilterParamDto dpFilterParamDto) {
Long num = userInfoMapper.countUserByPostAndAreaCode(dpFilterParamDto.getCityCode(), "6552");
} }
private void staticsCenterMapCountDataForCompany(Map<String, Object> result, DPFilterParamDto dpFilterParamDto) { private void staticsCenterMapCountDataForCompany(Map<String, Object> result, DPFilterParamDto dpFilterParamDto) {
String orgCode = regionCodeOrgCodeMap.get(dpFilterParamDto.getCityCode());
if (orgCode == null) {
orgCode = commonMapper.getOrgCodeByCompanyCode(dpFilterParamDto.getCityCode());
regionCodeOrgCodeMap.put(dpFilterParamDto.getCityCode(), orgCode);
}
result.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode, COMPANY_TYPE_USE));
result.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode, COMPANY_TYPE_MAINTENANCE));
result.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode, COMPANY_TYPE_MANUFACTURE));
result.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode, COMPANY_TYPE_FILLING));
} }
private long staticsCenterMapCountDataForCylinder(Map<String, Object> result, DPFilterParamDto dpFilterParamDto) { private long staticsCenterMapCountDataForCylinder(Map<String, Object> result, DPFilterParamDto dpFilterParamDto) {
......
...@@ -64,4 +64,6 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI ...@@ -64,4 +64,6 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
* @author yangyang * @author yangyang
*/ */
TzBaseEnterpriseInfo selectBySeq(Long sequenceNbr); TzBaseEnterpriseInfo selectBySeq(Long sequenceNbr);
Long countByUnitTypeAndOrgCode(@Param("orgCode") String orgCode,@Param("unitType") String unitType);
} }
...@@ -11,4 +11,6 @@ import java.util.Set; ...@@ -11,4 +11,6 @@ import java.util.Set;
public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> { public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
Page<TzsUserInfoDto> selectPageMessage(@Param("page") Page<TzsUserInfoDto> page, @Param("dto") TzsUserInfoDto dto); Page<TzsUserInfoDto> selectPageMessage(@Param("page") Page<TzsUserInfoDto> page, @Param("dto") TzsUserInfoDto dto);
Long countUserByPostAndAreaCode(@Param("areaCode") String areaCode, @Param("post") String post);
} }
...@@ -196,4 +196,13 @@ ...@@ -196,4 +196,13 @@
<select id="selectBySeq" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo"> <select id="selectBySeq" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo">
select * from tz_base_enterprise_info where sequence_nbr = #{sequenceNbr} select * from tz_base_enterprise_info where sequence_nbr = #{sequenceNbr}
</select> </select>
<select id="countByUnitTypeAndOrgCode" resultType="java.lang.Long">
SELECT
count(1)
FROM
"tz_base_enterprise_info" a
where
a.supervise_org_code like concat(#{orgCode},'%')
and a.unit_type like concat('%', #{unitType},'%')
</select>
</mapper> </mapper>
...@@ -48,4 +48,16 @@ ...@@ -48,4 +48,16 @@
</where> </where>
order by rec_date order by rec_date
</select> </select>
<select id="countUserByPostAndAreaCode" resultType="java.lang.Long">
SELECT
count(1)
FROM
tzs_user_info tui,
tz_base_enterprise_info bi
WHERE
tui.unit_code = bi.use_code
and tui.post LIKE concat ( '%', #{post}, '%' )
and bi.supervise_org_code LIKE CONCAT ( #{areaCode}}, '%' )
and tui.is_delete=false
</select>
</mapper> </mapper>
\ No newline at end of file
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