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
c99c1738
Commit
c99c1738
authored
Aug 11, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构代码结构
parent
0d13f169
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
51 deletions
+43
-51
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+40
-49
application-dev.properties
...-system-jcs/src/main/resources/application-dev.properties
+3
-2
No files found.
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 @
c99c1738
...
...
@@ -21,6 +21,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.itextpdf.text.pdf.PdfStructTreeController.returnType
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.workflow.RemoteWorkFlowService
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
...
...
@@ -112,68 +113,49 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
// return CommonResponseUtil.failure("添加失败");
}
if
(
ObjectUtils
.
isNotEmpty
(
model
))
{
excuteTask
(
false
,
model
.
getSequenceNbr
(),
instance
.
getString
(
"id"
),
userInfo
,
null
);
excuteTask
(
instance
.
getString
(
"id"
),
userInfo
,
null
);
}
return
true
;
}
public
boolean
excuteTask
(
boolean
falg
,
Long
sequenceNbr
,
String
procressId
,
ReginParams
userInfo
,
public
boolean
excuteTask
(
Long
sequenceNbr
,
ReginParams
userInfo
,
String
condition
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
// 获取送达部门的ID
Integer
failureEquipmentId
=
failureDetailsDto
.
getFailureEquipmentId
();
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Long
auditDepartmentId
=
null
;
if
(
falg
==
true
)
{
FailureAudit
failureAudit
=
failureAuditService
.
findByFaultId
(
sequenceNbr
);
auditDepartmentId
=
failureAudit
.
getAuditDepartmentId
();
}
else
{
auditDepartmentId
=
seq
;
}
Map
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
conditionMap
.
put
(
"condition"
,
condition
);
JSONObject
teskObject
=
remoteWorkFlowService
.
getChildNodeDetail
(
procressId
);
try
{
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
if
(
name
.
contains
(
EMERGENCY_COMMAND
)
&&
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
String
taskId
=
detail
.
getString
(
"id"
);
remoteWorkFlowService
.
excute
(
taskId
,
conditionMap
.
toString
());
break
;
}
else
{
if
(
failureEquipmentId
.
intValue
()
==
seq
.
intValue
())
{
String
taskId
=
detail
.
getString
(
"id"
);
remoteWorkFlowService
.
excute
(
taskId
,
conditionMap
.
toString
());
break
;
}
}
}
}
Map
<
String
,
Object
>
map
=
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
try
{
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
remoteWorkFlowService
.
excute
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
.
toString
());
}
}
catch
(
Exception
e
)
{
return
false
;
}
return
true
;
}
public
boolean
checkExcuteTaskAuth
(
boolean
falg
,
Long
sequenceNbr
,
ReginParams
userInfo
)
{
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Long
auditDepartmentId
=
null
;
if
(
falg
==
true
)
{
FailureAudit
failureAudit
=
failureAuditService
.
findByFaultId
(
sequenceNbr
);
auditDepartmentId
=
failureAudit
.
getAuditDepartmentId
();
}
else
{
auditDepartmentId
=
seq
;
public
boolean
excuteTask
(
String
procressId
,
ReginParams
userInfo
,
String
condition
)
{
Map
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
conditionMap
.
put
(
"condition"
,
condition
);
JSONObject
teskObject
=
remoteWorkFlowService
.
getChildNodeDetail
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
remoteWorkFlowService
.
excute
(
detail
.
getString
(
"id"
),
conditionMap
.
toString
());
}
}
return
checkExcuteTaskAuth
(
auditDepartmentId
,
sequenceNbr
,
userInfo
);
return
true
;
}
public
boolean
checkExcuteTaskAuth
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
Map
<
String
,
Object
>
map
=
this
.
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
return
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
());
}
public
boolean
checkExcuteTaskAuth
(
Long
auditDepartmentId
,
Long
sequenceNbr
,
ReginParams
userInfo
)
{
public
Map
<
String
,
Object
>
checkExcuteTaskAuthMap
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
// 获取送达部门的ID
Integer
failureEquipmentId
=
failureDetailsDto
.
getFailureEquipmentId
();
FailureAudit
failureAudit
=
failureAuditService
.
findByFaultId
(
sequenceNbr
);
//获取上一级操作部门的Id
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
...
...
@@ -184,16 +166,25 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
if
(
name
.
contains
(
EMERGENCY_COMMAND
)
&&
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
return
true
;
if
(
name
.
contains
(
EMERGENCY_COMMAND
)
)
{
FailureAudit
failureAuditDetail
=
failureAuditService
.
findByFaultId
(
sequenceNbr
);
Long
auditDepartmentId
=
failureAuditDetail
.
getAuditDepartmentId
();
if
(
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
map
.
put
(
"taskId"
,
detail
.
getString
(
"id"
));
map
.
put
(
"checkFlag"
,
true
);
return
map
;
}
}
else
{
if
(
failureEquipmentId
.
intValue
()
==
seq
.
intValue
())
{
return
true
;
map
.
put
(
"taskId"
,
detail
.
getString
(
"id"
));
map
.
put
(
"checkFlag"
,
true
);
return
map
;
}
}
}
}
return
false
;
map
.
put
(
"checkFlag"
,
false
);
return
map
;
}
public
Object
getCurrentProcessHistoryTask
(
Long
id
)
{
...
...
amos-boot-system-jcs/src/main/resources/application-dev.properties
View file @
c99c1738
...
...
@@ -41,7 +41,7 @@ video.url=https://11.11.16.4:443/
params.work.flow.normalProcessDefinitionKey
=
normalHazardManagement
params.work.flow.processDefinitionKey
=
hazardManagement
#
params.work.flow.address=http://172.16.3.4:30040
params.work.flow.address
=
http://172.16.10.80:30040
params.work.flow.address
=
http://172.16.3.4:30040
#
params.work.flow.address=http://172.16.10.80:30040
params.spc.address
=
http://172.16.3.89:9001
failure.work.flow.processDefinitionKey
=
malfunction_repair
\ 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