|
@@ -1,7 +1,9 @@
|
|
package com.qunzhixinxi.hnqz.admin.manager;
|
|
package com.qunzhixinxi.hnqz.admin.manager;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.qunzhixinxi.hnqz.admin.api.dto.SysCheckChainNodeCheckHistoryDTO;
|
|
import com.qunzhixinxi.hnqz.admin.api.dto.SysCheckChainNodeCheckHistoryDTO;
|
|
|
|
+import com.qunzhixinxi.hnqz.admin.api.dto.SysCheckChainNodeCheckHistoryDTO.OnCreate;
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysCheckChainNode;
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysCheckChainNode;
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysCheckChainNodeCheckHistory;
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysCheckChainNodeCheckHistory;
|
|
import com.qunzhixinxi.hnqz.admin.service.SysCheckChainNodeCheckHistoryService;
|
|
import com.qunzhixinxi.hnqz.admin.service.SysCheckChainNodeCheckHistoryService;
|
|
@@ -34,224 +36,259 @@ import java.util.stream.Collectors;
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public class SysCheckChainManager {
|
|
public class SysCheckChainManager {
|
|
|
|
|
|
- private final SysCheckChainNodeService checkChainNodeService;
|
|
|
|
- private final SysCheckChainNodeCheckHistoryService checkChainNodeCheckHistoryService;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- public Boolean doCheck(Collection<SysCheckChainNodeCheckHistoryDTO.OnCreate> resources, HnqzUser operator) {
|
|
|
|
-
|
|
|
|
- List<SysCheckChainNodeCheckHistory> temp = resources.stream().map(resource -> {
|
|
|
|
- SysCheckChainNodeCheckHistory history = new SysCheckChainNodeCheckHistory();
|
|
|
|
- history.setNodeId(resource.getNodeId());
|
|
|
|
- history.setTargetId(resource.getTargetId());
|
|
|
|
- history.setCheckResult(resource.getCheckResult());
|
|
|
|
- history.setCheckMsg(resource.getCheckMessage());
|
|
|
|
- history.setCreateBy(operator.getUsername());
|
|
|
|
- history.setUpdateBy(operator.getUsername());
|
|
|
|
- history.setCreateTime(LocalDateTime.now());
|
|
|
|
- history.setUpdateTime(LocalDateTime.now());
|
|
|
|
- return history;
|
|
|
|
- }).collect(Collectors.toCollection(LinkedList::new));
|
|
|
|
-
|
|
|
|
- List<Integer> roles = SecurityUtils.getRoles();
|
|
|
|
-
|
|
|
|
- // 事业部总经理
|
|
|
|
- if (roles.contains(39)) {
|
|
|
|
- List<SysCheckChainNodeCheckHistory> collect1 = resources.stream().filter(res -> res.getNodeId() == 5).map(r -> {
|
|
|
|
- SysCheckChainNodeCheckHistory history = new SysCheckChainNodeCheckHistory();
|
|
|
|
- history.setNodeId(6);
|
|
|
|
- history.setTargetId(r.getTargetId());
|
|
|
|
- history.setCheckResult(r.getCheckResult());
|
|
|
|
- history.setCheckMsg(r.getCheckMessage());
|
|
|
|
- history.setCreateBy(operator.getUsername());
|
|
|
|
- history.setUpdateBy(operator.getUsername());
|
|
|
|
- history.setCreateTime(LocalDateTime.now());
|
|
|
|
- history.setUpdateTime(LocalDateTime.now());
|
|
|
|
- return history;
|
|
|
|
-
|
|
|
|
- }).collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
- temp.addAll(collect1);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return checkChainNodeCheckHistoryService.createHistory(temp);
|
|
|
|
|
|
+ private final SysCheckChainNodeService checkChainNodeService;
|
|
|
|
+ private final SysCheckChainNodeCheckHistoryService checkChainNodeCheckHistoryService;
|
|
|
|
+
|
|
|
|
+ public Boolean doCheck(
|
|
|
|
+ Collection<SysCheckChainNodeCheckHistoryDTO.OnCreate> resources, HnqzUser operator) {
|
|
|
|
+
|
|
|
|
+ List<SysCheckChainNodeCheckHistory> temp =
|
|
|
|
+ resources.stream()
|
|
|
|
+ .map(
|
|
|
|
+ resource -> {
|
|
|
|
+ SysCheckChainNodeCheckHistory history = new SysCheckChainNodeCheckHistory();
|
|
|
|
+ history.setNodeId(resource.getNodeId());
|
|
|
|
+ history.setTargetId(resource.getTargetId());
|
|
|
|
+ history.setCheckResult(resource.getCheckResult());
|
|
|
|
+ history.setCheckMsg(resource.getCheckMessage());
|
|
|
|
+ history.setCreateBy(operator.getUsername());
|
|
|
|
+ history.setUpdateBy(operator.getUsername());
|
|
|
|
+ history.setCreateTime(LocalDateTime.now());
|
|
|
|
+ history.setUpdateTime(LocalDateTime.now());
|
|
|
|
+ return history;
|
|
|
|
+ })
|
|
|
|
+ .collect(Collectors.toCollection(LinkedList::new));
|
|
|
|
+
|
|
|
|
+ // 事业部总经理是双角色
|
|
|
|
+ List<Integer> roles = SecurityUtils.getRoles();
|
|
|
|
+ // 事业部总经理是双角色
|
|
|
|
+ boolean doubleRole = roles.contains(39) && roles.contains(41);
|
|
|
|
+ if (doubleRole) {
|
|
|
|
+
|
|
|
|
+ List<Integer> tIds =
|
|
|
|
+ resources.stream()
|
|
|
|
+ .mapToInt(OnCreate::getTargetId)
|
|
|
|
+ .boxed()
|
|
|
|
+ .distinct()
|
|
|
|
+ .sorted()
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ List<SysCheckChainNodeCheckHistory> histories =
|
|
|
|
+ checkChainNodeCheckHistoryService.list(
|
|
|
|
+ Wrappers.<SysCheckChainNodeCheckHistory>lambdaQuery()
|
|
|
|
+ .in(SysCheckChainNodeCheckHistory::getTargetId, tIds));
|
|
|
|
+
|
|
|
|
+ if (CollUtil.isNotEmpty(histories)) {
|
|
|
|
+
|
|
|
|
+ Map<Integer, List<SysCheckChainNodeCheckHistory>> collect =
|
|
|
|
+ histories.stream()
|
|
|
|
+ .collect(Collectors.groupingBy(SysCheckChainNodeCheckHistory::getTargetId));
|
|
|
|
+
|
|
|
|
+ List<SysCheckChainNodeCheckHistory> collect1 =
|
|
|
|
+ resources.stream()
|
|
|
|
+ .filter(
|
|
|
|
+ resource -> {
|
|
|
|
+ Map<Integer, List<SysCheckChainNodeCheckHistory>> nodeId2History =
|
|
|
|
+ collect.get(resource.getTargetId()).stream()
|
|
|
|
+ .collect(
|
|
|
|
+ Collectors.groupingBy(SysCheckChainNodeCheckHistory::getNodeId));
|
|
|
|
+
|
|
|
|
+ int sum = nodeId2History.keySet().stream().mapToInt(Integer::intValue).sum();
|
|
|
|
+
|
|
|
|
+ return sum == 23;
|
|
|
|
+ })
|
|
|
|
+ .map(
|
|
|
|
+ resource -> {
|
|
|
|
+ SysCheckChainNodeCheckHistory history = new SysCheckChainNodeCheckHistory();
|
|
|
|
+ history.setNodeId(5);
|
|
|
|
+ history.setTargetId(resource.getTargetId());
|
|
|
|
+ history.setCheckResult(resource.getCheckResult());
|
|
|
|
+ history.setCheckMsg(resource.getCheckMessage() + ("以总经理身份审核"));
|
|
|
|
+ history.setCreateBy(operator.getUsername());
|
|
|
|
+ history.setUpdateBy(operator.getUsername());
|
|
|
|
+ history.setCreateTime(LocalDateTime.now());
|
|
|
|
+ history.setUpdateTime(LocalDateTime.now());
|
|
|
|
+ return history;
|
|
|
|
+ })
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ temp.addAll(collect1);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ return checkChainNodeCheckHistoryService.createHistory(temp);
|
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取目标的最新的审核状态
|
|
|
|
- */
|
|
|
|
- public Map<Integer, Map<String, Object>> getTargetLatestCheckState(Collection<Integer> targetIds) {
|
|
|
|
-
|
|
|
|
- // 获取目标的所有审核
|
|
|
|
- List<SysCheckChainNodeCheckHistory> histories = checkChainNodeCheckHistoryService.getTargetLatestCheckState(targetIds);
|
|
|
|
|
|
+ /** 获取目标的最新的审核状态 */
|
|
|
|
+ public Map<Integer, Map<String, Object>> getTargetLatestCheckState(
|
|
|
|
+ Collection<Integer> targetIds) {
|
|
|
|
|
|
- if (CollUtil.isEmpty(histories)) {
|
|
|
|
- return initTargetCheckMap(targetIds, Collections.emptyMap());
|
|
|
|
- } else {
|
|
|
|
- Map<Integer, List<SysCheckChainNodeCheckHistory>> hisMap = histories.stream().collect(Collectors.groupingBy(SysCheckChainNodeCheckHistory::getTargetId));
|
|
|
|
- return initTargetCheckMap(targetIds, hisMap);
|
|
|
|
- }
|
|
|
|
|
|
+ // 获取目标的所有审核
|
|
|
|
+ List<SysCheckChainNodeCheckHistory> histories =
|
|
|
|
+ checkChainNodeCheckHistoryService.getTargetLatestCheckState(targetIds);
|
|
|
|
|
|
|
|
+ if (CollUtil.isEmpty(histories)) {
|
|
|
|
+ return initTargetCheckMap(targetIds, Collections.emptyMap());
|
|
|
|
+ } else {
|
|
|
|
+ Map<Integer, List<SysCheckChainNodeCheckHistory>> hisMap =
|
|
|
|
+ histories.stream()
|
|
|
|
+ .collect(Collectors.groupingBy(SysCheckChainNodeCheckHistory::getTargetId));
|
|
|
|
+ return initTargetCheckMap(targetIds, hisMap);
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private Map<Integer, Map<String, Object>> initTargetCheckMap(
|
|
|
|
+ Collection<Integer> targetIds, Map<Integer, List<SysCheckChainNodeCheckHistory>> hisMap) {
|
|
|
|
+
|
|
|
|
+ // 获取所有的审核节点
|
|
|
|
+ List<SysCheckChainNode> allCheckNodes = checkChainNodeService.list();
|
|
|
|
+ Map<Integer, SysCheckChainNode> nodeMap =
|
|
|
|
+ allCheckNodes.stream()
|
|
|
|
+ .collect(Collectors.toMap(SysCheckChainNode::getNodeId, Function.identity()));
|
|
|
|
+
|
|
|
|
+ // 封装初始化结果
|
|
|
|
+ Map<Integer, Map<String, Object>> res = new HashMap<>(targetIds.size());
|
|
|
|
+ for (Integer tid : targetIds) {
|
|
|
|
+ log.info("当前target_info:<--{}-->", tid);
|
|
|
|
+
|
|
|
|
+ Boolean checkResult = null;
|
|
|
|
+ String checkMsg = null;
|
|
|
|
+ String displayInfo = null;
|
|
|
|
+ Integer curNodeId = null;
|
|
|
|
+ Integer nextNodeId = null;
|
|
|
|
+ Integer roleId = null;
|
|
|
|
+
|
|
|
|
+ // 任务的审核记录
|
|
|
|
+ List<SysCheckChainNodeCheckHistory> histories = hisMap.get(tid);
|
|
|
|
+
|
|
|
|
+ int nodeId;
|
|
|
|
+ if (CollUtil.isNotEmpty(histories)) {
|
|
|
|
+
|
|
|
|
+ // 最新的审核结果(当前级别)
|
|
|
|
+ SysCheckChainNodeCheckHistory history = histories.get(0);
|
|
|
|
+ log.info("当前审核节点信息:<--{}-->", history);
|
|
|
|
+ nodeId = history.getNodeId();
|
|
|
|
+
|
|
|
|
+ if (nodeId == 1) {
|
|
|
|
+ checkResult = history.getCheckResult();
|
|
|
|
+ checkMsg = history.getCheckMsg();
|
|
|
|
+ displayInfo = nodeMap.get(2).getDisplayInfo();
|
|
|
|
+ curNodeId = nodeId;
|
|
|
|
+ nextNodeId = nodeMap.get(1).getNextNodeId();
|
|
|
|
+ roleId = nodeMap.get(2).getExecRoleId();
|
|
|
|
+
|
|
|
|
+ } else if (nodeId == 2) {
|
|
|
|
+ checkResult = history.getCheckResult();
|
|
|
|
+ checkMsg = history.getCheckMsg();
|
|
|
|
+ displayInfo = nodeMap.get(3).getDisplayInfo();
|
|
|
|
+ curNodeId = nodeId;
|
|
|
|
+ nextNodeId = nodeMap.get(2).getNextNodeId();
|
|
|
|
+ roleId = nodeMap.get(3).getExecRoleId();
|
|
|
|
+
|
|
|
|
+ } else if (nodeId == 3) {
|
|
|
|
+ checkResult = history.getCheckResult();
|
|
|
|
+ checkMsg = history.getCheckMsg();
|
|
|
|
+ displayInfo = nodeMap.get(4).getDisplayInfo();
|
|
|
|
+ curNodeId = nodeId;
|
|
|
|
+ nextNodeId = nodeMap.get(3).getNextNodeId();
|
|
|
|
+ // 事业组审核
|
|
|
|
+ roleId = -1;
|
|
|
|
|
|
-
|
|
|
|
- private Map<Integer, Map<String, Object>> initTargetCheckMap(Collection<Integer> targetIds, Map<Integer, List<SysCheckChainNodeCheckHistory>> hisMap) {
|
|
|
|
-
|
|
|
|
- // 获取所有的审核节点
|
|
|
|
- List<SysCheckChainNode> allCheckNodes = checkChainNodeService.list();
|
|
|
|
- Map<Integer, SysCheckChainNode> nodeMap = allCheckNodes.stream().collect(Collectors.toMap(SysCheckChainNode::getNodeId, Function.identity()));
|
|
|
|
-
|
|
|
|
- // 封装初始化结果
|
|
|
|
- Map<Integer, Map<String, Object>> res = new HashMap<>(targetIds.size());
|
|
|
|
- for (Integer tid : targetIds) {
|
|
|
|
- log.info("当前target_info:<--{}-->", tid);
|
|
|
|
-
|
|
|
|
- Boolean checkResult = null;
|
|
|
|
- String checkMsg = null;
|
|
|
|
- String displayInfo = null;
|
|
|
|
- Integer curNodeId = null;
|
|
|
|
- Integer nextNodeId = null;
|
|
|
|
- Integer roleId = null;
|
|
|
|
-
|
|
|
|
- // 任务的审核记录
|
|
|
|
- List<SysCheckChainNodeCheckHistory> histories = hisMap.get(tid);
|
|
|
|
-
|
|
|
|
- int nodeId;
|
|
|
|
- if (CollUtil.isNotEmpty(histories)) {
|
|
|
|
-
|
|
|
|
- // 最新的审核结果(当前级别)
|
|
|
|
- SysCheckChainNodeCheckHistory history = histories.get(0);
|
|
|
|
- log.info("当前审核节点信息:<--{}-->", history);
|
|
|
|
- nodeId = history.getNodeId();
|
|
|
|
-
|
|
|
|
- if (nodeId == 1) {
|
|
|
|
- checkResult = history.getCheckResult();
|
|
|
|
- checkMsg = history.getCheckMsg();
|
|
|
|
- displayInfo = nodeMap.get(2).getDisplayInfo();
|
|
|
|
- curNodeId = nodeId;
|
|
|
|
- nextNodeId = nodeMap.get(1).getNextNodeId();
|
|
|
|
- roleId = nodeMap.get(2).getExecRoleId();
|
|
|
|
-
|
|
|
|
- } else if (nodeId == 2) {
|
|
|
|
- checkResult = history.getCheckResult();
|
|
|
|
- checkMsg = history.getCheckMsg();
|
|
|
|
- displayInfo = nodeMap.get(3).getDisplayInfo();
|
|
|
|
- curNodeId = nodeId;
|
|
|
|
- nextNodeId = nodeMap.get(2).getNextNodeId();
|
|
|
|
- roleId = nodeMap.get(3).getExecRoleId();
|
|
|
|
-
|
|
|
|
- } else if (nodeId == 3) {
|
|
|
|
- checkResult = history.getCheckResult();
|
|
|
|
- checkMsg = history.getCheckMsg();
|
|
|
|
- displayInfo = nodeMap.get(4).getDisplayInfo();
|
|
|
|
- curNodeId = nodeId;
|
|
|
|
- nextNodeId = nodeMap.get(3).getNextNodeId();
|
|
|
|
- // 事业组审核
|
|
|
|
- roleId = -1;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- // 服务组
|
|
|
|
- else if (nodeId == 4) {
|
|
|
|
- checkResult = history.getCheckResult();
|
|
|
|
- checkMsg = history.getCheckMsg();
|
|
|
|
- displayInfo = nodeMap.get(4).getDisplayInfo();
|
|
|
|
- curNodeId = nodeId;
|
|
|
|
- roleId = -1;
|
|
|
|
- }
|
|
|
|
- // 分管领导
|
|
|
|
- else if (nodeId == 5) {
|
|
|
|
- checkResult = history.getCheckResult();
|
|
|
|
- checkMsg = history.getCheckMsg();
|
|
|
|
- displayInfo = nodeMap.get(6).getDisplayInfo();
|
|
|
|
- curNodeId = nodeId;
|
|
|
|
- nextNodeId = nodeMap.get(5).getNextNodeId();
|
|
|
|
- roleId = nodeMap.get(6).getExecRoleId();
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- // 总经理
|
|
|
|
- else if (nodeId == 6) {
|
|
|
|
- checkResult = history.getCheckResult();
|
|
|
|
- checkMsg = history.getCheckMsg();
|
|
|
|
- displayInfo = "事业部总经理已审核";
|
|
|
|
- curNodeId = nodeId;
|
|
|
|
- nextNodeId = -1;
|
|
|
|
- roleId = nodeMap.get(6).getExecRoleId();
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- // 如果最新提交的是市场组
|
|
|
|
- else if (nodeId == 8) {
|
|
|
|
- // 证明服务组已经审核完毕了
|
|
|
|
- if (histories.get(1).getNodeId() == 9) {
|
|
|
|
- displayInfo = nodeMap.get(5).getDisplayInfo();
|
|
|
|
- checkResult = history.getCheckResult();
|
|
|
|
- checkMsg = history.getCheckMsg();
|
|
|
|
- curNodeId = nodeId;
|
|
|
|
- nextNodeId = 5;
|
|
|
|
- roleId = nodeMap.get(5).getExecRoleId();
|
|
|
|
- }
|
|
|
|
- // 等待服务组审批
|
|
|
|
- else {
|
|
|
|
- displayInfo = nodeMap.get(8).getDisplayInfo();
|
|
|
|
- checkResult = history.getCheckResult();
|
|
|
|
- checkMsg = history.getCheckMsg();
|
|
|
|
- curNodeId = nodeId;
|
|
|
|
- nextNodeId = 9;
|
|
|
|
- roleId = nodeMap.get(9).getExecRoleId();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // 如果最信提交的是服务组
|
|
|
|
- else if (nodeId == 9) {
|
|
|
|
- // 证明服务组已经审核完毕了
|
|
|
|
- if (histories.get(1).getNodeId() == 8) {
|
|
|
|
- nextNodeId = 5;
|
|
|
|
- checkResult = history.getCheckResult();
|
|
|
|
- checkMsg = history.getCheckMsg();
|
|
|
|
- curNodeId = nodeId;
|
|
|
|
- displayInfo = nodeMap.get(5).getDisplayInfo();
|
|
|
|
- roleId = nodeMap.get(5).getExecRoleId();
|
|
|
|
- }
|
|
|
|
- // 等待市场组审批
|
|
|
|
- else {
|
|
|
|
- nextNodeId = 8;
|
|
|
|
- checkResult = history.getCheckResult();
|
|
|
|
- checkMsg = history.getCheckMsg();
|
|
|
|
- curNodeId = nodeId;
|
|
|
|
- displayInfo = nodeMap.get(9).getDisplayInfo();
|
|
|
|
- roleId = nodeMap.get(8).getExecRoleId();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- // 不存在审核记录的时候初始化
|
|
|
|
- else {
|
|
|
|
-
|
|
|
|
- log.info("初始化尚未审核的目标任务");
|
|
|
|
-
|
|
|
|
- checkMsg = "";
|
|
|
|
- nextNodeId = 1;
|
|
|
|
- curNodeId = 1;
|
|
|
|
- displayInfo = nodeMap.get(1).getDisplayInfo();
|
|
|
|
- roleId = nodeMap.get(1).getExecRoleId();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Map<String, Object> temp = new HashMap<>(5);
|
|
|
|
- temp.put("checkResult", checkResult);
|
|
|
|
- temp.put("checkMsg", checkMsg);
|
|
|
|
- temp.put("roleId", roleId);
|
|
|
|
- temp.put("displayInfo", displayInfo);
|
|
|
|
- temp.put("nextNodeId", nextNodeId);
|
|
|
|
- temp.put("curNodeId", curNodeId);
|
|
|
|
- res.put(tid, temp);
|
|
|
|
}
|
|
}
|
|
|
|
+ // 服务组
|
|
|
|
+ else if (nodeId == 4) {
|
|
|
|
+ checkResult = history.getCheckResult();
|
|
|
|
+ checkMsg = history.getCheckMsg();
|
|
|
|
+ displayInfo = nodeMap.get(4).getDisplayInfo();
|
|
|
|
+ curNodeId = nodeId;
|
|
|
|
+ roleId = -1;
|
|
|
|
+ }
|
|
|
|
+ // 分管领导
|
|
|
|
+ else if (nodeId == 5) {
|
|
|
|
+ checkResult = history.getCheckResult();
|
|
|
|
+ checkMsg = history.getCheckMsg();
|
|
|
|
+ displayInfo = nodeMap.get(6).getDisplayInfo();
|
|
|
|
+ curNodeId = nodeId;
|
|
|
|
+ nextNodeId = nodeMap.get(5).getNextNodeId();
|
|
|
|
+ roleId = nodeMap.get(6).getExecRoleId();
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ // 总经理
|
|
|
|
+ else if (nodeId == 6) {
|
|
|
|
+ checkResult = history.getCheckResult();
|
|
|
|
+ checkMsg = history.getCheckMsg();
|
|
|
|
+ displayInfo = "事业部总经理已审核";
|
|
|
|
+ curNodeId = nodeId;
|
|
|
|
+ nextNodeId = -1;
|
|
|
|
+ roleId = nodeMap.get(6).getExecRoleId();
|
|
|
|
|
|
- return res;
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+ // 如果最新提交的是市场组
|
|
|
|
+ else if (nodeId == 8) {
|
|
|
|
+ // 证明服务组已经审核完毕了
|
|
|
|
+ if (histories.get(1).getNodeId() == 9) {
|
|
|
|
+ displayInfo = nodeMap.get(5).getDisplayInfo();
|
|
|
|
+ checkResult = history.getCheckResult();
|
|
|
|
+ checkMsg = history.getCheckMsg();
|
|
|
|
+ curNodeId = nodeId;
|
|
|
|
+ nextNodeId = 5;
|
|
|
|
+ roleId = nodeMap.get(5).getExecRoleId();
|
|
|
|
+ }
|
|
|
|
+ // 等待服务组审批
|
|
|
|
+ else {
|
|
|
|
+ displayInfo = nodeMap.get(8).getDisplayInfo();
|
|
|
|
+ checkResult = history.getCheckResult();
|
|
|
|
+ checkMsg = history.getCheckMsg();
|
|
|
|
+ curNodeId = nodeId;
|
|
|
|
+ nextNodeId = 9;
|
|
|
|
+ roleId = nodeMap.get(9).getExecRoleId();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 如果最信提交的是服务组
|
|
|
|
+ else if (nodeId == 9) {
|
|
|
|
+ // 证明服务组已经审核完毕了
|
|
|
|
+ if (histories.get(1).getNodeId() == 8) {
|
|
|
|
+ nextNodeId = 5;
|
|
|
|
+ checkResult = history.getCheckResult();
|
|
|
|
+ checkMsg = history.getCheckMsg();
|
|
|
|
+ curNodeId = nodeId;
|
|
|
|
+ displayInfo = nodeMap.get(5).getDisplayInfo();
|
|
|
|
+ roleId = nodeMap.get(5).getExecRoleId();
|
|
|
|
+ }
|
|
|
|
+ // 等待市场组审批
|
|
|
|
+ else {
|
|
|
|
+ nextNodeId = 8;
|
|
|
|
+ checkResult = history.getCheckResult();
|
|
|
|
+ checkMsg = history.getCheckMsg();
|
|
|
|
+ curNodeId = nodeId;
|
|
|
|
+ displayInfo = nodeMap.get(9).getDisplayInfo();
|
|
|
|
+ roleId = nodeMap.get(8).getExecRoleId();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ // 不存在审核记录的时候初始化
|
|
|
|
+ else {
|
|
|
|
+
|
|
|
|
+ log.info("初始化尚未审核的目标任务");
|
|
|
|
+
|
|
|
|
+ checkMsg = "";
|
|
|
|
+ nextNodeId = 1;
|
|
|
|
+ curNodeId = 1;
|
|
|
|
+ displayInfo = nodeMap.get(1).getDisplayInfo();
|
|
|
|
+ roleId = nodeMap.get(1).getExecRoleId();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Map<String, Object> temp = new HashMap<>(5);
|
|
|
|
+ temp.put("checkResult", checkResult);
|
|
|
|
+ temp.put("checkMsg", checkMsg);
|
|
|
|
+ temp.put("roleId", roleId);
|
|
|
|
+ temp.put("displayInfo", displayInfo);
|
|
|
|
+ temp.put("nextNodeId", nextNodeId);
|
|
|
|
+ temp.put("curNodeId", curNodeId);
|
|
|
|
+ res.put(tid, temp);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+ return res;
|
|
|
|
+ }
|
|
}
|
|
}
|