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
Show whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
488 additions
and
443 deletions
+488
-443
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
+40
-10
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+107
-87
FailureMaintainServiceImpl.java
...e/common/biz/service/impl/FailureMaintainServiceImpl.java
+67
-16
FailureRepairlogServiceImpl.java
.../common/biz/service/impl/FailureRepairlogServiceImpl.java
+3
-3
CheckController.java
...amos/maintenance/business/controller/CheckController.java
+11
-20
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
+33
-26
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 {
...
@@ -49,7 +49,7 @@ public class FailureDetailsDto extends BaseDto {
private
Integer
submissionPid
;
private
Integer
submissionPid
;
@ApiModelProperty
(
value
=
"组织code"
)
@ApiModelProperty
(
value
=
"组织code"
)
private
Stri
ng
bizCode
;
private
Lo
ng
bizCode
;
@ApiModelProperty
(
value
=
"报送时间"
)
@ApiModelProperty
(
value
=
"报送时间"
)
private
Date
submissionTime
;
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 {
...
@@ -76,7 +76,7 @@ public class FailureDetails extends BaseEntity {
* 组织code
* 组织code
*/
*/
@TableField
(
"biz_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 {
...
@@ -32,6 +32,11 @@ public class FailureRepairlog extends BaseEntity {
*/
*/
@TableField
(
"process_auditor"
)
@TableField
(
"process_auditor"
)
private
String
processAuditor
;
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 {
...
@@ -7,8 +7,8 @@ public enum FailureStatuEnum {
WAITING_MAINTAIN
(
2
,
"待维修"
),
WAITING_MAINTAIN
(
2
,
"待维修"
),
WAITING_ACCEPTANCE
(
3
,
"待验收"
),
WAITING_ACCEPTANCE
(
3
,
"待验收"
),
REFUSE
(
4
,
"已拒绝"
),
REFUSE
(
4
,
"已拒绝"
),
FINISH
(
5
,
"已完结"
)
;
FINISH
(
5
,
"已完结"
)
,
IN_MAINTENANCE
(
6
,
"维修中"
);
private
FailureStatuEnum
(
Integer
code
,
String
name
){
private
FailureStatuEnum
(
Integer
code
,
String
name
){
this
.
code
=
code
;
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;
...
@@ -9,7 +9,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
* @date 2021-08-12
* @date 2021-08-12
*/
*/
public
interface
IFailureRepairlogService
{
public
interface
IFailureRepairlogService
{
public
FailureRepairlog
findByprocessAuditor
Id
(
Lo
ng
userId
);
public
FailureRepairlog
findByprocessAuditor
(
Stri
ng
userId
);
public
FailureRepairlog
findByFaultId
(
Long
faultId
)
;
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 {
...
@@ -6,7 +6,7 @@ public class CalendarStatusCountRespone {
/**
/**
* 个数
* 个数
*/
*/
private
double
count
;
private
Long
count
;
/**
/**
* 状态
* 状态
*/
*/
...
@@ -16,7 +16,7 @@ public class CalendarStatusCountRespone {
...
@@ -16,7 +16,7 @@ public class CalendarStatusCountRespone {
public
double
getCount
()
{
public
double
getCount
()
{
return
count
;
return
count
;
}
}
public
void
setCount
(
double
count
)
{
public
void
setCount
(
Long
count
)
{
this
.
count
=
count
;
this
.
count
=
count
;
}
}
public
String
getStatus
()
{
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 @@
...
@@ -5,7 +5,7 @@
<select
id=
"queryAlertStatusCount"
resultType=
"java.util.Map"
>
<select
id=
"queryAlertStatusCount"
resultType=
"java.util.Map"
>
SELECT
SELECT
count( 1 ) calledCount,
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 = '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 = 'GZWX' THEN 1 ELSE 0 END ) faultRescueCount,
sum( CASE WHEN alarm_type_code = 'TSZX' THEN 1 ELSE 0 END ) suggestionsCount
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 {
...
@@ -40,10 +40,8 @@ public class FailureAuditController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
FailureAuditDto
>
save
(
@RequestBody
FailureAuditDto
model
)
throws
Exception
{
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureAuditDto
model
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
model
=
failureAuditServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
());
return
ResponseHelper
.
buildResponse
(
model
);
}
}
...
...
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 {
...
@@ -38,8 +38,8 @@ public class FailureMaintainController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
FailureMaintainDto
>
save
(
@RequestBody
FailureMaintainDto
model
,
ReginParams
userInfo
)
{
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureMaintainDto
model
)
{
model
=
failureMaintainServiceImpl
.
savemodel
(
model
,
userInfo
);
failureMaintainServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()
);
return
ResponseHelper
.
buildResponse
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
}
...
@@ -53,11 +53,27 @@ public class FailureMaintainController extends BaseController {
...
@@ -53,11 +53,27 @@ public class FailureMaintainController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"验收操作"
,
notes
=
"根据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
);
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;
...
@@ -3,9 +3,13 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
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.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -36,6 +40,8 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -36,6 +40,8 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
@Autowired
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
FailureRepairlogServiceImpl
failureRepairlogService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureAuditServiceImpl
.
class
);
/**
/**
* 分页查询
* 分页查询
*/
*/
...
@@ -54,9 +60,15 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -54,9 +60,15 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
* 发起审核
* 发起审核
*/
*/
@Transactional
@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
());
int
condition
=
Integer
.
parseInt
(
model
.
getCondition
());
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
())
{
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
...
@@ -65,33 +77,49 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -65,33 +77,49 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
}
}
return
this
.
createWithModel
(
model
);
FailureAuditDto
withModel
=
this
.
createWithModel
(
model
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
info
(
"添加故障审核信息到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
}
return
true
;
}
}
/**
/**
* 修改故障保修单任务状态
* 修改故障保修单任务状态
*/
*/
@Transactional
@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
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
//当前角色部门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
.
setCurrentStatus
(
status
.
getCode
());
}
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
String
conditionText
;
String
conditionText
;
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
);
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
);
if
(
result
){
if
(
result
){
//添加报修日志
//添加报修日志
Long
faultId
=
model
.
getFaultId
();
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
();
Date
processTime
=
model
.
getAuditTime
();
String
processDepartment
=
model
.
getAuditDepartment
();
String
processDepartment
=
model
.
getAuditDepartment
();
String
processAuditor
=
model
.
getAuditor
();
String
processAuditor
=
model
.
getAuditor
();
Integer
processAuditorId
=
Integer
.
parseInt
(
userInfo
.
getUserModel
().
getUserId
())
;
Integer
processAuditorId
=
Integer
.
parseInt
(
userInfo
.
getUserModel
().
getUserId
())
;
Long
auditDepartmentId
=
(
userInfo
.
getDepartment
().
getSequenceNbr
());
Long
auditDepartmentId
=
(
userInfo
.
getDepartment
().
getSequenceNbr
());
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
)
{
conditionText
=
AuditResultEnum
.
AGREE
.
getName
();
conditionText
=
AuditResultEnum
.
AGREE
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
}
}
...
@@ -99,12 +127,14 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -99,12 +127,14 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
conditionText
=
AuditResultEnum
.
SEND_BACK
.
getName
();
conditionText
=
AuditResultEnum
.
SEND_BACK
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
}
}
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
()){
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
}
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
+
""
);
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
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.lang.reflect.InvocationTargetException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
...
@@ -10,6 +11,7 @@ import java.util.Map;
...
@@ -10,6 +11,7 @@ import java.util.Map;
import
java.util.Random
;
import
java.util.Random
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -17,6 +19,7 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -17,6 +19,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
...
@@ -24,7 +27,9 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -24,7 +27,9 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.BeanUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.itextpdf.text.pdf.PdfStructTreeController.returnType
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
...
@@ -73,7 +78,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -73,7 +78,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
IFailureRepairlogService
failureRepairlog
;
IFailureRepairlogService
failureRepairlog
;
public
static
String
EMERGENCY_COMMAND
=
"应急指挥科"
;
public
static
String
EMERGENCY_COMMAND
=
"应急指挥科"
;
public
static
String
[]
PROCESS_NAME
=
{
"提交维修单"
,
"审核"
,
"维修"
,
"验收"
};
public
static
String
[]
PROCESS_NAME
=
{
"提交维修单"
,
"审核"
,
"维修"
,
"验收"
};
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureDetailsServiceImpl
.
class
);
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureDetailsServiceImpl
.
class
);
...
@@ -84,21 +89,18 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -84,21 +89,18 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/**
/**
* 分页查询
* 分页查询
*/
*/
public
IPage
<
FailureDetails
>
queryAllPage
(
long
size
,
public
IPage
<
FailureDetails
>
queryAllPage
(
long
size
,
long
current
)
{
long
current
)
{
QueryWrapper
<
FailureDetails
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
FailureDetails
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
orderByDesc
(
"submission_time"
);
wrapper
.
orderByDesc
(
"submission_time"
);
IPage
<
FailureDetails
>
page
=
new
Page
<>(
current
,
size
);
IPage
<
FailureDetails
>
page
=
new
Page
<>(
current
,
size
);
return
baseMapper
.
selectPage
(
page
,
wrapper
);
return
baseMapper
.
selectPage
(
page
,
wrapper
);
}
}
public
IPage
<
FailureDetails
>
queryForFailureDetailsPage
(
Page
<
FailureDetails
>
page
,
AgencyUserModel
userInfo
,
Integer
type
)
{
if
(
type
.
equals
(
SELECY_ALL
))
{
public
IPage
<
FailureDetails
>
queryForFailureDetailsPage
(
Page
<
FailureDetails
>
page
,
return
this
.
queryAllPage
(
page
.
getSize
(),
page
.
getCurrent
());
AgencyUserModel
userInfo
,
Integer
type
)
{
if
(
type
.
equals
(
SELECY_ALL
)
)
{
return
this
.
queryAllPage
(
page
.
getSize
(),
page
.
getCurrent
());
}
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
...
@@ -106,7 +108,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -106,7 +108,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return
queryForPage
(
page
,
userInfo
.
getUserId
());
return
queryForPage
(
page
,
userInfo
.
getUserId
());
}
}
return
this
.
queryForWaitManage
(
page
,
userInfo
.
getUserId
());
return
this
.
queryForWaitManage
(
page
,
userInfo
.
getUserId
());
}
}
/**
/**
...
@@ -117,7 +119,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -117,7 +119,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return
null
;
return
null
;
}
}
QueryWrapper
<
FailureDetails
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
FailureDetails
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"submission_pid"
,
submissionPid
);
wrapper
.
eq
(
"submission_pid"
,
submissionPid
);
wrapper
.
orderByDesc
(
"submission_time"
);
wrapper
.
orderByDesc
(
"submission_time"
);
IPage
<
FailureDetails
>
failureDetailsPage
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
IPage
<
FailureDetails
>
failureDetailsPage
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
return
baseMapper
.
selectPage
(
failureDetailsPage
,
wrapper
);
return
baseMapper
.
selectPage
(
failureDetailsPage
,
wrapper
);
...
@@ -131,16 +133,14 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -131,16 +133,14 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return
null
;
return
null
;
}
}
QueryWrapper
<
FailureDetails
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
FailureDetails
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"submission_pid"
,
submissionPid
);
wrapper
.
eq
(
"submission_pid"
,
submissionPid
);
wrapper
.
notIn
(
"current_status"
,
FailureStatuEnum
.
REFUSE
.
getCode
(),
wrapper
.
notIn
(
"current_status"
,
FailureStatuEnum
.
REFUSE
.
getCode
(),
FailureStatuEnum
.
FINISH
.
getCode
(),
FailureStatuEnum
.
FINISH
.
getCode
(),
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
());
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
());
wrapper
.
orderByDesc
(
"submission_time"
);
wrapper
.
orderByDesc
(
"submission_time"
);
IPage
<
FailureDetails
>
failureDetailsPage
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
IPage
<
FailureDetails
>
failureDetailsPage
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
return
baseMapper
.
selectPage
(
failureDetailsPage
,
wrapper
);
return
baseMapper
.
selectPage
(
failureDetailsPage
,
wrapper
);
}
}
/**
/**
* 列表查询 示例
* 列表查询 示例
*/
*/
...
@@ -152,13 +152,13 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -152,13 +152,13 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
* 根据状态查询
* 根据状态查询
*/
*/
public
FailureDetailsDto
queryForOne
(
Long
sequenceNbr
){
public
FailureDetailsDto
queryForOne
(
Long
sequenceNbr
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
failureDetailsDto
.
setCurrentStatusName
(
failureDetailsDto
Constants
.
currentStatusNameMap
.
get
(
failureDetailsDto
.
getCurrentStatus
()));
.
setCurrentStatusName
(
Constants
.
currentStatusNameMap
.
get
(
failureDetailsDto
.
getCurrentStatus
()));
List
<
SourceFile
>
sourceFiles
=
sourceFileServiceImpl
.
findBySourceId
(
sequenceNbr
);
List
<
SourceFile
>
sourceFiles
=
sourceFileServiceImpl
.
findBySourceId
(
sequenceNbr
);
failureDetailsDto
.
setAttachment
(
sourceFiles
);
failureDetailsDto
.
setAttachment
(
sourceFiles
);
return
failureDetailsDto
;
return
failureDetailsDto
;
}
}
/**
/**
...
@@ -174,69 +174,74 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -174,69 +174,74 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
list
.
add
(
FailureStatuEnum
.
REFUSE
);
list
.
add
(
FailureStatuEnum
.
REFUSE
);
list
.
add
(
FailureStatuEnum
.
FINISH
);
list
.
add
(
FailureStatuEnum
.
FINISH
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
currentStatus
.
equals
(
list
.
get
(
i
).
getCode
())){
if
(
currentStatus
.
equals
(
list
.
get
(
i
).
getCode
()))
{
status
=
list
.
get
(
i
).
getName
();
status
=
list
.
get
(
i
).
getName
();
};
}
}
/*FailureStatuEnum[] failureStatuEnums = new FailureStatuEnum []{};*/
;
}
/* FailureStatuEnum[] failureStatuEnums = new FailureStatuEnum []{}; */
QueryWrapper
<
FailureDetails
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
FailureDetails
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"current_status"
,
status
).
orderByDesc
(
"submission_time"
);
queryWrapper
.
eq
(
"current_status"
,
status
).
orderByDesc
(
"submission_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
return
baseMapper
.
selectList
(
queryWrapper
);
}
}
/**
/**
* 查询任务状态数量
* 查询任务状态数量
*/
*/
public
List
<
FailureStatusCountDto
>
queryStatusCount
(
Integer
type
)
{
public
List
<
FailureStatusCountDto
>
queryStatusCount
(
Integer
type
)
{
List
<
FailureDetailsDto
>
failureDetailsDtos
=
new
ArrayList
<>();
List
<
FailureDetailsDto
>
failureDetailsDtos
=
new
ArrayList
<>();
if
(
type
.
equals
(
SELECY_ALL
))
{
if
(
type
.
equals
(
SELECY_ALL
))
{
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
}
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
}
}
int
auditStatus
=
0
;
int
auditStatus
=
0
;
int
submitStatus
=
0
;
int
submitStatus
=
0
;
int
maintainStatus
=
0
;
int
maintainStatus
=
0
;
int
acceptanceStatus
=
0
;
int
acceptanceStatus
=
0
;
int
refuseStatus
=
0
;
int
refuseStatus
=
0
;
int
finishStatus
=
0
;
int
finishStatus
=
0
;
int
inMaintenance
=
0
;
List
<
FailureStatusCountDto
>
list
=
new
ArrayList
<>();
List
<
FailureStatusCountDto
>
list
=
new
ArrayList
<>();
// String[] statusName = new String[]{"待审核", "待提交", "待维修", "待验收", "已拒绝", "已完结"};
// String[] statusName = new String[]{"待审核", "待提交", "待维修", "待验收", "已拒绝", "已完结"};
List
<
String
>
statusName
=
new
ArrayList
<>();
List
<
String
>
statusName
=
new
ArrayList
<>();
Collections
.
addAll
(
statusName
,
FailureStatuEnum
.
WAITING_AUDIT
.
getName
(),
Collections
.
addAll
(
statusName
,
FailureStatuEnum
.
WAITING_AUDIT
.
getName
(),
FailureStatuEnum
.
WAITING_SUBMIT
.
getName
(),
FailureStatuEnum
.
WAITING_SUBMIT
.
getName
(),
FailureStatuEnum
.
WAITING_MAINTAIN
.
getName
(),
FailureStatuEnum
.
WAITING_MAINTAIN
.
getName
(),
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getName
(),
FailureStatuEnum
.
REFUSE
.
getName
(),
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getName
(),
FailureStatuEnum
.
FINISH
.
getName
(),
FailureStatuEnum
.
IN_MAINTENANCE
.
getName
());
FailureStatuEnum
.
REFUSE
.
getName
());
for
(
int
i
=
0
;
i
<
failureDetailsDtos
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
failureDetailsDtos
.
size
();
i
++)
{
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
()))
{
auditStatus
++;
auditStatus
++;
}
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_SUBMIT
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_SUBMIT
.
getCode
()))
{
submitStatus
++;
submitStatus
++;
}
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_MAINTAIN
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_MAINTAIN
.
getCode
()))
{
maintainStatus
++;
maintainStatus
++;
}
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getCode
()))
{
acceptanceStatus
++;
acceptanceStatus
++;
}
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
REFUSE
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
REFUSE
.
getCode
()))
{
refuseStatus
++;
refuseStatus
++;
}
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
FINISH
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
FINISH
.
getCode
()))
{
finishStatus
++;
finishStatus
++;
}
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
IN_MAINTENANCE
.
getCode
()))
{
inMaintenance
++;
}
}
}
int
[]
statusCount
=
{
auditStatus
,
submitStatus
,
maintainStatus
,
acceptanceStatus
,
refuseStatus
,
finishStatus
};
int
[]
statusCount
=
{
auditStatus
,
submitStatus
,
maintainStatus
,
acceptanceStatus
,
refuseStatus
,
finishStatus
,
inMaintenance
};
for
(
int
i
=
0
;
i
<
statusName
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
statusName
.
size
();
i
++)
{
FailureStatusCountDto
statusCountDto
=
new
FailureStatusCountDto
();
FailureStatusCountDto
statusCountDto
=
new
FailureStatusCountDto
();
statusCountDto
.
setStatus
(
statusName
.
get
(
i
));
statusCountDto
.
setStatus
(
statusName
.
get
(
i
));
statusCountDto
.
setCount
(
statusCount
[
i
]);
statusCountDto
.
setCount
(
statusCount
[
i
]);
list
.
add
(
statusCountDto
);
list
.
add
(
statusCountDto
);
...
@@ -249,7 +254,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -249,7 +254,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
*
*
* @throws Exception
* @throws Exception
*/
*/
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
throws
Exception
{
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
{
String
businessKey
=
buildOrderNo
();
String
businessKey
=
buildOrderNo
();
JSONObject
body
=
new
JSONObject
();
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"businessKey"
,
businessKey
);
...
@@ -268,29 +273,29 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -268,29 +273,29 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureDetailsDto
.
setProcessId
(
instance
.
getString
(
"id"
));
failureDetailsDto
.
setProcessId
(
instance
.
getString
(
"id"
));
FailureDetailsDto
model
=
null
;
FailureDetailsDto
model
=
null
;
try
{
try
{
// 发起主表流程 并添加至报修日志
// 发起主表流程 并添加至报修日志
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
failureDetailsDto
.
setFailureCode
(
buildOrderNo
());
failureDetailsDto
.
setFailureCode
(
buildOrderNo
());
failureDetailsDto
.
setBizCode
(
buildOrderNo
());
failureDetailsDto
.
setBizCode
(
userInfo
.
getDepartment
().
getSequenceNbr
());
failureDetailsDto
.
setIsDelete
(
false
);
failureDetailsDto
.
setIsDelete
(
false
);
model
=
this
.
createWithModel
(
failureDetailsDto
);
model
=
this
.
createWithModel
(
failureDetailsDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
sourceFileServiceImpl
.
saveSourceFile
(
failureDetailsDto
.
getSequenceNbr
(),
failureDetailsDto
.
getAttachment
());
sourceFileServiceImpl
.
saveSourceFile
(
failureDetailsDto
.
getSequenceNbr
(),
failureDetailsDto
.
getAttachment
());
}
}
//添加至报修日志
//
添加至报修日志
try
{
try
{
Long
faultId
=
model
.
getSequenceNbr
();
Long
faultId
=
model
.
getSequenceNbr
();
String
processAuditor
=
model
.
getRecUserName
();
String
processAuditor
=
model
.
getRecUserName
();
Integer
processAuditorId
=
model
.
getSubmissionPid
();
Integer
processAuditorId
=
model
.
getSubmissionPid
();
String
processResult
=
"提交报修单"
;
String
processResult
=
"提交报修单"
;
String
processDepartment
=
userInfo
.
getDepartment
().
getDepartmentName
();
String
processDepartment
=
userInfo
.
getDepartment
().
getDepartmentName
();
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Date
processTime
=
model
.
getSubmissionTime
();
Date
processTime
=
model
.
getSubmissionTime
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
processResult
);
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
}
catch
(
Exception
e
){
processResult
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
info
(
"添加流程日志到数据库失败"
);
logger
.
info
(
"添加流程日志到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
...
@@ -303,11 +308,11 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -303,11 +308,11 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return
false
;
return
false
;
// return CommonResponseUtil.failure("添加失败");
// return CommonResponseUtil.failure("添加失败");
}
}
try
{
try
{
if
(
ObjectUtils
.
isNotEmpty
(
model
))
{
if
(
ObjectUtils
.
isNotEmpty
(
model
))
{
excuteTask
(
instance
.
getString
(
"id"
),
userInfo
,
null
);
excuteTask
(
instance
.
getString
(
"id"
),
userInfo
,
null
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
return
false
;
return
false
;
}
}
...
@@ -319,8 +324,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -319,8 +324,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
* 添加报修日志
* 添加报修日志
*/
*/
@Transactional
@Transactional
public
Boolean
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
public
Boolean
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
String
processResult
)
{
Date
processTime
,
String
processDepartment
,
String
processResult
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
...
@@ -330,7 +335,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -330,7 +335,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
FailureRepairlogDto
RepairlogModel
=
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
FailureRepairlogDto
RepairlogModel
=
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
RepairlogModel
)){
if
(
ObjectUtils
.
isNotEmpty
(
RepairlogModel
))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
@@ -483,22 +488,36 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -483,22 +488,36 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public
Object
getCurrentProcessHistoryTask
(
Long
id
)
{
public
Object
getCurrentProcessHistoryTask
(
Long
id
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
id
);
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
id
);
String
processId
=
failureDetailsDto
.
getProcessId
();
String
processId
=
failureDetailsDto
.
getProcessId
();
JSONObject
object
=
workflowFeignService
.
queryHistoryTaskListByProcessId
(
processId
);
JSONObject
object
=
workflowFeignService
.
queryHistoryTaskListByProcessId
(
processId
);
JSONArray
datArray
=
null
;
JSONArray
datArray
=
null
;
if
(
ObjectUtils
.
isNotEmpty
(
object
))
{
if
(
ObjectUtils
.
isNotEmpty
(
object
))
{
datArray
=
object
.
getJSONArray
(
"rows
"
);
datArray
=
object
.
getJSONArray
(
"data
"
);
}
}
List
<
Object
>
list
=
new
ArrayList
<
Object
>();
List
<
Object
>
list
=
new
ArrayList
<
Object
>();
if
(
datArray
!=
null
)
{
if
(
datArray
!=
null
)
{
datArray
.
stream
().
forEach
(
i
->
{
for
(
Object
i
:
datArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
if
(
detail
.
containsKey
(
"operator"
)
&&
!
detail
.
getString
(
"name"
).
equals
(
"维修中"
))
{
if
(
detail
.
containsKey
(
"operator"
)
&&
!
detail
.
getString
(
"name"
).
contains
(
"维修中"
))
{
//从流程记录表中拿到处理人的名称
// 从流程记录表中拿到处理人的名称
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByprocessAuditorId
(
Long
.
parseLong
(
detail
.
getString
(
"operator"
)));
FailureRepairlog
failureRepairlog
=
failureRepairlogService
detail
.
replace
(
"operator"
,
failureRepairlog
.
getProcessAuditor
());
.
findByprocessAuditor
(
detail
.
getString
(
"operator"
));
list
.
add
(
object
);
if
(
failureRepairlog
!=
null
)
{
}
detail
.
replace
(
"operator"
,
failureRepairlog
.
getProcessAuditorName
()==
null
?
""
:
failureRepairlog
.
getProcessAuditorName
());
});
}
}
list
.
add
(
detail
);
}
// datArray.stream().forEach(i -> {
// JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i));
// if (detail.containsKey("operator") && !detail.getString("name").equals("维修中")) {
// // 从流程记录表中拿到处理人的名称
// FailureRepairlog failureRepairlog = failureRepairlogService
// .findByprocessAuditor(detail.getString("operator"));
// detail.replace("operator", failureRepairlog.getProcessAuditorName());
// list.add(detail);
// }
// });
}
}
return
list
;
return
list
;
}
}
...
@@ -516,35 +535,36 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -516,35 +535,36 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/**
/**
* 获取当前登录人能够操作的任务执行Button类型
* 获取当前登录人能够操作的任务执行Button类型
*
* @param sequenceNbr
* @param sequenceNbr
* @param userInfo
* @param userInfo
* @return
* @return
*/
*/
public
Integer
getExcuteTaskAuthButton
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
public
Integer
getExcuteTaskAuthButton
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
int
flag
=
0
;
int
flag
=
0
;
Map
<
String
,
Object
>
map
=
this
.
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
Map
<
String
,
Object
>
map
=
this
.
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
String
buttonValueString
=
map
.
get
(
"name"
).
toString
();
String
buttonValueString
=
map
.
get
(
"name"
).
toString
();
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
0
]))
{
//
提交维修单
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
0
]))
{
//
提交维修单
flag
=
1
;
flag
=
1
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
1
]))
{
//
审核
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
1
]))
{
//
审核
flag
=
2
;
flag
=
2
;
if
(
buttonValueString
.
startsWith
(
PROCESS_NAME
[
2
]))
{
if
(
buttonValueString
.
startsWith
(
PROCESS_NAME
[
2
]))
{
flag
=
3
;
flag
=
3
;
}
}
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
2
]))
{
//
维修
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
2
]))
{
//
维修
flag
=
4
;
flag
=
4
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
3
]))
{
//
验收
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
3
]))
{
//
验收
flag
=
5
;
flag
=
5
;
}
}
}
}
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
JSONObject
object
=
workflowFeignService
.
queryHistoryTasksByProcessInstanceId
(
details
.
getProcessId
());
JSONObject
object
=
workflowFeignService
.
queryHistoryTasksByProcessInstanceId
(
details
.
getProcessId
());
JSONArray
array
=
object
.
getJSONArray
(
"rows"
);
JSONArray
array
=
object
.
getJSONArray
(
"rows"
);
for
(
Object
historyDetail
:
array
)
{
for
(
Object
historyDetail
:
array
)
{
JSONObject
historyDetailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
historyDetail
));
JSONObject
historyDetailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
historyDetail
));
if
(
"rejected"
.
equals
(
historyDetailJson
.
getString
(
"activityId"
)))
{
if
(
"rejected"
.
equals
(
historyDetailJson
.
getString
(
"activityId"
)))
{
flag
=
6
;
flag
=
6
;
}
}
}
}
return
flag
;
return
flag
;
...
...
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;
...
@@ -3,8 +3,14 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
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.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
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
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -26,6 +32,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService;
...
@@ -26,6 +32,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService;
* @date 2021-08-04
* @date 2021-08-04
*/
*/
@Service
@Service
@Transactional
public
class
FailureMaintainServiceImpl
extends
BaseService
<
FailureMaintainDto
,
FailureMaintain
,
FailureMaintainMapper
>
implements
IFailureMaintainService
{
public
class
FailureMaintainServiceImpl
extends
BaseService
<
FailureMaintainDto
,
FailureMaintain
,
FailureMaintainMapper
>
implements
IFailureMaintainService
{
@Autowired
@Autowired
SourceFileServiceImpl
sourceFileServiceImpl
;
SourceFileServiceImpl
sourceFileServiceImpl
;
...
@@ -34,6 +41,11 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
...
@@ -34,6 +41,11 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
@Autowired
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
FailureRepairlogServiceImpl
failureRepairlogService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureMaintainServiceImpl
.
class
);
private
static
String
[]
MAINTENANCE_STATUS
=
{
"维修完成"
,
"维修中"
};
private
static
String
[]
PROCESS_RESULT
=
{
"验证通过"
,
"验证未通过"
};
/**
/**
* 分页查询
* 分页查询
*/
*/
...
@@ -51,10 +63,11 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
...
@@ -51,10 +63,11 @@ 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
.
checkExcuteTaskAuthMap
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
null
);
try
{
this
.
createWithModel
(
failureMaintainDto
);
this
.
createWithModel
(
failureMaintainDto
);
//添加完成后修改保修单状态为待验收
//添加完成后修改保修单状态为待验收
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
...
@@ -62,23 +75,55 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
...
@@ -62,23 +75,55 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
//添加报修日志
//添加报修日志
String
processResult
=
"维修完成"
;
String
processResult
=
MAINTENANCE_STATUS
[
1
];
//维修中
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
);
failureMaintainDto
.
getDepartment
(),
processResult
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
())){
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
return
failureMaintainDto
;
}
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
null
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
info
(
"添加故障维修信息到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
}
}
return
true
;
}
/**
/**
*
根据FaultId查询
*
更新状态维修完成
*/
*/
public
List
<
FailureMaintain
>
findByfaultId
(
Long
faultId
)
{
public
Boolean
updateStatus
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
Page
<
FailureMaintain
>
page
=
new
Page
<>();
try
{
QueryWrapper
<
FailureMaintain
>
queryWrapper
=
new
QueryWrapper
<>();
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"submission_time"
);
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
IN_MAINTENANCE
.
getCode
());
return
baseMapper
.
selectList
(
queryWrapper
);
this
.
updateWithModel
(
failureMaintainDto
);
//添加报修日志
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
);
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
;
}
return
true
;
}
}
/**
/**
...
@@ -87,21 +132,27 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
...
@@ -87,21 +132,27 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
public
Boolean
updateModel
(
FailureMaintainDto
failureMaintainDto
,
Integer
status
,
ReginParams
userInfo
)
{
public
Boolean
updateModel
(
FailureMaintainDto
failureMaintainDto
,
Integer
status
,
ReginParams
userInfo
)
{
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
if
(
result
){
if
(
result
){
this
.
updateWithModel
(
failureMaintainDto
);
this
.
updateWithModel
(
failureMaintainDto
);
//根据status修改状态
//根据status修改状态
String
processResult
=
new
String
();
String
processResult
=
new
String
();
String
condition
=
new
String
();
String
condition
=
new
String
();
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
if
(
status
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
()
if
(
status
==
AuditResultEnum
.
AGREE
.
getCode
())
{
//同意状态为已完结
==
failureDetailsDto
.
getBizCode
())
{
//同意状态为已完结
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
FINISH
.
getCode
());
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
);
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
"验证通过"
;
processResult
=
PROCESS_RESULT
[
0
]
;
condition
=
AuditResultEnum
.
AGREE
.
getName
();
condition
=
AuditResultEnum
.
AGREE
.
getName
();
}
else
{
//不同意状态为已拒绝
}
else
{
//不同意状态为已拒绝
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
REFUSE
.
getCode
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
REFUSE
.
getCode
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
"验证未通过"
;
processResult
=
PROCESS_RESULT
[
1
]
;
condition
=
AuditResultEnum
.
REFUSE
.
getName
();
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
...
@@ -47,9 +47,9 @@ public class FailureRepairlogServiceImpl extends BaseService<FailureRepairlogDto
}
}
public
FailureRepairlog
findByprocessAuditor
Id
(
Lo
ng
userId
)
{
public
FailureRepairlog
findByprocessAuditor
(
Stri
ng
userId
)
{
QueryWrapper
<
FailureRepairlog
>
queryWrapper
=
new
QueryWrapper
<
FailureRepairlog
>();
LambdaQueryWrapper
<
FailureRepairlog
>
queryWrapper
=
new
Lambda
QueryWrapper
<
FailureRepairlog
>();
queryWrapper
.
eq
(
"process_auditor_id"
,
userId
);
queryWrapper
.
eq
(
FailureRepairlog:
:
getProcessAuditor
,
userId
);
queryWrapper
.
last
(
"LIMIT 1"
);
queryWrapper
.
last
(
"LIMIT 1"
);
return
baseMapper
.
selectOne
(
queryWrapper
);
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 {
...
@@ -295,28 +295,24 @@ public class CheckController extends AbstractBaseController {
/**
/**
* 获取巡检日历数据
* 获取巡检日历数据
*
*
* @param
queryRequests
* @param
date
* @return
* @return
*/
*/
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"
获取巡检日历数据<font color='blue'>手机app</font>"
,
notes
=
"获取巡检日历数据<font color='blue'>手机app</font>
"
)
@ApiOperation
(
value
=
"
维保日历-mobile"
,
notes
=
"维保日历-mobile
"
)
@
PostMapping
(
value
=
"
/checkCalendar"
,
produces
=
"application/json;charset=UTF-8"
)
@
GetMapping
(
value
=
"/{date}
/checkCalendar"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
checkCalendar
(
public
CommonResponse
checkCalendar
(
@ApiParam
(
value
=
"
查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
)
{
@ApiParam
(
value
=
"
date,格式YYYY-MM-DD"
,
required
=
true
)
@PathVariable
String
date
)
{
try
{
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
roleTypeName
=
getRoleTypeName
(
reginParams
);
Map
<
String
,
Object
>
authMap
=
Bean
.
BeantoMap
(
reginParams
.
getPersonIdentity
()
);
List
<
DaoCriteria
>
daoCriterias
=
buildDaoCriterias
(
queryRequests
,
true
,
loginOrgCode
,
roleTypeName
);
params
.
putAll
(
authMap
);
params
.
put
(
"checkTime"
,
date
);
params
.
put
(
"orgCode"
,
loginOrgCode
);
Map
<
String
,
Object
>
map
=
checkService
.
checkCalendar
(
CheckParamUtil
.
checkCalendar
(
daoCriterias
)
);
Map
<
String
,
Object
>
map
=
checkService
.
checkCalendar
(
params
);
return
CommonResponseUtil
.
success
(
map
);
return
CommonResponseUtil
.
success
(
map
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
@@ -347,13 +343,8 @@ public class CheckController extends AbstractBaseController {
...
@@ -347,13 +343,8 @@ public class CheckController extends AbstractBaseController {
@ApiOperation
(
value
=
"获取巡检记录详情信息<font color='blue'>手机app</font>"
,
notes
=
"获取巡检记录详情信息<font color='blue'>手机app</font>"
)
@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
)
@RequestMapping
(
value
=
"/queryCheckDetail"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRecordById
(
@RequestParam
(
required
=
true
)
int
checkId
)
{
public
CommonResponse
queryRecordById
(
@RequestParam
(
required
=
true
)
int
checkId
)
{
try
{
Map
<
String
,
Object
>
map
=
checkService
.
queryRecordById
(
checkId
);
Map
<
String
,
Object
>
map
=
checkService
.
queryRecordById
(
checkId
);
return
CommonResponseUtil
.
success
(
map
);
return
CommonResponseUtil
.
success
(
map
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
}
/**
/**
...
...
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 {
...
@@ -45,14 +45,14 @@ public interface CheckMapper extends BaseMapper {
* @param param
* @param param
* @return
* @return
*/
*/
Map
<
String
,
Object
>
pieChartData
(
CheckRecordParam
param
);
Map
<
String
,
Object
>
pieChartData
(
Map
<
String
,
Object
>
param
);
/**
/**
* 巡检日历日历数据
* 巡检日历日历数据
* @param param
* @param param
* @return
* @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
);
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 {
...
@@ -179,4 +179,5 @@ public interface PlanTaskMapper extends BaseMapper {
List
<
Map
<
String
,
Object
>>
queryTimeAxis
(
HashMap
<
String
,
Object
>
params
);
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
;
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
feign
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -37,5 +34,14 @@ public interface EquipFeign {
...
@@ -37,5 +34,14 @@ public interface EquipFeign {
*/
*/
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/area/tree"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/area/tree"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
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 {
...
@@ -624,26 +624,16 @@ public class CheckServiceImpl implements ICheckService {
}
}
@Override
@Override
public
Map
<
String
,
Object
>
checkCalendar
(
CheckRecordParam
recordP
aram
)
{
public
Map
<
String
,
Object
>
checkCalendar
(
Map
<
String
,
Object
>
p
aram
)
{
Map
<
String
,
Object
>
charData
=
checkMapper
.
pieChartData
(
recordP
aram
);
Map
<
String
,
Object
>
charData
=
checkMapper
.
pieChartData
(
p
aram
);
List
<
Map
<
String
,
Object
>>
calendarData
=
checkMapper
.
calendarData
(
recordP
aram
);
List
<
Map
<
String
,
Object
>>
calendarData
=
checkMapper
.
calendarData
(
p
aram
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
List
<
CalendarStatusCountRespone
>>
calendarMap
=
new
HashMap
<>();
Map
<
String
,
List
<
CalendarStatusCountRespone
>>
calendarMap
=
calendarData
.
stream
().
collect
(
Collectors
.
groupingBy
(
map
->
map
.
get
(
"time"
).
toString
(),
Collectors
.
mapping
(
c
->{
if
(!
calendarData
.
isEmpty
())
{
CalendarStatusCountRespone
countRespone
=
new
CalendarStatusCountRespone
();
calendarData
.
forEach
(
action
->
{
countRespone
.
setCount
(
Long
.
parseLong
(
c
.
get
(
"count"
).
toString
()));
List
<
CalendarStatusCountRespone
>
statusCountList
=
new
ArrayList
<>();
countRespone
.
setStatus
(
c
.
get
(
"status"
).
toString
());
CalendarStatusCountRespone
statusCount
=
new
CalendarStatusCountRespone
();
return
countRespone
;
statusCount
.
setCount
(
Double
.
valueOf
(
action
.
get
(
"count"
).
toString
()));
},
Collectors
.
toList
())));
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
);
}
});
}
result
.
put
(
"charData"
,
charData
);
result
.
put
(
"charData"
,
charData
);
result
.
put
(
"calendarData"
,
calendarMap
);
result
.
put
(
"calendarData"
,
calendarMap
);
return
result
;
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;
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.service.impl;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
com.google.common.base.Joiner
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
@@ -35,6 +36,7 @@ import org.springframework.data.domain.*;
...
@@ -35,6 +36,7 @@ import org.springframework.data.domain.*;
import
org.springframework.data.domain.Sort.Direction
;
import
org.springframework.data.domain.Sort.Direction
;
import
org.springframework.data.domain.Sort.Order
;
import
org.springframework.data.domain.Sort.Order
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -228,26 +230,19 @@ public class PointServiceImpl implements IPointService {
...
@@ -228,26 +230,19 @@ public class PointServiceImpl implements IPointService {
if
(!
pointInputItems
.
isEmpty
())
{
if
(!
pointInputItems
.
isEmpty
())
{
iPointInputItemDao
.
saveAll
(
pointInputItems
);
iPointInputItemDao
.
saveAll
(
pointInputItems
);
}
}
//TODO 2.分类暂时不需要 维保
}
}
@Override
@Override
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Long
>
delPointById
(
Long
[]
ids
)
{
public
List
<
Long
>
delPointById
(
Long
[]
ids
)
{
List
<
Long
>
idList
=
new
ArrayList
<
Long
>();
List
<
Long
>
idList
=
new
ArrayList
<
Long
>();
for
(
long
pointId
:
ids
)
{
idList
.
addAll
(
Arrays
.
asList
(
ids
));
idList
.
add
(
pointId
);
}
iPointClassifyDao
.
deleteByPointId
(
idList
);
// 物理删除点的分类
List
<
PointInputItem
>
pointInputItem
=
iPointInputItemDao
.
findAllById
(
idList
);
List
<
PointInputItem
>
pointInputItem
=
iPointInputItemDao
.
findAllById
(
idList
);
List
<
Long
>
pointInputItemIds
=
Lists
.
transform
(
pointInputItem
,
PointInputItem:
:
getId
);
List
<
Long
>
pointInputItemIds
=
Lists
.
transform
(
pointInputItem
,
PointInputItem:
:
getId
);
if
(
pointInputItemIds
.
size
()
>
0
)
// 物理删除p_point_inputitem表对应行
iPointInputItemDao
.
deleteFmeaRelationByPointInputItemIds
(
pointInputItemIds
);
//物理删除fmea关联巡检点项
iPointInputItemDao
.
deleteByPointId
(
idList
);
iPointInputItemDao
.
deleteByPointId
(
idList
);
// 物理删除p_point_inputitem表对应行
// 物理删除p_route_point、p_route_point_item中相关行
iPointPhotoDao
.
deleteByPointId
(
idList
);
// 物理删除点的图片信息
// iRoutePointDao.delRoutePointByPointId(idList); //
// 物理删除p_route_point中相关行
List
<
BigInteger
>
routePointIdList
=
iRoutePointDao
.
queryRoutePointByPointId
(
idList
);
List
<
BigInteger
>
routePointIdList
=
iRoutePointDao
.
queryRoutePointByPointId
(
idList
);
for
(
BigInteger
routePointId
:
routePointIdList
)
{
for
(
BigInteger
routePointId
:
routePointIdList
)
{
iRoutePointItemDao
.
delRoutePointItem
(
routePointId
.
longValue
());
iRoutePointItemDao
.
delRoutePointItem
(
routePointId
.
longValue
());
...
@@ -270,18 +265,19 @@ public class PointServiceImpl implements IPointService {
...
@@ -270,18 +265,19 @@ public class PointServiceImpl implements IPointService {
}
}
}
}
}
}
// 删除p_plan_task_detail相关行
iPlanTaskDetailDao
.
deletePlanTaskDetailByPointId
(
idList
);
// 删除p_plan_task_detail相关行
iPlanTaskDetailDao
.
deletePlanTaskDetailByPointId
(
idList
);
// 删除p_point相关行
iPointDao
.
delPointById
(
idList
);
iPointDao
.
delPointById
(
idList
);
return
idList
;
return
idList
;
}
}
@Override
@Override
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Point
updatePoint
(
PointParam
pointParam
)
{
public
Point
updatePoint
(
PointParam
pointParam
)
{
//1.更新点
//1.更新点
long
pointId
=
pointParam
.
getPoint
().
getId
();
long
pointId
=
pointParam
.
getPoint
().
getId
();
Point
newPoint
=
iPointDao
.
findById
(
pointId
).
get
(
);
Point
newPoint
=
iPointDao
.
findById
(
pointId
).
orElseThrow
(()->
new
RuntimeException
(
"找不到原始数据"
)
);
Bean
.
copyExistPropertis
(
pointParam
.
getPoint
(),
newPoint
);
Bean
.
copyExistPropertis
(
pointParam
.
getPoint
(),
newPoint
);
newPoint
.
setLastUpdateTime
(
new
Date
());
newPoint
.
setLastUpdateTime
(
new
Date
());
iPointDao
.
save
(
newPoint
);
iPointDao
.
save
(
newPoint
);
...
@@ -381,6 +377,7 @@ public class PointServiceImpl implements IPointService {
...
@@ -381,6 +377,7 @@ public class PointServiceImpl implements IPointService {
}
}
return
returnList
;
return
returnList
;
}
}
@Override
@Override
public
List
<
PointInputItemVo
>
queryPointInputItem
(
Long
pointId
)
{
public
List
<
PointInputItemVo
>
queryPointInputItem
(
Long
pointId
)
{
return
pointMapper
.
getPointInputItemById1
(
pointId
,
null
);
return
pointMapper
.
getPointInputItemById1
(
pointId
,
null
);
...
@@ -1089,11 +1086,27 @@ public class PointServiceImpl implements IPointService {
...
@@ -1089,11 +1086,27 @@ public class PointServiceImpl implements IPointService {
return
equipFeign
.
getRegionTress
();
return
equipFeign
.
getRegionTress
();
}
}
@Override
@Override
@Async
public
void
syncSavePoint
(
List
<
MaintenanceResourceData
>
list
,
String
orgCode
,
String
userId
)
{
public
void
syncSavePoint
(
List
<
MaintenanceResourceData
>
list
,
String
orgCode
,
String
userId
)
{
List
<
Point
>
points
=
new
ArrayList
<>();
List
<
Point
>
points
=
new
ArrayList
<>();
List
<
PointInputItem
>
inputItems
=
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
)
{
for
(
MaintenanceResourceData
x
:
list
)
{
Point
point
=
new
Point
();
Point
point
=
new
Point
();
String
pointNo
=
StringUtil
.
isNotEmpty
(
x
.
getFireFacilityCode
())
?
x
.
getFireFacilityCode
()
:
String
.
valueOf
(
sequence
.
nextId
());
String
pointNo
=
StringUtil
.
isNotEmpty
(
x
.
getFireFacilityCode
())
?
x
.
getFireFacilityCode
()
:
String
.
valueOf
(
sequence
.
nextId
());
...
@@ -1107,16 +1120,13 @@ public class PointServiceImpl implements IPointService {
...
@@ -1107,16 +1120,13 @@ public class PointServiceImpl implements IPointService {
point
.
setBelongSystemName
(
x
.
getFireFightSysName
());
point
.
setBelongSystemName
(
x
.
getFireFightSysName
());
point
.
setOwnerId
(
String
.
valueOf
(
x
.
getOwnerUnitId
()));
point
.
setOwnerId
(
String
.
valueOf
(
x
.
getOwnerUnitId
()));
point
.
setOwnerName
(
x
.
getOwnerUnitName
());
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
.
setLevel
(
""
);
point
.
setCreatorId
(
userId
);
point
.
setCreatorId
(
userId
);
point
.
setOrgCode
(
orgCode
);
point
.
setOrgCode
(
orgCode
);
points
.
add
(
point
);
points
.
add
(
point
);
Long
id
=
iPointDao
.
findPointByEquipmentIdAndFireFacilityId
(
pointNo
,
originalId
);
if
(
null
!=
id
)
{
ids
.
add
(
id
);
iPointDao
.
delPointBIds
(
id
);
}
iPointDao
.
save
(
point
);
iPointDao
.
save
(
point
);
List
<
InputItem
>
inputItemVos
=
inputItemMapper
.
getInputItemByEquipmentName
(
x
.
getClassifyName
(),
orgCode
);
List
<
InputItem
>
inputItemVos
=
inputItemMapper
.
getInputItemByEquipmentName
(
x
.
getClassifyName
(),
orgCode
);
if
(
0
<
inputItemVos
.
size
())
{
if
(
0
<
inputItemVos
.
size
())
{
...
@@ -1129,9 +1139,6 @@ public class PointServiceImpl implements IPointService {
...
@@ -1129,9 +1139,6 @@ public class PointServiceImpl implements IPointService {
});
});
}
}
}
}
if
(
0
<
ids
.
size
())
{
iPointInputItemDao
.
deleteByPointId
(
ids
);
}
iPointInputItemDao
.
saveAll
(
inputItems
);
iPointInputItemDao
.
saveAll
(
inputItems
);
}
}
...
...
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 {
...
@@ -66,7 +66,7 @@ public interface ICheckService {
* @param requestParam
* @param requestParam
* @return
* @return
*/
*/
Map
<
String
,
Object
>
checkCalendar
(
CheckRecordParam
requestParam
);
Map
<
String
,
Object
>
checkCalendar
(
Map
<
String
,
Object
>
requestParam
);
/**
/**
* 根据点ID查询点巡检记录 手机APP
* 根据点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 {
...
@@ -297,7 +297,7 @@ public interface IPointService {
List
queryItemList4RoutePoint
(
Long
pointId
,
Long
equipId
);
List
queryItemList4RoutePoint
(
Long
pointId
,
Long
equipId
);
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
void
syncSavePoint
(
List
<
MaintenanceResourceData
>
list
,
String
orgCode
,
String
userId
);
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
;
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
vo
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -53,7 +52,6 @@ public class MaintenanceResourceData {
...
@@ -53,7 +52,6 @@ public class MaintenanceResourceData {
/**
/**
* 业主单位名称
* 业主单位名称
*/
*/
@Excel
(
name
=
"所属单位"
,
width
=
30
,
orderNum
=
"7"
)
private
String
ownerUnitName
;
private
String
ownerUnitName
;
/**
/**
...
@@ -69,7 +67,6 @@ public class MaintenanceResourceData {
...
@@ -69,7 +67,6 @@ public class MaintenanceResourceData {
/**
/**
* 消防系统名称
* 消防系统名称
*/
*/
@Excel
(
name
=
"所属消防系统"
,
width
=
30
,
orderNum
=
"4"
)
private
String
fireFightSysName
;
private
String
fireFightSysName
;
/**
/**
...
@@ -85,7 +82,6 @@ public class MaintenanceResourceData {
...
@@ -85,7 +82,6 @@ public class MaintenanceResourceData {
/**
/**
* 分类名称
* 分类名称
*/
*/
@Excel
(
name
=
"设施类型"
,
width
=
30
,
orderNum
=
"3"
)
private
String
classifyName
;
private
String
classifyName
;
/**
/**
...
@@ -101,13 +97,11 @@ public class MaintenanceResourceData {
...
@@ -101,13 +97,11 @@ public class MaintenanceResourceData {
/**
/**
* 消防设施编码
* 消防设施编码
*/
*/
@Excel
(
name
=
"设施编码"
,
width
=
30
,
orderNum
=
"6"
)
private
String
fireFacilityCode
;
private
String
fireFacilityCode
;
/**
/**
* 消防设施名称
* 消防设施名称
*/
*/
@Excel
(
name
=
"设施名称"
,
width
=
30
,
orderNum
=
"1"
)
private
String
fireFacilityName
;
private
String
fireFacilityName
;
/**
/**
...
@@ -116,29 +110,10 @@ public class MaintenanceResourceData {
...
@@ -116,29 +110,10 @@ public class MaintenanceResourceData {
private
String
fireFacilityType
;
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
;
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
* 建筑ID
...
@@ -150,17 +125,12 @@ public class MaintenanceResourceData {
...
@@ -150,17 +125,12 @@ public class MaintenanceResourceData {
*/
*/
private
String
buildingName
;
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;
...
@@ -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.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
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.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.SystemClock
;
import
com.baomidou.mybatisplus.core.toolkit.SystemClock
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -68,7 +67,7 @@ import java.util.stream.Stream;
...
@@ -68,7 +67,7 @@ import java.util.stream.Stream;
*/
*/
@RestController
@RestController
@Api
(
tags
=
"警情接警填报记录Api"
)
@Api
(
tags
=
"警情接警填报记录Api"
)
@RequestMapping
(
value
=
"/
tzs/
alert-called"
)
@RequestMapping
(
value
=
"/alert-called"
)
public
class
AlertCalledController
extends
BaseController
{
public
class
AlertCalledController
extends
BaseController
{
@Autowired
@Autowired
...
@@ -218,21 +217,21 @@ public class AlertCalledController extends BaseController {
...
@@ -218,21 +217,21 @@ public class AlertCalledController extends BaseController {
// 当天接警
// 当天接警
alarmStatisticsDto
.
setTodayAlarmNum
(
map
.
get
(
"calledCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"calledCount"
).
toString
()))
;
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
.
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
();
Map
<
String
,
Integer
>
recordMap
=
Maps
.
newHashMap
();
// 近七天办理数量
// 近七天办理数量
for
(
int
i
=
1
;
i
<
8
;
i
++)
{
for
(
int
i
=
1
;
i
<
8
;
i
++)
{
Map
<
String
,
Object
>
nearlySevenDaysMap
=
iAlertCalledService
.
getAlertInfoList
(
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
"yyyy-MM-dd"
)+
" 00:00:00"
,
Map
<
String
,
Object
>
nearlySevenDaysMap
=
iAlertCalledService
.
getAlertInfoList
(
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
-
i
).
getTime
(),
"yyyy-MM-dd"
)+
" 00:00:00"
,
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
"yyyy-MM-dd"
)+
" 23:59:59"
,
null
,
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
-
i
).
getTime
(),
"yyyy-MM-dd"
)+
" 23:59:59"
,
null
,
getUserInfo
().
getUserId
());
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
);
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;
...
@@ -34,7 +34,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
*/
*/
@RestController
@RestController
@Api
(
tags
=
"派遣单Api"
)
@Api
(
tags
=
"派遣单Api"
)
@RequestMapping
(
value
=
"/
tzs/
dispatch-paper"
)
@RequestMapping
(
value
=
"/dispatch-paper"
)
public
class
DispatchPaperController
extends
BaseController
{
public
class
DispatchPaperController
extends
BaseController
{
@Autowired
@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;
...
@@ -34,7 +34,7 @@ import io.swagger.annotations.ApiOperation;
*/
*/
@RestController
@RestController
@Api
(
tags
=
"派遣任务Api"
)
@Api
(
tags
=
"派遣任务Api"
)
@RequestMapping
(
value
=
"/
tzs/
dispatch-task"
)
@RequestMapping
(
value
=
"/dispatch-task"
)
public
class
DispatchTaskController
extends
BaseController
{
public
class
DispatchTaskController
extends
BaseController
{
@Autowired
@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;
...
@@ -35,7 +35,7 @@ import java.util.List;
*/
*/
@RestController
@RestController
@Api
(
tags
=
"处置过程Api"
)
@Api
(
tags
=
"处置过程Api"
)
@RequestMapping
(
value
=
"/
tzs/
repair-consult"
)
@RequestMapping
(
value
=
"/repair-consult"
)
public
class
RepairConsultController
extends
BaseController
{
public
class
RepairConsultController
extends
BaseController
{
@Autowired
@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;
...
@@ -34,7 +34,7 @@ import io.swagger.annotations.ApiOperation;
*/
*/
@RestController
@RestController
@Api
(
tags
=
"救援过程表Api"
)
@Api
(
tags
=
"救援过程表Api"
)
@RequestMapping
(
value
=
"/
tzs/
rescue-process"
)
@RequestMapping
(
value
=
"/rescue-process"
)
public
class
RescueProcessController
extends
BaseController
{
public
class
RescueProcessController
extends
BaseController
{
@Autowired
@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;
...
@@ -32,7 +32,7 @@ import java.util.List;
*/
*/
@RestController
@RestController
@Api
(
tags
=
"模板表Api"
)
@Api
(
tags
=
"模板表Api"
)
@RequestMapping
(
value
=
"/t
zs/t
emplate"
)
@RequestMapping
(
value
=
"/template"
)
public
class
TemplateController
extends
BaseController
{
public
class
TemplateController
extends
BaseController
{
@Autowired
@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
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
...
@@ -39,7 +38,7 @@ import java.util.UUID;
...
@@ -39,7 +38,7 @@ import java.util.UUID;
*/
*/
@RestController
@RestController
@Api
(
tags
=
"通话记录附件Api"
)
@Api
(
tags
=
"通话记录附件Api"
)
@RequestMapping
(
value
=
"/
tzs/
voice-record-file"
)
@RequestMapping
(
value
=
"/voice-record-file"
)
public
class
VoiceRecordFileController
extends
BaseController
{
public
class
VoiceRecordFileController
extends
BaseController
{
@Autowired
@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 {
...
@@ -171,39 +171,39 @@ public class ESAlertCalledService {
long
currentTime
=
System
.
currentTimeMillis
()
;
long
currentTime
=
System
.
currentTimeMillis
()
;
currentTime
=
currentTime
-
120
*
60
*
1000
;
currentTime
=
currentTime
-
120
*
60
*
1000
;
BoolQueryBuilder
qb1
=
QueryBuilders
.
boolQuery
()
BoolQueryBuilder
qb1
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
rangeQuery
(
"callTimeLong"
).
gte
(
currentTime
));
.
filter
(
QueryBuilders
.
rangeQuery
(
"callTimeLong"
).
gte
(
currentTime
));
boolMust
.
must
(
qb1
);
boolMust
.
must
(
qb1
);
//报警电话一致
//报警电话一致
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getEmergencyCall
())
&&
!
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactPhone
()))
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getEmergencyCall
())
&&
!
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactPhone
()))
{
{
BoolQueryBuilder
qb2
=
QueryBuilders
.
boolQuery
()
BoolQueryBuilder
qb2
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"emergencyCall.keyword"
,
alertCalled
.
getEmergencyCall
()))
.
should
(
QueryBuilders
.
termQuery
(
"emergencyCall.keyword"
,
alertCalled
.
getEmergencyCall
()))
.
must
(
QueryBuilders
.
termQuery
(
"contactPhone.keyword"
,
alertCalled
.
getContactPhone
()));
.
should
(
QueryBuilders
.
termQuery
(
"contactPhone.keyword"
,
alertCalled
.
getContactPhone
()));
boolMust
.
should
(
qb2
);
boolMust
.
must
(
qb2
);
}
}
//事发地点一致,或相距不超过200米的
//事发地点一致,或相距不超过200米的
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getAddress
()))
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getAddress
()))
{
{
BoolQueryBuilder
qb3
=
QueryBuilders
.
boolQuery
()
BoolQueryBuilder
qb3
=
QueryBuilders
.
boolQuery
()
.
should
(
QueryBuilders
.
matchQuery
(
"address"
,
alertCalled
.
getAddress
()));
.
filter
(
QueryBuilders
.
matchQuery
(
"address"
,
alertCalled
.
getAddress
()));
boolMust
.
should
(
qb3
);
boolMust
.
should
(
qb3
);
}
}
//警情类型一致
//警情类型一致
BoolQueryBuilder
qb4
=
QueryBuilders
.
boolQuery
()
BoolQueryBuilder
qb4
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"alarmTypeCode"
,
alertCalled
.
getAlarmTypeCode
()));
.
filter
(
QueryBuilders
.
termQuery
(
"alarmTypeCode"
,
alertCalled
.
getAlarmTypeCode
()));
boolMust
.
must
(
qb4
);
boolMust
.
must
(
qb4
);
//使用单位名称一致
//使用单位名称一致
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getUseUnit
()))
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getUseUnit
()))
{
{
BoolQueryBuilder
qb5
=
QueryBuilders
.
boolQuery
()
BoolQueryBuilder
qb5
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"useUnit.keyword"
,
alertCalled
.
getUseUnit
()));
.
filter
(
QueryBuilders
.
termQuery
(
"useUnit.keyword"
,
alertCalled
.
getUseUnit
()));
boolMust
.
must
(
qb5
);
boolMust
.
must
(
qb5
);
}
}
//电梯识别码一致
//电梯识别码一致
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getDeviceId
()))
{
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getDeviceId
()))
{
BoolQueryBuilder
qb6
=
QueryBuilders
.
boolQuery
()
BoolQueryBuilder
qb6
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"deviceId.keyword"
,
alertCalled
.
getDeviceId
()));
.
filter
(
QueryBuilders
.
termQuery
(
"deviceId.keyword"
,
alertCalled
.
getDeviceId
()));
boolMust
.
should
(
qb6
);
boolMust
.
must
(
qb6
);
}
}
/**
/**
...
...
amos-boot-system-maintenance/src/main/resources/db/mapper/dbTemplate_check.xml
View file @
deb70718
...
@@ -286,27 +286,32 @@
...
@@ -286,27 +286,32 @@
COUNT(id) count
COUNT(id) count
FROM
FROM
p_check
p_check
WHERE
<include
refid=
"calendar-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>
</select>
</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
id=
"calendarData"
resultType=
"Map"
>
SELECT
SELECT
sum(is_ok
) AS count,
count(id
) AS count,
DATE_FORMAT(check_time, '%Y-%m-%d') time,
DATE_FORMAT(check_time, '%Y-%m-%d') time,
is_ok status
is_ok status
FROM
FROM
p_check
p_check
WHERE
<include
refid=
"calendar-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>
GROUP BY is_ok,time
GROUP BY is_ok,time
ORDER BY time
ORDER BY
check_
time
</select>
</select>
...
...
amos-boot-system-maintenance/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
deb70718
...
@@ -833,4 +833,24 @@
...
@@ -833,4 +833,24 @@
ORDER BY
ORDER BY
ppk.begin_time DESC LIMIT 60
ppk.begin_time DESC LIMIT 60
</select>
</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>
</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