Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
test
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
邬友楠
test
Commits
d382ecaa
Commit
d382ecaa
authored
Jan 13, 2020
by
雍欢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流程节点审批(大于多少人通过或超过一半人通过)
parent
f980a78d
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
928 additions
and
998 deletions
+928
-998
ApprovalRuleApplication.java
...pm/configuration/application/ApprovalRuleApplication.java
+108
-143
ApprovalRule.java
...gou/uasp/bpm/configuration/domain/model/ApprovalRule.java
+11
-7
ApprovalRuleHandlerGroup.java
.../configuration/domain/model/ApprovalRuleHandlerGroup.java
+14
-0
ActApplication.java
...om/huigou/uasp/bpm/engine/application/ActApplication.java
+134
-199
ProcUnitHandlerBase.java
...gou/uasp/bpm/engine/domain/model/ProcUnitHandlerBase.java
+32
-16
SQLBuilderImpl.java
...ava/com/huigou/data/query/parser/impl/SQLBuilderImpl.java
+3
-4
FlowBroker.java
...ou-uasp/src/main/java/com/huigou/uasp/bpm/FlowBroker.java
+560
-583
ApprovalRuleApplicationImpl.java
...uration/application/impl/ApprovalRuleApplicationImpl.java
+35
-9
ApprovalRuleController.java
.../bpm/configuration/controller/ApprovalRuleController.java
+10
-7
ActApplicationImpl.java
.../uasp/bpm/engine/application/impl/ActApplicationImpl.java
+17
-29
ApprovalHandlerDetailConfig.jsp
...m/configtool/approvalRule/ApprovalHandlerDetailConfig.jsp
+4
-1
No files found.
huigou-core-api/src/main/java/com/huigou/uasp/bpm/configuration/application/ApprovalRuleApplication.java
View file @
d382ecaa
...
...
@@ -30,8 +30,7 @@ public interface ApprovalRuleApplication {
/**
* 保存审批要素
*
* @param approvalElement
* 审批要素
* @param approvalElement 审批要素
* @return 审批要素ID
*/
String
saveApprovalElement
(
ApprovalElement
approvalElement
);
...
...
@@ -39,8 +38,7 @@ public interface ApprovalRuleApplication {
/**
* 加载审批要素
*
* @param id
* 审批要素ID
* @param id 审批要素ID
* @return 审批要素实体
*/
ApprovalElement
loadApprovalElement
(
String
id
);
...
...
@@ -48,16 +46,14 @@ public interface ApprovalRuleApplication {
/**
* 删除审批要素
*
* @param ids
* 审批要素ID列表
* @param ids 审批要素ID列表
*/
void
deleteApprovalElements
(
List
<
String
>
ids
);
/**
* 分页查询审批要素
*
* @param queryRequest
* 查询模型
* @param queryRequest 查询模型
* @return
*/
Map
<
String
,
Object
>
slicedQueryApprovalElements
(
CodeAndNameQueryRequest
queryRequest
);
...
...
@@ -79,8 +75,7 @@ public interface ApprovalRuleApplication {
/**
* 保存审批处理人类别
*
* @param approvalHandlerKind
* 审批处理人类别
* @param approvalHandlerKind 审批处理人类别
* @return 审批处理人类别ID
*/
String
saveApprovalHandlerKind
(
ApprovalHandlerKind
approvalHandlerKind
);
...
...
@@ -117,12 +112,9 @@ public interface ApprovalRuleApplication {
/**
* 保存流程审批要素
*
* @param procId
* 流程ID
* @param procUnitId
* 流程环节ID
* @param elementIds
* 审批要素ID列表
* @param procId 流程ID
* @param procUnitId 流程环节ID
* @param elementIds 审批要素ID列表
*/
void
saveProcApprovalElement
(
String
procId
,
String
procUnitId
,
List
<
String
>
elementIds
);
...
...
@@ -141,10 +133,8 @@ public interface ApprovalRuleApplication {
/**
* 查询流程审批要素
*
* @param procId
* 流程ID
* @param procUnitId
* 流程环节ID
* @param procId 流程ID
* @param procUnitId 流程环节ID
* @return
*/
List
<
ProcApprovalElementDesc
>
queryProcApprovalElements
(
String
procId
,
String
procUnitId
);
...
...
@@ -164,8 +154,7 @@ public interface ApprovalRuleApplication {
/**
* 更新流程审批规则
*
* @param approvalRule
* 审批规则
* @param approvalRule 审批规则
* 原名称
*/
void
updateApprovalRule
(
ApprovalRule
approvalRule
);
...
...
@@ -173,8 +162,7 @@ public interface ApprovalRuleApplication {
/**
* 加载流程审批规则
*
* @param id
* 流程审批规则ID
* @param id 流程审批规则ID
* @return
*/
ApprovalRule
loadApprovalRule
(
String
id
);
...
...
@@ -182,34 +170,26 @@ public interface ApprovalRuleApplication {
/**
* 删除流程审批规则
*
* @param ids
* 审批规则ID列表
* @param ids 审批规则ID列表
*/
void
deleteApprovalRules
(
List
<
String
>
ids
);
/**
* 移动审批规则
*
* @param id
* 审批规则ID
* @param parentId
* 父ID
* @param id 审批规则ID
* @param parentId 父ID
*/
void
moveApprovalRules
(
String
id
,
String
parentId
);
/**
* 查询流程审批规则
*
* @param orgId
* 组织ID
* @param procId
* 流程ID
* @param procUnitId
* 流程环节ID
* @param procUnitName
* 流程环节名称
* @param parentId
* 父ID
* @param orgId 组织ID
* @param procId 流程ID
* @param procUnitId 流程环节ID
* @param procUnitName 流程环节名称
* @param parentId 父ID
* @return
*/
Map
<
String
,
Object
>
queryApprovalRules
(
String
orgId
,
String
procId
,
String
procUnitId
,
String
procUnitName
,
String
parentId
);
...
...
@@ -217,12 +197,9 @@ public interface ApprovalRuleApplication {
/**
* 查询流程审批规则
*
* @param procId
* 流程Id
* @param procUnitId
* 流程环节ID
* @param parentId
* 父ID
* @param procId 流程Id
* @param procUnitId 流程环节ID
* @param parentId 父ID
* @return
*/
List
<
ApprovalRule
>
queryApprovalRules
(
String
procId
,
String
procUnitId
,
String
parentId
);
...
...
@@ -230,30 +207,24 @@ public interface ApprovalRuleApplication {
/**
* 保存审批规则要素
*
* @param approvalRuleId
* 审批规则ID
* @param approvalRuleElements
* 审批规则要素
* @param approvalRuleId 审批规则ID
* @param approvalRuleElements 审批规则要素
*/
void
saveApprovalRuleElements
(
String
approvalRuleId
,
List
<
ApprovalRuleElement
>
approvalRuleElements
);
/**
* 删除审批规则要素
*
* @param approvalRuleId
* 流程审批规则ID
* @param ids
* 审批规则要素ID列表
* @param approvalRuleId 流程审批规则ID
* @param ids 审批规则要素ID列表
*/
void
deleteApprovalRuleElements
(
String
approvalRuleId
,
List
<
String
>
ids
);
/**
* 查询审批规则要素
*
* @param approvalRuleId
* 审批规则ID
* @param queryRequest
* 分页信息
* @param approvalRuleId 审批规则ID
* @param queryRequest 分页信息
* @return
*/
Map
<
String
,
Object
>
queryApprovalRuleElements
(
String
approvalRuleId
,
EmptyQueryRequest
queryRequest
);
...
...
@@ -261,8 +232,7 @@ public interface ApprovalRuleApplication {
/**
* 为流程图查询审批规则要素
*
* @param approvalRuleId
* 审批规则ID
* @param approvalRuleId 审批规则ID
* @return
*/
List
<
Map
<
String
,
Object
>>
queryApprovalRuleElementsForFlowChart
(
String
approvalRuleId
);
...
...
@@ -270,50 +240,56 @@ public interface ApprovalRuleApplication {
/**
* 保存流程审批规则审批人
*
* @param approvalRuleId
* 流程审批规则ID
* @param approvalRuleHandlers
* 流程审批规则处理人列表
* @param approvalRuleId 流程审批规则ID
* @param approvalRuleHandlers 流程审批规则处理人列表
*/
void
saveApprovalRuleHandlers
(
String
approvalRuleId
,
List
<
ApprovalRuleHandler
>
approvalRuleHandlers
);
/**
* 保存流程审批规则审批人明细
*
* @param approvalRuleId
* 流程审批规则ID
* @param approvalRuleHandler
* 流程审批规则处理人
* @param taskExecuteMode
* 任务执行模式
* @param assistants
* 协审
* @param ccs
* 抄送
* @param fieldAuthorizations
* 字段授权
* @param approvalRuleId 流程审批规则ID
* @param approvalRuleHandler 流程审批规则处理人
* @param taskExecuteMode 任务执行模式
* @param assistants 协审
* @param ccs 抄送
* @param fieldAuthorizations 字段授权
* @deprecated 已被 {@link #saveApprovalRuleHandler(String, ApprovalRuleHandler, TaskExecuteMode, Integer, List, List, List)} 替代。
*/
@Deprecated
void
saveApprovalRuleHandler
(
String
approvalRuleId
,
ApprovalRuleHandler
approvalRuleHandler
,
TaskExecuteMode
taskExecuteMode
,
List
<
ApprovalRuleHandlerAssist
>
assistants
,
List
<
ApprovalRuleHandlerAssist
>
ccs
,
List
<
ApprovalRuleHandlerUIElmentPermission
>
fieldAuthorizations
);
/**
* 保存流程审批规则审批人明细
*
* @param approvalRuleId 流程审批规则ID
* @param approvalRuleHandler 流程审批规则处理人
* @param taskExecuteMode 任务执行模式
* @param limitHandler 最少审批人数
* @param assistants 协审
* @param ccs 抄送
* @param fieldAuthorizations 字段授权
* @since 1.1.3
*/
void
saveApprovalRuleHandler
(
String
approvalRuleId
,
ApprovalRuleHandler
approvalRuleHandler
,
TaskExecuteMode
taskExecuteMode
,
Integer
limitHandler
,
List
<
ApprovalRuleHandlerAssist
>
assistants
,
List
<
ApprovalRuleHandlerAssist
>
ccs
,
List
<
ApprovalRuleHandlerUIElmentPermission
>
fieldAuthorizations
);
/**
* 删除流程审批规则审批人
*
* @param approvalRule
* 流程审批规则
* @param ids
* 流程审批规则审批人ID列表
* @param approvalRule 流程审批规则
* @param ids 流程审批规则审批人ID列表
*/
void
deleteApprovalRuleHandlers
(
String
approvalRuleId
,
List
<
String
>
ids
);
/**
* 查询审批规则处理人
*
* @param approvalRuleId
* 流程审批规则ID
* @param queryRequest
* 分页信息
* @param approvalRuleId 流程审批规则ID
* @param queryRequest 分页信息
* @return
*/
Map
<
String
,
Object
>
queryApprovalRuleHandlers
(
String
approvalRuleId
,
EmptyQueryRequest
queryRequest
);
...
...
@@ -321,8 +297,7 @@ public interface ApprovalRuleApplication {
/**
* 查询审批环节协审人员
*
* @param approvalRuleHandlerId
* 审批规则处理人ID
* @param approvalRuleHandlerId 审批规则处理人ID
* @return
*/
Map
<
String
,
Object
>
queryAssistantHandlers
(
String
approvalRuleHandlerId
);
...
...
@@ -330,8 +305,7 @@ public interface ApprovalRuleApplication {
/**
* 查询抄送人员
*
* @param approvalRuleHandlerId
* 审批规则处理人ID
* @param approvalRuleHandlerId 审批规则处理人ID
* @return
*/
Map
<
String
,
Object
>
queryCCHandlers
(
String
approvalRuleHandlerId
);
...
...
@@ -339,8 +313,7 @@ public interface ApprovalRuleApplication {
/**
* 查询界面元素权限
*
* @param approvalRuleHandlerId
* 审批规则处理人ID
* @param approvalRuleHandlerId 审批规则处理人ID
* @return
*/
Map
<
String
,
Object
>
queryUIElementPermissions
(
String
approvalRuleHandlerId
);
...
...
@@ -348,12 +321,9 @@ public interface ApprovalRuleApplication {
/**
* 获取审批处理人时间限制
*
* @param procId
* 流程ID
* @param procUnitId
* 流程环节ID
* @param approvalRuleHandlerId
* 审批规则处理人ID
* @param procId 流程ID
* @param procUnitId 流程环节ID
* @param approvalRuleHandlerId 审批规则处理人ID
* @return
*/
LimitTime
getApprovalRuleHandlerLimitTime
(
String
procId
,
String
procUnitId
,
String
approvalRuleHandlerId
);
...
...
@@ -361,8 +331,7 @@ public interface ApprovalRuleApplication {
/**
* 加载审批规则处理人
*
* @param approvalRuleHandlerId
* 审批规则处理人ID
* @param approvalRuleHandlerId 审批规则处理人ID
* @return
*/
ApprovalRuleHandler
loadApprovalRuleHandler
(
String
approvalRuleHandlerId
);
...
...
@@ -374,10 +343,8 @@ public interface ApprovalRuleApplication {
/**
* 删除审批规则适用范围
*
* @param approvalRuleId
* 流程审批规则
* @param ids
* 审批规则要素ID列表
* @param approvalRuleId 流程审批规则
* @param ids 审批规则要素ID列表
*/
void
deleteApprovalRuleScopes
(
String
approvalRuleId
,
List
<
String
>
ids
);
...
...
@@ -385,10 +352,8 @@ public interface ApprovalRuleApplication {
/**
* 查询审批规则适用范围
*
* @param approvalRuleId
* 流程审批规则ID
* @param queryRequest
* 分页信息
* @param approvalRuleId 流程审批规则ID
* @param queryRequest 分页信息
* @return
*/
Map
<
String
,
Object
>
queryApprovalRuleScopes
(
String
approvalRuleId
,
EmptyQueryRequest
queryRequest
);
...
...
huigou-core-api/src/main/java/com/huigou/uasp/bpm/configuration/domain/model/ApprovalRule.java
View file @
d382ecaa
...
...
@@ -3,6 +3,7 @@ package com.huigou.uasp.bpm.configuration.domain.model;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
...
...
@@ -27,7 +28,7 @@ import com.huigou.data.domain.model.TreeEntity;
@Entity
@Table
(
name
=
"WF_ApprovalRule"
)
@EntityListeners
({
CreatorAndModifierListener
.
class
})
@EntityListeners
({
CreatorAndModifierListener
.
class
})
public
class
ApprovalRule
extends
TreeEntity
{
public
static
final
String
ROOT_ID
=
"1"
;
...
...
@@ -291,9 +292,12 @@ public class ApprovalRule extends TreeEntity {
}
public
ApprovalRuleHandlerGroup
findApprovalRuleHandlerGroup
(
Integer
groupId
)
{
for
(
ApprovalRuleHandlerGroup
item
:
this
.
getApprovalRuleHandlerGroups
())
{
if
(
item
.
getGroupId
().
equals
(
groupId
))
{
return
item
;
List
<
ApprovalRuleHandlerGroup
>
approvalRuleHandlerGroups
=
this
.
getApprovalRuleHandlerGroups
();
if
(
approvalRuleHandlerGroups
!=
null
)
{
for
(
ApprovalRuleHandlerGroup
group
:
approvalRuleHandlerGroups
)
{
if
(
Objects
.
equals
(
group
.
getGroupId
(),
groupId
))
{
return
group
;
}
}
}
return
null
;
...
...
@@ -348,7 +352,7 @@ public class ApprovalRule extends TreeEntity {
return
result
;
}
public
static
boolean
isCategory
(
int
id
){
public
static
boolean
isCategory
(
int
id
)
{
return
CATEGORY
.
getId
()
==
id
;
}
}
...
...
huigou-core-api/src/main/java/com/huigou/uasp/bpm/configuration/domain/model/ApprovalRuleHandlerGroup.java
View file @
d382ecaa
...
...
@@ -31,6 +31,13 @@ public class ApprovalRuleHandlerGroup extends AbstractEntity {
@Enumerated
(
EnumType
.
STRING
)
@Column
(
name
=
"task_execute_mode_id"
)
private
TaskExecuteMode
taskExecuteMode
;
/**
* 最少审批人数
*
* @since 1.3.3
*/
@Column
(
name
=
"limit_handler"
)
private
Integer
limitHandler
;
public
TaskExecuteMode
getTaskExecuteMode
()
{
return
taskExecuteMode
;
...
...
@@ -40,4 +47,11 @@ public class ApprovalRuleHandlerGroup extends AbstractEntity {
this
.
taskExecuteMode
=
taskExecuteMode
;
}
public
Integer
getLimitHandler
()
{
return
limitHandler
;
}
public
void
setLimitHandler
(
Integer
limitHandler
)
{
this
.
limitHandler
=
limitHandler
;
}
}
huigou-core-api/src/main/java/com/huigou/uasp/bpm/engine/application/ActApplication.java
View file @
d382ecaa
...
...
@@ -21,28 +21,23 @@ public interface ActApplication {
/**
* 保存任务扩展信息
*
* @param runtimeTaskExtension
* 运行时任务
* @param runtimeTaskExtension 运行时任务
*/
void
saveTaskExtension
(
RuntimeTaskExtension
runtimeTaskExtension
);
/**
* 保存任务扩展信息
*
* @param runtimeTaskExtension
* 运行时任务
* @param initiatorPersonMemberId
* 发起人ID
* @param runtimeTaskExtension 运行时任务
* @param initiatorPersonMemberId 发起人ID
*/
void
saveTaskExtension
(
RuntimeTaskExtension
runtimeTaskExtension
,
String
initiatorPersonMemberId
);
/**
* 保存任务扩展信息
*
* @param runtimeTaskExtension
* 运行时任务扩展
* @param procUnitHandler
* 流程环节处理人
* @param runtimeTaskExtension 运行时任务扩展
* @param procUnitHandler 流程环节处理人
*/
void
saveTaskExtension
(
RuntimeTaskExtension
runtimeTaskExtension
,
ProcUnitHandler
procUnitHandler
);
...
...
@@ -51,40 +46,32 @@ public interface ActApplication {
* <p>
* 包括运行时和历史任务
*
* @param taskId
* 任务ID
* @param taskStatus
* 任务状态
* @param taskId 任务ID
* @param taskStatus 任务状态
*/
void
updateTaskExtensionStatus
(
String
taskId
,
TaskStatus
taskStatus
);
/**
* 更新扩展任务状态为暂缓
*
* @param taskId
* 任务ID
* @param taskId 任务ID
*/
void
updateTaskExtensionSleepingStatus
(
String
taskId
);
/**
* 更新历史任务扩展是否计时
*
* @param taskId
* 任务ID
* @param needTiming
* 是否计时
* @param taskId 任务ID
* @param needTiming 是否计时
*/
void
updateTaskExtensionNeedTiming
(
String
taskId
,
Integer
needTiming
);
/**
* 更新任务扩展处理意见
*
* @param taskId
* 任务ID
* @param result
* 处理结果
* @param opinion
* 处理意见
* @param taskId 任务ID
* @param result 处理结果
* @param opinion 处理意见
*/
void
updateTaskExtensionHandleResult
(
String
taskId
,
HandleResult
result
,
String
opinion
);
...
...
@@ -100,42 +87,33 @@ public interface ActApplication {
/**
* 更新任务处理人
*
* @param taskId
* 任务ID
* @param orgUnit
* 组织单元
* @param updateStartTime
* 更新开始时间
* @param taskId 任务ID
* @param orgUnit 组织单元
* @param updateStartTime 更新开始时间
*/
void
updateTaskHanlder
(
String
taskId
,
OrgUnit
orgUnit
,
boolean
updateStartTime
);
/**
* 更新历史任务扩展状态
*
* @param taskId
* 任务ID
* @param taskStatus
* 任务状态
* @param taskId 任务ID
* @param taskStatus 任务状态
*/
void
updateHistoricTaskInstanceExtensionStatus
(
String
taskId
,
TaskStatus
taskStatus
);
/**
* 更新历史任务扩展为结束状态
*
* @param taskId
* 任务ID
* @param taskStatus
* 任务状态
* @param deleteReason
* 删除原因
* @param taskId 任务ID
* @param taskStatus 任务状态
* @param deleteReason 删除原因
*/
void
updateHistoricTaskInstanceExtensionEnded
(
String
taskId
,
TaskStatus
taskStatus
,
String
deleteReason
);
/**
* 从数据库中读取一条运行任务扩展信息
*
* @param id
* 任务ID
* @param id 任务ID
* @return
*/
RuntimeTaskExtension
loadRuntimeTaskExtension
(
String
id
);
...
...
@@ -143,8 +121,7 @@ public interface ActApplication {
/**
* 从数据库中读取一条历史任务扩展信息
*
* @param id
* 任务ID
* @param id 任务ID
* @return
*/
HistoricTaskInstanceExtension
loadHistoricTaskInstanceExtension
(
String
id
);
...
...
@@ -152,8 +129,7 @@ public interface ActApplication {
/**
* 查询历史任务实例
*
* @param ids
* 任务ID列表
* @param ids 任务ID列表
* @return
*/
List
<
HistoricTaskInstanceExtension
>
queryHistoricTaskInstanceExtensions
(
List
<
String
>
ids
);
...
...
@@ -161,18 +137,15 @@ public interface ActApplication {
/**
* 查询未完成的协作历史任务
*
* @param bizId
* 业务ID
* @param bizId 业务ID
*/
List
<
RuntimeTaskExtension
>
queryCoordinationTaskInstances
(
String
bizId
);
/**
* 查询历史任务
*
* @param bizId
* 业务ID
* @param procUnitId
* 环境ID
* @param bizId 业务ID
* @param procUnitId 环境ID
* @return
*/
List
<
HistoricTaskInstanceExtension
>
queryHistoricTaskInstanceByBizAndProcUnitId
(
String
bizId
,
String
procUnitId
);
...
...
@@ -183,16 +156,14 @@ public interface ActApplication {
/**
* 删除运行时任务扩展信息
*
* @param taskId
* 任务ID
* @param taskId 任务ID
*/
void
deleteRuntimeTaskExtension
(
String
taskId
);
/**
* 查询审批历史记录
*
* @param bizId
* 业务ID
* @param bizId 业务ID
* @return
*/
Map
<
String
,
Object
>
queryApprovalHistoryByBizId
(
String
bizId
);
...
...
@@ -200,8 +171,7 @@ public interface ActApplication {
/**
* 查询审批历史记录
*
* @param processInstanceId
* 流程实例ID
* @param processInstanceId 流程实例ID
* @return
*/
Map
<
String
,
Object
>
queryApprovalHistoryByProcessInstanceId
(
String
processInstanceId
);
...
...
@@ -209,12 +179,9 @@ public interface ActApplication {
/**
* 查询回退任务
*
* @param bizCode
* 业务编码
* @param procUnitId
* 流程环节ID
* @param groupId
* 组ID
* @param bizCode 业务编码
* @param procUnitId 流程环节ID
* @param groupId 组ID
* @return
*/
Map
<
String
,
Object
>
queryBackTasksByBizCode
(
String
bizCode
,
String
procUnitId
,
Integer
groupId
);
...
...
@@ -222,8 +189,7 @@ public interface ActApplication {
/**
* 查询流程申请人
*
* @param processInstanceId
* 流程实例ID
* @param processInstanceId 流程实例ID
* @return
*/
Map
<
String
,
Object
>
queryApplicantByProcessInstanceId
(
String
processInstanceId
);
...
...
@@ -231,8 +197,7 @@ public interface ActApplication {
/**
* 查询申请人任务
*
* @param bizId
* 业务ID
* @param bizId 业务ID
* @return
*/
HistoricTaskInstanceExtension
queryApplicantTask
(
String
bizId
);
...
...
@@ -240,8 +205,7 @@ public interface ActApplication {
/**
* 查询申请人任务
*
* @param bizCode
* 业务编码
* @param bizCode 业务编码
* @return
*/
HistoricTaskInstanceExtension
queryApplicantTaskByBizCode
(
String
bizCode
);
...
...
@@ -249,8 +213,7 @@ public interface ActApplication {
/**
* 查询任务明细
*
* @param taskId
* 任务ID
* @param taskId 任务ID
* @return
*/
TaskDetail
queryTaskDetail
(
String
taskId
);
...
...
@@ -258,8 +221,7 @@ public interface ActApplication {
/**
* 查询流程申请人
*
* @param bizId
* 业务ID
* @param bizId 业务ID
* @return
*/
Map
<
String
,
Object
>
queryApplicantByBizId
(
String
bizId
);
...
...
@@ -267,12 +229,20 @@ public interface ActApplication {
/**
* 从数据库中读取一条运行任务
*
* @param taskId
* 任务ID
* @return
* @param taskId 任务ID
* @deprecated 已被 {@link #queryByRuntimeTaskById(String)} 替代。
*/
@Deprecated
Map
<
String
,
Object
>
loadRuntimeTaskById
(
String
taskId
);
/**
* 从数据库中读取一条运行任务
*
* @param taskId 任务ID
* @since 1.1.3
*/
RuntimeTaskExtension
queryByRuntimeTaskById
(
String
taskId
);
/**
* 根据bizId从数据库中读取一条运行任务
*
...
...
@@ -284,8 +254,7 @@ public interface ActApplication {
/**
* 从数据库中读取一条历史任务
*
* @param taskId
* 任务id
* @param taskId 任务id
* @return
*/
Map
<
String
,
Object
>
loadHistoricTaskById
(
String
taskId
);
...
...
@@ -293,8 +262,7 @@ public interface ActApplication {
/**
* 根据业务编码查询任务数据
*
* @param bizCode
* 业务编码
* @param bizCode 业务编码
* @return
*/
Map
<
String
,
Object
>
queryHiTaskInstsByBizCode
(
String
bizCode
);
...
...
@@ -302,10 +270,8 @@ public interface ActApplication {
/**
* 根据业务编码和类别ID查询任务数据
*
* @param bizCode
* 业务编码
* @param kindId
* 类别ID
* @param bizCode 业务编码
* @param kindId 类别ID
* @return
*/
Map
<
String
,
Object
>
queryHiTaskInstsByBizCodeAndKindId
(
String
bizCode
,
String
kindId
);
...
...
@@ -313,28 +279,23 @@ public interface ActApplication {
/**
* 保存任务关联
*
* @param bizId
* 业务ID
* @param historicTaskInstRelation
* 任务关联对象
* @param bizId 业务ID
* @param historicTaskInstRelation 任务关联对象
*/
void
saveHiTaskinstRelations
(
String
bizId
,
List
<
HistoricTaskInstanceRelation
>
historicTaskInstRelations
);
/**
* 删除任务关联
*
* @param ids
* 任务关联ID列表
* @param ids 任务关联ID列表
*/
void
deleteHiTaskinstRelations
(
List
<
String
>
ids
);
/**
* 查询任务关联
*
* @param taskId
* 任务ID
* @param bizId
* 业务ID
* @param taskId 任务ID
* @param bizId 业务ID
* @return
*/
Map
<
String
,
Object
>
queryHiTaskinstRelations
(
String
taskId
,
String
bizId
);
...
...
@@ -346,8 +307,7 @@ public interface ActApplication {
/**
* 加载流程实例扩展
*
* @param id
* 流程实例扩展ID
* @param id 流程实例扩展ID
* @return
*/
HistoricProcessInstanceExtension
loadHistoricProcessInstanceExtension
(
String
id
);
...
...
@@ -355,8 +315,7 @@ public interface ActApplication {
/**
* 根据流程实例ID加载流程实例扩展
*
* @param processInstanceId
* 流程实例ID
* @param processInstanceId 流程实例ID
* @return
*/
HistoricProcessInstanceExtension
loadHistoricProcessInstanceExtensionByProcInstId
(
String
processInstanceId
);
...
...
@@ -364,16 +323,11 @@ public interface ActApplication {
/**
* 添加流程实例扩展信息
*
* @param processInstanceId
* 流程实例ID
* @param businessKey
* 业务主键ID
* @param initiatorPersonMemberId
* 申请人员ID
* @param description
* 流程实例描述(标题)
* @param processStatus
* 流程状态
* @param processInstanceId 流程实例ID
* @param businessKey 业务主键ID
* @param initiatorPersonMemberId 申请人员ID
* @param description 流程实例描述(标题)
* @param processStatus 流程状态
*/
void
saveHistoricProcessInstanceExtension
(
HistoricProcessInstanceEntity
historicProcessInstanceEntity
,
String
initiatorPersonMemberId
,
String
description
,
ProcessStatus
processStatus
);
...
...
@@ -381,32 +335,25 @@ public interface ActApplication {
/**
* 更新流程实例扩展状态
*
* @param processInstanceId
* 流程实例ID
* @param processStatus
* 流程状态
* @param processInstanceId 流程实例ID
* @param processStatus 流程状态
*/
void
updateHistoricProcessInstanceExtensionStatus
(
String
processInstanceId
,
ProcessStatus
processStatus
);
/**
* 更新流程实例扩展已完成
*
* @param processInstanceId
* 流程实例ID
* @param processStatus
* 流程状态
* @param deleteReason
* 删除原因
* @param endActivityId
* 结束环节ID
* @param processInstanceId 流程实例ID
* @param processStatus 流程状态
* @param deleteReason 删除原因
* @param endActivityId 结束环节ID
*/
void
updateHistoricProcessInstanceExtensionEnded
(
String
processInstanceId
,
ProcessStatus
processStatus
,
String
deleteReason
,
String
endActivityId
);
/**
* 根据流程环节处理人ID查询最近的历史任务实例扩展数据
*
* @param procUnitHandlerId
* 环节处理人ID
* @param procUnitHandlerId 环节处理人ID
* @return
*/
HistoricTaskInstanceExtension
queryRecentHiTaskInstExtensionByProcUnitHandlerId
(
String
procUnitHandlerId
);
...
...
@@ -414,8 +361,7 @@ public interface ActApplication {
/**
* 根据流程环节处理人ID查询最历史任务实例扩展数据
*
* @param procUnitHandlerId
* 环节处理人ID
* @param procUnitHandlerId 环节处理人ID
* @return
*/
List
<
HistoricTaskInstanceExtension
>
queryHiTaskInstExtensionByProcUnitHandlerId
(
String
procUnitHandlerId
);
...
...
@@ -430,20 +376,16 @@ public interface ActApplication {
/**
* 查询完成的历史任务ID集合
*
* @param processInstanceId
* 流程实例ID
* @param previousTaskId
* 前驱任务ID
* @param processInstanceId 流程实例ID
* @param previousTaskId 前驱任务ID
*/
List
<
String
>
queryHiTaskIdsByProcessInstanceAndPreviousId
(
String
processInstanceId
,
String
previousTaskId
);
/**
* 查询运行时任务ID集合
*
* @param processInstanceId
* 流程实例ID
* @param previousTaskId
* 前驱任务ID
* @param processInstanceId 流程实例ID
* @param previousTaskId 前驱任务ID
* @return 任务ID集合
*/
List
<
String
>
queryRuTaskIdsByProcessInstanceAndPreviousId
(
String
processInstanceId
,
String
previousTaskId
);
...
...
@@ -451,10 +393,8 @@ public interface ActApplication {
/**
* 查询主审的协审人任务ID列表
*
* @param bizId
* 业务ID
* @param chiefId
* 主审ID
* @param bizId 业务ID
* @param chiefId 主审ID
* @return
*/
List
<
String
>
queryRuAssistantTaskIds
(
String
bizId
,
String
chiefId
);
...
...
@@ -462,8 +402,7 @@ public interface ActApplication {
/**
* 查询运行时任务ID集合
*
* @param processInstanceId
* 流程实例ID
* @param processInstanceId 流程实例ID
* @return 任务ID集合
*/
List
<
String
>
queryRuTaskIdsByProcessInstanceId
(
String
processInstanceId
);
...
...
@@ -473,8 +412,7 @@ public interface ActApplication {
/**
* 统计待办流程任务数
*
* @param bizCode
* 业务编码
* @param bizCode 业务编码
* @return
*/
long
countReadyProcTasksByBizCode
(
String
bizCode
);
...
...
@@ -482,10 +420,8 @@ public interface ActApplication {
/**
* 统计等待的协审任务书
*
* @param bizId
* 业务ID
* @param chiefId
* 主审ID
* @param bizId 业务ID
* @param chiefId 主审ID
* @return
*/
Integer
countWaitedAssistantTask
(
String
bizId
,
String
chiefId
);
...
...
@@ -493,8 +429,7 @@ public interface ActApplication {
/**
* 流程中存在打回任务数
*
* @param bizId
* 业务ID
* @param bizId 业务ID
* @return
*/
boolean
existsReplenishTask
(
String
bizId
);
...
...
huigou-core-api/src/main/java/com/huigou/uasp/bpm/engine/domain/model/ProcUnitHandlerBase.java
View file @
d382ecaa
...
...
@@ -36,7 +36,7 @@ import com.huigou.util.StringUtil;
* @author gongmm
*/
@MappedSuperclass
@EntityListeners
({
VersionListener
.
class
})
@EntityListeners
({
VersionListener
.
class
})
public
class
ProcUnitHandlerBase
implements
IdentifiedEntity
,
Cloneable
,
Serializable
{
private
static
final
long
serialVersionUID
=
7627740680619707939L
;
...
...
@@ -214,6 +214,13 @@ public class ProcUnitHandlerBase implements IdentifiedEntity, Cloneable, Seriali
private
String
clientName
;
private
Integer
sequence
;
/**
* 分组最少审批人数。
*
* @since 1.1.3
*/
@Column
(
name
=
"limit_handler"
)
private
Integer
limitHandler
;
@Override
public
String
getId
()
{
...
...
@@ -475,6 +482,14 @@ public class ProcUnitHandlerBase implements IdentifiedEntity, Cloneable, Seriali
this
.
sendMessage
=
sendMessage
;
}
public
Integer
getLimitHandler
()
{
return
limitHandler
;
}
public
void
setLimitHandler
(
Integer
limitHandler
)
{
this
.
limitHandler
=
limitHandler
;
}
public
void
updateHandleResult
(
int
result
,
String
opinion
,
int
status
)
{
this
.
setResult
(
result
);
this
.
setOpinion
(
opinion
);
...
...
@@ -546,7 +561,8 @@ public class ProcUnitHandlerBase implements IdentifiedEntity, Cloneable, Seriali
}
public
enum
Status
{
INITIAL
(-
2
,
"补审初始化状态"
),
MERGED
(-
1
,
"已合并"
),
READY
(
0
,
"未处理"
),
COMPLETED
(
1
,
"已处理"
),
RETURNED
(
2
,
"已回退"
),
;
INITIAL
(-
2
,
"补审初始化状态"
),
MERGED
(-
1
,
"已合并"
),
READY
(
0
,
"未处理"
),
COMPLETED
(
1
,
"已处理"
),
RETURNED
(
2
,
"已回退"
),
;
private
final
int
id
;
private
final
String
displayName
;
...
...
@@ -581,7 +597,7 @@ public class ProcUnitHandlerBase implements IdentifiedEntity, Cloneable, Seriali
case
2
:
return
RETURNED
;
default
:
throw
new
ApplicationException
(
String
.
format
(
"无效的流程环节处理状态“%s”。"
,
new
Object
[]
{
Integer
.
valueOf
(
id
)
}));
throw
new
ApplicationException
(
String
.
format
(
"无效的流程环节处理状态“%s”。"
,
new
Object
[]{
Integer
.
valueOf
(
id
)
}));
}
}
}
...
...
huigou-data/src/main/java/com/huigou/data/query/parser/impl/SQLBuilderImpl.java
View file @
d382ecaa
package
com
.
huigou
.
data
.
query
.
parser
.
impl
;
import
java.util.Map
;
import
java.util.regex.Matcher
;
import
com.huigou.data.domain.query.QueryAbstractRequest
;
import
com.huigou.data.query.QueryPermissionBuilder
;
import
com.huigou.data.query.SQLExecutor
;
import
com.huigou.data.query.XMLParseUtil
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.parser.SQLBuilder
;
import
com.huigou.data.query.parser.model.ConditionModel
;
import
com.huigou.data.query.parser.model.DataFilterGroup
;
...
...
@@ -21,6 +17,9 @@ import com.huigou.uasp.bmp.query.QueryDocument.Query;
import
com.huigou.uasp.bmp.query.SqlDocument.Sql
;
import
com.huigou.util.StringUtil
;
import
java.util.Map
;
import
java.util.regex.Matcher
;
/**
* 根据查询对象组合SQL
*
...
...
huigou-uasp/src/main/java/com/huigou/uasp/bpm/FlowBroker.java
View file @
d382ecaa
package
com
.
huigou
.
uasp
.
bpm
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
...
...
@@ -84,6 +80,10 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
private
static
final
long
serialVersionUID
=
-
6575998537083218220L
;
private
static
final
String
PREEMPT_CANCEL_VARIABLE
=
"preemptCancel"
;
/**
* @since 1.1.3
*/
private
static
final
String
LIMIT_HANDLER_CANCEL_VARIABLE
=
"limitHandlerCancel"
;
private
static
final
String
CHIEF_APPROVE_PASSED_VARIABLE
=
"chiefApprovePassed"
;
...
...
@@ -236,8 +236,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 设置任务ID
*
* @param taskId
* 任务ID
* @param taskId 任务ID
*/
protected
void
setNewTaskId
(
String
taskId
)
{
getBizAndApprovalData
().
putProperty
(
"newTaskId"
,
taskId
);
...
...
@@ -286,8 +285,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 当前任务是否为审批环节
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
* @return 当前任务是否为审批环节
*/
protected
boolean
isApprovalProcUnit
(
DelegateTask
delegateTask
)
{
...
...
@@ -297,15 +295,14 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 当前任务是否为审批环节
*
* @param procUnitId
* 环节id
* @param procUnitId 环节id
* @return 当前任务是否为审批环节
*/
protected
boolean
isApprovalProcUnit
(
String
procUnitId
)
{
return
ActivityKind
.
APPROVE
.
equalsIgnoreCase
(
procUnitId
);
}
/**
/**
currentGroupChiefApprovePassed
* 流程通知事件处理
* <ul>
* <li>流程实例启动事件:调用<code>onStart</code>保存业务数据和历史流程实例扩展数据。</li>
...
...
@@ -318,6 +315,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
* <li>流程实例撤销事件</li>
* </ul>
*/
@Override
public
void
notify
(
DelegateExecution
delegateExecution
)
{
String
eventName
=
delegateExecution
.
getEventName
();
try
{
...
...
@@ -379,6 +377,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
* <li>预览处理人事件</li>
* </ul>
*/
@Override
public
void
notify
(
DelegateTask
delegateTask
)
{
String
eventName
=
delegateTask
.
getEventName
();
try
{
...
...
@@ -420,8 +419,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 审批是否完成
*
* @param procUnitId
* 流程环节ID
* @param procUnitId 流程环节ID
* @return 审批是否完成
*/
protected
boolean
approveFinished
(
String
procUnitId
)
{
...
...
@@ -447,7 +445,11 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
*/
protected
boolean
currentGroupChiefApprovePassed
(
String
procUnitId
)
{
int
groupId
=
getCurrentHandleGroupId
();
return
this
.
procUnitHandlerApplication
.
checkCurrentGroupChiefApprovePassed
(
getApprovalParameter
().
getBizId
(),
procUnitId
,
groupId
);
if
(
this
.
procUnitHandlerApplication
.
checkCurrentGroupChiefApprovePassed
(
getApprovalParameter
().
getBizId
(),
procUnitId
,
groupId
))
{
return
true
;
}
ProcUnitHandler
procUnitHandler
=
procUnitHandlerApplication
.
queryProcUnitHandlers
(
getApprovalParameter
().
getBizId
(),
procUnitId
,
groupId
).
get
(
0
);
return
isLimitHandler
(
procUnitId
,
groupId
,
procUnitHandler
.
getLimitHandler
());
}
private
String
getTaskDescriptionPrefix
()
{
...
...
@@ -473,8 +475,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 设置默认任务主题
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
protected
void
setTaskDescription
(
DelegateTask
delegateTask
)
{
...
...
@@ -483,10 +484,8 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 处理设置任务处理人信息(非申请环节和审批环节)
*
* @param delegateTask
* 代理任务
* @param runtimeTaskExtension
* 运行时任务扩展数据
* @param delegateTask 代理任务
* @param runtimeTaskExtension 运行时任务扩展数据
*/
protected
void
doOtherSetCurrentTaskHandler
(
DelegateTask
delegateTask
,
RuntimeTaskExtension
runtimeTaskExtension
)
{
...
...
@@ -495,10 +494,8 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 应用代理规则
*
* @param delegateTask
* 代理任务
* @param procUnitHandler
* 环节处理人
* @param delegateTask 代理任务
* @param procUnitHandler 环节处理人
* @return
*/
protected
Agent
applyAgentRule
(
DelegateTask
delegateTask
,
ProcUnitHandler
procUnitHandler
)
{
...
...
@@ -528,8 +525,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 填充申请人扩展数据
*
* @param runtimeTaskExtension
* 运行时任务扩展数据
* @param runtimeTaskExtension 运行时任务扩展数据
*/
private
void
fillApplicantExtendData
(
RuntimeTaskExtension
runtimeTaskExtension
)
{
SDO
sdo
=
ThreadLocalUtil
.
getVariable
(
Constants
.
SDO
,
SDO
.
class
);
...
...
@@ -556,10 +552,8 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
* <p>
* 3、设置扩展属性的处理人
*
* @param delegateTask
* 代理任务
* @param runtimeTaskExtension
* 运行时任务扩展数据
* @param delegateTask 代理任务
* @param runtimeTaskExtension 运行时任务扩展数据
*/
protected
void
setCurrentTaskHandler
(
DelegateTask
delegateTask
,
RuntimeTaskExtension
runtimeTaskExtension
)
{
String
processDefinitionId
=
delegateTask
.
getExecution
().
getProcessDefinitionId
();
...
...
@@ -734,8 +728,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
* <p>
* 与<code>saveBizAndApprovalData()</code>不同,可以通过本方法设置任务属性。
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
* @return
* @see #saveBizAndApprovalData()
*/
...
...
@@ -750,8 +743,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
* <li>保存历史流程实例扩展表</li>
* </ul>
*
* @param delegateExecution
* 代理执行
* @param delegateExecution 代理执行
*/
protected
void
onStart
(
DelegateExecution
delegateExecution
)
{
String
startModel
=
(
String
)
delegateExecution
.
getVariable
(
"startModel"
);
...
...
@@ -776,8 +768,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 流程结束事件
*
* @param delegateExecution
* 代理执行
* @param delegateExecution 代理执行
*/
protected
void
onEnd
(
DelegateExecution
delegateExecution
)
{
boolean
isMakeACopyFor
=
ClassHelper
.
convert
(
delegateExecution
.
getVariable
(
IS_MAKE_A_COPY_FOR
),
Boolean
.
class
,
false
);
...
...
@@ -803,8 +794,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 流程撤销事件
*
* @param delegateExecution
* 代理执行实例
* @param delegateExecution 代理执行实例
*/
protected
void
onRecallProcessInstance
(
DelegateExecution
delegateExecution
)
{
...
...
@@ -813,8 +803,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 删除流程实例事件
*
* @param delegateExecution
* 代理执行
* @param delegateExecution 代理执行
*/
protected
void
onDeleteProcessInstance
(
DelegateExecution
delegateExecution
)
{
}
...
...
@@ -822,8 +811,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 终止流程实例事件
*
* @param delegateExecution
* 代理执行
* @param delegateExecution 代理执行
*/
protected
void
onAbortProcessInstance
(
DelegateExecution
delegateExecution
)
{
boolean
isMakeACopyFor
=
ClassHelper
.
convert
(
delegateExecution
.
getVariable
(
IS_MAKE_A_COPY_FOR
),
Boolean
.
class
,
false
);
...
...
@@ -899,10 +887,8 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 设置任务扩展数据默认值
*
* @param delegateTask
* 代理任务
* @param runtimeTaskExtension
* 运行时任务数据
* @param delegateTask 代理任务
* @param runtimeTaskExtension 运行时任务数据
*/
private
void
setTaskExtendData
(
DelegateTask
delegateTask
,
RuntimeTaskExtension
runtimeTaskExtension
)
{
runtimeTaskExtension
.
setGenerateReason
(
getApprovalParameter
().
getProcessAction
());
...
...
@@ -914,10 +900,8 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 设置任务是否计时
*
* @param delegateTask
* 代理任务
* @param runtimeTaskExtension
* 运行时任务数据
* @param delegateTask 代理任务
* @param runtimeTaskExtension 运行时任务数据
*/
protected
void
setTaskLimitTime
(
DelegateTask
delegateTask
,
RuntimeTaskExtension
runtimeTaskExtension
)
{
if
(!
this
.
isApplyProcUnit
(
delegateTask
))
{
...
...
@@ -936,10 +920,8 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 修正扩展数据
*
* @param delegateTask
* 代理人员
* @param runtimeTaskExtension
* 任务扩展
* @param delegateTask 代理人员
* @param runtimeTaskExtension 任务扩展
*/
protected
void
reviseExtendData
(
DelegateTask
delegateTask
,
RuntimeTaskExtension
runtimeTaskExtension
)
{
...
...
@@ -956,8 +938,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
* <li>设置任务执行人信息
* </ul>
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
protected
void
onBeforeCreate
(
DelegateTask
delegateTask
)
{
RuntimeTaskExtension
runtimeTaskExtension
=
new
RuntimeTaskExtension
();
...
...
@@ -1057,8 +1038,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
* <li>给任务赋默认值
* </ul>
*
* @param delegateTas
* 代理任务
* @param delegateTas 代理任务
*/
@Transactional
public
void
onCreate
(
DelegateTask
delegateTask
)
{
...
...
@@ -1068,8 +1048,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 给任务赋处理人事件
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
public
void
onAssignment
(
DelegateTask
delegateTask
)
{
...
...
@@ -1090,8 +1069,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 是否抢占取消任务
*
* @param delegateTask
* 任务代理
* @param delegateTask 任务代理
* @return
*/
private
boolean
isPreemptCanceledTask
(
DelegateTask
delegateTask
)
{
...
...
@@ -1102,6 +1080,17 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
return
false
;
}
/**
* @since 1.1.3
*/
private
boolean
isLimitHandlerCanceledTask
(
DelegateTask
delegateTask
)
{
Object
object
=
delegateTask
.
getVariable
(
LIMIT_HANDLER_CANCEL_VARIABLE
);
if
(
object
!=
null
)
{
return
delegateTask
.
getVariable
(
LIMIT_HANDLER_CANCEL_VARIABLE
,
Boolean
.
class
);
}
return
false
;
}
/**
* 处理任务协作模式
*
...
...
@@ -1140,7 +1129,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
List
<
String
>
taskIds
=
this
.
actApplication
.
queryRuTaskIdsByProcessInstanceId
(
delegateTask
.
getProcessInstanceId
());
for
(
String
taskId
:
taskIds
)
{
if
(!
delegateTask
.
getId
().
equals
(
taskId
))
{
Map
<
String
,
Object
>
variables
=
new
HashMap
<
String
,
Object
>(
1
);
Map
<
String
,
Object
>
variables
=
new
HashMap
<>(
1
);
variables
.
put
(
PREEMPT_CANCEL_VARIABLE
,
true
);
this
.
workflowService
.
getTaskService
().
complete
(
taskId
,
variables
,
true
);
}
...
...
@@ -1148,6 +1137,19 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
this
.
procUnitHandlerApplication
.
updateOtherProcUnitHandlersResultSystemComplete
(
this
.
getBizId
(),
delegateTask
.
getTaskDefinitionKey
(),
this
.
getCurrentHandleGroupId
(),
procUnitHandlerId
,
null
);
}
else
{
// @since 1.1.3
if
(
isLimitHandler
(
procUnitHandler
.
getProcUnitId
(),
procUnitHandler
.
getGroupId
(),
procUnitHandler
.
getLimitHandler
()))
{
// 系统完成其他人的任务(包括协审任务)
Map
<
String
,
Object
>
variables
=
new
HashMap
<>(
1
);
variables
.
put
(
LIMIT_HANDLER_CANCEL_VARIABLE
,
true
);
this
.
actApplication
.
queryRuTaskIdsByProcessInstanceId
(
delegateTask
.
getProcessInstanceId
())
.
stream
()
.
filter
(
taskId
->
!
taskId
.
equals
(
delegateTask
.
getId
()))
.
forEach
(
taskId
->
workflowService
.
getTaskService
().
complete
(
taskId
,
variables
,
true
));
this
.
procUnitHandlerApplication
.
updateOtherProcUnitHandlersResultSystemComplete
(
this
.
getBizId
(),
delegateTask
.
getTaskDefinitionKey
(),
this
.
getCurrentHandleGroupId
(),
procUnitHandlerId
,
null
);
return
;
}
// 主审完成后,查询协审任务添加到通知事件环境中
List
<
String
>
taskIds
=
this
.
actApplication
.
queryRuAssistantTaskIds
(
this
.
getBizId
(),
procUnitHandlerId
);
for
(
String
taskId
:
taskIds
)
{
...
...
@@ -1156,11 +1158,28 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
}
}
/**
* @since 1.1.3
*/
private
boolean
isLimitHandler
(
String
procUnitId
,
Integer
groupId
,
Integer
limitHandler
)
{
int
procUnitHandlerCount
=
procUnitHandlerApplication
.
queryProcUnitHandlerIds
(
getBizId
(),
procUnitId
,
groupId
).
size
();
if
(
procUnitHandlerCount
<
2
)
{
return
false
;
}
// 已完成的环节处理人(主审)
List
<
ProcUnitHandler
>
completedChiefProcUnitHandlers
=
procUnitHandlerApplication
.
queryCompletedProcUnitHandlers
(
getBizId
(),
procUnitId
,
groupId
)
.
stream
()
.
filter
(
handler
->
CooperationModelKind
.
isChief
(
handler
.
getCooperationModelId
()))
.
collect
(
Collectors
.
toList
());
return
limitHandler
!=
null
&&
limitHandler
>
0
&&
Objects
.
equals
(
limitHandler
,
completedChiefProcUnitHandlers
.
size
());
}
/**
* 任务完成前事件处理
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
protected
void
onBeforeComplete
(
DelegateTask
delegateTask
)
{
if
(
isApprovalProcUnit
(
delegateTask
))
{
...
...
@@ -1205,8 +1224,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 任务完成后事件处理
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
protected
void
onAfterComplete
(
DelegateTask
delegateTask
)
{
...
...
@@ -1217,8 +1235,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
* <p>
* 基类只处理申请环节提交后,计算审批环节处理人
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
@Deprecated
protected
void
calculateNextProcUnitHandlers
(
DelegateTask
delegateTask
)
{
...
...
@@ -1348,7 +1365,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
private
void
calculateNextProcUnitHandlersForQueryAdvance
(
VariableScope
variableScope
,
String
processDefinitionKey
,
String
nextProcUnitId
)
{
List
<
Object
>
inputHandlers
=
this
.
getBizAndApprovalData
().
getList
(
"procUnitHandlers"
);
List
<
Map
<
String
,
Object
>>
handlerList
=
new
ArrayList
<
Map
<
String
,
Object
>
>(
inputHandlers
.
size
());
List
<
Map
<
String
,
Object
>>
handlerList
=
new
ArrayList
<>(
inputHandlers
.
size
());
checkQueryAdvance
(
inputHandlers
);
...
...
@@ -1428,8 +1445,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 修正下一环节处理人
*
* @param handlerList
* 环节处理人
* @param handlerList 环节处理人
*/
protected
void
reviseNextProcUnitHandlers
(
List
<
Map
<
String
,
Object
>>
handlerList
)
{
...
...
@@ -1527,8 +1543,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 计算下一环节处理人
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
protected
void
doCalculateNextProcUnitHandlers
(
DelegateTask
delegateTask
)
{
checkLicense
();
...
...
@@ -1566,8 +1581,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
* <p>
* 2、当前环节已审批完成,获取下一环节第一组审批人
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
protected
void
fillNextGroupHandlers
(
DelegateTask
delegateTask
)
{
Boolean
needApprove
=
ClassHelper
.
convert
(
delegateTask
.
getVariable
(
"needApprove"
),
Boolean
.
class
,
true
);
...
...
@@ -1605,8 +1619,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 保存逻辑处理
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
protected
void
onSave
(
DelegateTask
delegateTask
)
{
}
...
...
@@ -1614,8 +1627,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 提交事件
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
protected
void
onAdvance
(
DelegateTask
delegateTask
)
{
...
...
@@ -1624,10 +1636,8 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 抓回逻辑处理
*
* @param delegateTask
* 代理任务
* @param destActivityId
* 目标环境id
* @param delegateTask 代理任务
* @param destActivityId 目标环境id
*/
protected
void
onWithdraw
(
DelegateTask
delegateTask
,
String
destActivityId
)
{
...
...
@@ -1734,7 +1744,10 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
result
=
true
;
break
;
}
if
(
isLimitHandlerCanceledTask
(
delegateTask
))
{
result
=
true
;
break
;
}
String
bizId
=
approvalParameter
.
getBizId
();
if
(
StringUtil
.
isNotBlank
(
bizId
))
{
if
(
approvalParameter
.
isQueryAdvanceProcessAction
()
||
approvalParameter
.
getOnlyAdvance
())
{
...
...
@@ -1793,8 +1806,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
* <li>计算并填充流出节点的处理人
* </ul>
*
* @param delegateTask
* 代理人
* @param delegateTask 代理人
*/
public
void
onComplete
(
DelegateTask
delegateTask
)
{
if
(
fireEvent
(
delegateTask
))
{
...
...
@@ -1908,10 +1920,8 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
* <p>
* 取出下一组审批人列表,放入到handlerList中
*
* @param delegateTask
* 代理任务
* @param nextProcUnitId
* 下一环节ID
* @param delegateTask 代理任务
* @param nextProcUnitId 下一环节ID
*/
protected
void
fillHandlerListVariable
(
DelegateTask
delegateTask
,
String
nextProcUnitId
)
{
List
<
String
>
handlers
=
buildNextActivityGroupHandlers
(
delegateTask
.
getExecution
().
getProcessBusinessKey
(),
nextProcUnitId
,
getCurrentHandleGroupId
());
...
...
@@ -1931,10 +1941,8 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
* <p>
* 2、当前环节已审批完成,获取下一环节第一组审批人
*
* @param delegateTask
* 代理任务
* @param nextProcUnitId
* 下一环节ID
* @param delegateTask 代理任务
* @param nextProcUnitId 下一环节ID
*/
protected
void
doFillNextGroupHandlers
(
DelegateTask
delegateTask
,
String
nextProcUnitId
)
{
if
(
StringUtil
.
isNotBlank
(
nextProcUnitId
))
{
...
...
@@ -1967,8 +1975,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 任务删除事件
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
protected
void
onDelete
(
DelegateTask
delegateTask
)
{
// 审批未通过终止,删除流程实例的时候,任务已删除。
...
...
@@ -2058,8 +2065,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 保存业务数据
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
protected
String
onSaveBizData
(
DelegateTask
delegateTask
)
{
return
saveBizAndApprovalData
(
delegateTask
);
...
...
@@ -2067,8 +2073,6 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 检查审批规则处理人不能为空
*
* @param approvalRuleHandlers
*/
private
void
checkApprovalRuleHandlerNotNull
(
ApprovalRule
approvalRule
)
{
// 检查审批人是否为空
...
...
@@ -2108,18 +2112,12 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
return
false
;
}
/**
*
*/
/**
* 生成任务执行模型
*
* @param approvalRule
* 审批规则
* @param groupId
* 分组ID
* @param handler
* 处理人
* @param approvalRule 审批规则
* @param groupId 分组ID
* @param handler 处理人
*/
private
void
buildTaskExecuteMode
(
ApprovalRule
approvalRule
,
Integer
groupId
,
Map
<
String
,
Object
>
handler
)
{
ApprovalRuleHandlerGroup
approvalRuleHandlerGroup
=
approvalRule
.
findApprovalRuleHandlerGroup
(
groupId
);
...
...
@@ -2131,18 +2129,12 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 生成环节预览处理人
*
* @param processDefinitionKey
* 流程定义ID
* @param procUnitId
* 流程环节ID
* @param procUnitName
* 流程环节名称
* @param hasGatewayManual
* 是否有选择网关
* @param bizParams
* 业务参数
* @param handlers
* 处理人
* @param processDefinitionKey 流程定义ID
* @param procUnitId 流程环节ID
* @param procUnitName 流程环节名称
* @param hasGatewayManual 是否有选择网关
* @param bizParams 业务参数
* @param handlers 处理人
* @return
*/
protected
boolean
buildProcUnitHandlersForQuery
(
DelegateTask
delegateTask
,
String
processDefinitionKey
,
String
procUnitId
,
String
procUnitName
,
...
...
@@ -2259,8 +2251,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 预览处理人事件
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
*/
@SuppressWarnings
(
"unchecked"
)
protected
void
onQueryHandlers
(
DelegateTask
delegateTask
)
{
...
...
@@ -2284,11 +2275,11 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
Integer
porcUnitSequence
=
0
;
List
<
Map
<
String
,
Object
>>
handlers
=
new
ArrayList
<
Map
<
String
,
Object
>
>(
nextProcUnits
.
size
());
List
<
Map
<
String
,
Object
>>
handlers
=
new
ArrayList
<>(
nextProcUnits
.
size
());
List
<
Map
<
String
,
Object
>>
currentProcUnitHandlers
;
for
(
String
procUnitId
:
nextProcUnits
.
keySet
())
{
currentProcUnitHandlers
=
new
ArrayList
<
Map
<
String
,
Object
>
>();
currentProcUnitHandlers
=
new
ArrayList
<>();
if
(
hasGatewayManual
)
{
if
(
nextProcUnits
.
get
(
procUnitId
)
instanceof
EndEvent
)
{
handlers
.
add
(
buildEndHandlersForQuery
(
procUnitId
));
...
...
@@ -2351,10 +2342,8 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 冒泡排序处理人
*
* @param handlers
* 处理人
* @param sortField
* 排序字段
* @param handlers 处理人
* @param sortField 排序字段
*/
private
void
bubbleSortHandlers
(
List
<
Map
<
String
,
Object
>>
handlers
,
String
sortField
)
{
Integer
currentValue
,
nextValue
;
...
...
@@ -2405,8 +2394,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 得到流程业务参数
*
* @param bizId
* 业务ID
* @param bizId 业务ID
* @return 业务参数
*/
protected
Map
<
String
,
Object
>
getProcessBizParams
(
String
bizId
)
{
...
...
@@ -2416,8 +2404,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 得到当前Activity
*
* @param processDefinitionId
* 流程定义ID
* @param processDefinitionId 流程定义ID
* @return activity 环节ID
*/
protected
ActivityImpl
getCurrentActivity
(
String
processDefinitionId
,
String
activityId
)
{
...
...
@@ -2436,8 +2423,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 是否申请环节
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
* @return 是否申请环节
*/
protected
boolean
isApplyProcUnit
(
DelegateTask
delegateTask
)
{
...
...
@@ -2575,18 +2561,12 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 生成环节处理人
*
* @param approvalRule
* 审批规则
* @param approvalRuleHandler
* 审批规则处理人
* @param bizId
* 业务ID
* @param procUnitId
* 流程环节ID
* @param orgUnit
* 组织单元
* @param sequence
* 序号
* @param approvalRule 审批规则
* @param approvalRuleHandler 审批规则处理人
* @param bizId 业务ID
* @param procUnitId 流程环节ID
* @param orgUnit 组织单元
* @param sequence 序号
* @return
*/
protected
Map
<
String
,
Object
>
buildProcUnitHandler
(
ApprovalRule
approvalRule
,
ApprovalRuleHandler
approvalRuleHandler
,
String
bizId
,
String
procUnitId
,
...
...
@@ -2600,6 +2580,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
approvalRuleHandler
.
getGroupId
(),
sequence
,
0
);
if
(
approvalRule
!=
null
)
{
buildTaskExecuteMode
(
approvalRule
,
approvalRuleHandler
.
getGroupId
(),
handler
);
buildLimitHandler
(
approvalRule
,
approvalRuleHandler
,
handler
);
}
// 发送消息
handler
.
put
(
"sendMessage"
,
approvalRuleHandler
.
getSendMessage
());
...
...
@@ -2607,6 +2588,16 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
return
handler
;
}
/**
* @since 1.1.3
*/
private
void
buildLimitHandler
(
ApprovalRule
approvalRule
,
ApprovalRuleHandler
approvalRuleHandler
,
Map
<
String
,
Object
>
handler
)
{
ApprovalRuleHandlerGroup
approvalRuleHandlerGroup
=
approvalRule
.
findApprovalRuleHandlerGroup
(
approvalRuleHandler
.
getGroupId
());
if
(
approvalRuleHandlerGroup
!=
null
)
{
handler
.
put
(
"limitHandler"
,
approvalRuleHandlerGroup
.
getLimitHandler
());
}
}
/**
* 添加附加审批人员
* <p>
...
...
@@ -2625,14 +2616,10 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 添加附加处理人
*
* @param bizId
* 业务ID
* @param chiefHandlers
* 主审人
* @param additionalHandlers
* 附加处理人
* @param currentProcUnitId
* 当前流程环节ID
* @param bizId 业务ID
* @param chiefHandlers 主审人
* @param additionalHandlers 附加处理人
* @param currentProcUnitId 当前流程环节ID
*/
protected
void
addAdditionalHandlers
(
String
bizId
,
List
<
Map
<
String
,
Object
>>
chiefHandlers
,
List
<
Map
<
String
,
Object
>>
additionalHandlers
,
String
currentProcUnitId
)
{
...
...
@@ -2678,8 +2665,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 通过环节ID获取环节处理人
*
* @param delegateTask
* 代理任务
* @param delegateTask 代理任务
* @return 环节处理人
*/
protected
List
<
OrgUnit
>
getHandlersByProcUnitId
(
DelegateTask
delegateTask
,
String
procUnitId
)
{
...
...
@@ -2750,7 +2736,8 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
continue
;
}
currentPersonId
=
currentPersonId
.
substring
(
0
,
currentPersonId
.
indexOf
(
'@'
));
handlersLoop:
for
(
int
j
=
i
-
1
;
j
>=
0
;
j
--)
{
handlersLoop:
for
(
int
j
=
i
-
1
;
j
>=
0
;
j
--)
{
priorHandler
=
handlers
.
get
(
j
);
priorPersonId
=
ClassHelper
.
convert
(
priorHandler
.
get
(
"handlerId"
),
String
.
class
);
priorStatus
=
ClassHelper
.
convert
(
priorHandler
.
get
(
"status"
),
Integer
.
class
,
0
);
...
...
@@ -2799,10 +2786,8 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 排除指定人员
*
* @param bizId
* 业务ID
* @param handlers
* 处理人集合
* @param bizId 业务ID
* @param handlers 处理人集合
*/
private
void
excludeSpecifiedHandler
(
String
bizId
,
List
<
Map
<
String
,
Object
>>
handlers
)
{
List
<
String
>
specifiedExcludeHandler
=
getSpecifiedExcludeHandler
(
bizId
);
...
...
@@ -2840,8 +2825,7 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 得到指定的排除人员列表
*
* @param bizId
* 业务id
* @param bizId 业务id
* @return
*/
protected
List
<
String
>
getSpecifiedExcludeHandler
(
String
bizId
)
{
...
...
@@ -2851,12 +2835,9 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 内部抄送
*
* @param orgUnits
* 组织单元
* @param taskId
* 任务ID
* @param description
* 标题
* @param orgUnits 组织单元
* @param taskId 任务ID
* @param description 标题
*/
private
void
internalMakeACopyFor
(
List
<
OrgUnit
>
orgUnits
,
String
taskId
,
String
description
)
{
if
(
orgUnits
.
size
()
>
0
)
{
...
...
@@ -2874,14 +2855,10 @@ public class FlowBroker extends BaseApplication implements TaskListener, Executi
/**
* 给指定的管理权限发抄送任务
*
* @param orgId
* 组织ID
* @param manageType
* 业务管理权限类别
* @param taskId
* 任务ID
* @param description
* 标题
* @param orgId 组织ID
* @param manageType 业务管理权限类别
* @param taskId 任务ID
* @param description 标题
*/
protected
void
makeACopyForToManageType
(
String
orgId
,
String
manageType
,
String
taskId
,
String
description
)
{
List
<
OrgUnit
>
orgUnits
=
orgFun
.
findManagers
(
orgId
,
manageType
,
false
,
null
);
...
...
huigou-uasp/src/main/java/com/huigou/uasp/bpm/configuration/application/impl/ApprovalRuleApplicationImpl.java
View file @
d382ecaa
...
...
@@ -461,10 +461,16 @@ public class ApprovalRuleApplicationImpl extends BaseApplication implements Appr
}
@Override
@Transactional
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
void
saveApprovalRuleHandler
(
String
approvalRuleId
,
ApprovalRuleHandler
approvalRuleHandler
,
TaskExecuteMode
taskExecuteMode
,
List
<
ApprovalRuleHandlerAssist
>
assistants
,
List
<
ApprovalRuleHandlerAssist
>
ccs
,
List
<
ApprovalRuleHandlerUIElmentPermission
>
uiElmentPermissions
)
{
List
<
ApprovalRuleHandlerUIElmentPermission
>
fieldAuthorizations
)
{
saveApprovalRuleHandler
(
approvalRuleId
,
approvalRuleHandler
,
taskExecuteMode
,
null
,
assistants
,
ccs
,
fieldAuthorizations
);
}
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Override
public
void
saveApprovalRuleHandler
(
String
approvalRuleId
,
ApprovalRuleHandler
approvalRuleHandler
,
TaskExecuteMode
taskExecuteMode
,
Integer
limitHandler
,
List
<
ApprovalRuleHandlerAssist
>
assistants
,
List
<
ApprovalRuleHandlerAssist
>
ccs
,
List
<
ApprovalRuleHandlerUIElmentPermission
>
fieldAuthorizations
)
{
Assert
.
hasText
(
approvalRuleId
,
"参数approvalRuleId不能为空。"
);
Assert
.
notNull
(
approvalRuleHandler
,
"参数approvalRuleHandler不能为空。"
);
...
...
@@ -473,13 +479,18 @@ public class ApprovalRuleApplicationImpl extends BaseApplication implements Appr
ApprovalRuleHandler
sourceApprovalRuleHandler
=
approvalRule
.
findApprovalRuleHandler
(
approvalRuleHandler
.
getId
());
ApprovalRuleHandlerGroup
approvalRuleHandlerGroup
=
approvalRule
.
findApprovalRuleHandlerGroup
(
sourceApprovalRuleHandler
.
getGroupId
());
sourceApprovalRuleHandler
.
fromEntity
(
approvalRuleHandler
);
if
(
taskExecuteMode
==
null
)
{
if
(
taskExecuteMode
==
null
&&
limitHandler
==
null
)
{
if
(
approvalRuleHandlerGroup
!=
null
)
{
approvalRule
.
getApprovalRuleHandlerGroups
().
remove
(
approvalRuleHandlerGroup
);
}
}
if
(
taskExecuteMode
==
null
)
{
if
(
approvalRuleHandlerGroup
!=
null
)
{
approvalRuleHandlerGroup
.
setTaskExecuteMode
(
null
);
}
}
else
{
if
(
approvalRuleHandlerGroup
==
null
)
{
approvalRuleHandlerGroup
=
new
ApprovalRuleHandlerGroup
();
...
...
@@ -488,6 +499,21 @@ public class ApprovalRuleApplicationImpl extends BaseApplication implements Appr
approvalRuleHandlerGroup
.
setGroupId
(
sourceApprovalRuleHandler
.
getGroupId
());
approvalRuleHandlerGroup
.
setTaskExecuteMode
(
taskExecuteMode
);
}
if
(
limitHandler
==
null
)
{
if
(
approvalRuleHandlerGroup
!=
null
)
{
approvalRuleHandlerGroup
.
setLimitHandler
(
null
);
}
}
else
{
if
(
approvalRuleHandlerGroup
==
null
)
{
approvalRuleHandlerGroup
=
new
ApprovalRuleHandlerGroup
();
approvalRule
.
getApprovalRuleHandlerGroups
().
add
(
approvalRuleHandlerGroup
);
}
approvalRuleHandlerGroup
.
setGroupId
(
sourceApprovalRuleHandler
.
getGroupId
());
approvalRuleHandlerGroup
.
setLimitHandler
(
limitHandler
);
}
// 协审 抄送
sourceApprovalRuleHandler
.
getAssists
().
clear
();
if
(
assistants
!=
null
)
{
...
...
@@ -498,8 +524,8 @@ public class ApprovalRuleApplicationImpl extends BaseApplication implements Appr
}
// 权限字段
sourceApprovalRuleHandler
.
getUIElmentPermissions
().
clear
();
if
(
uiElmentPermiss
ions
!=
null
)
{
sourceApprovalRuleHandler
.
getUIElmentPermissions
().
addAll
(
uiElmentPermiss
ions
);
if
(
fieldAuthorizat
ions
!=
null
)
{
sourceApprovalRuleHandler
.
getUIElmentPermissions
().
addAll
(
fieldAuthorizat
ions
);
}
this
.
commonDomainService
.
saveTreeEntity
(
approvalRule
,
this
.
approvalRuleRepository
,
approvalRule
.
getName
(),
false
);
}
...
...
@@ -521,7 +547,7 @@ public class ApprovalRuleApplicationImpl extends BaseApplication implements Appr
if
(
procunithandlerIds
!=
null
&&
procunithandlerIds
.
size
()
>
0
)
{
List
<
Object
[]>
updateIds
=
new
ArrayList
<>(
procunithandlerIds
.
size
());
for
(
String
procunithandlerId
:
procunithandlerIds
)
{
updateIds
.
add
(
new
Object
[]
{
procunithandlerId
});
updateIds
.
add
(
new
Object
[]
{
procunithandlerId
});
}
if
(
updateIds
.
size
()
>
0
)
{
this
.
sqlExecutorDao
.
batchUpdate
(
"update wf_procunithandler t set t.approval_rule_handler_id='' where t.id=?"
,
updateIds
);
...
...
huigou-uasp/src/main/java/com/huigou/uasp/bpm/configuration/controller/ApprovalRuleController.java
View file @
d382ecaa
...
...
@@ -343,7 +343,7 @@ public class ApprovalRuleController extends CommonController {
return
success
();
}
@RequiresPermissions
(
value
=
{
"ProcApprovalRuleConfig:create"
,
"ProcApprovalRuleConfig:update"
},
logical
=
Logical
.
OR
)
@RequiresPermissions
(
value
=
{
"ProcApprovalRuleConfig:create"
,
"ProcApprovalRuleConfig:update"
},
logical
=
Logical
.
OR
)
@LogInfo
(
logType
=
LogType
.
SYS
,
subType
=
""
,
operaionType
=
OperationType
.
SAVE
,
description
=
"保存流程审批规则处理人"
)
public
String
saveApprovalRuleHandlers
()
{
SDO
params
=
this
.
getSDO
();
...
...
@@ -356,7 +356,7 @@ public class ApprovalRuleController extends CommonController {
return
success
();
}
@RequiresPermissions
(
value
=
{
"ProcApprovalRuleConfig:create"
,
"ProcApprovalRuleConfig:update"
},
logical
=
Logical
.
OR
)
@RequiresPermissions
(
value
=
{
"ProcApprovalRuleConfig:create"
,
"ProcApprovalRuleConfig:update"
},
logical
=
Logical
.
OR
)
@LogInfo
(
logType
=
LogType
.
SYS
,
subType
=
""
,
operaionType
=
OperationType
.
SAVE
,
description
=
"保存流程审批规则处理人"
)
public
String
saveApprovalRuleHandler
()
{
SDO
params
=
this
.
getSDO
();
...
...
@@ -365,6 +365,8 @@ public class ApprovalRuleController extends CommonController {
ApprovalRuleHandler
approvalRuleHandler
=
params
.
toObject
(
ApprovalRuleHandler
.
class
);
// 分组 任务执行模式
TaskExecuteMode
taskExecuteMode
=
TaskExecuteMode
.
fromId
(
params
.
getString
(
"taskExecuteMode"
));
// 最少审批人数
Integer
limitHandler
=
params
.
getInteger
(
"limitHandler"
);
// 协审
List
<
ApprovalRuleHandlerAssist
>
assistants
=
params
.
getList
(
"assistantList"
,
ApprovalRuleHandlerAssist
.
class
);
// 抄送
...
...
@@ -372,7 +374,7 @@ public class ApprovalRuleController extends CommonController {
// 字段权限
List
<
ApprovalRuleHandlerUIElmentPermission
>
uiElmentPermissions
=
params
.
getList
(
"fieldPermissionList"
,
ApprovalRuleHandlerUIElmentPermission
.
class
);
this
.
approvalRuleApplication
.
saveApprovalRuleHandler
(
approvalRuleId
,
approvalRuleHandler
,
taskExecuteMode
,
assistants
,
ccs
,
uiElmentPermissions
);
this
.
approvalRuleApplication
.
saveApprovalRuleHandler
(
approvalRuleId
,
approvalRuleHandler
,
taskExecuteMode
,
limitHandler
,
assistants
,
ccs
,
uiElmentPermissions
);
return
success
();
}
...
...
@@ -409,7 +411,7 @@ public class ApprovalRuleController extends CommonController {
return
toResult
(
data
);
}
@RequiresPermissions
(
value
=
{
"ProcApprovalRuleConfig:create"
,
"ProcApprovalRuleConfig:update"
},
logical
=
Logical
.
OR
)
@RequiresPermissions
(
value
=
{
"ProcApprovalRuleConfig:create"
,
"ProcApprovalRuleConfig:update"
},
logical
=
Logical
.
OR
)
@LogInfo
(
logType
=
LogType
.
SYS
,
subType
=
""
,
operaionType
=
OperationType
.
SAVE
,
description
=
"保存流程审批规则审批要素"
)
public
String
saveApprovalRuleElements
()
{
SDO
params
=
this
.
getSDO
();
...
...
@@ -448,6 +450,7 @@ public class ApprovalRuleController extends CommonController {
if
(
approvalRuleHandlerGroup
!=
null
)
{
this
.
putAttribute
(
"taskExecuteMode"
,
approvalRuleHandlerGroup
.
getTaskExecuteMode
());
this
.
putAttribute
(
"limitHandler"
,
approvalRuleHandlerGroup
.
getLimitHandler
());
}
return
forward
(
"ApprovalHandlerDetailConfig"
,
approvalRuleHandler
);
...
...
huigou-uasp/src/main/java/com/huigou/uasp/bpm/engine/application/impl/ActApplicationImpl.java
View file @
d382ecaa
package
com
.
huigou
.
uasp
.
bpm
.
engine
.
application
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
com.huigou.data.query.executor.SQLExecutorDao
;
import
com.huigou.util.*
;
import
org.activiti.engine.impl.context.Context
;
import
org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceEntity
;
import
org.activiti.engine.task.Task
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
com.huigou.cache.SystemCache
;
import
com.huigou.context.MessageSourceContext
;
import
com.huigou.context.Operator
;
...
...
@@ -29,28 +12,28 @@ import com.huigou.data.query.model.QueryModel;
import
com.huigou.uasp.bmp.common.application.BaseApplication
;
import
com.huigou.uasp.bmp.fn.impl.ProcessFun
;
import
com.huigou.uasp.bmp.opm.domain.model.org.Org
;
import
com.huigou.uasp.bpm.ActivityKind
;
import
com.huigou.uasp.bpm.HandleResult
;
import
com.huigou.uasp.bpm.ProcessStatus
;
import
com.huigou.uasp.bpm.TaskKind
;
import
com.huigou.uasp.bpm.TaskScope
;
import
com.huigou.uasp.bpm.TaskStatus
;
import
com.huigou.uasp.bpm.*
;
import
com.huigou.uasp.bpm.engine.application.ActApplication
;
import
com.huigou.uasp.bpm.engine.application.ProcUnitHandlerApplication
;
import
com.huigou.uasp.bpm.engine.application.WorkflowApplication
;
import
com.huigou.uasp.bpm.engine.domain.dto.BackTaskInfo
;
import
com.huigou.uasp.bpm.engine.domain.model.HistoricProcessInstanceExtension
;
import
com.huigou.uasp.bpm.engine.domain.model.HistoricTaskInstanceExtension
;
import
com.huigou.uasp.bpm.engine.domain.model.HistoricTaskInstanceRelation
;
import
com.huigou.uasp.bpm.engine.domain.model.ProcUnitHandler
;
import
com.huigou.uasp.bpm.engine.domain.model.ProcUnitHandlerManuscript
;
import
com.huigou.uasp.bpm.engine.domain.model.RuntimeTaskExtension
;
import
com.huigou.uasp.bpm.engine.domain.model.*
;
import
com.huigou.uasp.bpm.engine.domain.query.TaskDetail
;
import
com.huigou.uasp.bpm.engine.repository.HistoricProcInstanceExtensionRepository
;
import
com.huigou.uasp.bpm.engine.repository.HistoricTaskInstanceExtensionRepository
;
import
com.huigou.uasp.bpm.engine.repository.HistoricTaskInstanceRelationRepository
;
import
com.huigou.uasp.bpm.engine.repository.RuntimeTaskExtensionRepository
;
import
com.huigou.uasp.bpm.managment.application.ProcDefinitionApplication
;
import
com.huigou.util.*
;
import
org.activiti.engine.impl.context.Context
;
import
org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceEntity
;
import
org.activiti.engine.task.Task
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
java.util.*
;
@Service
(
"actApplication"
)
public
class
ActApplicationImpl
extends
BaseApplication
implements
ActApplication
{
...
...
@@ -536,6 +519,11 @@ public class ActApplicationImpl extends BaseApplication implements ActApplicatio
return
this
.
sqlExecutorDao
.
queryToMap
(
sql
,
taskId
);
}
@Override
public
RuntimeTaskExtension
queryByRuntimeTaskById
(
String
taskId
)
{
return
runtimeTaskExtensionRepository
.
findOne
(
taskId
);
}
@Override
public
Map
<
String
,
Object
>
loadRuntimeTaskByBizId
(
String
bizId
)
{
String
sql
=
this
.
getQuerySqlByName
(
"loadRuntimeTaskByBizId"
);
...
...
huigou-xt/src/main/webapp/system/configtool/approvalRule/ApprovalHandlerDetailConfig.jsp
View file @
d382ecaa
...
...
@@ -39,8 +39,11 @@
label=
"任务执行模式"
emptyOption=
"true"
fieldCol=
"4"
/>
</div>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"limitHandler"
label=
"最少审批人数"
spinner=
"true"
mask=
"nnn"
fieldCol=
"4"
/>
<x:inputC
name=
"groupId"
spinner=
"true"
mask=
"nnn"
dataOptions=
"min:1"
required=
"true"
label=
"审批分组"
fieldCol=
"4"
/>
</div>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"sequence"
spinner=
"true"
mask=
"nnn"
dataOptions=
"min:1"
required=
"true"
label=
"审批序号"
fieldCol=
"4"
/>
</div>
...
...
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