Commit 883aafa8 authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into…

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into develop_tzs_register_to_0715
parents d3f1a9c6 27762a7b
...@@ -12,7 +12,7 @@ import lombok.Data; ...@@ -12,7 +12,7 @@ import lombok.Data;
public class CountDto { public class CountDto {
@ApiModelProperty(value = "数据标识") @ApiModelProperty(value = "数据标识")
private String key; private String keyStr;
@ApiModelProperty(value = "描述") @ApiModelProperty(value = "描述")
private String label; private String label;
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; 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;
...@@ -31,7 +32,6 @@ import org.elasticsearch.search.aggregations.bucket.terms.Terms; ...@@ -31,7 +32,6 @@ import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDate; import java.time.LocalDate;
...@@ -222,15 +222,12 @@ public class DPStatisticsServiceImpl { ...@@ -222,15 +222,12 @@ public class DPStatisticsServiceImpl {
//3.单位数量统计 //3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, dpFilterParamDto); this.staticsCenterMapCountDataForCompany(result, dpFilterParamDto);
//4.人员数量统计 //4.人员数量统计
StopWatch stopWatch5 = new StopWatch();
stopWatch5.start();
this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto); this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto);
stopWatch5.stop();
log.info("------人员查询>:{}", stopWatch5.getTotalTimeSeconds());
return result; return result;
} }
private void staticsCenterMapCountDataForPerson(Map<String, Object> result, DPFilterParamDto dpFilterParamDto) { private void staticsCenterMapCountDataForPerson(Map<String, Object> result, DPFilterParamDto dpFilterParamDto) {
// 效率太慢暂时注释掉
// String orgCode = regionCodeOrgCodeMap.get(dpFilterParamDto.getCityCode()); // String orgCode = regionCodeOrgCodeMap.get(dpFilterParamDto.getCityCode());
// if (orgCode == null) { // if (orgCode == null) {
// orgCode = commonMapper.getOrgCodeByCompanyCode(dpFilterParamDto.getCityCode()); // orgCode = commonMapper.getOrgCodeByCompanyCode(dpFilterParamDto.getCityCode());
...@@ -250,10 +247,11 @@ public class DPStatisticsServiceImpl { ...@@ -250,10 +247,11 @@ public class DPStatisticsServiceImpl {
} }
regionCodeOrgCodeMap.put(dpFilterParamDto.getCityCode(), orgCode); regionCodeOrgCodeMap.put(dpFilterParamDto.getCityCode(), orgCode);
} }
result.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode, COMPANY_TYPE_USE)); List<CountDto> countDtos = enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode);
result.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode, COMPANY_TYPE_MAINTENANCE)); result.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), countDtos.stream().filter(c->c.getKeyStr().contains(COMPANY_TYPE_USE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode, COMPANY_TYPE_MANUFACTURE)); result.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), countDtos.stream().filter(c->c.getKeyStr().contains(COMPANY_TYPE_MAINTENANCE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode, COMPANY_TYPE_FILLING)); result.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), countDtos.stream().filter(c->c.getKeyStr().contains(COMPANY_TYPE_MANUFACTURE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), countDtos.stream().filter(c->c.getKeyStr().contains(COMPANY_TYPE_FILLING)).mapToInt(CountDto::getIntValue).sum());
} }
private long staticsCenterMapCountDataForCylinder(Map<String, Object> result, DPFilterParamDto dpFilterParamDto) { private long staticsCenterMapCountDataForCylinder(Map<String, Object> result, DPFilterParamDto dpFilterParamDto) {
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquEnterDto; import com.yeejoin.amos.boot.module.ymt.api.dto.EquEnterDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto; import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
...@@ -65,5 +66,5 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI ...@@ -65,5 +66,5 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
*/ */
TzBaseEnterpriseInfo selectBySeq(Long sequenceNbr); TzBaseEnterpriseInfo selectBySeq(Long sequenceNbr);
Long countByUnitTypeAndOrgCode(@Param("orgCode") String orgCode,@Param("unitType") String unitType); List<CountDto> countByUnitTypeAndOrgCode(@Param("orgCode") String orgCode);
} }
...@@ -196,13 +196,14 @@ ...@@ -196,13 +196,14 @@
<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 id="countByUnitTypeAndOrgCode" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT SELECT
count(1) count(1) as intValue,
a.unit_type as keyStr
FROM FROM
"tz_base_enterprise_info" a "tz_base_enterprise_info" a
where where
a.supervise_org_code like concat(#{orgCode},'%') a.supervise_org_code like concat(#{orgCode},'%')
and a.unit_type like concat('%', #{unitType},'%') group by a.unit_type
</select> </select>
</mapper> </mapper>
#DB properties: #DB properties:
spring.datasource.url=jdbc:vastbase://36.46.137.116:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true spring.datasource.url=jdbc:vastbase://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true
#spring.datasource.url=jdbc:vastbase://36.46.151.113:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz
spring.datasource.username=admin spring.datasource.username=admin
spring.datasource.password=Yeejoin@2023 spring.datasource.password=Yeejoin@2023
eureka.client.service-url.defaultZone=http://172.16.10.210:10001/eureka/ eureka.client.service-url.defaultZone=http://172.16.10.243:10001/eureka/
eureka.instance.prefer-ip-address=true eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/health eureka.instance.health-check-url=http://172.16.3.68:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/info eureka.instance.status-page-url=http://172.16.3.68:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.17:${server.port}${server.servlet.context-path}/doc.html eureka.instance.metadata-map.management.api-docs=http://172.16.3.68:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.17 eureka.instance.ip-address=172.16.3.68
## ES properties: ## ES properties:
elasticsearch.username=elastic elasticsearch.username=elastic
elasticsearch.password=a123456 elasticsearch.password=a123456
spring.elasticsearch.rest.uris=http://172.16.10.210:9200 spring.elasticsearch.rest.uris=http://172.16.10.243:9200
## unit(h) ## unit(h)
alertcall.es.synchrony.time=48 alertcall.es.synchrony.time=48
#redis properties: #redis properties:
spring.redis.mode=singleton
spring.redis.database=1 spring.redis.database=1
spring.redis.host=172.16.10.210 spring.redis.host=172.16.10.243
spring.redis.port=16379 spring.redis.port=6379
spring.redis.password=yeejoin@2020 spring.redis.password=yeejoin@2020
spring.redis.lettuce.pool.max-active=200 spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1 spring.redis.lettuce.pool.max-wait=-1
...@@ -32,7 +30,7 @@ spring.redis.lettuce.pool.min-idle=0 ...@@ -32,7 +30,7 @@ spring.redis.lettuce.pool.min-idle=0
## emqx properties: ## emqx properties:
emqx.clean-session=true emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]} emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://36.46.151.113:1883 emqx.broker=tcp://172.16.10.243:2883
emqx.client-user-name=super emqx.client-user-name=super
emqx.client-password=123456 emqx.client-password=123456
emqx.keepAliveInterval=1000 emqx.keepAliveInterval=1000
......
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