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
f2d564a7
Commit
f2d564a7
authored
Jul 24, 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
75ae644d
de994286
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
6 deletions
+104
-6
AlertStatisticsMapper.java
...oot/module/elevator/api/mapper/AlertStatisticsMapper.java
+2
-0
AlertStatisticsMapper.xml
...3-api/src/main/resources/mapper/AlertStatisticsMapper.xml
+10
-0
DPStatisticsController.java
...odule/elevator/biz/controller/DPStatisticsController.java
+36
-0
DPStatisticsServiceImpl.java
...le/elevator/biz/service/impl/DPStatisticsServiceImpl.java
+56
-6
No files found.
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/java/com/yeejoin/amos/boot/module/elevator/api/mapper/AlertStatisticsMapper.java
View file @
f2d564a7
...
@@ -20,4 +20,6 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> {
...
@@ -20,4 +20,6 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> {
Long
countProblemByTypeDateAndOrgCode
(
@Param
(
"problemType"
)
String
problemType
,
@Param
(
"dto"
)
DPFilterParamDto
params
,
@Param
(
"orgCode"
)
String
orgCode
);
Long
countProblemByTypeDateAndOrgCode
(
@Param
(
"problemType"
)
String
problemType
,
@Param
(
"dto"
)
DPFilterParamDto
params
,
@Param
(
"orgCode"
)
String
orgCode
);
String
getOrgCodeByCompanyCode
(
String
cityCode
);
String
getOrgCodeByCompanyCode
(
String
cityCode
);
Long
countEmergencyEventsByUniBizKey
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"dto"
)
DPFilterParamDto
filterParamDto
);
}
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/resources/mapper/AlertStatisticsMapper.xml
View file @
f2d564a7
...
@@ -112,4 +112,14 @@
...
@@ -112,4 +112,14 @@
<select
id=
"getOrgCodeByCompanyCode"
resultType=
"java.lang.String"
>
<select
id=
"getOrgCodeByCompanyCode"
resultType=
"java.lang.String"
>
select org_code from privilege_company where company_code = #{companyCode} limit 1
select org_code from privilege_company where company_code = #{companyCode} limit 1
</select>
</select>
<select
id=
"countEmergencyEventsByUniBizKey"
resultType=
"java.lang.Long"
>
SELECT
COALESCE(sum(emergency_events),0)
FROM
"tzs_alert_statistics"
where
supervisory_unit_org_code = #{orgCode}
and start_date=#{dto.beginDate}
and end_date=#{dto.endDate}
</select>
</mapper>
</mapper>
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/controller/DPStatisticsController.java
View file @
f2d564a7
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.elevator.biz.controller;
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.elevator.biz.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
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.elevator.api.dto.AlertMaintenanceUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertMaintenanceUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertMsgDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertPaperInfoDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertUseUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertUseUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.DPStatisticsServiceImpl
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.DPStatisticsServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -85,6 +87,17 @@ public class DPStatisticsController {
...
@@ -85,6 +87,17 @@ public class DPStatisticsController {
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-应急-即时警情列表"
,
notes
=
"大屏-应急-即时警情列表"
)
@PostMapping
(
value
=
"/yj/instantAlert"
)
public
ResponseModel
<
List
<
AlertPaperInfoDto
>>
instantAlert
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
throws
Exception
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
instantAlert
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-应急-月度困人故障高发使用单位"
,
notes
=
"大屏-应急-月度困人故障高发使用单位"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-应急-月度困人故障高发使用单位"
,
notes
=
"大屏-应急-月度困人故障高发使用单位"
)
@PostMapping
(
value
=
"/yj/trappedUserHighCompanyCount"
)
@PostMapping
(
value
=
"/yj/trappedUserHighCompanyCount"
)
public
ResponseModel
<
List
<
AlertUseUnitStatisticsDto
>>
trappedUserHighCompanyCount
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
throws
Exception
{
public
ResponseModel
<
List
<
AlertUseUnitStatisticsDto
>>
trappedUserHighCompanyCount
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
throws
Exception
{
...
@@ -105,4 +118,27 @@ public class DPStatisticsController {
...
@@ -105,4 +118,27 @@ public class DPStatisticsController {
}
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
rankUnitByRescueTime
(
dpFilterParamDto
));
return
ResponseHelper
.
buildResponse
(
statisticsService
.
rankUnitByRescueTime
(
dpFilterParamDto
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-应急-中间地图图列统计"
,
notes
=
"大屏-应急-中间地图图列统计"
)
@PostMapping
(
value
=
"/zl/center-map/legend"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
centerMapCountForGlobal
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
getCenterMapCountDataForGlobal
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@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
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
getCenterMapCountDataForOverview
(
dpFilterParamDto
));
}
}
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/service/impl/DPStatisticsServiceImpl.java
View file @
f2d564a7
...
@@ -3,31 +3,30 @@ package com.yeejoin.amos.boot.module.elevator.biz.service.impl;
...
@@ -3,31 +3,30 @@ package com.yeejoin.amos.boot.module.elevator.biz.service.impl;
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
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant
;
import
com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant
;
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.enums.ReginStepEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertMaintenanceUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertMaintenanceUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertMsgDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertPaperInfoDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertUseUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertUseUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertMaintenanceUnitStatistics
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertMaintenanceUnitStatistics
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertRescueStatistics
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertRescueStatistics
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertUseUnitStatistics
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertUseUnitStatistics
;
import
com.yeejoin.amos.boot.module.elevator.api.mapper.*
;
import
com.yeejoin.amos.boot.module.elevator.api.mapper.*
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IAlertRescueStatisticsService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
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
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.time.temporal.ChronoUnit
;
import
java.time.temporal.ChronoUnit
;
...
@@ -56,17 +55,23 @@ public class DPStatisticsServiceImpl {
...
@@ -56,17 +55,23 @@ public class DPStatisticsServiceImpl {
private
AlertMaintenanceUnitStatisticsMapper
alertMaintenanceUnitStatisticsMapper
;
private
AlertMaintenanceUnitStatisticsMapper
alertMaintenanceUnitStatisticsMapper
;
private
AlertStatisticsMapper
alertStatisticsMapper
;
@Autowired
AlertCalledServiceImpl
alertCalledService
;
private
static
Map
<
String
,
String
>
regionCodeOrgCodeMap
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
String
>
regionCodeOrgCodeMap
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
List
<
RegionModel
>>
regionChildRegionMap
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
List
<
RegionModel
>>
regionChildRegionMap
=
new
ConcurrentHashMap
<>();
public
DPStatisticsServiceImpl
(
YjBaseMapper
yjBaseMapper
,
AlertCalledMapper
alertCalledMapper
,
ElevatorMapper
elevatorMapper
,
AlertRescueStatisticsMapper
alertRescueStatisticsMapper
,
AlertUseUnitStatisticsMapper
alertUseUnitStatisticsMapper
,
AlertMaintenanceUnitStatisticsMapper
alertMaintenanceUnitStatisticsMapper
)
{
public
DPStatisticsServiceImpl
(
YjBaseMapper
yjBaseMapper
,
AlertCalledMapper
alertCalledMapper
,
ElevatorMapper
elevatorMapper
,
AlertRescueStatisticsMapper
alertRescueStatisticsMapper
,
AlertUseUnitStatisticsMapper
alertUseUnitStatisticsMapper
,
AlertMaintenanceUnitStatisticsMapper
alertMaintenanceUnitStatisticsMapper
,
AlertStatisticsMapper
alertStatisticsMapper
)
{
this
.
yjBaseMapper
=
yjBaseMapper
;
this
.
yjBaseMapper
=
yjBaseMapper
;
this
.
alertCalledMapper
=
alertCalledMapper
;
this
.
alertCalledMapper
=
alertCalledMapper
;
this
.
elevatorMapper
=
elevatorMapper
;
this
.
elevatorMapper
=
elevatorMapper
;
this
.
alertRescueStatisticsMapper
=
alertRescueStatisticsMapper
;
this
.
alertRescueStatisticsMapper
=
alertRescueStatisticsMapper
;
this
.
alertUseUnitStatisticsMapper
=
alertUseUnitStatisticsMapper
;
this
.
alertUseUnitStatisticsMapper
=
alertUseUnitStatisticsMapper
;
this
.
alertMaintenanceUnitStatisticsMapper
=
alertMaintenanceUnitStatisticsMapper
;
this
.
alertMaintenanceUnitStatisticsMapper
=
alertMaintenanceUnitStatisticsMapper
;
this
.
alertStatisticsMapper
=
alertStatisticsMapper
;
}
}
public
JSONObject
eventStatByDay
(
DPFilterParamDto
dpFilterParamDto
)
throws
Exception
{
public
JSONObject
eventStatByDay
(
DPFilterParamDto
dpFilterParamDto
)
throws
Exception
{
...
@@ -140,6 +145,13 @@ public class DPStatisticsServiceImpl {
...
@@ -140,6 +145,13 @@ public class DPStatisticsServiceImpl {
return
jsonObject
;
return
jsonObject
;
}
}
public
List
<
AlertPaperInfoDto
>
instantAlert
(
DPFilterParamDto
dpFilterParamDto
)
throws
Exception
{
List
<
String
>
regionCodes
=
new
ArrayList
<>();
regionCodes
.
add
(
dpFilterParamDto
.
getCityCode
());
List
<
AlertPaperInfoDto
>
alertPaperInfoDtoList
=
alertCalledService
.
getAlertPaperInfoList
(
alertCalledService
.
authRegionCodeList
(
regionCodes
),
false
);
return
alertPaperInfoDtoList
;
}
public
JSONObject
trappedUserCount
(
DPFilterParamDto
dpFilterParamDto
)
throws
Exception
{
public
JSONObject
trappedUserCount
(
DPFilterParamDto
dpFilterParamDto
)
throws
Exception
{
String
date
=
DateUtil
.
formatDate
(
new
Date
(),
"yyyy-MM"
);
String
date
=
DateUtil
.
formatDate
(
new
Date
(),
"yyyy-MM"
);
String
orgCode
=
this
.
getAndSetOrgCode
(
dpFilterParamDto
);
String
orgCode
=
this
.
getAndSetOrgCode
(
dpFilterParamDto
);
...
@@ -253,5 +265,43 @@ public class DPStatisticsServiceImpl {
...
@@ -253,5 +265,43 @@ public class DPStatisticsServiceImpl {
}
}
legendData
.
put
(
dataKey
,
value
);
legendData
.
put
(
dataKey
,
value
);
return
jsonObject
;
return
jsonObject
;
};
}
public
List
<
Map
<
String
,
Object
>>
getCenterMapCountDataForOverview
(
DPFilterParamDto
dpFilterParamDto
)
{
this
.
setDefaultFilter
(
dpFilterParamDto
);
return
getRegionList
(
dpFilterParamDto
).
parallelStream
().
map
(
r
->
{
DPFilterParamDto
filterParamDto
=
new
DPFilterParamDto
();
filterParamDto
.
setCityCode
(
r
.
getRegionCode
().
toString
());
String
orgCode
=
this
.
getAndSetOrgCode
(
filterParamDto
);
Map
<
String
,
Object
>
itemResult
=
getCenterMapOverviewData
(
orgCode
,
filterParamDto
);
itemResult
.
put
(
"regionCode"
,
r
.
getRegionCode
());
itemResult
.
put
(
"regionName"
,
r
.
getRegionName
());
return
itemResult
;
}).
collect
(
Collectors
.
toList
());
}
private
Map
<
String
,
Object
>
getCenterMapOverviewData
(
String
orgCode
,
DPFilterParamDto
filterParamDto
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Long
num
=
alertStatisticsMapper
.
countEmergencyEventsByUniBizKey
(
orgCode
,
filterParamDto
);
result
.
put
(
"alarmCount"
,
num
);
return
result
;
}
public
Map
<
String
,
Object
>
getCenterMapCountDataForGlobal
(
DPFilterParamDto
dpFilterParamDto
)
{
this
.
setDefaultFilter
(
dpFilterParamDto
);
String
orgCode
=
this
.
getAndSetOrgCode
(
dpFilterParamDto
);
// 1.报检数量统计
return
this
.
getCenterMapOverviewData
(
orgCode
,
dpFilterParamDto
);
}
private
void
setDefaultFilter
(
DPFilterParamDto
dpFilterParamDto
)
{
if
(
StringUtils
.
isEmpty
(
dpFilterParamDto
.
getBeginDate
()))
{
dpFilterParamDto
.
setBeginDate
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
beginOfMonth
(
new
Date
()).
toDateStr
());
}
if
(
StringUtils
.
isEmpty
(
dpFilterParamDto
.
getEndDate
()))
{
dpFilterParamDto
.
setEndDate
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
endOfMonth
(
new
Date
()).
toDateStr
());
}
}
}
}
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