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
2f554c53
Commit
2f554c53
authored
Aug 17, 2021
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
2d57e853
450b2e29
Hide whitespace changes
Inline
Side-by-side
Showing
86 changed files
with
1034 additions
and
8610 deletions
+1034
-8610
BizConstant.java
...m/yeejoin/amos/boot/biz/common/constants/BizConstant.java
+24
-0
WorkflowFeignService.java
.../boot/biz/common/workflow/feign/WorkflowFeignService.java
+8
-8
LatentDangerExcuteTypeEnum.java
.../maintenance/common/enums/LatentDangerExcuteTypeEnum.java
+0
-118
LatentDangerLevelEnum.java
.../amos/maintenance/common/enums/LatentDangerLevelEnum.java
+0
-67
LatentDangerOvertimeStateEnum.java
...intenance/common/enums/LatentDangerOvertimeStateEnum.java
+0
-45
LatentDangerReformTypeEnum.java
.../maintenance/common/enums/LatentDangerReformTypeEnum.java
+0
-47
LatentDangerStateEnum.java
.../amos/maintenance/common/enums/LatentDangerStateEnum.java
+0
-63
LatentDangerTypeEnum.java
...n/amos/maintenance/common/enums/LatentDangerTypeEnum.java
+0
-59
OrderByEnum.java
...om/yeejoin/amos/maintenance/common/enums/OrderByEnum.java
+3
-1
RiskFactorWorkFlowActionTypeEnum.java
...enance/common/enums/RiskFactorWorkFlowActionTypeEnum.java
+0
-45
RiskFactorsCmStatusEnum.java
...mos/maintenance/common/enums/RiskFactorsCmStatusEnum.java
+0
-84
RiskJudgeTaskworkTypeEnum.java
...s/maintenance/common/enums/RiskJudgeTaskworkTypeEnum.java
+0
-49
RiskJudgmentSelectStatusEnum.java
...aintenance/common/enums/RiskJudgmentSelectStatusEnum.java
+0
-36
RiskJudgmentStatusEnum.java
...amos/maintenance/common/enums/RiskJudgmentStatusEnum.java
+0
-38
RiskJudgmentTaskStatusEnum.java
.../maintenance/common/enums/RiskJudgmentTaskStatusEnum.java
+0
-50
WorkFlowDefinitionKeyEnum.java
...s/maintenance/common/enums/WorkFlowDefinitionKeyEnum.java
+0
-54
WorkFlowRiskFactorUriEnum.java
...s/maintenance/common/enums/WorkFlowRiskFactorUriEnum.java
+0
-45
WorkFlowUriEnum.java
...eejoin/amos/maintenance/common/enums/WorkFlowUriEnum.java
+0
-57
LatentDanger.java
...com/yeejoin/amos/maintenance/dao/entity/LatentDanger.java
+0
-154
LatentDangerFlowRecord.java
...n/amos/maintenance/dao/entity/LatentDangerFlowRecord.java
+0
-73
LatentDangerPatrol.java
...ejoin/amos/maintenance/dao/entity/LatentDangerPatrol.java
+0
-69
LatentDangerPhoto.java
...eejoin/amos/maintenance/dao/entity/LatentDangerPhoto.java
+0
-41
DispatchSaveFeedbackDto.java
...amos/boot/module/tzs/api/dto/DispatchSaveFeedbackDto.java
+3
-0
TzsCommonParam.java
...eejoin/amos/boot/module/tzs/api/enums/TzsCommonParam.java
+39
-0
WaterResourceController.java
...module/common/biz/controller/WaterResourceController.java
+12
-27
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+18
-11
LinkageUnitServiceImpl.java
...odule/common/biz/service/impl/LinkageUnitServiceImpl.java
+14
-24
WaterResourceServiceImpl.java
...ule/common/biz/service/impl/WaterResourceServiceImpl.java
+30
-0
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+376
-390
CheckController.java
...amos/maintenance/business/controller/CheckController.java
+50
-2
LatentDangerController.java
...intenance/business/controller/LatentDangerController.java
+0
-301
CheckMapper.java
...oin/amos/maintenance/business/dao/mapper/CheckMapper.java
+7
-1
LatentDangerFlowRecordMapper.java
...nce/business/dao/mapper/LatentDangerFlowRecordMapper.java
+0
-35
LatentDangerMapper.java
...s/maintenance/business/dao/mapper/LatentDangerMapper.java
+0
-70
LatentDangerPatrolMapper.java
...tenance/business/dao/mapper/LatentDangerPatrolMapper.java
+0
-22
RiskJudgmentFillRecordMapper.java
...nce/business/dao/mapper/RiskJudgmentFillRecordMapper.java
+0
-30
RiskJudgmentItemMapper.java
...intenance/business/dao/mapper/RiskJudgmentItemMapper.java
+0
-20
RiskJudgmentTaskMapper.java
...intenance/business/dao/mapper/RiskJudgmentTaskMapper.java
+0
-35
DangerExecuteSubmitDto.java
...amos/maintenance/business/dto/DangerExecuteSubmitDto.java
+0
-18
LatentDangerFlowRecordBoExtend.java
...siness/entity/mybatis/LatentDangerFlowRecordBoExtend.java
+0
-17
LatentDangerPatrolBoExtend.java
...e/business/entity/mybatis/LatentDangerPatrolBoExtend.java
+0
-43
RiskJudgmentFillRecordBo.java
...nce/business/entity/mybatis/RiskJudgmentFillRecordBo.java
+0
-77
RiskJudgmentItemBo.java
...intenance/business/entity/mybatis/RiskJudgmentItemBo.java
+0
-130
RiskJudgmentTaskBo.java
...intenance/business/entity/mybatis/RiskJudgmentTaskBo.java
+0
-79
LatentDangerBo.java
...enance/business/entity/mybatis/extend/LatentDangerBo.java
+0
-136
LatentDangerFlowRecordBo.java
...iness/entity/mybatis/extend/LatentDangerFlowRecordBo.java
+0
-50
LatentDangerNoticeBo.java
.../business/entity/mybatis/extend/LatentDangerNoticeBo.java
+0
-92
LatentDangerPatrolBo.java
.../business/entity/mybatis/extend/LatentDangerPatrolBo.java
+0
-51
RiskJudgmentFillRecordExtend.java
...s/entity/mybatis/extend/RiskJudgmentFillRecordExtend.java
+0
-92
CheckInputParam.java
...join/amos/maintenance/business/param/CheckInputParam.java
+4
-0
CheckRecordParam.java
...oin/amos/maintenance/business/param/CheckRecordParam.java
+4
-12
LatentDangerExcuteParam.java
...s/maintenance/business/param/LatentDangerExcuteParam.java
+0
-53
LatentDangerListParam.java
...mos/maintenance/business/param/LatentDangerListParam.java
+0
-40
LatentDangerNormalParam.java
...s/maintenance/business/param/LatentDangerNormalParam.java
+0
-50
LatentDangerPatrolItemParam.java
...intenance/business/param/LatentDangerPatrolItemParam.java
+0
-53
LatentDangerPatrolParam.java
...s/maintenance/business/param/LatentDangerPatrolParam.java
+0
-20
AppServiceImpl.java
...mos/maintenance/business/service/impl/AppServiceImpl.java
+48
-110
CheckServiceImpl.java
...s/maintenance/business/service/impl/CheckServiceImpl.java
+39
-6
LatentDangerServiceImpl.java
...enance/business/service/impl/LatentDangerServiceImpl.java
+0
-1657
PlanTaskServiceImpl.java
...aintenance/business/service/impl/PlanTaskServiceImpl.java
+1
-0
RiskJudgmentTaskServiceImpl.java
...ce/business/service/impl/RiskJudgmentTaskServiceImpl.java
+0
-461
ICheckService.java
...mos/maintenance/business/service/intfc/ICheckService.java
+12
-22
ILatentDangerService.java
...ntenance/business/service/intfc/ILatentDangerService.java
+0
-84
CheckParamUtil.java
...eejoin/amos/maintenance/business/util/CheckParamUtil.java
+0
-2
LatentDangerDetailRiskVo.java
...mos/maintenance/business/vo/LatentDangerDetailRiskVo.java
+0
-34
LatentDangerDetailVo.java
...in/amos/maintenance/business/vo/LatentDangerDetailVo.java
+0
-61
LatentDangerListVo.java
...join/amos/maintenance/business/vo/LatentDangerListVo.java
+0
-27
RemoteRiskFactorFlowService.java
...aintenance/common/remote/RemoteRiskFactorFlowService.java
+0
-61
RemoteSpcService.java
...join/amos/maintenance/common/remote/RemoteSpcService.java
+0
-86
RemoteWorkFlowService.java
...amos/maintenance/common/remote/RemoteWorkFlowService.java
+0
-308
LatentDanerScheduled.java
...ejoin/amos/maintenance/schedule/LatentDanerScheduled.java
+0
-27
AlertCalledServiceImpl.java
...t/module/tzs/biz/service/impl/AlertCalledServiceImpl.java
+12
-28
DispatchPaperServiceImpl.java
...module/tzs/biz/service/impl/DispatchPaperServiceImpl.java
+123
-108
DispatchTaskServiceImpl.java
.../module/tzs/biz/service/impl/DispatchTaskServiceImpl.java
+2
-2
RepairConsultServiceImpl.java
...module/tzs/biz/service/impl/RepairConsultServiceImpl.java
+25
-20
RescueProcessServiceImpl.java
...module/tzs/biz/service/impl/RescueProcessServiceImpl.java
+0
-1
application-dev.properties
...maintenance/src/main/resources/application-dev.properties
+4
-9
mt-1.0.0.xml
...-maintenance/src/main/resources/db/changelog/mt-1.0.0.xml
+10
-0
mt-sql-task.xml
...intenance/src/main/resources/db/changelog/mt-sql-task.xml
+1
-1
LatentDangerFlowRecordMapper.xml
...main/resources/db/mapper/LatentDangerFlowRecordMapper.xml
+0
-278
LatentDangerMapper.xml
...nance/src/main/resources/db/mapper/LatentDangerMapper.xml
+0
-947
LatentDangerPatrolMapper.xml
...src/main/resources/db/mapper/LatentDangerPatrolMapper.xml
+0
-210
SpcRiskJudgmentFillRecordMapper.xml
...n/resources/db/mapper/SpcRiskJudgmentFillRecordMapper.xml
+0
-301
SpcRiskJudgmentItemMapper.xml
...rc/main/resources/db/mapper/SpcRiskJudgmentItemMapper.xml
+0
-245
SpcRiskJudgmentTaskMapper.xml
...rc/main/resources/db/mapper/SpcRiskJudgmentTaskMapper.xml
+0
-327
dbTemplate_check.xml
...tenance/src/main/resources/db/mapper/dbTemplate_check.xml
+165
-3
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/constants/BizConstant.java
0 → 100644
View file @
2f554c53
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
constants
;
/**
* @Description: 业务通用常量类
* @Author: DELL
* @Date: 2021/5/26
*/
public
interface
BizConstant
{
/**
* 经度
*/
public
final
static
String
LONGITUDE
=
"longitude"
;
/**
* 纬度
*/
public
final
static
String
LATITUDE
=
"latitude"
;
/**
* 地址
*/
public
final
static
String
ADDRESS
=
"address"
;
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/workflow/feign/WorkflowFeignService.java
View file @
2f554c53
...
...
@@ -11,11 +11,11 @@ import org.springframework.web.bind.annotation.RequestParam;
import
com.alibaba.fastjson.JSONObject
;
@FeignClient
(
name
=
"AMOS-API-WORKFLOW"
,
path
=
"workflow"
,
configuration
=
{
CommonMultipartSupportConfig
.
class
})
@FeignClient
(
name
=
"AMOS-API-WORKFLOW
-CJHENHAO
"
,
path
=
"workflow"
,
configuration
=
{
CommonMultipartSupportConfig
.
class
})
public
interface
WorkflowFeignService
{
/**
* 发起流程
*
*
* @param params
* @return
*/
...
...
@@ -24,7 +24,7 @@ public interface WorkflowFeignService {
/**
* 完成任务
*
*
* @param taskID
* @param variable
* @return
...
...
@@ -36,7 +36,7 @@ public interface WorkflowFeignService {
/**
* 查询当前流程下所有的可执行任务
*
*
* @param processInstanceId
* @return
*/
...
...
@@ -45,13 +45,13 @@ public interface WorkflowFeignService {
/**
* 查询当前任务的执行用户组
*
*
* @param processInstanceId
* @return
*/
@RequestMapping
(
value
=
"/task/getTaskGroupName/{taskId}"
,
method
=
RequestMethod
.
GET
)
JSONObject
getTaskGroupName
(
@PathVariable
(
"taskId"
)
String
taskId
);
/**
* 我的待办
* @param processDefinitionKey
...
...
@@ -74,7 +74,7 @@ public interface WorkflowFeignService {
* @param processInstanceId
* @return
*/
@RequestMapping
(
value
=
"/activitiHistory/
tasks
/{processInstanceId}"
,
method
=
RequestMethod
.
GET
)
JSONObject
queryTasksByProcessInstanceId
(
@PathVariable
(
"processInstanceId"
)
String
processInstanceId
);
@RequestMapping
(
value
=
"/activitiHistory/
historyTask
/{processInstanceId}"
,
method
=
RequestMethod
.
GET
)
JSONObject
query
History
TasksByProcessInstanceId
(
@PathVariable
(
"processInstanceId"
)
String
processInstanceId
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/LatentDangerExcuteTypeEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
LatentDangerExcuteTypeEnum
{
填写隐患完成
(
"填写隐患完成"
,
1
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
待评审
,
"{\"action\": \"complete\"}"
),
隐患评审通过
(
"隐患评审通过"
,
2
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
待治理
,
"{\"reviewResult\": \"通过\"}"
),
隐患评审拒绝
(
"隐患评审拒绝"
,
3
,
ExecuteStateEnum
.
驳回
,
LatentDangerStateEnum
.
已撤销
,
"{\"reviewResult\": \"不通过\"}"
),
隐患常规治理
(
"隐患常规治理"
,
4
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
待验证
,
"{\"rectifyResult\": \"常规整改\"}"
),
隐患安措计划
(
"隐患安措计划"
,
5
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
安措计划中
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rectification\",\"value\": \"plan\"}]}"
),
隐患延期治理
(
"隐患延期治理"
,
15
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
延期治理申请待车间部门审核
,
"{\"rectifyResult\": \"延期\"}"
),
隐患延期治理车间部门审核通过
(
"隐患延期治理车间部门审核通过"
,
16
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
待治理
,
"{\"approveResult\": \"通过\"}"
),
隐患延期治理车间部门审核拒绝
(
"隐患延期治理车间部门审核拒绝"
,
17
,
ExecuteStateEnum
.
驳回
,
LatentDangerStateEnum
.
待治理
,
"{\"approveResult\": \"不通过\"}"
),
隐患延期治理公司审核通过
(
"隐患延期治理公司审核通过"
,
18
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
待治理
,
"{\"approveResult\": true}"
),
隐患延期治理公司审核拒绝
(
"隐患延期治理公司审核拒绝"
,
19
,
ExecuteStateEnum
.
驳回
,
LatentDangerStateEnum
.
延期治理申请待车间部门审核
,
"{\"approveResult\": false}"
),
填写安措计划完成
(
"填写安措计划完成"
,
6
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
安措计划中
,
"{\"action\": \"complete\"}"
),
车间部门审核通过
(
"车间部门审核通过"
,
7
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
安措计划中
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"
),
车间部门审核拒绝
(
"车间部门审核拒绝"
,
8
,
ExecuteStateEnum
.
驳回
,
LatentDangerStateEnum
.
待治理
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"
),
总工程师审核通过
(
"总工程师审核通过"
,
9
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
安措计划中
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"
),
总工程师审核拒绝
(
"总工程师审核拒绝"
,
10
,
ExecuteStateEnum
.
驳回
,
LatentDangerStateEnum
.
待治理
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"
),
公司负责人审核通过
(
"公司负责人审核通过"
,
11
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
待验证
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"
),
公司负责人审核拒绝
(
"公司负责人审核拒绝"
,
12
,
ExecuteStateEnum
.
驳回
,
LatentDangerStateEnum
.
待治理
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"
),
隐患验证通过
(
"隐患验证通过"
,
13
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
治理完毕
,
"{\"validationResult\": \"通过\"}"
),
隐患验证拒绝
(
"隐患验证拒绝"
,
14
,
ExecuteStateEnum
.
驳回
,
LatentDangerStateEnum
.
待治理
,
"{\"validationResult\": \"不通过\"}"
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
Integer
code
;
/**
* 执行状态
*/
private
ExecuteStateEnum
excuteState
;
private
String
requestBody
;
private
LatentDangerStateEnum
nextState
;
LatentDangerExcuteTypeEnum
(
String
name
,
Integer
code
,
ExecuteStateEnum
excuteState
,
LatentDangerStateEnum
nextState
,
String
requestBody
)
{
this
.
name
=
name
;
this
.
code
=
code
;
this
.
excuteState
=
excuteState
;
this
.
requestBody
=
requestBody
;
this
.
nextState
=
nextState
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
ExecuteStateEnum
getExcuteState
()
{
return
excuteState
;
}
public
void
setExcuteState
(
ExecuteStateEnum
excuteState
)
{
this
.
excuteState
=
excuteState
;
}
public
String
getRequestBody
()
{
return
requestBody
;
}
public
void
setRequestBody
(
String
requestBody
)
{
this
.
requestBody
=
requestBody
;
}
public
LatentDangerStateEnum
getNextState
()
{
return
nextState
;
}
public
void
setNextState
(
LatentDangerStateEnum
nextState
)
{
this
.
nextState
=
nextState
;
}
public
static
LatentDangerExcuteTypeEnum
getByCode
(
Integer
code
)
{
for
(
LatentDangerExcuteTypeEnum
e
:
LatentDangerExcuteTypeEnum
.
values
())
{
if
(
code
.
equals
(
e
.
getCode
()))
{
return
e
;
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/LatentDangerLevelEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
LatentDangerLevelEnum
{
安全问题
(
"安全问题"
,
0
,
"0"
),
一般隐患
(
"一般隐患"
,
1
,
"1"
),
重大隐患
(
"重大隐患"
,
2
,
"2"
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
Integer
code
;
private
String
riskSourceDangerLevelCode
;
LatentDangerLevelEnum
(
String
name
,
Integer
code
,
String
riskSourceDangerLevelCode
)
{
this
.
name
=
name
;
this
.
code
=
code
;
this
.
riskSourceDangerLevelCode
=
riskSourceDangerLevelCode
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getRiskSourceDangerLevelCode
()
{
return
riskSourceDangerLevelCode
;
}
public
void
setRiskSourceDangerLevelCode
(
String
riskSourceDangerLevelCode
)
{
this
.
riskSourceDangerLevelCode
=
riskSourceDangerLevelCode
;
}
public
static
LatentDangerLevelEnum
getByRiskSourceDangerLevelCode
(
String
riskSourceDangerLevelCode
)
{
for
(
LatentDangerLevelEnum
l
:
LatentDangerLevelEnum
.
values
())
{
if
(
riskSourceDangerLevelCode
.
equals
(
l
.
getRiskSourceDangerLevelCode
()))
{
return
l
;
}
}
return
null
;
}
public
static
LatentDangerLevelEnum
getByCode
(
Integer
code
)
{
for
(
LatentDangerLevelEnum
l
:
LatentDangerLevelEnum
.
values
())
{
if
(
code
.
equals
(
l
.
getCode
()))
{
return
l
;
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/LatentDangerOvertimeStateEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
LatentDangerOvertimeStateEnum
{
未超时
(
"未超时"
,
0
),
已超时
(
"已超时"
,
1
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
Integer
code
;
LatentDangerOvertimeStateEnum
(
String
name
,
Integer
code
)
{
this
.
name
=
name
;
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
static
LatentDangerOvertimeStateEnum
getByCode
(
Integer
code
)
{
for
(
LatentDangerOvertimeStateEnum
l
:
LatentDangerOvertimeStateEnum
.
values
())
{
if
(
code
.
equals
(
l
.
getCode
()))
{
return
l
;
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/LatentDangerReformTypeEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
LatentDangerReformTypeEnum
{
常规整改
(
"常规整改"
,
1
),
安措计划
(
"安措计划"
,
2
),
延期治理
(
"延期治理"
,
3
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
Integer
code
;
LatentDangerReformTypeEnum
(
String
name
,
Integer
code
)
{
this
.
name
=
name
;
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
static
LatentDangerReformTypeEnum
getByCode
(
Integer
code
)
{
for
(
LatentDangerReformTypeEnum
l
:
LatentDangerReformTypeEnum
.
values
())
{
if
(
code
.
equals
(
l
.
getCode
()))
{
return
l
;
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/LatentDangerStateEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
LatentDangerStateEnum
{
待评审
(
"待评审"
,
1
),
待治理
(
"待治理"
,
2
),
安措计划中
(
"安措计划中"
,
3
),
待验证
(
"待验证"
,
4
),
治理完毕
(
"治理完毕"
,
5
),
已撤销
(
"已撤销"
,
6
),
延期治理申请
(
"延期治理中"
,
7
),
延期治理申请待车间部门审核
(
"延期治理待车间部门审核"
,
8
),
延期治理申请待公司审核
(
"延期治理待公司审核"
,
9
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
Integer
code
;
LatentDangerStateEnum
(
String
name
,
Integer
code
)
{
this
.
name
=
name
;
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
static
String
getEnumName
(
Integer
code
)
{
String
name
=
""
;
for
(
LatentDangerStateEnum
type:
LatentDangerStateEnum
.
values
())
{
if
(
type
.
getCode
()==
code
)
{
name
=
type
.
getName
();
break
;
}
}
return
name
;
}
public
static
LatentDangerStateEnum
getByCode
(
Integer
code
)
{
for
(
LatentDangerStateEnum
l
:
LatentDangerStateEnum
.
values
())
{
if
(
code
.
equals
(
l
.
getCode
()))
{
return
l
;
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/LatentDangerTypeEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
LatentDangerTypeEnum
{
无码检查
(
"无码检查"
,
1
),
计划检查
(
"计划检查"
,
2
),
无计划检查
(
"无计划检查"
,
3
),
随手拍
(
"随手拍"
,
4
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
Integer
code
;
LatentDangerTypeEnum
(
String
name
,
Integer
code
)
{
this
.
name
=
name
;
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
static
String
getEnumName
(
Integer
code
)
{
String
name
=
""
;
for
(
LatentDangerTypeEnum
type:
LatentDangerTypeEnum
.
values
())
{
if
(
type
.
getCode
()==
code
)
{
name
=
type
.
getName
();
break
;
}
}
return
name
;
}
public
static
LatentDangerTypeEnum
getByCode
(
Integer
code
)
{
for
(
LatentDangerTypeEnum
l
:
LatentDangerTypeEnum
.
values
())
{
if
(
code
.
equals
(
l
.
getCode
()))
{
return
l
;
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/OrderByEnum.java
View file @
2f554c53
...
...
@@ -17,7 +17,9 @@ public enum OrderByEnum {
PLAN_TASK_NUM_ASC
(
"计划维保设施数正序"
,
"3"
,
"taskPlanNum asc"
),
PLAN_TASK_NUM_DESC
(
"计划维保设施数倒序"
,
"4"
,
"taskPlanNum desc"
),
FINISH_NUM_DESC
(
"完成数倒序"
,
"5"
,
"finishNum desc"
),
FINISH_NUM_ASC
(
"完成数正序"
,
"6"
,
"finishNum asc"
);
FINISH_NUM_ASC
(
"完成数正序"
,
"6"
,
"finishNum asc"
),
DATE_DESC
(
"维保记录时间倒序"
,
"7"
,
"checkDate desc"
),
DATE_ASC
(
"维保记录时间正序"
,
"8"
,
"checkDate asc"
);
/**
* 名字
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/RiskFactorWorkFlowActionTypeEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
RiskFactorWorkFlowActionTypeEnum
{
通过
(
"通过"
,
1
),
拒绝
(
"拒绝"
,
2
),
终止流程
(
"终止流程"
,
3
),
唤起流程
(
"唤起流程"
,
4
),
重启流程
(
"重启流程"
,
5
);
private
String
desc
;
private
Integer
actionType
;
RiskFactorWorkFlowActionTypeEnum
(
String
desc
,
Integer
actionType
)
{
this
.
desc
=
desc
;
this
.
actionType
=
actionType
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
Integer
getActionType
()
{
return
actionType
;
}
public
void
setActionType
(
Integer
actionType
)
{
this
.
actionType
=
actionType
;
}
public
static
RiskFactorWorkFlowActionTypeEnum
getByActionType
(
Integer
actionType
)
{
for
(
RiskFactorWorkFlowActionTypeEnum
e
:
RiskFactorWorkFlowActionTypeEnum
.
values
())
{
if
(
actionType
.
equals
(
e
.
actionType
))
{
return
e
;
}
}
return
null
;
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/RiskFactorsCmStatusEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 风险管控内容状态
* @author maoying
*
*/
public
enum
RiskFactorsCmStatusEnum
{
Control
(
"受控"
,
"1"
),
outOfControl
(
"失控"
,
"2"
),
generalDanger
(
"一般"
,
"3"
),
majorDanger
(
"重要"
,
"4"
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
String
code
;
private
RiskFactorsCmStatusEnum
(
String
name
,
String
code
){
this
.
name
=
name
;
this
.
code
=
code
;
}
public
static
RiskFactorsCmStatusEnum
getEnum
(
String
code
)
{
RiskFactorsCmStatusEnum
instance
=
null
;
for
(
RiskFactorsCmStatusEnum
type:
RiskFactorsCmStatusEnum
.
values
())
{
if
(
type
.
getCode
().
equals
(
code
))
{
instance
=
type
;
break
;
}
}
return
instance
;
}
public
static
String
getEnumName
(
String
code
)
{
String
name
=
""
;
for
(
RiskFactorsCmStatusEnum
type:
RiskFactorsCmStatusEnum
.
values
())
{
if
(
type
.
getCode
().
equals
(
code
))
{
name
=
type
.
getName
();
break
;
}
}
return
name
;
}
public
static
List
<
Map
<
String
,
String
>>
getEnumList
()
{
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<>();
for
(
RiskFactorsCmStatusEnum
e
:
RiskFactorsCmStatusEnum
.
values
())
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"code"
,
e
.
getCode
());
map
.
put
(
"name"
,
e
.
getName
());
list
.
add
(
map
);
}
return
list
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/RiskJudgeTaskworkTypeEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
/**
* 作业活动类型
*
* @author Administrator
*/
public
enum
RiskJudgeTaskworkTypeEnum
{
重大工艺操作
(
TaskworkTypeEnum
.
重大工艺操作
,
"danger_work_control_a"
),
检维修作业
(
TaskworkTypeEnum
.
检维修作业
,
"danger_work_control_b"
),
特殊动火作业
(
TaskworkTypeEnum
.
特殊动火作业
,
"danger_work_control_c"
),
一级动火作业
(
TaskworkTypeEnum
.
一级动火作业
,
"danger_work_control_d"
),
二级动火作业
(
TaskworkTypeEnum
.
二级动火作业
,
"danger_work_control_e"
),
进入受限空间作业
(
TaskworkTypeEnum
.
进入受限空间作业
,
"danger_work_control_f"
);
/**
* 名称,描述
*/
private
TaskworkTypeEnum
eum
;
/**
* 编码
*/
private
String
intemFlag
;
private
RiskJudgeTaskworkTypeEnum
(
TaskworkTypeEnum
eum
,
String
intemFlag
)
{
this
.
setEum
(
eum
);
this
.
setIntemFlag
(
intemFlag
);
}
public
TaskworkTypeEnum
getEum
()
{
return
eum
;
}
public
void
setEum
(
TaskworkTypeEnum
eum
)
{
this
.
eum
=
eum
;
}
public
String
getIntemFlag
()
{
return
intemFlag
;
}
public
void
setIntemFlag
(
String
intemFlag
)
{
this
.
intemFlag
=
intemFlag
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/RiskJudgmentSelectStatusEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
RiskJudgmentSelectStatusEnum
{
可控
(
"可控"
,
"1"
),
不可控
(
"不可控"
,
"2"
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
String
code
;
RiskJudgmentSelectStatusEnum
(
String
name
,
String
code
)
{
this
.
name
=
name
;
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/RiskJudgmentStatusEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
RiskJudgmentStatusEnum
{
未开始
(
"未开始"
,
0
),
进行中
(
"进行中"
,
1
),
已超时
(
"已超时"
,
2
),
已提交
(
"已提交"
,
3
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
Integer
code
;
RiskJudgmentStatusEnum
(
String
name
,
Integer
code
)
{
this
.
name
=
name
;
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/RiskJudgmentTaskStatusEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
RiskJudgmentTaskStatusEnum
{
未开始
(
"未开始"
,
0
),
进行中
(
"进行中"
,
1
),
已超时
(
"已超时"
,
2
),
已提交
(
"已提交"
,
3
),
已审核
(
"已审核"
,
4
),
已合并
(
"已汇总"
,
5
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
Integer
code
;
RiskJudgmentTaskStatusEnum
(
String
name
,
Integer
code
)
{
this
.
name
=
name
;
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
static
RiskJudgmentTaskStatusEnum
getByCode
(
Integer
code
)
{
for
(
RiskJudgmentTaskStatusEnum
l
:
RiskJudgmentTaskStatusEnum
.
values
())
{
if
(
code
.
equals
(
l
.
getCode
()))
{
return
l
;
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/WorkFlowDefinitionKeyEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
WorkFlowDefinitionKeyEnum
{
设备设施风险评级
(
"设备设施风险评级"
,
"1"
,
"A"
),
隐患治理流程
(
"隐患治理流程"
,
"2"
,
"B"
),
作业活动风险评级
(
"作业活动风险评级"
,
"3"
,
"C"
),
风险研判评审
(
"风险研判评审"
,
"4"
,
"G"
);
private
String
desc
;
private
String
key
;
private
String
processDefinitionKey
;
WorkFlowDefinitionKeyEnum
(
String
desc
,
String
key
,
String
processDefinitionKey
)
{
this
.
desc
=
desc
;
this
.
key
=
key
;
this
.
processDefinitionKey
=
processDefinitionKey
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
String
getProcessDefinitionKey
()
{
return
processDefinitionKey
;
}
public
void
setProcessDefinitionKey
(
String
processDefinitionKey
)
{
this
.
processDefinitionKey
=
processDefinitionKey
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
static
WorkFlowDefinitionKeyEnum
getByKey
(
String
key
)
{
for
(
WorkFlowDefinitionKeyEnum
w
:
WorkFlowDefinitionKeyEnum
.
values
())
{
if
(
key
.
equals
(
w
.
key
))
{
return
w
;
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/WorkFlowRiskFactorUriEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
WorkFlowRiskFactorUriEnum
{
唤起流程
(
"唤起流程"
,
"/api/spcRiskFactor/flowCallBack"
,
""
),
检查结果推送
(
"检查结果推送"
,
"/api/protal/data"
,
""
),
隐患治理结果推送
(
"隐患治理结果推送"
,
"/api/protal/hiddentrouble"
,
""
),
等级查询
(
"等级查询"
,
"/api/spcRiskLevel/listselect"
,
""
);
private
String
desc
;
private
String
uri
;
private
String
params
;
WorkFlowRiskFactorUriEnum
(
String
desc
,
String
uri
,
String
params
)
{
this
.
desc
=
desc
;
this
.
uri
=
uri
;
this
.
params
=
params
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
String
getUri
()
{
return
uri
;
}
public
void
setUri
(
String
uri
)
{
this
.
uri
=
uri
;
}
public
String
getParams
()
{
return
params
;
}
public
void
setParams
(
String
params
)
{
this
.
params
=
params
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/WorkFlowUriEnum.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
public
enum
WorkFlowUriEnum
{
启动流程
(
"启动流程"
,
"/workflow/task/startTask"
,
""
),
流程详情
(
"流程详情"
,
"/workflow/task/{taskId}"
,
"taskId"
),
合并启动流程
(
"合并启动流程"
,
"/workflow/task/startProcess"
,
""
),
所有已执行任务详情
(
"所有已执行任务详情"
,
"/workflow/activitiHistory/task/detail/{taskId}"
,
"taskId"
),
流程任务
(
"流程任务"
,
"/workflow/task?processInstanceId={processInstanceId}"
,
"processInstanceId"
),
我的代办
(
"我的代办"
,
"/workflow/task/all-list?processDefinitionKey={processDefinitionKey}"
,
"processDefinitionKey"
),
我的代办有
ID
(
"我的代办有ID"
,
"/workflow/task/all-list?processDefinitionKey={processDefinitionKey}&userId={userId}"
,
"processDefinitionKey,userId"
),
已执行任务
(
"已执行任务"
,
"/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}"
,
"processDefinitionKey"
),
已执行任务有
ID
(
"已执行任务有ID"
,
"/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}&userId={userId}"
,
"processDefinitionKey,userId"
),
启动免登录流程
(
"启动免登录流程"
,
"/processes/{appKey}"
,
"appKey"
),
当前节点
(
"当前节点"
,
"/wf/taskstodo?processInstanceId={processInstanceId}"
,
"processInstanceId"
),
执行流程
(
"执行流程"
,
"/workflow/task/pickupAndCompleteTask/{taskId}"
,
"taskId"
),
终止流程
(
"终止流程"
,
"/wf/processes/{processInstanceId}?deleteReason={deleteReason}"
,
"processInstanceId,deleteReason"
),
当前子节点
(
"当前子节点"
,
"/wf/processes/{processInstanceId}/tasks?taskDefinitionKey={taskDefinitionKey}"
,
"processInstanceId,taskDefinitionKey"
),
工作流流水
(
"工作流流水"
,
"/wf/processes/{processInstanceId}/tasks"
,
"processInstanceId"
),
子节点信息
(
"子节点信息"
,
"/workflow/task/list/all/{instanceId}"
,
"instanceId"
);
private
String
desc
;
private
String
uri
;
private
String
params
;
WorkFlowUriEnum
(
String
desc
,
String
uri
,
String
params
)
{
this
.
desc
=
desc
;
this
.
uri
=
uri
;
this
.
params
=
params
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
String
getUri
()
{
return
uri
;
}
public
void
setUri
(
String
uri
)
{
this
.
uri
=
uri
;
}
public
String
getParams
()
{
return
params
;
}
public
void
setParams
(
String
params
)
{
this
.
params
=
params
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/dao/entity/LatentDanger.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
dao
.
entity
;
import
lombok.Data
;
import
org.hibernate.annotations.Where
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.Table
;
import
java.util.Date
;
/**
* @author keyong
* @title: LatentDanger
* <pre>
* @description: 隐患表
* </pre>
* @date 2021/1/26 14:03
*/
@Entity
@Table
(
name
=
"p_latent_danger"
)
@NamedQuery
(
name
=
"LatentDanger.findAll"
,
query
=
"SELECT c FROM LatentDanger c"
)
@Where
(
clause
=
"deleted=0"
)
//表示未删除的数据
@Data
public
class
LatentDanger
extends
BasicEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 业务唯一标识
*/
@Column
(
name
=
"business_key"
)
private
String
businessKey
;
/**
* 公司组织机构
*/
@Column
(
name
=
"org_code"
)
private
String
orgCode
;
/**
* 隐患名称
*/
@Column
(
name
=
"danger_name"
)
private
String
dangerName
;
@Column
(
name
=
"instance_id"
)
private
String
instanceId
;
@Column
(
name
=
"current_flow_record_id"
)
private
Long
currentFlowRecordId
;
/**
* 隐患等级(1:一般隐患;2:重大隐患;0:安全问题)
*/
@Column
(
name
=
"danger_level"
)
private
Integer
dangerLevel
;
/**
* 隐患地点
*/
@Column
(
name
=
"danger_position"
)
private
String
dangerPosition
;
/**
* 隐患类型(1:普通隐患;2:巡检隐患)
*/
@Column
(
name
=
"danger_type"
)
private
Integer
dangerType
;
/**
* 备注
*/
@Column
(
name
=
"remark"
)
private
String
remark
;
/**
* 整改类型(1:常规整改;2:安措计划;3:延期整改)
*/
@Column
(
name
=
"reform_type"
)
private
Integer
reformType
;
/**
* 限制时间
*/
@Column
(
name
=
"reform_limit_date"
)
private
Date
reformLimitDate
;
@Column
(
name
=
"overtime_state"
)
private
Integer
overtimeState
;
@Column
(
name
=
"reform_json"
)
private
String
reformJson
;
/**
* 隐患状态(1:待评审;2:待治理;3:安措计划中;4:逾期未治理;5:待验证;6:治理完毕;7:已撤销)
*/
@Column
(
name
=
"danger_state"
)
private
Integer
dangerState
;
/**
* 发现人
*/
@Column
(
name
=
"discoverer_user_id"
)
private
String
discovererUserId
;
@Column
(
name
=
"discoverer_department_id"
)
private
String
discovererDepartmentId
;
@Column
(
name
=
"photo_urls"
)
private
String
photoUrls
;
/**
* 是否删除(0:否;1:是)
*/
@Column
(
name
=
"deleted"
)
private
Integer
deleted
;
/**
* 记录修改时间
*/
@Column
(
name
=
"update_date"
)
private
Date
updateDate
;
/**
* 延期治理时间
*/
@Column
(
name
=
"delay_limit_date"
)
private
Date
delayLimitDate
;
/**
* 问题描述
*/
@Column
(
name
=
"problem_description"
)
private
String
problemDescription
;
/**
* 原因分析
*/
@Column
(
name
=
"reason_analysis"
)
private
String
reasonAnalysis
;
/**
* 举一反三
*/
@Column
(
name
=
"infer_other_things"
)
private
String
inferOtherThings
;
/**
* 检查记录创建的隐患检查项对应id
*/
@Column
(
name
=
"check_input_id"
)
private
Long
checkInputId
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/dao/entity/LatentDangerFlowRecord.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
dao
.
entity
;
import
lombok.Data
;
import
org.hibernate.annotations.Where
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.Table
;
import
java.util.Date
;
/**
* @author keyong
* @title: LatentDangerFlowRecord
* <pre>
* @description: 隐患工作流记录表
* </pre>
* @date 2021/1/26 14:18
*/
@Entity
@Table
(
name
=
"p_latent_danger_flow_record"
)
@NamedQuery
(
name
=
"LatentDangerFlowRecord.findAll"
,
query
=
"SELECT c FROM LatentDangerFlowRecord c"
)
@Where
(
clause
=
"deleted=0"
)
//表示未删除的数据
@Data
public
class
LatentDangerFlowRecord
extends
BasicEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"danger_id"
)
private
Long
dangerId
;
@Column
(
name
=
"action_flag"
)
private
String
actionFlag
;
@Column
(
name
=
"flow_task_name"
)
private
String
flowTaskName
;
@Column
(
name
=
"flow_task_user_ids"
)
private
String
flowTaskUserIds
;
@Column
(
name
=
"flow_task_id"
)
private
String
flowTaskId
;
@Column
(
name
=
"excute_state"
)
private
Integer
excuteState
;
@Column
(
name
=
"excute_user_id"
)
private
String
excuteUserId
;
@Column
(
name
=
"excute_result"
)
private
String
excuteResult
;
@Column
(
name
=
"remark"
)
private
String
remark
;
@Column
(
name
=
"flow_json"
)
private
String
flowJson
;
/**
* 是否删除(0:否;1:是)
*/
@Column
(
name
=
"deleted"
)
private
Integer
deleted
;
/**
* 记录修改时间
*/
@Column
(
name
=
"update_date"
)
private
Date
updateDate
;
@Column
(
name
=
"excute_department_id"
)
private
String
excuteDepartmentId
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/dao/entity/LatentDangerPatrol.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
dao
.
entity
;
import
lombok.Data
;
import
org.hibernate.annotations.Where
;
import
org.springframework.data.annotation.Transient
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.Table
;
import
java.util.Date
;
/**
* @author keyong
* @title: LatentDangerPatrol
* <pre>
* @description: 隐患巡检关系表
* </pre>
* @date 2021/1/26 14:51
*/
@Entity
@Table
(
name
=
"p_latent_danger_patrol"
)
@NamedQuery
(
name
=
"LatentDangerPatrol.findAll"
,
query
=
"SELECT c FROM LatentDangerPatrol c"
)
@Where
(
clause
=
"deleted=0"
)
//表示未删除的数据
@Data
public
class
LatentDangerPatrol
extends
BasicEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"latent_danger_id"
)
private
Long
latentDangerId
;
@Column
(
name
=
"point_classify_id"
)
private
Long
pointClassifyId
;
@Column
(
name
=
"check_id"
)
private
Long
checkId
;
@Column
(
name
=
"item_id"
)
private
Long
itemId
;
@Column
(
name
=
"point_id"
)
private
Long
pointId
;
@Column
(
name
=
"route_id"
)
private
Long
routeId
;
@Column
(
name
=
"risk_factor_flow_id"
)
private
String
riskFactorFlowId
;
@Column
(
name
=
"route_point_item_id"
)
private
Long
routePointItemId
;
/**
* 是否删除(0:否;1:是)
*/
@Column
(
name
=
"deleted"
)
private
Integer
deleted
;
/**
* 检查类型-交大字段,只是前段显示用
*/
@Transient
private
String
checkType
;
/**
* 记录修改时间
*/
@Column
(
name
=
"update_date"
)
private
Date
updateDate
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/dao/entity/LatentDangerPhoto.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
dao
.
entity
;
import
lombok.Data
;
import
org.hibernate.annotations.Where
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.Table
;
/**
* @author keyong
* @title: LatentDangerPhoto
* <pre>
* @description: 隐患图片
* </pre>
* @date 2021/1/26 14:50
*/
@Entity
@Table
(
name
=
"p_latent_danger_photo"
)
@NamedQuery
(
name
=
"LatentDangerPhoto.findAll"
,
query
=
"SELECT c FROM LatentDangerPhoto c"
)
@Where
(
clause
=
"deleted=0"
)
//表示未删除的数据
@Data
public
class
LatentDangerPhoto
extends
BasicEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"biz_code"
)
private
String
bizCode
;
@Column
(
name
=
"url"
)
private
String
url
;
@Column
(
name
=
"biz_id"
)
private
Long
bizId
;
@Column
(
name
=
"deleted"
)
private
String
deleted
;
@Column
(
name
=
"update_date"
)
private
String
updateDate
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/DispatchSaveFeedbackDto.java
View file @
2f554c53
...
...
@@ -72,6 +72,9 @@ public class DispatchSaveFeedbackDto extends BaseDto {
@ApiModelProperty
(
value
=
"回访时间"
)
private
Date
feedbackTime
;
@ApiModelProperty
(
value
=
"维修备注"
)
private
String
fixRemark
;
public
DispatchSaveFeedbackDto
()
{
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/enums/TzsCommonParam.java
0 → 100644
View file @
2f554c53
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
enums
;
/**
* @author kongfm
* @date 2021/8/16.
*/
public
class
TzsCommonParam
{
public
static
final
String
SAVE_FEEDBACK_TIME
=
"save_feedback_time"
;
public
static
final
String
SAVE_FEEDBACK_USER
=
"save_feedback_user"
;
public
static
final
String
SAVE_FEEDBACK_UID
=
"save_feedback_uid"
;
public
static
final
String
SAVE_FEEDBACK_RESULT
=
"save_feedback_result"
;
public
static
final
String
FIX_RESULT
=
"fix_result"
;
public
static
final
String
ERROR_RESULT
=
"error_result"
;
public
static
final
String
FIX_REMARK
=
"fix_remark"
;
public
static
final
String
FIX_FEEDBACK_TIME
=
"fix_feedback_time"
;
public
static
final
String
FEEDBACK_RESULT
=
"feedback_result"
;
public
static
final
String
FIX_FEEDBACK_TYPE
=
"fix_feedback_type"
;
public
static
final
String
FIX_FEEDBACK_UNAME
=
"fix_feedback_uname"
;
public
static
final
String
FIX_FEEDBACK_UID
=
"fix_feedback_uid"
;
public
static
final
String
CONSULT_FEEDBACK_TIME
=
"consult_feedback_time"
;
public
static
final
String
ACTION_RESULT
=
"action_result"
;
public
static
final
String
CONSULT_FEEDBACK_TYPE
=
"consult_feedback_type"
;
public
static
final
String
CONSULT_FEEDBACK_UNAME
=
"consult_feedback_uname"
;
public
static
final
String
CONSULT_FEEDBACK_UID
=
"consult_feedback_uid"
;
public
static
final
String
MAIN_FEEDBACK_RESULT
=
"main_feedback_result"
;
public
static
final
String
PQ
=
"PQ"
;
public
static
final
String
JYHF
=
"JYHF"
;
public
static
final
String
WXJG
=
"WXJG"
;
public
static
final
String
GZYY
=
"GZYY"
;
public
static
final
String
WXFK
=
"WXFK"
;
public
static
final
String
BXFK
=
"BXFK"
;
public
static
final
String
FKFS
=
"FKFS"
;
public
static
final
String
TSRFK
=
"TSRFK"
;
public
static
final
String
CZJG
=
"CZJG"
;
public
static
final
String
FKJG
=
"FKJG"
;
public
static
final
String
WXFK_TS
=
"WXFK_TS"
;
public
static
final
String
DD
=
"DD"
;
public
static
final
String
JC
=
"JC"
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/WaterResourceController.java
View file @
2f554c53
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.constants.BizConstant
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.EnumsUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.WaterResourceCraneDto
;
...
...
@@ -91,19 +92,11 @@ public class WaterResourceController extends BaseController {
model
.
setRealityImg
(
JSONArray
.
toJSONString
(
model
.
getRealityImgList
()));
model
.
setOrientationImg
(
JSONArray
.
toJSONString
(
model
.
getOrientationImgList
()));
if
(
model
.
getAddress
()!=
null
){
String
[]
data
=
model
.
getAddress
().
split
(
"@address@"
);
model
.
setAddress
(
data
[
0
]);
if
(
data
[
1
]!=
null
&&!
""
.
equals
(
data
[
1
])){
JSONObject
jSONObject
=
JSON
.
parseObject
(
data
[
1
]);
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
model
.
setLongitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"longitude"
)));
}
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
model
.
setLatitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"latitude"
)));
}
}
JSONObject
address
=
WaterResourceServiceImpl
.
getLongLatFromAddress
(
model
.
getAddress
());
model
.
setAddress
(
address
.
getString
(
BizConstant
.
ADDRESS
));
model
.
setLongitude
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LONGITUDE
)));
model
.
setLatitude
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LATITUDE
)));
}
if
(!
StringUtils
.
isEmpty
(
resourceType
))
{
...
...
@@ -174,21 +167,13 @@ public class WaterResourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
WaterResourceDto
>
updateBySequenceNbrWaterResource
(
@RequestBody
WaterResourceDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
if
(
model
.
getAddress
()!=
null
){
String
[]
data
=
model
.
getAddress
().
split
(
"@address@"
);
model
.
setAddress
(
data
[
0
]);
if
(
data
[
1
]!=
null
&&!
""
.
equals
(
data
[
1
])){
JSONObject
jSONObject
=
JSON
.
parseObject
(
data
[
1
]);
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
model
.
setLongitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"longitude"
)));
}
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
model
.
setLatitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"latitude"
)));
}
}
}
if
(
StringUtils
.
isNotEmpty
(
model
.
getAddress
()))
{
JSONObject
address
=
WaterResourceServiceImpl
.
getLongLatFromAddress
(
model
.
getAddress
());
model
.
setAddress
(
address
.
getString
(
BizConstant
.
ADDRESS
));
model
.
setLongitude
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LONGITUDE
)));
model
.
setLatitude
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LATITUDE
)));
}
// 更新基本信息
model
.
setSequenceNbr
(
sequenceNbr
);
model
.
setRealityImg
(
JSONArray
.
toJSONString
(
model
.
getRealityImgList
()));
...
...
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 @
2f554c53
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.SourceFile
;
import
com.yeejoin.amos.boot.module.common.biz.constats.Constants
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -30,11 +32,13 @@ import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureDetails
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog
;
import
com.yeejoin.amos.boot.module.common.api.entity.SourceFile
;
import
com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum
;
import
com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService
;
import
com.yeejoin.amos.boot.module.common.biz.constats.Constants
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
/**
...
...
@@ -524,14 +528,17 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Map
<
String
,
Object
>
map
=
this
.
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
String
buttonValueString
=
map
.
get
(
"name"
).
toString
();
if
(
buttonValueString
.
contains
(
PROCESS_NAME
[
1
]))
{
//提交维修单
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
1
]))
{
//提交维修单
flag
=
1
;
}
else
if
(
buttonValueString
.
contains
(
PROCESS_NAME
[
2
]))
{
//审核
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
2
]))
{
//审核
if
(
buttonValueString
.
startsWith
(
PROCESS_NAME
[
3
]))
{
flag
=
3
;
}
flag
=
2
;
}
else
if
(
buttonValueString
.
contains
(
PROCESS_NAME
[
3
]))
{
//维修
flag
=
3
;
}
else
if
(
buttonValueString
.
contains
(
PROCESS_NAME
[
4
]))
{
//验收
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
3
]))
{
//维修
flag
=
4
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
4
]))
{
//验收
flag
=
5
;
}
}
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
...
...
@@ -540,7 +547,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
for
(
Object
historyDetail
:
array
)
{
JSONObject
historyDetailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
historyDetail
));
if
(
"rejected"
.
equals
(
historyDetailJson
.
getString
(
"activityId"
)))
{
flag
=
5
;
flag
=
6
;
}
}
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/LinkageUnitServiceImpl.java
View file @
2f554c53
...
...
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.constants.BizConstant
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
...
...
@@ -26,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
...
@@ -124,17 +126,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
public
LinkageUnitDto
saveModel
(
LinkageUnitDto
linkageUnitDto
)
{
if
(
linkageUnitDto
.
getAddress
()
!=
null
)
{
String
[]
data
=
linkageUnitDto
.
getAddress
().
split
(
"@address@"
);
linkageUnitDto
.
setAddress
(
data
[
0
]);
if
(
data
[
1
]
!=
null
&&
!
""
.
equals
(
data
[
1
]))
{
JSONObject
jSONObject
=
JSON
.
parseObject
(
data
[
1
]);
if
(
jSONObject
.
getString
(
"longitude"
)
!=
null
&&
!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
linkageUnitDto
.
setLongitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"longitude"
)));
}
if
(
jSONObject
.
getString
(
"longitude"
)
!=
null
&&
!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
linkageUnitDto
.
setLatitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"latitude"
)));
}
}
JSONObject
address
=
WaterResourceServiceImpl
.
getLongLatFromAddress
(
linkageUnitDto
.
getAddress
());
linkageUnitDto
.
setAddress
(
address
.
getString
(
BizConstant
.
ADDRESS
));
linkageUnitDto
.
setLongitude
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LONGITUDE
)));
linkageUnitDto
.
setLatitude
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LATITUDE
)));
}
// 1.保存行数据
String
groupCode
=
this
.
getGroupCode
();
...
...
@@ -178,8 +173,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
.
list
(
new
LambdaQueryWrapper
<
DynamicFormColumn
>().
eq
(
DynamicFormColumn:
:
getGroupCode
,
groupCode
));
Map
<
String
,
Object
>
fieldCodes
=
Bean
.
listToMap
(
columns
,
"fieldCode"
,
"queryStrategy"
,
DynamicFormColumn
.
class
);
LinkageUnitDto
linkageUnitDto
=
linkageUnitMapper
.
selectOne
(
false
,
fieldCodes
,
groupCode
,
sequenceNbr
);
List
<
SourceFile
>
sourceFiles
=
sourceFileServiceImpl
.
findBySourceId
(
linkageUnitDto
.
getSequenceNbr
());
linkageUnitDto
.
setImage
(
sourceFiles
);
if
(!
ValidationUtil
.
isEmpty
(
linkageUnitDto
))
{
List
<
SourceFile
>
sourceFiles
=
sourceFileServiceImpl
.
findBySourceId
(
linkageUnitDto
.
getSequenceNbr
());
linkageUnitDto
.
setImage
(
sourceFiles
);
}
return
linkageUnitDto
;
}
...
...
@@ -204,17 +201,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
public
LinkageUnitDto
updateById
(
LinkageUnitDto
linkageUnitDto
)
{
if
(
linkageUnitDto
.
getAddress
()
!=
null
)
{
String
[]
data
=
linkageUnitDto
.
getAddress
().
split
(
"@address@"
);
linkageUnitDto
.
setAddress
(
data
[
0
]);
if
(
data
[
1
]
!=
null
&&
!
""
.
equals
(
data
[
1
]))
{
JSONObject
jSONObject
=
JSON
.
parseObject
(
data
[
1
]);
if
(
jSONObject
.
getString
(
"longitude"
)
!=
null
&&
!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
linkageUnitDto
.
setLongitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"longitude"
)));
}
if
(
jSONObject
.
getString
(
"longitude"
)
!=
null
&&
!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
linkageUnitDto
.
setLatitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"latitude"
)));
}
}
JSONObject
address
=
WaterResourceServiceImpl
.
getLongLatFromAddress
(
linkageUnitDto
.
getAddress
());
linkageUnitDto
.
setAddress
(
address
.
getString
(
BizConstant
.
ADDRESS
));
linkageUnitDto
.
setLongitude
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LONGITUDE
)));
linkageUnitDto
.
setLatitude
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LATITUDE
)));
}
// 修改基本信息
updateWithModel
(
linkageUnitDto
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/WaterResourceServiceImpl.java
View file @
2f554c53
...
...
@@ -6,7 +6,10 @@ import java.util.Optional;
import
javax.annotation.Resource
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.constants.BizConstant
;
import
com.yeejoin.amos.boot.biz.common.utils.MenuFrom
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.entity.*
;
...
...
@@ -235,4 +238,31 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
public
List
<
WaterResourceTypeDto
>
getWaterResourceTypeList
(
Boolean
isDelete
)
{
return
waterResourceMapper
.
getWaterResourceTypeList
(
isDelete
);
}
public
static
JSONObject
getLongLatFromAddress
(
String
address
)
{
JSONObject
result
=
new
JSONObject
();
result
.
put
(
BizConstant
.
ADDRESS
,
""
);
result
.
put
(
BizConstant
.
LONGITUDE
,
"0"
);
result
.
put
(
BizConstant
.
LATITUDE
,
"0"
);
if
(
StringUtils
.
isNotEmpty
(
address
))
{
String
[]
addressData
=
address
.
split
(
"@address@"
);
if
(
addressData
.
length
>
1
)
{
result
.
put
(
BizConstant
.
ADDRESS
,
addressData
[
0
]);
JSONObject
langLatObj
=
JSON
.
parseObject
(
addressData
[
1
]);
if
(
StringUtils
.
isNotEmpty
(
langLatObj
.
getString
(
BizConstant
.
LONGITUDE
)))
{
result
.
put
(
BizConstant
.
LONGITUDE
,
langLatObj
.
getString
(
BizConstant
.
LONGITUDE
));
}
else
{
result
.
put
(
BizConstant
.
LONGITUDE
,
"0"
);
}
if
(
StringUtils
.
isNotEmpty
(
langLatObj
.
getString
(
BizConstant
.
LATITUDE
)))
{
result
.
put
(
BizConstant
.
LATITUDE
,
langLatObj
.
getString
(
BizConstant
.
LATITUDE
));
}
else
{
result
.
put
(
BizConstant
.
LATITUDE
,
"0"
);
}
}
else
{
result
.
put
(
BizConstant
.
ADDRESS
,
addressData
[
0
]);
}
}
return
result
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
View file @
2f554c53
...
...
@@ -8,12 +8,20 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.constants.BizConstant
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.FormValue
;
import
com.yeejoin.amos.boot.module.common.api.dto.RequestData
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledTodyDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerData
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Template
;
...
...
@@ -32,415 +40,393 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.StringUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* 警情接警记录 服务实现类
*
* @author tb
* @date 2021-06-17
*/
* 警情接警记录 服务实现类
*
* @author tb
* @date 2021-06-17
*/
@Service
public
class
AlertCalledServiceImpl
extends
BaseService
<
AlertCalledDto
,
AlertCalled
,
AlertCalledMapper
>
implements
IAlertCalledService
{
@Autowired
RedisUtils
redisUtils
;
@Autowired
AlertCalledMapper
alertCalledMapper
;
@Autowired
private
AlertFormValueServiceImpl
iAlertFormValueService
;
public
class
AlertCalledServiceImpl
extends
BaseService
<
AlertCalledDto
,
AlertCalled
,
AlertCalledMapper
>
implements
IAlertCalledService
{
@Autowired
private
ESAlertCalledService
eSAlertCalledService
;
RedisUtils
redisUtils
;
@Autowired
AlertCalledMapper
alertCalledMapper
;
@Autowired
RuleAlertCalledService
ruleAlertCalledService
;
@Autowired
private
EmqKeeper
emqKeeper
;
@Value
(
"${mqtt.topic.command.alert.notice}"
)
private
String
topic
;
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
@Autowired
TemplateMapper
templateMapper
;
@Autowired
PowerTransferMapper
powerTransferMapper
;
@Autowired
AlertSubmittedMapper
alertSubmittedMapper
;
/**
*
* 指挥系统 未结束的警情列表
*
* **/
@Override
public
List
<
AlertCalledZhDto
>
alertCalledListByAlertStatus
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
par
)
{
List
<
AlertCalledZhDto
>
list
=
alertCalledMapper
.
alertCalledListByAlertStatus
(
pageNum
,
pageSize
,
par
);
return
list
;
}
@Override
public
int
alertCalledListByAlertStatusCount
(
RequestData
par
)
{
return
alertCalledMapper
.
alertCalledListByAlertStatusCount
(
par
);
}
/**
*
* 根据灾情id 查询灾情详情
*
* **/
@Override
public
Object
selectAlertCalledById
(
Long
id
)
{
if
(
redisUtils
.
hasKey
(
RedisKey
.
ALERTCALLED_ID
+
id
)){
Object
obj
=
redisUtils
.
get
(
RedisKey
.
ALERTCALLED_ID
+
id
);
return
obj
;
}
else
{
// 警情基本信息
AlertCalled
alertCalled
=
this
.
getById
(
id
);
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
// 警情动态表单数据
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
List
<
FormValue
>
formValue
=
new
ArrayList
<
FormValue
>();
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
for
(
AlertFormValue
alertFormValue
:
list
)
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
"text"
,
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getBlock
());
formValue
.
add
(
value
);
}
}
AlertCalledFormDto
alertCalledFormVo
=
new
AlertCalledFormDto
(
alertCalled
,
formValue
);
redisUtils
.
set
(
RedisKey
.
ALERTCALLED_ID
+
id
,
JSON
.
toJSON
(
alertCalledFormVo
),
time
);
return
alertCalledFormVo
;
}
}
/**
*
* <pre>
* 保存警情信息
* </pre>
*
* @param alertCalledObjsDto
* @return
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
AlertCalledObjsDto
createAlertCalled
(
AlertCalledObjsDto
alertCalledObjsDto
)
{
try
{
// 警情基本信息
AlertCalled
alertCalled
=
alertCalledObjsDto
.
getAlertCalled
();
if
(
alertCalled
.
getAddress
()!=
null
){
String
[]
data
=
alertCalled
.
getAddress
().
split
(
"@address@"
);
alertCalled
.
setAddress
(
data
[
0
]);
if
(
data
[
1
]!=
null
&&!
""
.
equals
(
data
[
1
])){
JSONObject
jSONObject
=
JSON
.
parseObject
(
data
[
1
]);
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
alertCalled
.
setCoordinateX
(
Double
.
valueOf
(
jSONObject
.
getString
(
"longitude"
)));
}
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
alertCalled
.
setCoordinateY
(
Double
.
valueOf
(
jSONObject
.
getString
(
"latitude"
)));
}
}
}
alertCalled
.
setCallTime
(
new
Date
());
if
(
AlertStageEnums
.
RG
.
getValue
().
equals
(
alertCalled
.
getAlertSourceCode
())||
AlertStageEnums
.
RG
.
getValue
().
equals
(
alertCalled
.
getAlertSourceCode
())){
alertCalled
.
setType
(
"0"
);
}
else
{
alertCalled
.
setType
(
"1"
);
}
// 判断是否归并警情
if
(
alertCalled
.
getFatherAlert
()
!=
null
)
{
// 警情归并,设置当前警情状态为结束。
alertCalled
.
setAlertStatus
(
true
);
alertCalled
.
setAlertStage
(
AlertStageEnums
.
JQJB
.
getValue
());
alertCalled
.
setAlarmType
(
AlertStageEnums
.
JQGB
.
getValue
());
alertCalled
.
setAlarmTypeCode
(
AlertStageEnums
.
JQGB
.
getCode
());
this
.
save
(
alertCalled
);
// 动态表单
List
<
AlertFormValue
>
alertFormValuelist
=
alertCalledObjsDto
.
getAlertFormValue
();
// 填充警情主键
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
alertFormValue
.
setAlertCalledId
(
alertCalled
.
getSequenceNbr
());
alertFormValue
.
setAlertTypeCode
(
alertCalled
.
getAlertTypeCode
());
});
// 保存动态表单数据
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
}
else
{
// 警情报送
// ****************************************************待确认开发
alertCalled
.
setAlertStatus
(
false
);
alertCalled
.
setIsDelete
(
false
);
alertCalled
.
setAlertStage
(
AlertStageEnums
.
LLDP
.
getValue
());
alertCalled
.
setAlarmType
(
AlertStageEnums
.
JQCB
.
getValue
());
alertCalled
.
setAlarmTypeCode
(
AlertStageEnums
.
JQCB
.
getCode
());
this
.
save
(
alertCalled
);
// 动态表单
List
<
AlertFormValue
>
alertFormValuelist
=
alertCalledObjsDto
.
getAlertFormValue
();
// 填充警情主键
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
alertFormValue
.
setAlertCalledId
(
alertCalled
.
getSequenceNbr
());
alertFormValue
.
setAlertTypeCode
(
alertCalled
.
getAlertTypeCode
());
});
// 保存动态表单数据
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
alertCalledObjsDto
.
setAlertCalled
(
alertCalled
);
alertCalledObjsDto
.
setAlertFormValue
(
alertFormValuelist
);
//调用规则
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledObjsDto
);
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
}
/**
* 同步保存ES
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
return
alertCalledObjsDto
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
}
}
/**
* 根据id 修改警情
* type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
*
*/
@Override
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
boolean
updateAlertCalled
(
Long
id
,
String
code
)
{
// TODO Auto-generated method stub
try
{
switch
(
code
)
{
case
"314"
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"alert_status"
,
1
).
set
(
"alert_stage"
,
AlertStageEnums
.
ZBQJ
.
getValue
()).
set
(
"alarm_type"
,
AlertStageEnums
.
FJQ
.
getValue
()).
set
(
"alarm_type_code"
,
AlertStageEnums
.
FJQ
.
getCode
()));
break
;
case
"315"
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"alert_status"
,
1
).
set
(
"alert_stage"
,
AlertStageEnums
.
CZJS
.
getValue
()));
break
;
default
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"alert_stage"
,
AlertStageEnums
.
CZGZ
.
getValue
()));
break
;
}
AlertCalled
alertCalled
=
this
.
getById
(
id
);
//删除缓存
redisUtils
.
del
(
RedisKey
.
ALERTCALLED_ID
+
id
);
/**
* 同步更新存ES
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
//通知实战指挥页面发送mqtt 默认发送 String 类型 0新警情, 1警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"1"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
return
true
;
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"系统异常!"
);
}
}
private
static
int
comparingByGroupVal
(
Map
<
String
,
Object
>
map
,
Map
<
String
,
Object
>
map2
,
String
key
)
{
int
result
=
0
;
if
(
map
.
get
(
key
)
instanceof
Date
)
{
long
r1
=
((
Date
)
map
.
get
(
key
)).
getTime
();
long
r2
=
((
Date
)
map2
.
get
(
key
)).
getTime
();
result
=
Long
.
compare
(
r1
,
r2
);
}
return
result
;
}
/**
* 根据时间区间查询警情列表信息
*
* @param beginDate 开始时间
* @param endDate 结束时间
*/
public
List
<
Map
<
String
,
Object
>>
listByDateRange
(
String
beginDate
,
String
endDate
)
{
// 查询指定日期内的警情列表
List
<
AlertCalled
>
alertCalledList
=
@Autowired
TemplateMapper
templateMapper
;
@Autowired
PowerTransferMapper
powerTransferMapper
;
@Autowired
AlertSubmittedMapper
alertSubmittedMapper
;
@Autowired
private
AlertFormValueServiceImpl
iAlertFormValueService
;
@Autowired
private
ESAlertCalledService
eSAlertCalledService
;
@Autowired
private
EmqKeeper
emqKeeper
;
@Value
(
"${mqtt.topic.command.alert.notice}"
)
private
String
topic
;
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
private
static
int
comparingByGroupVal
(
Map
<
String
,
Object
>
map
,
Map
<
String
,
Object
>
map2
,
String
key
)
{
int
result
=
0
;
if
(
map
.
get
(
key
)
instanceof
Date
)
{
long
r1
=
((
Date
)
map
.
get
(
key
)).
getTime
();
long
r2
=
((
Date
)
map2
.
get
(
key
)).
getTime
();
result
=
Long
.
compare
(
r1
,
r2
);
}
return
result
;
}
/**
* 指挥系统 未结束的警情列表
**/
@Override
public
List
<
AlertCalledZhDto
>
alertCalledListByAlertStatus
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
par
)
{
List
<
AlertCalledZhDto
>
list
=
alertCalledMapper
.
alertCalledListByAlertStatus
(
pageNum
,
pageSize
,
par
);
return
list
;
}
@Override
public
int
alertCalledListByAlertStatusCount
(
RequestData
par
)
{
return
alertCalledMapper
.
alertCalledListByAlertStatusCount
(
par
);
}
/**
* 根据灾情id 查询灾情详情
**/
@Override
public
Object
selectAlertCalledById
(
Long
id
)
{
if
(
redisUtils
.
hasKey
(
RedisKey
.
ALERTCALLED_ID
+
id
))
{
Object
obj
=
redisUtils
.
get
(
RedisKey
.
ALERTCALLED_ID
+
id
);
return
obj
;
}
else
{
// 警情基本信息
AlertCalled
alertCalled
=
this
.
getById
(
id
);
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
// 警情动态表单数据
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
List
<
FormValue
>
formValue
=
new
ArrayList
<
FormValue
>();
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
AlertFormValue
alertFormValue
:
list
)
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
"text"
,
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getBlock
());
formValue
.
add
(
value
);
}
}
AlertCalledFormDto
alertCalledFormVo
=
new
AlertCalledFormDto
(
alertCalled
,
formValue
);
redisUtils
.
set
(
RedisKey
.
ALERTCALLED_ID
+
id
,
JSON
.
toJSON
(
alertCalledFormVo
),
time
);
return
alertCalledFormVo
;
}
}
/**
* <pre>
* 保存警情信息
* </pre>
*
* @param alertCalledObjsDto
* @return
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
AlertCalledObjsDto
createAlertCalled
(
AlertCalledObjsDto
alertCalledObjsDto
)
{
try
{
// 警情基本信息
AlertCalled
alertCalled
=
alertCalledObjsDto
.
getAlertCalled
();
if
(
alertCalled
.
getAddress
()
!=
null
)
{
JSONObject
address
=
WaterResourceServiceImpl
.
getLongLatFromAddress
(
alertCalled
.
getAddress
());
alertCalled
.
setAddress
(
address
.
getString
(
BizConstant
.
ADDRESS
));
alertCalled
.
setCoordinateX
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LONGITUDE
)));
alertCalled
.
setCoordinateY
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LATITUDE
)));
}
alertCalled
.
setCallTime
(
new
Date
());
if
(
AlertStageEnums
.
RG
.
getValue
().
equals
(
alertCalled
.
getAlertSourceCode
())
||
AlertStageEnums
.
RG
.
getValue
().
equals
(
alertCalled
.
getAlertSourceCode
()))
{
alertCalled
.
setType
(
"0"
);
}
else
{
alertCalled
.
setType
(
"1"
);
}
// 判断是否归并警情
if
(
alertCalled
.
getFatherAlert
()
!=
null
)
{
// 警情归并,设置当前警情状态为结束。
alertCalled
.
setAlertStatus
(
true
);
alertCalled
.
setAlertStage
(
AlertStageEnums
.
JQJB
.
getValue
());
alertCalled
.
setAlarmType
(
AlertStageEnums
.
JQGB
.
getValue
());
alertCalled
.
setAlarmTypeCode
(
AlertStageEnums
.
JQGB
.
getCode
());
this
.
save
(
alertCalled
);
// 动态表单
List
<
AlertFormValue
>
alertFormValuelist
=
alertCalledObjsDto
.
getAlertFormValue
();
// 填充警情主键
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
alertFormValue
.
setAlertCalledId
(
alertCalled
.
getSequenceNbr
());
alertFormValue
.
setAlertTypeCode
(
alertCalled
.
getAlertTypeCode
());
});
// 保存动态表单数据
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
}
else
{
// 警情报送
// ****************************************************待确认开发
alertCalled
.
setAlertStatus
(
false
);
alertCalled
.
setIsDelete
(
false
);
alertCalled
.
setAlertStage
(
AlertStageEnums
.
LLDP
.
getValue
());
alertCalled
.
setAlarmType
(
AlertStageEnums
.
JQCB
.
getValue
());
alertCalled
.
setAlarmTypeCode
(
AlertStageEnums
.
JQCB
.
getCode
());
this
.
save
(
alertCalled
);
// 动态表单
List
<
AlertFormValue
>
alertFormValuelist
=
alertCalledObjsDto
.
getAlertFormValue
();
// 填充警情主键
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
alertFormValue
.
setAlertCalledId
(
alertCalled
.
getSequenceNbr
());
alertFormValue
.
setAlertTypeCode
(
alertCalled
.
getAlertTypeCode
());
});
// 保存动态表单数据
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
alertCalledObjsDto
.
setAlertCalled
(
alertCalled
);
alertCalledObjsDto
.
setAlertFormValue
(
alertFormValuelist
);
//调用规则
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledObjsDto
);
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
}
/**
* 同步保存ES
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
return
alertCalledObjsDto
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
}
}
/**
* 根据id 修改警情
* type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
*/
@Override
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
boolean
updateAlertCalled
(
Long
id
,
String
code
)
{
// TODO Auto-generated method stub
try
{
switch
(
code
)
{
case
"314"
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"alert_status"
,
1
).
set
(
"alert_stage"
,
AlertStageEnums
.
ZBQJ
.
getValue
()).
set
(
"alarm_type"
,
AlertStageEnums
.
FJQ
.
getValue
()).
set
(
"alarm_type_code"
,
AlertStageEnums
.
FJQ
.
getCode
()));
break
;
case
"315"
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"alert_status"
,
1
).
set
(
"alert_stage"
,
AlertStageEnums
.
CZJS
.
getValue
()));
break
;
default
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"alert_stage"
,
AlertStageEnums
.
CZGZ
.
getValue
()));
break
;
}
AlertCalled
alertCalled
=
this
.
getById
(
id
);
//删除缓存
redisUtils
.
del
(
RedisKey
.
ALERTCALLED_ID
+
id
);
/**
* 同步更新存ES
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
//通知实战指挥页面发送mqtt 默认发送 String 类型 0新警情, 1警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"1"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
return
true
;
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"系统异常!"
);
}
}
/**
* 根据时间区间查询警情列表信息
*
* @param beginDate 开始时间
* @param endDate 结束时间
*/
public
List
<
Map
<
String
,
Object
>>
listByDateRange
(
String
beginDate
,
String
endDate
)
{
// 查询指定日期内的警情列表
List
<
AlertCalled
>
alertCalledList
=
this
.
list
(
new
LambdaQueryWrapper
<
AlertCalled
>().
apply
(!
ValidationUtil
.
isEmpty
(
beginDate
),
"call_time >= '"
+
beginDate
+
"'"
).
le
(
true
,
AlertCalled:
:
getCallTime
,
endDate
));
Map
<
String
,
String
>
queryParams
=
Maps
.
newHashMap
();
queryParams
.
put
(
"beginDate"
,
beginDate
);
queryParams
.
put
(
"endDate"
,
endDate
);
List
<
Map
<
String
,
Object
>>
allList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
alertCalledList
))
{
Map
<
String
,
List
<
AlertCalled
>>
alertCalledMap
=
alertCalledList
.
stream
().
collect
(
Collectors
.
groupingBy
(
AlertCalled:
:
getAlertTypeCode
));
Map
<
Long
,
AlertCalled
>
calledMap
=
alertCalledList
.
stream
().
collect
(
Collectors
.
toMap
(
AlertCalled:
:
getSequenceNbr
,
Function
.
identity
()));
alertCalledMap
.
forEach
((
alertTypeCode
,
list
)
->
{
allList
.
addAll
(
iAlertFormValueService
.
listAll
(
alertTypeCode
,
queryParams
));
});
allList
.
forEach
(
i
->
{
AlertCalled
alertCalled
=
calledMap
.
get
(
Long
.
parseLong
(
i
.
get
(
"instanceId"
).
toString
()));
i
.
putAll
(
Bean
.
BeantoMap
(
alertCalled
));
});
}
// 按接警时间正序排序
allList
.
sort
((
e
,
o
)
->
comparingByGroupVal
(
e
,
o
,
"callTime"
));
return
allList
;
}
public
Map
<
String
,
Object
>
getAlertInfoList
(
String
beginDate
,
String
endDate
)
{
Map
<
String
,
Object
>
result
=
Maps
.
newHashMap
();
List
<
Map
<
String
,
Object
>>
list
=
listByDateRange
(
beginDate
,
endDate
);
// 获取接警情况模板
List
<
Template
>
templateList
=
templateMapper
.
selectList
(
new
LambdaQueryWrapper
<
Template
>().
eq
(
Template:
:
getFormat
,
false
).
like
(
Template:
:
getTypeCode
,
DutyInfoEnum
.
接警情况
.
getKey
()
+
"-"
));
Map
<
String
,
Template
>
templateMap
=
templateList
.
stream
().
collect
(
Collectors
.
toMap
(
Template:
:
getTypeCode
,
Function
.
identity
()));
List
<
String
>
contentList
=
Lists
.
newArrayList
();
list
.
forEach
(
i
->
{
String
tempContent
=
templateMap
.
get
(
DutyInfoEnum
.
接警情况
.
getKey
()
+
"-"
+
i
.
get
(
"alertTypeCode"
)).
getContent
();
contentList
.
add
(
replaceTemplate
(
tempContent
,
i
));
});
Map
<
String
,
Integer
>
statusCountMap
=
alertCalledMapper
.
queryAlertStatusCount
(
beginDate
,
endDate
);
Integer
unFinishedCount
=
this
.
count
(
new
LambdaQueryWrapper
<
AlertCalled
>().
eq
(
AlertCalled:
:
getAlertStatus
,
"0"
));
result
.
put
(
"alertInfoList"
,
contentList
);
result
.
putAll
(
statusCountMap
);
result
.
put
(
"unFinishedCount"
,
unFinishedCount
);
return
result
;
}
/**
* 替换模板
*
* @param tempContent 模板
* @param objMap 对象map
* @return
*/
private
String
replaceTemplate
(
String
tempContent
,
Map
<
String
,
Object
>
objMap
)
{
int
size
=
objMap
.
size
();
String
[]
keys
=
objMap
.
keySet
().
toArray
(
new
String
[
size
]);
Object
[]
values
=
objMap
.
values
().
toArray
(
new
Object
[
size
]);
List
<
String
>
strList
=
Lists
.
newArrayList
();
for
(
Object
obj
:
values
)
{
if
(!
ValidationUtil
.
isEmpty
(
obj
))
{
if
(
obj
instanceof
Date
)
{
obj
=
DateUtils
.
date2LongStr
((
Date
)
obj
);
}
strList
.
add
(
obj
.
toString
());
}
else
{
strList
.
add
(
""
);
}
}
return
StringUtils
.
replaceEach
(
tempContent
,
keys
,
strList
.
toArray
(
new
String
[
strList
.
size
()]));
}
@Override
public
Map
<
String
,
Object
>
selectAlertCalledKeyValueLabelById
(
Long
id
)
{
// 警情基本信息
AlertCalled
alertCalled
=
this
.
getById
(
id
);
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
();
map
.
put
(
"title"
,
"【"
+
alertCalled
.
getAlertType
()+
"】"
+
alertCalled
.
getAddress
());
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
// 警情动态表单数据
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
listdate
.
add
(
new
KeyValueLabel
(
"接警时间"
,
"callTime"
,
alertCalled
.
getCallTime
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情地点"
,
"address"
,
alertCalled
.
getAddress
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情类型"
,
"alertType"
,
alertCalled
.
getAlertType
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情阶段"
,
"alertStage"
,
alertCalled
.
getAlertStage
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情等级"
,
"responseLevel"
,
"无"
));
listdate
.
add
(
new
KeyValueLabel
(
"被困人数"
,
"trappedNum"
,
alertCalled
.
getTrappedNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"伤亡人数"
,
"casualtiesNum"
,
alertCalled
.
getCasualtiesNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"联系人"
,
"contactUser"
,
alertCalled
.
getContactUser
()));
listdate
.
add
(
new
KeyValueLabel
(
"联系电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
listdate
.
add
(
new
KeyValueLabel
(
"联系人电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
list
.
stream
().
forEach
(
AlertFormValue
->{
listdate
.
add
(
new
KeyValueLabel
(
AlertFormValue
.
getFieldName
(),
AlertFormValue
.
getFieldCode
(),
AlertFormValue
.
getFieldValue
()));
});
map
.
put
(
"data"
,
listdate
);
return
map
;
}
@Override
public
List
<
KeyValueLabel
>
selectAlertCalledcount
(
Long
id
)
{
// 警情基本信息
AlertCalled
alertCalled
=
this
.
getById
(
id
);
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
listdate
.
add
(
new
KeyValueLabel
(
"被困人数"
,
"trappedNum"
,
alertCalled
.
getTrappedNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"伤亡人数"
,
"casualtiesNum"
,
alertCalled
.
getCasualtiesNum
()));
return
listdate
;
}
@Override
public
List
<
KeyValueLabel
>
powercount
(
Long
id
)
{
Map
<
String
,
Integer
>
map
=
powerTransferMapper
.
getCarNum
(
id
);
"call_time >= '"
+
beginDate
+
"'"
).
le
(
true
,
AlertCalled:
:
getCallTime
,
endDate
));
Map
<
String
,
String
>
queryParams
=
Maps
.
newHashMap
();
queryParams
.
put
(
"beginDate"
,
beginDate
);
queryParams
.
put
(
"endDate"
,
endDate
);
List
<
Map
<
String
,
Object
>>
allList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
alertCalledList
))
{
Map
<
String
,
List
<
AlertCalled
>>
alertCalledMap
=
alertCalledList
.
stream
().
collect
(
Collectors
.
groupingBy
(
AlertCalled:
:
getAlertTypeCode
));
Map
<
Long
,
AlertCalled
>
calledMap
=
alertCalledList
.
stream
().
collect
(
Collectors
.
toMap
(
AlertCalled:
:
getSequenceNbr
,
Function
.
identity
()));
alertCalledMap
.
forEach
((
alertTypeCode
,
list
)
->
{
allList
.
addAll
(
iAlertFormValueService
.
listAll
(
alertTypeCode
,
queryParams
));
});
allList
.
forEach
(
i
->
{
AlertCalled
alertCalled
=
calledMap
.
get
(
Long
.
parseLong
(
i
.
get
(
"instanceId"
).
toString
()));
i
.
putAll
(
Bean
.
BeantoMap
(
alertCalled
));
});
}
// 按接警时间正序排序
allList
.
sort
((
e
,
o
)
->
comparingByGroupVal
(
e
,
o
,
"callTime"
));
return
allList
;
}
public
Map
<
String
,
Object
>
getAlertInfoList
(
String
beginDate
,
String
endDate
)
{
Map
<
String
,
Object
>
result
=
Maps
.
newHashMap
();
List
<
Map
<
String
,
Object
>>
list
=
listByDateRange
(
beginDate
,
endDate
);
// 获取接警情况模板
List
<
Template
>
templateList
=
templateMapper
.
selectList
(
new
LambdaQueryWrapper
<
Template
>().
eq
(
Template:
:
getFormat
,
false
).
like
(
Template:
:
getTypeCode
,
DutyInfoEnum
.
接警情况
.
getKey
()
+
"-"
));
Map
<
String
,
Template
>
templateMap
=
templateList
.
stream
().
collect
(
Collectors
.
toMap
(
Template:
:
getTypeCode
,
Function
.
identity
()));
List
<
String
>
contentList
=
Lists
.
newArrayList
();
list
.
forEach
(
i
->
{
String
tempContent
=
templateMap
.
get
(
DutyInfoEnum
.
接警情况
.
getKey
()
+
"-"
+
i
.
get
(
"alertTypeCode"
)).
getContent
();
contentList
.
add
(
replaceTemplate
(
tempContent
,
i
));
});
Map
<
String
,
Integer
>
statusCountMap
=
alertCalledMapper
.
queryAlertStatusCount
(
beginDate
,
endDate
);
Integer
unFinishedCount
=
this
.
count
(
new
LambdaQueryWrapper
<
AlertCalled
>().
eq
(
AlertCalled:
:
getAlertStatus
,
"0"
));
result
.
put
(
"alertInfoList"
,
contentList
);
result
.
putAll
(
statusCountMap
);
result
.
put
(
"unFinishedCount"
,
unFinishedCount
);
return
result
;
}
/**
* 替换模板
*
* @param tempContent 模板
* @param objMap 对象map
* @return
*/
private
String
replaceTemplate
(
String
tempContent
,
Map
<
String
,
Object
>
objMap
)
{
int
size
=
objMap
.
size
();
String
[]
keys
=
objMap
.
keySet
().
toArray
(
new
String
[
size
]);
Object
[]
values
=
objMap
.
values
().
toArray
(
new
Object
[
size
]);
List
<
String
>
strList
=
Lists
.
newArrayList
();
for
(
Object
obj
:
values
)
{
if
(!
ValidationUtil
.
isEmpty
(
obj
))
{
if
(
obj
instanceof
Date
)
{
obj
=
DateUtils
.
date2LongStr
((
Date
)
obj
);
}
strList
.
add
(
obj
.
toString
());
}
else
{
strList
.
add
(
""
);
}
}
return
StringUtils
.
replaceEach
(
tempContent
,
keys
,
strList
.
toArray
(
new
String
[
strList
.
size
()]));
}
@Override
public
Map
<
String
,
Object
>
selectAlertCalledKeyValueLabelById
(
Long
id
)
{
// 警情基本信息
AlertCalled
alertCalled
=
this
.
getById
(
id
);
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
();
map
.
put
(
"title"
,
"【"
+
alertCalled
.
getAlertType
()
+
"】"
+
alertCalled
.
getAddress
());
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
// 警情动态表单数据
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
listdate
.
add
(
new
KeyValueLabel
(
"接警时间"
,
"callTime"
,
alertCalled
.
getCallTime
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情地点"
,
"address"
,
alertCalled
.
getAddress
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情类型"
,
"alertType"
,
alertCalled
.
getAlertType
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情阶段"
,
"alertStage"
,
alertCalled
.
getAlertStage
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情等级"
,
"responseLevel"
,
"无"
));
listdate
.
add
(
new
KeyValueLabel
(
"被困人数"
,
"trappedNum"
,
alertCalled
.
getTrappedNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"伤亡人数"
,
"casualtiesNum"
,
alertCalled
.
getCasualtiesNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"联系人"
,
"contactUser"
,
alertCalled
.
getContactUser
()));
listdate
.
add
(
new
KeyValueLabel
(
"联系电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
listdate
.
add
(
new
KeyValueLabel
(
"联系人电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
list
.
stream
().
forEach
(
AlertFormValue
->
{
listdate
.
add
(
new
KeyValueLabel
(
AlertFormValue
.
getFieldName
(),
AlertFormValue
.
getFieldCode
(),
AlertFormValue
.
getFieldValue
()));
});
map
.
put
(
"data"
,
listdate
);
return
map
;
}
@Override
public
List
<
KeyValueLabel
>
selectAlertCalledcount
(
Long
id
)
{
// 警情基本信息
AlertCalled
alertCalled
=
this
.
getById
(
id
);
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
listdate
.
add
(
new
KeyValueLabel
(
"被困人数"
,
"trappedNum"
,
alertCalled
.
getTrappedNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"伤亡人数"
,
"casualtiesNum"
,
alertCalled
.
getCasualtiesNum
()));
return
listdate
;
}
@Override
public
List
<
KeyValueLabel
>
powercount
(
Long
id
)
{
Map
<
String
,
Integer
>
map
=
powerTransferMapper
.
getCarNum
(
id
);
// Map<String,Integer> mapc=powerTransferMapper.getCompanyNum(id);
// Map<String,Integer> mapu= alertSubmittedMapper.getUseNum(id);
//统计参与人员
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
listdate
.
add
(
new
KeyValueLabel
(
"调动人力"
,
"useNum"
,
"0"
,
"人"
));
//统计参与车辆
listdate
.
add
(
new
KeyValueLabel
(
"调动人力"
,
"carNum"
,
map
.
get
(
"carNum"
),
"辆"
));
//统计参与队伍
listdate
.
add
(
new
KeyValueLabel
(
"调动单位"
,
"companyNum"
,
map
.
get
(
"companyNum"
),
"个"
));
//统计参与人员
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
listdate
.
add
(
new
KeyValueLabel
(
"调动人力"
,
"useNum"
,
"0"
,
"人"
));
//统计参与车辆
listdate
.
add
(
new
KeyValueLabel
(
"调动人力"
,
"carNum"
,
map
.
get
(
"carNum"
),
"辆"
));
//统计参与队伍
listdate
.
add
(
new
KeyValueLabel
(
"调动单位"
,
"companyNum"
,
map
.
get
(
"companyNum"
),
"个"
));
return
listdate
;
}
}
@Override
public
List
<
PowerData
>
getPowerDataList
(
Long
id
)
{
List
<
PowerData
>
list
=
powerTransferMapper
.
getPowerDataList
(
id
);
return
list
;
}
@Override
public
List
<
PowerData
>
getPowerDataList
(
Long
id
)
{
List
<
PowerData
>
list
=
powerTransferMapper
.
getPowerDataList
(
id
);
return
list
;
}
@Override
public
AlertCalled
getAlertCalledById
(
Long
id
)
{
return
this
.
getById
(
id
);
}
@Override
public
AlertCalled
getAlertCalledById
(
Long
id
)
{
return
this
.
getById
(
id
);
}
@Override
public
Integer
AlertCalledcountTime
(
int
type
)
{
return
alertCalledMapper
.
AlertCalledcountTime
(
type
);
}
@Override
public
Integer
AlertCalledcountTime
(
int
type
)
{
return
alertCalledMapper
.
AlertCalledcountTime
(
type
);
}
@Override
public
List
<
AlertCalledTodyDto
>
getTodayAlertCalled
()
{
return
alertCalledMapper
.
getTodayAlertCalled
();
}
@Override
public
List
<
AlertCalledTodyDto
>
getTodayAlertCalled
()
{
return
alertCalledMapper
.
getTodayAlertCalled
();
}
}
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 @
2f554c53
...
...
@@ -10,11 +10,13 @@ import com.yeejoin.amos.maintenance.business.service.intfc.ICheckService;
import
com.yeejoin.amos.maintenance.business.util.*
;
import
com.yeejoin.amos.maintenance.business.vo.CheckAnalysisVo
;
import
com.yeejoin.amos.maintenance.business.vo.CheckInfoVo
;
import
com.yeejoin.amos.maintenance.common.enums.OrderByEnum
;
import
com.yeejoin.amos.maintenance.core.async.AsyncTask
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonPageable
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonRequest
;
import
com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone
;
import
com.yeejoin.amos.maintenance.core.common.response.GraphInitDataResponse
;
import
com.yeejoin.amos.maintenance.core.framework.PersonIdentify
;
import
com.yeejoin.amos.maintenance.core.util.StringUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -29,6 +31,7 @@ import org.springframework.data.domain.Page;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -194,9 +197,12 @@ public class CheckController extends AbstractBaseController {
@ApiOperation
(
value
=
"保存巡检记录-mobile"
,
notes
=
"保存巡检记录-mobile"
)
@RequestMapping
(
value
=
"/saveRecord"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
saveCheckRecord
(
@ApiParam
(
value
=
"检查信息"
)
@RequestBody
()
CheckRecordParam
requestParam
)
{
@ApiParam
(
value
=
"检查信息"
)
@RequestBody
CheckRecordParam
requestParam
)
{
try
{
CheckDto
checkDto
=
checkService
.
saveCheckRecord
(
requestParam
,
getSelectedOrgInfo
());
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
getOrgCode
(
reginParams
);
requestParam
.
setOrgCode
(
orgCode
);
CheckDto
checkDto
=
checkService
.
saveCheckRecord
(
requestParam
,
reginParams
);
return
CommonResponseUtil
.
success
(
checkDto
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
...
...
@@ -477,4 +483,46 @@ public class CheckController extends AbstractBaseController {
@ApiParam
(
value
=
"源ids,逗号分隔"
,
required
=
true
)
@PathVariable
String
...
relationId
)
{
return
CommonResponseUtil
.
success
(
checkService
.
obtainLastCheckRecord
(
relationId
));
}
@PersonIdentify
(
isNeedIdentity
=
true
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"维保记录分页查询"
,
notes
=
"维保记录分页查询"
)
@GetMapping
(
value
=
"/page"
)
public
CommonResponse
getCheckRecord
(
@ApiParam
(
value
=
"查询范围"
)
@RequestParam
(
value
=
"userId"
,
required
=
false
)
String
userId
,
@ApiParam
(
value
=
"时间范围"
)
@RequestParam
(
value
=
"timeType"
,
required
=
false
)
String
timeType
,
@ApiParam
(
value
=
"维保结果"
)
@RequestParam
(
value
=
"result"
,
required
=
false
)
String
result
,
@ApiParam
(
value
=
"排序规则"
)
@RequestParam
(
value
=
"orderRule"
,
required
=
false
)
String
orderRule
,
@ApiParam
(
value
=
"开始时间"
)
@RequestParam
(
value
=
"beginTime"
,
required
=
false
)
String
beginTime
,
@ApiParam
(
value
=
"结束时间"
)
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
String
endTime
,
@ApiParam
(
value
=
"维保人员"
)
@RequestParam
(
value
=
"personId"
,
required
=
false
)
String
person
,
@ApiParam
(
value
=
"业主单位"
)
@RequestParam
(
value
=
"teamId"
,
required
=
false
)
String
teamId
,
@ApiParam
(
value
=
"当前页"
)
@RequestParam
(
value
=
"pageNumber"
)
int
pageNumber
,
@ApiParam
(
value
=
"页大小"
)
@RequestParam
(
value
=
"pageSize"
)
int
pageSize
)
throws
Exception
{
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
Map
<
String
,
Object
>
authMap
=
Bean
.
BeantoMap
(
reginParams
.
getPersonIdentity
());
params
.
putAll
(
authMap
);
params
.
put
(
"userId"
,
userId
);
params
.
put
(
"timeType"
,
timeType
);
params
.
put
(
"result"
,
result
);
params
.
put
(
"orderRule"
,
OrderByEnum
.
getEumByCode
(
orderRule
).
getOderBy
());
params
.
put
(
"beginTime"
,
beginTime
);
params
.
put
(
"endTime"
,
endTime
);
params
.
put
(
"person"
,
person
);
params
.
put
(
"teamId"
,
teamId
);
params
.
put
(
"orgCode"
,
loginOrgCode
);
CommonPageable
pageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
return
CommonResponseUtil
.
success
(
checkService
.
getCheckPage
(
params
,
pageable
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"维保记录详情"
,
notes
=
"维保记录详情"
)
@GetMapping
(
value
=
"/detail/{id}"
)
public
CommonResponse
getCheckDetail
(
@ApiParam
(
value
=
"记录Id"
)
@PathVariable
(
value
=
"id"
)
String
id
)
throws
Exception
{
return
CommonResponseUtil
.
success
(
checkService
.
getCheckDetail
(
id
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/LatentDangerController.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
controller
;
import
java.util.Date
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.maintenance.business.dto.DangerExecuteSubmitDto
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerExcuteParam
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerListParam
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerNormalParam
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerPatrolParam
;
import
com.yeejoin.amos.maintenance.business.param.PageParam
;
import
com.yeejoin.amos.maintenance.business.service.intfc.ILatentDangerService
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponse
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponseUtil
;
import
com.yeejoin.amos.maintenance.business.util.FileHelper
;
import
com.yeejoin.amos.maintenance.business.vo.DangerTimeAxisVo
;
import
com.yeejoin.amos.maintenance.common.enums.DictTypeEnum
;
import
com.yeejoin.amos.maintenance.core.common.response.DangerListResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
@RestController
@RequestMapping
(
value
=
"/api/latent/danger"
)
@Api
(
tags
=
"隐患接口api"
)
public
class
LatentDangerController
extends
AbstractBaseController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
LatentDangerController
.
class
);
@Autowired
private
ILatentDangerService
iLatentDangerService
;
@ApiOperation
(
value
=
"创建无码无计划隐患"
,
notes
=
"创建无码无计划隐患"
)
@PostMapping
(
value
=
"/normal/save"
)
public
CommonResponse
saveNormal
(
@ApiParam
(
value
=
"隐患对象"
,
required
=
true
)
@RequestBody
LatentDangerNormalParam
latentDangerParam
)
{
CommonResponse
commonResponse
=
new
CommonResponse
();
try
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
}
String
dangerLevelStr
=
String
.
valueOf
(
latentDangerParam
.
getDangerLevel
());
if
(
iLatentDangerService
.
getDangerLevelJsonObject
(
dangerLevelStr
,
getToken
(),
getProduct
(),
getAppKey
(),
DictTypeEnum
.
DANGERLEVEL
.
getCode
())
==
null
)
{
return
CommonResponseUtil
.
failure
(
"隐患等级有误"
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
deptId
=
getDepartmentId
(
reginParams
);
String
companyId
=
getCompanyId
(
reginParams
);
String
departmentName
=
getDepartmentName
(
reginParams
);
RoleBo
role
=
reginParams
.
getRole
();
return
iLatentDangerService
.
saveNormal
(
latentDangerParam
,
user
.
getUserId
(),
user
.
getRealName
(),
deptId
,
departmentName
,
companyId
,
loginOrgCode
,
role
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"创建普通隐患异常"
,
e
.
getMessage
());
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
@ApiOperation
(
value
=
"创建巡检隐患"
,
notes
=
"创建巡检隐患"
)
@PostMapping
(
value
=
"/patrol/save"
)
public
CommonResponse
savePatrol
(
@ApiParam
(
value
=
"隐患对象"
,
required
=
true
)
@RequestBody
LatentDangerPatrolParam
latentDangerPatrolParam
)
{
try
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
deptId
=
getDepartmentId
(
reginParams
);
String
companyId
=
getCompanyId
(
reginParams
);
String
departmentName
=
getDepartmentName
(
reginParams
);
RoleBo
role
=
reginParams
.
getRole
();
return
iLatentDangerService
.
savePatrol
(
latentDangerPatrolParam
,
user
.
getUserId
(),
user
.
getRealName
(),
deptId
,
departmentName
,
companyId
,
loginOrgCode
,
role
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"创建巡检隐患异常"
,
e
.
getMessage
());
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
@ApiOperation
(
value
=
"隐患列表"
,
notes
=
"隐患列表"
)
@PostMapping
(
value
=
"/list"
)
public
CommonResponse
list
(
@ApiParam
(
value
=
"隐患对象"
,
required
=
true
)
@RequestBody
LatentDangerListParam
latentDangerListParam
)
{
Date
startDate
=
new
Date
();
try
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
deptId
=
null
;
return
iLatentDangerService
.
list
(
getToken
(),
getProduct
(),
getAppKey
(),
latentDangerListParam
,
user
,
loginOrgCode
,
deptId
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"隐患列表异常"
,
e
.
getMessage
());
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
finally
{
Date
endDate
=
new
Date
();
logger
.
info
(
"-------------------------隐患列表时间"
+(
endDate
.
getTime
()-
startDate
.
getTime
()));
}
}
@ApiOperation
(
value
=
"隐患详情"
,
notes
=
"隐患详情"
)
@GetMapping
(
value
=
"/detail"
)
public
CommonResponse
detail
(
@ApiParam
(
value
=
"任务Id"
,
required
=
true
)
@RequestParam
String
id
,
@ApiParam
(
value
=
"是否完成"
,
required
=
true
)
@RequestParam
boolean
isFinish
)
{
try
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
}
return
iLatentDangerService
.
detail
(
id
,
user
.
getUserId
(),
isFinish
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"隐患详情异常"
,
e
.
getMessage
());
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
@ApiOperation
(
value
=
"隐患执行记录"
,
notes
=
"隐患执行记录"
)
@GetMapping
(
value
=
"/listFlowRecord"
)
public
CommonResponse
listFlowRecord
(
@ApiParam
(
value
=
"隐患编号"
,
required
=
true
)
@RequestParam
Long
id
)
{
try
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
}
return
iLatentDangerService
.
listFlowRecord
(
getToken
(),
getProduct
(),
getAppKey
(),
id
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"隐患执行记录异常"
,
e
.
getMessage
());
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
@ApiOperation
(
value
=
"流程执行"
,
notes
=
"流程执行"
)
@PostMapping
(
value
=
"/excute"
)
public
CommonResponse
excute
(
@ApiParam
(
value
=
"隐患对象"
,
required
=
true
)
@RequestBody
LatentDangerExcuteParam
latentDangerExcuteParam
)
{
try
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
deptId
=
getDepartmentId
(
reginParams
);
String
departmentName
=
getDepartmentName
(
reginParams
);
String
userRealName
=
user
.
getRealName
();
String
userId
=
user
.
getUserId
();
RoleBo
role
=
reginParams
.
getRole
();
DangerExecuteSubmitDto
executeSubmitDto
=
iLatentDangerService
.
execute
(
latentDangerExcuteParam
,
userId
,
userRealName
,
deptId
,
departmentName
,
role
);
// iLatentDangerService.freshRiskJudgmentLangerCount(latentDangerExcuteParam);//更新统计
if
(
executeSubmitDto
.
getIsOk
())
{
if
(!
StringUtils
.
isEmpty
(
executeSubmitDto
.
getPointOriginalId
()))
{
iLatentDangerService
.
sendLatentDangerExcuteResult
(
executeSubmitDto
);
}
return
CommonResponseUtil
.
success
();
}
else
{
return
CommonResponseUtil
.
failure
(
executeSubmitDto
.
getMsg
());
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"流程执行异常"
,
e
.
getMessage
());
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
@ApiOperation
(
value
=
"根据流程实例编号获取隐患信息"
,
notes
=
"根据流程实例编号获取隐患信息"
)
@GetMapping
(
value
=
"/getByInstanceId"
)
public
CommonResponse
getByInstanceId
(
@ApiParam
(
value
=
"流程实例编号"
,
required
=
true
)
@RequestParam
String
instanceId
)
{
try
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
}
return
iLatentDangerService
.
getByInstanceId
(
instanceId
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"根据流程实例编号获取隐患信息异常"
,
e
.
getMessage
());
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
@ApiOperation
(
value
=
"隐患按错计划流程执行回调"
,
notes
=
"隐患按错计划流程执行回调"
)
@PostMapping
(
value
=
"/plan/flow/excuteCallBack"
)
public
CommonResponse
excuteCallBack
(
@ApiParam
(
value
=
"隐患按错计划流程执行回调对象"
)
@RequestBody
JSONObject
json
)
{
try
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
}
String
instanceId
=
json
.
getString
(
"instanceId"
);
Integer
actionType
=
json
.
getInteger
(
"actionType"
);
String
remark
=
json
.
getString
(
"remark"
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
deptId
=
getDepartmentId
(
reginParams
);
String
departmentName
=
getDepartmentName
(
reginParams
);
DangerExecuteSubmitDto
executeSubmitDto
=
iLatentDangerService
.
excuteCallBack
(
instanceId
,
actionType
,
remark
,
getToken
(),
user
.
getUserId
(),
user
.
getRealName
(),
deptId
,
departmentName
);
if
(
executeSubmitDto
.
getIsOk
())
{
if
(!
StringUtils
.
isEmpty
(
executeSubmitDto
.
getPointOriginalId
()))
{
iLatentDangerService
.
sendLatentDangerExcuteResult
(
executeSubmitDto
);
}
return
CommonResponseUtil
.
success
();
}
else
{
return
CommonResponseUtil
.
failure
(
executeSubmitDto
.
getMsg
());
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"隐患按错计划流程执行回调异常"
,
e
.
getMessage
());
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
@ApiOperation
(
value
=
"获取隐患等级"
,
notes
=
"获取隐患等级"
)
@GetMapping
(
value
=
"/dangerLevel"
)
public
CommonResponse
getDangerLevel
()
{
return
CommonResponseUtil
.
success
(
iLatentDangerService
.
getDangerLevel
(
getToken
(),
getProduct
(),
getAppKey
(),
DictTypeEnum
.
DANGERLEVEL
.
getCode
()));
}
@ApiOperation
(
value
=
"获取隐患评审信息"
,
notes
=
"获取隐患评审信息"
)
@GetMapping
(
value
=
"/review/info"
)
public
CommonResponse
getDangerReviewInfo
(
@ApiParam
(
value
=
"隐患id"
,
required
=
true
)
@RequestParam
Long
dangerId
)
{
return
CommonResponseUtil
.
success
(
iLatentDangerService
.
getReviewInfo
(
dangerId
));
}
/**
* 隐患清单
*/
@ApiOperation
(
value
=
"隐患清单"
,
notes
=
"隐患清单"
)
@PostMapping
(
value
=
"/page/list"
)
public
CommonResponse
listDanger
(
@ApiParam
(
value
=
"查询条件"
,
required
=
true
)
@RequestBody
PageParam
pageParam
)
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
}
Page
<
DangerListResponse
>
result
=
iLatentDangerService
.
listDanger
(
pageParam
);
return
CommonResponseUtil
.
success
(
result
);
}
/**
* 导出隐患清单
*/
@ApiOperation
(
value
=
"导出隐患清单"
,
notes
=
"导出隐患清单"
)
@PostMapping
(
value
=
"/export"
)
public
void
exportDangerList
(
@ApiParam
(
value
=
"查询条件"
)
@RequestBody
PageParam
pageParam
,
HttpServletResponse
response
)
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
throw
new
RuntimeException
(
"用户session过期"
);
}
pageParam
.
setPageSize
(
Integer
.
MAX_VALUE
);
List
<
DangerListResponse
>
list
=
iLatentDangerService
.
export
(
pageParam
);
String
fileName
=
"隐患清单"
+
new
Date
().
getTime
();
FileHelper
.
exportExcel
(
list
,
"隐患清单"
,
"隐患清单"
,
DangerListResponse
.
class
,
fileName
+
".xls"
,
response
);
}
/**
* <pre>
* @Description: 查询隐患日志
* </pre>
*
* @MethodName:
* @Param: [userId, date]
* @Return: CommonResponse
* @Throws
* @Author keyong
* @Date 2021/3/11 11:42
*/
@ApiOperation
(
value
=
"隐患日志"
,
notes
=
"查询隐患节点信息"
)
@GetMapping
(
value
=
"/listDangerTimeAxis"
)
public
CommonResponse
listTimeAxis
(
@ApiParam
(
value
=
"时间"
)
@RequestParam
(
required
=
false
)
Integer
dateTime
)
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
throw
new
RuntimeException
(
"用户session过期"
);
}
try
{
List
<
DangerTimeAxisVo
>
result
=
iLatentDangerService
.
queryExecuteLog
(
dateTime
);
return
CommonResponseUtil
.
success
(
result
);
}
catch
(
Exception
e
)
{
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/dao/mapper/CheckMapper.java
View file @
2f554c53
...
...
@@ -36,7 +36,7 @@ public interface CheckMapper extends BaseMapper {
List
<
PointCheckDetailBo
>
findCheckPointInputItem
(
@Param
(
value
=
"checkId"
)
long
checkId
);
int
checkHasRecord
(
@Param
(
value
=
"planTaskId"
)
Long
planTaskId
,
@Param
(
value
=
"
check
Id"
)
Long
pointId
);
int
checkHasRecord
(
@Param
(
value
=
"planTaskId"
)
Long
planTaskId
,
@Param
(
value
=
"
point
Id"
)
Long
pointId
);
List
<
Map
<
String
,
Object
>>
queryCheckPointImgs
(
@Param
(
value
=
"planTaskId"
)
int
planTaskId
,
@Param
(
value
=
"pointId"
)
int
pointId
);
...
...
@@ -277,4 +277,10 @@ public interface CheckMapper extends BaseMapper {
//Map<String, String> queryUserInfoByIds(@Param(value = "userIds") String userIds);
long
getCheckCount
(
HashMap
<
String
,
Object
>
params
);
List
<
HashMap
<
String
,
Object
>>
getChecks
(
HashMap
<
String
,
Object
>
params
);
Map
<
String
,
Object
>
getCheckDetail
(
@Param
(
value
=
"id"
)
String
id
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dao/mapper/LatentDangerFlowRecordMapper.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
dao
.
mapper
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo
;
import
com.yeejoin.amos.maintenance.business.vo.DangerTimeAxisVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
public
interface
LatentDangerFlowRecordMapper
extends
BaseMapper
{
Integer
save
(
LatentDangerFlowRecordBo
latentDangerFlowRecordBo
);
LatentDangerFlowRecordBo
getByDangerIdAndActionFlag
(
@Param
(
"dangerId"
)
Long
dangerId
,
@Param
(
"actionFlag"
)
String
actionFlag
);
LatentDangerFlowRecordBo
getByDangerIdAndCreate
(
@Param
(
"dangerId"
)
Long
dangerId
);
LatentDangerFlowRecordBo
getById
(
Long
id
);
List
<
LatentDangerFlowRecordBo
>
listPassByDangerId
(
Long
dangerId
);
Integer
update
(
LatentDangerFlowRecordBo
latentDangerFlowRecordBo
);
LatentDangerFlowRecordBo
getNewestRecordByDangerId
(
Long
dangerId
);
List
<
LatentDangerFlowRecordBo
>
listNewestRecordByDangerIds
(
List
<
Long
>
dangerIds
);
List
<
LatentDangerFlowRecordBo
>
listByDangerId
(
Long
dangerId
);
void
deleteByLatentDangerIds
(
List
<
Long
>
dangerIds
);
List
<
DangerTimeAxisVo
>
listExecuteLog
(
Map
<
String
,
Object
>
map
);
LatentDangerFlowRecordBo
getByIdOderByDate
(
Long
dangerId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dao/mapper/LatentDangerMapper.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
dao
.
mapper
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerNoticeBo
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerListParam
;
import
com.yeejoin.amos.maintenance.business.param.PageParam
;
import
com.yeejoin.amos.maintenance.core.common.response.DangerListResponse
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
interface
LatentDangerMapper
extends
BaseMapper
{
Integer
save
(
LatentDangerBo
latentDangerBo
);
List
<
LatentDangerBo
>
listByMap
(
Map
<
String
,
Object
>
map
);
Long
countByMap
(
Map
<
String
,
Object
>
map
);
LatentDangerBo
getById
(
Long
id
);
Integer
update
(
LatentDangerBo
latentDangerBo
);
LatentDangerBo
getByInstanceId
(
String
instanceId
);
List
<
LatentDangerBo
>
listOfOvertime
();
Integer
countNotFinishByFlowId
(
String
flowId
);
List
<
LatentDangerBo
>
listNotFinishByPointId
(
HashMap
<
String
,
Object
>
params
);
Long
countByFlowUserIds
(
String
userId
);
Long
countNotFinishByTypeAndDeptId
(
@Param
(
"type"
)
Integer
type
,
@Param
(
"departmentId"
)
String
departmentId
);
String
getNotFinishIdsByTypeAndDeptId
(
@Param
(
"type"
)
Integer
type
,
@Param
(
"departmentId"
)
String
departmentId
);
void
deleteByIds
(
List
<
Long
>
dangerIds
);
/**
* 查询治理期限即将到期的隐患
*
* @return
*/
List
<
LatentDangerNoticeBo
>
listNeedNoticeDanger
();
/**
* 根据隐患id获取评审信息
*
* @param dangerId
* @return
*/
List
<
HashMap
<
String
,
Object
>>
getReViewInfo
(
Long
dangerId
);
List
<
DangerListResponse
>
dangerListByMap
(
PageParam
pageParam
);
Long
countDangerListByMap
(
PageParam
pageParam
);
List
<
LatentDangerBo
>
getByBathBusinessKeys
(
@Param
(
"businessKeys"
)
List
<
String
>
businessKeys
,
@Param
(
"latentDangerListParam"
)
LatentDangerListParam
latentDangerListParam
);
int
countByBathBusinessKeys
(
@Param
(
"businessKeys"
)
List
<
String
>
businessKeys
,
@Param
(
"latentDangerListParam"
)
LatentDangerListParam
latentDangerListParam
);
int
countByStatus
(
@Param
(
"businessKeys"
)
List
<
String
>
businessKeys
);
void
updateCheckInputDangerState
(
@Param
(
"id"
)
Long
id
,
@Param
(
"code"
)
int
code
);
LatentDangerBo
getbyBusinessKey
(
@Param
(
"businessKey"
)
String
businessKey
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dao/mapper/LatentDangerPatrolMapper.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
dao
.
mapper
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo
;
import
java.util.List
;
import
java.util.Map
;
public
interface
LatentDangerPatrolMapper
extends
BaseMapper
{
Integer
save
(
LatentDangerPatrolBo
latentDangerPatrolBo
);
LatentDangerPatrolBo
getByDangerId
(
Long
dangerId
);
List
<
LatentDangerPatrolBo
>
listByMap
(
Map
<
String
,
Object
>
map
);
List
<
LatentDangerPatrolBo
>
listByPointId
(
Long
pointId
);
List
<
LatentDangerPatrolBo
>
queryByPointClassifyIds
(
List
<
String
>
pointClassifyIds
);
void
deleteByLatentDangerIds
(
List
<
Long
>
latentDangerIds
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dao/mapper/RiskJudgmentFillRecordMapper.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
dao
.
mapper
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentFillRecordBo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* 风险研判填写记录表
*/
public
interface
RiskJudgmentFillRecordMapper
{
Integer
save
(
RiskJudgmentFillRecordBo
riskJudgmentFillRecordBo
);
Integer
update
(
RiskJudgmentFillRecordBo
riskJudgmentFillRecordBo
);
Integer
saveBatch
(
List
<
RiskJudgmentFillRecordBo
>
recordList
);
void
saveBatchWithStatus
(
List
<
RiskJudgmentFillRecordBo
>
recordList
);
Integer
updateBatch
(
List
<
RiskJudgmentFillRecordBo
>
recordList
);
List
<
RiskJudgmentFillRecordBo
>
listFillRecordData
(
@Param
(
"taskId"
)
Long
taskId
,
@Param
(
"type"
)
Integer
itemType
,
@Param
(
"level"
)
Integer
itemLevel
,
@Param
(
"itemParentId"
)
Long
itemId
);
Long
countNotFinishRecordByTaskId
(
Long
taskId
);
void
updateInputResultAndselectResult
(
Map
<
String
,
Object
>
map
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dao/mapper/RiskJudgmentItemMapper.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
dao
.
mapper
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentItemBo
;
import
java.util.List
;
/**
* 风险研判项表
*/
public
interface
RiskJudgmentItemMapper
{
Integer
save
(
RiskJudgmentItemBo
riskJudgmentItemBo
);
Integer
update
(
RiskJudgmentItemBo
riskJudgmentItemBo
);
List
<
RiskJudgmentItemBo
>
listAllItemByDepartmentCode
(
String
departmentCode
);
RiskJudgmentItemBo
findByItemId
(
Long
itemId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dao/mapper/RiskJudgmentTaskMapper.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
dao
.
mapper
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentTaskBo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 风险研判任务表
*/
public
interface
RiskJudgmentTaskMapper
{
Integer
save
(
RiskJudgmentTaskBo
riskJudgmentTaskBo
);
Integer
update
(
RiskJudgmentTaskBo
riskJudgmentTaskBo
);
Integer
updateBatch
(
List
<
RiskJudgmentTaskBo
>
list
);
List
<
RiskJudgmentTaskBo
>
listByDateAndStatus
(
@Param
(
"date"
)
String
date
,
@Param
(
"status"
)
Integer
status
);
List
<
RiskJudgmentTaskBo
>
listByMap
(
Map
<
String
,
Object
>
map
);
Long
countByMap
(
Map
<
String
,
Object
>
map
);
RiskJudgmentTaskBo
getById
(
Long
id
);
Long
countByFlowUserIds
(
String
userId
);
RiskJudgmentTaskBo
getByInstanceIdAndTaskDefinitionKey
(
@Param
(
"instanceId"
)
String
instanceId
,
@Param
(
"taskDefinitionKey"
)
String
taskDefinitionKey
);
void
updatetTaskStatusByInstanceId
(
HashMap
<
String
,
Object
>
map
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dto/DangerExecuteSubmitDto.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
dto
;
import
com.yeejoin.amos.maintenance.common.enums.LatentDangerExcuteTypeEnum
;
import
lombok.Data
;
@Data
public
class
DangerExecuteSubmitDto
extends
ExecuteSubmitDto
{
private
String
pointOriginalId
;
private
Long
pointId
;
private
String
dangerName
;
private
Long
dangerId
;
private
LatentDangerExcuteTypeEnum
executeTypeEnum
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/entity/mybatis/LatentDangerFlowRecordBoExtend.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
entity
.
mybatis
;
import
lombok.Data
;
@Data
public
class
LatentDangerFlowRecordBoExtend
{
private
String
executeDepartmentName
=
""
;
private
String
executeUserName
;
private
String
executeTime
;
private
Integer
dangerOvertimeState
;
private
Integer
dangerState
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/entity/mybatis/LatentDangerPatrolBoExtend.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
entity
.
mybatis
;
import
lombok.Data
;
@Data
public
class
LatentDangerPatrolBoExtend
{
private
String
itemName
;
private
String
itemBasis
;
private
String
pointName
;
private
String
pointLevel
;
private
String
pointNo
;
private
String
planName
;
private
String
planType
;
private
String
routeName
;
private
String
itemRemark
;
private
String
checkTime
;
private
String
checkUserId
;
private
String
classifyName
;
private
String
pointDepartMentId
;
private
String
classifyOriginalId
;
private
String
pointOriginalId
;
private
String
itemOriginalId
;
private
Integer
executeRate
;
private
String
checkDepartmentId
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/entity/mybatis/RiskJudgmentFillRecordBo.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
entity
.
mybatis
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.extend.RiskJudgmentFillRecordExtend
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 风险研判填写记录表
*/
@Data
public
class
RiskJudgmentFillRecordBo
extends
RiskJudgmentFillRecordExtend
{
/**
* 主键自增
*/
private
Long
id
;
/**
* 风险研判任务编号
*/
private
Long
taskId
;
/**
* 风险研判项编号
*/
private
Long
itemId
;
/**
* 选择结果
*/
private
String
selectResult
;
/**
* 填写结果
*/
private
String
inputResult
;
/**
* 备注结果
*/
private
String
remarkResult
;
/**
* 拍照结果
*/
private
String
photoResult
;
private
Integer
itemFinish
;
private
String
orgCode
;
/**
* 是否删除(0:否;1:是)
*/
private
Integer
deleted
;
/**
* 记录创建时间
*/
private
Date
createDate
;
/**
* 记录修改时间
*/
private
Date
updateDate
;
/**
* 排序-0开始
*/
private
Integer
orderNum
;
/**
* 危险作业/其他隐患风险id(逗号分隔)(一般风险、低风险不保存)
*/
private
String
extraIds
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/entity/mybatis/RiskJudgmentItemBo.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
entity
.
mybatis
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 风险研判项表
*/
@Data
public
class
RiskJudgmentItemBo
{
/**
* 主键自增
*/
private
Long
id
;
/**
* 唯一标识
*/
private
String
itemFlag
;
/**
* 风险研判项级别
*/
private
Integer
itemLevel
;
/**
* 风险研判项类型(1:风险研判表;2:风险研判采集表)
*/
private
Integer
itemType
;
/**
* 节点名称
*/
private
String
itemName
;
/**
* 父节点编号
*/
private
Long
itemParentId
;
private
Integer
itemCanCopy
;
/**
* 选项名称
*/
private
String
selectName
;
/**
* 选项是否需要(0:否;1:是)
*/
private
Integer
selectIsNeed
;
/**
* 选项是否必选(0:否;1:是)
*/
private
Integer
selectIsRequired
;
/**
* 选项json[{"id":1,"name":"否"}]
*/
private
String
selectJson
;
/**
* 输入项名称
*/
private
String
inputName
;
private
Integer
inputType
;
private
Integer
inputCanEdit
;
/**
* 输入是否需要(0:否;1:是)
*/
private
Integer
inputIsNeed
;
/**
* 输入项是否必填(0:否;1:是)
*/
private
Integer
inputIsRequired
;
/**
* 备注是否需要(0:否;1:是)
*/
private
Integer
remarkIsNeed
;
/**
* 备注是否必填(0:否;1:是)
*/
private
Integer
remarkIsRequired
;
/**
* 拍照是否需要(0:否;1:是)
*/
private
Integer
photoIsNeed
;
/**
* 拍照是否必填(0:否;1:是)
*/
private
Integer
photoIsRequired
;
private
String
orgCode
;
/**
* 是否删除(0:否;1:是)
*/
private
Integer
deleted
;
/**
* 记录创建时间
*/
private
Date
createDate
;
/**
* 记录修改时间
*/
private
Date
updateDate
;
/**
* 排序-0开始
*/
private
Integer
orderNum
;
/**
* 部门code
*/
private
String
deptCode
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/entity/mybatis/RiskJudgmentTaskBo.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
entity
.
mybatis
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 风险研判任务表
*/
@Data
public
class
RiskJudgmentTaskBo
{
/**
* 主键自增
*/
private
Long
id
;
/**
* 风险研判名称
*/
private
String
taskName
;
/**
* 部门编号
*/
private
String
departmentId
;
/**
* 状态(0:未开始;1:进行中;2:已超时;3:已提交)
*/
private
Integer
taskStatus
;
/**
* 风险研判日期(今天8:00-明天8:00)
*/
private
Date
taskDate
;
/**
* 提交时间
*/
private
Date
taskCommitDate
;
private
String
currentFlowTaskId
;
private
String
taskDefinitionKey
;
/**
* 可执行用户(多个逗号隔开)
*/
private
String
flowUserIds
;
/**
* 业务唯一标识
*/
private
String
businessKey
;
/**
* 工作流实例编号
*/
private
String
flowInstanceId
;
private
String
orgCode
;
/**
* 是否删除(0:否;1:是)
*/
private
Integer
deleted
;
/**
* 记录创建时间
*/
private
Date
createDate
;
/**
* 记录修改时间
*/
private
Date
updateDate
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/entity/mybatis/extend/LatentDangerBo.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
entity
.
mybatis
.
extend
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 隐患表
*/
@Data
public
class
LatentDangerBo
{
/**
* 主键自增
*/
private
Long
id
;
/**
* 业务唯一标识
*/
private
String
businessKey
;
/**
* 公司组织机构
*/
private
String
orgCode
;
/**
* 隐患名称
*/
private
String
dangerName
;
private
String
instanceId
;
private
Long
currentFlowRecordId
;
/**
* 隐患等级(1:一般隐患;2:重大隐患;0:安全问题)
*/
private
Integer
dangerLevel
;
/**
* 隐患地点
*/
private
String
dangerPosition
;
/**
* 隐患类型(1:普通隐患;2:巡检隐患)
*/
private
Integer
dangerType
;
/**
* 备注
*/
private
String
remark
;
/**
* 整改类型(1:常规整改;2:安措计划;3:延期整改)
*/
private
Integer
reformType
;
/**
* 限制时间
*/
private
Date
reformLimitDate
;
private
Integer
overtimeState
;
private
String
reformJson
;
/**
* 隐患状态(1:待评审;2:待治理;3:安措计划中;4:逾期未治理;5:待验证;6:治理完毕;7:已撤销)
*/
private
Integer
dangerState
;
/**
* 发现人
*/
private
String
discovererUserId
;
private
String
discovererDepartmentId
;
private
String
photoUrls
;
/**
* 是否删除(0:否;1:是)
*/
private
Integer
deleted
;
/**
* 记录创建时间
*/
private
Date
createDate
;
/**
* 记录修改时间
*/
private
Date
updateDate
;
/**
* 延期治理时间
*/
private
Date
delayLimitDate
;
/**
* 问题描述
*/
private
String
problemDescription
;
/**
* 原因分析
*/
private
String
reasonAnalysis
;
/**
* 举一反三
*/
private
String
inferOtherThings
;
/**
* 检查记录创建的隐患检查项对应id
*/
private
Long
checkInputId
;
/**
* 建筑id
*/
private
Long
structureId
;
/**
* 建筑名称
*/
private
String
structureName
;
private
String
instanceKey
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/entity/mybatis/extend/LatentDangerFlowRecordBo.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
entity
.
mybatis
.
extend
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.LatentDangerFlowRecordBoExtend
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
LatentDangerFlowRecordBo
extends
LatentDangerFlowRecordBoExtend
{
private
Long
id
;
private
Long
dangerId
;
private
String
actionFlag
;
private
String
flowTaskName
;
private
String
flowTaskUserIds
;
private
String
flowTaskId
;
private
Integer
excuteState
;
private
String
excuteUserId
;
private
String
excuteResult
;
private
String
remark
;
private
String
flowJson
;
/**
* 是否删除(0:否;1:是)
*/
private
Integer
deleted
;
/**
* 记录创建时间
*/
private
Date
createDate
;
/**
* 记录修改时间
*/
private
Date
updateDate
;
private
String
excuteDepartmentId
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/entity/mybatis/extend/LatentDangerNoticeBo.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
entity
.
mybatis
.
extend
;
import
java.util.Date
;
public
class
LatentDangerNoticeBo
{
/**
* 隐患id
*/
private
Long
dangerId
;
private
String
orgCode
;
/**
* 隐患状态
*/
private
Integer
dangerState
;
/**
* 隐患名称
*/
private
String
dangerName
;
/**
* 治理期限
*/
private
Date
reformLimitDate
;
/**
* 消息接收人(隐患治理人)
*/
private
String
receiverIds
;
private
String
instanceId
;
public
String
getInstanceId
()
{
return
instanceId
;
}
public
void
setInstanceId
(
String
instanceId
)
{
this
.
instanceId
=
instanceId
;
}
public
Long
getDangerId
()
{
return
dangerId
;
}
public
void
setDangerId
(
Long
dangerId
)
{
this
.
dangerId
=
dangerId
;
}
public
String
getOrgCode
()
{
return
orgCode
;
}
public
void
setOrgCode
(
String
orgCode
)
{
this
.
orgCode
=
orgCode
;
}
public
Integer
getDangerState
()
{
return
dangerState
;
}
public
void
setDangerState
(
Integer
dangerState
)
{
this
.
dangerState
=
dangerState
;
}
public
String
getDangerName
()
{
return
dangerName
;
}
public
void
setDangerName
(
String
dangerName
)
{
this
.
dangerName
=
dangerName
;
}
public
Date
getReformLimitDate
()
{
return
reformLimitDate
;
}
public
void
setReformLimitDate
(
Date
reformLimitDate
)
{
this
.
reformLimitDate
=
reformLimitDate
;
}
public
String
getReceiverIds
()
{
return
receiverIds
;
}
public
void
setReceiverIds
(
String
receiverIds
)
{
this
.
receiverIds
=
receiverIds
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/entity/mybatis/extend/LatentDangerPatrolBo.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
entity
.
mybatis
.
extend
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.LatentDangerPatrolBoExtend
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 隐患巡检关系表
*/
@Data
public
class
LatentDangerPatrolBo
extends
LatentDangerPatrolBoExtend
{
private
Long
id
;
private
Long
latentDangerId
;
private
Long
pointClassifyId
;
private
Long
checkId
;
private
Long
itemId
;
private
Long
pointId
;
private
Long
routeId
;
private
String
riskFactorFlowId
;
private
Long
routePointItemId
;
/**
* 是否删除(0:否;1:是)
*/
private
Integer
deleted
;
/**
* 检查类型-交大字段,只是前段显示用
*/
private
String
checkType
;
/**
* 记录创建时间
*/
private
Date
createDate
;
/**
* 记录修改时间
*/
private
Date
updateDate
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/entity/mybatis/extend/RiskJudgmentFillRecordExtend.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
entity
.
mybatis
.
extend
;
import
lombok.Data
;
@Data
public
class
RiskJudgmentFillRecordExtend
{
/**
* 唯一标识
*/
private
String
itemFlag
;
/**
* 风险研判项级别
*/
private
Integer
itemLevel
;
/**
* 风险研判项类型(1:风险研判表;2:风险研判采集表)
*/
private
Integer
itemType
;
/**
* 节点名称
*/
private
String
itemName
;
/**
* 父节点编号
*/
private
Long
itemParentId
;
private
Integer
itemCanCopy
;
/**
* 选项名称
*/
private
String
selectName
;
/**
* 选项是否需要(0:否;1:是)
*/
private
Integer
selectIsNeed
;
/**
* 选项是否必选(0:否;1:是)
*/
private
Integer
selectIsRequired
;
/**
* 选项json[{"id":1,"name":"否"}]
*/
private
String
selectJson
;
/**
* 输入项名称
*/
private
String
inputName
;
private
Integer
inputType
;
private
Integer
inputCanEdit
;
/**
* 输入是否需要(0:否;1:是)
*/
private
Integer
inputIsNeed
;
/**
* 输入项是否必填(0:否;1:是)
*/
private
Integer
inputIsRequired
;
/**
* 备注是否需要(0:否;1:是)
*/
private
Integer
remarkIsNeed
;
/**
* 备注是否必填(0:否;1:是)
*/
private
Integer
remarkIsRequired
;
/**
* 拍照是否需要(0:否;1:是)
*/
private
Integer
photoIsNeed
;
/**
* 拍照是否必填(0:否;1:是)
*/
private
Integer
photoIsRequired
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/param/CheckInputParam.java
View file @
2f554c53
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
param
;
import
com.yeejoin.amos.maintenance.business.dto.CheckShotDto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
...
...
@@ -9,6 +11,8 @@ import java.util.List;
* @author DELL
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
CheckInputParam
{
private
long
inputItemId
;
private
String
inputValue
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/param/CheckRecordParam.java
View file @
2f554c53
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.param;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
...
...
@@ -10,6 +11,7 @@ import java.util.List;
* @author DELL
*/
@Data
@NoArgsConstructor
@ApiModel
(
value
=
"任务提交"
)
public
class
CheckRecordParam
{
...
...
@@ -19,22 +21,12 @@ public class CheckRecordParam {
@ApiModelProperty
(
value
=
"点id"
,
required
=
true
)
private
Long
pointId
;
@ApiModelProperty
(
value
=
"点名称"
)
private
String
pointName
;
@ApiModelProperty
(
value
=
"检查记录id"
)
private
Long
checkId
;
@ApiModelProperty
(
value
=
"执行人id"
)
private
String
userId
;
@ApiModelProperty
(
value
=
"任务id"
)
private
String
orgCode
;
@ApiModelProperty
(
value
=
"组织机构"
,
required
=
false
)
private
String
orgCode
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"路线id"
)
private
Long
routeId
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/param/LatentDangerExcuteParam.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
param
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.Data
;
@Data
public
class
LatentDangerExcuteParam
{
private
Long
flowRecordId
;
private
String
taskId
;
private
Integer
excuteType
;
private
String
remark
;
private
String
nextCanActionUser
;
private
String
reformLimitDate
;
private
JSONObject
flowJson
;
private
String
delayLimitDate
;
/**
* 隐患id
*/
private
Long
dangerId
;
/**
* 延期治理是否需要公司审核
*/
private
Integer
needCompanyVerify
;
/**
* 原因分析
*/
private
String
reasonAnalysis
;
/**
* 举一反三
*/
private
String
inferOtherThings
;
/**
*问题描述
*/
private
String
problemDescription
;
private
Integer
dangerLevel
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/param/LatentDangerListParam.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
param
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonPageable
;
import
lombok.Data
;
/**
* @author keyong
* @title: LatentDangerListParam
* <pre>
* @description: TODO
* </pre>
* @date 2021/1/26 14:49
*/
@Data
public
class
LatentDangerListParam
extends
CommonPageable
{
/**
* 0:全部;1:我的
*/
private
Integer
belongType
;
/**
* 0:全部;1:待评审;2:待治理;3:安措计划中;4:待验证;5:治理完毕;6:已撤销;7:延期治理中;8:延期治理待车间部门审核;9:延期治理待公司审核
*/
private
Integer
dangerState
;
/**
* 是否已处理(1:是;2:否)
*/
private
Boolean
isHandle
;
/**
* -1:全部;1:一般隐患;2:重大隐患;0:安全问题
*/
private
Integer
dangerLevel
;
private
String
dangerName
;
private
String
userId
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/param/LatentDangerNormalParam.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
param
;
import
lombok.Data
;
/**
* @author keyong
* @title: LatentDangerNormalParam
* <pre>
* @description: 隐患
* </pre>
* @date 2021/1/26 14:46
*/
@Data
public
class
LatentDangerNormalParam
{
/**
* 隐患名称
*/
private
String
dangerName
;
/**
* 隐患等级(1:一般隐患;2:重大隐患;3:安全问题)
*/
private
Integer
dangerLevel
;
/**
* 隐患地点
*/
private
String
dangerPosition
;
/**
* 备注
*/
private
String
remark
;
/**
* 拍照路径集合(多个逗号分开)
*/
private
String
photoUrls
;
/**
* 建筑id
*/
private
Long
structureId
;
/**
* 建筑名称
*/
private
String
structureName
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/param/LatentDangerPatrolItemParam.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
param
;
import
lombok.Data
;
/**
* @author keyong
* @title: LatentDangerPatrolItemParam
* <pre>
* @description: TODO
* </pre>
* @date 2021/1/26 14:48
*/
@Data
public
class
LatentDangerPatrolItemParam
{
private
Long
itemId
;
/**
* 隐患等级(1:一般隐患;2:重大隐患;0:安全问题)
*/
private
Integer
dangerLevel
;
private
Long
routePointItemId
;
/**
* 问题描述
*/
private
String
remark
;
/**
* p_check_input 主键id
*/
private
Long
checkInputId
;
/**
* 建筑id
*/
private
Long
structureId
;
/**
* 建筑名称
*/
private
String
structureName
;
private
String
instanceKey
;
/*
* 隐患名称
* */
private
String
name
;
private
String
limitDate
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/param/LatentDangerPatrolParam.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
param
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author keyong
* @title: LatentDangerPatrolParam
* <pre>
* @description: TODO
* </pre>
* @date 2021/1/26 14:47
*/
@Data
public
class
LatentDangerPatrolParam
{
private
List
<
LatentDangerPatrolItemParam
>
itemList
;
private
Long
checkId
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/AppServiceImpl.java
View file @
2f554c53
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.LatentDangerMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.RiskJudgmentTaskMapper
;
import
com.yeejoin.amos.maintenance.business.dao.repository.AppVersionDao
;
import
com.yeejoin.amos.maintenance.business.dao.repository.IMsgSubscribeDao
;
import
com.yeejoin.amos.maintenance.business.param.UserMsgInitParam
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IAppService
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IMsgSubscribeService
;
import
com.yeejoin.amos.maintenance.common.remote.RemoteWorkFlowService
;
import
com.yeejoin.amos.maintenance.common.enums.YesOrNoEnum
;
import
org.assertj.core.util.Lists
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.yeejoin.amos.maintenance.business.param.UserMsgInitParam
;
import
com.yeejoin.amos.maintenance.common.enums.MsgSubscribeTypeEnum
;
import
com.yeejoin.amos.maintenance.dao.entity.AppVersion
;
import
com.yeejoin.amos.maintenance.dao.entity.MsgSubscribe
;
import
org.assertj.core.util.Lists
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -27,121 +20,65 @@ import java.util.List;
@Service
(
"iAppService"
)
public
class
AppServiceImpl
implements
IAppService
{
@Autowired
private
IMsgSubscribeDao
msgSubscribeDao
;
@Autowired
private
AppVersionDao
appVersion
Dao
;
private
IMsgSubscribeDao
msgSubscribe
Dao
;
@Autowired
private
RemoteWorkFlowService
remoteWorkFlowService
;
@Autowired
private
IMsgSubscribeService
msgSubscribeService
;
private
AppVersionDao
appVersionDao
;
@Autowired
private
LatentDangerMapper
latentDangerMapper
;
private
IMsgSubscribeService
msgSubscribeService
;
@Autowired
private
PlanTaskMapper
planTaskMapper
;
@Autowired
private
RiskJudgmentTaskMapper
riskJudgmentTaskMapper
;
@Override
public
AppVersion
queryAppLastVersion
()
{
// TODO Auto-generated method stub
return
appVersionDao
.
findLastVersion
();
}
@Override
public
AppVersion
queryAppLastVersion
()
{
// TODO Auto-generated method stub
return
appVersionDao
.
findLastVersion
();
}
/**
* 新增用户时初始化消息订阅(p_msg_subscribe)表
*
* @param userDTO
*/
@Override
public
List
<
MsgSubscribe
>
saveUserMsgInit
(
UserMsgInitParam
userInitParam
)
{
Long
count
=
msgSubscribeDao
.
countByUserId
(
userInitParam
.
getUserId
());
if
(
count
>
0
)
{
// 已存在用户订阅,直接返回
return
msgSubscribeService
.
queryMsgSubscribes
(
userInitParam
.
getUserId
());
}
List
<
MsgSubscribe
>
msgConfigs
=
new
ArrayList
<
MsgSubscribe
>();
for
(
MsgSubscribeTypeEnum
type
:
MsgSubscribeTypeEnum
.
values
())
{
MsgSubscribe
msgSub
=
new
MsgSubscribe
();
msgSub
.
setOrgCode
(
userInitParam
.
getOrgCode
());
msgSub
.
setUserId
(
userInitParam
.
getUserId
());
if
(
type
.
equals
(
MsgSubscribeTypeEnum
.
PLANBEGIN
)
||
type
.
equals
(
MsgSubscribeTypeEnum
.
PLANWARN
)
||
type
.
equals
(
MsgSubscribeTypeEnum
.
PLANEND
))
{
msgSub
.
setAttribute1
(
"False"
);
msgSub
.
setAttribute2
(
10
+
""
);
}
else
if
(
type
.
equals
(
MsgSubscribeTypeEnum
.
CHECKTYPE
)
||
type
.
equals
(
MsgSubscribeTypeEnum
.
CHECKEMAIL
))
{
msgSub
.
setAttribute1
(
"error"
);
}
/**else if (type.equals(MsgSubscribeTypeEnum.ROUTE) && !userInitParam.getInit()) {
// TODO 查询该用户下的路线
String roleTypeName = userInitParam.getRoleTypeName();
String orgCode = userInitParam.getOrgCode();
Specification<Route> spec = new Specification<Route>() {// 构建查询条件
@Override
public Predicate toPredicate(Root<Route> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
List<Predicate> predicate = new ArrayList<>();
if (!ObjectUtils.isEmpty(roleTypeName)) {
if (XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName)
|| XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName)) {
predicate.add(cb.like(root.get("orgCode").as(String.class), orgCode + "%"));
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName)) {
String orgCode_ = orgCode;
if (orgCode.indexOf("-") != -1) {
orgCode_ = orgCode.substring(0, orgCode.indexOf("-"));
}
predicate.add(cb.like(root.get("orgCode").as(String.class), orgCode_ + "%"));
} else {
predicate.add(cb.equal(root.get("orgCode").as(String.class), orgCode));
}
}
Predicate[] pre = new Predicate[predicate.size()];
return query.where(predicate.toArray(pre)).getRestriction();
}
};
List<Route> routeList = iRouteDao.findAll(spec);
List<Long> routeIdList = new ArrayList<>();
for (Route route : routeList) {
routeIdList.add(route.getId());
}
String routeIds = StringUtils.join(routeIdList.toArray(), ",");
msgSub.setAttribute1(routeIds);
}*/
msgSub
.
setMsgType
(
type
.
getName
());
msgSubscribeDao
.
saveAndFlush
(
msgSub
);
msgConfigs
.
add
(
msgSub
);
/**
* 新增用户时初始化消息订阅(p_msg_subscribe)表
*
* @param userDTO
*/
@Override
public
List
<
MsgSubscribe
>
saveUserMsgInit
(
UserMsgInitParam
userInitParam
)
{
Long
count
=
msgSubscribeDao
.
countByUserId
(
userInitParam
.
getUserId
());
if
(
count
>
0
)
{
// 已存在用户订阅,直接返回
return
msgSubscribeService
.
queryMsgSubscribes
(
userInitParam
.
getUserId
());
}
List
<
MsgSubscribe
>
msgConfigs
=
new
ArrayList
<
MsgSubscribe
>();
for
(
MsgSubscribeTypeEnum
type
:
MsgSubscribeTypeEnum
.
values
())
{
MsgSubscribe
msgSub
=
new
MsgSubscribe
();
msgSub
.
setOrgCode
(
userInitParam
.
getOrgCode
());
msgSub
.
setUserId
(
userInitParam
.
getUserId
());
if
(
type
.
equals
(
MsgSubscribeTypeEnum
.
PLANBEGIN
)
||
type
.
equals
(
MsgSubscribeTypeEnum
.
PLANWARN
)
||
type
.
equals
(
MsgSubscribeTypeEnum
.
PLANEND
))
{
msgSub
.
setAttribute1
(
"False"
);
msgSub
.
setAttribute2
(
10
+
""
);
}
else
if
(
type
.
equals
(
MsgSubscribeTypeEnum
.
CHECKTYPE
)
||
type
.
equals
(
MsgSubscribeTypeEnum
.
CHECKEMAIL
))
{
msgSub
.
setAttribute1
(
"error"
);
}
msgSub
.
setMsgType
(
type
.
getName
());
msgSubscribeDao
.
saveAndFlush
(
msgSub
);
msgConfigs
.
add
(
msgSub
);
}
return
msgConfigs
;
}
}
return
msgConfigs
;
}
@Override
public
List
<
String
>
getHaveToDoList
(
String
userId
)
{
int
taskCount
=
planTaskMapper
.
getCurrentPlanTaskCount
(
userId
);
@Override
public
List
<
String
>
getHaveToDoList
(
String
userId
)
{
int
taskCount
=
planTaskMapper
.
getCurrentPlanTaskCount
(
userId
);
List
<
String
>
havetoDoList
=
Lists
.
newArrayList
();
if
(
taskCount
>
0
)
{
havetoDoList
.
add
(
"planPatrol"
);
}
JSONObject
respBody
=
remoteWorkFlowService
.
pageTask
(
userId
,
Integer
.
parseInt
(
YesOrNoEnum
.
YES
.
getCode
()));
JSONArray
taskJsonList
=
respBody
.
getJSONArray
(
"data"
);
List
<
JSONObject
>
taskList
=
JSONObject
.
parseArray
(
taskJsonList
.
toJSONString
(),
JSONObject
.
class
);
List
<
String
>
bussinessKeys
=
new
ArrayList
<>();
for
(
JSONObject
json
:
taskList
)
{
bussinessKeys
.
add
(
json
.
getString
(
"businessKey"
));
}
Integer
dangerCount
=
latentDangerMapper
.
countByStatus
(
bussinessKeys
);
if
(
dangerCount
>
0
){
havetoDoList
.
add
(
"waitHandle"
);
}
return
havetoDoList
;
}
}
}
\ No newline at end of file
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 @
2f554c53
...
...
@@ -35,6 +35,7 @@ import com.yeejoin.amos.maintenance.common.enums.CheckStatusEnum;
import
com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum
;
import
com.yeejoin.amos.maintenance.common.enums.PointLevelEnum
;
import
com.yeejoin.amos.maintenance.common.enums.PointStatusEnum
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonPageable
;
import
com.yeejoin.amos.maintenance.core.common.response.*
;
import
com.yeejoin.amos.maintenance.core.util.DateUtil
;
import
com.yeejoin.amos.maintenance.core.util.StringUtil
;
...
...
@@ -138,11 +139,10 @@ public class CheckServiceImpl implements ICheckService {
check
.
setPlanTaskId
(
recordParam
.
getPlanTaskId
());
check
.
setPlanId
(
planTask
.
getPlanId
());
check
.
setPlanName
(
detail
.
get
(
"planName"
).
toString
());
check
.
setPointName
(
detail
.
get
(
"pointName"
).
toString
());
recordParam
.
setPointName
(
detail
.
get
(
"pointName"
).
toString
());
check
.
setPointId
(
recordParam
.
getPointId
());
check
.
setPointName
(
point
.
getName
());
check
.
setPointId
(
point
.
getId
());
check
.
setRemark
(
recordParam
.
getRemark
());
check
.
setCheckTime
(
DateUtil
.
getLongDate
(
recordParam
.
getCheckTime
()
));
check
.
setCheckTime
(
new
Date
(
));
check
.
setUploadTime
(
new
Date
());
check
.
setOrgCode
(
recordParam
.
getOrgCode
());
check
.
setUserId
(
mtUserSeq
);
...
...
@@ -158,7 +158,7 @@ public class CheckServiceImpl implements ICheckService {
CheckInput
checkInput
=
new
CheckInput
();
checkInput
.
setCreateDate
(
new
Date
());
checkInput
.
setOrgCode
(
recordParam
.
getOrgCode
());
checkInput
.
setInputId
(
Long
.
valueOf
(
item
.
getInputItemId
()
+
""
));
checkInput
.
setInputId
(
inputItem
.
getId
(
));
checkInput
.
setInputName
(
inputItem
.
getName
());
checkInput
.
setOrderNo
(
inputItem
.
getOrderNo
());
checkInput
.
setRemark
(
item
.
getRemark
());
...
...
@@ -176,7 +176,7 @@ public class CheckServiceImpl implements ICheckService {
Map
<
String
,
Object
>
unCheckMap
=
Maps
.
newHashMap
();
unCheckMap
.
put
(
"itemId"
,
item
.
getInputItemId
());
unCheckMap
.
put
(
"routeId"
,
check
.
getRouteId
());
unCheckMap
.
put
(
"pointId"
,
recordParam
.
getPoin
tId
());
unCheckMap
.
put
(
"pointId"
,
point
.
ge
tId
());
unCheckMap
.
put
(
"name"
,
inputItem
.
getName
());
unCheckMap
.
put
(
"inputValue"
,
item
.
getInputValue
());
unqualifiedCheckItemList
.
add
(
unCheckMap
);
...
...
@@ -225,6 +225,7 @@ public class CheckServiceImpl implements ICheckService {
checkItemList
.
forEach
(
c
->
{
c
.
getCheckShotList
().
forEach
(
s
->
{
s
.
setCheckId
(
c
.
getCheckId
());
s
.
setOrgCode
(
recordParam
.
getOrgCode
());
s
.
setCheckInputId
(
c
.
getId
());
});
allShot
.
addAll
(
c
.
getCheckShotList
());
...
...
@@ -1030,6 +1031,38 @@ public class CheckServiceImpl implements ICheckService {
}
@Override
public
Page
<
HashMap
<
String
,
Object
>>
getCheckPage
(
HashMap
<
String
,
Object
>
params
,
CommonPageable
page
)
{
List
<
HashMap
<
String
,
Object
>>
content
=
Lists
.
newArrayList
();
long
total
=
checkMapper
.
getCheckCount
(
params
);
if
(
total
==
0
)
{
return
new
PageImpl
<>(
content
,
page
,
total
);
}
params
.
put
(
"offset"
,
page
.
getOffset
());
params
.
put
(
"pageSize"
,
page
.
getPageSize
());
content
=
checkMapper
.
getChecks
(
params
);
if
(
0
<
content
.
size
())
{
for
(
HashMap
<
String
,
Object
>
map
:
content
)
{
if
(
map
.
containsKey
(
"isOk"
))
{
map
.
put
(
"status"
,
CheckStatusEnum
.
getEnum
(
String
.
valueOf
(
map
.
get
(
"isOk"
))).
getName
());
}
}
}
return
new
PageImpl
<>(
content
,
page
,
total
);
}
@Override
public
Map
<
String
,
Object
>
getCheckDetail
(
String
id
)
{
Map
<
String
,
Object
>
map
=
checkMapper
.
getCheckDetail
(
id
);
if
(
map
.
containsKey
(
"isOk"
))
{
map
.
put
(
"status"
,
CheckStatusEnum
.
getEnum
(
String
.
valueOf
(
map
.
get
(
"isOk"
))).
getName
());
}
if
(
map
.
containsKey
(
"picture"
))
{
map
.
put
(
"picture"
,
fileUrl
+
map
.
get
(
"picture"
));
}
return
map
;
}
@Override
public
List
<
HashMap
<
String
,
Object
>>
getEquipInputByCheckId
(
CheckDetailInputPageParam
param
)
{
// 如果不传巡检ID,则获取最新一条巡检点对应的巡检记录ID
if
(
param
.
getCheckID
()
==
-
1
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/LatentDangerServiceImpl.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
impl
;
import
static
org
.
typroject
.
tyboot
.
core
.
foundation
.
context
.
RequestContext
.
getProduct
;
import
java.net.InetAddress
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Sets
;
import
com.yeejoin.amos.boot.biz.common.bo.DepartmentBo
;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.maintenance.business.constants.XJConstant
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.CheckInputMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.LatentDangerFlowRecordMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.LatentDangerMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.LatentDangerPatrolMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.RiskFactorCmMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.RiskFactorMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.RiskSourceMapper
;
import
com.yeejoin.amos.maintenance.business.dao.repository.ICheckDao
;
import
com.yeejoin.amos.maintenance.business.dao.repository.ICheckShotDao
;
import
com.yeejoin.amos.maintenance.business.dao.repository.IInputItemDao
;
import
com.yeejoin.amos.maintenance.business.dao.repository.IPointClassifyDao
;
import
com.yeejoin.amos.maintenance.business.dto.DangerExecuteSubmitDto
;
import
com.yeejoin.amos.maintenance.business.dto.InputCheckDto
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.DangerResultBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.DictBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.RiskFactorBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.RiskSourceBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerNoticeBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo
;
import
com.yeejoin.amos.maintenance.business.feign.Business
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerExcuteParam
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerListParam
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerNormalParam
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerPatrolItemParam
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerPatrolParam
;
import
com.yeejoin.amos.maintenance.business.param.PageParam
;
import
com.yeejoin.amos.maintenance.business.service.intfc.ILatentDangerService
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IRiskJudgmentTaskService
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponse
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponseUtil
;
import
com.yeejoin.amos.maintenance.business.util.DateUtil
;
import
com.yeejoin.amos.maintenance.business.util.RandomUtil
;
import
com.yeejoin.amos.maintenance.business.vo.DangerTimeAxisVo
;
import
com.yeejoin.amos.maintenance.business.vo.LatentDangerDetailRiskVo
;
import
com.yeejoin.amos.maintenance.business.vo.LatentDangerDetailVo
;
import
com.yeejoin.amos.maintenance.business.vo.LatentDangerListVo
;
import
com.yeejoin.amos.maintenance.common.enums.CheckModeEnum
;
import
com.yeejoin.amos.maintenance.common.enums.DangerHandleStateEnum
;
import
com.yeejoin.amos.maintenance.common.enums.DictTypeEnum
;
import
com.yeejoin.amos.maintenance.common.enums.ExecuteStateEnum
;
import
com.yeejoin.amos.maintenance.common.enums.InstanceKeyEnum
;
import
com.yeejoin.amos.maintenance.common.enums.LatentDangerExcuteTypeEnum
;
import
com.yeejoin.amos.maintenance.common.enums.LatentDangerLevelEnum
;
import
com.yeejoin.amos.maintenance.common.enums.LatentDangerOvertimeStateEnum
;
import
com.yeejoin.amos.maintenance.common.enums.LatentDangerReformTypeEnum
;
import
com.yeejoin.amos.maintenance.common.enums.LatentDangerStateEnum
;
import
com.yeejoin.amos.maintenance.common.enums.LatentDangerTypeEnum
;
import
com.yeejoin.amos.maintenance.common.enums.RiskFactorsCmStatusEnum
;
import
com.yeejoin.amos.maintenance.common.remote.RemoteSpcService
;
import
com.yeejoin.amos.maintenance.common.remote.RemoteWebSocketServer
;
import
com.yeejoin.amos.maintenance.common.remote.RemoteWorkFlowService
;
import
com.yeejoin.amos.maintenance.core.async.AsyncTask
;
import
com.yeejoin.amos.maintenance.core.common.request.LatentDangerResultPushSpcRequest
;
import
com.yeejoin.amos.maintenance.core.common.response.DangerListResponse
;
import
com.yeejoin.amos.maintenance.core.util.StringUtil
;
import
com.yeejoin.amos.maintenance.dao.entity.Check
;
import
com.yeejoin.amos.maintenance.dao.entity.CheckShot
;
import
com.yeejoin.amos.maintenance.dao.entity.InputItem
;
import
com.yeejoin.amos.maintenance.dao.entity.PointClassify
;
import
com.yeejoin.amos.maintenance.exception.YeeException
;
import
com.yeejoin.amos.maintenance.feign.RemoteSecurityService
;
import
com.yeejoin.amos.maintenance.mqtt.WebMqttComponent
;
@Service
(
"latentDangerService"
)
public
class
LatentDangerServiceImpl
implements
ILatentDangerService
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
LatentDangerServiceImpl
.
class
);
@Autowired
private
RemoteWorkFlowService
remoteWorkFlowService
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
LatentDangerMapper
latentDangerMapper
;
@Autowired
private
RiskFactorMapper
riskFactorMapper
;
@Autowired
private
RiskFactorCmMapper
riskFactorCmMapper
;
@Autowired
private
RiskSourceMapper
riskSourceMapper
;
@Autowired
private
LatentDangerFlowRecordMapper
latentDangerFlowRecordMapper
;
@Autowired
private
LatentDangerPatrolMapper
latentDangerPatrolMapper
;
@Autowired
private
IPointClassifyDao
iPointClassifyDao
;
@Autowired
private
CheckInputMapper
checkInputMapper
;
@Autowired
private
IInputItemDao
iInputItemDao
;
@Autowired
private
RemoteSpcService
remoteSpcService
;
@Autowired
private
ICheckShotDao
iCheckShotDao
;
@Autowired
private
ICheckDao
iCheckDao
;
@Autowired
private
AsyncTask
asyncTask
;
@Autowired
private
RemoteWebSocketServer
remoteWebSocketServer
;
@Autowired
private
IRiskJudgmentTaskService
iRiskJudgmentTaskService
;
@Autowired
private
Business
business
;
@Autowired
EquipFeign
equipFeign
;
private
static
final
String
permissionType
=
"SUBMENU"
;
private
static
final
String
acctivePermissionType
=
"activitiItem"
;
private
static
final
String
path
=
"AppNormalLatentDangerReview"
;
@Value
(
"${server.port}"
)
private
String
port
;
// @Value("${LatentDanger.flow.photoUrls}")
// private String photoUrlPre;
@Value
(
"${file.url}"
)
private
String
fileUrl
;
@Value
(
"${file.url}"
)
private
String
fileServerAddress
;
@Value
(
"${params.work.flow.processDefinitionKey}"
)
private
String
processDefinitionKey
;
@Value
(
"${params.work.flow.normalProcessDefinitionKey}"
)
private
String
normalProcessDefinitionKey
;
@Value
(
"${amosRefresh.danger.topic}"
)
private
String
dangerTopic
;
@Autowired
private
WebMqttComponent
webMqttComponent
;
@Transactional
@Override
public
CommonResponse
saveNormal
(
LatentDangerNormalParam
latentDangerParam
,
String
userId
,
String
userRealName
,
String
departmentId
,
String
departmentName
,
String
companyId
,
String
orgCode
,
RoleBo
role
)
{
String
businessKey
=
RandomUtil
.
buildOrderNo
();
LatentDangerBo
latentDangerBo
=
saveLatentDanger
(
""
,
""
,
latentDangerParam
.
getRemark
(),
userId
,
departmentId
,
businessKey
,
orgCode
,
latentDangerParam
.
getDangerName
(),
latentDangerParam
.
getDangerLevel
()
,
latentDangerParam
.
getDangerPosition
(),
LatentDangerTypeEnum
.
随手拍
,
latentDangerParam
.
getPhotoUrls
(),
0L
,
latentDangerParam
.
getStructureId
(),
latentDangerParam
.
getStructureName
(),
InstanceKeyEnum
.
NORMAL
.
getCode
());
// 更新p_check_input表state字段
updateCheckInputDangerState
(
latentDangerBo
.
getCheckInputId
(),
DangerHandleStateEnum
.
HANDLE
.
getCode
());
Long
dangerId
=
latentDangerBo
.
getId
();
Date
startDate
=
new
Date
();
JSONObject
jsonObject
=
remoteWorkFlowService
.
startNew
(
dangerId
,
businessKey
,
processDefinitionKey
);
// if(!jsonObject.getString("msg").equals("操作成功")){
// return CommonResponseUtil.failure(jsonObject.getString("msg"));
// }
Date
endDate
=
new
Date
();
logger
.
info
(
"-------------------------提交隐患时间"
+(
endDate
.
getTime
()-
startDate
.
getTime
()));
if
(
jsonObject
==
null
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
CommonResponseUtil
.
failure
(
"启动流程失败"
);
}
JSONObject
instance
=
jsonObject
.
getJSONObject
(
"data"
);
if
(
instance
==
null
){
return
CommonResponseUtil
.
failure
(
"无提交隐患权限"
);
}
//提交隐患
// jsonObject = remoteWorkFlowService.excute(instance.getString("id"), null);
// JSONObject task = jsonObject.getJSONObject("data");
latentDangerBo
.
setInstanceId
(
instance
.
getString
(
"id"
));
JSONObject
flowJson
=
new
JSONObject
();
flowJson
.
put
(
"photoUrls"
,
latentDangerParam
.
getPhotoUrls
());
LatentDangerFlowRecordBo
record
=
saveFlowRecord
(
instance
.
getString
(
"id"
),
"提交隐患"
,
userId
,
departmentId
,
flowJson
,
dangerId
,
role
,
LatentDangerExcuteTypeEnum
.
填写隐患完成
.
getName
(),
latentDangerParam
.
getRemark
());
latentDangerBo
.
setCurrentFlowRecordId
(
record
.
getId
());
latentDangerMapper
.
update
(
latentDangerBo
);
sendMessage
(
latentDangerBo
,
LatentDangerExcuteTypeEnum
.
填写隐患完成
,
null
,
"隐患排查与治理"
,
this
.
getNextExecuteUsers
(
latentDangerBo
.
getInstanceId
()),
userRealName
,
departmentName
);
try
{
webMqttComponent
.
publish
(
dangerTopic
,
""
);
}
catch
(
Exception
e
){
logger
.
error
(
"隐患提交数字换流站页面推送失败-----------"
+
e
.
getMessage
());
}
return
CommonResponseUtil
.
success
();
}
@Transactional
@Override
public
CommonResponse
savePatrol
(
LatentDangerPatrolParam
latentDangerPatrolParam
,
String
userId
,
String
userRealName
,
String
departmentId
,
String
departmentName
,
String
companyId
,
String
orgCode
,
RoleBo
role
)
{
List
<
LatentDangerPatrolItemParam
>
itemList
=
latentDangerPatrolParam
.
getItemList
();
Long
checkId
=
latentDangerPatrolParam
.
getCheckId
();
Check
check
=
iCheckDao
.
getById
(
checkId
);
if
(
CollectionUtils
.
isEmpty
(
itemList
))
{
return
CommonResponseUtil
.
failure
(
"请求参数有误"
);
}
// Set<String> inputUserIdsStr = getUserIdsStrByTypeAndDefKey("B_1");
// Set<String> reviewUserIdsStr = getUserIdsStrByTypeAndDefKey("B_2");
//获取装备全路径
LinkedHashMap
<
String
,
Object
>
positionAll
=
equipFeign
.
getBuildingAbsolutePosition
();
LinkedHashMap
<
String
,
Object
>
position
=
new
LinkedHashMap
<>();
if
(
"200"
.
equals
(
positionAll
.
get
(
"status"
).
toString
())){
position
=
(
LinkedHashMap
<
String
,
Object
>)
positionAll
.
get
(
"result"
);
}
for
(
LatentDangerPatrolItemParam
param
:
itemList
)
{
InputCheckDto
inputCheckDto
=
checkInputMapper
.
getByCheckIdAndItemIdAndRoutePointItemId
(
checkId
,
param
.
getItemId
(),
param
.
getRoutePointItemId
(),
null
);
if
(
CheckModeEnum
.
WEB_OUT
.
getCode
().
equals
(
check
.
getCheckMode
()))
{
// 如果是外来检查,这里itemList里面无法区分InputCheckDto...
// 在LatentDangerPatrolItemParam中增加checkInputId字段来区分
inputCheckDto
=
checkInputMapper
.
getByCheckIdAndItemIdAndRoutePointItemId
(
null
,
null
,
null
,
param
.
getCheckInputId
());
}
if
(
inputCheckDto
==
null
)
{
return
CommonResponseUtil
.
failure
(
"检查项不存在"
);
}
InputItem
inputItem
=
iInputItemDao
.
getOne
(
inputCheckDto
.
getItemId
());
if
(
inputItem
==
null
&&
!
CheckModeEnum
.
WEB_OUT
.
getCode
().
equals
(
check
.
getCheckMode
()))
{
return
CommonResponseUtil
.
failure
(
"检查项不存在"
);
}
String
businessKey
=
RandomUtil
.
buildOrderNo
();
LatentDangerLevelEnum
levelEnum
=
LatentDangerLevelEnum
.
getByCode
(
param
.
getDangerLevel
());
if
(
levelEnum
==
null
)
{
return
CommonResponseUtil
.
failure
(
"请求参数有误"
);
}
String
remark
=
param
.
getRemark
();
String
photoUrls
=
""
;
List
<
CheckShot
>
checkShots
=
iCheckShotDao
.
findAllByCheckIdAndCheckInputId
(
inputCheckDto
.
getCheckId
(),
inputCheckDto
.
getCheckInputId
());
if
(!
CollectionUtils
.
isEmpty
(
checkShots
))
{
List
<
String
>
photos
=
checkShots
.
stream
().
map
(
e
->
{
if
(
e
!=
null
)
{
return
fileServerAddress
+
e
.
getPhotoData
().
replaceAll
(
"\\\\"
,
"/"
);
}
else
{
return
""
;
}
}).
collect
(
Collectors
.
toList
());
photoUrls
=
Joiner
.
on
(
","
).
join
(
photos
);
}
LatentDangerTypeEnum
dangerTypeEnum
=
null
;
String
dangerName
=
""
;
if
(
check
.
getPlanId
()
>
0
)
{
dangerTypeEnum
=
LatentDangerTypeEnum
.
计划检查
;
}
else
if
(
CheckModeEnum
.
WEB_OUT
.
getCode
().
equals
(
check
.
getCheckMode
()))
{
dangerTypeEnum
=
LatentDangerTypeEnum
.
无码检查
;
}
else
{
dangerTypeEnum
=
LatentDangerTypeEnum
.
无计划检查
;
}
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotEmpty
(
param
.
getName
())){
dangerName
=
param
.
getName
();
}
else
{
dangerName
=
inputItem
.
getName
();
}
Long
riskSourceId
=
null
;
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotEmpty
(
inputCheckDto
.
getRiskSourceId
())){
riskSourceId
=
Long
.
parseLong
(
inputCheckDto
.
getRiskSourceId
());
}
LatentDangerBo
latentDangerBo
=
saveLatentDanger
(
""
,
param
.
getRemark
(),
remark
,
userId
,
departmentId
,
businessKey
,
orgCode
,
dangerName
,
levelEnum
.
getCode
(),
null
,
dangerTypeEnum
,
photoUrls
,
inputCheckDto
.
getCheckInputId
(),
riskSourceId
,
position
.
get
(
inputCheckDto
.
getRiskSourceId
())==
null
?
""
:
position
.
get
(
inputCheckDto
.
getRiskSourceId
()).
toString
(),
InstanceKeyEnum
.
PATROL
.
getCode
());
// 更新p_check_input表state字段
updateCheckInputDangerState
(
latentDangerBo
.
getCheckInputId
(),
DangerHandleStateEnum
.
HANDLE
.
getCode
());
Long
dangerId
=
latentDangerBo
.
getId
();
Date
startDate
=
new
Date
();
JSONObject
jsonObject
=
remoteWorkFlowService
.
startNew
(
dangerId
,
businessKey
,
processDefinitionKey
);
Date
endDate
=
new
Date
();
logger
.
info
(
"-------------------------提交隐患时间"
+(
endDate
.
getTime
()-
startDate
.
getTime
()));
if
(
jsonObject
==
null
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
CommonResponseUtil
.
failure
(
"启动流程失败"
);
}
JSONObject
instance
=
jsonObject
.
getJSONObject
(
"data"
);
if
(
instance
==
null
){
return
CommonResponseUtil
.
failure
(
"无提交隐患权限"
);
}
LatentDangerFlowRecordBo
inputRecord
=
saveFlowRecord
(
instance
.
getString
(
"id"
),
"提交隐患"
,
userId
,
departmentId
,
null
,
dangerId
,
role
,
LatentDangerExcuteTypeEnum
.
填写隐患完成
.
getName
(),
latentDangerBo
.
getRemark
());
JSONObject
flowJson
=
new
JSONObject
();
flowJson
.
put
(
"photoUrls"
,
photoUrls
);
updateFlowRecord
(
inputRecord
,
LatentDangerExcuteTypeEnum
.
填写隐患完成
,
userId
,
departmentId
,
remark
,
flowJson
);
if
(
LatentDangerTypeEnum
.
计划检查
.
getCode
().
equals
(
latentDangerBo
.
getDangerType
())
||
LatentDangerTypeEnum
.
无计划检查
.
getCode
().
equals
(
latentDangerBo
.
getDangerType
()))
{
LatentDangerPatrolBo
latentDangerPatrolBo
=
new
LatentDangerPatrolBo
();
latentDangerPatrolBo
.
setCheckId
(
inputCheckDto
.
getCheckId
());
latentDangerPatrolBo
.
setPointClassifyId
(
inputCheckDto
.
getPointClassifyId
());
latentDangerPatrolBo
.
setItemId
(
inputCheckDto
.
getItemId
());
latentDangerPatrolBo
.
setRouteId
(
inputCheckDto
.
getRouteId
());
latentDangerPatrolBo
.
setPointId
(
inputCheckDto
.
getPointId
());
latentDangerPatrolBo
.
setLatentDangerId
(
latentDangerBo
.
getId
());
latentDangerPatrolBo
.
setRoutePointItemId
(
inputCheckDto
.
getRoutePointItemId
());
latentDangerPatrolMapper
.
save
(
latentDangerPatrolBo
);
}
latentDangerBo
.
setCurrentFlowRecordId
(
inputRecord
.
getId
());
latentDangerBo
.
setInstanceId
(
instance
.
getString
(
"id"
));
latentDangerMapper
.
update
(
latentDangerBo
);
//修改管控措施的状态为失效
LatentDangerPatrolBo
patrolBo
=
latentDangerPatrolMapper
.
getByDangerId
(
latentDangerBo
.
getId
());
sendMessage
(
latentDangerBo
,
LatentDangerExcuteTypeEnum
.
填写隐患完成
,
patrolBo
,
"巡检隐患排查与治理"
,
this
.
getNextExecuteUsers
(
latentDangerBo
.
getInstanceId
()),
userRealName
,
departmentName
);
try
{
webMqttComponent
.
publish
(
dangerTopic
,
""
);
}
catch
(
Exception
e
){
logger
.
error
(
"巡检隐患提交数字换流站页面推送失败-----------"
+
e
.
getMessage
());
}
}
return
CommonResponseUtil
.
success
();
}
private
void
updateCheckInputDangerState
(
Long
id
,
int
code
)
{
latentDangerMapper
.
updateCheckInputDangerState
(
id
,
code
);
}
private
String
buildLocalHost
()
{
try
{
String
ip
=
InetAddress
.
getLocalHost
().
getHostAddress
();
return
"http://"
+
ip
+
":"
+
port
+
"/"
;
}
catch
(
Exception
e
)
{
return
""
;
}
}
private
void
updateMeasuresContentStatus
(
Long
riskFactorId
,
Long
measuresContentId
,
String
evaluateId
,
RiskFactorsCmStatusEnum
riskFactorsCmStatusEnum
)
{
Map
<
String
,
Object
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"riskFactorId"
,
riskFactorId
);
map
.
put
(
"measuresContentId"
,
measuresContentId
);
map
.
put
(
"evaluateId"
,
evaluateId
);
map
.
put
(
"status"
,
riskFactorsCmStatusEnum
.
getCode
());
riskFactorCmMapper
.
updateStatusByMap
(
map
);
RiskFactorBo
riskFactorBo
=
new
RiskFactorBo
();
riskFactorBo
.
setId
(
riskFactorId
);
Long
outControlNumber
=
riskFactorCmMapper
.
countOutControl
(
map
);
if
(
outControlNumber
.
equals
(
0L
))
{
riskFactorBo
.
setControlStatus
(
RiskFactorsCmStatusEnum
.
Control
.
getName
());
}
else
{
riskFactorBo
.
setControlStatus
(
RiskFactorsCmStatusEnum
.
outOfControl
.
getName
());
}
riskFactorMapper
.
updateControlStatus
(
riskFactorBo
);
}
public
LatentDangerBo
saveLatentDanger
(
String
instanceId
,
String
problemDescription
,
String
remark
,
String
userId
,
String
departmentId
,
String
businessKey
,
String
orgCode
,
String
dangerName
,
Integer
level
,
String
position
,
LatentDangerTypeEnum
dangerTypeEnum
,
String
photoUrls
,
Long
checkInputId
,
Long
structureId
,
String
structureName
,
String
instanceKey
)
{
LatentDangerBo
latentDangerBo
=
new
LatentDangerBo
();
latentDangerBo
.
setInstanceId
(
instanceId
);
latentDangerBo
.
setProblemDescription
(
problemDescription
);
latentDangerBo
.
setRemark
(
remark
);
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
待评审
.
getCode
());
latentDangerBo
.
setDiscovererUserId
(
userId
);
latentDangerBo
.
setDiscovererDepartmentId
(
departmentId
);
latentDangerBo
.
setBusinessKey
(
businessKey
);
latentDangerBo
.
setOrgCode
(
orgCode
);
latentDangerBo
.
setDangerName
(
dangerName
);
latentDangerBo
.
setDangerLevel
(
level
);
latentDangerBo
.
setDangerPosition
(
position
);
latentDangerBo
.
setDangerType
(
dangerTypeEnum
.
getCode
());
StringBuilder
photoUrlsB
=
new
StringBuilder
();
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
photoUrls
)){
String
[]
photoUrlsList
=
photoUrls
.
split
(
","
);
for
(
String
url
:
photoUrlsList
)
{
if
(!
""
.
equals
(
url
)){
photoUrlsB
.
append
(
fileUrl
+
url
);
photoUrlsB
.
append
(
","
);
}
}
}
latentDangerBo
.
setPhotoUrls
(
photoUrlsB
.
toString
());
latentDangerBo
.
setCheckInputId
(
checkInputId
);
latentDangerBo
.
setStructureId
(
structureId
);
latentDangerBo
.
setStructureName
(
structureName
);
latentDangerBo
.
setInstanceKey
(
instanceKey
);
latentDangerMapper
.
save
(
latentDangerBo
);
return
latentDangerBo
;
}
public
LatentDangerFlowRecordBo
saveFlowRecord
(
String
taskId
,
String
taskName
,
String
userId
,
String
departmentId
,
JSONObject
flowJson
,
Long
dangerId
,
RoleBo
role
,
String
executeResult
,
String
remark
)
{
LatentDangerFlowRecordBo
record
=
new
LatentDangerFlowRecordBo
();
record
.
setFlowTaskId
(
taskId
);
record
.
setExcuteUserId
(
userId
);
record
.
setExcuteDepartmentId
(
departmentId
);
if
(
flowJson
!=
null
&&
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
flowJson
.
getString
(
"photoUrls"
))){
flowJson
.
put
(
"photoUrls"
,
fileUrl
+
flowJson
.
getString
(
"photoUrls"
));
}
record
.
setFlowJson
(
flowJson
!=
null
?
flowJson
.
toJSONString
()
:
null
);
record
.
setFlowTaskName
(
taskName
);
record
.
setDangerId
(
dangerId
);
// record.setExcuteUserId(RequestContext.getLoginId());
record
.
setExcuteResult
(
executeResult
);
record
.
setDeleted
(
0
);
record
.
setActionFlag
(
taskName
);
record
.
setRemark
(
remark
);
latentDangerFlowRecordMapper
.
save
(
record
);
return
record
;
}
public
LatentDangerFlowRecordBo
saveFlowRecord
(
String
taskId
,
String
userIds
,
String
taskName
,
String
taskDefinitionKey
,
Long
dangerId
)
{
LatentDangerFlowRecordBo
record
=
new
LatentDangerFlowRecordBo
();
record
.
setFlowTaskId
(
taskId
);
record
.
setFlowTaskUserIds
(
userIds
);
record
.
setFlowTaskName
(
taskName
);
record
.
setActionFlag
(
taskDefinitionKey
);
record
.
setDangerId
(
dangerId
);
latentDangerFlowRecordMapper
.
save
(
record
);
return
record
;
}
public
void
updateFlowRecord
(
LatentDangerFlowRecordBo
flowRecord
,
LatentDangerExcuteTypeEnum
excuteTypeEnum
,
String
userId
,
String
departmentId
,
String
remark
,
JSONObject
flowJson
)
{
flowRecord
.
setExcuteState
(
excuteTypeEnum
.
getExcuteState
().
getCode
());
flowRecord
.
setExcuteDepartmentId
(
departmentId
);
flowRecord
.
setExcuteUserId
(
userId
);
flowRecord
.
setExcuteResult
(
excuteTypeEnum
.
getName
());
if
(!
StringUtils
.
isEmpty
(
remark
))
{
flowRecord
.
setRemark
(
remark
);
}
if
(
flowJson
!=
null
)
{
flowRecord
.
setFlowJson
(
flowJson
.
toJSONString
());
}
latentDangerFlowRecordMapper
.
update
(
flowRecord
);
}
private
Set
<
String
>
getUserIdsStrByTypeAndDefKey
(
String
definitionKey
)
{
List
<
AgencyUserModel
>
users
=
remoteSecurityService
.
listUserByMenuCode
(
acctivePermissionType
,
definitionKey
);
if
(
CollectionUtils
.
isEmpty
(
users
))
{
return
Sets
.
newHashSet
();
}
else
{
return
Sets
.
newHashSet
(
Lists
.
transform
(
users
,
AgencyUserModel:
:
getUserId
));
}
}
private
Set
<
String
>
getUserIdsStrByPerTypeAndDefKey
(
JSONObject
jsonObject
)
{
String
taskDefinitionKey
=
jsonObject
.
getString
(
"taskDefinitionKey"
);
// List<UserModel> users = remoteSecurityService.listUserByMenuCode(acctivePermissionType, taskDefinitionKey);
// if (CollectionUtils.isEmpty(users)) {
// return Sets.newHashSet();
// } else {
// return Sets.newHashSet(Lists.transform(users, UserModel::getUserId));
// }
return
getUserIdsStrByTypeAndDefKey
(
taskDefinitionKey
);
}
private
Map
<
String
,
Object
>
buildQueryMapForList
(
LatentDangerListParam
latentDangerListParam
,
String
userId
)
{
Map
<
String
,
Object
>
map
=
Maps
.
newHashMap
();
Long
offset
=
latentDangerListParam
.
getOffset
();
map
.
put
(
"offset"
,
offset
);
map
.
put
(
"limit"
,
latentDangerListParam
.
getPageSize
());
if
(
latentDangerListParam
.
getIsHandle
()
!=
null
)
{
List
<
Integer
>
states
=
Lists
.
newArrayList
();
if
(
latentDangerListParam
.
getIsHandle
())
{
states
.
add
(
LatentDangerStateEnum
.
治理完毕
.
getCode
());
states
.
add
(
LatentDangerStateEnum
.
已撤销
.
getCode
());
}
else
{
states
.
add
(
LatentDangerStateEnum
.
待验证
.
getCode
());
states
.
add
(
LatentDangerStateEnum
.
延期治理申请
.
getCode
());
states
.
add
(
LatentDangerStateEnum
.
安措计划中
.
getCode
());
states
.
add
(
LatentDangerStateEnum
.
待治理
.
getCode
());
states
.
add
(
LatentDangerStateEnum
.
待评审
.
getCode
());
states
.
add
(
LatentDangerStateEnum
.
延期治理申请待车间部门审核
.
getCode
());
states
.
add
(
LatentDangerStateEnum
.
延期治理申请待公司审核
.
getCode
());
}
map
.
put
(
"states"
,
states
);
}
if
(!
latentDangerListParam
.
getBelongType
().
equals
(
0
))
{
map
.
put
(
"userId"
,
userId
);
}
if
(!
latentDangerListParam
.
getDangerLevel
().
equals
(-
1
))
{
map
.
put
(
"dangerLevel"
,
latentDangerListParam
.
getDangerLevel
());
}
if
(!
latentDangerListParam
.
getDangerState
().
equals
(
0
))
{
map
.
put
(
"dangerState"
,
latentDangerListParam
.
getDangerState
());
}
if
(!
StringUtils
.
isEmpty
(
latentDangerListParam
.
getDangerName
()))
{
map
.
put
(
"dangerName"
,
latentDangerListParam
.
getDangerName
());
}
return
map
;
}
@Override
public
CommonResponse
list
(
String
toke
,
String
product
,
String
appKey
,
LatentDangerListParam
latentDangerListParam
,
AgencyUserModel
user
,
String
loginOrgCode
,
String
deptId
)
{
JSONObject
respBody
;
Date
startDate
=
new
Date
();
if
(
latentDangerListParam
.
getIsHandle
())
{
respBody
=
remoteWorkFlowService
.
completedPageTask
(
user
.
getUserName
(),
latentDangerListParam
.
getBelongType
());
}
else
{
respBody
=
remoteWorkFlowService
.
pageTask
(
user
.
getUserId
(),
latentDangerListParam
.
getBelongType
());
}
Date
endDate
=
new
Date
();
logger
.
info
(
"-------------------------工作流列表时间"
+(
endDate
.
getTime
()-
startDate
.
getTime
()));
JSONArray
taskJsonList
=
respBody
.
getJSONArray
(
"data"
);
List
<
JSONObject
>
taskList
=
JSONObject
.
parseArray
(
taskJsonList
.
toJSONString
(),
JSONObject
.
class
);
List
<
String
>
bussinessKeys
=
new
ArrayList
<>();
for
(
JSONObject
json
:
taskList
)
{
bussinessKeys
.
add
(
json
.
getString
(
"businessKey"
));
}
if
(
0
==
latentDangerListParam
.
getBelongType
())
{
latentDangerListParam
.
setUserId
(
null
);
}
if
(-
1
==
latentDangerListParam
.
getDangerLevel
())
{
latentDangerListParam
.
setDangerLevel
(
null
);
}
if
(
0
==
latentDangerListParam
.
getDangerState
())
{
latentDangerListParam
.
setDangerState
(
null
);
}
Date
startDate1
=
new
Date
();;
int
dangerListSize
=
latentDangerMapper
.
countByBathBusinessKeys
(
bussinessKeys
,
latentDangerListParam
);
List
<
LatentDangerBo
>
dangerList
=
latentDangerMapper
.
getByBathBusinessKeys
(
bussinessKeys
,
latentDangerListParam
);
Date
endDate1
=
new
Date
();
logger
.
info
(
"-------------------------sql时间"
+(
endDate1
.
getTime
()-
startDate1
.
getTime
()));
// Map<String, Object> map = buildQueryMapForList(latentDangerListParam, userId);
// map.put("org_code", loginOrgCode);
// map.put("discoverer_department_id", deptId);
// String permissions = hasProcessBPermission(userId, acctivePermissionType);
// map.put("permissions", permissions);
// List<LatentDangerBo> list = latentDangerMapper.listByMap(map);
// Long count = 0L;
List
<
LatentDangerListVo
>
voList
=
Lists
.
newArrayList
();
Date
date
=
new
Date
();
if
(!
CollectionUtils
.
isEmpty
(
dangerList
))
{
Set
<
String
>
userIds
=
Sets
.
newHashSet
();
dangerList
.
forEach
(
e
->
userIds
.
add
(
e
.
getDiscovererUserId
()));
String
userIdsStr
=
Joiner
.
on
(
","
).
join
(
userIds
);
List
<
AgencyUserModel
>
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
userIdsStr
);
Map
<
String
,
AgencyUserModel
>
userMap
=
Maps
.
uniqueIndex
(
users
,
AgencyUserModel:
:
getUserId
);
for
(
LatentDangerBo
bo
:
dangerList
)
{
JSONObject
task
=
taskList
.
stream
().
filter
(
t
->
t
.
getString
(
"businessKey"
).
equals
(
bo
.
getBusinessKey
())).
collect
(
Collectors
.
toList
()).
get
(
0
);
LatentDangerListVo
vo
=
new
LatentDangerListVo
();
vo
.
setTaskId
(
task
.
getString
(
"id"
));
vo
.
setDangerId
(
bo
.
getId
());
vo
.
setOvertimeState
(
bo
.
getOvertimeState
());
vo
.
setDangerName
(
bo
.
getDangerName
());
vo
.
setDiscovererUserName
(
userMap
.
get
(
bo
.
getDiscovererUserId
()).
getRealName
());
vo
.
setLevel
(
bo
.
getDangerLevel
());
LatentDangerLevelEnum
levelEnum
=
LatentDangerLevelEnum
.
getByCode
(
bo
.
getDangerLevel
());
if
(
levelEnum
!=
null
)
{
vo
.
setLevelDesc
(
levelEnum
.
getName
());
}
vo
.
setState
(
bo
.
getDangerState
());
LatentDangerStateEnum
stateEnum
=
LatentDangerStateEnum
.
getByCode
(
bo
.
getDangerState
());
if
(
stateEnum
!=
null
)
{
vo
.
setStateDesc
(
stateEnum
.
getName
());
}
vo
.
setLimitDesc
(
getLimitDesc
(
bo
,
date
));
voList
.
add
(
vo
);
}
// count = latentDangerMapper.countByMap(map);
}
// return CommonResponseUtil.success(new PageImpl<>(newList, latentDangerListParam, respBody.getLong("total")));
return
CommonResponseUtil
.
success
(
new
PageImpl
<>(
voList
,
latentDangerListParam
,
dangerListSize
));
}
/**
* 获取指定用户具有隐患权限的code
*
* @param userId 指定用户id
* @param permissionType “activitiItem”
* @return permissions 具有隐患权限的code(逗号分割)
*/
private
String
hasProcessBPermission
(
String
userId
,
String
permissionType
)
{
String
permissions
=
""
;
// 根据用户id和许可类型获取用户所有的授权操作菜单路径("B"、"B_1"、"G_1_1"、"A"、"A_1"、"C".....)
JSONArray
jsonArray
=
remoteSecurityService
.
getMenuPathByUserIdAndPermissionType
(
userId
,
permissionType
);
if
(
CollectionUtils
.
isEmpty
(
jsonArray
))
{
return
""
;
}
// 过滤出隐患权限菜单路径("B_1,B_2.....B_10")
Object
obj
=
jsonArray
.
stream
().
filter
(
i
->
i
.
toString
().
matches
(
"^B_\\d+"
)).
collect
(
Collectors
.
toList
());
if
(
StringUtil
.
isNotEmpty
(
obj
)
&&
((
List
<
String
>)
obj
).
size
()
>
0
)
{
permissions
=
Joiner
.
on
(
","
).
join
((
List
<
String
>)
obj
);
}
return
permissions
;
}
private
String
getLimitDesc
(
LatentDangerBo
bo
,
Date
start
)
{
Integer
dangerState
=
bo
.
getDangerState
();
if
(
LatentDangerStateEnum
.
已撤销
.
getCode
().
equals
(
dangerState
)
||
LatentDangerStateEnum
.
治理完毕
.
getCode
().
equals
(
dangerState
))
{
if
(
bo
.
getOvertimeState
().
equals
(
LatentDangerOvertimeStateEnum
.
已超时
.
getCode
()))
{
return
"逾期治理"
;
}
else
{
return
"按期治理"
;
}
}
else
{
Date
end
=
bo
.
getReformLimitDate
();
if
(
end
==
null
)
{
return
""
;
}
if
(
bo
.
getOvertimeState
().
equals
(
LatentDangerOvertimeStateEnum
.
已超时
.
getCode
()))
{
return
"逾期未治理"
;
}
else
{
long
betweenSecond
=
(
end
.
getTime
()
-
start
.
getTime
())
/
1000
;
if
(
betweenSecond
<
0
)
{
return
"逾期未治理"
;
}
else
{
String
str
=
""
;
if
(
betweenSecond
>
3600
)
{
long
hour
=
betweenSecond
/
3600
;
str
+=
hour
+
"时"
;
betweenSecond
=
betweenSecond
%
3600
;
}
if
(
betweenSecond
>
60
)
{
long
minute
=
betweenSecond
/
60
;
str
+=
minute
+
"分"
;
betweenSecond
=
betweenSecond
%
60
;
}
if
(
betweenSecond
>
0
)
{
str
+=
betweenSecond
+
"秒"
;
}
return
str
;
}
}
}
}
@Transactional
@Override
public
DangerExecuteSubmitDto
execute
(
LatentDangerExcuteParam
latentDangerExcuteParam
,
String
userId
,
String
userRealName
,
String
departmentId
,
String
departmentName
,
RoleBo
role
)
{
DangerExecuteSubmitDto
executeSubmitDto
=
new
DangerExecuteSubmitDto
();
LatentDangerBo
latentDangerBo
=
null
;
if
(
StringUtil
.
isNotEmpty
(
latentDangerExcuteParam
.
getDangerId
()))
{
latentDangerBo
=
latentDangerMapper
.
getById
(
latentDangerExcuteParam
.
getDangerId
());
}
if
(
StringUtil
.
isNotEmpty
(
latentDangerExcuteParam
.
getReformLimitDate
())){
latentDangerExcuteParam
.
setReformLimitDate
(
latentDangerExcuteParam
.
getReformLimitDate
()+
" 23:59:59"
);
}
LatentDangerExcuteTypeEnum
executeTypeEnum
=
LatentDangerExcuteTypeEnum
.
getByCode
(
latentDangerExcuteParam
.
getExcuteType
());
if
(
executeTypeEnum
==
null
)
{
executeSubmitDto
.
setIsOk
(
false
);
executeSubmitDto
.
setMsg
(
"执行类型有误"
);
return
executeSubmitDto
;
}
// 延期治理时,根据用户选择是否需要公司来构造参数调用工作流
if
(
StringUtil
.
isNotEmpty
(
latentDangerExcuteParam
.
getNeedCompanyVerify
())
&&
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理车间部门审核通过
))
{
String
requestBody
=
""
;
if
(
latentDangerExcuteParam
.
getNeedCompanyVerify
()
==
0
)
{
// 延期治理申请 不需要公司审核
requestBody
=
"{\"needCompanyApproval\": \"否\",\"approveResult\": \"通过\"}"
;
}
else
{
// 延期治理申请 需要公司审核
requestBody
=
"{\"needCompanyApproval\": \"是\",\"approveResult\": \"通过\"}"
;
}
executeTypeEnum
.
setRequestBody
(
requestBody
);
}
// 延期治理选择的延期日期不能早于整改日期校验
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理
))
{
if
(
latentDangerBo
.
getReformLimitDate
().
compareTo
(
DateUtil
.
longStr2Date
(
latentDangerExcuteParam
.
getDelayLimitDate
()))
>=
0
)
{
executeSubmitDto
.
setIsOk
(
false
);
executeSubmitDto
.
setMsg
(
"延期日期不能早于整改期限"
);
return
executeSubmitDto
;
}
}
DangerExecuteSubmitDto
dangerExecuteSubmitDto
=
executeSubmit
(
latentDangerExcuteParam
,
executeTypeEnum
,
latentDangerBo
,
userId
,
userRealName
,
departmentId
,
departmentName
,
executeSubmitDto
,
role
);
try
{
webMqttComponent
.
publish
(
dangerTopic
,
""
);
}
catch
(
Exception
e
){
logger
.
error
(
"隐患执行提交数字换流站页面推送失败-----------"
+
e
.
getMessage
());
}
return
dangerExecuteSubmitDto
;
}
@Override
public
CommonResponse
detail
(
String
id
,
String
userId
,
boolean
isFinish
)
{
JSONObject
jsonObject
;
if
(
isFinish
==
true
){
jsonObject
=
remoteWorkFlowService
.
queryFinishTaskDetail
(
id
);
}
else
{
jsonObject
=
remoteWorkFlowService
.
queryTaskDetail
(
id
);
}
JSONObject
task
=
jsonObject
.
getJSONObject
(
"data"
);
LatentDangerBo
latentDangerBo
=
latentDangerMapper
.
getbyBusinessKey
(
task
.
getString
(
"businessKey"
));
// LinkedHashMap<String,Object> positionAll = equipFeign.getBuildingAbsolutePosition();
// LinkedHashMap<String,Object> position = new LinkedHashMap<>();
// if("200".equals(positionAll.get("status").toString())){
// position = (LinkedHashMap<String, Object>) positionAll.get("result");
// }
LatentDangerDetailVo
detailVo
=
new
LatentDangerDetailVo
();
if
(
latentDangerBo
!=
null
)
{
detailVo
.
setDangerId
(
latentDangerBo
.
getId
());
detailVo
.
setDangerType
(
latentDangerBo
.
getDangerType
());
// if(position.size()>0){
// detailVo.setPosition(position.get(latentDangerBo.getStructureId()).toString());
// }else {
// detailVo.setPosition(latentDangerBo.getDangerPosition());
// }
if
(
StringUtils
.
isEmpty
(
latentDangerBo
.
getDangerPosition
())){
detailVo
.
setPosition
(
latentDangerBo
.
getStructureName
());
}
else
{
detailVo
.
setPosition
(
latentDangerBo
.
getStructureName
()+
"·"
+
latentDangerBo
.
getDangerPosition
());
}
detailVo
.
setDangerState
(
latentDangerBo
.
getDangerState
());
detailVo
.
setProblemDescription
(
latentDangerBo
.
getProblemDescription
());
detailVo
.
setReasonAnalysis
(
latentDangerBo
.
getReasonAnalysis
());
detailVo
.
setInferOtherThings
(
latentDangerBo
.
getInferOtherThings
());
detailVo
.
setProblemDescription
(
latentDangerBo
.
getProblemDescription
());
LatentDangerStateEnum
dangerStateEnum
=
LatentDangerStateEnum
.
getByCode
(
latentDangerBo
.
getDangerState
());
if
(
dangerStateEnum
!=
null
)
{
detailVo
.
setDangerStateDesc
(
dangerStateEnum
.
getName
());
}
detailVo
.
setDangerName
(
latentDangerBo
.
getDangerName
());
detailVo
.
setLevel
(
latentDangerBo
.
getDangerLevel
());
LatentDangerLevelEnum
levelEnum
=
LatentDangerLevelEnum
.
getByCode
(
latentDangerBo
.
getDangerLevel
());
if
(
levelEnum
!=
null
)
{
detailVo
.
setLevelDesc
(
levelEnum
.
getName
());
}
detailVo
.
setRemark
(
latentDangerBo
.
getRemark
());
if
(
latentDangerBo
.
getReformType
()
!=
null
)
{
LatentDangerReformTypeEnum
typeEnum
=
LatentDangerReformTypeEnum
.
getByCode
(
latentDangerBo
.
getReformType
());
if
(
typeEnum
!=
null
)
{
detailVo
.
setReformTypeDesc
(
typeEnum
.
getName
());
}
}
if
(
latentDangerBo
.
getReformLimitDate
()
!=
null
)
{
detailVo
.
setReformLimitDate
(
DateUtil
.
date2Str
(
latentDangerBo
.
getReformLimitDate
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
));
}
if
(
latentDangerBo
.
getDelayLimitDate
()
!=
null
)
{
detailVo
.
setDelayLimitDate
(
DateUtil
.
date2Str
(
latentDangerBo
.
getDelayLimitDate
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
));
}
// detailVo.setCurrentUserCanExcute(false);
// if (!latentDangerBo.getCurrentFlowRecordId().equals(-1L)) {
// LatentDangerFlowRecordBo currentRecord = latentDangerFlowRecordMapper.getById(latentDangerBo.getCurrentFlowRecordId());
// String userIdsStr = currentRecord.getFlowTaskUserIds();
// List<String> userIds = Arrays.asList(userIdsStr.split(","));
// if (userIds.contains(userId) || hasProcessBPermission(userId, acctivePermissionType).contains(currentRecord.getActionFlag())) {
// detailVo.setCurrentUserCanExcute(true);
// }
// }
detailVo
.
setCurrentFlowRecordId
(
latentDangerBo
.
getCurrentFlowRecordId
());
if
(!
StringUtils
.
isEmpty
(
latentDangerBo
.
getReformJson
()))
{
detailVo
.
setReformJson
(
JSONObject
.
parseObject
(
latentDangerBo
.
getReformJson
()));
}
if
(!
StringUtils
.
isEmpty
(
latentDangerBo
.
getPhotoUrls
()))
{
List
<
String
>
photoUrls
=
Lists
.
newArrayList
(
latentDangerBo
.
getPhotoUrls
().
split
(
","
));
detailVo
.
setPhotoUrls
(
photoUrls
);
}
buildOfDifferentDangerType
(
latentDangerBo
,
detailVo
);
detailVo
.
setTaskId
(
task
.
getString
(
"id"
));
}
return
CommonResponseUtil
.
success
(
detailVo
);
}
private
void
buildOfDifferentDangerType
(
LatentDangerBo
latentDangerBo
,
LatentDangerDetailVo
detailVo
)
{
if
(
latentDangerBo
.
getDangerType
().
equals
(
LatentDangerTypeEnum
.
计划检查
.
getCode
())
||
latentDangerBo
.
getDangerType
().
equals
(
LatentDangerTypeEnum
.
无计划检查
.
getCode
()))
{
LatentDangerPatrolBo
patrolBo
=
latentDangerPatrolMapper
.
getByDangerId
(
latentDangerBo
.
getId
());
if
(
patrolBo
!=
null
)
{
LatentDangerDetailRiskVo
riskVo
=
new
LatentDangerDetailRiskVo
();
List
<
String
>
basis
=
new
ArrayList
<>();
if
(!
StringUtils
.
isEmpty
(
patrolBo
.
getItemBasis
())){
basis
.
add
(
patrolBo
.
getItemBasis
());
}
riskVo
.
setBasis
(
basis
);
riskVo
.
setPointName
(
patrolBo
.
getPointName
());
riskVo
.
setPointNo
(
patrolBo
.
getPointNo
());
riskVo
.
setPointLevel
(
StringUtil
.
isNotEmpty
(
patrolBo
.
getPointLevel
())
?
patrolBo
.
getPointLevel
()
:
""
);
riskVo
.
setPlanName
(
patrolBo
.
getPlanName
());
riskVo
.
setCheckTime
(
patrolBo
.
getCheckTime
());
AgencyUserModel
checkUser
=
remoteSecurityService
.
getUserById
(
RequestContext
.
getToken
(),
RequestContext
.
getProduct
(),
RequestContext
.
getAppKey
(),
patrolBo
.
getCheckUserId
());
if
(
StringUtil
.
isNotEmpty
(
checkUser
))
{
riskVo
.
setCheckUser
(
checkUser
.
getRealName
());
}
RiskFactorBo
riskFactorBo
=
StringUtil
.
isNotEmpty
(
patrolBo
.
getClassifyOriginalId
())
?
riskFactorMapper
.
getById
(
Long
.
valueOf
(
patrolBo
.
getClassifyOriginalId
()))
:
null
;
if
(
riskFactorBo
!=
null
&&
riskFactorBo
.
getEquipmentDepartmentId
()
!=
null
)
{
DepartmentModel
department
=
remoteSecurityService
.
getDepartmentByDeptId
(
RequestContext
.
getToken
(),
getProduct
(),
RequestContext
.
getAppKey
(),
riskFactorBo
.
getEquipmentDepartmentId
().
toString
());
if
(
department
!=
null
)
{
riskVo
.
setBelongDepartmentName
(
department
.
getDepartmentName
());
}
}
List
<
CheckShot
>
checkShots
=
iCheckShotDao
.
findAllByCheckIdAndCheckInputId
(
patrolBo
.
getCheckId
(),
latentDangerBo
.
getCheckInputId
());
if
(!
CollectionUtils
.
isEmpty
(
checkShots
))
{
List
<
String
>
photos
=
Lists
.
transform
(
checkShots
,
e
->
{
if
(
e
!=
null
)
{
return
fileServerAddress
+
e
.
getPhotoData
().
replaceAll
(
"\\\\"
,
"/"
);
}
else
{
return
""
;
}
});
detailVo
.
setPhotoUrls
(
photos
);
}
detailVo
.
setRiskInfo
(
riskVo
);
}
}
}
@Override
public
CommonResponse
getByInstanceId
(
String
instanceId
)
{
LatentDangerBo
latentDangerBo
=
latentDangerMapper
.
getByInstanceId
(
instanceId
);
if
(
latentDangerBo
==
null
)
{
return
CommonResponseUtil
.
failure
(
"隐患不存在"
);
}
JSONObject
result
=
new
JSONObject
();
JSONObject
baseInfo
=
new
JSONObject
();
JSONObject
reviewInfo
=
new
JSONObject
();
JSONObject
dangerInfo
=
new
JSONObject
();
Set
<
String
>
userIds
=
Sets
.
newHashSet
();
userIds
.
add
(
latentDangerBo
.
getDiscovererUserId
());
LatentDangerPatrolBo
patrolBo
=
null
;
if
(
latentDangerBo
.
getDangerType
().
equals
(
LatentDangerTypeEnum
.
计划检查
.
getCode
()))
{
patrolBo
=
latentDangerPatrolMapper
.
getByDangerId
(
latentDangerBo
.
getId
());
JSONArray
checkTypeArry
=
remoteSecurityService
.
listDictionaryByDictCode
(
RequestContext
.
getToken
(),
getProduct
(),
RequestContext
.
getAppKey
(),
XJConstant
.
CHECK_TYPE
);
Map
<
String
,
String
>
checkTypeMap
=
Maps
.
newHashMap
();
for
(
int
i
=
0
;
i
<
checkTypeArry
.
size
();
i
++)
{
JSONObject
categoryJson
=
checkTypeArry
.
getJSONObject
(
i
);
checkTypeMap
.
put
(
categoryJson
.
getString
(
"dictDataKey"
),
categoryJson
.
getString
(
"dictDataValue"
));
}
if
(
patrolBo
!=
null
)
{
PointClassify
classify
=
iPointClassifyDao
.
getOne
(
patrolBo
.
getPointClassifyId
());
RiskFactorBo
riskFactorBo
=
riskFactorMapper
.
getById
(
Long
.
valueOf
(
classify
.
getOriginalId
()));
String
jsonStr
=
patrolBo
.
getItemBasis
();
String
itemBasis
=
""
;
if
(!
StringUtils
.
isEmpty
(
jsonStr
))
{
StringBuilder
itemBasisBuilder
=
new
StringBuilder
();
JSONArray
arr
=
JSONArray
.
parseArray
(
jsonStr
);
for
(
int
i
=
0
;
i
<
arr
.
size
();
i
++)
{
JSONObject
object
=
arr
.
getJSONObject
(
i
);
itemBasisBuilder
.
append
(
object
.
getString
(
"name"
)).
append
(
","
);
}
itemBasis
=
itemBasisBuilder
.
length
()
>
0
?
itemBasisBuilder
.
substring
(
0
,
itemBasisBuilder
.
length
()
-
1
)
:
itemBasis
;
}
if
(
riskFactorBo
!=
null
)
{
userIds
.
add
(
patrolBo
.
getCheckUserId
());
dangerInfo
.
put
(
"type"
,
"设备设施类"
);
dangerInfo
.
put
(
"equipmentCode"
,
riskFactorBo
.
getEquipmentCode
());
dangerInfo
.
put
(
"isCheckWithPlan"
,
"是"
);
dangerInfo
.
put
(
"planName"
,
patrolBo
.
getPlanName
());
dangerInfo
.
put
(
"planType"
,
checkTypeMap
.
get
(
patrolBo
.
getCheckType
()));
dangerInfo
.
put
(
"routeName"
,
patrolBo
.
getRouteName
());
dangerInfo
.
put
(
"classifyName"
,
patrolBo
.
getClassifyName
());
dangerInfo
.
put
(
"itemName"
,
patrolBo
.
getItemName
());
dangerInfo
.
put
(
"itemBasis"
,
itemBasis
);
dangerInfo
.
put
(
"itemRemark"
,
patrolBo
.
getItemRemark
());
dangerInfo
.
put
(
"checkTime"
,
DateUtil
.
str2Date
(
patrolBo
.
getCheckTime
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
));
}
}
}
LatentDangerFlowRecordBo
reviewRecordBo
=
latentDangerFlowRecordMapper
.
getByDangerIdAndActionFlag
(
latentDangerBo
.
getId
(),
"B_2"
);
LatentDangerFlowRecordBo
reformRecordBo
=
latentDangerFlowRecordMapper
.
getByDangerIdAndActionFlag
(
latentDangerBo
.
getId
(),
"B_3"
);
if
(
reviewRecordBo
!=
null
)
{
userIds
.
add
(
reviewRecordBo
.
getExcuteUserId
());
}
if
(
reformRecordBo
!=
null
)
{
userIds
.
add
(
reformRecordBo
.
getExcuteUserId
());
}
userIds
.
removeAll
(
Collections
.
singleton
(
null
));
List
<
AgencyUserModel
>
userModels
=
remoteSecurityService
.
listUserByUserIds
(
Joiner
.
on
(
","
).
join
(
userIds
));
Map
<
String
,
AgencyUserModel
>
userMap
=
Maps
.
uniqueIndex
(
userModels
,
AgencyUserModel:
:
getUserId
);
AgencyUserModel
user
=
userMap
.
get
(
latentDangerBo
.
getDiscovererUserId
());
baseInfo
.
put
(
"orderNo"
,
latentDangerBo
.
getBusinessKey
());
baseInfo
.
put
(
"startTime"
,
latentDangerBo
.
getCreateDate
());
if
(
user
!=
null
)
{
baseInfo
.
put
(
"userName"
,
user
.
getRealName
());
}
DepartmentBo
departmentBo
=
remoteSecurityService
.
getDepartmentByDeptId
(
latentDangerBo
.
getDiscovererDepartmentId
().
toString
());
if
(
departmentBo
!=
null
)
{
baseInfo
.
put
(
"department"
,
departmentBo
.
getDepartmentName
());
}
LatentDangerLevelEnum
levelEnum
=
LatentDangerLevelEnum
.
getByCode
(
latentDangerBo
.
getDangerLevel
());
if
(
levelEnum
!=
null
)
{
dangerInfo
.
put
(
"latentDangerLevel"
,
levelEnum
.
getName
());
}
dangerInfo
.
put
(
"latentDangerName"
,
latentDangerBo
.
getDangerName
());
if
(!
StringUtils
.
isEmpty
(
latentDangerBo
.
getReformJson
()))
{
String
str
=
JSONObject
.
parseObject
(
latentDangerBo
.
getReformJson
()).
getString
(
"rectMeasures"
);
dangerInfo
.
put
(
"reformJson"
,
str
.
replace
(
"\\n"
,
"\\\\n"
));
}
dangerInfo
.
put
(
"reformLimitDate"
,
latentDangerBo
.
getReformLimitDate
());
if
(
reformRecordBo
!=
null
)
{
AgencyUserModel
reformUser
=
userMap
.
get
(
reformRecordBo
.
getExcuteUserId
());
if
(
reformUser
!=
null
)
{
dangerInfo
.
put
(
"reformUserName"
,
reformUser
.
getRealName
());
}
}
if
(
patrolBo
!=
null
)
{
if
(
patrolBo
.
getCheckUserId
()
!=
null
)
{
AgencyUserModel
checkUser
=
userMap
.
get
(
patrolBo
.
getCheckUserId
());
if
(
checkUser
!=
null
)
{
dangerInfo
.
put
(
"checkUserName"
,
checkUser
.
getRealName
());
}
}
if
(
patrolBo
.
getCheckDepartmentId
()
!=
null
)
{
DepartmentBo
checkDepartment
=
remoteSecurityService
.
getDepartmentByDeptId
(
patrolBo
.
getCheckDepartmentId
());
if
(
checkDepartment
!=
null
)
{
dangerInfo
.
put
(
"checkUserDeptName"
,
checkDepartment
.
getDepartmentName
());
}
}
}
if
(
reviewRecordBo
!=
null
)
{
AgencyUserModel
reviewUser
=
userMap
.
get
(
reviewRecordBo
.
getExcuteUserId
());
reviewInfo
.
put
(
"reviewUserName"
,
StringUtil
.
isNotEmpty
(
reviewUser
)
?
reviewUser
.
getRealName
()
:
""
);
reviewInfo
.
put
(
"reviewDate"
,
StringUtil
.
isNotEmpty
(
reviewUser
)
?
reviewRecordBo
.
getUpdateDate
()
:
""
);
reviewInfo
.
put
(
"reviewResult"
,
StringUtil
.
isNotEmpty
(
reviewUser
)
?
reviewRecordBo
.
getExcuteResult
()
:
""
);
}
result
.
put
(
"baseInfo"
,
baseInfo
);
result
.
put
(
"dangerInfo"
,
dangerInfo
);
result
.
put
(
"reviewInfo"
,
reviewInfo
);
result
.
put
(
"latentDangerType"
,
latentDangerBo
.
getDangerType
());
LatentDangerTypeEnum
typeEnum
=
LatentDangerTypeEnum
.
getByCode
(
latentDangerBo
.
getDangerType
());
if
(
typeEnum
!=
null
)
{
result
.
put
(
"latentDangerTypeDesc"
,
typeEnum
.
getName
());
}
return
CommonResponseUtil
.
success
(
result
);
}
@Transactional
@Override
public
DangerExecuteSubmitDto
excuteCallBack
(
String
instanceId
,
Integer
actionType
,
String
remark
,
String
token
,
String
userId
,
String
userRealName
,
String
departmentId
,
String
departmentName
)
{
DangerExecuteSubmitDto
executeSubmitDto
=
new
DangerExecuteSubmitDto
();
executeSubmitDto
.
setIsOk
(
true
);
LatentDangerBo
latentDangerBo
=
latentDangerMapper
.
getByInstanceId
(
instanceId
);
if
(
latentDangerBo
!=
null
)
{
LatentDangerFlowRecordBo
currentRecord
=
latentDangerFlowRecordMapper
.
getById
(
latentDangerBo
.
getCurrentFlowRecordId
());
if
(
actionType
.
equals
(
1
))
{
//通过
LatentDangerExcuteTypeEnum
excuteTypeEnum
=
LatentDangerExcuteTypeEnum
.
公司负责人审核通过
;
updateFlowRecord
(
currentRecord
,
excuteTypeEnum
,
userId
,
departmentId
,
remark
,
null
);
JSONObject
flowJson
=
remoteWorkFlowService
.
allTasksInProcessInstanceId
(
latentDangerBo
.
getInstanceId
());
if
(
flowJson
==
null
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
executeSubmitDto
;
}
LatentDangerPatrolBo
patrolBo
=
null
;
String
userIds
;
if
(
latentDangerBo
.
getDangerType
().
equals
(
LatentDangerTypeEnum
.
计划检查
.
getCode
()))
{
patrolBo
=
latentDangerPatrolMapper
.
getByDangerId
(
latentDangerBo
.
getId
());
userIds
=
Joiner
.
on
(
","
).
join
(
getUserIdsStrByPerTypeAndDefKey
(
flowJson
));
}
else
{
LatentDangerFlowRecordBo
recordBo
=
latentDangerFlowRecordMapper
.
getByDangerIdAndActionFlag
(
latentDangerBo
.
getId
(),
"B_8"
);
userIds
=
recordBo
.
getFlowTaskUserIds
();
}
LatentDangerFlowRecordBo
record
=
saveFlowRecord
(
flowJson
.
getString
(
"id"
),
userIds
,
flowJson
.
getString
(
"name"
),
flowJson
.
getString
(
"taskDefinitionKey"
),
latentDangerBo
.
getId
());
latentDangerBo
.
setCurrentFlowRecordId
(
record
.
getId
());
latentDangerBo
.
setDangerState
(
excuteTypeEnum
.
getNextState
().
getCode
());
latentDangerMapper
.
update
(
latentDangerBo
);
///web推送刷新消息
// dangerStateChangeWebSockte(latentDangerBo);
// Set<String> nextExecuteUserIds = Sets.newHashSet(Arrays.asList(userIds.split(",")));
sendMessage
(
latentDangerBo
,
excuteTypeEnum
,
patrolBo
,
currentRecord
.
getFlowTaskName
(),
this
.
getNextExecuteUsers
(
latentDangerBo
.
getInstanceId
()),
userRealName
,
departmentName
);
}
else
if
(
actionType
.
equals
(
2
))
{
//终止
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
已撤销
.
getCode
());
latentDangerMapper
.
update
(
latentDangerBo
);
// remoteWorkFlowService.stop(latentDangerBo.getInstanceId());
if
(
latentDangerBo
.
getDangerType
().
equals
(
LatentDangerTypeEnum
.
计划检查
.
getCode
()))
{
LatentDangerPatrolBo
patrolBo
=
latentDangerPatrolMapper
.
getByDangerId
(
latentDangerBo
.
getId
());
if
(
patrolBo
.
getClassifyOriginalId
()
!=
null
&&
patrolBo
.
getItemOriginalId
()
!=
null
)
{
updateMeasuresContentStatus
(
Long
.
valueOf
(
patrolBo
.
getClassifyOriginalId
()),
Long
.
valueOf
(
patrolBo
.
getItemOriginalId
()),
patrolBo
.
getRiskFactorFlowId
(),
RiskFactorsCmStatusEnum
.
Control
);
}
LatentDangerLevelEnum
levelEnum
=
LatentDangerLevelEnum
.
getByCode
(
latentDangerBo
.
getDangerLevel
());
if
(
levelEnum
!=
null
)
{
updateRiskSourceDangerState
(
false
,
Long
.
valueOf
(
patrolBo
.
getPointOriginalId
()),
levelEnum
,
patrolBo
.
getPointId
(),
latentDangerBo
.
getId
());
}
executeSubmitDto
.
setDangerId
(
latentDangerBo
.
getId
());
executeSubmitDto
.
setDangerName
(
latentDangerBo
.
getDangerName
());
executeSubmitDto
.
setPointOriginalId
(
patrolBo
.
getPointOriginalId
());
executeSubmitDto
.
setPointId
(
patrolBo
.
getPointId
());
executeSubmitDto
.
setExecuteTypeEnum
(
LatentDangerExcuteTypeEnum
.
隐患评审拒绝
);
}
}
else
if
(
actionType
.
equals
(
3
))
{
//拒绝
LatentDangerExcuteTypeEnum
excuteTypeEnum
=
LatentDangerExcuteTypeEnum
.
公司负责人审核拒绝
;
updateFlowRecord
(
currentRecord
,
excuteTypeEnum
,
userId
,
departmentId
,
remark
,
null
);
JSONObject
flowJson
=
remoteWorkFlowService
.
allTasksInProcessInstanceId
(
latentDangerBo
.
getInstanceId
());
if
(
flowJson
==
null
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
executeSubmitDto
;
}
LatentDangerPatrolBo
patrolBo
=
null
;
String
userIds
;
if
(
latentDangerBo
.
getDangerType
().
equals
(
LatentDangerTypeEnum
.
计划检查
.
getCode
()))
{
patrolBo
=
latentDangerPatrolMapper
.
getByDangerId
(
latentDangerBo
.
getId
());
userIds
=
Joiner
.
on
(
","
).
join
(
getUserIdsStrByPerTypeAndDefKey
(
flowJson
));
}
else
{
LatentDangerFlowRecordBo
recordBo
=
latentDangerFlowRecordMapper
.
getByDangerIdAndActionFlag
(
latentDangerBo
.
getId
(),
"B_3"
);
userIds
=
recordBo
.
getFlowTaskUserIds
();
}
LatentDangerFlowRecordBo
record
=
saveFlowRecord
(
flowJson
.
getString
(
"id"
),
userIds
,
flowJson
.
getString
(
"name"
),
flowJson
.
getString
(
"taskDefinitionKey"
),
latentDangerBo
.
getId
());
latentDangerBo
.
setCurrentFlowRecordId
(
record
.
getId
());
latentDangerBo
.
setDangerState
(
excuteTypeEnum
.
getNextState
().
getCode
());
latentDangerMapper
.
update
(
latentDangerBo
);
///web推送刷新消息
// dangerStateChangeWebSockte(latentDangerBo);
// Set<String> nextExecuteUserIds = Sets.newHashSet(Arrays.asList(userIds.split(",")));
sendMessage
(
latentDangerBo
,
excuteTypeEnum
,
patrolBo
,
currentRecord
.
getFlowTaskName
(),
this
.
getNextExecuteUsers
(
latentDangerBo
.
getInstanceId
()),
userRealName
,
departmentName
);
}
}
return
executeSubmitDto
;
}
@Override
public
void
updateDangerStateOfOvertime
()
{
logger
.
info
(
"修改治理过期隐患的逾期状态"
);
List
<
LatentDangerBo
>
overtimeList
=
latentDangerMapper
.
listOfOvertime
();
for
(
LatentDangerBo
latentDangerBo
:
overtimeList
)
{
latentDangerBo
.
setOvertimeState
(
LatentDangerOvertimeStateEnum
.
已超时
.
getCode
());
latentDangerMapper
.
update
(
latentDangerBo
);
if
(
latentDangerBo
.
getDangerType
().
equals
(
LatentDangerTypeEnum
.
计划检查
.
getCode
()))
{
LatentDangerPatrolBo
patrolBo
=
latentDangerPatrolMapper
.
getByDangerId
(
latentDangerBo
.
getId
());
LatentDangerResultPushSpcRequest
spcRequest
=
new
LatentDangerResultPushSpcRequest
();
spcRequest
.
setProcessingTime
(
DateUtil
.
date2Str
(
new
Date
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
));
spcRequest
.
setHiddenTroubleName
(
latentDangerBo
.
getDangerName
());
spcRequest
.
setRiskSourceId
(
patrolBo
.
getPointOriginalId
());
spcRequest
.
setHiddenTroubleStatus
(
"治理逾期"
);
spcRequest
.
setTroubleList
(
getTroubleList
(
patrolBo
.
getPointId
()));
remoteSpcService
.
pushLatentDangerExcuteResult
(
spcRequest
);
}
}
//推送页面刷新
// remoteWebSocketServer.wsDataRefresh("dangerOverdue");
// 即将逾期的隐患发送消息提醒用户
List
<
LatentDangerNoticeBo
>
needNoticeDangerList
=
latentDangerMapper
.
listNeedNoticeDanger
();
if
(!
CollectionUtils
.
isEmpty
(
needNoticeDangerList
))
{
logger
.
info
(
"隐患治理即将逾期通知》》》》"
);
needNoticeDangerList
.
forEach
(
danger
->
{
asyncTask
.
pushLatentDangerReformLimitDateExpireMessage
(
this
.
getNextExecuteUsers
(
danger
.
getInstanceId
()),
danger
.
getOrgCode
(),
danger
.
getDangerName
(),
DateUtil
.
date2Str
(
danger
.
getReformLimitDate
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
),
danger
.
getDangerId
(),
danger
.
getDangerState
(),
""
);
});
}
}
/**
* web安全态势预控 ( 隐患按车间/部门统计) 模块推送刷新消息
*/
private
void
dangerStateChangeWebSockte
(
LatentDangerBo
latentDangerBo
)
{
Integer
state
=
latentDangerBo
.
getDangerState
();
Integer
type
=
latentDangerBo
.
getDangerType
();
if
(
LatentDangerTypeEnum
.
计划检查
.
getCode
().
equals
(
type
)
||
LatentDangerTypeEnum
.
无计划检查
.
getCode
().
equals
(
type
))
{
if
(
LatentDangerStateEnum
.
待治理
.
getCode
().
equals
(
state
)
// || LatentDangerStateEnum.安措计划中.getCode().equals(state)
||
LatentDangerStateEnum
.
待验证
.
getCode
().
equals
(
state
))
{
remoteWebSocketServer
.
wsDataRefresh
(
"dangerExecute"
);
}
}
}
@Override
public
CommonResponse
listFlowRecord
(
String
token
,
String
product
,
String
appKey
,
Long
id
)
{
LatentDangerBo
latentDangerBo
=
latentDangerMapper
.
getById
(
id
);
if
(
latentDangerBo
==
null
)
{
return
CommonResponseUtil
.
failure
(
"隐患不存在"
);
}
LatentDangerDetailVo
detailVo
=
new
LatentDangerDetailVo
();
detailVo
.
setDangerName
(
latentDangerBo
.
getDangerName
());
detailVo
.
setLevel
(
latentDangerBo
.
getDangerLevel
());
detailVo
.
setPosition
(
latentDangerBo
.
getStructureName
());
LatentDangerLevelEnum
levelEnum
=
LatentDangerLevelEnum
.
getByCode
(
latentDangerBo
.
getDangerLevel
());
if
(
levelEnum
!=
null
)
{
detailVo
.
setLevelDesc
(
levelEnum
.
getName
());
}
List
<
LatentDangerFlowRecordBo
>
records
=
latentDangerFlowRecordMapper
.
listByDangerId
(
latentDangerBo
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
records
))
{
Set
<
String
>
userIds
=
Sets
.
newHashSet
();
Set
<
String
>
deptIds
=
Sets
.
newHashSet
();
records
.
forEach
(
e
->
{
if
(!
StringUtils
.
isEmpty
(
e
.
getExcuteUserId
()))
{
userIds
.
add
(
e
.
getExcuteUserId
());
}
if
(!
StringUtils
.
isEmpty
(
e
.
getExcuteDepartmentId
()))
{
deptIds
.
add
(
e
.
getExcuteDepartmentId
());
}
});
List
<
DepartmentModel
>
departmentBos
=
remoteSecurityService
.
getlistDepartmentByDeptIds
(
token
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
deptIds
));
List
<
AgencyUserModel
>
userModels
=
remoteSecurityService
.
listUserByUserIds
(
token
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
Map
<
String
,
AgencyUserModel
>
userMap
=
Maps
.
uniqueIndex
(
userModels
,
AgencyUserModel:
:
getUserId
);
Map
<
Long
,
DepartmentModel
>
departmentBoMap
=
Maps
.
uniqueIndex
(
departmentBos
,
DepartmentModel:
:
getSequenceNbr
);
for
(
LatentDangerFlowRecordBo
recordBo
:
records
)
{
AgencyUserModel
user
=
userMap
.
get
(
recordBo
.
getExcuteUserId
());
if
(
user
!=
null
)
{
recordBo
.
setExecuteUserName
(
user
.
getRealName
());
}
DepartmentModel
departmentBo
=
departmentBoMap
.
get
(
recordBo
.
getExcuteDepartmentId
());
if
(
departmentBo
!=
null
)
{
recordBo
.
setExecuteDepartmentName
(
departmentBo
.
getDepartmentName
());
}
recordBo
.
setExecuteTime
(
DateUtil
.
date2Str
(
recordBo
.
getCreateDate
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
));
}
detailVo
.
setRecords
(
records
);
}
return
CommonResponseUtil
.
success
(
detailVo
);
}
// private void resetMeasuresContentStatus(LatentDangerBo latentDangerBo) {
// if (latentDangerBo.getDangerType().equals(LatentDangerTypeEnum.巡检隐患.getCode())
// || latentDangerBo.getDangerType().equals(LatentDangerTypeEnum.有码无计划隐患.getCode())) {
// logger.info("重置管控内容的状态为受控");
// //重置管控内容的状态为受控
//
// }
// }
public
DangerExecuteSubmitDto
executeSubmit
(
LatentDangerExcuteParam
param
,
LatentDangerExcuteTypeEnum
executeTypeEnum
,
LatentDangerBo
latentDangerBo
,
String
userId
,
String
userRealName
,
String
departmentId
,
String
departmentName
,
DangerExecuteSubmitDto
executeSubmitDto
,
RoleBo
role
)
{
JSONObject
executeJson
=
remoteWorkFlowService
.
excute
(
param
.
getTaskId
(),
executeTypeEnum
.
getRequestBody
());
if
(
executeJson
==
null
)
{
executeSubmitDto
.
setIsOk
(
false
);
executeSubmitDto
.
setMsg
(
"执行失败"
);
return
executeSubmitDto
;
}
LatentDangerPatrolBo
patrolBo
=
null
;
if
(
latentDangerBo
.
getDangerType
().
equals
(
LatentDangerTypeEnum
.
计划检查
.
getCode
()))
{
patrolBo
=
latentDangerPatrolMapper
.
getByDangerId
(
latentDangerBo
.
getId
());
}
JSONObject
data
=
executeJson
.
getJSONObject
(
"data"
);
if
(
executeTypeEnum
.
getNextState
().
equals
(
LatentDangerStateEnum
.
已撤销
))
{
latentDangerBo
.
setDangerState
(
executeTypeEnum
.
getNextState
().
getCode
());
saveFlowRecord
(
executeJson
.
getString
(
"id"
),
data
.
getString
(
"name"
),
userId
,
departmentId
,
param
.
getFlowJson
(),
param
.
getDangerId
(),
role
,
executeTypeEnum
.
getName
(),
param
.
getRemark
());
}
else
if
(
executeTypeEnum
.
getNextState
().
equals
(
LatentDangerStateEnum
.
治理完毕
))
{
latentDangerBo
.
setDangerState
(
executeTypeEnum
.
getNextState
().
getCode
());
saveFlowRecord
(
executeJson
.
getString
(
"id"
),
data
.
getString
(
"name"
),
userId
,
departmentId
,
param
.
getFlowJson
(),
param
.
getDangerId
(),
role
,
executeTypeEnum
.
getName
(),
param
.
getRemark
());
}
else
{
LatentDangerFlowRecordBo
flowRecord
=
saveFlowRecord
(
executeJson
.
getString
(
"id"
),
data
.
getString
(
"name"
),
userId
,
departmentId
,
param
.
getFlowJson
(),
param
.
getDangerId
(),
role
,
executeTypeEnum
.
getName
(),
param
.
getRemark
());
latentDangerBo
.
setCurrentFlowRecordId
(
flowRecord
.
getId
());
latentDangerBo
.
setDangerState
(
executeTypeEnum
.
getNextState
().
getCode
());
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患常规治理
))
{
latentDangerBo
.
setReformType
(
LatentDangerReformTypeEnum
.
常规整改
.
getCode
());
latentDangerBo
.
setReformJson
(
param
.
getFlowJson
().
toJSONString
());
latentDangerBo
.
setInferOtherThings
(
param
.
getInferOtherThings
());
latentDangerBo
.
setProblemDescription
(
param
.
getReasonAnalysis
());
latentDangerBo
.
setReasonAnalysis
(
param
.
getRemark
());
}
else
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理
))
{
latentDangerBo
.
setReformType
(
LatentDangerReformTypeEnum
.
延期治理
.
getCode
());
latentDangerBo
.
setReformJson
(
param
.
getFlowJson
().
toJSONString
());
latentDangerBo
.
setInferOtherThings
(
param
.
getInferOtherThings
());
latentDangerBo
.
setProblemDescription
(
param
.
getReasonAnalysis
());
latentDangerBo
.
setReasonAnalysis
(
param
.
getRemark
());
latentDangerBo
.
setDelayLimitDate
(
DateUtil
.
str2Date
(
param
.
getDelayLimitDate
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
));
}
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患评审通过
))
{
latentDangerBo
.
setReformLimitDate
(
DateUtil
.
str2Date
(
param
.
getReformLimitDate
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
));
latentDangerBo
.
setDangerLevel
(
param
.
getDangerLevel
());
}
}
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理车间部门审核通过
))
{
// 延期治理评审通过且 不需要 公司审核
if
(
param
.
getNeedCompanyVerify
()
==
0
)
{
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
延期治理申请
.
getCode
());
latentDangerBo
.
setReformLimitDate
(
latentDangerBo
.
getDelayLimitDate
());
}
else
{
// 延期治理评审通过且 需要 公司审核
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
延期治理申请待公司审核
.
getCode
());
LatentDangerFlowRecordBo
recordBo
=
latentDangerFlowRecordMapper
.
getByDangerIdAndCreate
(
latentDangerBo
.
getId
());
String
flowJsonStr
=
recordBo
.
getFlowJson
();
JSONObject
flowJson
=
JSONObject
.
parseObject
(
flowJsonStr
);
flowJson
.
put
(
"needCompanyVerify"
,
param
.
getNeedCompanyVerify
());
recordBo
.
setFlowJson
(
flowJson
.
toJSONString
());
latentDangerFlowRecordMapper
.
update
(
recordBo
);
}
}
else
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理车间部门审核拒绝
))
{
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
待治理
.
getCode
());
}
else
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理公司审核通过
))
{
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
延期治理申请
.
getCode
());
latentDangerBo
.
setReformLimitDate
(
latentDangerBo
.
getDelayLimitDate
());
}
else
if
(
executeTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患延期治理公司审核拒绝
))
{
latentDangerBo
.
setDangerState
(
LatentDangerStateEnum
.
延期治理申请待车间部门审核
.
getCode
());
}
latentDangerMapper
.
update
(
latentDangerBo
);
if
(
patrolBo
!=
null
)
{
executeSubmitDto
.
setPointOriginalId
(
patrolBo
.
getPointOriginalId
());
executeSubmitDto
.
setPointId
(
patrolBo
.
getPointId
());
}
executeSubmitDto
.
setIsOk
(
true
);
executeSubmitDto
.
setExecuteTypeEnum
(
executeTypeEnum
);
executeSubmitDto
.
setDangerName
(
latentDangerBo
.
getDangerName
());
executeSubmitDto
.
setDangerId
(
latentDangerBo
.
getId
());
sendMessage
(
latentDangerBo
,
executeTypeEnum
,
patrolBo
,
executeTypeEnum
.
getName
(),
this
.
getNextExecuteUsers
(
latentDangerBo
.
getInstanceId
()),
userRealName
,
departmentName
);
return
executeSubmitDto
;
}
private
void
sendMessage
(
LatentDangerBo
latentDangerBo
,
LatentDangerExcuteTypeEnum
excuteTypeEnum
,
LatentDangerPatrolBo
patrolBo
,
String
flowTaskName
,
String
informerList
,
String
userRealName
,
String
departmentName
)
{
try
{
if
(
excuteTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患评审拒绝
))
{
String
pointName
=
null
;
if
(
patrolBo
!=
null
)
{
pointName
=
patrolBo
.
getPointName
();
}
Set
<
String
>
sendUserIds
=
Sets
.
newHashSet
(
latentDangerBo
.
getDiscovererUserId
());
asyncTask
.
pushLatentDangerExecuteMessage
(
informerList
,
latentDangerBo
.
getOrgCode
(),
latentDangerBo
.
getDangerName
(),
pointName
,
departmentName
,
latentDangerBo
.
getId
(),
userRealName
,
flowTaskName
,
ExecuteStateEnum
.
驳回
.
getName
(),
DateUtil
.
date2Str
(
new
Date
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
),
latentDangerBo
.
getDangerState
());
}
else
if
(
excuteTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患验证通过
))
{
if
(
patrolBo
!=
null
)
{
// RiskFactorBo riskFactorBo = riskFactorMapper.getById(Long.valueOf(patrolBo.getClassifyOriginalId()));
// Set<String> sendUserIds = Sets.newHashSet();
// if (riskFactorBo != null) {
// sendUserIds.addAll(Arrays.asList(riskFactorBo.getUserIds().split(",")));
// sendUserIds.add(riskFactorBo.getFirstEvaluateUserId());
// sendUserIds.add(riskFactorBo.getSecondEvaluateUserId());
// asyncTask.pushRiskWarnMessage(sendUserIds, latentDangerBo.getOrgCode(),
// latentDangerBo.getDangerName(), riskFactorBo.getId(),
// riskFactorBo.getName(), patrolBo.getPointName(),
// DateUtil.date2Str(new Date(), DateUtil.DATETIME_DEFAULT_FORMAT));
// }
// 更新p_check_input表state字段
updateCheckInputDangerState
(
latentDangerBo
.
getCheckInputId
(),
DangerHandleStateEnum
.
COMPLETED
.
getCode
());
DangerResultBo
dangerResultBo
=
new
DangerResultBo
();
try
{
business
.
processProtalDataFromDanger
(
dangerResultBo
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"隐患治理完成调用站端接口出错!"
);
}
}
}
else
{
String
pointName
=
null
;
if
(
patrolBo
!=
null
)
{
pointName
=
patrolBo
.
getPointName
();
}
asyncTask
.
pushLatentDangerExecuteMessage
(
informerList
,
latentDangerBo
.
getOrgCode
(),
latentDangerBo
.
getDangerName
(),
pointName
,
departmentName
,
latentDangerBo
.
getId
(),
userRealName
,
flowTaskName
,
excuteTypeEnum
.
getExcuteState
().
getName
(),
DateUtil
.
date2Str
(
new
Date
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
),
latentDangerBo
.
getDangerState
());
if
(
excuteTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患评审通过
))
{
// 隐患治理到期时间为当天,则立即提示消息
Date
reformLimitDate
=
latentDangerBo
.
getReformLimitDate
();
if
(
DateUtil
.
getDateFormat
(
new
Date
()).
equals
(
DateUtil
.
getDateFormat
(
reformLimitDate
)))
{
asyncTask
.
pushLatentDangerReformLimitDateExpireMessage
(
informerList
,
latentDangerBo
.
getOrgCode
(),
latentDangerBo
.
getDangerName
(),
DateUtil
.
date2Str
(
latentDangerBo
.
getReformLimitDate
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
),
latentDangerBo
.
getId
(),
latentDangerBo
.
getDangerState
(),
userRealName
);
}
}
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"隐患执行发送消息失败"
,
e
);
}
}
private
void
updateSpcStateToControl
(
LatentDangerPatrolBo
patrolBo
,
LatentDangerBo
latentDangerBo
)
{
if
(
patrolBo
.
getClassifyOriginalId
()
!=
null
&&
patrolBo
.
getItemOriginalId
()
!=
null
)
{
updateMeasuresContentStatus
(
Long
.
valueOf
(
patrolBo
.
getClassifyOriginalId
()),
Long
.
valueOf
(
patrolBo
.
getItemOriginalId
()),
patrolBo
.
getRiskFactorFlowId
(),
RiskFactorsCmStatusEnum
.
Control
);
}
LatentDangerLevelEnum
levelEnum
=
LatentDangerLevelEnum
.
getByCode
(
latentDangerBo
.
getDangerLevel
());
if
(
levelEnum
!=
null
)
{
updateRiskSourceDangerState
(
false
,
Long
.
valueOf
(
patrolBo
.
getPointOriginalId
()),
levelEnum
,
patrolBo
.
getPointId
(),
latentDangerBo
.
getId
());
}
}
// private void wakeUpRiskFactorFlow(LatentDangerPatrolBo patrolBo, String token) {
// Integer notFinishFlow = latentDangerMapper.countNotFinishByFlowId(patrolBo.getRiskFactorFlowId());
// if (notFinishFlow == 0) {
// logger.info("解冻原来的A流程");
// //解冻原来的A流程
// remoteSpcService.wakeUpOrRestartRiskFactorFlow(patrolBo.getRiskFactorFlowId(), WorkFlowRiskFactorUriEnum.流程回调, token, RiskFactorWorkFlowActionTypeEnum.唤起流程);
// }
// }
@Async
@Override
public
void
sendLatentDangerExcuteResult
(
DangerExecuteSubmitDto
executeSubmitDto
)
{
LatentDangerExcuteTypeEnum
excuteTypeEnum
=
executeSubmitDto
.
getExecuteTypeEnum
();
String
dangerName
=
executeSubmitDto
.
getDangerName
();
String
pointOriginalId
=
executeSubmitDto
.
getPointOriginalId
();
Long
pointId
=
executeSubmitDto
.
getPointId
();
String
status
=
null
;
if
(
excuteTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患评审通过
))
{
status
=
"隐患评审通过"
;
}
else
if
(
excuteTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患评审拒绝
))
{
status
=
"隐患评审不通过"
;
}
else
if
(
excuteTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患验证拒绝
))
{
status
=
"治理验证不通过"
;
}
else
if
(
excuteTypeEnum
.
equals
(
LatentDangerExcuteTypeEnum
.
隐患验证通过
))
{
status
=
"治理验证完成"
;
}
if
(
status
!=
null
)
{
LatentDangerResultPushSpcRequest
spcRequest
=
new
LatentDangerResultPushSpcRequest
();
spcRequest
.
setProcessingTime
(
DateUtil
.
date2Str
(
new
Date
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
));
spcRequest
.
setHiddenTroubleName
(
dangerName
);
spcRequest
.
setRiskSourceId
(
pointOriginalId
);
spcRequest
.
setHiddenTroubleStatus
(
status
);
spcRequest
.
setTroubleList
(
getTroubleList
(
pointId
));
remoteSpcService
.
pushLatentDangerExcuteResult
(
spcRequest
);
}
}
private
List
<
String
>
getTroubleList
(
Long
pointId
)
{
List
<
String
>
troubleList
=
Lists
.
newArrayList
();
List
<
LatentDangerPatrolBo
>
patrolList
=
latentDangerPatrolMapper
.
listByPointId
(
pointId
);
if
(!
CollectionUtils
.
isEmpty
(
patrolList
))
{
List
<
Long
>
dangerIds
=
Lists
.
transform
(
patrolList
,
LatentDangerPatrolBo:
:
getLatentDangerId
);
List
<
LatentDangerFlowRecordBo
>
flowRecordBos
=
latentDangerFlowRecordMapper
.
listNewestRecordByDangerIds
(
dangerIds
);
flowRecordBos
.
forEach
(
l
->
{
String
status
=
null
;
if
(
l
.
getDangerState
().
equals
(
LatentDangerStateEnum
.
待治理
.
getCode
())
&&
l
.
getDangerOvertimeState
().
equals
(
LatentDangerOvertimeStateEnum
.
已超时
.
getCode
()))
{
status
=
"治理逾期"
;
}
else
{
if
(
l
.
getExcuteResult
().
equals
(
LatentDangerExcuteTypeEnum
.
隐患评审通过
.
getName
()))
{
status
=
"隐患评审通过"
;
}
else
if
(
l
.
getExcuteResult
().
equals
(
LatentDangerExcuteTypeEnum
.
隐患评审拒绝
.
getName
()))
{
status
=
"隐患评审不通过"
;
}
else
if
(
l
.
getExcuteResult
().
equals
(
LatentDangerExcuteTypeEnum
.
隐患验证拒绝
.
getName
()))
{
status
=
"治理验证不通过"
;
}
else
if
(
l
.
getExcuteResult
().
equals
(
LatentDangerExcuteTypeEnum
.
隐患验证通过
.
getName
()))
{
status
=
"治理验证完成"
;
}
}
if
(
status
!=
null
)
{
troubleList
.
add
(
status
);
}
});
}
return
troubleList
;
}
private
void
updateRiskSourceDangerState
(
Boolean
isSave
,
Long
riskSourceId
,
LatentDangerLevelEnum
levelEnum
,
Long
pointId
,
Long
dangerId
)
{
RiskSourceBo
riskSourceBo
=
riskSourceMapper
.
getById
(
riskSourceId
);
if
(
riskSourceBo
!=
null
)
{
if
(
isSave
)
{
//添加隐患
riskSourceBo
.
setIsDanger
(
true
);
if
(
riskSourceBo
.
getDangerLevel
()
==
null
)
{
riskSourceBo
.
setDangerLevel
(
levelEnum
.
getRiskSourceDangerLevelCode
());
}
else
{
// if (riskSourceBo.getDangerLevel().equals(LatentDangerLevelEnum.一般隐患.getRiskSourceDangerLevelCode())
// && levelEnum.equals(LatentDangerLevelEnum.重大隐患)) {
// riskSourceBo.setDangerLevel(levelEnum.getRiskSourceDangerLevelCode());
// }
if
(
Integer
.
parseInt
(
riskSourceBo
.
getDangerLevel
())
<
Integer
.
parseInt
(
levelEnum
.
getRiskSourceDangerLevelCode
()))
{
riskSourceBo
.
setDangerLevel
(
levelEnum
.
getRiskSourceDangerLevelCode
());
}
}
}
else
{
//撤销、完成隐患
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pointId"
,
pointId
);
params
.
put
(
"dangerId"
,
dangerId
);
List
<
LatentDangerBo
>
latentDangerBos
=
latentDangerMapper
.
listNotFinishByPointId
(
params
);
if
(
CollectionUtils
.
isEmpty
(
latentDangerBos
))
{
riskSourceBo
.
setIsDanger
(
false
);
}
else
{
riskSourceBo
.
setIsDanger
(
true
);
String
dangerLevel
=
checkHasSeriousDanger
(
latentDangerBos
);
riskSourceBo
.
setDangerLevel
(
dangerLevel
);
}
}
riskSourceMapper
.
updateDangerState
(
riskSourceBo
);
}
}
private
String
checkHasSeriousDanger
(
List
<
LatentDangerBo
>
latentDangerBos
)
{
String
dangerLevel
=
LatentDangerLevelEnum
.
安全问题
.
getRiskSourceDangerLevelCode
();
for
(
LatentDangerBo
latentDangerBo
:
latentDangerBos
)
{
// if (latentDangerBo.getDangerLevel().equals(LatentDangerLevelEnum.重大隐患.getCode())) {
// return LatentDangerLevelEnum.重大隐患.getRiskSourceDangerLevelCode();
// }
}
int
code
=
latentDangerBos
.
stream
().
mapToInt
(
LatentDangerBo:
:
getDangerLevel
).
max
().
getAsInt
();
dangerLevel
=
LatentDangerLevelEnum
.
getByCode
(
code
).
getRiskSourceDangerLevelCode
();
return
dangerLevel
;
}
@Override
public
void
freshRiskJudgmentLangerCount
(
LatentDangerExcuteParam
latentDangerExcuteParam
)
{
Long
currentFlowRecordId
=
latentDangerExcuteParam
.
getFlowRecordId
();
LatentDangerFlowRecordBo
currentRecord
=
latentDangerFlowRecordMapper
.
getById
(
currentFlowRecordId
);
if
(
currentRecord
==
null
)
{
return
;
}
LatentDangerBo
latentDangerBo
=
latentDangerMapper
.
getById
(
currentRecord
.
getDangerId
());
if
(
latentDangerBo
==
null
)
{
return
;
}
LatentDangerPatrolBo
patrolBo
=
latentDangerPatrolMapper
.
getByDangerId
(
latentDangerBo
.
getId
());
if
(
patrolBo
!=
null
&&
StringUtil
.
isNotEmpty
(
patrolBo
.
getPointOriginalId
()))
{
iRiskJudgmentTaskService
.
freshRiskJudgmentLangerCount
(
Long
.
parseLong
(
patrolBo
.
getPointOriginalId
()));
}
}
@Override
public
Object
getDangerLevel
(
String
token
,
String
product
,
String
appKey
,
String
dictCode
)
{
JSONArray
jsonArray
=
remoteSecurityService
.
listDictionaryByDictCode
(
token
,
product
,
appKey
,
dictCode
);
return
jsonArray
;
}
@Override
public
JSONObject
getDangerLevelJsonObject
(
String
dangerLevelStr
,
String
token
,
String
product
,
String
appKey
,
String
dictCode
)
{
JSONArray
dangerLevelList
=
(
JSONArray
)
this
.
getDangerLevel
(
token
,
product
,
appKey
,
dictCode
);
JSONObject
dangerLevel
=
new
JSONObject
();
List
<
Object
>
objs
=
dangerLevelList
.
stream
().
filter
(
level
->
((
JSONObject
)
level
).
get
(
"dictDataKey"
).
equals
(
dangerLevelStr
)).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
objs
))
{
dangerLevel
=
(
JSONObject
)
objs
.
get
(
0
);
}
return
dangerLevel
;
}
@Override
public
JSONObject
getReviewInfo
(
Long
dangerId
)
{
List
<
HashMap
<
String
,
Object
>>
result
=
latentDangerMapper
.
getReViewInfo
(
dangerId
);
Set
<
String
>
userIdSet
=
Sets
.
newHashSet
();
result
.
forEach
(
r
->
{
userIdSet
.
add
((
String
)
r
.
get
(
"executeUserId"
));
if
(
StringUtil
.
isNotEmpty
(
r
.
get
(
"handleUserIds"
)))
{
List
<
String
>
handleUserIds
=
Arrays
.
asList
(
r
.
get
(
"handleUserIds"
).
toString
().
split
(
","
));
userIdSet
.
addAll
(
handleUserIds
);
}
});
userIdSet
.
removeAll
(
Collections
.
singleton
(
null
));
List
<
AgencyUserModel
>
userModels
=
remoteSecurityService
.
listUserByUserIds
(
Joiner
.
on
(
","
).
join
(
userIdSet
));
if
(
StringUtil
.
isNotEmpty
(
userModels
))
{
Map
<
String
,
AgencyUserModel
>
userMap
=
Maps
.
uniqueIndex
(
userModels
,
AgencyUserModel:
:
getUserId
);
result
.
forEach
(
r
->
{
r
.
put
(
"executeUserName"
,
StringUtil
.
isNotEmpty
(
r
.
get
(
"executeUserId"
))
?
userMap
.
get
(
r
.
get
(
"executeUserId"
)).
getRealName
()
:
""
);
List
<
String
>
handleUserNames
=
Lists
.
newArrayList
();
if
(
StringUtil
.
isNotEmpty
(
r
.
get
(
"handleUserIds"
)))
{
List
<
String
>
handleUserIds
=
Arrays
.
asList
(
r
.
get
(
"handleUserIds"
).
toString
().
split
(
","
));
handleUserIds
.
forEach
(
id
->
handleUserNames
.
add
(
userMap
.
get
(
id
).
getRealName
()));
}
r
.
put
(
"handleUserName"
,
Joiner
.
on
(
","
).
join
(
handleUserNames
));
});
}
JSONObject
resultObjJson
=
new
JSONObject
();
result
.
forEach
(
r
->
{
r
.
put
(
"flowJson"
,
JSON
.
parseObject
((
String
)
r
.
get
(
"flowJson"
)));
resultObjJson
.
put
((
String
)
r
.
get
(
"actionFlag"
),
JSONObject
.
toJSON
(
r
));
});
return
resultObjJson
;
}
@Override
public
Page
<
DangerListResponse
>
listDanger
(
PageParam
pageParam
)
{
String
idsStr
=
(
String
)
pageParam
.
get
(
"dangerIds"
);
if
(
StringUtil
.
isNotEmpty
(
idsStr
))
{
List
<
String
>
dangerIdList
=
Lists
.
newArrayList
(
idsStr
.
split
(
","
));
pageParam
.
put
(
"dangerIds"
,
dangerIdList
);
}
if
(
StringUtil
.
isNotEmpty
(
pageParam
.
get
(
"pageNumber"
))
&&
StringUtil
.
isNotEmpty
(
pageParam
.
get
(
"pageSize"
)))
{
int
offSet
=
(
int
)
pageParam
.
get
(
"pageNumber"
)
*
(
int
)
pageParam
.
get
(
"pageSize"
);
pageParam
.
put
(
"offset"
,
offSet
);
}
// 获取隐患地点的子节点
Object
structureId
=
pageParam
.
get
(
"structureId"
);
List
<
Long
>
structureIdList
=
null
;
if
(
structureId
!=
null
&&
structureId
.
toString
().
trim
().
length
()
>
0
)
{
LinkedHashMap
<
String
,
Object
>
o
=
equipFeign
.
getBuildingTree
();
if
(
o
==
null
||!
"200"
.
equals
(
o
.
get
(
"status"
).
toString
()))
{
throw
new
YeeException
(
"获取建筑树出错"
);
}
List
<
Map
<
String
,
Object
>>
buildingTree
=
(
List
<
Map
<
String
,
Object
>>)
o
.
get
(
"result"
);
Map
<
String
,
Object
>
node
=
getAllNodes
(
buildingTree
).
stream
().
filter
(
map
->
structureId
.
equals
(
map
.
get
(
"id"
))).
findFirst
().
orElse
(
null
);
if
(
node
!=
null
)
{
structureIdList
=
findBuildChildrenIds
(
node
);
}
}
pageParam
.
put
(
"structureId"
,
structureIdList
);
List
<
DangerListResponse
>
dangerListResponseList
=
latentDangerMapper
.
dangerListByMap
(
pageParam
);
Map
<
Long
,
String
>
buildingAbsolutePositionMap
=
new
HashMap
<>();
try
{
LinkedHashMap
<
String
,
Object
>
buildingAbsolutePosition
=
equipFeign
.
getBuildingAbsolutePosition
();
if
(
buildingAbsolutePosition
==
null
||
!
"200"
.
equals
(
buildingAbsolutePosition
.
get
(
"status"
).
toString
()))
{
throw
new
YeeException
(
"获取建筑树出错"
);
}
buildingAbsolutePositionMap
=
(
Map
<
Long
,
String
>)
buildingAbsolutePosition
.
get
(
"result"
);
}
catch
(
Exception
e
)
{
}
if
(!
dangerListResponseList
.
isEmpty
())
{
Map
<
Long
,
String
>
finalBuildingAbsolutePositionMap
=
buildingAbsolutePositionMap
;
dangerListResponseList
.
forEach
(
danger
->
danger
.
setStructureName
(
finalBuildingAbsolutePositionMap
.
get
(
danger
.
getStructureId
())));
}
Long
count
=
latentDangerMapper
.
countDangerListByMap
(
pageParam
);
if
(
CollectionUtils
.
isEmpty
(
dangerListResponseList
))
{
return
new
PageImpl
<>(
dangerListResponseList
,
pageParam
,
0L
);
}
return
new
PageImpl
<>(
dangerList
(
dangerListResponseList
),
pageParam
,
count
);
}
private
List
<
Map
<
String
,
Object
>>
getAllNodes
(
List
<
Map
<
String
,
Object
>>
buildingTree
)
{
List
<
Map
<
String
,
Object
>>
res
=
new
LinkedList
<>();
if
(
buildingTree
!=
null
&&
!
buildingTree
.
isEmpty
())
{
res
.
addAll
(
buildingTree
);
buildingTree
.
forEach
(
building
->
{
List
<
Map
<
String
,
Object
>>
childrenTree
=
(
List
<
Map
<
String
,
Object
>>)
building
.
get
(
"children"
);
res
.
addAll
(
getAllNodes
(
childrenTree
));
});
}
return
res
;
}
private
List
<
Long
>
findBuildChildrenIds
(
Map
<
String
,
Object
>
building
)
{
List
<
Map
<
String
,
Object
>>
buildingTree
=
getAllNodes
(
Collections
.
singletonList
(
building
));
return
buildingTree
.
stream
().
map
(
building123
->
Long
.
valueOf
(
building123
.
get
(
"id"
).
toString
())).
collect
(
Collectors
.
toList
());
}
@Override
public
List
<
DangerListResponse
>
export
(
PageParam
pageParam
)
{
String
idsStr
=
(
String
)
pageParam
.
get
(
"dangerIds"
);
if
(
StringUtil
.
isNotEmpty
(
idsStr
))
{
List
<
String
>
dangerIdList
=
Lists
.
newArrayList
(
idsStr
.
split
(
","
));
pageParam
.
put
(
"dangerIds"
,
dangerIdList
);
}
List
<
DangerListResponse
>
dangerListResponseList
=
latentDangerMapper
.
dangerListByMap
(
pageParam
);
return
dangerList
(
dangerListResponseList
);
}
@Override
public
List
<
DangerTimeAxisVo
>
queryExecuteLog
(
Integer
dateTime
)
{
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
// String endTime = com.yeejoin.amos.maintenance.core.util.DateUtil.getShortCurrentDate();
String
beginTime
=
""
;
if
(
dateTime
!=
null
&&
dateTime
==
7
)
{
beginTime
=
com
.
yeejoin
.
amos
.
maintenance
.
core
.
util
.
DateUtil
.
getIntervalDateStr
(
new
Date
(),
-
7
,
"yyyy-MM-dd"
);
}
else
if
(
dateTime
!=
null
&&
dateTime
==
30
)
{
beginTime
=
com
.
yeejoin
.
amos
.
maintenance
.
core
.
util
.
DateUtil
.
getIntervalDateStr
(
new
Date
(),
-
30
,
"yyyy-MM-dd"
);
}
else
{
beginTime
=
com
.
yeejoin
.
amos
.
maintenance
.
core
.
util
.
DateUtil
.
getShortCurrentDate
();
}
param
.
put
(
"beginTime"
,
beginTime
+
" 00:00:00"
);
// param.put("endTime",endTime + " 23:59:59");
List
<
DangerTimeAxisVo
>
list
=
latentDangerFlowRecordMapper
.
listExecuteLog
(
param
);
String
d
;
if
(
0
<
list
.
size
())
{
for
(
DangerTimeAxisVo
vo
:
list
)
{
AgencyUserModel
userModel
=
remoteSecurityService
.
getUserById
(
RequestContext
.
getToken
(),
getProduct
(),
RequestContext
.
getAppKey
(),
vo
.
getExecuteUserId
().
toString
());
vo
.
setUserName
(
userModel
.
getRealName
());
vo
.
setDangerState
(
LatentDangerStateEnum
.
getEnumName
(
Integer
.
valueOf
(
vo
.
getDangerState
())));
vo
.
setXAxis
(
null
==
vo
.
getUpdateDate
()
?
DateUtil
.
getDateFormat
(
new
Date
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
)
:
DateUtil
.
getDateFormat
(
vo
.
getUpdateDate
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
));
vo
.
setRow1
(
vo
.
getUserName
()
+
"-"
+
vo
.
getDangerState
()
+
"-"
+
vo
.
getDangerName
());
if
(
"3"
.
equals
(
vo
.
getReformType
()))
{
d
=
null
==
vo
.
getDelayLimitDate
()
?
"无"
:
DateUtil
.
getDateFormat
(
vo
.
getDelayLimitDate
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
);
}
else
{
d
=
null
==
vo
.
getReformLimitDate
()
?
"无"
:
DateUtil
.
getDateFormat
(
vo
.
getReformLimitDate
(),
DateUtil
.
DATETIME_DEFAULT_FORMAT
);
}
vo
.
setRow2
(
vo
.
getStructureName
()
+
"-"
+
d
);
}
}
return
list
;
}
private
List
<
DangerListResponse
>
dangerList
(
List
<
DangerListResponse
>
dangerListResponseList
)
{
JSONArray
array
=
remoteSecurityService
.
listDictionaryByDictCode
(
RequestContext
.
getToken
(),
getProduct
(),
RequestContext
.
getAppKey
(),
DictTypeEnum
.
DANGERLEVEL
.
getCode
());
List
<
DictBo
>
dangerLevelList
=
JSONArray
.
parseArray
(
array
.
toJSONString
(),
DictBo
.
class
);
for
(
DangerListResponse
e
:
dangerListResponseList
)
{
e
.
setDangerState
(
LatentDangerStateEnum
.
getEnumName
(
Integer
.
valueOf
(
e
.
getDangerState
())));
DictBo
dangerLevel
=
dangerLevelList
.
stream
().
filter
(
item
->
item
.
getDictDataKey
().
equals
(
e
.
getDangerLevel
())).
collect
(
Collectors
.
toList
()).
get
(
0
);
e
.
setDangerLevel
(
dangerLevel
.
getDictDataValue
());
e
.
setReformType
(!
StringUtil
.
isNotEmpty
(
e
.
getReformType
())
?
""
:
LatentDangerReformTypeEnum
.
getByCode
(
Integer
.
valueOf
(
e
.
getReformType
())).
getName
());
e
.
setOvertimeState
(
"0"
.
equals
(
e
.
getOvertimeState
())
?
"否"
:
"是"
);
e
.
setDangerTypeName
(
LatentDangerTypeEnum
.
getEnumName
(
Integer
.
valueOf
(
e
.
getDangerType
())));
e
.
setDeadline
(
null
==
e
.
getDeadlineDate
()
?
""
:
DateUtil
.
getLongDate
(
e
.
getDeadlineDate
()));
}
return
dangerListResponseList
;
}
//获取下一节点需要发消息的用户信息
public
String
getNextExecuteUsers
(
String
instanceId
)
{
String
informerList
=
""
;
JSONObject
object
=
remoteWorkFlowService
.
getChildNodeDetail
(
instanceId
);
if
(
object
!=
null
){
JSONArray
array
=
object
.
getJSONArray
(
"data"
);
if
(
array
.
size
()>
0
){
JSONObject
workFlowDetail
=
array
.
getJSONObject
(
0
);
informerList
=
workFlowDetail
.
getString
(
"informerList"
);
}
}
return
informerList
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/PlanTaskServiceImpl.java
View file @
2f554c53
...
...
@@ -1022,6 +1022,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
facility
.
put
(
"pointNo"
,
point
.
getPointNo
());
facility
.
put
(
"position"
,
point
.
getBuildingName
()
+
point
.
getAddress
());
facility
.
put
(
"userName"
,
planTask
.
getUserName
());
facility
.
put
(
"planTaskId"
,
planTask
.
getId
());
facility
.
put
(
"riskAndManage"
,
point
.
getRemark
());
return
facility
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/RiskJudgmentTaskServiceImpl.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
impl
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
org.assertj.core.util.Sets
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.DepartmentBo
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.maintenance.business.constants.XJConstant
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.LatentDangerMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.RiskFactorMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.RiskJudgmentFillRecordMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.RiskJudgmentItemMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.RiskJudgmentTaskMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.RiskSourceMapper
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.TaskworkMapper
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentFillRecordBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentItemBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentTaskBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.RiskSourceBo
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IRiskJudgmentTaskService
;
import
com.yeejoin.amos.maintenance.business.util.RandomUtil
;
import
com.yeejoin.amos.maintenance.business.util.StringUtil
;
import
com.yeejoin.amos.maintenance.common.enums.BooleanEnum
;
import
com.yeejoin.amos.maintenance.common.enums.RiskJudgeTaskworkTypeEnum
;
import
com.yeejoin.amos.maintenance.common.enums.RiskJudgmentSelectStatusEnum
;
import
com.yeejoin.amos.maintenance.common.enums.RiskJudgmentStatusEnum
;
import
com.yeejoin.amos.maintenance.common.enums.RiskJudgmentTaskStatusEnum
;
import
com.yeejoin.amos.maintenance.common.enums.RiskLevelEnum
;
import
com.yeejoin.amos.maintenance.common.enums.TaskworkTypeEnum
;
import
com.yeejoin.amos.maintenance.common.enums.WorkFlowDefinitionKeyEnum
;
import
com.yeejoin.amos.maintenance.common.remote.RemoteWorkFlowService
;
import
com.yeejoin.amos.maintenance.core.async.AsyncTask
;
import
com.yeejoin.amos.maintenance.core.util.DateUtil
;
import
com.yeejoin.amos.maintenance.feign.RemoteSecurityService
;
@Service
(
"iSpcRiskJudgmentTaskService"
)
public
class
RiskJudgmentTaskServiceImpl
implements
IRiskJudgmentTaskService
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RiskJudgmentTaskServiceImpl
.
class
);
@Autowired
private
RiskJudgmentTaskMapper
riskJudgmentTaskMapper
;
@Autowired
private
RiskSourceMapper
riskSourceMapper
;
@Autowired
private
RiskJudgmentItemMapper
riskJudgmentItemMapper
;
@Autowired
private
RiskJudgmentFillRecordMapper
riskJudgmentFillRecordMapper
;
@Autowired
private
RiskFactorMapper
riskFactorMapper
;
@Autowired
private
LatentDangerMapper
latentDangerMapper
;
@Autowired
private
TaskworkMapper
taskworkMapper
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
RemoteWorkFlowService
remoteWorkFlowService
;
@Autowired
private
AsyncTask
asyncTask
;
private
static
final
String
permissionType
=
"activitiItem"
;
@Override
public
void
initRiskJudgmentTask
(
Date
date
)
{
List
<
CompanyBo
>
companyBoList
=
remoteSecurityService
.
listCompanyTree
();
if
(
CollectionUtils
.
isEmpty
(
companyBoList
))
{
return
;
}
List
<
CompanyBo
>
companyBos
=
Lists
.
newArrayList
();
writeCompany
(
companyBoList
,
companyBos
);
Map
<
String
,
String
>
deptWorkflowMap
=
buildDeptWorkflowMap
(
RequestContext
.
getToken
(),
RequestContext
.
getProduct
(),
RequestContext
.
getAppKey
());
for
(
CompanyBo
c
:
companyBos
)
{
List
<
DepartmentBo
>
departmentBos
=
Lists
.
newArrayList
();
String
companyId
=
c
.
getSequenceNbr
().
toString
();
List
<
DepartmentBo
>
list
=
remoteSecurityService
.
getDepartmentTreeByCompanyId
(
companyId
);
writeDepartment
(
list
,
departmentBos
);
if
(
CollectionUtils
.
isEmpty
(
departmentBos
))
{
continue
;
}
JSONObject
body
=
new
JSONObject
();
String
businessKey
=
RandomUtil
.
buildOrderNo
();
body
.
put
(
"processDefinitionKey"
,
WorkFlowDefinitionKeyEnum
.
风险研判评审
.
getProcessDefinitionKey
());
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"companyId"
,
c
.
getSequenceNbr
());
JSONObject
startJson
=
remoteWorkFlowService
.
startWithAppKey
(
body
);
if
(
startJson
==
null
)
{
logger
.
error
(
c
.
getCompanyName
()
+
"启动风险研判流程失败"
);
continue
;
}
JSONObject
dataList
=
startJson
.
getJSONObject
(
"dataList"
);
String
instanceId
=
dataList
.
getJSONObject
(
"historicInstance"
).
getString
(
"id"
);
JSONArray
taskInstances
=
dataList
.
getJSONArray
(
"taskInstances"
);
Map
<
String
,
JSONObject
>
taskDefinitionKeyMap
=
buildTaskDefinitionKeyMap
(
taskInstances
);
for
(
DepartmentBo
departmentBo
:
departmentBos
)
{
JSONObject
taskInstance
=
getTaskInstanceByDeptCode
(
departmentBo
.
getDepartmentCode
(),
taskDefinitionKeyMap
,
deptWorkflowMap
);
if
(
taskInstance
!=
null
)
{
List
<
RiskJudgmentItemBo
>
items
=
riskJudgmentItemMapper
.
listAllItemByDepartmentCode
(
departmentBo
.
getDepartmentCode
());
if
(
CollectionUtils
.
isEmpty
(
items
))
{
logger
.
error
(
"初始化风险研判任务失败,检查项表未配置该部门,部门编号===================>"
+
departmentBo
.
getSequenceNbr
());
continue
;
}
boolean
success
=
initRiskJudgment
(
taskInstance
,
departmentBo
,
date
,
items
,
c
.
getOrgCode
(),
companyId
,
instanceId
,
businessKey
);
if
(!
success
)
{
logger
.
error
(
"初始化风险研判任务失败,部门编号===================>"
+
departmentBo
.
getSequenceNbr
());
}
}
}
}
}
private
JSONObject
getTaskInstanceByDeptCode
(
String
departmentCode
,
Map
<
String
,
JSONObject
>
taskDefinitionKeyMap
,
Map
<
String
,
String
>
deptWorkflowMap
)
{
return
taskDefinitionKeyMap
.
get
(
deptWorkflowMap
.
get
(
departmentCode
));
}
private
Map
<
String
,
String
>
buildDeptWorkflowMap
(
String
token
,
String
product
,
String
appKey
)
{
Map
<
String
,
String
>
deptWorkflowMap
=
Maps
.
newHashMap
();
JSONArray
deptWorkflowArray
=
remoteSecurityService
.
listDictionaryByDictCode
(
token
,
product
,
appKey
,
XJConstant
.
DEPT_WF_MAP_DIC_CODE
);
for
(
int
i
=
0
;
i
<
deptWorkflowArray
.
size
();
i
++)
{
JSONObject
deptWorkJson
=
deptWorkflowArray
.
getJSONObject
(
i
);
deptWorkflowMap
.
put
(
deptWorkJson
.
getString
(
"dictDataKey"
),
deptWorkJson
.
getString
(
"dictDataValue"
));
}
return
deptWorkflowMap
;
}
private
Map
<
String
,
JSONObject
>
buildTaskDefinitionKeyMap
(
JSONArray
arr
)
{
Map
<
String
,
JSONObject
>
map
=
Maps
.
newHashMap
();
for
(
int
i
=
0
;
i
<
arr
.
size
();
i
++)
{
JSONObject
object
=
arr
.
getJSONObject
(
i
);
map
.
put
(
object
.
getString
(
"taskDefinitionKey"
),
object
);
}
return
map
;
}
private
boolean
initRiskJudgment
(
JSONObject
taskInstance
,
DepartmentBo
departmentBo
,
Date
date
,
List
<
RiskJudgmentItemBo
>
items
,
String
orgCode
,
String
companyId
,
String
instanceId
,
String
businessKey
)
{
try
{
RiskJudgmentTaskBo
riskJudgmentTaskBo
=
new
RiskJudgmentTaskBo
();
String
currentFlowTaskId
=
taskInstance
.
getString
(
"id"
);
String
taskDefinitionKey
=
taskInstance
.
getString
(
"taskDefinitionKey"
);
// 获取该departmentBo部门具有研判审批权限的用户ID
String
reviewUserIds
=
getUserIds
(
taskDefinitionKey
,
companyId
,
departmentBo
.
getSequenceNbr
().
toString
());
riskJudgmentTaskBo
.
setBusinessKey
(
businessKey
);
riskJudgmentTaskBo
.
setFlowInstanceId
(
instanceId
);
riskJudgmentTaskBo
.
setTaskStatus
(
RiskJudgmentStatusEnum
.
未开始
.
getCode
());
riskJudgmentTaskBo
.
setTaskDefinitionKey
(
taskDefinitionKey
);
riskJudgmentTaskBo
.
setCurrentFlowTaskId
(
currentFlowTaskId
);
riskJudgmentTaskBo
.
setFlowUserIds
(
reviewUserIds
);
riskJudgmentTaskBo
.
setTaskName
(
"风险研判任务"
);
riskJudgmentTaskBo
.
setDepartmentId
(
departmentBo
.
getSequenceNbr
().
toString
());
riskJudgmentTaskBo
.
setTaskDate
(
date
);
riskJudgmentTaskBo
.
setOrgCode
(
orgCode
);
riskJudgmentTaskMapper
.
save
(
riskJudgmentTaskBo
);
List
<
RiskJudgmentFillRecordBo
>
records
=
Lists
.
newArrayList
();
for
(
RiskJudgmentItemBo
item
:
items
)
{
RiskJudgmentFillRecordBo
record
=
new
RiskJudgmentFillRecordBo
();
record
.
setTaskId
(
riskJudgmentTaskBo
.
getId
());
record
.
setItemId
(
item
.
getId
());
String
selectResultStr
=
null
;
if
(
item
.
getSelectIsNeed
().
equals
(
BooleanEnum
.
YES
.
getCode
()))
{
StringBuilder
selectResult
=
new
StringBuilder
();
JSONArray
arr
=
JSONArray
.
parseArray
(
item
.
getSelectJson
());
for
(
int
i
=
0
;
i
<
arr
.
size
();
i
++)
{
JSONObject
jsonObject
=
arr
.
getJSONObject
(
i
);
if
(
jsonObject
.
getBoolean
(
"defaultSelect"
))
{
selectResult
.
append
(
jsonObject
.
getString
(
"id"
)).
append
(
","
);
}
}
if
(
selectResult
.
length
()
>
0
)
{
selectResultStr
=
selectResult
.
substring
(
0
,
selectResult
.
length
()
-
1
);
}
}
record
.
setSelectResult
(
selectResultStr
);
Long
count
=
getCount
(
item
.
getItemFlag
(),
departmentBo
.
getSequenceNbr
().
toString
());
if
(
count
!=
null
)
{
//数量回显
record
.
setInputResult
(
String
.
valueOf
(
count
));
}
String
defaultSelectId
=
getDefaultSelectId
(
item
.
getItemFlag
(),
departmentBo
.
getSequenceNbr
().
toString
());
if
(
defaultSelectId
!=
null
)
{
//作业活动是否可控回显
record
.
setSelectResult
(
defaultSelectId
);
}
record
.
setOrgCode
(
orgCode
);
records
.
add
(
record
);
}
riskJudgmentFillRecordMapper
.
saveBatch
(
records
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"风险研判填写记录表初始化失败"
);
return
false
;
}
return
true
;
}
private
String
getDefaultSelectId
(
String
itemFlag
,
String
deptId
)
{
String
defaultSelectId
=
null
;
Long
count
=
null
;
switch
(
itemFlag
)
{
case
"danger_work_control_a"
:
//重大工艺操作
count
=
taskworkMapper
.
countViolateState
(
TaskworkTypeEnum
.
重大工艺操作
.
getCode
(),
deptId
);
break
;
case
"danger_work_control_b"
:
//检维修作业
count
=
taskworkMapper
.
countViolateState
(
TaskworkTypeEnum
.
检维修作业
.
getCode
(),
deptId
);
break
;
case
"danger_work_control_c"
:
//特殊动火作业
count
=
taskworkMapper
.
countViolateState
(
TaskworkTypeEnum
.
特殊动火作业
.
getCode
(),
deptId
);
break
;
case
"danger_work_control_d"
:
//一级动火作业
count
=
taskworkMapper
.
countViolateState
(
TaskworkTypeEnum
.
一级动火作业
.
getCode
(),
deptId
);
break
;
case
"danger_work_control_e"
:
//二级动火作业
count
=
taskworkMapper
.
countViolateState
(
TaskworkTypeEnum
.
二级动火作业
.
getCode
(),
deptId
);
break
;
case
"danger_work_control_f"
:
//进入受限空间作业
count
=
taskworkMapper
.
countViolateState
(
TaskworkTypeEnum
.
进入受限空间作业
.
getCode
(),
deptId
);
break
;
default
:
break
;
}
if
(
count
!=
null
&&
count
>
0
)
{
defaultSelectId
=
RiskJudgmentSelectStatusEnum
.
不可控
.
getCode
();
//不可控
}
else
if
(
count
!=
null
&&
count
==
0
)
{
defaultSelectId
=
RiskJudgmentSelectStatusEnum
.
可控
.
getCode
();
//可控
}
return
defaultSelectId
;
}
private
String
getUserIds
(
String
path
,
String
companyId
,
String
departmentId
)
{
String
reviewUserIds
=
""
;
List
<
AgencyUserModel
>
userModels
=
remoteSecurityService
.
listUserByMenuCode
(
permissionType
,
path
);
if
(!
CollectionUtils
.
isEmpty
(
userModels
))
{
List
<
String
>
userIds
=
Lists
.
newArrayList
();
for
(
AgencyUserModel
userModel
:
userModels
)
{
String
userId
=
getUserIdIsInDepartmentId
(
departmentId
,
userModel
,
companyId
);
if
(
userId
!=
null
)
{
userIds
.
add
(
userId
);
}
}
if
(!
CollectionUtils
.
isEmpty
(
userIds
))
{
reviewUserIds
=
Joiner
.
on
(
","
).
join
(
userIds
);
}
}
return
reviewUserIds
;
}
private
String
getUserIdIsInDepartmentId
(
String
departmentId
,
AgencyUserModel
userModel
,
String
companyId
)
{
Map
<
Long
,
List
<
DepartmentModel
>>
companyDepartments
=
userModel
.
getCompanyDepartments
();
List
<
DepartmentModel
>
departments
=
companyDepartments
.
get
(
Long
.
valueOf
(
companyId
));
if
(!
CollectionUtils
.
isEmpty
(
departments
))
{
for
(
DepartmentModel
departmentModel
:
departments
)
{
if
(
departmentModel
.
getSequenceNbr
().
toString
().
equals
(
departmentId
))
{
return
userModel
.
getUserId
();
}
}
}
return
null
;
}
public
Long
getCount
(
String
flag
,
String
deptId
)
{
Long
count
=
null
;
switch
(
flag
)
{
case
"other_latent_danger_state_"
:
//安全问题--
count
=
latentDangerMapper
.
countNotFinishByTypeAndDeptId
(
0
,
deptId
);
break
;
case
"other_latent_danger_state_a"
:
//一般隐患--
count
=
latentDangerMapper
.
countNotFinishByTypeAndDeptId
(
1
,
deptId
);
break
;
case
"other_latent_danger_state_b"
:
//重大隐患--
count
=
latentDangerMapper
.
countNotFinishByTypeAndDeptId
(
2
,
deptId
);
break
;
case
"other_latent_danger_state_c"
:
//重大风险-1级
count
=
riskFactorMapper
.
countByLevelCodeAndDeptId
(
RiskLevelEnum
.
level_1
.
getCode
(),
deptId
);
break
;
case
"other_latent_danger_state_d"
:
//较大风险-2级
count
=
riskFactorMapper
.
countByLevelCodeAndDeptId
(
RiskLevelEnum
.
level_2
.
getCode
(),
deptId
);
break
;
case
"other_latent_danger_state_e"
:
//一般风险-3级
count
=
riskFactorMapper
.
countByLevelCodeAndDeptId
(
RiskLevelEnum
.
level_3
.
getCode
(),
deptId
);
break
;
case
"other_latent_danger_state_f"
:
//低风险-4级
count
=
riskFactorMapper
.
countByLevelCodeAndDeptId
(
RiskLevelEnum
.
level_4
.
getCode
(),
deptId
);
break
;
case
"danger_work_control_a"
:
//重大工艺操作
count
=
taskworkMapper
.
countByTypeAndDeptId
(
TaskworkTypeEnum
.
重大工艺操作
.
getCode
(),
deptId
);
break
;
case
"danger_work_control_b"
:
//检维修作业
count
=
taskworkMapper
.
countByTypeAndDeptId
(
TaskworkTypeEnum
.
检维修作业
.
getCode
(),
deptId
);
break
;
case
"danger_work_control_c"
:
//特殊动火作业
count
=
taskworkMapper
.
countByTypeAndDeptId
(
TaskworkTypeEnum
.
特殊动火作业
.
getCode
(),
deptId
);
break
;
case
"danger_work_control_d"
:
//一级动火作业
count
=
taskworkMapper
.
countByTypeAndDeptId
(
TaskworkTypeEnum
.
一级动火作业
.
getCode
(),
deptId
);
break
;
case
"danger_work_control_e"
:
//二级动火作业
count
=
taskworkMapper
.
countByTypeAndDeptId
(
TaskworkTypeEnum
.
二级动火作业
.
getCode
(),
deptId
);
break
;
case
"danger_work_control_f"
:
//进入受限空间作业
count
=
taskworkMapper
.
countByTypeAndDeptId
(
TaskworkTypeEnum
.
进入受限空间作业
.
getCode
(),
deptId
);
break
;
default
:
break
;
}
return
count
;
}
private
void
writeCompany
(
List
<
CompanyBo
>
tree
,
List
<
CompanyBo
>
companyBos
)
{
tree
.
forEach
(
d
->
{
companyBos
.
add
(
d
);
if
(!
CollectionUtils
.
isEmpty
(
d
.
getChildren
()))
{
writeCompany
(
d
.
getChildren
(),
companyBos
);
}
});
}
private
void
writeDepartment
(
List
<
DepartmentBo
>
tree
,
List
<
DepartmentBo
>
departmentBos
)
{
tree
.
forEach
(
d
->
{
if
(
d
.
getLevel
().
equals
(
"shop"
))
{
departmentBos
.
add
(
d
);
}
if
(!
CollectionUtils
.
isEmpty
(
d
.
getChildren
()))
{
writeDepartment
(
d
.
getChildren
(),
departmentBos
);
}
});
}
@Override
public
void
updateRiskJudgmentTaskToOverTime
(
Date
date
)
{
String
dateStr
=
DateUtil
.
formatDatrToStr
(
date
,
DateUtil
.
SHORT_PATTERN
);
RiskJudgmentTaskStatusEnum
statusEnum
=
RiskJudgmentTaskStatusEnum
.
已超时
;
List
<
RiskJudgmentTaskBo
>
taskBos
=
riskJudgmentTaskMapper
.
listByDateAndStatus
(
dateStr
,
RiskJudgmentTaskStatusEnum
.
进行中
.
getCode
());
taskBos
.
forEach
(
e
->
{
e
.
setTaskStatus
(
statusEnum
.
getCode
());
try
{
String
cdate
=
DateUtil
.
formatDatrToStr
(
e
.
getTaskDate
(),
"yyyy年MM月dd日"
);
String
userIds
=
e
.
getFlowUserIds
();
Set
<
String
>
userIdSet
=
Sets
.
newHashSet
(
Arrays
.
asList
(
userIds
.
split
(
","
)));
List
<
AgencyUserModel
>
reviewUserModels
=
remoteSecurityService
.
listUserByMenuCode
(
permissionType
,
e
.
getTaskDefinitionKey
()
+
"_1"
);
List
<
AgencyUserModel
>
companyReviewUserModels
=
remoteSecurityService
.
listUserByMenuCode
(
permissionType
,
"G_9"
);
if
(!
CollectionUtils
.
isEmpty
(
reviewUserModels
))
{
userIdSet
.
addAll
(
Lists
.
transform
(
reviewUserModels
,
AgencyUserModel:
:
getUserId
));
}
if
(!
CollectionUtils
.
isEmpty
(
companyReviewUserModels
))
{
userIdSet
.
addAll
(
Lists
.
transform
(
companyReviewUserModels
,
AgencyUserModel:
:
getUserId
));
}
DepartmentBo
departmentBo
=
remoteSecurityService
.
getDepartmentByDeptId
(
e
.
getDepartmentId
());
asyncTask
.
pushRiskJudgmentMessage
(
this
.
getNextExecuteUsers
(
e
.
getFlowInstanceId
()),
e
.
getOrgCode
(),
e
.
getTaskName
(),
cdate
,
departmentBo
.
getDepartmentName
(),
statusEnum
.
getName
(),
e
.
getId
(),
statusEnum
.
getCode
());
}
catch
(
Exception
ex
)
{
logger
.
error
(
"风险研判推送异常"
,
ex
);
}
});
if
(
taskBos
.
size
()
>
0
)
{
riskJudgmentTaskMapper
.
updateBatch
(
taskBos
);
}
}
@Override
public
void
updateRiskJudgmentTaskToProcess
(
Date
date
)
{
String
dateStr
=
DateUtil
.
formatDatrToStr
(
date
,
DateUtil
.
SHORT_PATTERN
);
RiskJudgmentTaskStatusEnum
statusEnum
=
RiskJudgmentTaskStatusEnum
.
进行中
;
List
<
RiskJudgmentTaskBo
>
taskBos
=
riskJudgmentTaskMapper
.
listByDateAndStatus
(
dateStr
,
RiskJudgmentTaskStatusEnum
.
未开始
.
getCode
());
taskBos
.
forEach
(
e
->
{
e
.
setTaskStatus
(
statusEnum
.
getCode
());
try
{
String
cdate
=
DateUtil
.
formatDatrToStr
(
e
.
getTaskDate
(),
"yyyy年MM月dd日"
);
DepartmentBo
departmentBo
=
remoteSecurityService
.
getDepartmentByDeptId
(
e
.
getDepartmentId
());
Set
<
String
>
userIds
=
Sets
.
newHashSet
(
Arrays
.
asList
(
e
.
getFlowUserIds
().
split
(
","
)));
asyncTask
.
pushRiskJudgmentMessage
(
this
.
getNextExecuteUsers
(
e
.
getFlowInstanceId
()),
e
.
getOrgCode
(),
e
.
getTaskName
(),
cdate
,
departmentBo
.
getDepartmentName
(),
statusEnum
.
getName
(),
e
.
getId
(),
e
.
getTaskStatus
());
}
catch
(
Exception
ex
)
{
logger
.
error
(
"风险研判推送异常"
,
ex
);
}
});
if
(
taskBos
.
size
()
>
0
)
{
riskJudgmentTaskMapper
.
updateBatch
(
taskBos
);
}
}
@Override
public
void
freshRiskJudgmentLangerCount
(
Long
riskSourceId
)
{
RiskSourceBo
riskSource
=
riskSourceMapper
.
getById
(
riskSourceId
);
if
(
riskSource
!=
null
&&
StringUtil
.
isNotEmpty
(
riskSource
.
getBelongDepartmentId
()))
{
Long
count1
=
latentDangerMapper
.
countNotFinishByTypeAndDeptId
(
1
,
riskSource
.
getBelongDepartmentId
());
Long
count2
=
latentDangerMapper
.
countNotFinishByTypeAndDeptId
(
2
,
riskSource
.
getBelongDepartmentId
());
Long
count0
=
latentDangerMapper
.
countNotFinishByTypeAndDeptId
(
0
,
riskSource
.
getBelongDepartmentId
());
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"departmentId"
,
riskSource
.
getBelongDepartmentId
());
map
.
put
(
"inputResult"
,
count1
);
map
.
put
(
"taskStatus"
,
RiskJudgmentTaskStatusEnum
.
进行中
.
getCode
());
map
.
put
(
"itemFlag"
,
"other_latent_danger_state_a"
);
riskJudgmentFillRecordMapper
.
updateInputResultAndselectResult
(
map
);
//更新一般隐患数量
map
.
put
(
"inputResult"
,
count2
);
map
.
put
(
"itemFlag"
,
"other_latent_danger_state_b"
);
riskJudgmentFillRecordMapper
.
updateInputResultAndselectResult
(
map
);
//更新重大隐患数量
map
.
put
(
"inputResult"
,
count0
);
map
.
put
(
"itemFlag"
,
"other_latent_danger_state_z"
);
riskJudgmentFillRecordMapper
.
updateInputResultAndselectResult
(
map
);
//更新安全问题数量
}
}
@Override
public
void
freshRiskJudgmentTaskwork
(
String
deptId
)
{
//循环更新riskJudgmentFillRecordMapper 的 select_result and input_result
Long
count
=
0L
;
String
defaultSelectId
=
null
;
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
for
(
RiskJudgeTaskworkTypeEnum
eum
:
RiskJudgeTaskworkTypeEnum
.
values
())
{
count
=
getCount
(
eum
.
getIntemFlag
(),
deptId
);
//查询条件: 部门 + 类型
defaultSelectId
=
getDefaultSelectId
(
eum
.
getIntemFlag
(),
deptId
);
//查询条件: 部门 + 类型
paramMap
.
clear
();
paramMap
.
put
(
"departmentId"
,
deptId
);
paramMap
.
put
(
"inputResult"
,
count
);
paramMap
.
put
(
"selectResult"
,
defaultSelectId
);
paramMap
.
put
(
"taskStatus"
,
RiskJudgmentTaskStatusEnum
.
进行中
.
getCode
());
paramMap
.
put
(
"itemFlag"
,
eum
.
getIntemFlag
());
riskJudgmentFillRecordMapper
.
updateInputResultAndselectResult
(
paramMap
);
}
}
//获取下一节点需要发消息的用户信息
public
String
getNextExecuteUsers
(
String
instanceId
)
{
String
informerList
=
""
;
JSONObject
object
=
remoteWorkFlowService
.
getChildNodeDetail
(
instanceId
);
if
(
object
!=
null
){
JSONArray
array
=
object
.
getJSONArray
(
"data"
);
JSONObject
workFlowDetail
=
array
.
getJSONObject
(
0
);
informerList
=
workFlowDetail
.
getString
(
"informerList"
);
}
return
informerList
;
}
}
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 @
2f554c53
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
intfc
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
org.springframework.data.domain.Page
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.yeejoin.amos.boot.biz.common.bo.DepartmentBo
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.maintenance.business.dto.CheckDto
;
import
com.yeejoin.amos.maintenance.business.dto.CheckRecordDto
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.CheckDetailBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.CheckInfoBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.CheckInputBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.CheckTraListBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.CheckUserBo
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.PlanRoutePointBo
;
import
com.yeejoin.amos.maintenance.business.param.CheckInfoListPageParam
;
import
com.yeejoin.amos.maintenance.business.param.CheckInfoPageParam
;
import
com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam
;
import
com.yeejoin.amos.maintenance.business.param.CheckRecordParam
;
import
com.yeejoin.amos.maintenance.business.param.CheckStatisticalParam
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.*
;
import
com.yeejoin.amos.maintenance.business.param.*
;
import
com.yeejoin.amos.maintenance.business.util.CheckDetailInputPageParam
;
import
com.yeejoin.amos.maintenance.business.util.Toke
;
import
com.yeejoin.amos.maintenance.business.vo.CheckAnalysisVo
;
import
com.yeejoin.amos.maintenance.business.vo.CheckInfoVo
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonPageable
;
import
com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone
;
import
com.yeejoin.amos.maintenance.core.common.response.CommonPage
;
import
com.yeejoin.amos.maintenance.core.common.response.GraphInitDataResponse
;
import
com.yeejoin.amos.maintenance.core.common.response.QueryCriteriaRespone
;
import
com.yeejoin.amos.maintenance.dao.entity.CheckShot
;
import
com.yeejoin.amos.maintenance.exception.YeeException
;
import
org.springframework.data.domain.Page
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
interface
ICheckService
{
/**
...
...
@@ -269,6 +256,9 @@ public interface ICheckService {
*/
Map
<
String
,
CheckRecordDto
>
obtainLastCheckRecord
(
String
[]
relationId
);
Page
<
HashMap
<
String
,
Object
>>
getCheckPage
(
HashMap
<
String
,
Object
>
map
,
CommonPageable
pageable
);
Map
<
String
,
Object
>
getCheckDetail
(
String
id
);
/**
* 校验是否已经填写过
* @param planTaskId
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/intfc/ILatentDangerService.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
intfc
;
import
java.util.List
;
import
org.springframework.data.domain.Page
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.maintenance.business.dto.DangerExecuteSubmitDto
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerExcuteParam
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerListParam
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerNormalParam
;
import
com.yeejoin.amos.maintenance.business.param.LatentDangerPatrolParam
;
import
com.yeejoin.amos.maintenance.business.param.PageParam
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponse
;
import
com.yeejoin.amos.maintenance.business.vo.DangerTimeAxisVo
;
import
com.yeejoin.amos.maintenance.core.common.response.DangerListResponse
;
/**
* @author keyong
* @title: ILatentDangerService
* <pre>
* @description: TODO
* </pre>
* @date 2021/1/26 14:44
*/
public
interface
ILatentDangerService
{
CommonResponse
saveNormal
(
LatentDangerNormalParam
latentDangerParam
,
String
userId
,
String
userRealName
,
String
departmentId
,
String
departmentName
,
String
companyId
,
String
orgCode
,
RoleBo
role
);
CommonResponse
savePatrol
(
LatentDangerPatrolParam
latentDangerPatrolParam
,
String
userId
,
String
userRealName
,
String
departmentId
,
String
departmentName
,
String
companyId
,
String
orgCode
,
RoleBo
role
);
CommonResponse
list
(
String
toke
,
String
product
,
String
appKey
,
LatentDangerListParam
latentDangerListParam
,
AgencyUserModel
user
,
String
loginOrgCode
,
String
deptId
);
DangerExecuteSubmitDto
execute
(
LatentDangerExcuteParam
latentDangerExcuteParam
,
String
userId
,
String
userRealName
,
String
departmentId
,
String
departmentName
,
RoleBo
role
);
CommonResponse
detail
(
String
id
,
String
userId
,
boolean
isFinish
);
CommonResponse
getByInstanceId
(
String
instanceId
);
DangerExecuteSubmitDto
excuteCallBack
(
String
instanceId
,
Integer
actionType
,
String
remark
,
String
token
,
String
userId
,
String
userRealName
,
String
departmentId
,
String
departmentName
);
void
updateDangerStateOfOvertime
();
CommonResponse
listFlowRecord
(
String
token
,
String
product
,
String
appKey
,
Long
id
);
void
sendLatentDangerExcuteResult
(
DangerExecuteSubmitDto
executeSubmitDto
);
void
freshRiskJudgmentLangerCount
(
LatentDangerExcuteParam
latentDangerExcuteParam
);
/**
* 获取隐患等级字典值
*
* @return
*/
Object
getDangerLevel
(
String
token
,
String
product
,
String
appKey
,
String
dictCode
);
/**
* 根据等级字符串获取等级字典对象
*
* @param dangerLevelStr 等级("1","2","0")
* @return
*/
JSONObject
getDangerLevelJsonObject
(
String
dangerLevelStr
,
String
token
,
String
product
,
String
appKey
,
String
dictCode
);
/**
* 根据隐患id获取评审信息
*
* @param dangerId
* @return
*/
JSONObject
getReviewInfo
(
Long
dangerId
);
Page
<
DangerListResponse
>
listDanger
(
PageParam
pageParam
);
List
<
DangerListResponse
>
export
(
PageParam
pageParam
);
List
<
DangerTimeAxisVo
>
queryExecuteLog
(
Integer
dateTime
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/util/CheckParamUtil.java
View file @
2f554c53
...
...
@@ -17,8 +17,6 @@ public class CheckParamUtil {
if
(
"checkTime"
.
equals
(
name
)){
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM"
);
param
.
setCheckTime
(
daoCriterias
.
get
(
i
).
getValue
().
toString
());
}
else
if
(
"userId"
.
equals
(
name
)){
param
.
setUserId
(
daoCriterias
.
get
(
i
).
getValue
().
toString
());
}
else
if
(
"routeId"
.
equals
(
name
)){
param
.
setRouteId
(
Long
.
valueOf
(
daoCriterias
.
get
(
i
).
getValue
().
toString
()));
}
else
if
(
"orgCode"
.
equals
(
name
)
&&
operator
.
equals
(
QueryOperatorEnum
.
EQUAL
.
getName
())){
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/vo/LatentDangerDetailRiskVo.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
vo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
LatentDangerDetailRiskVo
{
private
String
pointName
;
private
String
pointNo
;
private
String
belongDepartmentName
;
private
String
pointLevel
;
private
List
<
String
>
basis
;
/**
* 计划名称
*/
private
String
planName
;
/**
* 检查时间
*/
private
String
checkTime
;
/**
* 检查人
*/
private
String
checkUser
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/vo/LatentDangerDetailVo.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
vo
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
LatentDangerDetailVo
{
private
Long
dangerId
;
private
String
dangerName
;
private
Integer
level
;
private
String
levelDesc
;
private
String
remark
;
private
String
position
;
private
String
reformTypeDesc
;
private
String
reformLimitDate
;
private
JSONObject
reformJson
;
private
Long
currentFlowRecordId
;
private
Integer
dangerState
;
private
Integer
dangerType
;
private
String
dangerStateDesc
;
private
Boolean
currentUserCanExcute
;
private
List
<
String
>
photoUrls
;
private
LatentDangerDetailRiskVo
riskInfo
;
private
JSONObject
reviewInfo
;
private
JSONObject
reformInfo
;
private
JSONObject
recheckInfo
;
private
List
<
LatentDangerFlowRecordBo
>
records
;
private
String
delayLimitDate
;
private
String
problemDescription
;
private
String
reasonAnalysis
;
private
String
inferOtherThings
;
private
String
taskId
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/vo/LatentDangerListVo.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
vo
;
import
lombok.Data
;
@Data
public
class
LatentDangerListVo
{
private
Long
dangerId
;
private
String
dangerName
;
private
String
discovererUserName
;
private
Integer
level
;
private
String
levelDesc
;
private
String
limitDesc
;
private
Integer
state
;
private
String
stateDesc
;
private
Integer
overtimeState
;
private
String
taskId
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/common/remote/RemoteRiskFactorFlowService.java
deleted
100644 → 0
View file @
2d57e853
//package com.yeejoin.amos.maintenance.common.remote;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import com.google.common.collect.Maps;
//import com.yeejoin.amos.maintenance.business.constants.XJConstant;
//import com.yeejoin.amos.maintenance.business.util.HttpUtil;
//import com.yeejoin.amos.maintenance.common.enums.WorkFlowRiskFactorUriEnum;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Service;
//import org.springframework.util.StringUtils;
//
//import java.util.Map;
//
//@Service("remoteSpcService")
//public class RemoteRiskFactorFlowService {
//
// private final Logger logger = LoggerFactory.getLogger(RemoteRiskFactorFlowService.class);
//
// /* @Value("${params.spc.address}")
// private String address;*/
//
// private static final String success = "SUCCESS";
//
// private String buildUrl(String address, WorkFlowRiskFactorUriEnum workFlowRiskFactorUriEnum, Map<String, String> map) {
// String uri = workFlowRiskFactorUriEnum.getUri();
// String params = workFlowRiskFactorUriEnum.getParams();
// if (!StringUtils.isEmpty(params) && map != null) {
// String[] paramsArr = params.split(",");
// for (String param : paramsArr) {
// uri = uri.replace("{" + param + "}", map.get(param));
// }
// }
// return address + uri;
// }
//
// private JSONObject handleResult(String resultStr) {
// if (resultStr == null) {
// return null;
// }
// JSONObject json = JSON.parseObject(resultStr);
// if (success.equals(json.getString("result"))) {
// return json;
// }
// return null;
// }
//
// /* public JSONObject wakeUpRiskFactorFlow(String pointClassifyOriginalId, String token) {
// String url = buildUrl(address, WorkFlowRiskFactorUriEnum.唤起流程, null);
// JSONObject body = new JSONObject();
// body.put("riskFactorId", pointClassifyOriginalId);
// Map<String, String> headerMap = Maps.newHashMap();
// headerMap.put(XJConstant.TOKEN_KEY, token);
// String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, body.toJSONString(), headerMap);
// return handleResult(resultStr);
// }
//*/
//
//}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/common/remote/RemoteSpcService.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
remote
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.maintenance.business.util.HttpUtil
;
import
com.yeejoin.amos.maintenance.business.constants.XJConstant
;
import
com.yeejoin.amos.maintenance.common.enums.RiskFactorWorkFlowActionTypeEnum
;
import
com.yeejoin.amos.maintenance.common.enums.WorkFlowRiskFactorUriEnum
;
import
com.yeejoin.amos.maintenance.core.common.request.CheckResultPushSpcRequest
;
import
com.yeejoin.amos.maintenance.core.common.request.LatentDangerResultPushSpcRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.Map
;
@Service
(
"remoteSpcService"
)
public
class
RemoteSpcService
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RemoteSpcService
.
class
);
@Value
(
"${params.spc.address}"
)
private
String
address
;
private
static
final
String
success
=
"SUCCESS"
;
private
String
buildUrl
(
String
address
,
WorkFlowRiskFactorUriEnum
workFlowRiskFactorUriEnum
,
Map
<
String
,
String
>
map
)
{
String
uri
=
workFlowRiskFactorUriEnum
.
getUri
();
String
params
=
workFlowRiskFactorUriEnum
.
getParams
();
if
(!
StringUtils
.
isEmpty
(
params
)
&&
map
!=
null
)
{
String
[]
paramsArr
=
params
.
split
(
","
);
for
(
String
param
:
paramsArr
)
{
uri
=
uri
.
replace
(
"{"
+
param
+
"}"
,
map
.
get
(
param
));
}
}
return
address
+
uri
;
}
private
JSONObject
handleResult
(
String
resultStr
)
{
if
(
resultStr
==
null
)
{
return
null
;
}
JSONObject
json
=
JSON
.
parseObject
(
resultStr
);
if
(
success
.
equals
(
json
.
getString
(
"result"
)))
{
return
json
;
}
return
null
;
}
public
JSONObject
wakeUpOrRestartRiskFactorFlow
(
String
instanceId
,
WorkFlowRiskFactorUriEnum
factorUriEnum
,
String
token
,
RiskFactorWorkFlowActionTypeEnum
actionType
)
{
String
url
=
buildUrl
(
address
,
factorUriEnum
,
null
);
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"instanceId"
,
instanceId
);
body
.
put
(
"actionType"
,
actionType
.
getActionType
());
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
token
);
String
resultStr
=
HttpUtil
.
sendHttpPostJsonWithHeader
(
url
,
body
.
toJSONString
(),
headerMap
);
return
handleResult
(
resultStr
);
}
public
JSONObject
pushSpcCheckResult
(
CheckResultPushSpcRequest
checkResultPushSpcRequest
)
{
String
url
=
buildUrl
(
address
,
WorkFlowRiskFactorUriEnum
.
检查结果推送
,
null
);
String
stringJson
=
JSONObject
.
toJSONString
(
checkResultPushSpcRequest
);
String
resultStr
=
HttpUtil
.
sendHttpPostJson
(
url
,
stringJson
);
return
handleResult
(
resultStr
);
}
public
JSONObject
pushLatentDangerExcuteResult
(
LatentDangerResultPushSpcRequest
latentDangerResultPushSpcRequest
)
{
String
url
=
buildUrl
(
address
,
WorkFlowRiskFactorUriEnum
.
隐患治理结果推送
,
null
);
String
stringJson
=
JSONObject
.
toJSONString
(
latentDangerResultPushSpcRequest
);
String
resultStr
=
HttpUtil
.
sendHttpPostJson
(
url
,
stringJson
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n请求参数=======================>"
+
stringJson
+
"\r\n返回参数=======================>"
+
resultStr
);
return
handleResult
(
resultStr
);
}
public
JSONObject
queryPagetree
()
{
String
url
=
buildUrl
(
address
,
WorkFlowRiskFactorUriEnum
.
等级查询
,
null
);
String
resultStr
=
HttpUtil
.
sendHttpPostJson
(
url
,
null
);
return
handleResult
(
resultStr
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/common/remote/RemoteWorkFlowService.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
remote
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.maintenance.business.util.HttpUtil
;
import
com.yeejoin.amos.maintenance.business.constants.XJConstant
;
import
com.yeejoin.amos.maintenance.common.enums.WorkFlowUriEnum
;
import
com.yeejoin.amos.maintenance.common.enums.YesOrNoEnum
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.Map
;
@Service
(
"remoteWorkFlowService"
)
public
class
RemoteWorkFlowService
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RemoteWorkFlowService
.
class
);
@Value
(
"${params.work.flow.address}"
)
private
String
address
;
private
static
final
String
success
=
"SUCCESS"
;
private
static
final
String
appKey
=
"8b193f7cb22c842b5a56e866c2e20dbf"
;
@Value
(
"${params.work.flow.processDefinitionKey}"
)
private
String
processDefinitionKey
;
private
String
buildUrl
(
String
address
,
WorkFlowUriEnum
workFlowUriEnum
,
Map
<
String
,
String
>
map
)
{
String
uri
=
workFlowUriEnum
.
getUri
();
String
params
=
workFlowUriEnum
.
getParams
();
if
(!
StringUtils
.
isEmpty
(
params
)
&&
map
!=
null
)
{
String
[]
paramsArr
=
params
.
split
(
","
);
for
(
String
param
:
paramsArr
)
{
uri
=
uri
.
replace
(
"{"
+
param
+
"}"
,
map
.
get
(
param
));
}
}
return
address
+
uri
;
}
private
JSONObject
handleResult
(
String
resultStr
)
{
if
(
resultStr
==
null
)
{
return
null
;
}
JSONObject
json
=
JSON
.
parseObject
(
resultStr
);
if
(
"200"
.
equals
(
json
.
getString
(
"code"
)))
{
return
json
;
}
return
null
;
}
public
JSONObject
start
(
String
businessKey
,
String
processDefinitionKey
)
{
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
启动流程
,
null
);
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
String
resultStr
=
HttpUtil
.
sendHttpPostJson
(
url
,
body
.
toJSONString
());
return
handleResult
(
resultStr
);
}
public
JSONObject
getChildNodeDetail
(
String
instanceId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"instanceId"
,
instanceId
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
子节点信息
,
map
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n请求参数=======================>"
+
instanceId
+
"\r\n返回参数=======================>"
+
resultStr
);
return
handleResult
(
resultStr
);
}
public
JSONObject
start
(
Long
dangerId
,
String
businessKey
,
String
processDefinitionKey
)
{
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
启动流程
,
null
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
JSONArray
variables
=
new
JSONArray
();
// JSONObject companyJson = new JSONObject();
// companyJson.put("name", "companyId");
// companyJson.put("value", companyId);
// JSONObject departmentJson = new JSONObject();
// departmentJson.put("name", "departmentId");
// departmentJson.put("value", departmentId);
JSONObject
dangerIdJson
=
new
JSONObject
();
// dangerIdJson.put("name", "dangerId");
dangerIdJson
.
put
(
"dangerId"
,
dangerId
);
// variables.add(companyJson);
// variables.add(departmentJson);
// variables.add(dangerIdJson);
// body.put("variables", variables);
// String requestBody = body.toJSONString();
body
.
put
(
"variables"
,
dangerIdJson
);
String
resultStr
=
HttpUtil
.
sendHttpPostJsonWithHeader
(
url
,
body
.
toJSONString
(),
headerMap
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n请求参数=======================>"
+
body
+
"\r\n返回参数=======================>"
+
resultStr
);
return
JSON
.
parseObject
(
resultStr
);
}
public
JSONObject
startWithAppKey
(
JSONObject
body
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
map
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
map
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
启动免登录流程
,
map
);
String
requestBody
=
body
.
toJSONString
();
String
resultStr
=
HttpUtil
.
sendHttpPostJson
(
url
,
requestBody
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n请求参数=======================>"
+
requestBody
+
"\r\n返回参数=======================>"
+
resultStr
);
return
handleResult
(
resultStr
);
}
public
JSONObject
startNew
(
Long
dangerId
,
String
businessKey
,
String
processDefinitionKey
)
{
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
合并启动流程
,
null
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
JSONObject
dangerIdJson
=
new
JSONObject
();
dangerIdJson
.
put
(
"dangerId"
,
dangerId
);
body
.
put
(
"variables"
,
dangerIdJson
);
String
resultStr
=
HttpUtil
.
sendHttpPostJsonWithHeader
(
url
,
body
.
toJSONString
(),
headerMap
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n请求参数=======================>"
+
body
+
"\r\n返回参数=======================>"
+
resultStr
);
return
JSON
.
parseObject
(
resultStr
);
}
// public JSONObject stop(String processInstanceId, String deleteReason) {
// Map<String, String> map = Maps.newHashMap();
// map.put("deleteReason", deleteReason);
// map.put("processInstanceId", processInstanceId);
// String url = buildUrl(address, WorkFlowUriEnum.终止流程, map);
// String resultStr = HttpUtil.sendHttpDelete(url);
// JSONObject json = handleResult(resultStr);
// logger.info("\r\n终止流程请求路径=======================>" + url + "\r\n终止流程返回参数=======================>" + resultStr);
// return json;
// }
public
JSONObject
stop
(
String
processInstanceId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
// map.put("deleteReason", deleteReason);
map
.
put
(
"processInstanceId"
,
processInstanceId
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
终止流程
,
map
);
String
resultStr
=
HttpUtil
.
sendHttpDeleteWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
// public JSONObject excute(String taskId, String requestBody) {
// Map<String, String> map = Maps.newHashMap();
// map.put("taskId", taskId);
// String url = buildUrl(address, WorkFlowUriEnum.执行流程, map);
// String resultStr = HttpUtil.sendHttpPostJson(url, requestBody);
// JSONObject json = handleResult(resultStr);
// logger.info("\r\n执行任务请求路径=======================>" + url + "\r\n执行任务请求参数=======================>" + requestBody + "\r\n执行任务返回参数=======================>" + resultStr);
// return json;
// }
public
JSONObject
excute
(
String
taskId
,
String
requestBody
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"taskId"
,
taskId
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
执行流程
,
map
);
String
resultStr
=
HttpUtil
.
sendHttpPostJsonWithHeader
(
url
,
requestBody
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n请求参数=======================>"
+
requestBody
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
public
JSONObject
currentTask
(
String
instanceId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"processInstanceId"
,
instanceId
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
当前节点
,
map
);
String
resultStr
=
HttpUtil
.
sendHttpGet
(
url
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n当前任务请求路径=======================>"
+
url
+
"\r\n当前任务返回参数=======================>"
+
resultStr
);
if
(
json
==
null
)
{
return
null
;
}
JSONArray
reviewContent
=
json
.
getJSONObject
(
"dataList"
).
getJSONArray
(
"content"
);
if
(
reviewContent
!=
null
&&
reviewContent
.
size
()
>
0
)
{
return
reviewContent
.
getJSONObject
(
0
);
}
return
null
;
}
public
JSONObject
allTasksInProcessInstanceId
(
String
instanceId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"processInstanceId"
,
instanceId
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
工作流流水
,
map
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
if
(
json
==
null
)
{
return
null
;
}
JSONArray
allContent
=
json
.
getJSONArray
(
"dataList"
);
if
(
allContent
!=
null
&&
allContent
.
size
()
>
0
)
{
return
allContent
.
getJSONObject
(
allContent
.
size
()
-
1
);
}
return
null
;
}
public
JSONObject
pageTask
(
String
userId
,
Integer
BelongType
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
String
url
=
""
;
map
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
if
(
Integer
.
parseInt
(
YesOrNoEnum
.
YES
.
getCode
())==
BelongType
){
map
.
put
(
"userId"
,
userId
);
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
我的代办有
ID
,
map
);
}
else
{
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
我的代办
,
map
);
}
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
public
JSONObject
completedPageTask
(
String
userId
,
Integer
BelongType
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
String
url
=
""
;
map
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
if
(
Integer
.
parseInt
(
YesOrNoEnum
.
YES
.
getCode
())==
BelongType
){
map
.
put
(
"userId"
,
userId
);
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
已执行任务有
ID
,
map
);
}
else
{
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
已执行任务
,
map
);
}
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
public
JSONObject
queryTask
(
String
id
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"processInstanceId"
,
id
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
流程任务
,
map
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
public
JSONObject
queryTaskDetail
(
String
taskId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"taskId"
,
taskId
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
流程详情
,
map
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
public
JSONObject
queryFinishTaskDetail
(
String
taskId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"taskId"
,
taskId
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
所有已执行任务详情
,
map
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/schedule/LatentDanerScheduled.java
deleted
100644 → 0
View file @
2d57e853
package
com
.
yeejoin
.
amos
.
maintenance
.
schedule
;
import
com.yeejoin.amos.maintenance.business.service.intfc.ILatentDangerService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
/**
* 隐患定时任务
*/
@Configuration
(
"latentDanerScheduled"
)
@EnableScheduling
public
class
LatentDanerScheduled
{
@Autowired
private
ILatentDangerService
iLatentDangerService
;
/**
* 每1分钟执行一次:查询逾期的隐患,修改状态
*/
// @Scheduled(cron = "0 0/1 * * * ?")
public
void
updateDangerStateOfOvertime
()
{
iLatentDangerService
.
updateDangerStateOfOvertime
();
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/AlertCalledServiceImpl.java
View file @
2f554c53
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
...
...
@@ -13,41 +23,15 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.FormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.ESAlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Elevator
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.RepairConsult
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Template
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.AlertStatusEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.elasticsearch.core.SearchHit
;
import
org.springframework.data.elasticsearch.core.SearchHits
;
import
org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
/**
* 警情接警填报记录服务实现类
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/DispatchPaperServiceImpl.java
View file @
2f554c53
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertFormInitDto
;
...
...
@@ -20,6 +21,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import
com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.DispatchPaperMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IDispatchPaperService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService
;
...
...
@@ -31,11 +33,11 @@ import org.springframework.transaction.annotation.Transactional;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 派遣单服务实现类
...
...
@@ -199,7 +201,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
rescueProcessServiceImpl
.
updateByAlertId
(
rescueProcessDto
,
null
);
}
// 修改警情到派遣阶段
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
alertId
,
"PQ"
);
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
alertId
,
TzsCommonParam
.
PQ
);
return
dispatchPaperFormDto
;
}
...
...
@@ -222,7 +224,6 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchSaveFeedbackDto
.
setFeedbackCode
(
dispatchPaper
.
getFeedbackCode
());
dispatchSaveFeedbackDto
.
setFeedbackType
(
dispatchPaper
.
getFeedbackType
());
dispatchSaveFeedbackDto
.
setFeedbackFinishTime
(
dispatchPaper
.
getFeedbackFinishTime
());
dispatchSaveFeedbackDto
.
setRemark
(
dispatchPaper
.
getRemark
());
if
(
StringUtils
.
isBlank
(
dispatchPaper
.
getFeedbackUid
()))
{
dispatchSaveFeedbackDto
.
setFeedbackUid
(
null
);
}
else
{
...
...
@@ -251,23 +252,22 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
}
// 动态字段
List
<
AlertFormValue
>
dynamicFormAlert
=
dispatchPaperFormDto
.
getDynamicFormAlert
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
dynamicFormAlert
.
stream
().
forEach
(
alertFormValue
->
{
String
value
=
null
;
switch
(
alertFormValue
.
getFieldCode
())
{
case
"save_feedback_time"
:
case
TzsCommonParam
.
SAVE_FEEDBACK_TIME
:
value
=
alertFormValue
.
getFieldValue
();
if
(
StringUtils
.
isBlank
(
value
))
{
dispatchSaveFeedbackDto
.
setSaveFeedbackTime
(
null
);
}
else
{
try
{
dispatchSaveFeedbackDto
.
setSaveFeedbackTime
(
sdf
.
pars
e
(
value
));
}
catch
(
Parse
Exception
e
)
{
dispatchSaveFeedbackDto
.
setSaveFeedbackTime
(
DateUtils
.
longStr2Dat
e
(
value
));
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"救援时间格式错误"
);
}
}
break
;
case
"save_feedback_user"
:
case
TzsCommonParam
.
SAVE_FEEDBACK_USER
:
value
=
alertFormValue
.
getFieldValue
();
if
(
StringUtils
.
isBlank
(
value
))
{
dispatchSaveFeedbackDto
.
setSaveFeedbackUser
(
null
);
...
...
@@ -275,7 +275,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchSaveFeedbackDto
.
setSaveFeedbackUser
(
value
);
}
break
;
case
"save_feedback_uid"
:
case
TzsCommonParam
.
SAVE_FEEDBACK_UID
:
value
=
alertFormValue
.
getFieldValue
();
if
(
StringUtils
.
isBlank
(
value
))
{
dispatchSaveFeedbackDto
.
setSaveFeedbackUid
(
null
);
...
...
@@ -283,18 +283,22 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchSaveFeedbackDto
.
setSaveFeedbackUid
(
value
);
}
break
;
case
"save_feedback_result"
:
case
TzsCommonParam
.
SAVE_FEEDBACK_RESULT
:
value
=
alertFormValue
.
getFieldValue
();
dispatchSaveFeedbackDto
.
setSaveFeedbackResult
(
value
);
break
;
case
"fix_result"
:
case
TzsCommonParam
.
FIX_RESULT
:
value
=
alertFormValue
.
getFieldValueCode
();
dispatchSaveFeedbackDto
.
setFixResult
(
value
);
break
;
case
"error_result"
:
case
TzsCommonParam
.
ERROR_RESULT
:
value
=
alertFormValue
.
getFieldValueCode
();
dispatchSaveFeedbackDto
.
setErrorResult
(
value
);
break
;
case
TzsCommonParam
.
FIX_REMARK
:
value
=
alertFormValue
.
getFieldValueCode
();
dispatchSaveFeedbackDto
.
setFixRemark
(
value
);
break
;
}
});
...
...
@@ -311,45 +315,48 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
DispatchPaper
dispatchPaper
=
dispatchPaperFormDto
.
getDispatchPaper
();
// 动态字段
List
<
AlertFormValue
>
dynamicFormAlert
=
dispatchPaperFormDto
.
getDynamicFormAlert
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
dynamicFormAlert
.
stream
().
forEach
(
alertFormValue
->
{
switch
(
alertFormValue
.
getFieldCode
())
{
case
"save_feedback_time"
:
case
TzsCommonParam
.
SAVE_FEEDBACK_TIME
:
if
(
dispatchSaveFeedbackDto
.
getSaveFeedbackTime
()
!=
null
)
{
if
(
alertFormValue
.
getFieldValue
()
==
null
)
{
// 坐席回访
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
dispatchSaveFeedbackDto
.
getAlertId
(),
"JYHF"
,
null
,
user
);
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
dispatchSaveFeedbackDto
.
getAlertId
(),
TzsCommonParam
.
JYHF
,
null
,
user
);
// 修改警情到救援反馈
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
dispatchSaveFeedbackDto
.
getAlertId
(),
"JYHF"
);
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
dispatchSaveFeedbackDto
.
getAlertId
(),
TzsCommonParam
.
JYHF
);
}
alertFormValue
.
setFieldValue
(
sdf
.
format
(
dispatchSaveFeedbackDto
.
getSaveFeedbackTime
()));
alertFormValue
.
setFieldValue
(
DateUtils
.
date2LongStr
(
dispatchSaveFeedbackDto
.
getSaveFeedbackTime
()));
}
break
;
case
"save_feedback_user"
:
case
TzsCommonParam
.
SAVE_FEEDBACK_USER
:
if
(
StringUtils
.
isNotBlank
(
dispatchSaveFeedbackDto
.
getSaveFeedbackUser
()))
alertFormValue
.
setFieldValue
(
dispatchSaveFeedbackDto
.
getSaveFeedbackUser
());
break
;
case
"save_feedback_uid"
:
case
TzsCommonParam
.
SAVE_FEEDBACK_UID
:
if
(
StringUtils
.
isNotBlank
(
dispatchSaveFeedbackDto
.
getSaveFeedbackUid
()))
alertFormValue
.
setFieldValue
(
dispatchSaveFeedbackDto
.
getSaveFeedbackUid
());
break
;
case
"save_feedback_result"
:
case
TzsCommonParam
.
SAVE_FEEDBACK_RESULT
:
if
(
StringUtils
.
isNotBlank
(
dispatchSaveFeedbackDto
.
getSaveFeedbackResult
()))
alertFormValue
.
setFieldValue
(
dispatchSaveFeedbackDto
.
getSaveFeedbackResult
());
break
;
case
"fix_result"
:
case
TzsCommonParam
.
FIX_REMARK
:
if
(
StringUtils
.
isNotBlank
(
dispatchSaveFeedbackDto
.
getFixRemark
()))
alertFormValue
.
setFieldValue
(
dispatchSaveFeedbackDto
.
getFixRemark
());
break
;
case
TzsCommonParam
.
FIX_RESULT
:
if
(
StringUtils
.
isNotBlank
(
dispatchSaveFeedbackDto
.
getFixResult
()))
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
"WXJG"
).
eq
(
"code"
,
dispatchSaveFeedbackDto
.
getFixResult
());
queryWrapper
.
eq
(
"type"
,
TzsCommonParam
.
WXJG
).
eq
(
"code"
,
dispatchSaveFeedbackDto
.
getFixResult
());
DataDictionary
fixResult
=
iDataDictionaryService
.
getOne
(
queryWrapper
);
alertFormValue
.
setFieldValue
(
fixResult
.
getName
());
alertFormValue
.
setFieldValueCode
(
fixResult
.
getCode
());
}
break
;
case
"error_result"
:
case
TzsCommonParam
.
ERROR_RESULT
:
if
(
StringUtils
.
isNotBlank
(
dispatchSaveFeedbackDto
.
getErrorResult
()))
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
"GZYY"
).
eq
(
"code"
,
dispatchSaveFeedbackDto
.
getErrorResult
());
queryWrapper
.
eq
(
"type"
,
TzsCommonParam
.
GZYY
).
eq
(
"code"
,
dispatchSaveFeedbackDto
.
getErrorResult
());
DataDictionary
errorResult
=
iDataDictionaryService
.
getOne
(
queryWrapper
);
alertFormValue
.
setFieldValue
(
errorResult
.
getName
());
alertFormValue
.
setFieldValueCode
(
errorResult
.
getCode
());
...
...
@@ -362,16 +369,15 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchPaper
.
setFeedbackFinishTime
(
dispatchSaveFeedbackDto
.
getFeedbackFinishTime
());
dispatchPaper
.
setFeedbackUid
(
dispatchSaveFeedbackDto
.
getFeedbackUid
());
dispatchPaper
.
setFeedbackUname
(
dispatchSaveFeedbackDto
.
getFeedbackUname
());
dispatchPaper
.
setRemark
(
dispatchSaveFeedbackDto
.
getRemark
());
if
(
dispatchPaper
.
getFeedbackTime
()
==
null
&&
dispatchSaveFeedbackDto
.
getFeedbackTime
()
!=
null
)
{
// 维修反馈
Long
taskId
=
dispatchPaper
.
getRepairOrgTaskId
()
!=
null
?
dispatchPaper
.
getRepairOrgTaskId
()
:
dispatchPaper
.
getUseOrgTaskId
();
if
(
taskId
==
null
)
{
throw
new
BadRequest
(
"未找到反馈任务单"
);
}
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
dispatchSaveFeedbackDto
.
getAlertId
(),
"WXFK"
,
taskId
,
user
);
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
dispatchSaveFeedbackDto
.
getAlertId
(),
TzsCommonParam
.
WXFK
,
taskId
,
user
);
// 修改警情到维修反馈
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
dispatchSaveFeedbackDto
.
getAlertId
(),
"WXFK"
);
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
dispatchSaveFeedbackDto
.
getAlertId
(),
TzsCommonParam
.
WXFK
);
}
dispatchPaper
.
setFeedbackTime
(
dispatchSaveFeedbackDto
.
getFeedbackTime
());
// 保存动态表单数据
...
...
@@ -433,31 +439,30 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
// 动态字段
List
<
AlertFormValue
>
dynamicFormAlert
=
dispatchPaperFormDto
.
getDynamicFormAlert
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
dynamicFormAlert
.
stream
().
forEach
(
alertFormValue
->
{
String
value
=
null
;
switch
(
alertFormValue
.
getFieldCode
())
{
case
"fix_feedback_time"
:
//报修反馈时间
case
TzsCommonParam
.
FIX_FEEDBACK_TIME
:
//报修反馈时间
value
=
alertFormValue
.
getFieldValue
();
if
(
StringUtils
.
isBlank
(
value
))
{
dispatchRepairFeedbackDto
.
setFixFeedbackTime
(
null
);
}
else
{
try
{
dispatchRepairFeedbackDto
.
setFixFeedbackTime
(
sdf
.
pars
e
(
value
));
}
catch
(
Parse
Exception
e
)
{
dispatchRepairFeedbackDto
.
setFixFeedbackTime
(
DateUtils
.
longStr2Dat
e
(
value
));
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"维修反馈时间格式错误"
);
}
}
break
;
case
"feedback_result"
:
//报修结果
value
=
alertFormValue
.
getFieldValue
();
case
TzsCommonParam
.
FEEDBACK_RESULT
:
//报修结果
value
=
alertFormValue
.
getFieldValue
Code
();
dispatchRepairFeedbackDto
.
setFeedbackResult
(
value
);
break
;
case
"fix_feedback_type"
:
// 保修反馈方式
case
TzsCommonParam
.
FIX_FEEDBACK_TYPE
:
// 保修反馈方式
value
=
alertFormValue
.
getFieldValueCode
();
dispatchRepairFeedbackDto
.
setFixFeedbackType
(
value
);
break
;
case
"fix_feedback_uname"
:
case
TzsCommonParam
.
FIX_FEEDBACK_UNAME
:
value
=
alertFormValue
.
getFieldValue
();
if
(
StringUtils
.
isBlank
(
value
))
{
dispatchRepairFeedbackDto
.
setFixFeedbackUname
(
null
);
...
...
@@ -465,7 +470,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchRepairFeedbackDto
.
setFixFeedbackUname
(
value
);
}
break
;
case
"fix_feedback_uid"
:
case
TzsCommonParam
.
FIX_FEEDBACK_UID
:
value
=
alertFormValue
.
getFieldValue
();
if
(
StringUtils
.
isBlank
(
value
))
{
dispatchRepairFeedbackDto
.
setFixFeedbackUid
(
null
);
...
...
@@ -473,15 +478,15 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchRepairFeedbackDto
.
setFixFeedbackUid
(
value
);
}
break
;
case
"fix_result"
:
case
TzsCommonParam
.
FIX_RESULT
:
value
=
alertFormValue
.
getFieldValueCode
();
dispatchRepairFeedbackDto
.
setFixResult
(
value
);
break
;
case
"error_result"
:
case
TzsCommonParam
.
ERROR_RESULT
:
value
=
alertFormValue
.
getFieldValueCode
();
dispatchRepairFeedbackDto
.
setErrorResult
(
value
);
break
;
case
"fix_remark"
:
case
TzsCommonParam
.
FIX_REMARK
:
value
=
alertFormValue
.
getFieldValue
();
dispatchRepairFeedbackDto
.
setFixRemark
(
value
);
break
;
...
...
@@ -501,69 +506,62 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
DispatchPaper
dispatchPaper
=
dispatchPaperFormDto
.
getDispatchPaper
();
// 动态字段
List
<
AlertFormValue
>
dynamicFormAlert
=
dispatchPaperFormDto
.
getDynamicFormAlert
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Map
<
String
,
Boolean
>
tempMap
=
new
HashMap
<
String
,
Boolean
>(
);
dynamicFormAlert
.
stream
().
forEach
(
alertFormValue
->
{
switch
(
alertFormValue
.
getFieldCode
())
{
case
"fix_feedback_time"
:
case
TzsCommonParam
.
FIX_FEEDBACK_TIME
:
if
(
dispatchRepairFeedbackDto
.
getFixFeedbackTime
()
!=
null
)
{
if
(
alertFormValue
.
getFieldValue
()
==
null
)
{
// 报修反馈
Long
taskId
=
dispatchPaper
.
getRepairOrgTaskId
()
!=
null
?
dispatchPaper
.
getRepairOrgTaskId
()
:
dispatchPaper
.
getUseOrgTaskId
();
if
(
taskId
==
null
)
{
throw
new
BadRequest
(
"未找到反馈任务单"
);
}
// 修改警情到报修反馈
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
dispatchRepairFeedbackDto
.
getAlertId
(),
"BXFK"
);
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
dispatchRepairFeedbackDto
.
getAlertId
(),
"BXFK"
,
taskId
,
user
);
tempMap
.
put
(
TzsCommonParam
.
BXFK
,
true
);
}
alertFormValue
.
setFieldValue
(
sdf
.
format
(
dispatchRepairFeedbackDto
.
getFixFeedbackTime
()));
alertFormValue
.
setFieldValue
(
DateUtils
.
date2LongStr
(
dispatchRepairFeedbackDto
.
getFixFeedbackTime
()));
}
break
;
case
"feedback_result"
:
case
TzsCommonParam
.
FEEDBACK_RESULT
:
if
(
StringUtils
.
isNotBlank
(
dispatchRepairFeedbackDto
.
getFeedbackResult
()))
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
"FKJG"
).
eq
(
"code"
,
dispatchRepairFeedbackDto
.
getFeedbackResult
());
queryWrapper
.
eq
(
"type"
,
TzsCommonParam
.
WXJG
).
eq
(
"code"
,
dispatchRepairFeedbackDto
.
getFeedbackResult
());
DataDictionary
feedbackType
=
iDataDictionaryService
.
getOne
(
queryWrapper
);
alertFormValue
.
setFieldValue
(
feedbackType
.
getName
());
alertFormValue
.
setFieldValueCode
(
feedbackType
.
getCode
());
}
break
;
case
"fix_feedback_type"
:
case
TzsCommonParam
.
FIX_FEEDBACK_TYPE
:
if
(
StringUtils
.
isNotBlank
(
dispatchRepairFeedbackDto
.
getFixFeedbackType
()))
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
"FKFS"
).
eq
(
"code"
,
dispatchRepairFeedbackDto
.
getFixFeedbackType
());
queryWrapper
.
eq
(
"type"
,
TzsCommonParam
.
FKFS
).
eq
(
"code"
,
dispatchRepairFeedbackDto
.
getFixFeedbackType
());
DataDictionary
feedbackType
=
iDataDictionaryService
.
getOne
(
queryWrapper
);
alertFormValue
.
setFieldValue
(
feedbackType
.
getName
());
alertFormValue
.
setFieldValueCode
(
feedbackType
.
getCode
());
}
break
;
case
"fix_feedback_uname"
:
case
TzsCommonParam
.
FIX_FEEDBACK_UNAME
:
if
(
StringUtils
.
isNotBlank
(
dispatchRepairFeedbackDto
.
getFixFeedbackUname
()))
alertFormValue
.
setFieldValue
(
dispatchRepairFeedbackDto
.
getFixFeedbackUname
());
break
;
case
"fix_feedback_uid"
:
case
TzsCommonParam
.
FIX_FEEDBACK_UID
:
if
(
StringUtils
.
isNotBlank
(
dispatchRepairFeedbackDto
.
getFixFeedbackUid
()))
alertFormValue
.
setFieldValue
(
dispatchRepairFeedbackDto
.
getFixFeedbackUid
());
break
;
case
"fix_result"
:
case
TzsCommonParam
.
FIX_RESULT
:
if
(
StringUtils
.
isNotBlank
(
dispatchRepairFeedbackDto
.
getFixResult
()))
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
"WXJG"
).
eq
(
"code"
,
dispatchRepairFeedbackDto
.
getFixResult
());
queryWrapper
.
eq
(
"type"
,
TzsCommonParam
.
WXJG
).
eq
(
"code"
,
dispatchRepairFeedbackDto
.
getFixResult
());
DataDictionary
fixResult
=
iDataDictionaryService
.
getOne
(
queryWrapper
);
alertFormValue
.
setFieldValue
(
fixResult
.
getName
());
alertFormValue
.
setFieldValueCode
(
fixResult
.
getCode
());
}
break
;
case
"error_result"
:
case
TzsCommonParam
.
ERROR_RESULT
:
if
(
StringUtils
.
isNotBlank
(
dispatchRepairFeedbackDto
.
getErrorResult
()))
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
"GZYY"
).
eq
(
"code"
,
dispatchRepairFeedbackDto
.
getErrorResult
());
queryWrapper
.
eq
(
"type"
,
TzsCommonParam
.
GZYY
).
eq
(
"code"
,
dispatchRepairFeedbackDto
.
getErrorResult
());
DataDictionary
errorResult
=
iDataDictionaryService
.
getOne
(
queryWrapper
);
alertFormValue
.
setFieldValue
(
errorResult
.
getName
());
alertFormValue
.
setFieldValueCode
(
errorResult
.
getCode
());
}
break
;
case
"fix_remark"
:
case
TzsCommonParam
.
FIX_REMARK
:
if
(
StringUtils
.
isNotBlank
(
dispatchRepairFeedbackDto
.
getFixRemark
()))
alertFormValue
.
setFieldValue
(
dispatchRepairFeedbackDto
.
getFixRemark
());
break
;
...
...
@@ -576,6 +574,14 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchPaper
.
setFeedbackUname
(
dispatchRepairFeedbackDto
.
getFeedbackUname
());
dispatchPaper
.
setRemark
(
dispatchRepairFeedbackDto
.
getRemark
());
if
(
dispatchPaper
.
getFeedbackTime
()
==
null
&&
dispatchRepairFeedbackDto
.
getFeedbackTime
()
!=
null
)
{
tempMap
.
put
(
"FEEDBACK"
,
true
);
}
dispatchPaper
.
setFeedbackTime
(
dispatchRepairFeedbackDto
.
getFeedbackTime
());
// 保存动态表单数据
iAlertFormValueService
.
updateBatchById
(
dynamicFormAlert
);
// 保存派遣表
flag
=
this
.
updateById
(
dispatchPaper
);
if
(
tempMap
.
get
(
"FEEDBACK"
)
!=
null
)
{
// 维修反馈
Long
taskId
=
dispatchPaper
.
getRepairOrgTaskId
()
!=
null
?
dispatchPaper
.
getRepairOrgTaskId
()
:
dispatchPaper
.
getUseOrgTaskId
();
if
(
taskId
==
null
)
{
...
...
@@ -585,11 +591,16 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
dispatchRepairFeedbackDto
.
getAlertId
(),
"WXFK"
);
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
dispatchRepairFeedbackDto
.
getAlertId
(),
"WXFK"
,
taskId
,
user
);
}
dispatchPaper
.
setFeedbackTime
(
dispatchRepairFeedbackDto
.
getFeedbackTime
());
// 保存动态表单数据
iAlertFormValueService
.
updateBatchById
(
dynamicFormAlert
);
// 保存派遣表
flag
=
this
.
updateById
(
dispatchPaper
);
if
(
tempMap
.
get
(
"BXFK"
)
!=
null
)
{
// 报修反馈
Long
taskId
=
dispatchPaper
.
getRepairOrgTaskId
()
!=
null
?
dispatchPaper
.
getRepairOrgTaskId
()
:
dispatchPaper
.
getUseOrgTaskId
();
if
(
taskId
==
null
)
{
throw
new
BadRequest
(
"未找到反馈任务单"
);
}
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
dispatchRepairFeedbackDto
.
getAlertId
(),
"BXFK"
,
taskId
,
user
);
// 修改警情到报修反馈
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
dispatchRepairFeedbackDto
.
getAlertId
(),
"BXFK"
);
}
return
flag
;
}
...
...
@@ -646,35 +657,34 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
// 动态字段
List
<
AlertFormValue
>
dynamicFormAlert
=
dispatchPaperFormDto
.
getDynamicFormAlert
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
dynamicFormAlert
.
stream
().
forEach
(
alertFormValue
->
{
String
value
=
null
;
switch
(
alertFormValue
.
getFieldCode
())
{
case
"consult_feedback_time"
:
//咨询反馈时间
case
TzsCommonParam
.
CONSULT_FEEDBACK_TIME
:
//咨询反馈时间
value
=
alertFormValue
.
getFieldValue
();
if
(
StringUtils
.
isBlank
(
value
))
{
dispatchConsultFeedbackDto
.
setConsultFeedbackTime
(
null
);
}
else
{
try
{
dispatchConsultFeedbackDto
.
setConsultFeedbackTime
(
sdf
.
pars
e
(
value
));
}
catch
(
Parse
Exception
e
)
{
dispatchConsultFeedbackDto
.
setConsultFeedbackTime
(
DateUtils
.
longStr2Dat
e
(
value
));
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"咨询反馈时间格式错误"
);
}
}
break
;
case
"action_result"
:
//处置结果
value
=
alertFormValue
.
getFieldValue
();
case
TzsCommonParam
.
ACTION_RESULT
:
//处置结果
value
=
alertFormValue
.
getFieldValue
Code
();
dispatchConsultFeedbackDto
.
setActionResult
(
value
);
break
;
case
"feedback_result"
:
//咨询反馈结果
value
=
alertFormValue
.
getFieldValue
();
case
TzsCommonParam
.
FEEDBACK_RESULT
:
//咨询反馈结果
value
=
alertFormValue
.
getFieldValue
Code
();
dispatchConsultFeedbackDto
.
setFeedbackResult
(
value
);
break
;
case
"consult_feedback_type"
:
// 咨询反馈方式
case
TzsCommonParam
.
CONSULT_FEEDBACK_TYPE
:
// 咨询反馈方式
value
=
alertFormValue
.
getFieldValueCode
();
dispatchConsultFeedbackDto
.
setConsultFeedbackType
(
value
);
break
;
case
"consult_feedback_uname"
:
case
TzsCommonParam
.
CONSULT_FEEDBACK_UNAME
:
value
=
alertFormValue
.
getFieldValue
();
if
(
StringUtils
.
isBlank
(
value
))
{
dispatchConsultFeedbackDto
.
setConsultFeedbackUname
(
null
);
...
...
@@ -682,7 +692,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchConsultFeedbackDto
.
setConsultFeedbackUname
(
value
);
}
break
;
case
"consult_feedback_uid"
:
case
TzsCommonParam
.
CONSULT_FEEDBACK_UID
:
value
=
alertFormValue
.
getFieldValue
();
if
(
StringUtils
.
isBlank
(
value
))
{
dispatchConsultFeedbackDto
.
setConsultFeedbackUid
(
null
);
...
...
@@ -690,7 +700,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchConsultFeedbackDto
.
setConsultFeedbackUid
(
value
);
}
break
;
case
"main_feedback_result"
:
case
TzsCommonParam
.
MAIN_FEEDBACK_RESULT
:
value
=
alertFormValue
.
getFieldValue
();
dispatchConsultFeedbackDto
.
setMainFeedbackResult
(
value
);
break
;
...
...
@@ -709,58 +719,51 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
DispatchPaper
dispatchPaper
=
dispatchPaperFormDto
.
getDispatchPaper
();
// 动态字段
List
<
AlertFormValue
>
dynamicFormAlert
=
dispatchPaperFormDto
.
getDynamicFormAlert
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Map
<
String
,
Boolean
>
tempMap
=
new
HashMap
<
String
,
Boolean
>(
);
dynamicFormAlert
.
stream
().
forEach
(
alertFormValue
->
{
switch
(
alertFormValue
.
getFieldCode
())
{
case
"consult_feedback_time"
:
case
TzsCommonParam
.
CONSULT_FEEDBACK_TIME
:
if
(
dispatchConsultFeedbackDto
.
getConsultFeedbackTime
()
!=
null
)
{
if
(
alertFormValue
.
getFieldValue
()
==
null
)
{
// 投诉人反馈
Long
taskId
=
dispatchPaper
.
getRepairOrgTaskId
()
!=
null
?
dispatchPaper
.
getRepairOrgTaskId
()
:
dispatchPaper
.
getUseOrgTaskId
();
if
(
taskId
==
null
)
{
throw
new
BadRequest
(
"未找到反馈任务单"
);
}
// 修改警情到投诉人反馈
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
dispatchConsultFeedbackDto
.
getAlertId
(),
"TSRFK"
);
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
dispatchConsultFeedbackDto
.
getAlertId
(),
"TSRFK"
,
taskId
,
user
);
tempMap
.
put
(
TzsCommonParam
.
TSRFK
,
true
);
}
alertFormValue
.
setFieldValue
(
sdf
.
format
(
dispatchConsultFeedbackDto
.
getConsultFeedbackTime
()));
alertFormValue
.
setFieldValue
(
DateUtils
.
date2LongStr
(
dispatchConsultFeedbackDto
.
getConsultFeedbackTime
()));
}
break
;
case
"action_result"
:
case
TzsCommonParam
.
ACTION_RESULT
:
if
(
StringUtils
.
isNotBlank
(
dispatchConsultFeedbackDto
.
getActionResult
()))
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
"CZJG"
).
eq
(
"code"
,
dispatchConsultFeedbackDto
.
getActionResult
());
queryWrapper
.
eq
(
"type"
,
TzsCommonParam
.
CZJG
).
eq
(
"code"
,
dispatchConsultFeedbackDto
.
getActionResult
());
DataDictionary
feedbackType
=
iDataDictionaryService
.
getOne
(
queryWrapper
);
alertFormValue
.
setFieldValue
(
feedbackType
.
getName
());
alertFormValue
.
setFieldValueCode
(
feedbackType
.
getCode
());
}
break
;
case
"consult_feedback_type"
:
case
TzsCommonParam
.
CONSULT_FEEDBACK_TYPE
:
if
(
StringUtils
.
isNotBlank
(
dispatchConsultFeedbackDto
.
getConsultFeedbackType
()))
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
"FKFS"
).
eq
(
"code"
,
dispatchConsultFeedbackDto
.
getConsultFeedbackType
());
queryWrapper
.
eq
(
"type"
,
TzsCommonParam
.
FKFS
).
eq
(
"code"
,
dispatchConsultFeedbackDto
.
getConsultFeedbackType
());
DataDictionary
feedbackType
=
iDataDictionaryService
.
getOne
(
queryWrapper
);
alertFormValue
.
setFieldValue
(
feedbackType
.
getName
());
alertFormValue
.
setFieldValueCode
(
feedbackType
.
getCode
());
}
break
;
case
"consult_feedback_uname"
:
case
TzsCommonParam
.
CONSULT_FEEDBACK_UNAME
:
if
(
StringUtils
.
isNotBlank
(
dispatchConsultFeedbackDto
.
getConsultFeedbackUname
()))
alertFormValue
.
setFieldValue
(
dispatchConsultFeedbackDto
.
getConsultFeedbackUname
());
break
;
case
"consult_feedback_uid"
:
case
TzsCommonParam
.
CONSULT_FEEDBACK_UID
:
if
(
StringUtils
.
isNotBlank
(
dispatchConsultFeedbackDto
.
getConsultFeedbackUid
()))
alertFormValue
.
setFieldValue
(
dispatchConsultFeedbackDto
.
getConsultFeedbackUid
());
break
;
case
"main_feedback_result"
:
case
TzsCommonParam
.
MAIN_FEEDBACK_RESULT
:
if
(
StringUtils
.
isNotBlank
(
dispatchConsultFeedbackDto
.
getMainFeedbackResult
()))
alertFormValue
.
setFieldValue
(
dispatchConsultFeedbackDto
.
getMainFeedbackResult
());
break
;
case
"feedback_result"
:
case
TzsCommonParam
.
FEEDBACK_RESULT
:
if
(
StringUtils
.
isNotBlank
(
dispatchConsultFeedbackDto
.
getFeedbackResult
()))
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
"FKJG"
).
eq
(
"code"
,
dispatchConsultFeedbackDto
.
getFeedbackResult
());
queryWrapper
.
eq
(
"type"
,
TzsCommonParam
.
FKJG
).
eq
(
"code"
,
dispatchConsultFeedbackDto
.
getFeedbackResult
());
DataDictionary
feedbackType
=
iDataDictionaryService
.
getOne
(
queryWrapper
);
alertFormValue
.
setFieldValue
(
feedbackType
.
getName
());
alertFormValue
.
setFieldValueCode
(
feedbackType
.
getCode
());
...
...
@@ -771,14 +774,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchPaper
.
setFeedbackCode
(
dispatchConsultFeedbackDto
.
getFeedbackCode
());
dispatchPaper
.
setFeedbackType
(
dispatchConsultFeedbackDto
.
getFeedbackType
());
if
(
dispatchPaper
.
getFeedbackTime
()
==
null
&&
dispatchConsultFeedbackDto
.
getFeedbackTime
()
!=
null
)
{
// 维修反馈
Long
taskId
=
dispatchPaper
.
getRepairOrgTaskId
()
!=
null
?
dispatchPaper
.
getRepairOrgTaskId
()
:
dispatchPaper
.
getUseOrgTaskId
();
if
(
taskId
==
null
)
{
throw
new
BadRequest
(
"未找到反馈任务单"
);
}
// 修改警情到维修反馈
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
dispatchConsultFeedbackDto
.
getAlertId
(),
"WXFK"
);
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
dispatchConsultFeedbackDto
.
getAlertId
(),
"WXFK-TS"
,
taskId
,
user
);
tempMap
.
put
(
"FEEDBACK"
,
true
);
}
dispatchPaper
.
setFeedbackTime
(
dispatchConsultFeedbackDto
.
getFeedbackTime
());
dispatchPaper
.
setFeedbackFinishTime
(
dispatchConsultFeedbackDto
.
getFeedbackFinishTime
());
...
...
@@ -789,7 +785,26 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
iAlertFormValueService
.
updateBatchById
(
dynamicFormAlert
);
// 保存派遣表
flag
=
this
.
updateById
(
dispatchPaper
);
if
(
tempMap
.
get
(
"FEEDBACK"
)
!=
null
)
{
// 维修反馈
Long
taskId
=
dispatchPaper
.
getRepairOrgTaskId
()
!=
null
?
dispatchPaper
.
getRepairOrgTaskId
()
:
dispatchPaper
.
getUseOrgTaskId
();
if
(
taskId
==
null
)
{
throw
new
BadRequest
(
"未找到反馈任务单"
);
}
// 修改警情到维修反馈
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
dispatchConsultFeedbackDto
.
getAlertId
(),
TzsCommonParam
.
WXFK
);
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
dispatchConsultFeedbackDto
.
getAlertId
(),
TzsCommonParam
.
WXFK_TS
,
taskId
,
user
);
}
if
(
tempMap
.
get
(
"TSRFK"
)
!=
null
)
{
// 修改警情到投诉人反馈
// 投诉人反馈
Long
taskId
=
dispatchPaper
.
getRepairOrgTaskId
()
!=
null
?
dispatchPaper
.
getRepairOrgTaskId
()
:
dispatchPaper
.
getUseOrgTaskId
();
if
(
taskId
==
null
)
{
throw
new
BadRequest
(
"未找到反馈任务单"
);
}
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
dispatchConsultFeedbackDto
.
getAlertId
(),
TzsCommonParam
.
TSRFK
,
taskId
,
user
);
alertCalledServiceImpl
.
updateAlertStageByAlertId
(
dispatchConsultFeedbackDto
.
getAlertId
(),
TzsCommonParam
.
TSRFK
);
}
return
flag
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/DispatchTaskServiceImpl.java
View file @
2f554c53
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto
;
...
...
@@ -105,8 +106,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
String
content
=
template
.
getContent
();
// 替换模板内容
// 通用替换字段 报修时间 地址 电梯识别码 使用单位分类
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"YYYY-MM-dd HH:mm:ss"
);
String
createTime
=
sdf
.
format
(
alertCalledDto
.
getCallTime
());
String
createTime
=
DateUtils
.
date2LongStr
(
alertCalledDto
.
getCallTime
());
String
rescueCode
=
alertCalledDto
.
getDeviceId
();
String
emergencyCall
=
alertCalledDto
.
getEmergencyCall
()
==
null
?
""
:
alertCalledDto
.
getEmergencyCall
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/RepairConsultServiceImpl.java
View file @
2f554c53
...
...
@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask;
import
com.yeejoin.amos.boot.module.tzs.api.entity.RepairConsult
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Template
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.RepairConsultMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IRepairConsultService
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
...
@@ -83,7 +84,11 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
AlertCalledDto
alertCalledVo
=
alertCallFrom
.
getAlertCalledDto
();
// 获取模板 拼接json
QueryWrapper
<
Template
>
templateQueryWrapper
=
new
QueryWrapper
<>();
templateQueryWrapper
.
eq
(
"type_code"
,
"RECORD-"
+
type
);
if
(
TzsCommonParam
.
WXFK_TS
.
equals
(
type
))
{
templateQueryWrapper
.
eq
(
"type_code"
,
"RECORD-WXFK"
);
}
else
{
templateQueryWrapper
.
eq
(
"type_code"
,
"RECORD-"
+
type
);
}
Template
template
=
templateServiceImpl
.
getOne
(
templateQueryWrapper
);
String
content
=
template
.
getContent
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
...
...
@@ -103,7 +108,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
throw
new
BadRequest
(
"警情类型缺失"
);
content
=
content
.
replace
(
"$createTime"
,
createTime
).
replace
(
"$createUser"
,
createUser
).
replace
(
"$call"
,
emergency_call
);
content
=
content
.
replace
(
"$area"
,
area
).
replace
(
"$alertType"
,
alertType
);
}
else
if
(
"PQ"
.
equals
(
type
))
{
}
else
if
(
TzsCommonParam
.
PQ
.
equals
(
type
))
{
String
createUser
=
user
.
getUserName
();
DispatchTask
dispatchTask
=
dispatchTaskServiceImpl
.
getById
(
taskId
);
String
unit
=
dispatchTask
.
getResponseOrgName
();
...
...
@@ -125,25 +130,25 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
}
content
=
content
.
replace
(
"$createTime"
,
createTime
).
replace
(
"$createUser"
,
createUser
).
replace
(
"$unit"
,
unit
);
content
=
content
.
replace
(
"$person"
,
person
).
replace
(
"$phone"
,
phone
).
replace
(
"$taskType"
,
taskType
);
}
else
if
(
"DD"
.
equals
(
type
))
{
}
else
if
(
TzsCommonParam
.
DD
.
equals
(
type
))
{
DispatchTask
dispatchTask
=
dispatchTaskServiceImpl
.
getById
(
taskId
);
String
person
=
dispatchTask
.
getResponseUserName
();
content
=
content
.
replace
(
"$createTime"
,
createTime
).
replace
(
"$person"
,
person
);
RescueProcessDto
rescueProcessDto
=
rescueProcessServiceImpl
.
getProcessByAlertId
(
alertId
);
String
FKFS
=
rescueProcessDto
.
getArriveFeedbackType
();
content
=
content
.
replace
(
"$FKFS"
,
FKFS
);
}
else
if
(
"JC"
.
equals
(
type
))
{
}
else
if
(
TzsCommonParam
.
JC
.
equals
(
type
))
{
DispatchTask
dispatchTask
=
dispatchTaskServiceImpl
.
getById
(
taskId
);
String
person
=
dispatchTask
.
getResponseUserName
();
content
=
content
.
replace
(
"$createTime"
,
createTime
).
replace
(
"$person"
,
person
);
RescueProcessDto
rescueProcessDto
=
rescueProcessServiceImpl
.
getProcessByAlertId
(
alertId
);
String
FKFS
=
rescueProcessDto
.
getArriveFeedbackType
();
content
=
content
.
replace
(
"$FKFS"
,
FKFS
);
}
else
if
(
"JYHF"
.
equals
(
type
))
{
}
else
if
(
TzsCommonParam
.
JYHF
.
equals
(
type
))
{
String
createUser
=
user
.
getUserName
();
String
create
=
alertCalledVo
.
getEmergencyPerson
();
content
=
content
.
replace
(
"$createTime"
,
createTime
).
replace
(
"$createUser"
,
createUser
).
replace
(
"$create"
,
create
);
}
else
if
(
"WXFK"
.
equals
(
type
))
{
//从派遣单获取数据
}
else
if
(
TzsCommonParam
.
WXFK
.
equals
(
type
))
{
//从派遣单获取数据
DispatchTask
dispatchTask
=
dispatchTaskServiceImpl
.
getById
(
taskId
);
String
person
=
dispatchTask
.
getResponseUserName
();
content
=
content
.
replace
(
"$createTime"
,
createTime
).
replace
(
"$person"
,
person
);
...
...
@@ -152,12 +157,12 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
List
<
AlertFormValue
>
dynamicForm
=
dispatchPaperFormDto
.
getDynamicFormAlert
();
Map
<
String
,
String
>
tempMap
=
new
HashMap
<
String
,
String
>();
dynamicForm
.
stream
().
forEach
(
alertFormValue
->
{
if
(
"fix_result"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
if
(
TzsCommonParam
.
FIX_RESULT
.
equals
(
alertFormValue
.
getFieldCode
()))
{
tempMap
.
put
(
"fixResult"
,
alertFormValue
.
getFieldValue
());
}
});
content
=
content
.
replace
(
"$FKFS"
,
dispatchPaper
.
getFeedbackType
()).
replace
(
"$fixResult"
,
tempMap
.
get
(
"fixResult"
));
}
else
if
(
"WXFK-TS"
.
equals
(
type
))
{
//从派遣单获取数据
}
else
if
(
TzsCommonParam
.
WXFK_TS
.
equals
(
type
))
{
//从派遣单获取数据
DispatchTask
dispatchTask
=
dispatchTaskServiceImpl
.
getById
(
taskId
);
String
person
=
dispatchTask
.
getResponseUserName
();
content
=
content
.
replace
(
"$createTime"
,
createTime
).
replace
(
"$person"
,
person
);
...
...
@@ -166,13 +171,13 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
List
<
AlertFormValue
>
dynamicForm
=
dispatchPaperFormDto
.
getDynamicFormAlert
();
Map
<
String
,
String
>
tempMap
=
new
HashMap
<
String
,
String
>();
dynamicForm
.
stream
().
forEach
(
alertFormValue
->
{
if
(
"action_result"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
if
(
TzsCommonParam
.
ACTION_RESULT
.
equals
(
alertFormValue
.
getFieldCode
()))
{
tempMap
.
put
(
"fixResult"
,
alertFormValue
.
getFieldValue
());
}
});
content
=
content
.
replace
(
"$FKFS"
,
dispatchPaper
.
getFeedbackType
()).
replace
(
"$fixResult"
,
tempMap
.
get
(
"fixResult"
));
type
=
"WXFK"
;
}
else
if
(
"BXFK"
.
equals
(
type
))
{
type
=
TzsCommonParam
.
WXFK
;
}
else
if
(
TzsCommonParam
.
BXFK
.
equals
(
type
))
{
DispatchTask
dispatchTask
=
dispatchTaskServiceImpl
.
getById
(
taskId
);
String
person
=
dispatchTask
.
getResponseUserName
();
content
=
content
.
replace
(
"$createTime"
,
createTime
).
replace
(
"$person"
,
person
);
...
...
@@ -180,14 +185,14 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
List
<
AlertFormValue
>
dynamicForm
=
dispatchPaperFormDto
.
getDynamicFormAlert
();
Map
<
String
,
String
>
tempMap
=
new
HashMap
<
String
,
String
>();
dynamicForm
.
stream
().
forEach
(
alertFormValue
->
{
if
(
"fix_feedback_type"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
tempMap
.
put
(
"FKFS"
,
alertFormValue
.
getFieldValue
());
}
else
if
(
"fix_result"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
if
(
TzsCommonParam
.
FIX_FEEDBACK_TYPE
.
equals
(
alertFormValue
.
getFieldCode
()))
{
tempMap
.
put
(
TzsCommonParam
.
FKFS
,
alertFormValue
.
getFieldValue
());
}
else
if
(
TzsCommonParam
.
FIX_RESULT
.
equals
(
alertFormValue
.
getFieldCode
()))
{
tempMap
.
put
(
"fixResult"
,
alertFormValue
.
getFieldValue
());
}
});
content
=
content
.
replace
(
"$FKFS"
,
tempMap
.
get
(
"FKFS"
)).
replace
(
"$feedbackResult"
,
tempMap
.
get
(
"fixResult"
));
}
else
if
(
"TSRFK"
.
equals
(
type
))
{
content
=
content
.
replace
(
"$FKFS"
,
tempMap
.
get
(
TzsCommonParam
.
FKFS
)).
replace
(
"$feedbackResult"
,
tempMap
.
get
(
"fixResult"
));
}
else
if
(
TzsCommonParam
.
TSRFK
.
equals
(
type
))
{
DispatchTask
dispatchTask
=
dispatchTaskServiceImpl
.
getById
(
taskId
);
String
person
=
dispatchTask
.
getResponseUserName
();
content
=
content
.
replace
(
"$createTime"
,
createTime
).
replace
(
"$person"
,
person
);
...
...
@@ -195,13 +200,13 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
List
<
AlertFormValue
>
dynamicForm
=
dispatchPaperFormDto
.
getDynamicFormAlert
();
Map
<
String
,
String
>
tempMap
=
new
HashMap
<
String
,
String
>();
dynamicForm
.
stream
().
forEach
(
alertFormValue
->
{
if
(
"consult_feedback_type"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
tempMap
.
put
(
"FKFS"
,
alertFormValue
.
getFieldValue
());
}
else
if
(
"action_result"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
if
(
TzsCommonParam
.
CONSULT_FEEDBACK_TYPE
.
equals
(
alertFormValue
.
getFieldCode
()))
{
tempMap
.
put
(
TzsCommonParam
.
FKFS
,
alertFormValue
.
getFieldValue
());
}
else
if
(
TzsCommonParam
.
ACTION_RESULT
.
equals
(
alertFormValue
.
getFieldCode
()))
{
tempMap
.
put
(
"action_result"
,
alertFormValue
.
getFieldValue
());
}
});
content
=
content
.
replace
(
"$FKFS"
,
tempMap
.
get
(
"FKFS"
)).
replace
(
"$feedbackResult"
,
tempMap
.
get
(
"action_result"
));
content
=
content
.
replace
(
"$FKFS"
,
tempMap
.
get
(
TzsCommonParam
.
FKFS
)).
replace
(
"$feedbackResult"
,
tempMap
.
get
(
"action_result"
));
}
repairConsult
.
setType
(
AlertStageEnums
.
getEnumByCode
(
type
).
getId
());
repairConsult
.
setAlertStageCode
(
AlertStageEnums
.
getEnumByCode
(
type
).
getId
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/RescueProcessServiceImpl.java
View file @
2f554c53
...
...
@@ -96,7 +96,6 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
if
(
arriveTime
!=
null
&&
dispatchTime
!=
null
)
{
Long
arriveTimes
=
arriveTime
.
getTime
()
-
dispatchTime
.
getTime
();
// 相差毫秒数
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
//这里想要只保留分秒可以写成"mm:ss"
formatter
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"GMT+00:00"
));
String
hms
=
formatter
.
format
(
arriveTimes
);
rescueProcessDto
.
setIsTimeout
(
arriveTimes
<
1800000
?
false
:
true
);
rescueProcessDto
.
setArriveUseTime
(
hms
);
...
...
amos-boot-system-maintenance/src/main/resources/application-dev.properties
View file @
2f554c53
...
...
@@ -25,12 +25,6 @@ spring.redis.timeout=1000
jobs.cron
=
0 0/1 22-23 * * ?
#jpush 推送配置项
params.isPush
=
false
params.work.flow.normalProcessDefinitionKey
=
normalHazardManagement
params.work.flow.processDefinitionKey
=
hazardManagement
params.work.flow.address
=
http://172.16.10.80:30040
params.spc.address
=
http://172.16.3.89:9001
#websocket
params.remoteWebsocketUrl
=
http://39.100.241.164:8080/
#websocket send message url
...
...
@@ -45,9 +39,9 @@ linux.img.path = /
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}-1
emqx.broker
=
tcp://172.16.1
0.85
:1883
emqx.user-name
=
super
emqx.password
=
a123456
emqx.broker
=
tcp://172.16.1
1.33
:1883
emqx.user-name
=
admin
emqx.password
=
public
emqx.max-inflight
=
1000
file.url
=
http://39.98.45.134:9000/
\ No newline at end of file
amos-boot-system-maintenance/src/main/resources/db/changelog/mt-1.0.0.xml
View file @
2f554c53
...
...
@@ -38,4 +38,13 @@
ALTER TABLE p_point ADD COLUMN `building_name` varchar(255) DEFAULT NULL COMMENT '所在建筑名称' AFTER `building_id`;
</sql>
</changeSet>
<changeSet
author=
"suhuiguang"
id=
"1628747347004-3"
>
<preConditions
onFail=
"MARK_RAN"
>
<columnExists
tableName=
"p_check_shot"
columnName=
"org_code"
/>
</preConditions>
<comment>
p_check_shot modify COLUMN org_code 需求变更
</comment>
<sql>
ALTER TABLE p_check_shot modify `org_code` varchar(100) DEFAULT NULL COMMENT '权限系统org code';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
amos-boot-system-maintenance/src/main/resources/db/changelog/mt-sql-task.xml
View file @
2f554c53
...
...
@@ -8,7 +8,7 @@
<changeSet
author=
"suhuiguang"
id=
"1628836692856-1"
runOnChange=
"true"
>
<createProcedure
procedureName=
"updatePlanTask"
>
DROP PROCEDURE IF EXISTS `updatePlanTask`;
CREATE PROCEDURE `updatePlanTask`(IN `planTaskId` int,IN `pointId` int,IN `planTaskDetailId` int,IN `executorId` int)
CREATE PROCEDURE `updatePlanTask`(IN `planTaskId` int,IN `pointId` int,IN `planTaskDetailId` int,IN `executorId`
big
int)
BEGIN
declare num int ;
declare orgCode VARCHAR(50) ;
...
...
amos-boot-system-maintenance/src/main/resources/db/mapper/LatentDangerFlowRecordMapper.xml
deleted
100644 → 0
View file @
2d57e853
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.maintenance.business.dao.mapper.LatentDangerFlowRecordMapper"
>
<insert
id=
"save"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo"
useGeneratedKeys=
"true"
>
insert into p_latent_danger_flow_record
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"dangerId != null"
>
danger_id,
</if>
<if
test=
"actionFlag != null"
>
action_flag,
</if>
<if
test=
"flowTaskName != null"
>
flow_task_name,
</if>
<if
test=
"flowTaskUserIds != null"
>
flow_task_user_ids,
</if>
<if
test=
"flowTaskId != null"
>
flow_task_id,
</if>
<if
test=
"excuteState != null"
>
excute_state,
</if>
<if
test=
"excuteUserId != null"
>
excute_user_id,
</if>
<if
test=
"excuteDepartmentId != null"
>
excute_department_id,
</if>
<if
test=
"excuteResult != null"
>
excute_result,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"flowJson != null"
>
flow_json,
</if>
<if
test=
"deleted != null"
>
deleted,
</if>
<if
test=
"createDate != null"
>
create_date,
</if>
<if
test=
"updateDate != null"
>
update_date,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"dangerId != null"
>
#{dangerId},
</if>
<if
test=
"actionFlag != null"
>
#{actionFlag},
</if>
<if
test=
"flowTaskName != null"
>
#{flowTaskName},
</if>
<if
test=
"flowTaskUserIds != null"
>
#{flowTaskUserIds},
</if>
<if
test=
"flowTaskId != null"
>
#{flowTaskId},
</if>
<if
test=
"excuteState != null"
>
#{excuteState},
</if>
<if
test=
"excuteUserId != null"
>
#{excuteUserId},
</if>
<if
test=
"excuteDepartmentId != null"
>
#{excuteDepartmentId},
</if>
<if
test=
"excuteResult != null"
>
#{excuteResult},
</if>
<if
test=
"remark != null"
>
#{remark},
</if>
<if
test=
"flowJson != null"
>
#{flowJson},
</if>
<if
test=
"deleted != null"
>
#{deleted},
</if>
<if
test=
"createDate != null"
>
#{createDate},
</if>
<if
test=
"updateDate != null"
>
#{updateDate},
</if>
</trim>
</insert>
<update
id=
"update"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo"
>
update p_latent_danger_flow_record
<set>
<if
test=
"dangerId != null"
>
danger_id = #{dangerId},
</if>
<if
test=
"actionFlag != null"
>
action_flag = #{actionFlag},
</if>
<if
test=
"flowTaskName != null"
>
flow_task_name = #{flowTaskName},
</if>
<if
test=
"flowTaskUserIds != null"
>
flow_task_user_ids = #{flowTaskUserIds},
</if>
<if
test=
"flowTaskId != null"
>
flow_task_id = #{flowTaskId},
</if>
<if
test=
"excuteState != null"
>
excute_state = #{excuteState},
</if>
<if
test=
"excuteUserId != null"
>
excute_user_id = #{excuteUserId},
</if>
<if
test=
"excuteDepartmentId != null"
>
excute_department_id = #{excuteDepartmentId},
</if>
<if
test=
"excuteResult != null"
>
excute_result = #{excuteResult},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"flowJson != null"
>
flow_json = #{flowJson},
</if>
<if
test=
"deleted != null"
>
deleted = #{deleted},
</if>
<if
test=
"createDate != null"
>
create_date = #{createDate},
</if>
<if
test=
"updateDate != null"
>
update_date = #{updateDate},
</if>
</set>
where id = #{id}
</update>
<select
id=
"getById"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo"
>
select * from p_latent_danger_flow_record where deleted = 0 and id = #{id} limit 1
</select>
<select
id=
"getNewestRecordByDangerId"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo"
>
select * from p_latent_danger_flow_record where deleted = 0 and danger_id = #{dangerId} order by create_date desc limit 1
</select>
<select
id=
"listPassByDangerId"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo"
>
select
*
from
p_latent_danger_flow_record
where
id in
(
select
max(id)
from
p_latent_danger_flow_record
where
deleted = 0
and
danger_id = #{dangerId}
and
excute_state = 2
group by action_flag
)
</select>
<select
id=
"listByDangerId"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo"
>
select
*
from
p_latent_danger_flow_record
where
deleted = 0
and
danger_id = #{dangerId}
</select>
<select
id=
"getByDangerIdAndActionFlag"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo"
>
select
*
from
p_latent_danger_flow_record
where
danger_id = #{dangerId}
and
action_flag = #{actionFlag}
order by create_date desc
limit 1
</select>
<select
id=
"getByDangerIdAndCreate"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo"
>
select
*
from
p_latent_danger_flow_record
where
danger_id = #{dangerId}
order by create_date desc
limit 1
</select>
<select
id=
"listNewestRecordByDangerIds"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo"
>
select
a.*,b.overtime_state as dangerOvertimeState,b.danger_state as dangerState
from
p_latent_danger_flow_record as a
left join
p_latent_danger as b on a.danger_id = b.id
where
a.id in
(
select
max(id)
from
p_latent_danger_flow_record
where
deleted = 0
and
danger_id in
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
and
excute_state in (2,3)
group by danger_id
)
</select>
<delete
id=
"deleteByLatentDangerIds"
>
update p_latent_danger_flow_record set deleted = 1 where danger_id in
<foreach
collection=
"list"
index=
"index"
item=
"dangerId"
open=
"("
separator=
","
close=
")"
>
#{dangerId}
</foreach>
</delete>
<select
id=
"listExecuteLog"
resultType=
"com.yeejoin.amos.maintenance.business.vo.DangerTimeAxisVo"
>
SELECT
pld.id AS dangerId,
pldfr.excute_user_id AS executeUserId,
pldfr.excute_result AS executeResult,
pld.create_date AS createDate,
pld.update_date AS updateDate,
pld.danger_name AS dangerName,
pld.danger_state AS dangerState,
pld.structure_id AS structureId,
pld.reform_limit_date AS reformLimitDate,
pld.reform_type AS reformType,
pld.delay_limit_date AS delayLimitDate,
wws.full_name AS structureName
FROM
p_latent_danger pld
LEFT JOIN p_latent_danger_flow_record pldfr ON pldfr.id = pld.current_flow_record_id
LEFT JOIN wl_warehouse_structure wws ON wws.id = pld.structure_id
<!-- WHERE-->
<!-- <if test="beginTime != null and beginTime != ''">-->
<!-- pld.reform_limit_date <![CDATA[>=]]> #{beginTime}-->
<!-- </if>-->
ORDER BY
pld.update_date DESC
</select>
<select
id=
"getByIdOderByDate"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerFlowRecordBo"
>
select * from p_latent_danger_flow_record where deleted = 0 and danger_id = #{dangerId} ORDER BY create_date DESC LIMIT 1
</select>
</mapper>
\ No newline at end of file
amos-boot-system-maintenance/src/main/resources/db/mapper/LatentDangerMapper.xml
deleted
100644 → 0
View file @
2d57e853
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.maintenance.business.dao.mapper.LatentDangerMapper"
>
<insert
id=
"save"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerBo"
useGeneratedKeys=
"true"
>
insert into p_latent_danger
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"businessKey != null"
>
business_key,
</if>
<if
test=
"orgCode != null"
>
org_code,
</if>
<if
test=
"dangerName != null"
>
danger_name,
</if>
<if
test=
"currentFlowRecordId != null"
>
current_flow_record_id,
</if>
<if
test=
"instanceId != null"
>
instance_id,
</if>
<if
test=
"dangerLevel != null"
>
danger_level,
</if>
<if
test=
"dangerPosition != null"
>
danger_position,
</if>
<if
test=
"dangerType != null"
>
danger_type,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"overtimeState != null"
>
overtime_state,
</if>
<if
test=
"reformType != null"
>
reform_type,
</if>
<if
test=
"reformLimitDate != null"
>
reform_limit_date,
</if>
<if
test=
"reformJson != null"
>
reform_json,
</if>
<if
test=
"dangerState != null"
>
danger_state,
</if>
<if
test=
"discovererUserId != null"
>
discoverer_user_id,
</if>
<if
test=
"discovererDepartmentId != null"
>
discoverer_department_id,
</if>
<if
test=
"photoUrls != null"
>
photo_urls,
</if>
<if
test=
"deleted != null"
>
deleted,
</if>
<if
test=
"createDate != null"
>
create_date,
</if>
<if
test=
"updateDate != null"
>
update_date,
</if>
<if
test=
"problemDescription != null"
>
problem_description,
</if>
<if
test=
"checkInputId != null"
>
check_input_id,
</if>
<if
test=
"structureId != null"
>
structure_id,
</if>
<if
test=
"structureName != null"
>
structure_name,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"businessKey != null"
>
#{businessKey},
</if>
<if
test=
"orgCode != null"
>
#{orgCode},
</if>
<if
test=
"dangerName != null"
>
#{dangerName},
</if>
<if
test=
"currentFlowRecordId != null"
>
#{currentFlowRecordId},
</if>
<if
test=
"instanceId != null"
>
#{instanceId},
</if>
<if
test=
"dangerLevel != null"
>
#{dangerLevel},
</if>
<if
test=
"dangerPosition != null"
>
#{dangerPosition},
</if>
<if
test=
"dangerType != null"
>
#{dangerType},
</if>
<if
test=
"remark != null"
>
#{remark},
</if>
<if
test=
"overtimeState != null"
>
#{overtimeState},
</if>
<if
test=
"reformType != null"
>
#{reformType},
</if>
<if
test=
"reformLimitDate != null"
>
#{reformLimitDate},
</if>
<if
test=
"reformJson != null"
>
#{reformJson},
</if>
<if
test=
"dangerState != null"
>
#{dangerState},
</if>
<if
test=
"discovererUserId != null"
>
#{discovererUserId},
</if>
<if
test=
"discovererDepartmentId != null"
>
#{discovererDepartmentId},
</if>
<if
test=
"photoUrls != null"
>
#{photoUrls},
</if>
<if
test=
"deleted != null"
>
#{deleted},
</if>
<if
test=
"createDate != null"
>
#{createDate},
</if>
<if
test=
"updateDate != null"
>
#{updateDate},
</if>
<if
test=
"problemDescription != null"
>
#{problemDescription},
</if>
<if
test=
"checkInputId != null"
>
#{checkInputId},
</if>
<if
test=
"structureId != null"
>
#{structureId},
</if>
<if
test=
"structureName != null"
>
#{structureName},
</if>
</trim>
</insert>
<update
id=
"update"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerBo"
>
update p_latent_danger
<set>
<if
test=
"businessKey != null"
>
business_key = #{businessKey},
</if>
<if
test=
"orgCode != null"
>
org_code = #{orgCode},
</if>
<if
test=
"dangerName != null"
>
danger_name = #{dangerName},
</if>
<if
test=
"currentFlowRecordId != null"
>
current_flow_record_id = #{currentFlowRecordId},
</if>
<if
test=
"instanceId != null"
>
instance_id = #{instanceId},
</if>
<if
test=
"dangerLevel != null"
>
danger_level = #{dangerLevel},
</if>
<if
test=
"dangerPosition != null"
>
danger_position = #{dangerPosition},
</if>
<if
test=
"dangerType != null"
>
danger_type = #{dangerType},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"overtimeState != null"
>
overtime_state = #{overtimeState},
</if>
<if
test=
"currentFlowRecordId != null"
>
current_flow_record_id = #{currentFlowRecordId},
</if>
<if
test=
"reformType != null"
>
reform_type = #{reformType},
</if>
<if
test=
"reformLimitDate != null"
>
reform_limit_date = #{reformLimitDate},
</if>
<if
test=
"reformJson != null"
>
reform_json = #{reformJson},
</if>
<if
test=
"dangerState != null"
>
danger_state = #{dangerState},
</if>
<if
test=
"discovererUserId != null"
>
discoverer_user_id = #{discovererUserId},
</if>
<if
test=
"discovererDepartmentId != null"
>
discoverer_department_id = #{discovererDepartmentId},
</if>
<if
test=
"photoUrls != null"
>
photo_urls = #{photoUrls},
</if>
<if
test=
"deleted != null"
>
deleted = #{deleted},
</if>
<if
test=
"createDate != null"
>
create_date = #{createDate},
</if>
<if
test=
"updateDate != null"
>
update_date = #{updateDate},
</if>
<if
test=
"delayLimitDate != null"
>
delay_limit_date = #{delayLimitDate},
</if>
<if
test=
"reasonAnalysis != null"
>
reason_analysis = #{reasonAnalysis},
</if>
<if
test=
"inferOtherThings != null"
>
infer_other_things = #{inferOtherThings},
</if>
<if
test=
"problemDescription != null"
>
problem_description = #{problemDescription},
</if>
</set>
where id = #{id}
</update>
<update
id=
"deleteByIds"
>
update p_latent_danger set deleted = 1 where id in
<foreach
collection=
"list"
index=
"index"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</update>
<select
id=
"getById"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerBo"
>
select * from p_latent_danger where deleted = 0 and id = #{id}
</select>
<select
id=
"getByInstanceId"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerBo"
>
select * from p_latent_danger where deleted = 0 and instance_id = #{instanceId} and danger_state = 3 limit 1
</select>
<select
id=
"listByMap"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerBo"
>
select
a.*
from
p_latent_danger as a
left join
p_latent_danger_flow_record as b on a.current_flow_record_id = b.id
<where>
<!-- case-->
<!-- when a.danger_type = 1 and find_in_set(b.action_flag, 'B_3,B_4') then-->
<!-- 1=1-->
<!-- <if test="userId != null and userId != ''">-->
<!-- and find_in_set( #{userId}, b.flow_task_user_ids )-->
<!-- </if>-->
<!-- else-->
<!-- 1=1-->
<!-- <if test="userId != null and userId != ''">-->
<!-- and (find_in_set(#{userId}, b.flow_task_user_ids) or find_in_set(b.action_flag, #{permissions}))-->
<!-- </if>-->
<!-- end-->
<!-- and a.deleted = 0-->
<!-- and b.deleted = 0-->
<if
test=
"dangerLevel != null and dangerLevel != -1"
>
and a.danger_level=#{dangerLevel}
</if>
<if
test=
"dangerState != null and dangerState != ''"
>
and a.danger_state=#{dangerState}
</if>
<if
test=
"states != null"
>
and a.danger_state in
<foreach
collection=
"states"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"dangerName != null and dangerName != ''"
>
and a.danger_name like concat('%',#{dangerName},'%')
</if>
<if
test=
"org_code != null and org_code != ''"
>
and a.org_code = #{org_code}
</if>
<!-- <if test="discoverer_department_id != null and discoverer_department_id != ''">-->
<!-- and (a.discoverer_department_id = #{discoverer_department_id} or ISNULL(a.discoverer_department_id))-->
<!-- </if>-->
</where>
order by a.create_date desc
<if
test=
"limit != null and offset != null"
>
limit #{offset},#{limit}
</if>
</select>
<select
id=
"countByMap"
resultType=
"java.lang.Long"
>
select
count(1)
from
p_latent_danger as a
left join
p_latent_danger_flow_record as b on a.current_flow_record_id = b.id
<where>
case
when a.danger_type = 1 and find_in_set(b.action_flag, 'B_3,B_4') then
1=1
<if
test=
"userId != null and userId != ''"
>
and find_in_set( #{userId}, b.flow_task_user_ids )
</if>
else
1=1
<if
test=
"userId != null and userId != ''"
>
and (find_in_set(#{userId}, b.flow_task_user_ids) or find_in_set(b.action_flag, #{permissions}))
</if>
end
and a.deleted = 0
and b.deleted = 0
<if
test=
"dangerLevel != null and dangerLevel != -1"
>
and a.danger_level=#{dangerLevel}
</if>
<if
test=
"dangerState != null and dangerState != ''"
>
and a.danger_state=#{dangerState}
</if>
<if
test=
"states != null"
>
and a.danger_state in
<foreach
collection=
"states"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"dangerName != null and dangerName != ''"
>
and a.danger_name like concat('%',#{dangerName},'%')
</if>
<if
test=
"org_code != null and org_code != ''"
>
and a.org_code = #{org_code}
</if>
<if
test=
"discoverer_department_id != null and discoverer_department_id != ''"
>
and (a.discoverer_department_id = #{discoverer_department_id} or ISNULL(a.discoverer_department_id))
</if>
</where>
</select>
<select
id=
"listOfOvertime"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerBo"
>
select * from p_latent_danger where now()>reform_limit_date and overtime_state = 0 and deleted = 0 and danger_state in (2,3,4)
</select>
<select
id=
"countNotFinishByFlowId"
resultType=
"java.lang.Integer"
>
select
count(1)
from
p_latent_danger
where
deleted = 0
and
danger_state in (1,2,3,4)
and
id in
(
select
latent_danger_id
from
p_latent_danger_patrol
where
risk_factor_flow_id = #{value}
and
deleted = 0
)
</select>
<select
id=
"listNotFinishByPointId"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerBo"
>
select
*
from
p_latent_danger
where
deleted = 0
and
danger_state in (1,2,3,4)
and
id in
(
select
latent_danger_id
from
p_latent_danger_patrol
where
point_id = #{pointId}
and
deleted = 0
)
and id !=#{dangerId}
</select>
<select
id=
"countByFlowUserIds"
resultType=
"java.lang.Long"
>
select
count(1)
from
p_latent_danger as a
left join
p_latent_danger_flow_record as b on a.current_flow_record_id = b.id
where
find_in_set(#{userId},b.flow_task_user_ids)
and
a.deleted = 0
and
a.danger_state in (1,2,4)
</select>
<select
id=
"countNotFinishByTypeAndDeptId"
resultType=
"java.lang.Long"
>
SELECT
count(1)
FROM
p_latent_danger a,
p_latent_danger_patrol b,
p_point c,
spc_risk_source d
WHERE
a.danger_level = #{type}
<if
test=
"departmentId != null and departmentId != -1"
>
and d.belong_department_id = #{departmentId}
</if>
and a.danger_type IN (2, 3)
AND (
a.danger_state IN (2, 3, 4)
OR a.danger_state = 5
AND DATEDIFF(a.update_date, CURDATE()) = 0
)
and b.latent_danger_id = a.id
and b.point_id = c.id
and c.original_id = d.id
</select>
<select
id=
"getNotFinishIdsByTypeAndDeptId"
resultType=
"java.lang.String"
>
SELECT
GROUP_CONCAT(DISTINCT a.id ) extraIds
FROM
p_latent_danger a,
p_latent_danger_patrol b,
p_point c,
spc_risk_source d
WHERE
a.danger_level = #{type} -- (1,2)
<if
test=
"departmentId != null and departmentId != -1"
>
and d.belong_department_id = #{departmentId}
</if>
AND a.danger_type IN ( 2, 3 ) -- 2:巡检隐患;3:有码无计划隐患
AND (
a.danger_state IN ( 2, 3, 4 ) -- 2:待治理;3:安措计划中;4:待验证;5:治理完毕
OR a.danger_state = 5
AND DATEDIFF( a.update_date, CURDATE( ) ) = 0
)
AND b.latent_danger_id = a.id
AND b.point_id = c.id
AND c.original_id = d.id;
</select>
<select
id=
"listNeedNoticeDanger"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerNoticeBo"
>
SELECT
ld.id dangerId,
ld.org_code orgCode,
ld.danger_state dangerState,
ld.danger_name dangerName,
ld.instance_id instanceId,
ld.reform_limit_date reformLimitDate
FROM
p_latent_danger ld
WHERE
TIMESTAMPDIFF( MINUTE, now(), ld.reform_limit_date ) = TIMESTAMPDIFF( MINUTE, (SELECT DATE_ADD(CURDATE(),
INTERVAL 8 HOUR)), ld.reform_limit_date ) -- 截止日期到当天早上8:00:00分钟数
AND ld.overtime_state = 0
AND ld.deleted = 0
AND ld.danger_state = 2;
</select>
<select
id=
"getReViewInfo"
resultType=
"java.util.HashMap"
>
SELECT
f.id,
f.danger_id dangerId,
f.action_flag actionFlag,
f.flow_task_name flowTaskName,
CASE
WHEN f.excute_state = 2 THEN
'通过'
WHEN f.excute_state = 3 THEN
'驳回'
END executeState,
f.excute_user_id executeUserId,
f.update_date reViewDate,
ld.reform_limit_date reformLimitDate,
f.flow_json flowJson,
f.remark,
ld.infer_other_things inferOtherThings,
(select ff.flow_task_user_ids from p_latent_danger_flow_record ff where ff.danger_id = f.danger_id and
ff.action_flag = 'B_3' limit 1 ) handleUserIds,
CASE
WHEN ld.reform_type = 1 THEN
'常规整改'
WHEN ld.reform_type = 2 THEN
'安措计划'
WHEN ld.reform_type = 3 THEN
'延期治理'
END reformTypeName,
ld.reform_type reformType,
ld.delay_limit_date delayLimitDate
FROM
p_latent_danger_flow_record f
LEFT JOIN p_latent_danger ld ON ld.id = f.danger_id
WHERE
f.action_flag != 'B_1'
AND NOT ISNULL( f.update_date )
AND f.excute_state != 1
AND f.danger_id = #{dangerId}
</select>
<select
id=
"dangerListByMap"
resultType=
"com.yeejoin.amos.maintenance.core.common.response.DangerListResponse"
>
SELECT
*
FROM
(
SELECT
pld.id,
pld.danger_name dangerName,
pld.danger_position dangerPosition,
pld.danger_level dangerLevel,
pld.reform_type reformType,
pld.reform_limit_date deadlineDate,
pld.danger_state dangerState,
pld.overtime_state overtimeState,
pld.problem_description problemDescription,
pld.reason_analysis reasonAnalysis,
pld.infer_other_things inferOtherThings,
pld.remark,
pp.plan_type planType,
pp.`name` planName,
pr.`name` routeName,
pld.danger_type dangerType,
pc.check_time checkTimeDate,
pii.`name` checkContent,
pc.user_id checkUser,
pc.error checkResult,
pc.is_ok checkStatus,
pld.id dangerId,
pld.reform_json measures,
pld.instance_id processInstanceId,
pld.discoverer_user_id discoverUser,
p.original_id riskSourceId,
pld.structure_id structureId,
pld.structure_name structureName
FROM
p_latent_danger pld
LEFT JOIN p_latent_danger_patrol ldp ON pld.id = ldp.latent_danger_id
LEFT JOIN p_point p ON p.id = ldp.point_id
LEFT JOIN p_point_classify ppc ON ppc.id = ldp.point_classify_id
LEFT JOIN p_input_item pii ON pii.id = ldp.item_id
LEFT JOIN p_check pc ON pc.id = ldp.check_id
LEFT JOIN p_plan pp ON pp.id = pc.plan_id
LEFT JOIN p_route pr ON pr.id = pc.route_id
<where>
<if
test=
"dangerIds != null"
>
pld.id IN
<foreach
collection=
"dangerIds"
item=
"id"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
</where>
) temp
WHERE
1 = 1
<if
test=
"type != null and type !=''"
>
AND type = #{type}
</if>
<if
test=
"eqCode != null and eqCode !=''"
>
AND eqCode LIKE concat('%',#{eqCode},'%')
</if>
<if
test=
"dangerName != null and dangerName !=''"
>
AND dangerName LIKE concat('%',#{dangerName},'%')
</if>
<if
test=
"planType != null and planType !=''"
>
AND planType = #{planType}
</if>
<if
test=
"structureId != null and structureId.size > 0"
>
AND structureId in
<foreach
collection=
"structureId"
open=
"("
close=
")"
separator=
","
item=
"sid"
>
#{sid}
</foreach>
</if>
<if
test=
"routeName != null and routeName !=''"
>
AND routeName LIKE concat('%',#{routeName},'%')
</if>
<if
test=
"planName != null and planName !=''"
>
AND planName LIKE concat('%',#{planName},'%')
</if>
<if
test=
"beginCheckTime != null and beginCheckTime !=''"
>
AND checkTimeDate
<![CDATA[>=]]>
#{beginCheckTime}
</if>
<if
test=
"endCheckTime != null and endCheckTime !=''"
>
AND checkTimeDate
<![CDATA[<=]]>
#{endCheckTime}
</if>
<if
test=
"checkDep != null and checkDep !=''"
>
AND checkDep = #{checkDep}
</if>
<if
test=
"checkUser != null and checkUser !=''"
>
AND checkUser = #{checkUser}
</if>
<if
test=
"checkResult != null and checkResult !=''"
>
AND checkResult LIKE concat('%',#{checkResult},'%')
</if>
<if
test=
"beginDeadline != null and beginDeadline !=''"
>
AND deadlineDate
<![CDATA[>=]]>
#{beginDeadline}
</if>
<if
test=
"endDeadline != null and endDeadline !=''"
>
AND deadlineDate
<![CDATA[<=]]>
#{endDeadline}
</if>
<if
test=
"governDep != null and governDep !=''"
>
AND governDep = #{governDep}
</if>
<if
test=
"governUser != null and governUser !=''"
>
AND governUser = #{governUser}
</if>
<if
test=
"dangerLevel != null and dangerLevel !=''"
>
AND dangerLevel = #{dangerLevel}
</if>
<if
test=
"dangerType != null and dangerType !=''"
>
AND dangerType = #{dangerType}
</if>
<if
test=
"reformType != null and reformType !=''"
>
AND reformType = #{reformType}
</if>
<if
test=
"overtimeState != null and overtimeState !=''"
>
AND overtimeState = #{overtimeState}
</if>
<if
test=
"dangerState != null and dangerState !=''"
>
AND dangerState = #{dangerState}
</if>
<if
test=
"verifyDep != null and verifyDep !=''"
>
AND verifyDep = #{verifyDep}
</if>
<if
test=
"verifyUser != null and verifyUser !=''"
>
AND verifyUser = #{verifyUser}
</if>
<if
test=
"riskSourceId != null and riskSourceId !=''"
>
AND riskSourceId = #{riskSourceId}
</if>
ORDER BY temp.id desc
<if
test=
"offset != null and pageSize != null"
>
limit #{offset},#{pageSize}
</if>
</select>
<select
id=
"countDangerListByMap"
resultType=
"java.lang.Long"
>
SELECT
COUNT(1)
FROM
(
SELECT
pld.danger_name dangerName,
pld.danger_position dangerPosition,
pld.structure_name structureName,
pld.structure_id structureId,
pld.danger_level dangerLevel,
pld.reform_type reformType,
pld.reform_limit_date deadlineDate,
pld.danger_state dangerState,
pld.overtime_state overtimeState,
pp.plan_type planType,
pp.`name` planName,
pr.`name` routeName,
pld.danger_type dangerType,
pc.check_time checkTimeDate,
pii.`name` checkContent,
pc.user_id checkUser,
pc.error checkResult,
pc.is_ok checkStatus,
pld.id dangerId,
dangerFlow.governDep,
dangerFlow.governUser,
dangerFlow.governDate,
dangerFlow.verifyDep,
dangerFlow.verifyUser,
dangerFlow.verifyResult,
pld.reform_json measures
FROM
p_latent_danger pld
LEFT JOIN p_latent_danger_patrol ldp ON pld.id = ldp.latent_danger_id
LEFT JOIN p_point_classify ppc ON ppc.id = ldp.point_classify_id
LEFT JOIN p_input_item pii ON pii.id = ldp.item_id
LEFT JOIN p_check pc ON pc.id = ldp.check_id
LEFT JOIN p_plan pp ON pp.id = pc.plan_id
LEFT JOIN p_route pr ON pr.id = pc.route_id
LEFT JOIN (
SELECT
GROUP_CONCAT(
CASE
WHEN action_flag = 'B_3' THEN
excute_department_id
ELSE
NULL
END
) governDep,
GROUP_CONCAT(
CASE
WHEN action_flag = 'B_3' THEN
excute_user_id
ELSE
NULL
END
) governUser,
GROUP_CONCAT(
CASE
WHEN action_flag = 'B_3' THEN
update_date
ELSE
NULL
END
) governDate,
GROUP_CONCAT(
CASE
WHEN action_flag = 'B_4' THEN
excute_department_id
ELSE
NULL
END
) verifyDep,
GROUP_CONCAT(
CASE
WHEN action_flag = 'B_4' THEN
excute_user_id
ELSE
NULL
END
) verifyUser,
GROUP_CONCAT(
CASE
WHEN action_flag = 'B_4' THEN
pldfr.excute_result
ELSE
NULL
END
) verifyResult,
pldfr.danger_id dangerId
FROM
(
SELECT
*
FROM
p_latent_danger_flow_record
WHERE
id IN (
SELECT
max(id)
FROM
p_latent_danger_flow_record
WHERE
deleted = 0
AND action_flag IN ('B_3', 'B_4')
GROUP BY
action_flag,
danger_id
)
) pldfr
GROUP BY
pldfr.danger_id
) dangerFlow ON dangerFlow.dangerId = pld.id
<where>
<if
test=
"dangerIds != null"
>
pld.id IN
<foreach
collection=
"dangerIds"
item=
"id"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
</where>
) temp
WHERE
1 = 1
<if
test=
"type != null and type !=''"
>
AND type = #{type}
</if>
<if
test=
"eqCode != null and eqCode !=''"
>
AND eqCode LIKE concat('%',#{eqCode},'%')
</if>
<if
test=
"dangerName != null and dangerName !=''"
>
AND dangerName LIKE concat('%',#{dangerName},'%')
</if>
<if
test=
"planType != null and planType !=''"
>
AND planType = #{planType}
</if>
<if
test=
"structureId != null and structureId.size > 0"
>
AND structureId in
<foreach
collection=
"structureId"
open=
"("
close=
")"
separator=
","
item=
"sid"
>
#{sid}
</foreach>
</if>
<if
test=
"routeName != null and routeName !=''"
>
AND routeName LIKE concat('%',#{routeName},'%')
</if>
<if
test=
"planName != null and planName !=''"
>
AND planName LIKE concat('%',#{planName},'%')
</if>
<if
test=
"beginCheckTime != null and beginCheckTime !=''"
>
AND checkTimeDate
<![CDATA[>=]]>
#{beginCheckTime}
</if>
<if
test=
"endCheckTime != null and endCheckTime !=''"
>
AND checkTimeDate
<![CDATA[<=]]>
#{endCheckTime}
</if>
<if
test=
"checkDep != null and checkDep !=''"
>
AND checkDep = #{checkDep}
</if>
<if
test=
"checkUser != null and checkUser !=''"
>
AND checkUser = #{checkUser}
</if>
<if
test=
"checkResult != null and checkResult !=''"
>
AND checkResult LIKE concat('%',#{checkResult},'%')
</if>
<if
test=
"beginDeadline != null and beginDeadline !=''"
>
AND deadlineDate
<![CDATA[>=]]>
#{beginDeadline}
</if>
<if
test=
"endDeadline != null and endDeadline !=''"
>
AND deadlineDate
<![CDATA[<=]]>
#{endDeadline}
</if>
<if
test=
"governDep != null and governDep !=''"
>
AND governDep = #{governDep}
</if>
<if
test=
"governUser != null and governUser !=''"
>
AND governUser = #{governUser}
</if>
<if
test=
"dangerLevel != null and dangerLevel !=''"
>
AND dangerLevel = #{dangerLevel}
</if>
<if
test=
"dangerType != null and dangerType !=''"
>
AND dangerType = #{dangerType}
</if>
<if
test=
"reformType != null and reformType !=''"
>
AND reformType = #{reformType}
</if>
<if
test=
"overtimeState != null and overtimeState !=''"
>
AND overtimeState = #{overtimeState}
</if>
<if
test=
"dangerState != null and dangerState !=''"
>
AND dangerState = #{dangerState}
</if>
<if
test=
"verifyDep != null and verifyDep !=''"
>
AND verifyDep = #{verifyDep}
</if>
<if
test=
"verifyUser != null and verifyUser !=''"
>
AND verifyUser = #{verifyUser}
</if>
<if
test=
"riskSourceId != null and riskSourceId !=''"
>
AND riskSourceId = #{riskSourceId}
</if>
</select>
<select
id=
"getByBathBusinessKeys"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerBo"
>
SELECT
*
FROM
p_latent_danger pld
WHERE
pld.business_key IN
<foreach
collection =
"businessKeys"
item =
"businessKey"
index=
"index"
open =
"("
close =
")"
separator =
","
>
#{businessKey}
</foreach>
<if
test=
"latentDangerListParam.dangerLevel != null and latentDangerListParam.dangerLevel != -1"
>
and pld.danger_level=#{latentDangerListParam.dangerLevel}
</if>
<if
test=
"latentDangerListParam.dangerState != null and latentDangerListParam.dangerState != ''"
>
and pld.danger_state=#{latentDangerListParam.dangerState}
</if>
<if
test=
"latentDangerListParam.userId != null and latentDangerListParam.userId != ''"
>
and pld.discoverer_user_id=#{latentDangerListParam.userId}
</if>
<if
test=
"latentDangerListParam.dangerName != null and latentDangerListParam.dangerName !=''"
>
AND pld.danger_name LIKE concat('%',#{latentDangerListParam.dangerName},'%')
</if>
ORDER BY create_date DESC
<if
test=
"latentDangerListParam.pageSize != null and latentDangerListParam.offset != null"
>
limit #{latentDangerListParam.offset}, #{latentDangerListParam.pageSize}
</if>
</select>
<select
id=
"countByBathBusinessKeys"
resultType=
"java.lang.Integer"
>
SELECT
count(*)
FROM
p_latent_danger pld
WHERE
pld.business_key IN
<foreach
collection =
"businessKeys"
item =
"businessKey"
index=
"index"
open =
"("
close =
")"
separator =
","
>
#{businessKey}
</foreach>
<if
test=
"latentDangerListParam.dangerLevel != null and latentDangerListParam.dangerLevel != -1"
>
and pld.danger_level=#{latentDangerListParam.dangerLevel}
</if>
<if
test=
"latentDangerListParam.dangerState != null and latentDangerListParam.dangerState != ''"
>
and pld.danger_state=#{latentDangerListParam.dangerState}
</if>
<if
test=
"latentDangerListParam.userId != null and latentDangerListParam.userId != ''"
>
and pld.discoverer_user_id=#{latentDangerListParam.userId}
</if>
<if
test=
"latentDangerListParam.dangerName != null and latentDangerListParam.dangerName !=''"
>
AND pld.danger_name LIKE concat('%',#{latentDangerListParam.dangerName},'%')
</if>
</select>
<select
id=
"countByStatus"
resultType=
"java.lang.Integer"
>
SELECT
count(*)
FROM
p_latent_danger pld
WHERE
pld.deleted = 0
AND
pld.danger_state in (1,2,4,7,8,9)
AND
pld.business_key IN
<foreach
collection =
"businessKeys"
item =
"businessKey"
index=
"index"
open =
"("
close =
")"
separator =
","
>
#{businessKey}
</foreach>
</select>
<update
id=
"updateCheckInputDangerState"
>
update
p_check_input
set danger_handle_state = #{code}
where id = #{id};
</update>
<select
id=
"getbyBusinessKey"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerBo"
>
SELECT
*
FROM
p_latent_danger pld
WHERE
pld.business_key = #{businessKey}
</select>
</mapper>
\ No newline at end of file
amos-boot-system-maintenance/src/main/resources/db/mapper/LatentDangerPatrolMapper.xml
deleted
100644 → 0
View file @
2d57e853
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.maintenance.business.dao.mapper.LatentDangerPatrolMapper"
>
<insert
id=
"save"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo"
useGeneratedKeys=
"true"
>
insert into p_latent_danger_patrol
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"latentDangerId != null"
>
latent_danger_id,
</if>
<if
test=
"pointClassifyId != null"
>
point_classify_id,
</if>
<!-- <if test="riskFactorFlowId != null">-->
<!-- risk_factor_flow_id,-->
<!-- </if>-->
<if
test=
"checkId != null"
>
check_id,
</if>
<if
test=
"itemId != null"
>
item_id,
</if>
<if
test=
"pointId != null"
>
point_id,
</if>
<if
test=
"routeId != null"
>
route_id,
</if>
<if
test=
"routePointItemId != null"
>
route_point_item_id,
</if>
<if
test=
"deleted != null"
>
deleted,
</if>
<if
test=
"createDate != null"
>
create_date,
</if>
<if
test=
"updateDate != null"
>
update_date,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"latentDangerId != null"
>
#{latentDangerId},
</if>
<if
test=
"pointClassifyId != null"
>
#{pointClassifyId},
</if>
<!-- <if test="riskFactorFlowId != null">-->
<!-- #{riskFactorFlowId},-->
<!-- </if>-->
<if
test=
"checkId != null"
>
#{checkId},
</if>
<if
test=
"itemId != null"
>
#{itemId},
</if>
<if
test=
"pointId != null"
>
#{pointId},
</if>
<if
test=
"routeId != null"
>
#{routeId},
</if>
<if
test=
"routePointItemId != null"
>
#{routePointItemId},
</if>
<if
test=
"deleted != null"
>
#{deleted},
</if>
<if
test=
"createDate != null"
>
#{createDate},
</if>
<if
test=
"updateDate != null"
>
#{updateDate},
</if>
</trim>
</insert>
<update
id=
"update"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo"
>
update p_latent_danger_patrol
<set>
<if
test=
"latentDangerId != null"
>
latent_danger_id = #{latentDangerId},
</if>
<if
test=
"pointClassifyId != null"
>
point_classify_id = #{pointClassifyId},
</if>
<if
test=
"checkId != null"
>
check_id = #{checkId},
</if>
<if
test=
"riskFactorFlowId != null"
>
risk_factor_flow_id = #{riskFactorFlowId},
</if>
<if
test=
"itemId != null"
>
item_id = #{itemId},
</if>
<if
test=
"pointId != null"
>
point_id = #{pointId},
</if>
<if
test=
"routeId != null"
>
route_id = #{routeId},
</if>
<if
test=
"routePointItemId != null"
>
route_point_item_id = #{routePointItemId},
</if>
<if
test=
"deleted != null"
>
deleted = #{deleted},
</if>
<if
test=
"createDate != null"
>
create_date = #{createDate},
</if>
<if
test=
"updateDate != null"
>
update_date = #{updateDate},
</if>
</set>
where id = #{id}
</update>
<delete
id=
"deleteByLatentDangerIds"
>
update p_latent_danger_patrol set deleted = 1 where latent_danger_id in
<foreach
collection=
"list"
index=
"index"
item=
"latentDangerId"
open=
"("
separator=
","
close=
")"
>
#{latentDangerId}
</foreach>
</delete>
<select
id=
"getByDangerId"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo"
>
select
a.*,
b.name as itemName,
b.original_id as itemOriginalId,
b.basis_json as itemBasis,
b.remark as itemRemark,
c.name as pointName,
c.point_no as pointNo,
c.level as pointLevel,
c.charge_dept_id as pointDepartMentId,
c.original_id as pointOriginalId,
d.name as routeName,
e.check_time as checkTime,
e.user_id as checkUserId,
e.dep_id as checkDepartmentId,
f.name as planName,
f.plan_type as planType,
f.execute_rate as executeRate,
g.original_id as classifyOriginalId,
g.name as classifyName
from
p_latent_danger_patrol as a
left join
p_input_item as b on a.item_id = b.id
left join
p_point as c on a.point_id = c.id
left join
p_route as d on a.route_id = d.id
left join
p_check as e on a.check_id = e.id
left join
p_plan as f on e.plan_id = f.id
left join
p_point_classify as g on a.point_classify_id = g.id
where
a.deleted = 0
and
a.latent_danger_id = #{dangerId}
</select>
<select
id=
"listByMap"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo"
>
select
a.*
from
p_latent_danger_patrol as a
left join
p_latent_danger as b
<where>
<if
test=
"pointId != null"
>
and a.point_id = #{pointId}
</if>
<if
test=
"itemId != null"
>
and a.item_id = #{itemId}
</if>
<if
test=
"pointClassifyId != null"
>
and a.point_classify_id = #{pointClassifyId}
</if>
<if
test=
"dangerType != null"
>
and b.danger_type = #{dangerType}
</if>
</where>
</select>
<select
id=
"listByPointId"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo"
>
select
*
from
p_latent_danger_patrol
where
point_id = #{pointId}
</select>
<select
id=
"queryByPointClassifyIds"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.extend.LatentDangerPatrolBo"
>
select * from p_latent_danger_patrol where point_classify_id in
<foreach
collection=
"list"
index=
"index"
item=
"pointClassifyId"
open=
"("
separator=
","
close=
")"
>
#{pointClassifyId}
</foreach>
</select>
</mapper>
\ No newline at end of file
amos-boot-system-maintenance/src/main/resources/db/mapper/SpcRiskJudgmentFillRecordMapper.xml
deleted
100644 → 0
View file @
2d57e853
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.maintenance.business.dao.mapper.RiskJudgmentFillRecordMapper"
>
<insert
id=
"save"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentFillRecordBo"
useGeneratedKeys=
"true"
>
insert into spc_risk_judgment_fill_record
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"taskId != null"
>
task_id,
</if>
<if
test=
"itemId != null"
>
item_id,
</if>
<if
test=
"selectResult != null"
>
select_result,
</if>
<if
test=
"inputResult != null"
>
input_result,
</if>
<if
test=
"remarkResult != null"
>
remark_result,
</if>
<if
test=
"photoResult != null"
>
photo_result,
</if>
<if
test=
"itemFinish != null"
>
item_finish,
</if>
<if
test=
"deleted != null"
>
deleted,
</if>
<if
test=
"createDate != null"
>
create_date,
</if>
<if
test=
"updateDate != null"
>
update_date,
</if>
<if
test=
"orgCode != null"
>
org_code,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"taskId != null"
>
#{taskId},
</if>
<if
test=
"itemId != null"
>
#{itemId},
</if>
<if
test=
"selectResult != null"
>
#{selectResult},
</if>
<if
test=
"inputResult != null"
>
#{inputResult},
</if>
<if
test=
"remarkResult != null"
>
#{remarkResult},
</if>
<if
test=
"photoResult != null"
>
#{photoResult},
</if>
<if
test=
"itemFinish != null"
>
#{itemFinish},
</if>
<if
test=
"deleted != null"
>
#{deleted},
</if>
<if
test=
"createDate != null"
>
#{createDate},
</if>
<if
test=
"updateDate != null"
>
#{updateDate},
</if>
<if
test=
"orgCode != null"
>
#{orgCode},
</if>
</trim>
</insert>
<update
id=
"update"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentFillRecordBo"
>
update spc_risk_judgment_fill_record
<set>
<if
test=
"taskId != null"
>
task_id = #{taskId},
</if>
<if
test=
"itemId != null"
>
item_id = #{itemId},
</if>
<if
test=
"selectResult != null"
>
select_result = #{selectResult},
</if>
<if
test=
"inputResult != null"
>
input_result = #{inputResult},
</if>
<if
test=
"remarkResult != null"
>
remark_result = #{remarkResult},
</if>
<if
test=
"itemFinish != null"
>
item_finish = #{itemFinish},
</if>
<if
test=
"photoResult != null"
>
photo_result = #{photoResult},
</if>
<if
test=
"deleted != null"
>
deleted = #{deleted},
</if>
<if
test=
"createDate != null"
>
create_date = #{createDate},
</if>
<if
test=
"updateDate != null"
>
update_date = #{updateDate},
</if>
<if
test=
"orgCode != null"
>
org_code = #{orgCode},
</if>
</set>
where id = #{id}
</update>
<insert
id=
"saveBatch"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentFillRecordBo"
useGeneratedKeys=
"true"
>
insert into spc_risk_judgment_fill_record
(
task_id,
item_id,
select_result,
input_result,
remark_result,
photo_result,
org_code
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.taskId},
#{item.itemId},
#{item.selectResult},
#{item.inputResult},
#{item.remarkResult},
#{item.photoResult},
#{item.orgCode}
)
</foreach>
</insert>
<insert
id=
"saveBatchWithStatus"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentFillRecordBo"
useGeneratedKeys=
"true"
>
insert into spc_risk_judgment_fill_record
(
task_id,
item_id,
select_result,
input_result,
remark_result,
photo_result,
org_code,
item_finish
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.taskId},
#{item.itemId},
#{item.selectResult},
#{item.inputResult},
#{item.remarkResult},
#{item.photoResult},
#{item.orgCode},
#{item.itemFinish}
)
</foreach>
</insert>
<update
id=
"updateBatch"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentFillRecordBo"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
";"
>
update spc_risk_judgment_fill_record
<set>
<if
test=
"item.taskId != null"
>
task_id = #{item.taskId},
</if>
<if
test=
"item.itemId != null"
>
item_id = #{item.itemId},
</if>
<if
test=
"item.selectResult != null"
>
select_result = #{item.selectResult},
</if>
<if
test=
"item.inputResult != null"
>
input_result = #{item.inputResult},
</if>
<if
test=
"item.remarkResult != null"
>
remark_result = #{item.remarkResult},
</if>
<if
test=
"item.itemFinish != null"
>
item_finish = #{item.itemFinish},
</if>
<if
test=
"item.photoResult != null"
>
photo_result = #{item.photoResult},
</if>
<if
test=
"item.deleted != null"
>
deleted = #{item.deleted},
</if>
<if
test=
"item.createDate != null"
>
create_date = #{item.createDate},
</if>
<if
test=
"item.updateDate != null"
>
update_date = #{item.updateDate},
</if>
<if
test=
"item.orgCode != null"
>
org_code = #{item.orgCode},
</if>
<if
test=
"item.extraIds != null"
>
extra_ids = #{item.extraIds},
</if>
</set>
where id = #{item.id}
</foreach>
</update>
<select
id=
"listFillRecordData"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentFillRecordBo"
>
select
b.order_num,
a.*,
b.item_flag,
b.item_level,
b.item_type,
b.item_name,
b.item_can_copy,
b.item_parent_id,
b.select_name,
b.select_is_need,
b.select_is_required,
b.select_json,
b.input_name,
b.input_type,
b.input_can_edit,
b.input_is_need,
b.input_is_required,
b.remark_is_need,
b.remark_is_required,
b.photo_is_need,
b.photo_is_required,
(select c.department_id from spc_risk_judgment_task c where a.task_id = c.id) as department_id
from
spc_risk_judgment_fill_record a
left join
spc_risk_judgment_item b on a.item_id = b.id
<where>
<if
test=
"true"
>
and a.deleted = 0
</if>
<if
test=
"taskId != null"
>
and a.task_id = #{taskId}
</if>
<if
test=
"type != null"
>
and b.item_type = #{type}
</if>
<if
test=
"level != null"
>
and b.item_level = #{level}
</if>
<if
test=
"itemParentId != null"
>
and b.item_parent_id = #{itemParentId}
</if>
</where>
order by b.order_num
</select>
<select
id=
"countNotFinishRecordByTaskId"
resultType=
"java.lang.Long"
>
select
count(1)
from
spc_risk_judgment_fill_record
where
deleted = 0
and
task_id = #{taskId}
and
item_finish = 0
</select>
<update
id=
'updateInputResultAndselectResult'
>
update
spc_risk_judgment_fill_record a,
spc_risk_judgment_task b,
spc_risk_judgment_item c
set a.input_result = #{inputResult}
<if
test=
"selectResult !=null"
>
,a.select_result = #{selectResult}
</if>
WHERE
b.task_date = CURRENT_DATE ()
AND b.department_id = #{departmentId}
AND a.item_id = c.id
and b.id = a.task_id
and c.item_flag = #{itemFlag}
and b.task_status
<![CDATA[<=]]>
#{taskStatus}
</update>
</mapper>
\ No newline at end of file
amos-boot-system-maintenance/src/main/resources/db/mapper/SpcRiskJudgmentItemMapper.xml
deleted
100644 → 0
View file @
2d57e853
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.maintenance.business.dao.mapper.RiskJudgmentItemMapper"
>
<insert
id=
"save"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentItemBo"
useGeneratedKeys=
"true"
>
insert into spc_risk_judgment_item
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"itemFlag != null"
>
item_flag,
</if>
<if
test=
"itemLevel != null"
>
item_level,
</if>
<if
test=
"itemType != null"
>
item_type,
</if>
<if
test=
"itemName != null"
>
item_name,
</if>
<if
test=
"itemParentId != null"
>
item_parent_id,
</if>
<if
test=
"itemCanCopy != null"
>
item_can_copy,
</if>
<if
test=
"selectName != null"
>
select_name,
</if>
<if
test=
"selectIsNeed != null"
>
select_is_need,
</if>
<if
test=
"selectIsRequired != null"
>
select_is_required,
</if>
<if
test=
"selectJson != null"
>
select_json,
</if>
<if
test=
"inputName != null"
>
input_name,
</if>
<if
test=
"inputType != null"
>
input_type,
</if>
<if
test=
"inputCanEdit != null"
>
input_can_edit,
</if>
<if
test=
"inputIsNeed != null"
>
input_is_need,
</if>
<if
test=
"inputIsRequired != null"
>
input_is_required,
</if>
<if
test=
"remarkIsNeed != null"
>
remark_is_need,
</if>
<if
test=
"remarkIsRequired != null"
>
remark_is_required,
</if>
<if
test=
"photoIsNeed != null"
>
photo_is_need,
</if>
<if
test=
"photoIsRequired != null"
>
photo_is_required,
</if>
<if
test=
"deleted != null"
>
deleted,
</if>
<if
test=
"createDate != null"
>
create_date,
</if>
<if
test=
"updateDate != null"
>
update_date,
</if>
<if
test=
"orgCode != null"
>
org_code,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"itemFlag != null"
>
#{itemFlag},
</if>
<if
test=
"itemLevel != null"
>
#{itemLevel},
</if>
<if
test=
"itemType != null"
>
#{itemType},
</if>
<if
test=
"itemName != null"
>
#{itemName},
</if>
<if
test=
"itemParentId != null"
>
#{itemParentId},
</if>
<if
test=
"itemCanCopy != null"
>
#{itemCanCopy},
</if>
<if
test=
"selectName != null"
>
#{selectName},
</if>
<if
test=
"selectIsNeed != null"
>
#{selectIsNeed},
</if>
<if
test=
"selectIsRequired != null"
>
#{selectIsRequired},
</if>
<if
test=
"selectJson != null"
>
#{selectJson},
</if>
<if
test=
"inputName != null"
>
#{inputName},
</if>
<if
test=
"inputType != null"
>
#{inputType},
</if>
<if
test=
"inputCanEdit != null"
>
#{inputCanEdit},
</if>
<if
test=
"inputIsNeed != null"
>
#{inputIsNeed},
</if>
<if
test=
"inputIsRequired != null"
>
#{inputIsRequired},
</if>
<if
test=
"remarkIsNeed != null"
>
#{remarkIsNeed},
</if>
<if
test=
"remarkIsRequired != null"
>
#{remarkIsRequired},
</if>
<if
test=
"photoIsNeed != null"
>
#{photoIsNeed},
</if>
<if
test=
"photoIsRequired != null"
>
#{photoIsRequired},
</if>
<if
test=
"deleted != null"
>
#{deleted},
</if>
<if
test=
"createDate != null"
>
#{createDate},
</if>
<if
test=
"updateDate != null"
>
#{updateDate},
</if>
<if
test=
"orgCode != null"
>
#{orgCode},
</if>
</trim>
</insert>
<update
id=
"update"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentItemBo"
>
update spc_risk_judgment_item
<set>
<if
test=
"itemFlag != null"
>
item_flag = #{itemFlag},
</if>
<if
test=
"itemLevel != null"
>
item_level = #{itemLevel},
</if>
<if
test=
"itemType != null"
>
item_type = #{itemType},
</if>
<if
test=
"itemName != null"
>
item_name = #{itemName},
</if>
<if
test=
"itemParentId != null"
>
item_parent_id = #{itemParentId},
</if>
<if
test=
"itemCanCopy != null"
>
item_can_copy = #{itemCanCopy},
</if>
<if
test=
"selectName != null"
>
select_name = #{selectName},
</if>
<if
test=
"selectIsNeed != null"
>
select_is_need = #{selectIsNeed},
</if>
<if
test=
"selectIsRequired != null"
>
select_is_required = #{selectIsRequired},
</if>
<if
test=
"selectJson != null"
>
select_json = #{selectJson},
</if>
<if
test=
"inputName != null"
>
input_name = #{inputName},
</if>
<if
test=
"inputTye != null"
>
input_type = #{inputTye},
</if>
<if
test=
"inputCanEdit != null"
>
input_can_edit = #{inputCanEdit},
</if>
<if
test=
"inputIsNeed != null"
>
input_is_need = #{inputIsNeed},
</if>
<if
test=
"inputIsRequired != null"
>
input_is_required = #{inputIsRequired},
</if>
<if
test=
"remarkIsNeed != null"
>
remark_is_need = #{remarkIsNeed},
</if>
<if
test=
"remarkIsRequired != null"
>
remark_is_required = #{remarkIsRequired},
</if>
<if
test=
"photoIsNeed != null"
>
photo_is_need = #{photoIsNeed},
</if>
<if
test=
"photoIsRequired != null"
>
photo_is_required = #{photoIsRequired},
</if>
<if
test=
"deleted != null"
>
deleted = #{deleted},
</if>
<if
test=
"createDate != null"
>
create_date = #{createDate},
</if>
<if
test=
"updateDate != null"
>
update_date = #{updateDate},
</if>
<if
test=
"orgCode != null"
>
org_code = #{orgCode},
</if>
</set>
where id = #{id}
</update>
<select
id=
"listAllItemByDepartmentCode"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentItemBo"
>
select
*
from
spc_risk_judgment_item
where
deleted = 0
and
department_code = #{departmentCode}
</select>
<select
id=
"findByItemId"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentItemBo"
>
select * from spc_risk_judgment_item where id = #{itemId}
</select>
</mapper>
\ No newline at end of file
amos-boot-system-maintenance/src/main/resources/db/mapper/SpcRiskJudgmentTaskMapper.xml
deleted
100644 → 0
View file @
2d57e853
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.maintenance.business.dao.mapper.RiskJudgmentTaskMapper"
>
<insert
id=
"save"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentTaskBo"
useGeneratedKeys=
"true"
>
insert into spc_risk_judgment_task
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"taskName != null"
>
task_name,
</if>
<if
test=
"departmentId != null"
>
department_id,
</if>
<if
test=
"taskStatus != null"
>
task_status,
</if>
<if
test=
"taskDate != null"
>
task_date,
</if>
<if
test=
"taskCommitDate != null"
>
task_commit_date,
</if>
<if
test=
"currentFlowTaskId != null"
>
current_flow_task_id,
</if>
<if
test=
"taskDefinitionKey != null"
>
task_definition_key,
</if>
<if
test=
"flowUserIds != null"
>
flow_user_ids,
</if>
<if
test=
"flowInstanceId != null"
>
flow_instance_id,
</if>
<if
test=
"orgCode != null"
>
org_code,
</if>
<if
test=
"deleted != null"
>
deleted,
</if>
<if
test=
"createDate != null"
>
create_date,
</if>
<if
test=
"updateDate != null"
>
update_date,
</if>
<if
test=
"businessKey != null and businessKey !=''"
>
business_key,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"taskName != null"
>
#{taskName},
</if>
<if
test=
"departmentId != null"
>
#{departmentId},
</if>
<if
test=
"taskStatus != null"
>
#{taskStatus},
</if>
<if
test=
"taskDate != null"
>
#{taskDate},
</if>
<if
test=
"taskCommitDate != null"
>
#{taskCommitDate},
</if>
<if
test=
"currentFlowTaskId != null"
>
#{currentFlowTaskId},
</if>
<if
test=
"taskDefinitionKey != null"
>
#{taskDefinitionKey},
</if>
<if
test=
"flowUserIds != null"
>
#{flowUserIds},
</if>
<if
test=
"flowInstanceId != null"
>
#{flowInstanceId},
</if>
<if
test=
"orgCode != null"
>
#{orgCode},
</if>
<if
test=
"deleted != null"
>
#{deleted},
</if>
<if
test=
"createDate != null"
>
#{createDate},
</if>
<if
test=
"updateDate != null"
>
#{updateDate},
</if>
<if
test=
"businessKey != null and businessKey !=''"
>
#{businessKey}
</if>
</trim>
</insert>
<update
id=
"update"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentTaskBo"
>
update spc_risk_judgment_task
<set>
<if
test=
"taskName != null"
>
task_name = #{taskName},
</if>
<if
test=
"departmentId != null"
>
department_id = #{departmentId},
</if>
<if
test=
"taskStatus != null"
>
task_status = #{taskStatus},
</if>
<if
test=
"taskDate != null"
>
task_date = #{taskDate},
</if>
<if
test=
"taskCommitDate != null"
>
task_commit_date = #{taskCommitDate},
</if>
<if
test=
"currentFlowTaskId != null"
>
current_flow_task_id = #{currentFlowTaskId},
</if>
<if
test=
"taskDefinitionKey != null"
>
task_definition_key = #{taskDefinitionKey},
</if>
<if
test=
"flowUserIds != null"
>
flow_user_ids = #{flowUserIds},
</if>
<if
test=
"flowInstanceId != null"
>
flow_instance_id = #{flowInstanceId},
</if>
<if
test=
"orgCode != null"
>
org_code = #{orgCode},
</if>
<if
test=
"deleted != null"
>
deleted = #{deleted},
</if>
<if
test=
"createDate != null"
>
create_date = #{createDate},
</if>
<if
test=
"updateDate != null"
>
update_date = #{updateDate},
</if>
</set>
where id = #{id}
</update>
<update
id=
"updateBatch"
parameterType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentItemBo"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
";"
>
update spc_risk_judgment_task
<set>
<if
test=
"item.taskName != null"
>
task_name = #{item.taskName},
</if>
<if
test=
"item.departmentId != null"
>
department_id = #{item.departmentId},
</if>
<if
test=
"item.taskStatus != null"
>
task_status = #{item.taskStatus},
</if>
<if
test=
"item.taskDate != null"
>
task_date = #{item.taskDate},
</if>
<if
test=
"item.taskCommitDate != null"
>
task_commit_date = #{item.taskCommitDate},
</if>
<if
test=
"item.currentFlowTaskId != null"
>
current_flow_task_id = #{item.currentFlowTaskId},
</if>
<if
test=
"item.taskDefinitionKey != null"
>
task_definition_key = #{item.taskDefinitionKey},
</if>
<if
test=
"item.flowUserIds != null"
>
flow_user_ids = #{item.flowUserIds},
</if>
<if
test=
"item.flowInstanceId != null"
>
flow_instance_id = #{item.flowInstanceId},
</if>
<if
test=
"item.orgCode != null"
>
org_code = #{item.orgCode},
</if>
<if
test=
"item.deleted != null"
>
deleted = #{item.deleted},
</if>
<if
test=
"item.createDate != null"
>
create_date = #{item.createDate},
</if>
<if
test=
"item.updateDate != null"
>
update_date = #{item.updateDate},
</if>
</set>
where id = #{item.id}
</foreach>
</update>
<select
id=
"listByDateAndStatus"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentTaskBo"
>
select
*
from
spc_risk_judgment_task
where
deleted = 0
and
task_date = #{date}
and
task_status = #{status}
</select>
<select
id=
"listByMap"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentTaskBo"
>
select
a.*
from
spc_risk_judgment_task as a
<where>
<if
test=
"true"
>
and a.deleted = 0
</if>
<if
test=
"true"
>
and a.task_status != 0
</if>
<if
test=
"userId != null and userId != '' and !hasPermission"
>
and find_in_set(#{userId}, a.flow_user_ids)
</if>
<if
test=
"orgCode != null and orgCode != ''"
>
and a.org_code = #{orgCode}
</if>
<if
test=
"taskStatus != null and taskStatus != ''"
>
and a.task_status = #{taskStatus}
</if>
<if
test=
"beginTime != null and beginTime != ''"
>
and a.task_date
>
= #{beginTime}
</if>
<if
test=
"endTime != null and endTime != ''"
>
and a.task_date
<
= #{endTime}
</if>
<if
test=
"departmentId != null"
>
and a.department_id = #{departmentId}
</if>
<if
test=
"departmentIds != null and departmentIds != ''"
>
and find_in_set(a.department_id, #{departmentIds})
</if>
</where>
order by create_date desc
limit #{offset},#{limit}
</select>
<select
id=
"countByMap"
resultType=
"java.lang.Long"
>
select
count(1)
from
spc_risk_judgment_task as a
<where>
<if
test=
"true"
>
and a.deleted = 0
</if>
<if
test=
"true"
>
and a.task_status != 0
</if>
<if
test=
"userId != null and userId != '' and !hasPermission"
>
and find_in_set(#{userId}, a.flow_user_ids)
</if>
<if
test=
"orgCode != null and orgCode != ''"
>
and a.org_code = #{orgCode}
</if>
<if
test=
"taskStatus != null and taskStatus != ''"
>
and a.task_status = #{taskStatus}
</if>
<if
test=
"beginTime != null and beginTime != ''"
>
and a.task_date
>
= #{beginTime}
</if>
<if
test=
"endTime != null and endTime != ''"
>
and a.task_date
<
= #{endTime}
</if>
<if
test=
"departmentId != null"
>
and a.department_id = #{departmentId}
</if>
<if
test=
"departmentIds != null and departmentIds != ''"
>
and find_in_set(a.department_id, #{departmentIds})
</if>
</where>
</select>
<select
id=
"getById"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentTaskBo"
>
select
*
from
spc_risk_judgment_task
where
deleted = 0
and
id = #{id}
</select>
<select
id=
"getByInstanceIdAndTaskDefinitionKey"
resultType=
"com.yeejoin.amos.maintenance.business.entity.mybatis.RiskJudgmentTaskBo"
>
select
*
from
spc_risk_judgment_task
where
deleted = 0
and
flow_instance_id = #{instanceId}
and
task_definition_key = #{taskDefinitionKey}
</select>
<select
id=
"countByFlowUserIds"
resultType=
"java.lang.Long"
>
select
count(1)
from
spc_risk_judgment_task
where
deleted = 0
and
task_status = 1
and
find_in_set(#{userId},flow_user_ids)
</select>
<update
id=
"updatetTaskStatusByInstanceId"
>
update spc_risk_judgment_task
set task_status = #{taskStatus}
where flow_instance_id = #{flowInstanceId}
</update>
</mapper>
\ No newline at end of file
amos-boot-system-maintenance/src/main/resources/db/mapper/dbTemplate_check.xml
View file @
2f554c53
...
...
@@ -108,9 +108,6 @@
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id`
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id`
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id`
<if
test=
"dangerId != null and dangerId != ''"
>
LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id
</if>
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<if
test=
"beginDate!=null and endDate!=null"
>
and a.check_time BETWEEN #{beginDate} and #{endDate}
</if>
<!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> -->
...
...
@@ -1893,4 +1890,168 @@
d.date
</select>
<select
id=
"getChecks"
resultType=
"Map"
>
SELECT * FROM (
SELECT
pc.id checkId,
pc.user_id userId,
pc.is_ok isOk,
pp.owner_id ownerId,
date_format(
pc.check_time,
'%Y-%m-%d %H:%i:%s'
) checkDate,
pp.id pointId,
pp.equipment_id equipmentId,
pp.equipment_name equipmentName,
pp.belong_system_id systemId,
pp.belong_system_name systemName,
pp.address address,
CONCAT(pp.address, pp.building_name) buildingName
FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id
) a
<include
refid=
"mobile-check-record-where"
/>
limit #{offset},#{pageSize}
</select>
<sql
id=
"mobile-check-record-where"
>
<where>
<if
test=
"userId != null and userId > 0 "
>
and find_in_set(#{userId},a.userId)>0
</if>
<if
test=
"timeType != null and timeType != '' and timeType == '1' "
>
<include
refid=
"mobile-check-time-today"
></include>
</if>
<if
test=
"timeType != null and timeType != '' and timeType == '2' "
>
<include
refid=
"mobile-check-time-tomorrow"
></include>
</if>
<if
test=
"timeType != null and timeType != '' and timeType == '3' "
>
<include
refid=
"mobile-check-time-week"
></include>
</if>
<if
test=
"timeType != null and timeType != '' and timeType == '4' "
>
<include
refid=
"mobile-check-time-last-week"
></include>
</if>
<if
test=
"timeType != null and timeType != '' and timeType == '5' "
>
<include
refid=
"mobile-check-time-month"
></include>
</if>
<if
test=
"timeType != null and timeType != '' and timeType == '5' "
>
<include
refid=
"mobile-check-time-last-month"
></include>
</if>
<if
test=
"finishStatus != null"
>
and a.finishStatus = #{finishStatus}
</if>
<if
test=
"beginTime != null and beginTime != '' and endTime != null and endTime != '' "
>
AND (
(
a.beginTime
<![CDATA[>=]]>
#{beginTime}
AND a.endTime
<![CDATA[<=]]>
#{endTime}
)
OR (
a.beginTime
<![CDATA[<=]]>
#{endTime}
AND a.endTime
<![CDATA[>=]]>
#{endTime}
)
OR (
a.beginTime
<![CDATA[<=]]>
#{beginTime}
AND a.endTime
<![CDATA[>]]>
#{beginTime}
)
OR (
a.beginTime
<![CDATA[<=]]>
#{beginTime}
AND a.endTime
<![CDATA[>=]]>
#{endTime}
)
)
</if>
<choose>
<when
test=
"identityType==1"
>
And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} )
<if
test=
"companyId != null"
>
and a.ownerId = #{teamId}
</if>
</when>
<when
test=
"identityType==2"
>
And a.ownerId = #{teamId}
</when>
</choose>
</where>
<if
test=
"orderRule != null and orderRule != ''"
>
order by ${orderRule}
</if>
</sql>
<sql
id=
"mobile-check-time-today"
>
and to_days(a.checkDate)= to_days(now())
</sql>
<sql
id=
"mobile-check-time-tomorrow"
>
and to_days(now())-to_days(a.checkDate)
<![CDATA[<=]]>
1
</sql>
<sql
id=
"mobile-check-time-week"
>
and YEARWEEK(date_format(a.checkDate, '%Y-%m-%d')) = YEARWEEK(now())
</sql>
<sql
id=
"mobile-check-time-last-week"
>
and YEARWEEK(date_format(a.checkDate, '%Y-%m-%d')) = YEARWEEK(now())-1
</sql>
<sql
id=
"mobile-check-time-month"
>
and date_format(a.checkDate,'%Y-%m')=date_format(now(),'%Y-%m')
</sql>
<sql
id=
"mobile-check-time-last-month"
>
and date_format(a.checkDate,'%Y-%m')=date_format(DATE_SUB(curdate(), INTERVAL 1 MONTH),'%Y-%m')
</sql>
<select
id=
"getCheckCount"
resultType=
"long"
>
SELECT COUNT(1) checkCount
FROM (
SELECT
pc.id checkId,
pc.user_id userId,
pc.is_ok isOk,
pp.owner_id ownerId,
date_format(
pc.check_time,
'%Y-%m-%d %H:%i:%s'
) checkDate,
pp.id pointId,
pp.equipment_id equipmentId,
pp.equipment_name equipmentName,
pp.belong_system_id systemId,
pp.belong_system_name systemName,
pp.address address,
CONCAT(pp.address, pp.building_name) buildingName
FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id
) a
<include
refid=
"mobile-check-record-where"
/>
</select>
<select
id=
"getCheckDetail"
resultType=
"Map"
>
SELECT
pc.id checkId,
pci.is_ok isOk,
date_format(
pc.check_time,
'%Y-%m-%d %H:%i:%s'
) maintenanceDate,
pp.id pointId,
pp.equipment_id equipmentId,
pp.remark remark,
pp.owner_name ownerName,
pp.equipment_name equipmentName,
pp.belong_system_id systemId,
pp.belong_system_name systemName,
CONCAT(pp.address, pp.building_name) address,
CONCAT(date_format(
ppl.plan_begin,
'%Y-%m-%d %H:%i:%s'
), '-', date_format(
ppl.plan_end,
'%Y-%m-%d %H:%i:%s'
)) planDate,
ppl.name planName,
pp.plan_type planType,
ppt.user_name planUser,
pci.input_name itemName,
pii.maintenance_content itemContent,
pcs.photo_data picture,
pcs.point_name pointName,
pcs.shot_type shotType
FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id
LEFT JOIN p_plan ppl ON ppl.id = pc.plan_id
LEFT JOIN p_check_input pci ON pci.check_id = pc.id
LEFT JOIN p_input_item pii ON pii.id = pci.input_id
LEFT JOIN p_check_shot pcs ON pcs.check_id = pc.id
LEFT JOIN p_plan_task ppt ON ppt.id = pc.plan_task_id
WHERE
pc.id = #{id}
</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