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
3b4c2681
Commit
3b4c2681
authored
Jul 11, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.接口性能优化
parent
4859c968
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
12 deletions
+62
-12
DPStatisticsController.java
...boot/module/jg/biz/controller/DPStatisticsController.java
+4
-4
DPStatisticsServiceImpl.java
...t/module/jg/biz/service/impl/DPStatisticsServiceImpl.java
+43
-6
DPStatisticsController.java
...ot/module/jyjc/biz/controller/DPStatisticsController.java
+2
-2
TzBaseEnterpriseInfoMapper.java
...oot/module/ymt/api/mapper/TzBaseEnterpriseInfoMapper.java
+4
-0
TzBaseEnterpriseInfoMapper.xml
.../src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
+9
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/DPStatisticsController.java
View file @
3b4c2681
...
...
@@ -39,7 +39,7 @@ public class DPStatisticsController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏总览
右侧-
使用登记统计"
,
notes
=
"大屏总览右侧-使用登记统计"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏总览
-右侧
使用登记统计"
,
notes
=
"大屏总览右侧-使用登记统计"
)
@PostMapping
(
value
=
"/useRegister/count/byEquList"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
useRegisterCountByEquList
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
...
...
@@ -50,7 +50,7 @@ public class DPStatisticsController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏总览
中间-
地图左右两侧8大类、单位、人员数量全局统计"
,
notes
=
"大屏总览中间-地图左右两侧8大类、单位、人员数量全局统计"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏总览
-中间
地图左右两侧8大类、单位、人员数量全局统计"
,
notes
=
"大屏总览中间-地图左右两侧8大类、单位、人员数量全局统计"
)
@PostMapping
(
value
=
"/zl/center-map/legend"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
centerMapCountForGlobal
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
...
...
@@ -61,7 +61,7 @@ public class DPStatisticsController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏总览
中间-
地图地市统计"
,
notes
=
"大屏总览中间-地图地市统计"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏总览
-中间
地图地市统计"
,
notes
=
"大屏总览中间-地图地市统计"
)
@PostMapping
(
value
=
"/zl/center-map/overview"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
centerMapCountForOverview
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
...
...
@@ -72,7 +72,7 @@ public class DPStatisticsController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏
八大类左侧-
使用登记统计"
,
notes
=
"大屏八大类左侧-使用登记统计"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏
8大类-左侧气瓶
使用登记统计"
,
notes
=
"大屏八大类左侧-使用登记统计"
)
@PostMapping
(
value
=
"/useRegisterCount"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
useRegisterCount
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
...
...
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 @
3b4c2681
...
...
@@ -211,6 +211,7 @@ public class DPStatisticsServiceImpl {
}
}
public
Map
<
String
,
Object
>
getCenterMapCountDataForGlobal
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
// 1.气瓶数量统计
...
...
@@ -226,6 +227,19 @@ public class DPStatisticsServiceImpl {
return
result
;
}
public
Map
<
String
,
Object
>
getCenterMapOverviewData
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
// 1.气瓶数量统计
long
cylinderNum
=
this
.
staticsCenterMapCountDataForCylinder
(
result
,
dpFilterParamDto
);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
this
.
staticsCenterMapCountDataForEquip
(
result
,
dpFilterParamDto
,
cylinderNum
);
//2.压力管道长度统计
this
.
staticsCenterMapCountDataForPipeline
(
result
,
dpFilterParamDto
);
//3.人员数量统计
this
.
staticsCenterMapCountDataForPerson
(
result
,
dpFilterParamDto
);
return
result
;
}
private
void
staticsCenterMapCountDataForPerson
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
)
{
// 效率太慢暂时注释掉
String
orgCode
=
regionCodeOrgCodeMap
.
get
(
dpFilterParamDto
.
getCityCode
());
...
...
@@ -246,10 +260,7 @@ public class DPStatisticsServiceImpl {
if
(
orgCode
==
null
)
{
orgCode
=
commonMapper
.
getOrgCodeByCompanyCode
(
dpFilterParamDto
.
getCityCode
());
if
(
orgCode
==
null
)
{
result
.
put
(
DPMapStatisticsItemEnum
.
USERS_UNITS
.
getCode
(),
0
);
result
.
put
(
DPMapStatisticsItemEnum
.
CONSTRUCTION_UNITS
.
getCode
(),
0
);
result
.
put
(
DPMapStatisticsItemEnum
.
MANUFACTURING_UNITS
.
getCode
(),
0
);;
result
.
put
(
DPMapStatisticsItemEnum
.
GAS_UNITS
.
getCode
(),
0
);
setDefaultCompanyCountData
(
result
);
return
;
}
regionCodeOrgCodeMap
.
put
(
dpFilterParamDto
.
getCityCode
(),
orgCode
);
...
...
@@ -368,16 +379,42 @@ public class DPStatisticsServiceImpl {
}
public
List
<
Map
<
String
,
Object
>>
getCenterMapCountDataForOverview
(
DPFilterParamDto
dpFilterParamDto
)
{
return
regionModels
.
parallelStream
().
filter
(
e
->
e
.
getParentRegionCode
()
!=
null
&&
(
e
.
getParentRegionCode
().
toString
()).
equals
(
dpFilterParamDto
.
getCityCode
())).
map
(
r
->
{
List
<
Map
<
String
,
Object
>>
result
=
regionModels
.
parallelStream
().
filter
(
e
->
e
.
getParentRegionCode
()
!=
null
&&
(
e
.
getParentRegionCode
().
toString
()).
equals
(
dpFilterParamDto
.
getCityCode
())).
map
(
r
->
{
DPFilterParamDto
filterParamDto
=
new
DPFilterParamDto
();
filterParamDto
.
setCityCode
(
r
.
getRegionCode
().
toString
());
Map
<
String
,
Object
>
itemResult
=
getCenterMap
CountDataForGlobal
(
filterParamDto
);
Map
<
String
,
Object
>
itemResult
=
getCenterMap
OverviewData
(
filterParamDto
);
if
(
itemResult
==
null
)
{
itemResult
=
new
HashMap
<>();
}
itemResult
.
put
(
"cityCode"
,
r
.
getRegionCode
());
return
itemResult
;
}).
collect
(
Collectors
.
toList
());
this
.
setCompanyDataBatch
(
result
);
return
result
;
}
private
void
setCompanyDataBatch
(
List
<
Map
<
String
,
Object
>>
result
)
{
List
<
CountDto
>
countDtos
=
enterpriseInfoMapper
.
countByUnitTypeAndOrgCodeNoParam
();
result
.
forEach
(
m
->
{
String
cityCode
=
m
.
get
(
"cityCode"
).
toString
();
String
orgCode
=
regionCodeOrgCodeMap
.
get
(
cityCode
);
if
(
orgCode
!=
null
)
{
m
.
put
(
DPMapStatisticsItemEnum
.
USERS_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_USE
)
&&
c
.
getLabel
().
contains
(
orgCode
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
m
.
put
(
DPMapStatisticsItemEnum
.
CONSTRUCTION_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_MAINTENANCE
)
&&
c
.
getLabel
().
contains
(
orgCode
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
m
.
put
(
DPMapStatisticsItemEnum
.
MANUFACTURING_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_MANUFACTURE
)
&&
c
.
getLabel
().
contains
(
orgCode
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
m
.
put
(
DPMapStatisticsItemEnum
.
GAS_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_FILLING
)
&&
c
.
getLabel
().
contains
(
orgCode
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
}
else
{
setDefaultCompanyCountData
(
m
);
}
});
}
private
void
setDefaultCompanyCountData
(
Map
<
String
,
Object
>
m
)
{
m
.
put
(
DPMapStatisticsItemEnum
.
USERS_UNITS
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
CONSTRUCTION_UNITS
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
MANUFACTURING_UNITS
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
GAS_UNITS
.
getCode
(),
0
);
}
private
void
initReginCode
()
{
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/controller/DPStatisticsController.java
View file @
3b4c2681
...
...
@@ -38,7 +38,7 @@ public class DPStatisticsController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"检验检测次数统计"
,
notes
=
"按照维度设备种类、检验类型进行统计"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"
大屏总览-右侧
检验检测次数统计"
,
notes
=
"按照维度设备种类、检验类型进行统计"
)
@PostMapping
(
value
=
"/inspectTime/count/byEquListAndInspectType"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
inspectTimeCountByTypeAndEquList
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
...
...
@@ -49,7 +49,7 @@ public class DPStatisticsController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"气瓶检验检测次数统计"
,
notes
=
"气瓶检验检测次数统计"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"
大屏8大类-
气瓶检验检测次数统计"
,
notes
=
"气瓶检验检测次数统计"
)
@PostMapping
(
value
=
"/inspectTimeCount"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
inspectTimeCount
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
...
...
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 @
3b4c2681
...
...
@@ -67,4 +67,8 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
TzBaseEnterpriseInfo
selectBySeq
(
Long
sequenceNbr
);
List
<
CountDto
>
countByUnitTypeAndOrgCode
(
@Param
(
"orgCode"
)
String
orgCode
);
List
<
CountDto
>
countByUnitTypeAndOrgCodeNoParam
();
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
View file @
3b4c2681
...
...
@@ -206,4 +206,13 @@
a.supervise_org_code like concat(#{orgCode},'%')
group by a.unit_type
</select>
<select
id=
"countByUnitTypeAndOrgCodeNoParam"
resultType=
"com.yeejoin.amos.boot.biz.common.dto.CountDto"
>
SELECT
count(1) as intValue,
a.unit_type as keyStr,
a.supervise_org_code as label
FROM
"tz_base_enterprise_info" a
group by a.unit_type,a.supervise_org_code
</select>
</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