Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
085848f7
Commit
085848f7
authored
Jan 16, 2025
by
chenyuxi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 允许跳过节点系统自动审核
parent
5e6bc517
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
21 deletions
+21
-21
AbastractAuditProcess.java
...us/v1/yifu/salary/service/impl/AbastractAuditProcess.java
+20
-19
TInsuranceUnpurchaseApplyServiceImpl.java
...ry/service/impl/TInsuranceUnpurchaseApplyServiceImpl.java
+1
-1
TInsuranceUnpurchaseApplyAuditProcess.java
...e/impl/process/TInsuranceUnpurchaseApplyAuditProcess.java
+0
-1
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/AbastractAuditProcess.java
View file @
085848f7
...
@@ -132,6 +132,7 @@ public abstract class AbastractAuditProcess<T,E extends T> {
...
@@ -132,6 +132,7 @@ public abstract class AbastractAuditProcess<T,E extends T> {
// 节点是否允许跳过(0:不允许,1允许)
// 节点是否允许跳过(0:不允许,1允许)
Integer
isPass
=
CommonConstants
.
ZERO_INT
;
Integer
isPass
=
CommonConstants
.
ZERO_INT
;
for
(
TNodePrimission
nodePrimission
:
nodePrimissionList
)
{
for
(
TNodePrimission
nodePrimission
:
nodePrimissionList
)
{
isPass
=
CommonConstants
.
ZERO_INT
;
// 审核用户改造; 3指定用户;5指定角色(crm)
// 审核用户改造; 3指定用户;5指定角色(crm)
if
(
CommonConstants
.
THREE_INT
==
nodePrimission
.
getType
().
intValue
()
if
(
CommonConstants
.
THREE_INT
==
nodePrimission
.
getType
().
intValue
()
||
CommonConstants
.
TWO_INT
==
nodePrimission
.
getType
().
intValue
()
||
CommonConstants
.
TWO_INT
==
nodePrimission
.
getType
().
intValue
()
...
@@ -145,13 +146,10 @@ public abstract class AbastractAuditProcess<T,E extends T> {
...
@@ -145,13 +146,10 @@ public abstract class AbastractAuditProcess<T,E extends T> {
}
}
// 事业部条线没有审批人直接审核通过,配置了可以跳过
// 事业部条线没有审批人直接审核通过,配置了可以跳过
// if(Common.isEmpty(sysUserList) && CommonConstants.ONE_STRING.equals(nodePrimission.getIsPass())){
if
(
Common
.
isEmpty
(
sysUserList
)
&&
CommonConstants
.
ONE_STRING
.
equals
(
nodePrimission
.
getIsPass
())){
//// // 标记节点可以跳过
// 系统自动给当前节点完成审核,将审核通过
//// isPass = CommonConstants.ONE_INT;
return
sysAutoAudit
(
processVo
,
currentProcessNode
,
departId
,
auditType
,
entityId
,
entity
);
//// // 系统自动给当前节点完成审核,将审核通过
}
else
{
//// sysAutoAudit(processVo,currentProcessNode,departId,auditType,entityId,entity);
//// } else {
if
(
Common
.
isEmpty
(
sysUserList
))
{
if
(
Common
.
isEmpty
(
sysUserList
))
{
throw
new
CheckedException
(
"未找到审批用户"
);
throw
new
CheckedException
(
"未找到审批用户"
);
}
}
...
@@ -187,8 +185,7 @@ public abstract class AbastractAuditProcess<T,E extends T> {
...
@@ -187,8 +185,7 @@ public abstract class AbastractAuditProcess<T,E extends T> {
auditRecordService
.
save
(
newEntity
);
auditRecordService
.
save
(
newEntity
);
}
}
//}
}
}
}
// 事业部条线没有审批人直接审核通过,配置了可以跳过
// 事业部条线没有审批人直接审核通过,配置了可以跳过
if
(
Common
.
isEmpty
(
sysUserList
)
&&
isPass
==
CommonConstants
.
ONE_INT
){
if
(
Common
.
isEmpty
(
sysUserList
)
&&
isPass
==
CommonConstants
.
ONE_INT
){
...
@@ -609,7 +606,7 @@ public abstract class AbastractAuditProcess<T,E extends T> {
...
@@ -609,7 +606,7 @@ public abstract class AbastractAuditProcess<T,E extends T> {
* @param entity 实体类:用于审核通过逻辑
* @param entity 实体类:用于审核通过逻辑
* @return R<String>
* @return R<String>
**/
**/
private
void
sysAutoAudit
(
ProcessVo
processVo
,
TProcessNode
currentProcessNode
,
String
departId
,
String
auditType
,
private
List
<
SysUser
>
sysAutoAudit
(
ProcessVo
processVo
,
TProcessNode
currentProcessNode
,
String
departId
,
String
auditType
,
String
entityId
,
T
entity
)
{
String
entityId
,
T
entity
)
{
// 新增自动审核通过记录
// 新增自动审核通过记录
TAuditRecord
newEntity
=
new
TAuditRecord
();
TAuditRecord
newEntity
=
new
TAuditRecord
();
...
@@ -617,8 +614,9 @@ public abstract class AbastractAuditProcess<T,E extends T> {
...
@@ -617,8 +614,9 @@ public abstract class AbastractAuditProcess<T,E extends T> {
newEntity
.
setFlowId
(
currentProcessNode
.
getProcessId
());
newEntity
.
setFlowId
(
currentProcessNode
.
getProcessId
());
newEntity
.
setNodeId
(
currentProcessNode
.
getId
());
newEntity
.
setNodeId
(
currentProcessNode
.
getId
());
newEntity
.
setApprovalMan
(
CommonConstants
.
ONE_STRING
);
newEntity
.
setApprovalMan
(
CommonConstants
.
ONE_STRING
);
newEntity
.
setApprovalManName
(
"
系统
"
);
newEntity
.
setApprovalManName
(
"
审核人为空,系统默认审核通过
"
);
newEntity
.
setApprovalOpinion
(
"审核人为空,默认审核通过"
);
newEntity
.
setApprovalOpinion
(
"审核人为空,默认审核通过"
);
newEntity
.
setApprovalTime
(
LocalDateTime
.
now
());
newEntity
.
setDeleteFlag
(
CommonConstants
.
NOT_DELETE_FLAG
);
newEntity
.
setDeleteFlag
(
CommonConstants
.
NOT_DELETE_FLAG
);
newEntity
.
setPreFlag
(
CommonConstants
.
ONE_STRING
);
newEntity
.
setPreFlag
(
CommonConstants
.
ONE_STRING
);
newEntity
.
setApprovalResult
(
CommonConstants
.
ZERO_STRING
);
newEntity
.
setApprovalResult
(
CommonConstants
.
ZERO_STRING
);
...
@@ -644,36 +642,39 @@ public abstract class AbastractAuditProcess<T,E extends T> {
...
@@ -644,36 +642,39 @@ public abstract class AbastractAuditProcess<T,E extends T> {
// 获取流程配置信息
// 获取流程配置信息
TProcessNode
endProcessNode
=
ProcessAuditUtil
.
getEndProcessNode
(
processVo
);
TProcessNode
endProcessNode
=
ProcessAuditUtil
.
getEndProcessNode
(
processVo
);
if
(
endProcessNode
==
null
)
{
if
(
endProcessNode
==
null
)
{
log
.
error
(
"系统自动审核,未获取到结束节点"
);
throw
new
CheckedException
(
"系统自动审核,未获取到结束节点"
);
return
;
}
}
TProcessNode
preEndProcessNode
=
ProcessAuditUtil
.
getPreEndTProcessNode
(
processVo
,
endProcessNode
);
TProcessNode
preEndProcessNode
=
ProcessAuditUtil
.
getPreEndTProcessNode
(
processVo
,
endProcessNode
);
if
(
preEndProcessNode
==
null
)
{
if
(
preEndProcessNode
==
null
)
{
log
.
error
(
"系统自动审核,未找到结束节点前一个节点"
);
throw
new
CheckedException
(
"系统自动审核,未找到结束节点前一个节点"
);
return
;
}
}
// 当前是结束节点前的一个节点
// 当前是结束节点前的一个节点
if
(
StringUtils
.
equals
(
preEndProcessNode
.
getId
(),
newEntity
.
getNodeId
()))
{
if
(
StringUtils
.
equals
(
preEndProcessNode
.
getId
(),
newEntity
.
getNodeId
()))
{
// 直接最终审核通过
// 直接最终审核通过
auditSuccess
(
entity
,
newEntity
,
null
);
auditSuccess
(
entity
,
newEntity
,
null
);
return
null
;
}
else
{
}
else
{
TProcessNode
nextProcessNode
=
getNextNode
(
processVo
,
currentProcessNode
.
getLogoTitle
(),
entityId
,
auditType
,
entity
,
null
);
TProcessNode
nextProcessNode
=
getNextNode
(
processVo
,
currentProcessNode
.
getLogoTitle
(),
entityId
,
auditType
,
entity
,
null
);
if
(
nextProcessNode
==
null
)
{
if
(
nextProcessNode
==
null
)
{
throw
new
CheckedException
(
NEXT_AUDIT_NODE_NOT_FOUND
);
// 未找到下一个审核节点,删除系统自动审核的记录
auditRecordService
.
removeById
(
newEntity
.
getId
());
throw
new
CheckedException
(
"未找到系统自动审核后,下一个审批节点,请联系管理员"
);
}
}
// 如果返回的是end节点:判断是不是返回的是不是主流程结束节点
// 如果返回的是end节点:判断是不是返回的是不是主流程结束节点
if
(
StringUtils
.
equals
(
ProcessConstants
.
PROCESS_NODE_END
,
nextProcessNode
.
getType
())
if
(
StringUtils
.
equals
(
ProcessConstants
.
PROCESS_NODE_END
,
nextProcessNode
.
getType
())
&&
StringUtils
.
equals
(
currentProcessNode
.
getProcessId
(),
nextProcessNode
.
getProcessId
()))
{
&&
StringUtils
.
equals
(
currentProcessNode
.
getProcessId
(),
nextProcessNode
.
getProcessId
()))
{
// 直接最终审核通过
// 直接最终审核通过
auditSuccess
(
entity
,
newEntity
,
null
);
auditSuccess
(
entity
,
newEntity
,
null
);
return
null
;
}
}
// 获取下个审批用户
// 获取下个审批用户
List
<
SysUser
>
remoteSysUserList
=
getAuditUseListByProcessNode
(
processVo
,
nextProcessNode
,
departId
,
entityId
,
auditType
,
entity
,
newEntity
);
List
<
SysUser
>
remoteSysUserList
=
getAuditUseListByProcessNode
(
processVo
,
nextProcessNode
,
departId
,
entityId
,
auditType
,
entity
,
newEntity
);
if
(
Common
.
isEmpty
(
remoteSysUserList
))
{
if
(
Common
.
isEmpty
(
remoteSysUserList
))
{
throw
new
CheckedException
(
NEXT_NODE_USER_NULL
);
// 未找到下一个审核节点,删除系统自动审核的记录
auditRecordService
.
removeById
(
newEntity
.
getId
());
throw
new
CheckedException
(
"未找到系统自动审核后,下个节点的审批用户"
);
}
}
// // 流程中的审核结束,继续下一个节点
return
remoteSysUserList
;
// auditSuccessAndNex(entity, remoteSysUserList, newEntity);
}
}
}
}
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TInsuranceUnpurchaseApplyServiceImpl.java
View file @
085848f7
...
@@ -525,7 +525,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
...
@@ -525,7 +525,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
if
(
Common
.
isEmpty
(
entity
.
getCreateUserDeptId
())){
if
(
Common
.
isEmpty
(
entity
.
getCreateUserDeptId
())){
return
R
.
failed
(
"申请人所属部门id不能为空"
);
return
R
.
failed
(
"申请人所属部门id不能为空"
);
}
}
//
todo
传:流程类型 1不购买商险申请;审核类型 0不购买商险审核
// 传:流程类型 1不购买商险申请;审核类型 0不购买商险审核
R
<
List
<
SysUser
>>
auditUserListR
=
tInsuranceUnpurchaseApplyAuditProcess
.
getAuditUserList
(
id
,
user
,
entity
.
getCreateUserDeptId
(),
R
<
List
<
SysUser
>>
auditUserListR
=
tInsuranceUnpurchaseApplyAuditProcess
.
getAuditUserList
(
id
,
user
,
entity
.
getCreateUserDeptId
(),
CommonConstants
.
ONE_STRING
,
CommonConstants
.
ZERO_STRING
,
CommonConstants
.
ONE_STRING
,
CommonConstants
.
ZERO_STRING
,
""
,
entity
.
getApplyNo
(),
entity
,
TInsuranceUnpurchaseApply
.
class
);
""
,
entity
.
getApplyNo
(),
entity
,
TInsuranceUnpurchaseApply
.
class
);
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/process/TInsuranceUnpurchaseApplyAuditProcess.java
View file @
085848f7
...
@@ -227,7 +227,6 @@ public class TInsuranceUnpurchaseApplyAuditProcess extends AbastractAuditProcess
...
@@ -227,7 +227,6 @@ public class TInsuranceUnpurchaseApplyAuditProcess extends AbastractAuditProcess
String
authUrl
=
null
;
String
authUrl
=
null
;
Map
<
String
,
Object
>
textcard
=
new
HashMap
<>();
Map
<
String
,
Object
>
textcard
=
new
HashMap
<>();
authUrl
=
String
.
format
(
SecurityConstants
.
WX_GET_MESSAGE_AUTH_URL
,
wxConfig
.
getCorpid
(),
"https://test-wx.worfu.com/auth/oauth/wxLogin"
,
"01"
+
insuranceUnpurchaseApply
.
getId
());
authUrl
=
String
.
format
(
SecurityConstants
.
WX_GET_MESSAGE_AUTH_URL
,
wxConfig
.
getCorpid
(),
"https://test-wx.worfu.com/auth/oauth/wxLogin"
,
"01"
+
insuranceUnpurchaseApply
.
getId
());
textcard
.
put
(
"title"
,
"含风险项目不购买商险申请"
);
textcard
.
put
(
"title"
,
"含风险项目不购买商险申请"
);
...
...
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