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
d6978261
Commit
d6978261
authored
Aug 16, 2024
by
麻笑宇
Browse files
Options
Browse Files
Download
Plain Diff
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
c8a1aa04
f91fb6ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
118 additions
and
3 deletions
+118
-3
DPFilterParamForDetailDto.java
...boot/module/common/api/dto/DPFilterParamForDetailDto.java
+10
-0
YJDPStatisticsController.java
...le/statistcs/biz/controller/YJDPStatisticsController.java
+36
-3
YJDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/YJDPStatisticsServiceImpl.java
+72
-0
No files found.
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/DPFilterParamForDetailDto.java
View file @
d6978261
...
...
@@ -59,6 +59,16 @@ public class DPFilterParamForDetailDto {
private
String
companyName
;
/**
* 维保单位名称
*/
private
String
maintenanceCompanyName
;
/**
* 地市名称
*/
private
String
regionName
;
/**
* 报警类型code
*/
private
String
typeCode
;
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/YJDPStatisticsController.java
View file @
d6978261
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.AlertUseUnitStatistics
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.impl.YJDPStatisticsServiceImpl
;
import
com.yeejoin.amos.boot.module.statistics.api.dto.AlertUseUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.AlertPaperInfoDto
;
...
...
@@ -20,9 +22,8 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 大屏统计controller
...
...
@@ -193,4 +194,36 @@ public class YJDPStatisticsController {
public
ResponseModel
<
IPage
<
Map
<
String
,
Object
>>>
alertRecordTableForDP
(
DPFilterParamForDetailDto
recordFilterVo
)
{
return
statisticsService
.
alertRecordTableForDP
(
recordFilterVo
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"月度困人故障高发使用单位-右上角更多-地市月度应急事件高发使用单位-侧边树"
,
notes
=
"月度困人故障高发使用单位-右上角更多-地市月度应急事件高发使用单位-侧边树"
)
@PostMapping
(
"/alertUnitOption/dp"
)
public
ResponseModel
<
Object
>
alertUnitOption
()
{
List
<
JSONObject
>
subList
=
Collections
.
singletonList
(
new
JSONObject
()
.
fluentPut
(
"value"
,
"use"
)
.
fluentPut
(
"title"
,
"使用单位"
));
JSONObject
jsonObject
=
new
JSONObject
()
.
fluentPut
(
"title"
,
"企业类型"
)
.
fluentPut
(
"value"
,
"all"
)
.
fluentPut
(
"children"
,
subList
);
return
ResponseHelper
.
buildResponse
(
jsonObject
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"月度困人故障高发使用单位-右上角更多-地市月度应急事件高发使用单位-柱状图"
,
notes
=
"月度困人故障高发使用单位-右上角更多-地市月度应急事件高发使用单位-柱状图"
)
@PostMapping
(
"/alertUnitBarChart/dp"
)
public
ResponseModel
<
JSONObject
>
alertUnitBarChartForDP
(
@Validated
@RequestBody
DPFilterParamForDetailDto
detailDto
)
{
return
statisticsService
.
alertUnitBarChartForDP
(
detailDto
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"月度困人故障高发使用单位-右上角更多-地市月度应急事件高发使用单位-表格"
,
notes
=
"月度困人故障高发使用单位-右上角更多-地市月度应急事件高发使用单位-表格"
)
@PostMapping
(
"/alertUseUnitTable/dp"
)
public
ResponseModel
<
IPage
<
AlertUseUnitStatistics
>>
alertUseUnitTableForDP
(
@Validated
@RequestBody
DPFilterParamForDetailDto
detailDto
)
{
return
statisticsService
.
alertUseUnitTableForDP
(
detailDto
);
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/YJDPStatisticsServiceImpl.java
View file @
d6978261
...
...
@@ -535,10 +535,82 @@ public class YJDPStatisticsServiceImpl {
public
ResponseModel
<
IPage
<
Map
<
String
,
Object
>>>
alertRecordTableForDP
(
DPFilterParamForDetailDto
recordFilterVo
)
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
recordFilterVo
.
getCityCode
());
if
(
orgCode
==
null
)
{
return
ResponseHelper
.
buildResponse
(
new
Page
<>());
}
if
(!
ValidationUtil
.
isEmpty
(
recordFilterVo
.
getTreeValue
())){
recordFilterVo
.
setAlertTypeCode
(
recordFilterVo
.
getTreeValue
());
}
Page
<
Map
<
String
,
Object
>>
mapPage
=
alertStatisticsMapper
.
alertRecordForPage
(
new
Page
<>(
recordFilterVo
.
getCurrent
(),
recordFilterVo
.
getSize
()),
recordFilterVo
,
orgCode
);
return
ResponseHelper
.
buildResponse
(
mapPage
);
}
public
ResponseModel
<
JSONObject
>
alertUnitBarChartForDP
(
DPFilterParamForDetailDto
detailDto
){
JSONObject
res
=
new
JSONObject
();
JSONArray
legendData
=
new
JSONArray
();
legendData
.
add
(
new
JSONObject
()
.
fluentPut
(
"dataKey"
,
"alertUnitTotal"
)
.
fluentPut
(
"value"
,
"故障高发企业总数"
)
.
fluentPut
(
"chartType"
,
"bar"
));
List
<
RegionModel
>
regionList
=
stCommonService
.
setRegionIfRootParentAndNoAccessIf3Level
(
ValidationUtil
.
isEmpty
(
detailDto
.
getCityCode
())
?
"610000"
:
detailDto
.
getCityCode
());
List
<
String
>
xData
=
regionList
.
stream
()
.
map
(
RegionModel:
:
getRegionName
)
.
filter
(
regionName
->
!
"西咸新区"
.
equals
(
regionName
))
.
collect
(
Collectors
.
toList
());
List
<?
extends
Number
>
alertUnitTotal
=
regionList
.
stream
()
.
map
(
region
->
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
String
.
valueOf
(
region
.
getRegionCode
()));
if
(
ValidationUtil
.
isEmpty
(
orgCode
))
{
return
0L
;
}
return
alertUseUnitStatisticsMapper
.
selectCount
(
new
QueryWrapper
<
AlertUseUnitStatistics
>().
lambda
()
.
likeRight
(
AlertUseUnitStatistics:
:
getSupervisoryUnitOrgCode
,
orgCode
)
.
isNotNull
(
AlertUseUnitStatistics:
:
getUseUnitCode
));
}).
collect
(
Collectors
.
toList
());
res
.
put
(
"legendData"
,
legendData
);
res
.
put
(
"xdata"
,
xData
);
res
.
put
(
"alertUnitTotal"
,
alertUnitTotal
);
return
ResponseHelper
.
buildResponse
(
res
);
}
public
ResponseModel
<
IPage
<
AlertUseUnitStatistics
>>
alertUseUnitTableForDP
(
DPFilterParamForDetailDto
detailDto
){
Page
<
AlertUseUnitStatistics
>
page
=
new
Page
<>();
page
.
setCurrent
(
detailDto
.
getCurrent
());
page
.
setSize
(
detailDto
.
getSize
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
ValidationUtil
.
isEmpty
(
detailDto
.
getCityCode
())
?
"610000"
:
detailDto
.
getCityCode
());
if
(
orgCode
==
null
)
{
return
ResponseHelper
.
buildResponse
(
page
);
}
LambdaQueryWrapper
<
AlertUseUnitStatistics
>
lambda
=
new
QueryWrapper
<
AlertUseUnitStatistics
>().
lambda
();
lambda
.
isNotNull
(
AlertUseUnitStatistics:
:
getUseUnitCode
);
// 地市搜索
if
(!
ValidationUtil
.
isEmpty
(
detailDto
.
getRegionName
()))
{
List
<
RegionModel
>
regionList
=
stCommonService
.
setRegionIfRootParentAndNoAccessIf3Level
(
ValidationUtil
.
isEmpty
(
detailDto
.
getCityCode
())
?
"610000"
:
detailDto
.
getCityCode
()
);
RegionModel
matchedRegion
=
regionList
.
stream
()
.
filter
(
region
->
detailDto
.
getRegionName
().
equals
(
region
.
getRegionName
()))
.
findFirst
()
.
orElseThrow
(()
->
new
IllegalArgumentException
(
"Region not found"
));
String
cityOrgCode
=
stCommonService
.
getAndSetOrgCode
(
String
.
valueOf
(
matchedRegion
.
getRegionCode
()));
lambda
.
likeRight
(
AlertUseUnitStatistics:
:
getSupervisoryUnitOrgCode
,
cityOrgCode
);
}
else
{
lambda
.
likeRight
(
AlertUseUnitStatistics:
:
getSupervisoryUnitOrgCode
,
orgCode
);
}
// 使用单位
if
(!
ValidationUtil
.
isEmpty
(
detailDto
.
getCompanyName
())){
lambda
.
like
(
AlertUseUnitStatistics:
:
getUseUnit
,
detailDto
.
getCompanyName
());
}
// 维保单位
if
(!
ValidationUtil
.
isEmpty
(
detailDto
.
getMaintenanceCompanyName
())){
lambda
.
like
(
AlertUseUnitStatistics:
:
getMaintenanceUnit
,
detailDto
.
getMaintenanceCompanyName
());
}
IPage
<
AlertUseUnitStatistics
>
alertUseUnitStatistics
=
alertUseUnitStatisticsMapper
.
selectPage
(
page
,
lambda
);
return
ResponseHelper
.
buildResponse
(
alertUseUnitStatistics
);
}
}
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