Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
a9dd1b57
Commit
a9dd1b57
authored
Dec 29, 2021
by
龙于生
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增审批节点并序审批功能
parent
096ad6bf
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
9 deletions
+83
-9
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
+7
-3
src/main/java/cn/timer/api/controller/spmk/service/SpmkServiceImpl.java
+3
-0
src/main/java/cn/timer/api/dto/spmk/Relation.java
+5
-0
src/main/java/cn/timer/api/utils/router/RouterUtils.java
+68
-6
No files found.
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
View file @
a9dd1b57
...
...
@@ -726,7 +726,6 @@ public class SpmkController {
@ApiOperationSupport
(
order
=
19
)
@Log
(
title
=
"审批-审批详情"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
Object
>
selectAd
(
@PathVariable
(
required
=
true
)
Integer
id
)
{
SpmkApproveDetailDto
adD
=
spmkService
.
selectApproveDetailByAsId
(
id
);
System
.
out
.
println
(
ResultUtil
.
data
(
adD
));
return
ResultUtil
.
data
(
adD
);
...
...
@@ -778,7 +777,10 @@ public class SpmkController {
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
return
ResultUtil
.
error
(
"您已审批过!"
);
}
Integer
integer
=
spmkExecutorMapper
.
selectCount
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
()
.
eq
(
SpmkExecutor:
:
getId
,
approvingDto
.
getExecutorId
())
.
eq
(
SpmkExecutor:
:
getEmpNum
,
userBean
.
getEmpNum
())
.
eq
(
SpmkExecutor:
:
getSts
,
ExecutorSts
.
IN_EXECUTION
.
ordinal
()));
if
(
spmkExecutorMapper
.
selectCount
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
()
.
eq
(
SpmkExecutor:
:
getId
,
approvingDto
.
getExecutorId
())
.
eq
(
SpmkExecutor:
:
getEmpNum
,
userBean
.
getEmpNum
())
...
...
@@ -808,11 +810,13 @@ public class SpmkController {
approvingDto
.
getOpinion
(),
approvingDto
.
getSts
(),
approvingDto
.
getUser
(),
approvingDto
.
getSignatureImg
()
approvingDto
.
getSignatureImg
(),
userBean
.
getEmpNum
()
);
// 更新 flowChildren
SpmkApproveDetailSummary
.
builder
().
id
(
ad
.
getId
()).
flowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
()).
build
().
updateById
();
//最后一条数据
FlowChildren
fc
=
CollUtil
.
getLast
(
listFlowChildren
);
if
(
fc
.
getExecute
()
==
"2"
)
{
// 查询 SpmkApproveSummary 状态
...
...
src/main/java/cn/timer/api/controller/spmk/service/SpmkServiceImpl.java
View file @
a9dd1b57
...
...
@@ -92,7 +92,9 @@ public class SpmkServiceImpl implements SpmkService{
public
SpmkApproveDetailDto
selectApproveDetailByAsId
(
Integer
asId
)
{
// TODO Auto-generated method stub
//SpmkApproveDetail ad = spmkApproveDetailMapper.selectOne(new QueryWrapper<SpmkApproveDetail>().lambda().eq(SpmkApproveDetail::getApproveSummaryId, asId));
//审批详情
SpmkApproveDetailSummary
ad
=
spmkApproveDetailSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>().
lambda
().
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
asId
));
//审批汇总
SpmkApproveSummary
sum
=
null
;
if
(
ad
!=
null
)
{
sum
=
SpmkApproveSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
().
select
(
SpmkApproveSummary:
:
getId
,
SpmkApproveSummary:
:
getEmpNum
,
SpmkApproveSummary:
:
getSts
,
SpmkApproveSummary:
:
getCreateTime
)
...
...
@@ -103,6 +105,7 @@ public class SpmkServiceImpl implements SpmkService{
if
(
ad
==
null
)
{
return
null
;
}
//审批操作记录
List
<
SpmkApproveExecuteRecord
>
listAer
=
spmkApproveExecuteRecordMapper
.
selectListByAsId
(
asId
);
BeanUtil
.
copyProperties
(
ad
,
adD
,
"requestData"
,
"froms"
,
"router"
,
"flowChildren"
,
"spmkApproveExecuteRecord"
);
if
(
ad
.
getRequestData
()
!=
null
)
{
...
...
src/main/java/cn/timer/api/dto/spmk/Relation.java
View file @
a9dd1b57
...
...
@@ -53,4 +53,9 @@ public class Relation implements Serializable{
*/
private
Integer
signature
;
/**
* 同级审批次序 0依次 1同时
*/
private
String
approvalOrder
;
}
src/main/java/cn/timer/api/utils/router/RouterUtils.java
View file @
a9dd1b57
...
...
@@ -463,6 +463,42 @@ public class RouterUtils {
.
insert
();
break
;
case
AUDIT:
// 新增 执行人
List
<
User
>
listUser
=
listFlowChildren
.
get
(
i
).
getRelation
().
get
(
0
).
getUsers
();
Relation
relation1
=
listFlowChildren
.
get
(
i
).
getRelation
().
get
(
0
);
if
(
"1"
.
equals
(
relation1
.
getApprovalOrder
())){
for
(
User
user2
:
listUser
)
{
SpmkApproveExecuteRecord
aer2
=
SpmkApproveExecuteRecord
.
builder
()
.
approveSummaryId
(
asId
)
.
name
(
ParticipatorType
.
APPROVER
.
getName
())
.
type
(
ParticipatorType
.
APPROVER
.
ordinal
())
.
sts
(
ExecuteRecordSts
.
IN_EXECUTION
.
ordinal
())
.
build
();
// 新增 审批执行记录
aer2
.
insert
();
SpmkExecutor
executor
=
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
aer2
.
getId
())
.
empNum
(
Integer
.
parseInt
(
user2
.
getId
()))
.
operatorHeaderUrl
(
user2
.
getHeadUrl
())
.
executorName
(
user2
.
getName
())
.
build
();
user2
.
setExecute
(
"1"
);
switch
(
user2
.
getExecute
())
{
case
EXECUTING:
executor
.
setSts
(
ExecutorSts
.
IN_EXECUTION
.
ordinal
());
executor
.
insert
();
break
;
case
EXECUTED:
executor
.
setSts
(
ExecutorSts
.
AGREE
.
ordinal
());
executor
.
insert
();
break
;
}
}
}
else
{
SpmkApproveExecuteRecord
aer2
=
SpmkApproveExecuteRecord
.
builder
()
.
approveSummaryId
(
asId
)
...
...
@@ -472,10 +508,6 @@ public class RouterUtils {
.
build
();
// 新增 审批执行记录
aer2
.
insert
();
// 新增 执行人
List
<
User
>
listUser
=
listFlowChildren
.
get
(
i
).
getRelation
().
get
(
0
).
getUsers
();
for
(
User
user2
:
listUser
)
{
SpmkExecutor
executor
=
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
aer2
.
getId
())
...
...
@@ -494,6 +526,8 @@ public class RouterUtils {
break
;
}
}
}
break
;
case
COPY:
SpmkApproveExecuteRecord
aer3
=
SpmkApproveExecuteRecord
...
...
@@ -536,10 +570,12 @@ public class RouterUtils {
* @param opinion 意见
* @param sts 状态 1执行中 2通过 3拒绝
*/
public
static
void
approving
(
List
<
FlowChildren
>
listFlowChildren
,
Integer
asId
,
Integer
executeRecordId
,
Integer
executorId
,
String
opinion
,
Integer
sts
,
User
redeployUser
,
String
signatureImg
)
throws
Exception
{
public
static
void
approving
(
List
<
FlowChildren
>
listFlowChildren
,
Integer
asId
,
Integer
executeRecordId
,
Integer
executorId
,
String
opinion
,
Integer
sts
,
User
redeployUser
,
String
signatureImg
,
Integer
empNum
)
throws
Exception
{
boolean
hasNextApprover
=
false
;
int
es
=
0
;
for
(
int
i
=
0
,
n
=
listFlowChildren
.
size
();
i
<
n
;
i
++)
{
// 新增 执行人
...
...
@@ -548,14 +584,32 @@ public class RouterUtils {
List
<
Relation
>
listR
=
listFlowChildren
.
get
(
i
).
getRelation
();
if
(
CollectionUtil
.
isNotEmpty
(
listR
))
{
listUser
=
listR
.
get
(
0
).
getUsers
();
if
(
"1"
.
equals
(
listR
.
get
(
0
).
getApprovalOrder
())){
for
(
User
user:
listR
.
get
(
0
).
getUsers
()
)
{
if
(
"1"
.
equals
(
user
.
getExecute
())){
es
++;
}
}
/*for (int j = 0; j < listR.get(0).getUsers().size(); j++) {
String execute = listR.get(0).getUsers().get(j).getExecute();
if("1".equals(execute)){
es++;
}
}*/
}
}
if
(
EXECUTING
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
()))
{
for
(
int
i_user
=
0
,
n_user
=
listUser
.
size
();
i_user
<
n_user
;
i_user
++)
{
if
(
EXECUTED
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
}
else
if
(
EXECUTING
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
if
(
Integer
.
parseInt
(
listUser
.
get
(
i_user
).
getId
())
==
empNum
){
SpmkExecutor
.
builder
()
.
id
(
executorId
)
.
opinion
(
opinion
)
...
...
@@ -567,6 +621,8 @@ public class RouterUtils {
.
build
()
.
updateById
();
listUser
.
get
(
i_user
).
setExecute
(
EXECUTED
);
}
// 历史审批人
SpmkApproveSummary
.
builder
()
...
...
@@ -574,6 +630,7 @@ public class RouterUtils {
.
historyApprover
(
listUser
.
get
(
i_user
).
getName
())
.
build
()
.
updateById
();
//拒绝处理
// 0未执行 1执行中 2同意 3拒绝 4 转派
if
(
sts
==
ExecutorSts
.
REFUSE
.
ordinal
())
{
// 更新 审批汇总 状态
...
...
@@ -629,11 +686,16 @@ public class RouterUtils {
.
build
();
// 更新 审批执行记录
aer
.
updateById
();
if
(
es
<=
1
){
listFlowChildren
.
get
(
i
).
setExecute
(
EXECUTED
);
}
}
}
else
if
(
UNEXECUTED
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
()))
{
if
(!
hasNextApprover
)
{
if
(!
hasNextApprover
&&
es
<=
1
)
{
switch
(
listFlowChildren
.
get
(
i
).
getClassName
())
{
case
CREATOR:
SpmkApproveExecuteRecord
aer
=
SpmkApproveExecuteRecord
...
...
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