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
283c867d
Commit
283c867d
authored
Nov 09, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
963194ee
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
431 additions
and
15 deletions
+431
-15
AlertMaintenanceUnitStatisticsDto.java
...e/elevator/api/dto/AlertMaintenanceUnitStatisticsDto.java
+56
-0
AlertMaintenanceUnitStatistics.java
...e/elevator/api/entity/AlertMaintenanceUnitStatistics.java
+96
-0
AlertMaintenanceUnitStatisticsMapper.java
...ator/api/mapper/AlertMaintenanceUnitStatisticsMapper.java
+21
-0
IAlertMaintenanceUnitStatisticsService.java
...r/api/service/IAlertMaintenanceUnitStatisticsService.java
+20
-0
AlertMaintenanceUnitStatisticsExportVo.java
...evator/api/vo/AlertMaintenanceUnitStatisticsExportVo.java
+37
-0
AlertMaintenanceUnitStatisticsMapper.xml
...resources/mapper/AlertMaintenanceUnitStatisticsMapper.xml
+46
-0
StatisticsController.java
.../module/elevator/biz/controller/StatisticsController.java
+54
-12
AlertMaintenanceUnitStatisticsServiceImpl.java
...rvice/impl/AlertMaintenanceUnitStatisticsServiceImpl.java
+91
-0
AlertPlaceStatisticsServiceImpl.java
...tor/biz/service/impl/AlertPlaceStatisticsServiceImpl.java
+4
-0
AlertRescueStatisticsServiceImpl.java
...or/biz/service/impl/AlertRescueStatisticsServiceImpl.java
+1
-1
AlertStatisticsServiceImpl.java
...elevator/biz/service/impl/AlertStatisticsServiceImpl.java
+1
-1
AlertUseUnitStatisticsServiceImpl.java
...r/biz/service/impl/AlertUseUnitStatisticsServiceImpl.java
+4
-1
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/dto/AlertMaintenanceUnitStatisticsDto.java
0 → 100644
View file @
283c867d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
elevator
.
api
.
dto
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
*
*
* @author system_generator
* @date 2023-11-09
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"AlertMaintenanceUnitStatisticsDto"
,
description
=
""
)
public
class
AlertMaintenanceUnitStatisticsDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"监管单位ID"
)
private
String
supervisoryUnitId
;
@ApiModelProperty
(
value
=
"监管单位名称"
)
private
String
supervisoryUnitName
;
@ApiModelProperty
(
value
=
"监管单位编码"
)
private
String
supervisoryUnitOrgCode
;
@ApiModelProperty
(
value
=
"统计月份"
)
private
String
statisticsDate
;
@ApiModelProperty
(
value
=
"开始日期"
)
private
String
startDate
;
@ApiModelProperty
(
value
=
"结束日期"
)
private
String
endDate
;
@ApiModelProperty
(
value
=
"维保单位"
)
private
String
maintenanceName
;
@ApiModelProperty
(
value
=
"困人救援"
)
private
Integer
trappedNum
;
@ApiModelProperty
(
value
=
"故障救援"
)
private
Integer
faultNum
;
@ApiModelProperty
(
value
=
"总事件数"
)
private
Integer
alertNum
;
@ApiModelProperty
(
value
=
"比率"
)
private
String
rate
;
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/java/com/yeejoin/amos/boot/module/elevator/api/entity/AlertMaintenanceUnitStatistics.java
0 → 100644
View file @
283c867d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
elevator
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
*
*
* @author system_generator
* @date 2023-11-09
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tzs_alert_maintenance_unit_statistics"
)
public
class
AlertMaintenanceUnitStatistics
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 监管单位ID
*/
@TableField
(
"supervisory_unit_id"
)
private
String
supervisoryUnitId
;
/**
* 监管单位名称
*/
@TableField
(
"supervisory_unit_name"
)
private
String
supervisoryUnitName
;
/**
* 监管单位编码
*/
@TableField
(
"supervisory_unit_org_code"
)
private
String
supervisoryUnitOrgCode
;
/**
* 统计月份
*/
@TableField
(
"statistics_date"
)
private
String
statisticsDate
;
/**
* 开始日期
*/
@TableField
(
"start_date"
)
private
String
startDate
;
/**
* 结束日期
*/
@TableField
(
"end_date"
)
private
String
endDate
;
/**
* 维保单位
*/
@TableField
(
"maintenance_name"
)
private
String
maintenanceName
;
/**
* 困人救援
*/
@TableField
(
"trapped_num"
)
private
Integer
trappedNum
;
/**
* 故障救援
*/
@TableField
(
"fault_num"
)
private
Integer
faultNum
;
/**
* 总事件数
*/
@TableField
(
"alert_num"
)
private
Integer
alertNum
;
/**
* 比率
*/
@TableField
(
"rate"
)
private
String
rate
;
/**
* 维保电梯数量
*/
@TableField
(
"equip_num"
)
private
Integer
equipNum
;
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/java/com/yeejoin/amos/boot/module/elevator/api/mapper/AlertMaintenanceUnitStatisticsMapper.java
0 → 100644
View file @
283c867d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
elevator
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertMaintenanceUnitStatistics
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* Mapper 接口
*
* @author system_generator
* @date 2023-11-09
*/
public
interface
AlertMaintenanceUnitStatisticsMapper
extends
BaseMapper
<
AlertMaintenanceUnitStatistics
>
{
List
<
Map
<
String
,
String
>>
getMessage
(
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
AlertMaintenanceUnitStatistics
countMessage
(
@Param
(
"unitCode"
)
String
unitCode
,
@Param
(
"equipId"
)
String
equipId
);
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/java/com/yeejoin/amos/boot/module/elevator/api/service/IAlertMaintenanceUnitStatisticsService.java
0 → 100644
View file @
283c867d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
elevator
.
api
.
service
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertMaintenanceUnitStatistics
;
import
java.util.List
;
/**
* 接口类
*
* @author system_generator
* @date 2023-11-09
*/
public
interface
IAlertMaintenanceUnitStatisticsService
{
void
statisticalGeneration
();
List
<
AlertMaintenanceUnitStatistics
>
getList
(
String
date
);
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/java/com/yeejoin/amos/boot/module/elevator/api/vo/AlertMaintenanceUnitStatisticsExportVo.java
0 → 100644
View file @
283c867d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
elevator
.
api
.
vo
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
lombok.Data
;
@Data
public
class
AlertMaintenanceUnitStatisticsExportVo
{
@ColumnWidth
(
10
)
@ExcelProperty
(
value
=
"序号"
,
index
=
0
)
private
Integer
number
;
@ColumnWidth
(
30
)
@ExcelProperty
(
value
=
"区 域"
,
index
=
1
)
private
String
supervisoryUnitName
;
@ColumnWidth
(
30
)
@ExcelProperty
(
value
=
"维保单位名称"
,
index
=
2
)
private
String
maintenanceName
;
@ExcelProperty
(
value
=
"困人次数"
,
index
=
4
)
private
Integer
trappedNum
;
@ExcelProperty
(
value
=
"故障次数"
,
index
=
5
)
private
Integer
faultNum
;
@ExcelProperty
(
value
=
"总事件数"
,
index
=
6
)
private
Integer
alertNum
;
@ExcelProperty
(
value
=
"比 率"
,
index
=
7
)
private
String
rate
;
@ExcelProperty
(
value
=
"维保电梯数量"
,
index
=
3
)
private
Integer
equipNum
;
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/resources/mapper/AlertMaintenanceUnitStatisticsMapper.xml
0 → 100644
View file @
283c867d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.elevator.api.mapper.AlertMaintenanceUnitStatisticsMapper"
>
<select
id=
"getMessage"
resultType=
"java.util.Map"
>
SELECT mainCode as maintenanceCode, orgBranchName,orgBranchCode, equipmentId
from (
SELECT
tac.equipment_id as equipmentId,
(
SELECT ME_UNIT_CREDIT_CODE
from idx_biz_jg_maintenance_record_info
WHERE RECORD = equipment_id
ORDER BY INFORM_START LIMIT 1
) as mainCode,
jsi."ORG_BRANCH_NAME" as orgBranchName,
jsi."ORG_BRANCH_code" as orgBranchCode
from tz_alert_called tac
LEFT JOIN idx_biz_jg_supervision_info jsi on tac.equipment_id = jsi.RECORD
WHERE tac.alarm_type_code != '962'
and tac.equipment_id is not null
and call_time between #{startDate} and #{endDate}
)
WHERE mainCode is not null
GROUP BY equipmentId
</select>
<select
id=
"countMessage"
resultType=
"com.yeejoin.amos.boot.module.elevator.api.entity.AlertMaintenanceUnitStatistics"
>
SELECT
(
SELECT count(DISTINCT(RECORD)) FROM idx_biz_jg_maintenance_record_info WHERE ME_UNIT_CREDIT_CODE = #{unitCode}
)as equipNum,
(
SELECT count(1) from tz_alert_called WHERE equipment_id = #{equipId} and alarm_type_code = '960'
) as trappedNum,
(
SELECT count(1) from tz_alert_called WHERE equipment_id = #{equipId} and alarm_type_code = '961'
) as faultNum,
(
SELECT ME_UNIT_NAME from idx_biz_jg_maintenance_record_info WHERE ME_UNIT_CREDIT_CODE = #{unitCode} limit 1
) as maintenanceName
</select>
</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/StatisticsController.java
View file @
283c867d
...
@@ -4,18 +4,9 @@ import cn.hutool.core.bean.BeanUtil;
...
@@ -4,18 +4,9 @@ import cn.hutool.core.bean.BeanUtil;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.biz.common.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertPlaceStatistics
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.*
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertRescueStatistics
;
import
com.yeejoin.amos.boot.module.elevator.api.service.*
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertStatistics
;
import
com.yeejoin.amos.boot.module.elevator.api.vo.*
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertUseUnitStatistics
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IAlertPlaceStatisticsService
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IAlertRescueStatisticsService
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IAlertStatisticsService
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IAlertUseUnitStatisticsService
;
import
com.yeejoin.amos.boot.module.elevator.api.vo.AlertPlaceStatisticsExportVo
;
import
com.yeejoin.amos.boot.module.elevator.api.vo.AlertRescueStatisticsExportVo
;
import
com.yeejoin.amos.boot.module.elevator.api.vo.AlertStatisticsExportVo
;
import
com.yeejoin.amos.boot.module.elevator.api.vo.AlertUseUnitStatisticsVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -55,6 +46,9 @@ public class StatisticsController extends BaseController {
...
@@ -55,6 +46,9 @@ public class StatisticsController extends BaseController {
@Autowired
@Autowired
private
IAlertUseUnitStatisticsService
alertUseUnitStatisticsService
;
private
IAlertUseUnitStatisticsService
alertUseUnitStatisticsService
;
@Autowired
private
IAlertMaintenanceUnitStatisticsService
alertMaintenanceUnitStatisticsService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/statisticalGeneration"
)
@GetMapping
(
value
=
"/statisticalGeneration"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"生成统计数据"
,
notes
=
"生成统计数据"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"生成统计数据"
,
notes
=
"生成统计数据"
)
...
@@ -253,4 +247,52 @@ public class StatisticsController extends BaseController {
...
@@ -253,4 +247,52 @@ public class StatisticsController extends BaseController {
ExcelUtil
.
createTemplate
(
response
,
"月度困人故障高发使用单位"
,
"月度困人故障高发使用单位"
,
exportVos
,
AlertUseUnitStatisticsVo
.
class
,
null
,
false
);
ExcelUtil
.
createTemplate
(
response
,
"月度困人故障高发使用单位"
,
"月度困人故障高发使用单位"
,
exportVos
,
AlertUseUnitStatisticsVo
.
class
,
null
,
false
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/statisticalMaintenanceUnitGeneration"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"生成统计数据"
,
notes
=
"生成统计数据"
)
public
ResponseModel
<
Object
>
statisticalMaintenanceUnitGeneration
()
{
alertMaintenanceUnitStatisticsService
.
statisticalGeneration
();
return
ResponseHelper
.
buildResponse
(
"success"
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/maintenanceUnitList"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询列表"
,
notes
=
"查询列表"
)
public
ResponseModel
<
Object
>
maintenanceUnitList
(
@RequestParam
(
value
=
"date"
,
required
=
false
)
String
date
)
{
if
(
ObjectUtils
.
isEmpty
(
date
))
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM"
);
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
new
Date
());
Date
nowDate
=
cal
.
getTime
();
date
=
format
.
format
(
nowDate
);
}
Page
<
AlertMaintenanceUnitStatistics
>
alertRescueStatisticsPage
=
new
Page
<>();
alertRescueStatisticsPage
.
setRecords
(
alertMaintenanceUnitStatisticsService
.
getList
(
date
));
return
ResponseHelper
.
buildResponse
(
alertRescueStatisticsPage
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/exportMaintenanceUnitData"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"月度故障高发维保单位统计导出"
,
notes
=
"月度故障高发维保单位统计导出"
)
public
void
exportMaintenanceUnitData
(
HttpServletResponse
response
,
@RequestParam
(
value
=
"date"
,
required
=
false
)
String
date
)
throws
ParseException
{
if
(
ObjectUtils
.
isEmpty
(
date
))
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM"
);
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
new
Date
());
Date
nowDate
=
cal
.
getTime
();
date
=
format
.
format
(
nowDate
);
}
ArrayList
<
AlertMaintenanceUnitStatisticsExportVo
>
exportVos
=
new
ArrayList
<>();
List
<
AlertMaintenanceUnitStatistics
>
list
=
alertMaintenanceUnitStatisticsService
.
getList
(
date
);
int
number
=
1
;
for
(
AlertMaintenanceUnitStatistics
item
:
list
)
{
AlertMaintenanceUnitStatisticsExportVo
vo
=
new
AlertMaintenanceUnitStatisticsExportVo
();
BeanUtil
.
copyProperties
(
item
,
vo
);
vo
.
setNumber
(
number
);
number
=
number
+
1
;
exportVos
.
add
(
vo
);
}
ExcelUtil
.
createTemplate
(
response
,
"月度故障高发维保单位统计"
,
"月度故障高发维保单位统计"
,
exportVos
,
AlertMaintenanceUnitStatisticsExportVo
.
class
,
null
,
false
);
}
}
}
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/AlertMaintenanceUnitStatisticsServiceImpl.java
0 → 100644
View file @
283c867d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
elevator
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertMaintenanceUnitStatisticsDto
;
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.mapper.AlertMaintenanceUnitStatisticsMapper
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IAlertMaintenanceUnitStatisticsService
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 服务实现类
*
* @author system_generator
* @date 2023-11-09
*/
@Service
public
class
AlertMaintenanceUnitStatisticsServiceImpl
extends
BaseService
<
AlertMaintenanceUnitStatisticsDto
,
AlertMaintenanceUnitStatistics
,
AlertMaintenanceUnitStatisticsMapper
>
implements
IAlertMaintenanceUnitStatisticsService
{
@Autowired
private
AlertStatisticsServiceImpl
alertStatisticsService
;
@Override
@Scheduled
(
cron
=
"0 0 0 1 * ?"
)
@SchedulerLock
(
name
=
"AlertMaintenanceUnitStatisticsServiceImpl"
,
lockAtMostFor
=
"PT10M"
,
lockAtLeastFor
=
"PT10M"
)
public
void
statisticalGeneration
()
{
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"0.00"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
ArrayList
<
AlertMaintenanceUnitStatistics
>
list
=
new
ArrayList
<>();
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
new
Date
());
cal
.
add
(
Calendar
.
MONTH
,
-
1
);
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
cal
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
));
Date
firstDayOfMonth
=
cal
.
getTime
();
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
cal
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
Date
lastDayOfMonth
=
cal
.
getTime
();
List
<
LinkedHashMap
>
supervisionList
=
alertStatisticsService
.
getSupervisionList
();
if
(!
ObjectUtils
.
isEmpty
(
supervisionList
))
{
List
<
Map
<
String
,
String
>>
message
=
this
.
baseMapper
.
getMessage
(
format
.
format
(
firstDayOfMonth
)
+
" 00:00:00"
,
format
.
format
(
lastDayOfMonth
)
+
" 23:59:59"
);
supervisionList
.
forEach
(
item
->
{
List
<
Map
<
String
,
String
>>
collect
=
message
.
stream
().
filter
(
maintenance
->
maintenance
.
get
(
"orgBranchCode"
).
startsWith
(
String
.
valueOf
(
item
.
get
(
"orgCode"
)))).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
collect
))
{
collect
.
forEach
(
data
->
{
AlertMaintenanceUnitStatistics
alertMaintenanceStatistics
=
this
.
baseMapper
.
countMessage
(
data
.
get
(
"maintenanceCode"
),
data
.
get
(
"equipmentId"
));
alertMaintenanceStatistics
.
setSupervisoryUnitName
(
String
.
valueOf
(
item
.
get
(
"companyName"
)));
alertMaintenanceStatistics
.
setSupervisoryUnitOrgCode
(
String
.
valueOf
(
item
.
get
(
"orgCode"
)));
alertMaintenanceStatistics
.
setSupervisoryUnitId
(
String
.
valueOf
(
item
.
get
(
"sequenceNbr"
)));
alertMaintenanceStatistics
.
setAlertNum
(
alertMaintenanceStatistics
.
getTrappedNum
()
+
alertMaintenanceStatistics
.
getFaultNum
());
if
(
alertMaintenanceStatistics
.
getAlertNum
()
!=
0
&&
alertMaintenanceStatistics
.
getEquipNum
()
!=
0
)
{
BigDecimal
bigDecimal
=
new
BigDecimal
(
alertMaintenanceStatistics
.
getAlertNum
());
BigDecimal
bigDecimal1
=
new
BigDecimal
(
alertMaintenanceStatistics
.
getEquipNum
());
BigDecimal
divide
=
bigDecimal
.
divide
(
bigDecimal1
,
4
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
new
BigDecimal
(
100
));
alertMaintenanceStatistics
.
setRate
(
decimalFormat
.
format
(
divide
)
+
"%"
);
}
else
{
alertMaintenanceStatistics
.
setRate
(
"0%"
);
}
alertMaintenanceStatistics
.
setStartDate
(
format
.
format
(
firstDayOfMonth
));
alertMaintenanceStatistics
.
setEndDate
(
format
.
format
(
lastDayOfMonth
));
alertMaintenanceStatistics
.
setStatisticsDate
(
format
.
format
(
lastDayOfMonth
).
substring
(
0
,
7
));
list
.
add
(
alertMaintenanceStatistics
);
});
}
});
if
(!
ObjectUtils
.
isEmpty
(
list
))
{
this
.
saveBatch
(
list
);
}
}
}
@Override
public
List
<
AlertMaintenanceUnitStatistics
>
getList
(
String
date
)
{
LambdaQueryWrapper
<
AlertMaintenanceUnitStatistics
>
lambda
=
new
QueryWrapper
<
AlertMaintenanceUnitStatistics
>().
lambda
();
lambda
.
eq
(
AlertMaintenanceUnitStatistics:
:
getStatisticsDate
,
date
);
return
this
.
baseMapper
.
selectList
(
lambda
);
}
}
\ No newline at end of file
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/AlertPlaceStatisticsServiceImpl.java
View file @
283c867d
...
@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.module.elevator.api.dto.AlertPlaceStatisticsDto;
...
@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.module.elevator.api.dto.AlertPlaceStatisticsDto;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertPlaceStatistics
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.AlertPlaceStatistics
;
import
com.yeejoin.amos.boot.module.elevator.api.mapper.AlertPlaceStatisticsMapper
;
import
com.yeejoin.amos.boot.module.elevator.api.mapper.AlertPlaceStatisticsMapper
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IAlertPlaceStatisticsService
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IAlertPlaceStatisticsService
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
@@ -26,6 +28,8 @@ public class AlertPlaceStatisticsServiceImpl extends BaseService<AlertPlaceStati
...
@@ -26,6 +28,8 @@ public class AlertPlaceStatisticsServiceImpl extends BaseService<AlertPlaceStati
@Override
@Override
@Scheduled
(
cron
=
"0 0 0 1 * ?"
)
@SchedulerLock
(
name
=
"AlertPlaceStatisticsServiceImpl"
,
lockAtMostFor
=
"PT10M"
,
lockAtLeastFor
=
"PT10M"
)
public
void
statisticalGeneration
()
{
public
void
statisticalGeneration
()
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"0.00"
);
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"0.00"
);
...
...
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/AlertRescueStatisticsServiceImpl.java
View file @
283c867d
...
@@ -34,7 +34,7 @@ public class AlertRescueStatisticsServiceImpl extends BaseService<AlertRescueSta
...
@@ -34,7 +34,7 @@ public class AlertRescueStatisticsServiceImpl extends BaseService<AlertRescueSta
@Override
@Override
@Scheduled
(
cron
=
"0 0 0 1 * ?"
)
@Scheduled
(
cron
=
"0 0 0 1 * ?"
)
@SchedulerLock
(
name
=
"
statisticalGeneration
"
,
lockAtMostFor
=
"PT10M"
,
lockAtLeastFor
=
"PT10M"
)
@SchedulerLock
(
name
=
"
AlertRescueStatisticsServiceImpl
"
,
lockAtMostFor
=
"PT10M"
,
lockAtLeastFor
=
"PT10M"
)
public
void
statisticalGeneration
()
{
public
void
statisticalGeneration
()
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
cal
=
Calendar
.
getInstance
();
Calendar
cal
=
Calendar
.
getInstance
();
...
...
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/AlertStatisticsServiceImpl.java
View file @
283c867d
...
@@ -34,7 +34,7 @@ public class AlertStatisticsServiceImpl extends BaseService<AlertStatisticsDto,
...
@@ -34,7 +34,7 @@ public class AlertStatisticsServiceImpl extends BaseService<AlertStatisticsDto,
@Override
@Override
@Scheduled
(
cron
=
"0 0 0 1 * ?"
)
@Scheduled
(
cron
=
"0 0 0 1 * ?"
)
@SchedulerLock
(
name
=
"
statisticalGeneration
"
,
lockAtMostFor
=
"PT10M"
,
lockAtLeastFor
=
"PT10M"
)
@SchedulerLock
(
name
=
"
AlertStatisticsServiceImpl
"
,
lockAtMostFor
=
"PT10M"
,
lockAtLeastFor
=
"PT10M"
)
public
void
statisticalGeneration
()
{
public
void
statisticalGeneration
()
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
cal
=
Calendar
.
getInstance
();
Calendar
cal
=
Calendar
.
getInstance
();
...
...
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/AlertUseUnitStatisticsServiceImpl.java
View file @
283c867d
...
@@ -8,6 +8,8 @@ import com.yeejoin.amos.boot.module.elevator.api.dto.AlertUseUnitStatisticsDto;
...
@@ -8,6 +8,8 @@ import com.yeejoin.amos.boot.module.elevator.api.dto.AlertUseUnitStatisticsDto;
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.AlertUseUnitStatisticsMapper
;
import
com.yeejoin.amos.boot.module.elevator.api.mapper.AlertUseUnitStatisticsMapper
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IAlertUseUnitStatisticsService
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IAlertUseUnitStatisticsService
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
@@ -27,9 +29,10 @@ public class AlertUseUnitStatisticsServiceImpl extends BaseService<AlertUseUnitS
...
@@ -27,9 +29,10 @@ public class AlertUseUnitStatisticsServiceImpl extends BaseService<AlertUseUnitS
@Override
@Override
@Scheduled
(
cron
=
"0 0 0 1 * ?"
)
@SchedulerLock
(
name
=
"AlertUseUnitStatisticsServiceImpl"
,
lockAtMostFor
=
"PT10M"
,
lockAtLeastFor
=
"PT10M"
)
public
void
statisticalGeneration
()
{
public
void
statisticalGeneration
()
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"0.00"
);
Calendar
cal
=
Calendar
.
getInstance
();
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
new
Date
());
cal
.
setTime
(
new
Date
());
cal
.
add
(
Calendar
.
MONTH
,
-
1
);
cal
.
add
(
Calendar
.
MONTH
,
-
1
);
...
...
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