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
7d838995
Commit
7d838995
authored
Nov 29, 2024
by
麻笑宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应急处置 / 月度困人故障高发使用单位 下钻列表增加expiryDate许可有效期,userCount人员数量,equipCount设备数量三个字段
parent
cb71725c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
4 deletions
+74
-4
AlertUseUnitStatisticsMapper.java
...e/statistics/api/mapper/AlertUseUnitStatisticsMapper.java
+2
-0
AlertUseUnitStatisticsMapper.xml
...rc/main/resources/mapper/AlertUseUnitStatisticsMapper.xml
+42
-0
YJDPStatisticsController.java
...le/statistcs/biz/controller/YJDPStatisticsController.java
+1
-1
YJDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/YJDPStatisticsServiceImpl.java
+29
-3
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/mapper/AlertUseUnitStatisticsMapper.java
View file @
7d838995
...
@@ -18,4 +18,6 @@ public interface AlertUseUnitStatisticsMapper extends BaseMapper<AlertUseUnitSta
...
@@ -18,4 +18,6 @@ public interface AlertUseUnitStatisticsMapper extends BaseMapper<AlertUseUnitSta
List
<
Map
<
String
,
String
>>
getStatisticsMessage
(
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
List
<
Map
<
String
,
String
>>
getStatisticsMessage
(
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
AlertUseUnitStatistics
getUseUnitMessage
(
@Param
(
"unitCode"
)
String
unitCode
,
@Param
(
"equipmentId"
)
String
equipmentId
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
AlertUseUnitStatistics
getUseUnitMessage
(
@Param
(
"unitCode"
)
String
unitCode
,
@Param
(
"equipmentId"
)
String
equipmentId
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
List
<
Map
<
String
,
Object
>>
countByUseUnitCode
(
@Param
(
"useUnitCodeList"
)
List
<
String
>
useUnitCodeList
);
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/AlertUseUnitStatisticsMapper.xml
View file @
7d838995
...
@@ -43,6 +43,48 @@
...
@@ -43,6 +43,48 @@
and father_alert is null
and father_alert is null
) as faultNum
) as faultNum
</select>
</select>
<select
id=
"countByUseUnitCode"
resultType=
"java.util.Map"
>
SELECT
tbei.use_unit_code AS useUnitCode,
l.expiry_date AS expiryDate,
IFNULL ( u."userCount", '0' ) AS userCount,
IFNULL ( e."equipCount", '0' ) AS equipCount
FROM
tz_base_enterprise_info tbei
LEFT JOIN ( SELECT * FROM tz_base_unit_licence GROUP BY unit_code ORDER BY expiry_date DESC ) AS l ON l.unit_code = tbei.use_unit_code
LEFT JOIN (
SELECT
tbei.use_unit_code AS useNnitCode,
COUNT ( 1 ) AS userCount
FROM
tz_base_enterprise_info tbei
INNER JOIN tzs_user_info ui ON tbei.use_unit_code = ui.unit_code
where tbei.use_unit_code IN
<foreach
collection=
"useUnitCodeList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
GROUP BY
tbei.use_unit_code
) u ON u."useNnitCode" = tbei.use_unit_code
LEFT JOIN (
SELECT
tbei.use_unit_code AS useNnitCode,
COUNT ( 1 ) AS equipCount
FROM
tz_base_enterprise_info tbei
INNER JOIN idx_biz_jg_use_info jui ON tbei.use_unit_code = jui.USE_UNIT_CREDIT_CODE
LEFT JOIN idx_biz_jg_other_info joi ON joi.RECORD = jui.RECORD
AND joi.SUPERVISORY_CODE IS NOT NULL
AND joi.SUPERVISORY_CODE != ''
AND joi.SUPERVISORY_CODE != 'null'
where tbei.use_unit_code IN
<foreach
collection=
"useUnitCodeList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
GROUP BY
tbei.use_unit_code
) e ON e."useNnitCode" = tbei.use_unit_code
</select>
</mapper>
</mapper>
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 @
7d838995
...
@@ -321,7 +321,7 @@ public class YJDPStatisticsController {
...
@@ -321,7 +321,7 @@ public class YJDPStatisticsController {
@ApiOperation
(
value
=
"月度困人故障高发使用单位-右上角更多-地市月度应急事件高发使用单位-表格"
,
@ApiOperation
(
value
=
"月度困人故障高发使用单位-右上角更多-地市月度应急事件高发使用单位-表格"
,
notes
=
"月度困人故障高发使用单位-右上角更多-地市月度应急事件高发使用单位-表格"
)
notes
=
"月度困人故障高发使用单位-右上角更多-地市月度应急事件高发使用单位-表格"
)
@PostMapping
(
"/alertUseUnitTable/dp"
)
@PostMapping
(
"/alertUseUnitTable/dp"
)
public
ResponseModel
<
IPage
<
AlertUseUnitStatistics
>>
alertUseUnitTableForDP
(
@Validated
@RequestBody
DPFilterParamForDetailDto
detailDto
,
public
ResponseModel
<
IPage
<
Map
<
String
,
Object
>
>>
alertUseUnitTableForDP
(
@Validated
@RequestBody
DPFilterParamForDetailDto
detailDto
,
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
Integer
current
,
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
Integer
current
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"20"
)
Integer
size
)
throws
Exception
{
@RequestParam
(
value
=
"size"
,
defaultValue
=
"20"
)
Integer
size
)
throws
Exception
{
detailDto
.
setCurrent
(
current
);
detailDto
.
setCurrent
(
current
);
...
...
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 @
7d838995
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -40,7 +41,9 @@ import org.elasticsearch.search.aggregations.AggregationBuilders;
...
@@ -40,7 +41,9 @@ import org.elasticsearch.search.aggregations.AggregationBuilders;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
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.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.DateTimeUtil
;
import
org.typroject.tyboot.core.foundation.utils.DateTimeUtil
;
import
org.typroject.tyboot.core.foundation.utils.DateUtil
;
import
org.typroject.tyboot.core.foundation.utils.DateUtil
;
...
@@ -714,14 +717,14 @@ public class YJDPStatisticsServiceImpl {
...
@@ -714,14 +717,14 @@ public class YJDPStatisticsServiceImpl {
return
ResponseHelper
.
buildResponse
(
res
);
return
ResponseHelper
.
buildResponse
(
res
);
}
}
public
ResponseModel
<
IPage
<
AlertUseUnitStatistics
>>
alertUseUnitTableForDP
(
DPFilterParamForDetailDto
detailDto
)
throws
Exception
{
public
ResponseModel
<
IPage
<
Map
<
String
,
Object
>
>>
alertUseUnitTableForDP
(
DPFilterParamForDetailDto
detailDto
)
throws
Exception
{
Page
<
AlertUseUnitStatistics
>
page
=
new
Page
<>();
Page
<
AlertUseUnitStatistics
>
page
=
new
Page
<>();
page
.
setCurrent
(
detailDto
.
getCurrent
());
page
.
setCurrent
(
detailDto
.
getCurrent
());
page
.
setSize
(
detailDto
.
getSize
());
page
.
setSize
(
detailDto
.
getSize
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
ValidationUtil
.
isEmpty
(
detailDto
.
getCityCode
())
?
"610000"
:
detailDto
.
getCityCode
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
ValidationUtil
.
isEmpty
(
detailDto
.
getCityCode
())
?
"610000"
:
detailDto
.
getCityCode
());
if
(
orgCode
==
null
)
{
if
(
orgCode
==
null
)
{
return
ResponseHelper
.
buildResponse
(
page
);
return
ResponseHelper
.
buildResponse
(
new
Page
<>()
);
}
}
LambdaQueryWrapper
<
AlertUseUnitStatistics
>
lambda
=
new
QueryWrapper
<
AlertUseUnitStatistics
>().
lambda
();
LambdaQueryWrapper
<
AlertUseUnitStatistics
>
lambda
=
new
QueryWrapper
<
AlertUseUnitStatistics
>().
lambda
();
...
@@ -766,7 +769,30 @@ public class YJDPStatisticsServiceImpl {
...
@@ -766,7 +769,30 @@ public class YJDPStatisticsServiceImpl {
lambda
.
le
(
AlertUseUnitStatistics:
:
getEquipmentClassificationCode
,
detailDto
.
getEquListCode
());
lambda
.
le
(
AlertUseUnitStatistics:
:
getEquipmentClassificationCode
,
detailDto
.
getEquListCode
());
}
}
IPage
<
AlertUseUnitStatistics
>
alertUseUnitStatistics
=
alertUseUnitStatisticsMapper
.
selectPage
(
page
,
lambda
);
IPage
<
AlertUseUnitStatistics
>
alertUseUnitStatistics
=
alertUseUnitStatisticsMapper
.
selectPage
(
page
,
lambda
);
return
ResponseHelper
.
buildResponse
(
alertUseUnitStatistics
);
List
<
AlertUseUnitStatistics
>
records
=
alertUseUnitStatistics
.
getRecords
();
List
<
String
>
useUnitCodeList
=
records
.
stream
().
map
(
AlertUseUnitStatistics:
:
getUseUnitCode
).
collect
(
Collectors
.
toList
());
Map
<
String
,
Map
<
String
,
Object
>>
useUnitMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
useUnitCodeList
)){
List
<
Map
<
String
,
Object
>>
list
=
alertUseUnitStatisticsMapper
.
countByUseUnitCode
(
useUnitCodeList
);
if
(!
CollectionUtils
.
isEmpty
(
list
)){
list
.
forEach
(
map
->
{
useUnitMap
.
put
(
map
.
get
(
"useUnitCode"
).
toString
(),
map
);
});
}
}
records
.
forEach
(
t
->{
Map
<
String
,
Object
>
map
=
BeanUtil
.
beanToMap
(
t
);
map
.
putAll
(
useUnitMap
.
get
(
t
.
getUseUnitCode
()));
resultList
.
add
(
map
);
});
Page
<
Map
<
String
,
Object
>>
resultPage
=
new
Page
<>();
resultPage
.
setCurrent
(
page
.
getCurrent
());
resultPage
.
setSize
(
page
.
getSize
());
resultPage
.
setTotal
(
alertUseUnitStatistics
.
getTotal
());
resultPage
.
setRecords
(
resultList
);
return
ResponseHelper
.
buildResponse
(
resultPage
);
}
}
public
List
<
JSONObject
>
getKeyPositionMonitor
(
DPFilterParamForDetailDto
filterParamDto
)
{
public
List
<
JSONObject
>
getKeyPositionMonitor
(
DPFilterParamForDetailDto
filterParamDto
)
{
...
...
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