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
f46854c4
Commit
f46854c4
authored
Aug 17, 2021
by
高建强
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
cab83412
d302a6af
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
450 additions
and
314 deletions
+450
-314
WorkflowFeignService.java
.../boot/biz/common/workflow/feign/WorkflowFeignService.java
+15
-0
FailureMaintainDto.java
...n/amos/boot/module/common/api/dto/FailureMaintainDto.java
+2
-2
FailureRepairlogDto.java
.../amos/boot/module/common/api/dto/FailureRepairlogDto.java
+3
-0
FailureMaintain.java
...n/amos/boot/module/common/api/entity/FailureMaintain.java
+1
-1
FailureRepairlog.java
.../amos/boot/module/common/api/entity/FailureRepairlog.java
+11
-0
EquipFeignClient.java
...n/amos/boot/module/common/api/feign/EquipFeignClient.java
+8
-0
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
CommandController.java
...boot/module/command/biz/controller/CommandController.java
+12
-1
Constants.java
...ejoin/amos/boot/module/common/biz/constats/Constants.java
+1
-0
FailureDetailsController.java
...odule/common/biz/controller/FailureDetailsController.java
+7
-0
FailureMaintainController.java
...dule/common/biz/controller/FailureMaintainController.java
+1
-2
FailureAuditServiceImpl.java
...dule/common/biz/service/impl/FailureAuditServiceImpl.java
+31
-18
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+160
-89
FailureMaintainServiceImpl.java
...e/common/biz/service/impl/FailureMaintainServiceImpl.java
+47
-15
FailureRepairlogServiceImpl.java
.../common/biz/service/impl/FailureRepairlogServiceImpl.java
+5
-3
StatisticsController.java
...maintenance/business/controller/StatisticsController.java
+42
-0
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
StatisticsServiceImpl.java
...ntenance/business/service/impl/StatisticsServiceImpl.java
+46
-0
IStatisticsService.java
...aintenance/business/service/intfc/IStatisticsService.java
+16
-0
AlertCalledController.java
...boot/module/tzs/biz/controller/AlertCalledController.java
+6
-7
dbTemplate_plan_task.xml
...nce/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+21
-0
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/workflow/feign/WorkflowFeignService.java
View file @
f46854c4
...
...
@@ -76,5 +76,20 @@ public interface WorkflowFeignService {
*/
@RequestMapping
(
value
=
"/activitiHistory/historyTask/{processInstanceId}"
,
method
=
RequestMethod
.
GET
)
JSONObject
queryHistoryTasksByProcessInstanceId
(
@PathVariable
(
"processInstanceId"
)
String
processInstanceId
);
/**
* 拾取任务
* @param taskID
* @return
*/
@RequestMapping
(
value
=
"/task/pickuptask/{taskID}"
,
method
=
RequestMethod
.
GET
)
JSONObject
pickuptask
(
@PathVariable
(
"taskID"
)
String
taskID
)
;
/**
* 直接完成任务
* @param taskId
* @param variable
* @return
*/
@RequestMapping
(
value
=
"/task/complete/{taskId}"
,
method
=
RequestMethod
.
POST
)
JSONObject
completeByVariable
(
@PathVariable
(
"taskId"
)
String
taskId
,
@RequestBody
HashMap
<
String
,
Object
>
variable
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/FailureMaintainDto.java
View file @
f46854c4
...
...
@@ -32,7 +32,7 @@ public class FailureMaintainDto extends BaseDto {
private
Long
maintainPhone
;
@ApiModelProperty
(
value
=
"所属部门ID"
)
private
Stri
ng
bizId
;
private
Lo
ng
bizId
;
@ApiModelProperty
(
value
=
"所属部门"
)
private
String
department
;
...
...
@@ -52,7 +52,7 @@ public class FailureMaintainDto extends BaseDto {
@ApiModelProperty
(
value
=
"附件"
)
private
List
<
SourceFile
>
attachment
;
@ApiModelProperty
(
value
=
"审核结果条件判断,0
同意,1拒绝,2驳回
"
)
@ApiModelProperty
(
value
=
"审核结果条件判断,0
完成,1保存
"
)
private
String
condition
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/FailureRepairlogDto.java
View file @
f46854c4
...
...
@@ -44,4 +44,7 @@ public class FailureRepairlogDto extends BaseDto {
@ApiModelProperty
(
value
=
"设备故障报修主表ID"
)
private
Long
faultId
;
@ApiModelProperty
(
value
=
"操作人中文名称"
)
private
String
processAuditorCid
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/FailureMaintain.java
View file @
f46854c4
...
...
@@ -45,7 +45,7 @@ public class FailureMaintain extends BaseEntity {
* 所属部门ID
*/
@TableField
(
"biz_id"
)
private
Stri
ng
bizId
;
private
Lo
ng
bizId
;
/**
* 所属部门
...
...
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 @
f46854c4
...
...
@@ -32,6 +32,11 @@ public class FailureRepairlog extends BaseEntity {
*/
@TableField
(
"process_auditor"
)
private
String
processAuditor
;
/**
* 流程处理人
*/
@TableField
(
"process_auditor_name"
)
private
String
processAuditorName
;
/**
* 处理人所属部门
...
...
@@ -61,4 +66,10 @@ public class FailureRepairlog extends BaseEntity {
@TableField
(
"fault_id"
)
private
Long
faultId
;
/**
* 操作人中文名称
*/
@TableField
(
"process_auditor_name"
)
private
String
processAuditorCid
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/feign/EquipFeignClient.java
View file @
f46854c4
...
...
@@ -150,6 +150,14 @@ public interface EquipFeignClient {
*/
@RequestMapping
(
value
=
"/video/pageVideo"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
pageVideo
(
@RequestParam
Integer
pageNum
,
@RequestParam
Integer
pageSize
,
@RequestParam
Double
longitude
,
@RequestParam
Double
latitude
,
@RequestParam
Double
distance
);
/**
*
*获取视频列表
* @param
* @return
*/
@RequestMapping
(
value
=
"/video/getByid"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
Map
<
String
,
Object
>>
getByid
(
@RequestParam
Long
id
);
}
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 @
f46854c4
...
...
@@ -9,7 +9,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
* @date 2021-08-12
*/
public
interface
IFailureRepairlogService
{
public
FailureRepairlog
findByprocessAuditor
Id
(
Lo
ng
userId
);
public
FailureRepairlog
findByprocessAuditor
(
Stri
ng
userId
);
public
FailureRepairlog
findByFaultId
(
Long
faultId
)
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/core/common/response/CalendarStatusCountRespone.java
View file @
f46854c4
...
...
@@ -6,7 +6,7 @@ public class CalendarStatusCountRespone {
/**
* 个数
*/
private
Double
count
;
private
Long
count
;
/**
* 状态
*/
...
...
@@ -16,7 +16,7 @@ public class CalendarStatusCountRespone {
public
double
getCount
()
{
return
count
;
}
public
void
setCount
(
double
count
)
{
public
void
setCount
(
Long
count
)
{
this
.
count
=
count
;
}
public
String
getStatus
()
{
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/resources/mapper/AlertCalledMapper.xml
View file @
f46854c4
...
...
@@ -5,7 +5,7 @@
<select
id=
"queryAlertStatusCount"
resultType=
"java.util.Map"
>
SELECT
count( 1 ) calledCount,
sum( CASE WHEN father_alert
=
null THEN 1 ELSE 0 END ) majorAlertCount,
sum( CASE WHEN father_alert
is
null THEN 1 ELSE 0 END ) majorAlertCount,
sum( CASE WHEN alarm_type_code = 'KRJY' THEN 1 ELSE 0 END ) sleepyIncidentCount,
sum( CASE WHEN alarm_type_code = 'GZWX' THEN 1 ELSE 0 END ) faultRescueCount,
sum( CASE WHEN alarm_type_code = 'TSZX' THEN 1 ELSE 0 END ) suggestionsCount
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-command-biz/src/main/java/com/yeejoin/amos/boot/module/command/biz/controller/CommandController.java
View file @
f46854c4
...
...
@@ -256,7 +256,18 @@ public class CommandController extends BaseController {
}
/**
* 水源列表分页查询
*
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"video/{id}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
" 视频详情88"
,
notes
=
"视频详情88"
)
public
ResponseModel
<
Object
>
getVideoByid
(
@PathVariable
Long
id
)
{
ResponseModel
<
Map
<
String
,
Object
>>
data
=
equipFeignClient
.
getByid
(
id
);
return
ResponseHelper
.
buildResponse
(
data
!=
null
?
data
.
getResult
():
null
);
}
/**
* 水源列表分页查询
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/constats/Constants.java
View file @
f46854c4
...
...
@@ -14,5 +14,6 @@ public class Constants {
currentStatusNameMap
.
put
(
3
,
"待验收"
);
currentStatusNameMap
.
put
(
4
,
"已拒绝"
);
currentStatusNameMap
.
put
(
5
,
"已完结"
);
currentStatusNameMap
.
put
(
6
,
"维修中"
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureDetailsController.java
View file @
f46854c4
...
...
@@ -194,4 +194,11 @@ public class FailureDetailsController extends BaseController {
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
getExcuteTaskAuthButton
(
sequenceNbr
,
getSelectedOrgInfo
()));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前任务详情"
,
notes
=
"查询当前任务详情"
)
@GetMapping
(
value
=
"/getCurrentTask{sequenceNbr}"
)
public
ResponseModel
<
Object
>
getCurrentTask
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
getCurrentTask
(
sequenceNbr
));
}
}
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 @
f46854c4
...
...
@@ -39,8 +39,7 @@ public class FailureMaintainController extends BaseController {
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureMaintainDto
model
)
{
failureMaintainServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
());
return
ResponseHelper
.
buildResponse
(
model
);
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
}
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureAuditServiceImpl.java
View file @
f46854c4
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
...
...
@@ -25,6 +26,9 @@ import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import
com.yeejoin.amos.boot.module.common.api.mapper.FailureAuditMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
.
FailureDetailsServiceImpl
.
EMERGENCY_COMMAND
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
.
FailureDetailsServiceImpl
.
PROCESS_NAME
;
/**
* 服务实现类
*
...
...
@@ -60,22 +64,25 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
* 发起审核
*/
@Transactional
public
Object
savemodel
(
FailureAuditDto
model
,
ReginParams
userInfo
)
throws
Exception
{
public
Object
savemodel
(
FailureAuditDto
model
,
ReginParams
userInfo
)
{
int
condition
=
Integer
.
parseInt
(
model
.
getCondition
());
model
.
setAuditTime
(
new
Date
());
model
.
setAuditDepartmentId
(
userInfo
.
getDepartment
().
getSequenceNbr
());
model
.
setAuditor
(
userInfo
.
get
Role
().
getRole
Name
());
model
.
setAuditor
(
userInfo
.
get
UserModel
().
getUser
Name
());
model
.
setAuditDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
try
{
//根据审核的结果进行业务操作
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_
MAINTAIN
,
userInfo
,
condition
);
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
().
equals
(
failureDetailsDto
.
getBizCode
())
)
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_
AUDIT
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
}
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
)
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
}
FailureAuditDto
withModel
=
this
.
createWithModel
(
model
);
...
...
@@ -99,15 +106,16 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
//当前角色部门id为应急指挥科的时候 并且同意时 不修改主表状态 依然为待审核
//当前角色部门id为维修部门的时候 修改状态
if
(
userInfo
.
getDepartment
().
getSequenceNbr
()
==
failureDetailsDto
.
getBizCode
()
&&
condition
==
AuditResultEnum
.
AGREE
.
getCode
()){
/*Map<String, Object> stringObjectMap = failureDetailsService.checkExcuteTaskAuthMap(failureDetailsDto.getSequenceNbr(), userInfo);
String name = stringObjectMap.get("name").toString();
if (name.contains(EMERGENCY_COMMAND)) {
failureDetailsDto.setCurrentStatus(failureDetailsDto.getCurrentStatus());
}
else
if
(
userInfo
.
getDepartment
().
getSequenceNbr
()
!=
failureDetailsDto
.
getBizCode
()
)
{
}*/
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
}
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
FailureDetailsDto
failureDetailsDtos
=
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
System
.
out
.
println
(
failureDetailsDtos
);
String
conditionText
;
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
);
...
...
@@ -118,18 +126,17 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
String
processDepartment
=
model
.
getAuditDepartment
();
String
processAuditor
=
model
.
getAuditor
();
Integer
processAuditorId
=
Integer
.
parseInt
(
userInfo
.
getUserModel
().
getUserId
())
;
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
Long
auditDepartmentId
=
(
userInfo
.
getDepartment
().
getSequenceNbr
());
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
)
{
conditionText
=
AuditResultEnum
.
AGREE
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
}
if
(
condition
==
AuditResultEnum
.
SEND_BACK
.
getCode
())
{
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditorCid
);
}
else
if
(
condition
==
AuditResultEnum
.
SEND_BACK
.
getCode
())
{
conditionText
=
AuditResultEnum
.
SEND_BACK
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
}
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
()){
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditorCid
);
}
else
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
()){
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditorCid
);
}
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
+
""
);
return
true
;
...
...
@@ -141,7 +148,8 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
* 添加报修日志
*/
@Transactional
public
void
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
)
{
public
Boolean
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorCid
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
...
...
@@ -150,7 +158,12 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditorCid
(
processAuditorCid
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
)){
return
true
;
}
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 @
f46854c4
...
...
@@ -73,7 +73,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
IFailureRepairlogService
failureRepairlog
;
public
static
String
EMERGENCY_COMMAND
=
"应急指挥科"
;
public
static
String
[]
PROCESS_NAME
=
{
"提交维修单"
,
"审核"
,
"维修"
,
"验收"
};
public
static
String
[]
PROCESS_NAME
=
{
"提交维修单"
,
"审核"
,
"维修"
,
"验收"
,
"维修中"
};
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureDetailsServiceImpl
.
class
);
...
...
@@ -84,21 +84,18 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/**
* 分页查询
*/
public
IPage
<
FailureDetails
>
queryAllPage
(
long
size
,
long
current
)
{
public
IPage
<
FailureDetails
>
queryAllPage
(
long
size
,
long
current
)
{
QueryWrapper
<
FailureDetails
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
orderByDesc
(
"submission_time"
);
IPage
<
FailureDetails
>
page
=
new
Page
<>(
current
,
size
);
return
baseMapper
.
selectPage
(
page
,
wrapper
);
}
public
IPage
<
FailureDetails
>
queryForFailureDetailsPage
(
Page
<
FailureDetails
>
page
,
AgencyUserModel
userInfo
,
Integer
type
)
{
public
IPage
<
FailureDetails
>
queryForFailureDetailsPage
(
Page
<
FailureDetails
>
page
,
AgencyUserModel
userInfo
,
Integer
type
)
{
if
(
type
.
equals
(
SELECY_ALL
)
)
{
return
this
.
queryAllPage
(
page
.
getSize
(),
page
.
getCurrent
());
if
(
type
.
equals
(
SELECY_ALL
))
{
return
this
.
queryAllPage
(
page
.
getSize
(),
page
.
getCurrent
());
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
...
...
@@ -106,7 +103,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return
queryForPage
(
page
,
userInfo
.
getUserId
());
}
return
this
.
queryForWaitManage
(
page
,
userInfo
.
getUserId
());
return
this
.
queryForWaitManage
(
page
,
userInfo
.
getUserId
());
}
/**
...
...
@@ -117,7 +114,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return
null
;
}
QueryWrapper
<
FailureDetails
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"submission_pid"
,
submissionPid
);
wrapper
.
eq
(
"submission_pid"
,
submissionPid
);
wrapper
.
orderByDesc
(
"submission_time"
);
IPage
<
FailureDetails
>
failureDetailsPage
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
return
baseMapper
.
selectPage
(
failureDetailsPage
,
wrapper
);
...
...
@@ -131,9 +128,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return
null
;
}
QueryWrapper
<
FailureDetails
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"submission_pid"
,
submissionPid
);
wrapper
.
notIn
(
"current_status"
,
FailureStatuEnum
.
REFUSE
.
getCode
(),
FailureStatuEnum
.
FINISH
.
getCode
(),
wrapper
.
eq
(
"submission_pid"
,
submissionPid
);
wrapper
.
notIn
(
"current_status"
,
FailureStatuEnum
.
REFUSE
.
getCode
(),
FailureStatuEnum
.
FINISH
.
getCode
(),
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
());
wrapper
.
orderByDesc
(
"submission_time"
);
IPage
<
FailureDetails
>
failureDetailsPage
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
...
...
@@ -152,13 +148,13 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
* 根据状态查询
*/
public
FailureDetailsDto
queryForOne
(
Long
sequenceNbr
){
public
FailureDetailsDto
queryForOne
(
Long
sequenceNbr
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
failureDetailsDto
.
setCurrentStatusName
(
Constants
.
currentStatusNameMap
.
get
(
failureDetailsDto
.
getCurrentStatus
()));
failureDetailsDto
.
setCurrentStatusName
(
Constants
.
currentStatusNameMap
.
get
(
failureDetailsDto
.
getCurrentStatus
()));
List
<
SourceFile
>
sourceFiles
=
sourceFileServiceImpl
.
findBySourceId
(
sequenceNbr
);
failureDetailsDto
.
setAttachment
(
sourceFiles
);
return
failureDetailsDto
;
return
failureDetailsDto
;
}
/**
...
...
@@ -174,11 +170,12 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
list
.
add
(
FailureStatuEnum
.
REFUSE
);
list
.
add
(
FailureStatuEnum
.
FINISH
);
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
();
};
}
/*FailureStatuEnum[] failureStatuEnums = new FailureStatuEnum []{};*/
;
}
/* FailureStatuEnum[] failureStatuEnums = new FailureStatuEnum []{}; */
QueryWrapper
<
FailureDetails
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"current_status"
,
status
).
orderByDesc
(
"submission_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
...
...
@@ -190,61 +187,58 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
* 查询任务状态数量
*/
public
List
<
FailureStatusCountDto
>
queryStatusCount
(
Integer
type
)
{
List
<
FailureDetailsDto
>
failureDetailsDtos
=
new
ArrayList
<>();
List
<
FailureDetailsDto
>
failureDetailsDtos
=
new
ArrayList
<>();
if
(
type
.
equals
(
SELECY_ALL
))
{
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
}
int
auditStatus
=
0
;
int
submitStatus
=
0
;
int
maintainStatus
=
0
;
int
acceptanceStatus
=
0
;
int
refuseStatus
=
0
;
int
finishStatus
=
0
;
int
inMaintenance
=
0
;
int
auditStatus
=
0
;
int
submitStatus
=
0
;
int
maintainStatus
=
0
;
int
acceptanceStatus
=
0
;
int
refuseStatus
=
0
;
int
finishStatus
=
0
;
int
inMaintenance
=
0
;
List
<
FailureStatusCountDto
>
list
=
new
ArrayList
<>();
// String[] statusName = new String[]{"待审核", "待提交", "待维修", "待验收", "已拒绝", "已完结"};
List
<
String
>
statusName
=
new
ArrayList
<>();
Collections
.
addAll
(
statusName
,
FailureStatuEnum
.
WAITING_AUDIT
.
getName
(),
FailureStatuEnum
.
WAITING_SUBMIT
.
getName
(),
FailureStatuEnum
.
WAITING_MAINTAIN
.
getName
(),
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getName
(),
FailureStatuEnum
.
REFUSE
.
getName
(),
FailureStatuEnum
.
FINISH
.
getName
(),
FailureStatuEnum
.
IN_MAINTENANCE
.
getName
());
FailureStatuEnum
.
WAITING_SUBMIT
.
getName
(),
FailureStatuEnum
.
WAITING_MAINTAIN
.
getName
(),
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getName
(),
FailureStatuEnum
.
REFUSE
.
getName
(),
FailureStatuEnum
.
FINISH
.
getName
(),
FailureStatuEnum
.
IN_MAINTENANCE
.
getName
());
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
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_SUBMIT
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_SUBMIT
.
getCode
()))
{
submitStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_MAINTAIN
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_MAINTAIN
.
getCode
()))
{
maintainStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getCode
()))
{
acceptanceStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
REFUSE
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
REFUSE
.
getCode
()))
{
refuseStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
FINISH
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
FINISH
.
getCode
()))
{
finishStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
IN_MAINTENANCE
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
IN_MAINTENANCE
.
getCode
()))
{
inMaintenance
++;
}
}
int
[]
statusCount
=
{
auditStatus
,
submitStatus
,
maintainStatus
,
acceptanceStatus
,
refuseStatus
,
finishStatus
,
inMaintenance
};
int
[]
statusCount
=
{
auditStatus
,
submitStatus
,
maintainStatus
,
acceptanceStatus
,
refuseStatus
,
finishStatus
,
inMaintenance
};
for
(
int
i
=
0
;
i
<
statusName
.
size
();
i
++)
{
FailureStatusCountDto
statusCountDto
=
new
FailureStatusCountDto
();
FailureStatusCountDto
statusCountDto
=
new
FailureStatusCountDto
();
statusCountDto
.
setStatus
(
statusName
.
get
(
i
));
statusCountDto
.
setCount
(
statusCount
[
i
]);
list
.
add
(
statusCountDto
);
...
...
@@ -284,18 +278,20 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
model
=
this
.
createWithModel
(
failureDetailsDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
sourceFileServiceImpl
.
saveSourceFile
(
failureDetailsDto
.
getSequenceNbr
(),
failureDetailsDto
.
getAttachment
());
sourceFileServiceImpl
.
saveSourceFile
(
failureDetailsDto
.
getSequenceNbr
(),
failureDetailsDto
.
getAttachment
());
}
//添加至报修日志
//
添加至报修日志
try
{
Long
faultId
=
model
.
getSequenceNbr
();
String
processAuditor
=
model
.
getRecUserName
();
Integer
processAuditorId
=
model
.
getSubmissionPid
();
String
processResult
=
"提交报修单"
;
String
processDepartment
=
userInfo
.
getDepartment
().
getDepartmentName
();
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Date
processTime
=
model
.
getSubmissionTime
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
processResult
);
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
processResult
,
processAuditorCid
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
info
(
"添加流程日志到数据库失败"
);
...
...
@@ -309,11 +305,11 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return
false
;
// return CommonResponseUtil.failure("添加失败");
}
try
{
try
{
if
(
ObjectUtils
.
isNotEmpty
(
model
))
{
excuteTask
(
instance
.
getString
(
"id"
),
userInfo
,
null
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
...
...
@@ -325,8 +321,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
* 添加报修日志
*/
@Transactional
public
Boolean
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
)
{
public
Boolean
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorCid
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
...
...
@@ -335,21 +331,51 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
FailureRepairlogDto
RepairlogModel
=
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
RepairlogModel
)){
failureRepairlogDto
.
setProcessAuditorCid
(
processAuditorCid
);
FailureRepairlogDto
repairlogModel
=
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
repairlogModel
)){
return
true
;
}
return
false
;
}
public
boolean
excuteTask
(
Long
sequenceNbr
,
ReginParams
userInfo
,
String
condition
)
{
@Transactional
public
boolean
excuteTask
(
Long
sequenceNbr
,
ReginParams
userInfo
,
String
condition
)
throws
Exception
{
HashMap
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
conditionMap
.
put
(
"condition"
,
Integer
.
parseInt
(
condition
));
Map
<
String
,
Object
>
map
=
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
try
{
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
if
(
map
.
get
(
"name"
).
toString
().
startsWith
(
PROCESS_NAME
[
4
]))
{
workflowFeignService
.
completeByVariable
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
}
else
{
workflowFeignService
.
pickupAndCompleteTask
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
}
// 判断下一个节点是不是维修中,如果是则添加当前任务的执行人
String
nextTaskId
=
checkIsInMaintenance
(
sequenceNbr
);
if
(
nextTaskId
!=
null
)
{
workflowFeignService
.
pickuptask
(
nextTaskId
);
}
}
return
true
;
}
/**
* 已经存在的操作人的任务执行,用于维修中节点完成任务
*
* @param sequenceNbr
* @param userInfo
* @param condition
* @return
*/
public
boolean
excuteTaskOnlyOperation
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
Map
<
String
,
Object
>
map
=
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
try
{
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
())
&&
map
.
get
(
"checkFlag"
).
toString
().
startsWith
(
PROCESS_NAME
[
4
]))
{
workflowFeignService
.
completeByVariable
(
map
.
get
(
"taskId"
).
toString
(),
null
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
...
...
@@ -391,6 +417,23 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
());
}
public
String
checkIsInMaintenance
(
Long
sequenceNbr
)
{
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
if
(
name
.
startsWith
(
PROCESS_NAME
[
4
]))
{
return
detail
.
getString
(
"id"
);
}
}
}
return
null
;
}
public
Map
<
String
,
Object
>
checkExcuteTaskAuthMap
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
// 获取当前登录用户的角色
String
currentLoginUserRole
=
userInfo
.
getRole
().
getRoleName
();
...
...
@@ -399,7 +442,6 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
// 获取送达部门的ID
Long
failureEquipmentId
=
failureDetailsDto
.
getSubmissionBranchId
();
// 获取上一级操作部门的Id
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
...
...
@@ -489,28 +531,43 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public
Object
getCurrentProcessHistoryTask
(
Long
id
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
id
);
String
processId
=
failureDetailsDto
.
getProcessId
();
JSONObject
object
=
workflowFeignService
.
queryHistoryTaskListByProcessId
(
processId
);
JSONArray
datArray
=
null
;
if
(
ObjectUtils
.
isNotEmpty
(
object
))
{
datArray
=
object
.
getJSONArray
(
"rows
"
);
JSONObject
object
=
workflowFeignService
.
queryHistoryTaskListByProcessId
(
processId
);
JSONArray
datArray
=
null
;
if
(
ObjectUtils
.
isNotEmpty
(
object
))
{
datArray
=
object
.
getJSONArray
(
"data
"
);
}
List
<
Object
>
list
=
new
ArrayList
<
Object
>();
if
(
datArray
!=
null
)
{
datArray
.
stream
().
forEach
(
i
->
{
if
(
datArray
!=
null
)
{
for
(
Object
i
:
datArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
if
(
detail
.
containsKey
(
"operator"
)
&&
!
detail
.
getString
(
"name"
).
equals
(
"维修中"
))
{
//从流程记录表中拿到处理人的名称
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByprocessAuditorId
(
Long
.
parseLong
(
detail
.
getString
(
"operator"
)));
detail
.
replace
(
"operator"
,
failureRepairlog
.
getProcessAuditor
());
list
.
add
(
object
);
}
});
if
(
detail
.
containsKey
(
"operator"
)
&&
!
detail
.
getString
(
"name"
).
contains
(
"维修中"
))
{
// 从流程记录表中拿到处理人的名称
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByprocessAuditor
(
detail
.
getString
(
"operator"
));
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
;
}
public
static
String
buildOrderNo
()
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy
MMddHHmm
ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy
-MM-dd HH:mm:
ss"
);
String
newDate
=
sdf
.
format
(
new
Date
());
String
result
=
""
;
Random
random
=
new
Random
();
...
...
@@ -522,38 +579,51 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/**
* 获取当前登录人能够操作的任务执行Button类型
*
* @param sequenceNbr
* @param userInfo
* @return
*/
public
Integer
getExcuteTaskAuthButton
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
int
flag
=
0
;
int
flag
=
0
;
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
();
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
0
]))
{
//
提交维修单
flag
=
1
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
1
]))
{
//
审核
flag
=
2
;
if
(
buttonValueString
.
startsWith
(
PROCESS_NAME
[
2
]))
{
flag
=
3
;
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
0
]))
{
//
提交维修单
flag
=
1
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
1
]))
{
//
审核
flag
=
2
;
if
(
buttonValueString
.
startsWith
(
PROCESS_NAME
[
2
]))
{
flag
=
3
;
}
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
2
]))
{
//
维修
flag
=
4
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
3
]))
{
//
验收
flag
=
5
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
2
]))
{
//
维修
flag
=
4
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
3
]))
{
//
验收
flag
=
5
;
}
}
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
JSONObject
object
=
workflowFeignService
.
queryHistoryTasksByProcessInstanceId
(
details
.
getProcessId
());
JSONArray
array
=
object
.
getJSONArray
(
"rows"
);
JSONObject
object
=
workflowFeignService
.
queryHistoryTasksByProcessInstanceId
(
details
.
getProcessId
());
JSONArray
array
=
object
.
getJSONArray
(
"rows"
);
for
(
Object
historyDetail
:
array
)
{
JSONObject
historyDetailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
historyDetail
));
if
(
"rejected"
.
equals
(
historyDetailJson
.
getString
(
"activityId"
)))
{
flag
=
6
;
JSONObject
historyDetailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
historyDetail
));
if
(
"rejected"
.
equals
(
historyDetailJson
.
getString
(
"activityId"
)))
{
flag
=
6
;
}
}
return
flag
;
}
public
Object
getCurrentTask
(
Long
sequenceNbr
)
{
JSONArray
taskDetailArray
=
null
;
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
}
return
taskDetailArray
;
}
}
\ No newline at end of file
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 @
f46854c4
...
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import
java.util.Date
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -13,7 +12,6 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
...
...
@@ -41,9 +39,13 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
private
static
String
RECORE_TYPE
=
"维修记录"
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureMaintainServiceImpl
.
class
);
private
static
String
[]
MAINTENANCE_STATUS
=
{
"维修完成"
,
"维修中"
};
private
static
int
MAINTENANCE_COMPLETE
=
0
;
private
static
int
MAINTENANCE_ADD
=
1
;
private
static
String
[]
PROCESS_RESULT
=
{
"验证通过"
,
"验证未通过"
};
/**
...
...
@@ -64,26 +66,36 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
* 添加维修记录
*/
public
Object
savemodel
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
failureDetailsService
.
checkExcuteTaskAuthMap
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
String
condition
=
failureMaintainDto
.
getCondition
();
int
conditionStatus
=
Integer
.
parseInt
(
condition
);
if
(
conditionStatus
==
MAINTENANCE_ADD
){
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
if
(!
result
){
return
false
;
}
try
{
failureMaintainDto
.
setMaintainMan
(
userInfo
.
getUserModel
().
getUserName
());
failureMaintainDto
.
setMaintainTime
(
new
Date
());
failureMaintainDto
.
setDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
failureMaintainDto
.
setBizId
(
userInfo
.
getDepartment
().
getSequenceNbr
());
failureMaintainDto
.
setRecoreType
(
RECORE_TYPE
);
this
.
createWithModel
(
failureMaintainDto
);
//添加完成后修改保修单状态为待验收
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_ACCEPT
ANCE
.
getCode
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
IN_MAINTEN
ANCE
.
getCode
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
//添加报修日志
String
processResult
=
MAINTENANCE_STATUS
[
1
];
//维修中
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
);
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
())){
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
}
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
null
);
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
condition
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
@@ -95,6 +107,9 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
return
true
;
}
return
this
.
updateStatus
(
failureMaintainDto
,
userInfo
);
}
/**
...
...
@@ -103,26 +118,26 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
public
Boolean
updateStatus
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
try
{
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
IN_MAINTEN
ANCE
.
getCode
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_ACCEPT
ANCE
.
getCode
());
this
.
updateWithModel
(
failureMaintainDto
);
//添加报修日志
String
processResult
=
MAINTENANCE_STATUS
[
0
];
//维修完成
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
);
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
())){
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
}
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
null
);
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
failureMaintainDto
.
getCondition
()
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
info
(
"更新故障验收信息到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
}
return
true
;
}
...
...
@@ -134,6 +149,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
if
(
result
){
this
.
updateWithModel
(
failureMaintainDto
);
//根据status修改状态
String
processResult
=
new
String
();
...
...
@@ -144,7 +160,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
PROCESS_RESULT
[
0
]
;
condition
=
AuditResultEnum
.
AGREE
.
getName
();
}
else
if
(
status
==
AuditResultEnum
.
AGREE
.
getCode
()
)
{
//同意状态为已完结
}
else
if
(
status
==
AuditResultEnum
.
AGREE
.
getCode
()
)
{
//同意状态为已完结
failureDetailsDto
.
setCurrentStatus
(
failureDetailsDto
.
getCurrentStatus
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
PROCESS_RESULT
[
0
]
;
...
...
@@ -157,8 +173,16 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
}
//添加报修日志
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
);
try
{
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
condition
);
}
catch
(
Exception
e
)
{
return
false
;
}
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
condition
);
return
true
;
}
...
...
@@ -178,15 +202,22 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
/**
* 添加报修日志
*/
public
void
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
)
{
@Transactional
public
Boolean
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorCid
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
failureRepairlogDto
.
setProcessDepartmentId
(
departmentId
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessDepartmentId
(
departmentId
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditorCid
(
processAuditorCid
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
)){
return
true
;
}
return
false
;
}
}
\ No newline at end of file
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 @
f46854c4
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import
java.util.List
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -21,6 +22,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService;
* @date 2021-08-12
*/
@Service
@Transactional
public
class
FailureRepairlogServiceImpl
extends
BaseService
<
FailureRepairlogDto
,
FailureRepairlog
,
FailureRepairlogMapper
>
implements
IFailureRepairlogService
{
/**
* 分页查询
...
...
@@ -47,9 +49,9 @@ public class FailureRepairlogServiceImpl extends BaseService<FailureRepairlogDto
}
public
FailureRepairlog
findByprocessAuditor
Id
(
Lo
ng
userId
)
{
QueryWrapper
<
FailureRepairlog
>
queryWrapper
=
new
QueryWrapper
<
FailureRepairlog
>();
queryWrapper
.
eq
(
"process_auditor_id"
,
userId
);
public
FailureRepairlog
findByprocessAuditor
(
Stri
ng
userId
)
{
LambdaQueryWrapper
<
FailureRepairlog
>
queryWrapper
=
new
Lambda
QueryWrapper
<
FailureRepairlog
>();
queryWrapper
.
eq
(
FailureRepairlog:
:
getProcessAuditor
,
userId
);
queryWrapper
.
last
(
"LIMIT 1"
);
return
baseMapper
.
selectOne
(
queryWrapper
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/StatisticsController.java
0 → 100644
View file @
f46854c4
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/PlanTaskMapper.java
View file @
f46854c4
...
...
@@ -179,4 +179,5 @@ public interface PlanTaskMapper extends BaseMapper {
List
<
Map
<
String
,
Object
>>
queryTimeAxis
(
HashMap
<
String
,
Object
>
params
);
List
<
Map
<
String
,
Object
>>
statisticsTaskWithAuth
(
Map
<
String
,
Object
>
param
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/feign/EquipFeign.java
View file @
f46854c4
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
feign
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
...
...
@@ -37,5 +34,14 @@ public interface EquipFeign {
*/
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/area/tree"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
/**
* 查询维保到期设备
* @param type
* @param companyId
* @return
*/
@GetMapping
(
value
=
"${equip.fegin.prefix}+/facility"
)
List
<
Map
<
String
,
Object
>>
overTimeMaintenanceFacility
(
@RequestParam
String
type
,
String
companyId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/feign/Remote3D.java
deleted
100644 → 0
View file @
cab83412
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 @
cab83412
//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/StatisticsServiceImpl.java
0 → 100644
View file @
f46854c4
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/IStatisticsService.java
0 → 100644
View file @
f46854c4
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-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/AlertCalledController.java
View file @
f46854c4
...
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.SystemClock
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -218,21 +217,21 @@ public class AlertCalledController extends BaseController {
// 当天接警
alarmStatisticsDto
.
setTodayAlarmNum
(
map
.
get
(
"calledCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"calledCount"
).
toString
()))
;
//当天提交
alarmStatisticsDto
.
set
TodayAlarm
Num
(
map
.
get
(
"majorAlertCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"majorAlertCount"
).
toString
()))
;
alarmStatisticsDto
.
set
Submit
Num
(
map
.
get
(
"majorAlertCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"majorAlertCount"
).
toString
()))
;
//投诉咨询数量
alarmStatisticsDto
.
setSuggestions
(
map
.
get
(
"suggestionsCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"suggestionsCount"
).
toString
()))
;
//故障维修数量
alarmStatisticsDto
.
set
Suggestions
(
map
.
get
(
"faultRescueCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"faultRescueCount"
).
toString
()))
;
alarmStatisticsDto
.
set
FaultRescue
(
map
.
get
(
"faultRescueCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"faultRescueCount"
).
toString
()))
;
//困人救援数量
alarmStatisticsDto
.
setS
uggestions
(
map
.
get
(
"sleepyIncidentCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"sleepyIncidentCount"
).
toString
()))
;
alarmStatisticsDto
.
setS
leepyIncident
(
map
.
get
(
"sleepyIncidentCount"
)
==
null
?
0
:
Integer
.
valueOf
(
map
.
get
(
"sleepyIncidentCount"
).
toString
()))
;
Map
<
String
,
Integer
>
recordMap
=
Maps
.
newHashMap
();
// 近七天办理数量
for
(
int
i
=
1
;
i
<
8
;
i
++)
{
Map
<
String
,
Object
>
nearlySevenDaysMap
=
iAlertCalledService
.
getAlertInfoList
(
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
"yyyy-MM-dd"
)+
" 00:00:00"
,
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
"yyyy-MM-dd"
)+
" 23:59:59"
,
null
,
Map
<
String
,
Object
>
nearlySevenDaysMap
=
iAlertCalledService
.
getAlertInfoList
(
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
-
i
).
getTime
(),
"yyyy-MM-dd"
)+
" 00:00:00"
,
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
-
i
).
getTime
(),
"yyyy-MM-dd"
)+
" 23:59:59"
,
null
,
getUserInfo
().
getUserId
());
recordMap
.
put
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddDays
(
new
Date
(),
-
i
),
"
"
),
nearlySevenDaysMap
.
get
(
"calledCount"
)
==
null
?
0
:
Integer
.
valueOf
(
nearlySevenDaysMap
.
get
(
"calledCount"
).
toString
()));
recordMap
.
put
(
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
-
i
).
getTime
(),
"yyyy-MM-dd
"
),
nearlySevenDaysMap
.
get
(
"calledCount"
)
==
null
?
0
:
Integer
.
valueOf
(
nearlySevenDaysMap
.
get
(
"calledCount"
).
toString
()));
}
alarmStatisticsDto
.
setNearlySevenDaysNum
(
recordMap
);
}
...
...
amos-boot-system-maintenance/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
f46854c4
...
...
@@ -833,4 +833,24 @@
ORDER BY
ppk.begin_time DESC LIMIT 60
</select>
<select
id=
"statisticsTaskWithAuth"
resultType=
"java.util.Map"
>
SELECT
count(1) as total,
td.is_finish
from p_plan_task_detail td ,
p_plan_task t,
p_route r
where
td.task_no = t.id
and t.route_id = r.id
<choose>
<when
test=
"identityType==1"
>
and (t.org_code LIKE CONCAT( #{orgCode}, '-%' ) or t.org_code= #{orgCode} )
</when>
<when
test=
"identityType==2"
>
And r.owner_id = #{companyId}
</when>
</choose>
GROUP BY td.is_finish
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment