Commit 50fd5d6f by 龙于生

修改并序审批bug

parent a9dd1b57
...@@ -580,11 +580,12 @@ public class RouterUtils { ...@@ -580,11 +580,12 @@ public class RouterUtils {
// 新增 执行人 // 新增 执行人
List<User> listUser = CollUtil.toList(); List<User> listUser = CollUtil.toList();
boolean aobl = false;
List<Relation> listR = listFlowChildren.get(i).getRelation(); List<Relation> listR = listFlowChildren.get(i).getRelation();
if (CollectionUtil.isNotEmpty(listR)) { if (CollectionUtil.isNotEmpty(listR)) {
listUser = listR.get(0).getUsers(); listUser = listR.get(0).getUsers();
if("1".equals(listR.get(0).getApprovalOrder())){ if("1".equals(listR.get(0).getApprovalOrder())){
aobl = true;
for (User user:listR.get(0).getUsers() for (User user:listR.get(0).getUsers()
) { ) {
if ("1".equals(user.getExecute())){ if ("1".equals(user.getExecute())){
...@@ -592,12 +593,6 @@ public class RouterUtils { ...@@ -592,12 +593,6 @@ public class RouterUtils {
} }
} }
/*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++;
}
}*/
} }
} }
...@@ -668,7 +663,8 @@ public class RouterUtils { ...@@ -668,7 +663,8 @@ public class RouterUtils {
.insert(); .insert();
hasNextApprover = true; hasNextApprover = true;
listUser.get(i_user).setExecute(EXECUTING); listUser.get(i_user).setExecute(EXECUTING);
// 当前审批人 // 当前审批人
SpmkApproveSummary.builder().id(asId).currentApprover(listUser.get(i_user).getName()).build().updateById(); SpmkApproveSummary.builder().id(asId).currentApprover(listUser.get(i_user).getName()).build().updateById();
...@@ -722,35 +718,71 @@ public class RouterUtils { ...@@ -722,35 +718,71 @@ public class RouterUtils {
listFlowChildren.get(i).setExecute(EXECUTED); listFlowChildren.get(i).setExecute(EXECUTED);
break; break;
case AUDIT: case AUDIT:
SpmkApproveExecuteRecord aer2 = SpmkApproveExecuteRecord if(aobl){
.builder() String currentApprover = "";
.approveSummaryId(asId) for (int i_user2 = 0,n_user2 = listUser.size(); i_user2 < n_user2; i_user2++) {
.name(ParticipatorType.APPROVER.getName())
.type(ParticipatorType.APPROVER.ordinal()) SpmkApproveExecuteRecord aer2 = SpmkApproveExecuteRecord
.sts(ExecuteRecordSts.IN_EXECUTION.ordinal()) .builder()
.build(); .approveSummaryId(asId)
// 新增 审批执行记录 .name(ParticipatorType.APPROVER.getName())
aer2.insert(); .type(ParticipatorType.APPROVER.ordinal())
.sts(ExecuteRecordSts.IN_EXECUTION.ordinal())
.build();
// 新增 审批执行记录
aer2.insert();
SpmkExecutor executor = SpmkExecutor.builder()
.approveExecuteRecordId(aer2.getId())
.empNum(Integer.parseInt(listUser.get(i_user2).getId()))
.executorName(listUser.get(i_user2).getName())
.operatorHeaderUrl(listUser.get(i_user2).getHeadUrl())
.sts(ExecutorSts.IN_EXECUTION.ordinal())
.build();
executor.insert();
listUser.get(i_user2).setExecute(EXECUTING);
hasNextApprover = true;
for (int i_user2 = 0,n_user2 = listUser.size(); i_user2 < n_user2; i_user2++) { currentApprover=currentApprover!=""?currentApprover+","+listUser.get(i_user2).getName():listUser.get(i_user2).getName();
SpmkExecutor executor = SpmkExecutor.builder() // 当前审批人
.approveExecuteRecordId(aer2.getId()) SpmkApproveSummary.builder().id(asId).currentApprover(currentApprover).build().updateById();
.empNum(Integer.parseInt(listUser.get(i_user2).getId()))
.executorName(listUser.get(i_user2).getName()) }
.operatorHeaderUrl(listUser.get(i_user2).getHeadUrl())
.sts(ExecutorSts.IN_EXECUTION.ordinal()) listFlowChildren.get(i).setExecute(EXECUTING);
}else{
SpmkApproveExecuteRecord aer2 = SpmkApproveExecuteRecord
.builder()
.approveSummaryId(asId)
.name(ParticipatorType.APPROVER.getName())
.type(ParticipatorType.APPROVER.ordinal())
.sts(ExecuteRecordSts.IN_EXECUTION.ordinal())
.build(); .build();
executor.insert(); // 新增 审批执行记录
aer2.insert();
listUser.get(i_user2).setExecute(EXECUTING);
hasNextApprover = true; for (int i_user2 = 0,n_user2 = listUser.size(); i_user2 < n_user2; i_user2++) {
// 当前审批人 SpmkExecutor executor = SpmkExecutor.builder()
SpmkApproveSummary.builder().id(asId).currentApprover(listUser.get(i_user2).getName()).build().updateById(); .approveExecuteRecordId(aer2.getId())
// 处理了 下一个审批人 则跳出循环 .empNum(Integer.parseInt(listUser.get(i_user2).getId()))
break; .executorName(listUser.get(i_user2).getName())
.operatorHeaderUrl(listUser.get(i_user2).getHeadUrl())
.sts(ExecutorSts.IN_EXECUTION.ordinal())
.build();
executor.insert();
listUser.get(i_user2).setExecute(EXECUTING);
hasNextApprover = true;
// 当前审批人
SpmkApproveSummary.builder().id(asId).currentApprover(listUser.get(i_user2).getName()).build().updateById();
// 处理了 下一个审批人 则跳出循环
break;
}
listFlowChildren.get(i).setExecute(EXECUTING);
} }
listFlowChildren.get(i).setExecute(EXECUTING);
break; break;
case COPY: case COPY:
SpmkApproveExecuteRecord aer3 = SpmkApproveExecuteRecord SpmkApproveExecuteRecord aer3 = SpmkApproveExecuteRecord
......
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
b.opinion SpmkExecutor_opinion, b.opinion SpmkExecutor_opinion,
b.sts SpmkExecutor_sts, b.sts SpmkExecutor_sts,
b.create_time SpmkExecutor_create_time, b.create_time SpmkExecutor_create_time,
b.update_time SpmkExecutor_update_time b.update_time SpmkExecutor_update_time,
b.signature_img SpmkExecutor_signature_img
</sql> </sql>
<sql id="Base_Column_List_Alias"> <sql id="Base_Column_List_Alias">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment