Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
67d3f1ae
Commit
67d3f1ae
authored
Jul 11, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.大屏地图图列统计接口开发空指针处理
parent
8909826c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
CountDto.java
...n/java/com/yeejoin/amos/boot/biz/common/dto/CountDto.java
+1
-1
DPStatisticsServiceImpl.java
...t/module/jg/biz/service/impl/DPStatisticsServiceImpl.java
+7
-9
TzBaseEnterpriseInfoMapper.java
...oot/module/ymt/api/mapper/TzBaseEnterpriseInfoMapper.java
+2
-1
TzBaseEnterpriseInfoMapper.xml
.../src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
+4
-3
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/dto/CountDto.java
View file @
67d3f1ae
...
@@ -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
key
Str
;
@ApiModelProperty
(
value
=
"描述"
)
@ApiModelProperty
(
value
=
"描述"
)
private
String
label
;
private
String
label
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/DPStatisticsServiceImpl.java
View file @
67d3f1ae
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
)
{
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/TzBaseEnterpriseInfoMapper.java
View file @
67d3f1ae
...
@@ -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
);
L
ong
countByUnitTypeAndOrgCode
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"unitType"
)
String
unitTyp
e
);
L
ist
<
CountDto
>
countByUnitTypeAndOrgCode
(
@Param
(
"orgCode"
)
String
orgCod
e
);
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
View file @
67d3f1ae
...
@@ -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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment