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
40dd9ccc
Commit
40dd9ccc
authored
Aug 14, 2023
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
审批校验
parent
fabb756b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
3 deletions
+91
-3
src/main/java/cn/timer/api/controller/spmk/AdminSpmkController.java
+24
-2
src/main/java/cn/timer/api/controller/spmk/service/SpmkServiceImpl.java
+66
-0
src/main/resources/mapping/spmk/SpmkApproveExecuteRecordMapper.xml
+1
-1
No files found.
src/main/java/cn/timer/api/controller/spmk/AdminSpmkController.java
View file @
40dd9ccc
...
@@ -154,6 +154,7 @@ public class AdminSpmkController {
...
@@ -154,6 +154,7 @@ public class AdminSpmkController {
}
}
List
<
FlowChildren
>
listFlowChildren
=
jsonObject
.
parseArray
(
ad
.
getFlowChildren
(),
FlowChildren
.
class
);
List
<
FlowChildren
>
listFlowChildren
=
jsonObject
.
parseArray
(
ad
.
getFlowChildren
(),
FlowChildren
.
class
);
RouterUtils
.
updateRefuseToAgree
(
RouterUtils
.
updateRefuseToAgree
(
listFlowChildren
,
listFlowChildren
,
asId
,
asId
,
...
@@ -171,6 +172,21 @@ public class AdminSpmkController {
...
@@ -171,6 +172,21 @@ public class AdminSpmkController {
);
);
listFlowChildren
.
forEach
(
l
->{
//如果大节点已经完成
if
(
l
.
getClassName
().
equals
(
"audit"
)){
if
(
l
.
getExecute
().
equals
(
"2"
)){
l
.
getRelation
().
get
(
0
).
getUsers
().
forEach
(
v
->{
if
(!
v
.
getExecute
().
equals
(
"2"
)){
v
.
setExecute
(
"2"
);
}
});
}
else
if
(
l
.
getExecute
().
equals
(
"1"
)){
//大节点未执行完
}
}
});
// 更新 flowChildren
// 更新 flowChildren
SpmkApproveDetailSummary
sadsUpdate
=
SpmkApproveDetailSummary
.
builder
().
id
(
ad
.
getId
()).
flowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
()).
build
();
SpmkApproveDetailSummary
sadsUpdate
=
SpmkApproveDetailSummary
.
builder
().
id
(
ad
.
getId
()).
flowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
()).
build
();
/*// 审批详情 审批时添加 附件
/*// 审批详情 审批时添加 附件
...
@@ -180,10 +196,16 @@ public class AdminSpmkController {
...
@@ -180,10 +196,16 @@ public class AdminSpmkController {
sadsUpdate
.
updateById
();
sadsUpdate
.
updateById
();
//最后一条数据
//最后一条数据
FlowChildren
fc
=
CollUtil
.
getLast
(
listFlowChildren
);
FlowChildren
fc
=
CollUtil
.
getLast
(
listFlowChildren
);
/** TODO:每次审批都校验一次json是否正确
* 1.验证当前流程是否已完成,如果已完成验证是否有子节点出现未完成的状态
* 2.验证当前节点上面的节点是否已完成,未完成的都改为已完成
* 3.验证当前流程是否全部完成,如果已经完成,修改所有的节点为已完成
* 4.验证当前节点
*/
if
(
fc
.
getExecute
()
==
"2"
)
{
if
(
fc
.
getExecute
()
==
"2"
)
{
// 查询 SpmkApproveSummary 状态
// 查询 SpmkApproveSummary 状态
aSummary
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
()
aSummary
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
()
...
...
src/main/java/cn/timer/api/controller/spmk/service/SpmkServiceImpl.java
View file @
40dd9ccc
...
@@ -7,11 +7,15 @@ import java.util.List;
...
@@ -7,11 +7,15 @@ import java.util.List;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.bean.spmk.*
;
import
cn.timer.api.bean.spmk.*
;
import
cn.timer.api.config.enuminterface.JxglEnumInterface
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface
;
import
cn.timer.api.dao.spmk.*
;
import
cn.timer.api.dao.spmk.*
;
import
cn.timer.api.dto.spmk.FlowChildren
;
import
cn.timer.api.dto.spmk.FlowChildren
;
import
cn.timer.api.dto.spmk.Router
;
import
cn.timer.api.dto.spmk.Router
;
import
cn.timer.api.dto.spmk.User
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
net.sf.json.JSONArray
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -115,9 +119,71 @@ public class SpmkServiceImpl implements SpmkService{
...
@@ -115,9 +119,71 @@ public class SpmkServiceImpl implements SpmkService{
if
(
ad
==
null
)
{
if
(
ad
==
null
)
{
return
null
;
return
null
;
}
}
//修正json
List
<
FlowChildren
>
listFlowChildren
=
jsonObject
.
parseArray
(
ad
.
getFlowChildren
(),
FlowChildren
.
class
);
for
(
FlowChildren
l
:
listFlowChildren
)
{
//如果大节点已经完成 子节点全部改为已完成
if
(
l
.
getClassName
().
equals
(
"audit"
)){
if
(
l
.
getExecute
().
equals
(
"2"
)){
l
.
getRelation
().
get
(
0
).
getUsers
().
forEach
(
v
->{
if
(!
v
.
getExecute
().
equals
(
"2"
)){
v
.
setExecute
(
"2"
);
}
});
}
// else if(l.getExecute().equals("1")){
// int count1=0;
// int count2 = 0;
// //大节点未执行完
// List<User> listUser = l.getRelation().get(0).getUsers();
// for (int i = 0; i < listUser.size(); i++) {
// User currentUser = listUser.get(i);
// String execute = listUser.get(i).getExecute();
// //统计数子节点的数量
// if(execute.equals("1")){
// count1=+1;
// }
// if(execute.equals("2")){
// count2=+1;
// }
// //当前用户执行记录
// SpmkApproveExecuteRecord spmkApproveExecuteRecord = spmkApproveExecuteRecordMapper.selectExecuteRecordById(Integer.parseInt(currentUser.getId()), asId);
// if(spmkApproveExecuteRecord!=null){
// //如果json状态等于执行记录的里状态就是对的
// if(spmkApproveExecuteRecord.getSts().toString().equals(execute)){
// continue;
// }else{
// l.getRelation().get(0).getUsers().get(i).setExecute(spmkApproveExecuteRecord.getSts().toString());
// }
// }
// }
// if(count1==listUser.size()){
// l.setExecute("1");
// }
// if(count2==listUser.size()){
// l.setExecute("2");
// }
// }
else
if
(
l
.
getExecute
().
equals
(
"0"
))
{
//大节点未执行 子节点全部改为未执行
if
(
l
.
getExecute
().
equals
(
JxglEnumInterface
.
ProcessNodeSts
.
NON_EXECUTION
.
getType
()))
{
l
.
getRelation
().
get
(
0
).
getUsers
().
forEach
(
v
->
{
if
(!
v
.
getExecute
().
equals
(
"0"
))
{
v
.
setExecute
(
"0"
);
}
});
}
}
}
}
ad
.
setFlowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
());
ad
.
updateById
();
//审批操作记录
//审批操作记录
List
<
SpmkApproveExecuteRecord
>
listAer
=
spmkApproveExecuteRecordMapper
.
selectListByAsId
(
asId
);
List
<
SpmkApproveExecuteRecord
>
listAer
=
spmkApproveExecuteRecordMapper
.
selectListByAsId
(
asId
);
BeanUtil
.
copyProperties
(
ad
,
adD
,
"requestData"
,
"froms"
,
"router"
,
"flowChildren"
,
"spmkApproveExecuteRecord"
);
BeanUtil
.
copyProperties
(
ad
,
adD
,
"requestData"
,
"froms"
,
"router"
,
"flowChildren"
,
"spmkApproveExecuteRecord"
);
if
(
ad
.
getRequestData
()
!=
null
)
{
if
(
ad
.
getRequestData
()
!=
null
)
{
adD
.
setRequestData
(
jsonObject
.
parseObject
(
ad
.
getRequestData
(),
JSONObject
.
class
));
adD
.
setRequestData
(
jsonObject
.
parseObject
(
ad
.
getRequestData
(),
JSONObject
.
class
));
}
}
...
...
src/main/resources/mapping/spmk/SpmkApproveExecuteRecordMapper.xml
View file @
40dd9ccc
...
@@ -167,7 +167,7 @@
...
@@ -167,7 +167,7 @@
-->
-->
<select
id=
"selectExecuteRecordById"
resultType=
"cn.timer.api.bean.spmk.SpmkApproveExecuteRecord"
>
<select
id=
"selectExecuteRecordById"
resultType=
"cn.timer.api.bean.spmk.SpmkApproveExecuteRecord"
>
SELECT sr.id FROM spmk_approve_execute_record sr
SELECT sr.id
,sr.sts
FROM spmk_approve_execute_record sr
LEFT JOIN spmk_executor se ON se.approve_execute_record_id=sr.id
LEFT JOIN spmk_executor se ON se.approve_execute_record_id=sr.id
WHERE sr.approve_summary_id = #{approveSummaryId} and se.emp_num = #{userId}
WHERE sr.approve_summary_id = #{approveSummaryId} and se.emp_num = #{userId}
</select>
</select>
...
...
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