Commit 8434079e by tangzhaoqian

审批人审批- 转派功能

parent d4aba8c9
...@@ -519,7 +519,9 @@ public class SpmkServiceImpl { ...@@ -519,7 +519,9 @@ public class SpmkServiceImpl {
approvingDto.getExecuteRecordId(), approvingDto.getExecuteRecordId(),
approvingDto.getExecutorId(), approvingDto.getExecutorId(),
approvingDto.getOpinion(), approvingDto.getOpinion(),
approvingDto.getSts()); approvingDto.getSts(),
approvingDto.getUser()
);
System.out.println(listFlowChildren); System.out.println(listFlowChildren);
// 更新 flowChildren // 更新 flowChildren
......
...@@ -26,5 +26,8 @@ public class ApprovingDto { ...@@ -26,5 +26,8 @@ public class ApprovingDto {
@ApiModelProperty(value = "状态 2同意 3拒绝", example = "2", required = true) @ApiModelProperty(value = "状态 2同意 3拒绝", example = "2", required = true)
private Integer sts; private Integer sts;
@ApiModelProperty(value = "被转派人 ", example = "对象")
private User user;
} }
...@@ -29,7 +29,7 @@ public class MySummaryQueryDto extends Page{ ...@@ -29,7 +29,7 @@ public class MySummaryQueryDto extends Page{
@ApiModelProperty(value = "结束时间 ", example = "2020-10-10 10:10:10") @ApiModelProperty(value = "结束时间 ", example = "2020-10-10 10:10:10")
private String endTime; private String endTime;
@ApiModelProperty(value = "1抄送人 2审批人 3连续多级主管", example = "0") @ApiModelProperty(value = "0我发起的 1抄送我的 2我审批的", example = "0")
private Integer type; private Integer type;
} }
...@@ -4,10 +4,13 @@ import java.util.ArrayList; ...@@ -4,10 +4,13 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import org.apache.commons.collections4.ListUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Console; import cn.hutool.core.lang.Console;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
...@@ -419,7 +422,7 @@ public class RouterUtils { ...@@ -419,7 +422,7 @@ public class RouterUtils {
* @param opinion 意见 * @param opinion 意见
* @param sts 状态 1执行中 2通过 3拒绝 * @param sts 状态 1执行中 2通过 3拒绝
*/ */
public static void approving(List<FlowChildren> listFlowChildren,Integer asId,Integer executeRecordId, Integer executorId, String opinion,Integer sts ) { public static void approving(List<FlowChildren> listFlowChildren,Integer asId,Integer executeRecordId, Integer executorId, String opinion,Integer sts,User redeployUser ) {
boolean hasNextApprover = false; boolean hasNextApprover = false;
...@@ -447,7 +450,7 @@ public class RouterUtils { ...@@ -447,7 +450,7 @@ public class RouterUtils {
// 历史审批人 // 历史审批人
SpmkApproveSummary.builder().id(asId).historyApprover(listUser.get(i_user).getName()).build().updateById(); SpmkApproveSummary.builder().id(asId).historyApprover(listUser.get(i_user).getName()).build().updateById();
// 0未执行 1执行中 2同意 3拒绝 // 0未执行 1执行中 2同意 3拒绝 4 转派
if (sts == 3) { if (sts == 3) {
// 更新 审批汇总 状态 // 更新 审批汇总 状态
SpmkApproveSummary.builder().id(asId).endTime(new Date()).sts(sts).build().updateById(); SpmkApproveSummary.builder().id(asId).endTime(new Date()).sts(sts).build().updateById();
...@@ -460,6 +463,13 @@ public class RouterUtils { ...@@ -460,6 +463,13 @@ public class RouterUtils {
.updateById(); .updateById();
listFlowChildren.get(i_user).setExecute(EXECUTED); listFlowChildren.get(i_user).setExecute(EXECUTED);
return; return;
//转派 处理
}else if (sts == 4) {
List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1);
users1.add(redeployUser);
List<User> users2 = CollectionUtil.sub(listUser, i_user+1, listUser.size());
listUser = ListUtils.union(users1, users2);
n_user = listUser.size();
} }
}else if (UNEXECUTED.equals(listUser.get(i_user).getExecute())) { }else if (UNEXECUTED.equals(listUser.get(i_user).getExecute())) {
SpmkExecutor.builder() SpmkExecutor.builder()
......
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