|
@@ -498,7 +498,6 @@ public class FixedFlowController extends BladeController {
|
|
|
if (!collect.isEmpty()) {
|
|
|
List<FixedFlowLink> fixedFlowLinkList = fixedFlowLinkService.getBaseMapper().selectList(
|
|
|
Wrappers.<FixedFlowLink>lambdaQuery()
|
|
|
- .isNotNull(FixedFlowLink::getFixedFlowLink)
|
|
|
.in(FixedFlowLink::getFixedFlowId, collect)
|
|
|
.orderByAsc(FixedFlowLink::getFixedFlowBranchSort)
|
|
|
.orderByAsc(FixedFlowLink::getFixedFlowLinkSort)
|
|
@@ -519,6 +518,15 @@ public class FixedFlowController extends BladeController {
|
|
|
List<FixedFlowLink> one = group.getOrDefault(fixedFlow.getId(), null);
|
|
|
if (one != null) {
|
|
|
/** 上面方法会去除同名流程*/
|
|
|
+ for (FixedFlowLink link : one) {
|
|
|
+ if (link.getFixedFlowBranchSort() == null ) {
|
|
|
+ link.setFixedFlowBranchSort(link.getFixedFlowLinkSort());
|
|
|
+ link.setFixedFlowLinkSort(1);
|
|
|
+ }
|
|
|
+ if (link.getFixedFlowLink() == null || link.getFixedFlowLink().isEmpty()) {
|
|
|
+ link.setFixedFlowLink(fixedFlow.getFixedFlowName());
|
|
|
+ }
|
|
|
+ }
|
|
|
List<String> names = one.stream().filter(l->l.getFixedFlowLinkSort() != null).collect(Collectors.groupingBy(
|
|
|
FixedFlowLink::getFixedFlowLinkSort,
|
|
|
Collectors.collectingAndThen(
|
|
@@ -543,8 +551,21 @@ public class FixedFlowController extends BladeController {
|
|
|
public R<org.springblade.meter.vo.FixedFlowVO> getFixedFlow(@RequestParam String id) {
|
|
|
FixedFlow fixedFlow = jdbcTemplate.query("SELECT * FROM u_fixed_flow WHERE is_deleted = 0 AND id = ?", new Object[]{id}, new BeanPropertyRowMapper<>(FixedFlow.class)).stream().findAny().orElse(null);
|
|
|
if (fixedFlow != null) {
|
|
|
+ ProjectInfo projectInfo = projectClient.getById(fixedFlow.getProjectId() + "");
|
|
|
List<FixedFlowLink> fixedFlowLinkList = jdbcTemplate.query("SELECT * FROM u_fixed_flow_link WHERE is_deleted = 0 AND fixed_flow_id = ? ORDER BY fixed_flow_branch_sort,fixed_flow_link_sort", new Object[]{fixedFlow.getId()}, new BeanPropertyRowMapper<>(FixedFlowLink.class));
|
|
|
- if (fixedFlowLinkList.size() > 0) {
|
|
|
+ if (!fixedFlowLinkList.isEmpty()) {
|
|
|
+ for (FixedFlowLink link : fixedFlowLinkList) {
|
|
|
+ if (link.getFixedFlowBranchSort() == null ) {
|
|
|
+ link.setFixedFlowBranchSort(link.getFixedFlowLinkSort());
|
|
|
+ link.setFixedFlowLinkSort(1);
|
|
|
+ }
|
|
|
+ if (link.getFixedFlowLink() == null || link.getFixedFlowLink().isEmpty()) {
|
|
|
+ link.setFixedFlowLink(fixedFlow.getFixedFlowName());
|
|
|
+ }
|
|
|
+ if (link.getFixedFlowLinkType() == null) {
|
|
|
+ link.setFixedFlowLinkType(projectInfo == null ? (link.getFlowTaskType() == null ? 2 : link.getFlowTaskType()) : projectInfo.getApprovalType());
|
|
|
+ }
|
|
|
+ }
|
|
|
Map<String, List<FixedFlowLink>> group = fixedFlowLinkList.stream().collect(Collectors.groupingBy(
|
|
|
obj -> obj.getFixedFlowLink() + "@@@" + obj.getFixedFlowLinkType() + "@@@"+obj.getFlowTaskType() + "@@@"+obj.getFixedFlowLinkSort(),
|
|
|
LinkedHashMap::new,
|