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
deb70718
Commit
deb70718
authored
Aug 17, 2021
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
b357163a
9bcbbe81
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
412 additions
and
387 deletions
+412
-387
FailureDetailsDto.java
...in/amos/boot/module/common/api/dto/FailureDetailsDto.java
+1
-1
FailureDetails.java
...in/amos/boot/module/common/api/entity/FailureDetails.java
+1
-1
FailureRepairlog.java
.../amos/boot/module/common/api/entity/FailureRepairlog.java
+5
-0
FailureStatuEnum.java
...n/amos/boot/module/common/api/enums/FailureStatuEnum.java
+2
-2
IFailureRepairlogService.java
...t/module/common/api/service/IFailureRepairlogService.java
+1
-1
CalendarStatusCountRespone.java
...ance/core/common/response/CalendarStatusCountRespone.java
+2
-2
AlertCalledMapper.xml
...e-tzs-api/src/main/resources/mapper/AlertCalledMapper.xml
+1
-1
FailureAuditController.java
.../module/common/biz/controller/FailureAuditController.java
+2
-4
FailureMaintainController.java
...dule/common/biz/controller/FailureMaintainController.java
+20
-4
FailureAuditServiceImpl.java
...dule/common/biz/service/impl/FailureAuditServiceImpl.java
+50
-20
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+0
-0
FailureMaintainServiceImpl.java
...e/common/biz/service/impl/FailureMaintainServiceImpl.java
+74
-23
FailureRepairlogServiceImpl.java
.../common/biz/service/impl/FailureRepairlogServiceImpl.java
+3
-3
CheckController.java
...amos/maintenance/business/controller/CheckController.java
+16
-25
StatisticsController.java
...maintenance/business/controller/StatisticsController.java
+42
-0
CheckMapper.java
...oin/amos/maintenance/business/dao/mapper/CheckMapper.java
+2
-2
PlanTaskMapper.java
.../amos/maintenance/business/dao/mapper/PlanTaskMapper.java
+1
-0
EquipFeign.java
...m/yeejoin/amos/maintenance/business/feign/EquipFeign.java
+10
-4
Remote3D.java
...com/yeejoin/amos/maintenance/business/feign/Remote3D.java
+0
-37
Remote3DServer.java
...ejoin/amos/maintenance/business/feign/Remote3DServer.java
+0
-131
CheckServiceImpl.java
...s/maintenance/business/service/impl/CheckServiceImpl.java
+9
-19
PointServiceImpl.java
...s/maintenance/business/service/impl/PointServiceImpl.java
+42
-35
StatisticsServiceImpl.java
...ntenance/business/service/impl/StatisticsServiceImpl.java
+46
-0
ICheckService.java
...mos/maintenance/business/service/intfc/ICheckService.java
+1
-1
IPointService.java
...mos/maintenance/business/service/intfc/IPointService.java
+1
-1
IStatisticsService.java
...aintenance/business/service/intfc/IStatisticsService.java
+16
-0
MaintenanceResourceData.java
...amos/maintenance/business/vo/MaintenanceResourceData.java
+4
-34
AlertCalledController.java
...boot/module/tzs/biz/controller/AlertCalledController.java
+7
-8
DispatchPaperController.java
...ot/module/tzs/biz/controller/DispatchPaperController.java
+1
-1
DispatchTaskController.java
...oot/module/tzs/biz/controller/DispatchTaskController.java
+1
-1
RepairConsultController.java
...ot/module/tzs/biz/controller/RepairConsultController.java
+1
-1
RescueProcessController.java
...ot/module/tzs/biz/controller/RescueProcessController.java
+1
-1
TemplateController.java
...os/boot/module/tzs/biz/controller/TemplateController.java
+1
-1
VoiceRecordFileController.java
.../module/tzs/biz/controller/VoiceRecordFileController.java
+1
-2
ESAlertCalledService.java
...oot/module/tzs/biz/service/impl/ESAlertCalledService.java
+9
-9
dbTemplate_check.xml
...tenance/src/main/resources/db/mapper/dbTemplate_check.xml
+17
-12
dbTemplate_plan_task.xml
...nce/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+21
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/FailureDetailsDto.java
View file @
deb70718
...
...
@@ -49,7 +49,7 @@ public class FailureDetailsDto extends BaseDto {
private
Integer
submissionPid
;
@ApiModelProperty
(
value
=
"组织code"
)
private
Stri
ng
bizCode
;
private
Lo
ng
bizCode
;
@ApiModelProperty
(
value
=
"报送时间"
)
private
Date
submissionTime
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/FailureDetails.java
View file @
deb70718
...
...
@@ -76,7 +76,7 @@ public class FailureDetails extends BaseEntity {
* 组织code
*/
@TableField
(
"biz_code"
)
private
Stri
ng
bizCode
;
private
Lo
ng
bizCode
;
/**
* 报送时间
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/FailureRepairlog.java
View file @
deb70718
...
...
@@ -32,6 +32,11 @@ public class FailureRepairlog extends BaseEntity {
*/
@TableField
(
"process_auditor"
)
private
String
processAuditor
;
/**
* 流程处理人
*/
@TableField
(
"process_auditor_name"
)
private
String
processAuditorName
;
/**
* 处理人所属部门
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/enums/FailureStatuEnum.java
View file @
deb70718
...
...
@@ -7,8 +7,8 @@ public enum FailureStatuEnum {
WAITING_MAINTAIN
(
2
,
"待维修"
),
WAITING_ACCEPTANCE
(
3
,
"待验收"
),
REFUSE
(
4
,
"已拒绝"
),
FINISH
(
5
,
"已完结"
)
;
FINISH
(
5
,
"已完结"
)
,
IN_MAINTENANCE
(
6
,
"维修中"
);
private
FailureStatuEnum
(
Integer
code
,
String
name
){
this
.
code
=
code
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IFailureRepairlogService.java
View file @
deb70718
...
...
@@ -9,7 +9,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
* @date 2021-08-12
*/
public
interface
IFailureRepairlogService
{
public
FailureRepairlog
findByprocessAuditor
Id
(
Lo
ng
userId
);
public
FailureRepairlog
findByprocessAuditor
(
Stri
ng
userId
);
public
FailureRepairlog
findByFaultId
(
Long
faultId
)
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/core/common/response/CalendarStatusCountRespone.java
View file @
deb70718
...
...
@@ -6,7 +6,7 @@ public class CalendarStatusCountRespone {
/**
* 个数
*/
private
double
count
;
private
Long
count
;
/**
* 状态
*/
...
...
@@ -16,7 +16,7 @@ public class CalendarStatusCountRespone {
public
double
getCount
()
{
return
count
;
}
public
void
setCount
(
double
count
)
{
public
void
setCount
(
Long
count
)
{
this
.
count
=
count
;
}
public
String
getStatus
()
{
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/resources/mapper/AlertCalledMapper.xml
View file @
deb70718
...
...
@@ -5,7 +5,7 @@
<select
id=
"queryAlertStatusCount"
resultType=
"java.util.Map"
>
SELECT
count( 1 ) calledCount,
sum( CASE WHEN father_alert
=
null THEN 1 ELSE 0 END ) majorAlertCount,
sum( CASE WHEN father_alert
is
null THEN 1 ELSE 0 END ) majorAlertCount,
sum( CASE WHEN alarm_type_code = 'KRJY' THEN 1 ELSE 0 END ) sleepyIncidentCount,
sum( CASE WHEN alarm_type_code = 'GZWX' THEN 1 ELSE 0 END ) faultRescueCount,
sum( CASE WHEN alarm_type_code = 'TSZX' THEN 1 ELSE 0 END ) suggestionsCount
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureAuditController.java
View file @
deb70718
...
...
@@ -40,10 +40,8 @@ public class FailureAuditController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
FailureAuditDto
>
save
(
@RequestBody
FailureAuditDto
model
)
throws
Exception
{
model
=
failureAuditServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
());
return
ResponseHelper
.
buildResponse
(
model
);
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureAuditDto
model
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureMaintainController.java
View file @
deb70718
...
...
@@ -38,8 +38,8 @@ public class FailureMaintainController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
FailureMaintainDto
>
save
(
@RequestBody
FailureMaintainDto
model
,
ReginParams
userInfo
)
{
model
=
failureMaintainServiceImpl
.
savemodel
(
model
,
userInfo
);
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureMaintainDto
model
)
{
failureMaintainServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()
);
return
ResponseHelper
.
buildResponse
(
model
);
}
...
...
@@ -53,11 +53,27 @@ public class FailureMaintainController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"验收操作"
,
notes
=
"根据sequenceNbr更新"
)
public
Object
updateBySequenceNbrFailureMaintain
(
@RequestBody
FailureMaintainDto
model
,
Integer
status
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
,
ReginParams
userInfo
)
{
public
Object
updateBySequenceNbrFailureMaintain
(
@RequestBody
FailureMaintainDto
model
,
Integer
status
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
updateModel
(
model
,
status
,
userInfo
));
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
updateModel
(
model
,
status
,
getSelectedOrgInfo
()
));
}
/**
* 根据sequenceNbr更新
* 根据传递的Status状态确认验收状态
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/update/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"维修完成"
,
notes
=
"根据sequenceNbr更新"
)
public
Object
updateByFailureMaintain
(
@RequestBody
FailureMaintainDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
updateStatus
(
model
,
getSelectedOrgInfo
()));
}
/*
*/
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureAuditServiceImpl.java
View file @
deb70718
...
...
@@ -3,9 +3,13 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -36,6 +40,8 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureAuditServiceImpl
.
class
);
/**
* 分页查询
*/
...
...
@@ -54,44 +60,66 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
* 发起审核
*/
@Transactional
public
FailureAuditDto
savemodel
(
FailureAuditDto
model
,
ReginParams
userInfo
)
throws
Exception
{
public
Object
savemodel
(
FailureAuditDto
model
,
ReginParams
userInfo
)
throws
Exception
{
int
condition
=
Integer
.
parseInt
(
model
.
getCondition
());
//根据审核的结果进行业务操作
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
model
.
setAuditTime
(
new
Date
());
model
.
setAuditDepartmentId
(
userInfo
.
getDepartment
().
getSequenceNbr
());
model
.
setAuditor
(
userInfo
.
getRole
().
getRoleName
());
model
.
setAuditDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
try
{
//根据审核的结果进行业务操作
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
}
FailureAuditDto
withModel
=
this
.
createWithModel
(
model
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
info
(
"添加故障审核信息到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
}
return
this
.
createWithModel
(
model
);
return
true
;
}
/**
* 修改故障保修单任务状态
*/
@Transactional
FailureDetailsDto
updateStatus
(
FailureAuditDto
model
,
FailureStatuEnum
status
,
ReginParams
userInfo
,
int
condition
)
throws
Exception
{
public
Boolean
updateStatus
(
FailureAuditDto
model
,
FailureStatuEnum
status
,
ReginParams
userInfo
,
int
condition
)
throws
Exception
{
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
//当前角色部门id为应急指挥科的时候 并且同意时 不修改主表状态 依然为待审核
//当前角色部门id为维修部门的时候 修改状态
if
(
userInfo
.
getDepartment
().
getSequenceNbr
()
==
failureDetailsDto
.
getBizCode
()
&&
condition
==
AuditResultEnum
.
AGREE
.
getCode
()){
failureDetailsDto
.
setCurrentStatus
(
failureDetailsDto
.
getCurrentStatus
());
}
else
if
(
userInfo
.
getDepartment
().
getSequenceNbr
()
!=
failureDetailsDto
.
getBizCode
()
)
{
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
}
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
String
conditionText
;
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
);
if
(
result
){
//添加报修日志
Long
faultId
=
model
.
getFaultId
();
model
.
setAuditTime
(
new
Date
());
model
.
setAuditDepartmentId
(
userInfo
.
getDepartment
().
getSequenceNbr
());
model
.
setAuditor
(
userInfo
.
getRole
().
getRoleName
());
model
.
setAuditDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
Date
processTime
=
model
.
getAuditTime
();
String
processDepartment
=
model
.
getAuditDepartment
();
String
processAuditor
=
model
.
getAuditor
();
Integer
processAuditorId
=
Integer
.
parseInt
(
userInfo
.
getUserModel
().
getUserId
())
;
Long
auditDepartmentId
=
(
userInfo
.
getDepartment
().
getSequenceNbr
());
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
)
{
conditionText
=
AuditResultEnum
.
AGREE
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
}
...
...
@@ -99,12 +127,14 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
conditionText
=
AuditResultEnum
.
SEND_BACK
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
}
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
()){
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
}
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
+
""
);
return
failureDetailsService
.
updateWithModel
(
failureDetailsDto
)
;
return
true
;
}
return
null
;
return
false
;
}
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureDetailsServiceImpl.java
View file @
deb70718
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureMaintainServiceImpl.java
View file @
deb70718
...
...
@@ -3,8 +3,14 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import
java.util.Date
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -26,6 +32,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService;
* @date 2021-08-04
*/
@Service
@Transactional
public
class
FailureMaintainServiceImpl
extends
BaseService
<
FailureMaintainDto
,
FailureMaintain
,
FailureMaintainMapper
>
implements
IFailureMaintainService
{
@Autowired
SourceFileServiceImpl
sourceFileServiceImpl
;
...
...
@@ -34,6 +41,11 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureMaintainServiceImpl
.
class
);
private
static
String
[]
MAINTENANCE_STATUS
=
{
"维修完成"
,
"维修中"
};
private
static
String
[]
PROCESS_RESULT
=
{
"验证通过"
,
"验证未通过"
};
/**
* 分页查询
*/
...
...
@@ -51,34 +63,67 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
/**
* 添加维修记录
*/
public
FailureMaintainDto
savemodel
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
public
Object
savemodel
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
failureDetailsService
.
checkExcuteTaskAuthMap
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
null
);
this
.
createWithModel
(
failureMaintainDto
);
//添加完成后修改保修单状态为待验收
try
{
this
.
createWithModel
(
failureMaintainDto
);
//添加完成后修改保修单状态为待验收
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getCode
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
//添加报修日志
String
processResult
=
MAINTENANCE_STATUS
[
1
];
//维修中
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
())){
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
}
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
null
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
info
(
"添加故障维修信息到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
}
return
true
;
}
/**
* 更新状态维修完成
*/
public
Boolean
updateStatus
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
try
{
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_ACCEPT
ANCE
.
getCode
());
failureDetailsService
.
updateWithModel
(
failureDetails
Dto
);
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
IN_MAINTEN
ANCE
.
getCode
());
this
.
updateWithModel
(
failureMaintain
Dto
);
//添加报修日志
String
processResult
=
"维修完成"
;
String
processResult
=
MAINTENANCE_STATUS
[
0
];
//维修完成
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
);
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
return
failureMaintainDto
;
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
())){
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
}
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
null
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
info
(
"更新故障验收信息到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
}
/**
* 根据FaultId查询
*/
public
List
<
FailureMaintain
>
findByfaultId
(
Long
faultId
)
{
Page
<
FailureMaintain
>
page
=
new
Page
<>();
QueryWrapper
<
FailureMaintain
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"submission_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
return
true
;
}
/**
...
...
@@ -87,21 +132,27 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
public
Boolean
updateModel
(
FailureMaintainDto
failureMaintainDto
,
Integer
status
,
ReginParams
userInfo
)
{
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
if
(
result
){
this
.
updateWithModel
(
failureMaintainDto
);
//根据status修改状态
String
processResult
=
new
String
();
String
condition
=
new
String
();
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
if
(
status
==
AuditResultEnum
.
AGREE
.
getCode
())
{
//同意状态为已完结
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
FINISH
.
getCode
());
if
(
status
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
()
==
failureDetailsDto
.
getBizCode
())
{
//同意状态为已完结
failureDetailsDto
.
setCurrentStatus
(
failureDetailsDto
.
getCurrentStatus
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
PROCESS_RESULT
[
0
]
;
condition
=
AuditResultEnum
.
AGREE
.
getName
();
}
else
if
(
status
==
AuditResultEnum
.
AGREE
.
getCode
()
)
{
//同意状态为已完结
failureDetailsDto
.
setCurrentStatus
(
failureDetailsDto
.
getCurrentStatus
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
"验证通过"
;
processResult
=
PROCESS_RESULT
[
0
]
;
condition
=
AuditResultEnum
.
AGREE
.
getName
();
}
else
{
//不同意状态为已拒绝
}
else
{
//不同意状态为已拒绝
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
REFUSE
.
getCode
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
"验证未通过"
;
processResult
=
PROCESS_RESULT
[
1
]
;
condition
=
AuditResultEnum
.
REFUSE
.
getName
();
}
//添加报修日志
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureRepairlogServiceImpl.java
View file @
deb70718
...
...
@@ -47,9 +47,9 @@ public class FailureRepairlogServiceImpl extends BaseService<FailureRepairlogDto
}
public
FailureRepairlog
findByprocessAuditor
Id
(
Lo
ng
userId
)
{
QueryWrapper
<
FailureRepairlog
>
queryWrapper
=
new
QueryWrapper
<
FailureRepairlog
>();
queryWrapper
.
eq
(
"process_auditor_id"
,
userId
);
public
FailureRepairlog
findByprocessAuditor
(
Stri
ng
userId
)
{
LambdaQueryWrapper
<
FailureRepairlog
>
queryWrapper
=
new
Lambda
QueryWrapper
<
FailureRepairlog
>();
queryWrapper
.
eq
(
FailureRepairlog:
:
getProcessAuditor
,
userId
);
queryWrapper
.
last
(
"LIMIT 1"
);
return
baseMapper
.
selectOne
(
queryWrapper
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/CheckController.java
View file @
deb70718
...
...
@@ -295,28 +295,24 @@ public class CheckController extends AbstractBaseController {
/**
* 获取巡检日历数据
*
* @param
queryRequests
* @param
date
* @return
*/
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"
获取巡检日历数据<font color='blue'>手机app</font>"
,
notes
=
"获取巡检日历数据<font color='blue'>手机app</font>
"
)
@
PostMapping
(
value
=
"
/checkCalendar"
,
produces
=
"application/json;charset=UTF-8"
)
@ApiOperation
(
value
=
"
维保日历-mobile"
,
notes
=
"维保日历-mobile
"
)
@
GetMapping
(
value
=
"/{date}
/checkCalendar"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
checkCalendar
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
)
{
try
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
roleTypeName
=
getRoleTypeName
(
reginParams
);
List
<
DaoCriteria
>
daoCriterias
=
buildDaoCriterias
(
queryRequests
,
true
,
loginOrgCode
,
roleTypeName
);
Map
<
String
,
Object
>
map
=
checkService
.
checkCalendar
(
CheckParamUtil
.
checkCalendar
(
daoCriterias
));
return
CommonResponseUtil
.
success
(
map
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
@ApiParam
(
value
=
"date,格式YYYY-MM-DD"
,
required
=
true
)
@PathVariable
String
date
)
{
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
Map
<
String
,
Object
>
authMap
=
Bean
.
BeantoMap
(
reginParams
.
getPersonIdentity
());
params
.
putAll
(
authMap
);
params
.
put
(
"checkTime"
,
date
);
params
.
put
(
"orgCode"
,
loginOrgCode
);
Map
<
String
,
Object
>
map
=
checkService
.
checkCalendar
(
params
);
return
CommonResponseUtil
.
success
(
map
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -347,13 +343,8 @@ public class CheckController extends AbstractBaseController {
@ApiOperation
(
value
=
"获取巡检记录详情信息<font color='blue'>手机app</font>"
,
notes
=
"获取巡检记录详情信息<font color='blue'>手机app</font>"
)
@RequestMapping
(
value
=
"/queryCheckDetail"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRecordById
(
@RequestParam
(
required
=
true
)
int
checkId
)
{
try
{
Map
<
String
,
Object
>
map
=
checkService
.
queryRecordById
(
checkId
);
return
CommonResponseUtil
.
success
(
map
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
Map
<
String
,
Object
>
map
=
checkService
.
queryRecordById
(
checkId
);
return
CommonResponseUtil
.
success
(
map
);
}
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/StatisticsController.java
0 → 100644
View file @
deb70718
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
controller
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IStatisticsService
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponse
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponseUtil
;
import
com.yeejoin.amos.maintenance.core.framework.PersonIdentify
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @author DELL
*/
@RestController
@RequestMapping
(
value
=
"/api/statistics"
)
@Api
(
tags
=
"统计api"
)
public
class
StatisticsController
extends
AbstractBaseController
{
@Autowired
IStatisticsService
iStatisticsService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PersonIdentify
@GetMapping
(
value
=
"/task"
)
@ApiOperation
(
value
=
"app首页任务统计"
)
public
CommonResponse
taskStatusStatistics
(){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
Map
<
String
,
Object
>
result
=
iStatisticsService
.
taskStatusStatistics
(
opIdentifyInfo
(),
loginOrgCode
);
return
CommonResponseUtil
.
success
(
result
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dao/mapper/CheckMapper.java
View file @
deb70718
...
...
@@ -45,14 +45,14 @@ public interface CheckMapper extends BaseMapper {
* @param param
* @return
*/
Map
<
String
,
Object
>
pieChartData
(
CheckRecordParam
param
);
Map
<
String
,
Object
>
pieChartData
(
Map
<
String
,
Object
>
param
);
/**
* 巡检日历日历数据
* @param param
* @return
*/
List
<
Map
<
String
,
Object
>>
calendarData
(
CheckRecordParam
param
);
List
<
Map
<
String
,
Object
>>
calendarData
(
Map
<
String
,
Object
>
param
);
List
<
Map
<
String
,
Object
>>
queryRecordByPointId
(
HashMap
<
String
,
Object
>
req
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dao/mapper/PlanTaskMapper.java
View file @
deb70718
...
...
@@ -179,4 +179,5 @@ public interface PlanTaskMapper extends BaseMapper {
List
<
Map
<
String
,
Object
>>
queryTimeAxis
(
HashMap
<
String
,
Object
>
params
);
List
<
Map
<
String
,
Object
>>
statisticsTaskWithAuth
(
Map
<
String
,
Object
>
param
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/feign/EquipFeign.java
View file @
deb70718
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
feign
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
...
...
@@ -37,5 +34,14 @@ public interface EquipFeign {
*/
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/area/tree"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
/**
* 查询维保到期设备
* @param type
* @param companyId
* @return
*/
@GetMapping
(
value
=
"${equip.fegin.prefix}+/facility"
)
List
<
Map
<
String
,
Object
>>
overTimeMaintenanceFacility
(
@RequestParam
String
type
,
String
companyId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/feign/Remote3D.java
deleted
100644 → 0
View file @
b357163a
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
feign
;
//@RequestLine
//@FeignClient(name = "${Remote3D.fegin.name}",configuration=FeignConfiguration.class)
//public interface Remote3D {
// @RequestMapping(value = "/patrol/check", method = RequestMethod.POST)
// @ResponseBody
// CommonResponse checkStatusPush( @RequestBody List<PointCheckInfoRespone> pointCheckInfo);
//
//
// @RequestMapping(value = "/patrol/task", method = RequestMethod.POST)
// CommonResponse errorTaskPushTo3D( @RequestBody List<TaskInfoRespone> taskInfoRespone);
//
//
// @RequestMapping(value = "/view3d/synchronous/points", method = RequestMethod.POST)
// CommonResponse pointInfoPush( @RequestBody List<PointInfoSyn3DRespone> pointInfoResponseList);
//
//
// @RequestMapping(value = "/view3d/synchronous/routes", method = RequestMethod.POST)
// CommonResponse routeInfoPush( @RequestBody List<RouteResponse> routeResponseList);
//
//
//
//
//
//
//
//}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/feign/Remote3DServer.java
deleted
100644 → 0
View file @
b357163a
//package com.yeejoin.amos.maintenance.business.feign;
//
//import java.util.List;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.http.HttpEntity;
//import org.springframework.http.HttpHeaders;
//import org.springframework.http.MediaType;
//import org.springframework.stereotype.Service;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.client.RestTemplate;
//
//import com.yeejoin.amos.maintenance.business.util.CommonResponse;
//import com.yeejoin.amos.maintenance.business.util.CommonResponseUtil;
//import com.yeejoin.amos.maintenance.core.common.response.PointCheckInfoRespone;
//import com.yeejoin.amos.maintenance.core.common.response.PointInfoSyn3DRespone;
//import com.yeejoin.amos.maintenance.core.common.response.RouteResponse;
//import com.yeejoin.amos.maintenance.core.common.response.TaskInfoRespone;
//
//
//
////三维远程访问
//@Service("remote3DServer")
//public class Remote3DServer {
// @Autowired
// private RestTemplate restTemplate;
//
// @Value("${Remote3D.fegin.name}")
// private String Remote3DFeginName;
//
//
// private static String checkStatusPush = "/patrol/check";
//
// private static String errorTaskPushTo3D = "/patrol/task";
//
// private static String pointInfoPush = "/view3d/synchronous/points";
//
// private static String routeInfoPush = "/view3d/synchronous/routes";
//
//
//
// public String geturls(String url){
// return "http://"+Remote3DFeginName+url;
// }
// public HttpHeaders getHeader(String toke,String product,String appKey){
// HttpHeaders headers = new HttpHeaders();
// headers.setContentType(MediaType.APPLICATION_JSON);
// headers.set("Content-Type", "application/json");
// headers.set("token", toke);
// headers.set("product",product);
// headers.set("appKey", appKey);
// return headers;
// }
//
//
// public CommonResponse checkStatusPush( String toke,String product,String appKey, List<PointCheckInfoRespone> pointCheckInfo){
// try {
// HttpEntity httpEntity = new HttpEntity<>(pointCheckInfo, getHeader( toke, product, appKey));
// CommonResponse commonResponse1 = restTemplate.postForObject(geturls(checkStatusPush),httpEntity, CommonResponse.class);
// return commonResponse1;
// } catch (Exception e) {
// e.printStackTrace();
// return CommonResponseUtil.failure("发送失败");
//
// }
// }
//
//
//
// public CommonResponse errorTaskPushTo3D( String toke,String product,String appKey, List<TaskInfoRespone> taskInfoRespone){
// try {
// HttpEntity httpEntity = new HttpEntity<>(taskInfoRespone, getHeader( toke, product, appKey));
// CommonResponse commonResponse1 = restTemplate.postForObject(geturls(errorTaskPushTo3D),httpEntity, CommonResponse.class);
// return commonResponse1;
// } catch (Exception e) {
// e.printStackTrace();
// return CommonResponseUtil.failure("发送失败");
//
// }
// }
//
//
// public CommonResponse pointInfoPush(String toke,String product,String appKey,List<PointInfoSyn3DRespone> pointInfoResponseList){
// try {
// HttpEntity httpEntity = new HttpEntity<>(pointInfoResponseList, getHeader( toke, product, appKey));
// CommonResponse commonResponse1 = restTemplate.postForObject(geturls(pointInfoPush),httpEntity, CommonResponse.class);
// return commonResponse1;
// } catch (Exception e) {
// e.printStackTrace();
// return CommonResponseUtil.failure("发送失败");
//
// }
// }
//
//
// public CommonResponse routeInfoPush( String toke,String product,String appKey, List<RouteResponse> routeResponseList){
// try {
// HttpEntity httpEntity = new HttpEntity<>(routeResponseList, getHeader( toke, product, appKey));
// CommonResponse commonResponse1 = restTemplate.postForObject(geturls(routeInfoPush),httpEntity, CommonResponse.class);
// return commonResponse1;
// } catch (Exception e) {
// e.printStackTrace();
// return CommonResponseUtil.failure("发送失败");
//
// }
// }
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/CheckServiceImpl.java
View file @
deb70718
...
...
@@ -624,26 +624,16 @@ public class CheckServiceImpl implements ICheckService {
}
@Override
public
Map
<
String
,
Object
>
checkCalendar
(
CheckRecordParam
recordP
aram
)
{
Map
<
String
,
Object
>
charData
=
checkMapper
.
pieChartData
(
recordP
aram
);
List
<
Map
<
String
,
Object
>>
calendarData
=
checkMapper
.
calendarData
(
recordP
aram
);
public
Map
<
String
,
Object
>
checkCalendar
(
Map
<
String
,
Object
>
p
aram
)
{
Map
<
String
,
Object
>
charData
=
checkMapper
.
pieChartData
(
p
aram
);
List
<
Map
<
String
,
Object
>>
calendarData
=
checkMapper
.
calendarData
(
p
aram
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
List
<
CalendarStatusCountRespone
>>
calendarMap
=
new
HashMap
<>();
if
(!
calendarData
.
isEmpty
())
{
calendarData
.
forEach
(
action
->
{
List
<
CalendarStatusCountRespone
>
statusCountList
=
new
ArrayList
<>();
CalendarStatusCountRespone
statusCount
=
new
CalendarStatusCountRespone
();
statusCount
.
setCount
(
Double
.
valueOf
(
action
.
get
(
"count"
).
toString
()));
statusCount
.
setStatus
(
action
.
get
(
"status"
).
toString
());
if
(
calendarMap
.
containsKey
(
action
.
get
(
"time"
)))
{
statusCountList
=
calendarMap
.
get
(
action
.
get
(
"time"
));
statusCountList
.
add
(
statusCount
);
}
else
{
statusCountList
.
add
(
statusCount
);
calendarMap
.
put
(
action
.
get
(
"time"
).
toString
(),
statusCountList
);
}
});
}
Map
<
String
,
List
<
CalendarStatusCountRespone
>>
calendarMap
=
calendarData
.
stream
().
collect
(
Collectors
.
groupingBy
(
map
->
map
.
get
(
"time"
).
toString
(),
Collectors
.
mapping
(
c
->{
CalendarStatusCountRespone
countRespone
=
new
CalendarStatusCountRespone
();
countRespone
.
setCount
(
Long
.
parseLong
(
c
.
get
(
"count"
).
toString
()));
countRespone
.
setStatus
(
c
.
get
(
"status"
).
toString
());
return
countRespone
;
},
Collectors
.
toList
())));
result
.
put
(
"charData"
,
charData
);
result
.
put
(
"calendarData"
,
calendarMap
);
return
result
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/PointServiceImpl.java
View file @
deb70718
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.service.impl;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
...
@@ -35,6 +36,7 @@ import org.springframework.data.domain.*;
import
org.springframework.data.domain.Sort.Direction
;
import
org.springframework.data.domain.Sort.Order
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -228,26 +230,19 @@ public class PointServiceImpl implements IPointService {
if
(!
pointInputItems
.
isEmpty
())
{
iPointInputItemDao
.
saveAll
(
pointInputItems
);
}
//TODO 2.分类暂时不需要 维保
}
@Override
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Long
>
delPointById
(
Long
[]
ids
)
{
List
<
Long
>
idList
=
new
ArrayList
<
Long
>();
for
(
long
pointId
:
ids
)
{
idList
.
add
(
pointId
);
}
iPointClassifyDao
.
deleteByPointId
(
idList
);
// 物理删除点的分类
idList
.
addAll
(
Arrays
.
asList
(
ids
));
List
<
PointInputItem
>
pointInputItem
=
iPointInputItemDao
.
findAllById
(
idList
);
List
<
Long
>
pointInputItemIds
=
Lists
.
transform
(
pointInputItem
,
PointInputItem:
:
getId
);
if
(
pointInputItemIds
.
size
()
>
0
)
iPointInputItemDao
.
deleteFmeaRelationByPointInputItemIds
(
pointInputItemIds
);
//物理删除fmea关联巡检点项
iPointInputItemDao
.
deleteByPointId
(
idList
);
// 物理删除p_point_inputitem表对应行
iPointPhotoDao
.
deleteByPointId
(
idList
);
// 物理删除点的图片信息
// iRoutePointDao.delRoutePointByPointId(idList); //
// 物理删除p_route_point中相关行
// 物理删除p_point_inputitem表对应行
iPointInputItemDao
.
deleteByPointId
(
idList
);
// 物理删除p_route_point、p_route_point_item中相关行
List
<
BigInteger
>
routePointIdList
=
iRoutePointDao
.
queryRoutePointByPointId
(
idList
);
for
(
BigInteger
routePointId
:
routePointIdList
)
{
iRoutePointItemDao
.
delRoutePointItem
(
routePointId
.
longValue
());
...
...
@@ -270,18 +265,19 @@ public class PointServiceImpl implements IPointService {
}
}
}
iPlanTaskDetailDao
.
deletePlanTaskDetailByPointId
(
idList
);
// 删除p_plan_task_detail相关行
// 删除p_plan_task_detail相关行
iPlanTaskDetailDao
.
deletePlanTaskDetailByPointId
(
idList
);
// 删除p_point相关行
iPointDao
.
delPointById
(
idList
);
return
idList
;
}
@Override
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Point
updatePoint
(
PointParam
pointParam
)
{
//1.更新点
long
pointId
=
pointParam
.
getPoint
().
getId
();
Point
newPoint
=
iPointDao
.
findById
(
pointId
).
get
(
);
Point
newPoint
=
iPointDao
.
findById
(
pointId
).
orElseThrow
(()->
new
RuntimeException
(
"找不到原始数据"
)
);
Bean
.
copyExistPropertis
(
pointParam
.
getPoint
(),
newPoint
);
newPoint
.
setLastUpdateTime
(
new
Date
());
iPointDao
.
save
(
newPoint
);
...
...
@@ -346,9 +342,9 @@ public class PointServiceImpl implements IPointService {
public
Page
<
PointVo
>
queryPointInfo
(
List
<
DaoCriteria
>
criterias
,
CommonPageable
commonPageable
,
String
loginOrgCode
)
{
BaseQuerySpecification
<
Point
>
spec
=
new
BaseQuerySpecification
<>(
criterias
);
Order
idOrder
=
new
Order
(
Direction
.
DESC
,
"id"
);
List
<
Order
>
orders
=
new
ArrayList
<
Order
>();
orders
.
add
(
idOrder
);
Sort
sort
=
Sort
.
by
(
orders
);
List
<
Order
>
orders
=
new
ArrayList
<
Order
>();
orders
.
add
(
idOrder
);
Sort
sort
=
Sort
.
by
(
orders
);
commonPageable
.
setSort
(
sort
);
Page
<
Point
>
pointPage
=
iPointDao
.
findAll
(
spec
,
commonPageable
);
List
<
PointInputItem
>
pointInputItems
=
iPointInputItemDao
.
findAll
();
...
...
@@ -367,9 +363,9 @@ public class PointServiceImpl implements IPointService {
public
List
<
PointVo
>
queryAllPoint
(
List
<
DaoCriteria
>
criterias
)
{
BaseQuerySpecification
<
Point
>
spec
=
new
BaseQuerySpecification
<>(
criterias
);
Order
idOrder
=
new
Order
(
Direction
.
DESC
,
"id"
);
List
<
Order
>
orders
=
new
ArrayList
<
Order
>();
orders
.
add
(
idOrder
);
Sort
sort
=
Sort
.
by
(
orders
);
List
<
Order
>
orders
=
new
ArrayList
<
Order
>();
orders
.
add
(
idOrder
);
Sort
sort
=
Sort
.
by
(
orders
);
List
<
PointVo
>
returnList
=
new
ArrayList
<>();
List
<
Point
>
list
=
iPointDao
.
findAll
(
spec
,
sort
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
...
...
@@ -381,6 +377,7 @@ public class PointServiceImpl implements IPointService {
}
return
returnList
;
}
@Override
public
List
<
PointInputItemVo
>
queryPointInputItem
(
Long
pointId
)
{
return
pointMapper
.
getPointInputItemById1
(
pointId
,
null
);
...
...
@@ -1089,11 +1086,27 @@ public class PointServiceImpl implements IPointService {
return
equipFeign
.
getRegionTress
();
}
@Override
@Async
public
void
syncSavePoint
(
List
<
MaintenanceResourceData
>
list
,
String
orgCode
,
String
userId
)
{
List
<
Point
>
points
=
new
ArrayList
<>();
List
<
PointInputItem
>
inputItems
=
new
ArrayList
<>();
List
<
Long
>
ids
=
new
ArrayList
<
Long
>();
List
<
Long
>
ids
=
new
ArrayList
<>();
//1.删除已有数据
for
(
MaintenanceResourceData
x
:
list
)
{
String
pointNo
=
x
.
getFireFacilityCode
();
String
originalId
=
String
.
valueOf
(
x
.
getFireFacilityId
());
Long
id
=
iPointDao
.
findPointByEquipmentIdAndFireFacilityId
(
pointNo
,
originalId
);
if
(
null
!=
id
)
{
ids
.
add
(
id
);
}
}
if
(!
ids
.
isEmpty
())
{
Long
[]
idsArray
=
ids
.
toArray
(
new
Long
[
0
]);
delPointById
(
idsArray
);
}
//2.创建
for
(
MaintenanceResourceData
x
:
list
)
{
Point
point
=
new
Point
();
String
pointNo
=
StringUtil
.
isNotEmpty
(
x
.
getFireFacilityCode
())
?
x
.
getFireFacilityCode
()
:
String
.
valueOf
(
sequence
.
nextId
());
...
...
@@ -1107,16 +1120,13 @@ public class PointServiceImpl implements IPointService {
point
.
setBelongSystemName
(
x
.
getFireFightSysName
());
point
.
setOwnerId
(
String
.
valueOf
(
x
.
getOwnerUnitId
()));
point
.
setOwnerName
(
x
.
getOwnerUnitName
());
point
.
setAddress
(
x
.
getLocation
());
point
.
setBuildingId
(
x
.
getBuildingId
()
!=
null
?
x
.
getBuildingId
().
toString
()
:
""
);
point
.
setBuildingName
(
x
.
getBuildingName
());
point
.
setAddress
(
x
.
getArea
());
point
.
setLevel
(
""
);
point
.
setCreatorId
(
userId
);
point
.
setOrgCode
(
orgCode
);
points
.
add
(
point
);
Long
id
=
iPointDao
.
findPointByEquipmentIdAndFireFacilityId
(
pointNo
,
originalId
);
if
(
null
!=
id
)
{
ids
.
add
(
id
);
iPointDao
.
delPointBIds
(
id
);
}
iPointDao
.
save
(
point
);
List
<
InputItem
>
inputItemVos
=
inputItemMapper
.
getInputItemByEquipmentName
(
x
.
getClassifyName
(),
orgCode
);
if
(
0
<
inputItemVos
.
size
())
{
...
...
@@ -1129,9 +1139,6 @@ public class PointServiceImpl implements IPointService {
});
}
}
if
(
0
<
ids
.
size
())
{
iPointInputItemDao
.
deleteByPointId
(
ids
);
}
iPointInputItemDao
.
saveAll
(
inputItems
);
}
...
...
@@ -1139,9 +1146,9 @@ public class PointServiceImpl implements IPointService {
public
Page
<
PointDto
>
queryPointInfoWithItem
(
List
<
DaoCriteria
>
criterias
,
CommonPageable
cPageable
,
Long
ownerId
)
{
BaseQuerySpecification
<
Point
>
spec
=
new
BaseQuerySpecification
<>(
criterias
);
Order
idOrder
=
new
Order
(
Direction
.
DESC
,
"id"
);
List
<
Order
>
orders
=
new
ArrayList
<
Order
>();
orders
.
add
(
idOrder
);
Sort
sort
=
Sort
.
by
(
orders
);
List
<
Order
>
orders
=
new
ArrayList
<
Order
>();
orders
.
add
(
idOrder
);
Sort
sort
=
Sort
.
by
(
orders
);
cPageable
.
setSort
(
sort
);
Page
<
Point
>
pointPage
=
iPointDao
.
findAll
(
spec
,
cPageable
);
List
<
PointInputItem
>
pointInputItems
=
iPointInputItemDao
.
findAll
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/StatisticsServiceImpl.java
0 → 100644
View file @
deb70718
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
impl
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IStatisticsService
;
import
com.yeejoin.amos.maintenance.common.enums.PlanTaskDetailIsFinishEnum
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @author DELL
*/
@Service
public
class
StatisticsServiceImpl
implements
IStatisticsService
{
@Autowired
PlanTaskMapper
planTaskMapper
;
@Autowired
EquipFeign
equipFeign
;
@Override
public
Map
<
String
,
Object
>
taskStatusStatistics
(
ReginParams
.
PersonIdentity
opIdentifyInfo
,
String
orgCode
)
{
Map
<
String
,
Object
>
param
=
Bean
.
BeantoMap
(
opIdentifyInfo
);
param
.
put
(
"orgCode"
,
orgCode
);
List
<
Map
<
String
,
Object
>>
list
=
planTaskMapper
.
statisticsTaskWithAuth
(
param
);
Map
<
Integer
,
Long
>
statusNumberMap
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
map
->
Integer
.
parseInt
(
map
.
get
(
"is_finish"
).
toString
()),
v
->
Long
.
parseLong
(
v
.
get
(
"total"
).
toString
())));
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
// 待执行任务数量
resultMap
.
put
(
"waitExecuteTask"
,
statusNumberMap
.
get
(
PlanTaskDetailIsFinishEnum
.
UNFINISHED
.
getValue
())
==
null
?
0L
:
statusNumberMap
.
get
(
PlanTaskDetailIsFinishEnum
.
UNFINISHED
.
getValue
()));
// 超时任务数量
resultMap
.
put
(
"overTimeTask"
,
statusNumberMap
.
get
(
PlanTaskDetailIsFinishEnum
.
OVERTIME
.
getValue
())
==
null
?
0L
:
statusNumberMap
.
get
(
PlanTaskDetailIsFinishEnum
.
OVERTIME
.
getValue
()));
List
<
Map
<
String
,
Object
>>
overTimeFacility
=
new
ArrayList
<>();
//overTimeFacility = equipFeign.overTimeMaintenanceFacility(opIdentifyInfo.getIdentityType(),opIdentifyInfo.getCompanyId());
// 到期维保设备
resultMap
.
put
(
"overTimeFacility"
,
overTimeFacility
.
size
());
return
resultMap
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/intfc/ICheckService.java
View file @
deb70718
...
...
@@ -66,7 +66,7 @@ public interface ICheckService {
* @param requestParam
* @return
*/
Map
<
String
,
Object
>
checkCalendar
(
CheckRecordParam
requestParam
);
Map
<
String
,
Object
>
checkCalendar
(
Map
<
String
,
Object
>
requestParam
);
/**
* 根据点ID查询点巡检记录 手机APP
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/intfc/IPointService.java
View file @
deb70718
...
...
@@ -297,7 +297,7 @@ public interface IPointService {
List
queryItemList4RoutePoint
(
Long
pointId
,
Long
equipId
);
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
void
syncSavePoint
(
List
<
MaintenanceResourceData
>
list
,
String
orgCode
,
String
userId
);
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/intfc/IStatisticsService.java
0 → 100644
View file @
deb70718
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
intfc
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
java.util.Map
;
/**
* @author DELL
*/
public
interface
IStatisticsService
{
/**
* 维保任务统计
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
taskStatusStatistics
(
ReginParams
.
PersonIdentity
opIdentifyInfo
,
String
loginOrgCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/vo/MaintenanceResourceData.java
View file @
deb70718
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
vo
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
...
...
@@ -53,7 +52,6 @@ public class MaintenanceResourceData {
/**
* 业主单位名称
*/
@Excel
(
name
=
"所属单位"
,
width
=
30
,
orderNum
=
"7"
)
private
String
ownerUnitName
;
/**
...
...
@@ -69,7 +67,6 @@ public class MaintenanceResourceData {
/**
* 消防系统名称
*/
@Excel
(
name
=
"所属消防系统"
,
width
=
30
,
orderNum
=
"4"
)
private
String
fireFightSysName
;
/**
...
...
@@ -85,7 +82,6 @@ public class MaintenanceResourceData {
/**
* 分类名称
*/
@Excel
(
name
=
"设施类型"
,
width
=
30
,
orderNum
=
"3"
)
private
String
classifyName
;
/**
...
...
@@ -101,13 +97,11 @@ public class MaintenanceResourceData {
/**
* 消防设施编码
*/
@Excel
(
name
=
"设施编码"
,
width
=
30
,
orderNum
=
"6"
)
private
String
fireFacilityCode
;
/**
* 消防设施名称
*/
@Excel
(
name
=
"设施名称"
,
width
=
30
,
orderNum
=
"1"
)
private
String
fireFacilityName
;
/**
...
...
@@ -116,29 +110,10 @@ public class MaintenanceResourceData {
private
String
fireFacilityType
;
/**
* 维保到期时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"到期维保时间"
,
exportFormat
=
"yyyy-MM-dd HH:mm:ss"
,
importFormat
=
"yyyy-MM-dd HH:mm:ss"
,
width
=
30
,
orderNum
=
"5"
)
private
Date
maintenanceExpirationTime
;
/**
* 位置
*/
@Excel
(
name
=
"安装或设置位置"
,
width
=
50
,
orderNum
=
"2"
)
private
String
location
;
/**
* 建筑层级IDS
*/
private
String
buildTierIds
;
/**
* 新增和更新执行
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"添加时间"
,
exportFormat
=
"yyyy-MM-dd HH:mm:ss"
,
importFormat
=
"yyyy-MM-dd HH:mm:ss"
,
width
=
30
,
orderNum
=
"8"
)
private
Date
createDate
;
/**
* 建筑ID
...
...
@@ -150,17 +125,12 @@ public class MaintenanceResourceData {
*/
private
String
buildingName
;
/**
* 是否已关联
*/
private
List
<
Long
>
buildingIds
;
/**
*
是否已关联
*
详情位置
*/
private
Boolean
isRelation
;
private
String
area
;
// public void setRelation(Boolean relation) {
// isRelation = relation == null ? null : false;
// }
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/AlertCalledController.java
View file @
deb70718
...
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.SystemClock
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -68,7 +67,7 @@ import java.util.stream.Stream;
*/
@RestController
@Api
(
tags
=
"警情接警填报记录Api"
)
@RequestMapping
(
value
=
"/
tzs/
alert-called"
)
@RequestMapping
(
value
=
"/alert-called"
)
public
class
AlertCalledController
extends
BaseController
{
@Autowired
...
...
@@ -218,21 +217,21 @@ public class AlertCalledController extends BaseController {
// 当天接警
alarmStatisticsDto
.
setTodayAlarmNum
(
map
.
get
(
"calledCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"calledCount"
).
toString
()))
;
//当天提交
alarmStatisticsDto
.
set
TodayAlarm
Num
(
map
.
get
(
"majorAlertCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"majorAlertCount"
).
toString
()))
;
alarmStatisticsDto
.
set
Submit
Num
(
map
.
get
(
"majorAlertCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"majorAlertCount"
).
toString
()))
;
//投诉咨询数量
alarmStatisticsDto
.
setSuggestions
(
map
.
get
(
"suggestionsCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"suggestionsCount"
).
toString
()))
;
//故障维修数量
alarmStatisticsDto
.
set
Suggestions
(
map
.
get
(
"faultRescueCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"faultRescueCount"
).
toString
()))
;
alarmStatisticsDto
.
set
FaultRescue
(
map
.
get
(
"faultRescueCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"faultRescueCount"
).
toString
()))
;
//困人救援数量
alarmStatisticsDto
.
setS
uggestions
(
map
.
get
(
"sleepyIncidentCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"sleepyIncidentCount"
).
toString
()))
;
alarmStatisticsDto
.
setS
leepyIncident
(
map
.
get
(
"sleepyIncidentCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"sleepyIncidentCount"
).
toString
()))
;
Map
<
String
,
Integer
>
recordMap
=
Maps
.
newHashMap
();
// 近七天办理数量
for
(
int
i
=
1
;
i
<
8
;
i
++)
{
Map
<
String
,
Object
>
nearlySevenDaysMap
=
iAlertCalledService
.
getAlertInfoList
(
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
"yyyy-MM-dd"
)+
" 00:00:00"
,
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
"yyyy-MM-dd"
)+
" 23:59:59"
,
null
,
Map
<
String
,
Object
>
nearlySevenDaysMap
=
iAlertCalledService
.
getAlertInfoList
(
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
-
i
).
getTime
(),
"yyyy-MM-dd"
)+
" 00:00:00"
,
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
-
i
).
getTime
(),
"yyyy-MM-dd"
)+
" 23:59:59"
,
null
,
getUserInfo
().
getUserId
());
recordMap
.
put
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddDays
(
new
Date
(),
-
i
),
"
"
),
nearlySevenDaysMap
.
get
(
"calledCount"
)
==
null
?
0
:
Integer
.
valueOf
(
nearlySevenDaysMap
.
get
(
"calledCount"
).
toString
()));
recordMap
.
put
(
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
-
i
).
getTime
(),
"yyyy-MM-dd
"
),
nearlySevenDaysMap
.
get
(
"calledCount"
)
==
null
?
0
:
Integer
.
valueOf
(
nearlySevenDaysMap
.
get
(
"calledCount"
).
toString
()));
}
alarmStatisticsDto
.
setNearlySevenDaysNum
(
recordMap
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/DispatchPaperController.java
View file @
deb70718
...
...
@@ -34,7 +34,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
*/
@RestController
@Api
(
tags
=
"派遣单Api"
)
@RequestMapping
(
value
=
"/
tzs/
dispatch-paper"
)
@RequestMapping
(
value
=
"/dispatch-paper"
)
public
class
DispatchPaperController
extends
BaseController
{
@Autowired
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/DispatchTaskController.java
View file @
deb70718
...
...
@@ -34,7 +34,7 @@ import io.swagger.annotations.ApiOperation;
*/
@RestController
@Api
(
tags
=
"派遣任务Api"
)
@RequestMapping
(
value
=
"/
tzs/
dispatch-task"
)
@RequestMapping
(
value
=
"/dispatch-task"
)
public
class
DispatchTaskController
extends
BaseController
{
@Autowired
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/RepairConsultController.java
View file @
deb70718
...
...
@@ -35,7 +35,7 @@ import java.util.List;
*/
@RestController
@Api
(
tags
=
"处置过程Api"
)
@RequestMapping
(
value
=
"/
tzs/
repair-consult"
)
@RequestMapping
(
value
=
"/repair-consult"
)
public
class
RepairConsultController
extends
BaseController
{
@Autowired
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/RescueProcessController.java
View file @
deb70718
...
...
@@ -34,7 +34,7 @@ import io.swagger.annotations.ApiOperation;
*/
@RestController
@Api
(
tags
=
"救援过程表Api"
)
@RequestMapping
(
value
=
"/
tzs/
rescue-process"
)
@RequestMapping
(
value
=
"/rescue-process"
)
public
class
RescueProcessController
extends
BaseController
{
@Autowired
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/TemplateController.java
View file @
deb70718
...
...
@@ -32,7 +32,7 @@ import java.util.List;
*/
@RestController
@Api
(
tags
=
"模板表Api"
)
@RequestMapping
(
value
=
"/t
zs/t
emplate"
)
@RequestMapping
(
value
=
"/template"
)
public
class
TemplateController
extends
BaseController
{
@Autowired
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/VoiceRecordFileController.java
View file @
deb70718
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
...
...
@@ -39,7 +38,7 @@ import java.util.UUID;
*/
@RestController
@Api
(
tags
=
"通话记录附件Api"
)
@RequestMapping
(
value
=
"/
tzs/
voice-record-file"
)
@RequestMapping
(
value
=
"/voice-record-file"
)
public
class
VoiceRecordFileController
extends
BaseController
{
@Autowired
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/ESAlertCalledService.java
View file @
deb70718
...
...
@@ -171,39 +171,39 @@ public class ESAlertCalledService {
long
currentTime
=
System
.
currentTimeMillis
()
;
currentTime
=
currentTime
-
120
*
60
*
1000
;
BoolQueryBuilder
qb1
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
rangeQuery
(
"callTimeLong"
).
gte
(
currentTime
));
.
filter
(
QueryBuilders
.
rangeQuery
(
"callTimeLong"
).
gte
(
currentTime
));
boolMust
.
must
(
qb1
);
//报警电话一致
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getEmergencyCall
())
&&
!
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactPhone
()))
{
BoolQueryBuilder
qb2
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"emergencyCall.keyword"
,
alertCalled
.
getEmergencyCall
()))
.
must
(
QueryBuilders
.
termQuery
(
"contactPhone.keyword"
,
alertCalled
.
getContactPhone
()));
boolMust
.
should
(
qb2
);
.
should
(
QueryBuilders
.
termQuery
(
"emergencyCall.keyword"
,
alertCalled
.
getEmergencyCall
()))
.
should
(
QueryBuilders
.
termQuery
(
"contactPhone.keyword"
,
alertCalled
.
getContactPhone
()));
boolMust
.
must
(
qb2
);
}
//事发地点一致,或相距不超过200米的
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getAddress
()))
{
BoolQueryBuilder
qb3
=
QueryBuilders
.
boolQuery
()
.
should
(
QueryBuilders
.
matchQuery
(
"address"
,
alertCalled
.
getAddress
()));
.
filter
(
QueryBuilders
.
matchQuery
(
"address"
,
alertCalled
.
getAddress
()));
boolMust
.
should
(
qb3
);
}
//警情类型一致
BoolQueryBuilder
qb4
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"alarmTypeCode"
,
alertCalled
.
getAlarmTypeCode
()));
.
filter
(
QueryBuilders
.
termQuery
(
"alarmTypeCode"
,
alertCalled
.
getAlarmTypeCode
()));
boolMust
.
must
(
qb4
);
//使用单位名称一致
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getUseUnit
()))
{
BoolQueryBuilder
qb5
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"useUnit.keyword"
,
alertCalled
.
getUseUnit
()));
.
filter
(
QueryBuilders
.
termQuery
(
"useUnit.keyword"
,
alertCalled
.
getUseUnit
()));
boolMust
.
must
(
qb5
);
}
//电梯识别码一致
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getDeviceId
()))
{
BoolQueryBuilder
qb6
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"deviceId.keyword"
,
alertCalled
.
getDeviceId
()));
boolMust
.
should
(
qb6
);
.
filter
(
QueryBuilders
.
termQuery
(
"deviceId.keyword"
,
alertCalled
.
getDeviceId
()));
boolMust
.
must
(
qb6
);
}
/**
...
...
amos-boot-system-maintenance/src/main/resources/db/mapper/dbTemplate_check.xml
View file @
deb70718
...
...
@@ -286,27 +286,32 @@
COUNT(id) count
FROM
p_check
WHERE
DATE_FORMAT(check_time, '%Y-%m') = #{checkTime}
<if
test=
"userId!=null and userId!=0"
>
AND FIND_IN_SET(#{userId}, user_id)>0
</if>
<if
test=
"routeId!=null and routeId!=0"
>
AND route_id = #{routeId}
</if>
<if
test=
"orgCode!=null"
>
AND org_code LIKE #{orgCode}
</if>
<include
refid=
"calendar-where"
/>
</select>
<sql
id=
"calendar-where"
>
<where>
DATE_FORMAT(check_time, '%Y-%m') = #{checkTime}
<choose>
<when
test=
"identityType==1"
>
And (org_code LIKE CONCAT( #{orgCode}, '-%' ) or org_code= #{orgCode} )
</when>
<when
test=
"identityType==2"
>
And owner_id = #{companyId}
</when>
</choose>
</where>
</sql>
<select
id=
"calendarData"
resultType=
"Map"
>
SELECT
sum(is_ok
) AS count,
count(id
) AS count,
DATE_FORMAT(check_time, '%Y-%m-%d') time,
is_ok status
FROM
p_check
WHERE
DATE_FORMAT(check_time, '%Y-%m') = #{checkTime}
<if
test=
"userId!=null and userId!=0"
>
AND FIND_IN_SET(#{userId}, user_id)>0
</if>
<if
test=
"routeId!=null and routeId!=0"
>
AND route_id = #{routeId}
</if>
<if
test=
"orgCode!=null"
>
AND org_code LIKE #{orgCode}
</if>
<include
refid=
"calendar-where"
/>
GROUP BY is_ok,time
ORDER BY time
ORDER BY
check_
time
</select>
...
...
amos-boot-system-maintenance/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
deb70718
...
...
@@ -833,4 +833,24 @@
ORDER BY
ppk.begin_time DESC LIMIT 60
</select>
<select
id=
"statisticsTaskWithAuth"
resultType=
"java.util.Map"
>
SELECT
count(1) as total,
td.is_finish
from p_plan_task_detail td ,
p_plan_task t,
p_route r
where
td.task_no = t.id
and t.route_id = r.id
<choose>
<when
test=
"identityType==1"
>
and (t.org_code LIKE CONCAT( #{orgCode}, '-%' ) or t.org_code= #{orgCode} )
</when>
<when
test=
"identityType==2"
>
And r.owner_id = #{companyId}
</when>
</choose>
GROUP BY td.is_finish
</select>
</mapper>
\ No newline at end of file
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