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
be741fa5
Commit
be741fa5
authored
Sep 23, 2021
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:修改防火监督工作流执行
parent
887504c4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
29 deletions
+61
-29
PlanAuditController.java
.../supervision/business/controller/PlanAuditController.java
+1
-2
IPlanAuditDao.java
...os/supervision/business/dao/repository/IPlanAuditDao.java
+3
-0
PlanAuditServiceImpl.java
...pervision/business/service/impl/PlanAuditServiceImpl.java
+56
-26
IPlanAuditService.java
...supervision/business/service/intfc/IPlanAuditService.java
+1
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/controller/PlanAuditController.java
View file @
be741fa5
...
@@ -31,12 +31,11 @@ public class PlanAuditController extends AbstractBaseController {
...
@@ -31,12 +31,11 @@ public class PlanAuditController extends AbstractBaseController {
@RequestMapping
(
value
=
"/auditWorkFlow"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/auditWorkFlow"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
auditWorkFlow
(
public
CommonResponse
auditWorkFlow
(
@ApiParam
(
value
=
"工作流流水实例"
,
required
=
true
)
@RequestBody
PlanAuditLog
planAuditLog
,
@ApiParam
(
value
=
"工作流流水实例"
,
required
=
true
)
@RequestBody
PlanAuditLog
planAuditLog
,
@ApiParam
(
value
=
"工作流实例编号"
,
required
=
true
)
@RequestParam
String
instanceId
,
@ApiParam
(
value
=
"执行控制条件"
,
required
=
true
)
@RequestParam
String
condition
)
{
@ApiParam
(
value
=
"执行控制条件"
,
required
=
true
)
@RequestParam
String
condition
)
{
try
{
try
{
AgencyUserModel
userInfo
=
getUserInfo
();
AgencyUserModel
userInfo
=
getUserInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
CommonResponseUtil
.
success
(
planAuditService
.
auditWorkFlow
(
planAuditLog
,
instanceId
,
condition
,
reginParams
));
return
CommonResponseUtil
.
success
(
planAuditService
.
auditWorkFlow
(
planAuditLog
,
condition
,
reginParams
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"计划工作流审核失败!"
);
return
CommonResponseUtil
.
failure
(
"计划工作流审核失败!"
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/dao/repository/IPlanAuditDao.java
View file @
be741fa5
...
@@ -7,4 +7,6 @@ import org.springframework.stereotype.Repository;
...
@@ -7,4 +7,6 @@ import org.springframework.stereotype.Repository;
public
interface
IPlanAuditDao
extends
BaseDao
<
PlanAudit
,
Long
>
{
public
interface
IPlanAuditDao
extends
BaseDao
<
PlanAudit
,
Long
>
{
PlanAudit
findByProcessInstanceId
(
String
instanceId
);
PlanAudit
findByProcessInstanceId
(
String
instanceId
);
PlanAudit
findByPlanId
(
Long
planId
);
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/PlanAuditServiceImpl.java
View file @
be741fa5
package
com
.
yeejoin
.
amos
.
supervision
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
supervision
.
business
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.service.IWorkflowExcuteService
;
import
com.yeejoin.amos.boot.biz.common.service.IWorkflowExcuteService
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
...
@@ -11,7 +9,6 @@ import com.yeejoin.amos.supervision.business.service.intfc.IPlanAuditService;
...
@@ -11,7 +9,6 @@ import com.yeejoin.amos.supervision.business.service.intfc.IPlanAuditService;
import
com.yeejoin.amos.supervision.dao.entity.PlanAudit
;
import
com.yeejoin.amos.supervision.dao.entity.PlanAudit
;
import
com.yeejoin.amos.supervision.dao.entity.PlanAuditLog
;
import
com.yeejoin.amos.supervision.dao.entity.PlanAuditLog
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -35,38 +32,71 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
...
@@ -35,38 +32,71 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
@Override
@Override
@Transactional
@Transactional
public
Boolean
auditWorkFlow
(
PlanAuditLog
planAuditLog
,
String
instanceId
,
String
condition
,
ReginParams
reginParams
)
{
public
Boolean
auditWorkFlow
(
PlanAuditLog
planAuditLog
,
String
condition
,
ReginParams
reginParams
)
{
Map
<
String
,
Object
>
taskAuthMap
=
workflowExcuteService
.
checkTaskAuthMap
(
instanceId
);
PlanAudit
planAudit
=
planAuditDao
.
findByPlanId
(
planAuditLog
.
getPlanId
());
if
(
taskAuthMap
!=
null
&&
!
taskAuthMap
.
isEmpty
())
{
if
(
ObjectUtils
.
isNotEmpty
(
planAudit
))
{
String
taskId
=
taskAuthMap
.
get
(
"taskId"
).
toString
();
String
instanceId
=
planAudit
.
getProcessInstanceId
();
if
(
StringUtils
.
isNotBlank
(
taskId
))
{
Map
<
String
,
Object
>
taskAuthMap
=
workflowExcuteService
.
checkTaskAuthMap
(
instanceId
);
if
(
taskAuthMap
!=
null
&&
!
taskAuthMap
.
isEmpty
())
{
String
taskId
=
taskAuthMap
.
get
(
"taskId"
).
toString
();
String
name
=
taskAuthMap
.
get
(
"name"
).
toString
();
String
roleName
=
reginParams
.
getRole
().
getRoleName
();
String
roleName
=
reginParams
.
getRole
().
getRoleName
();
JSONObject
taskGroupName
=
workflowFeignService
.
getTaskGroupName
(
taskId
);
JSONArray
taskGroupNameDetail
=
taskGroupName
.
getJSONArray
(
"data"
);
// JSONObject taskGroupNameDetail = JSONObject.parseObject(JSONObject.toJSONString(data.get(data.size() - 2)));
if
(!
ObjectUtils
.
isEmpty
(
taskGroupNameDetail
))
{
String
defaultExecutionRoleProcess
=
taskGroupNameDetail
.
getJSONObject
(
0
).
getString
(
"groupId"
);
}
boolean
b
=
workflowExcuteService
.
CompleteTask
(
instanceId
,
condition
);
boolean
b
=
workflowExcuteService
.
CompleteTask
(
instanceId
,
condition
);
if
(
b
)
{
if
(
b
)
{
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
workflowExcuteService
.
setTaskAssign
(
instanceId
,
personIdentity
.
getPersonSeq
());
workflowExcuteService
.
setTaskAssign
(
instanceId
,
personIdentity
.
getPersonSeq
());
PlanAudit
planAudit
=
planAuditDao
.
findByProcessInstanceId
(
instanceId
);
planAuditLog
.
setPlanId
(
planAudit
.
getPlanId
());
if
(
ObjectUtils
.
isNotEmpty
(
planAudit
))
{
planAuditLog
.
setPlanAuditId
(
planAudit
.
getId
());
planAuditLog
.
setPlanId
(
planAudit
.
getPlanId
());
planAuditLog
.
setExcuteUserId
(
personIdentity
.
getPersonSeq
());
planAuditLog
.
setPlanAuditId
(
planAudit
.
getId
());
planAuditLog
.
setExcuteUserName
(
personIdentity
.
getPersonName
());
planAuditLog
.
setExcuteUserId
(
personIdentity
.
getPersonSeq
());
planAuditLog
.
setFlowTaskId
(
taskId
);
planAuditLog
.
setExcuteUserName
(
personIdentity
.
getPersonName
());
planAuditLog
.
setFlowTaskName
(
name
);
// planAuditLog.setFlowTaskId();
planAuditLog
.
setFlowJson
(
condition
);
// planAuditLog.setFlowTaskName();
planAuditLog
.
setRoleName
(
roleName
);
planAuditLog
.
setFlowJson
(
condition
);
planAuditLogDao
.
save
(
planAuditLog
);
planAuditLog
.
setRoleName
(
roleName
);
planAuditLogDao
.
save
(
planAuditLog
);
}
}
}
return
b
;
return
b
;
}
}
}
}
return
Boolean
.
FALSE
;
return
Boolean
.
FALSE
;
}
}
// @Override
// @Transactional
// public Boolean auditWorkFlow(PlanAuditLog planAuditLog, String condition, ReginParams reginParams) {
// PlanAudit planAudit = planAuditDao.findByPlanId(planAuditLog.getPlanId());
// Map<String, Object> taskAuthMap = workflowExcuteService.checkTaskAuthMap(instanceId);
// if (taskAuthMap != null && !taskAuthMap.isEmpty()) {
// String taskId = taskAuthMap.get("taskId").toString();
// String name = taskAuthMap.get("name").toString();
// if (StringUtils.isNotBlank(taskId)) {
// String roleName = reginParams.getRole().getRoleName();
//// JSONObject taskGroupName = workflowFeignService.getTaskGroupName(taskId);
//// JSONArray taskGroupNameDetail = taskGroupName.getJSONArray("data");
////// JSONObject taskGroupNameDetail = JSONObject.parseObject(JSONObject.toJSONString(data.get(data.size() - 2)));
//// if (!ObjectUtils.isEmpty(taskGroupNameDetail)) {
//// String defaultExecutionRoleProcess = taskGroupNameDetail.getJSONObject(0).getString("groupId");
//// }
// boolean b = workflowExcuteService.CompleteTask(instanceId, condition);
// if (b) {
// ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
// workflowExcuteService.setTaskAssign(instanceId, personIdentity.getPersonSeq());
//
// if (ObjectUtils.isNotEmpty(planAudit)) {
// planAuditLog.setPlanId(planAudit.getPlanId());
// planAuditLog.setPlanAuditId(planAudit.getId());
// planAuditLog.setExcuteUserId(personIdentity.getPersonSeq());
// planAuditLog.setExcuteUserName(personIdentity.getPersonName());
// planAuditLog.setFlowTaskId(taskId);
// planAuditLog.setFlowTaskName(name);
// planAuditLog.setFlowJson(condition);
// planAuditLog.setRoleName(roleName);
// planAuditLogDao.save(planAuditLog);
// }
// }
// return b;
// }
// }
// return Boolean.FALSE;
// }
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/intfc/IPlanAuditService.java
View file @
be741fa5
...
@@ -4,5 +4,5 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...
@@ -4,5 +4,5 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.amos.supervision.dao.entity.PlanAuditLog
;
import
com.yeejoin.amos.supervision.dao.entity.PlanAuditLog
;
public
interface
IPlanAuditService
{
public
interface
IPlanAuditService
{
Boolean
auditWorkFlow
(
PlanAuditLog
planAuditLog
,
String
instanceId
,
String
condition
,
ReginParams
reginParams
);
Boolean
auditWorkFlow
(
PlanAuditLog
planAuditLog
,
String
condition
,
ReginParams
reginParams
);
}
}
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