|
@@ -206,13 +206,15 @@ public class TaskClientImpl implements TaskClient {
|
|
|
fixedFlow.setFixedFlowName(fixedName);
|
|
|
fixedFlow.setProjectId(projectId);
|
|
|
fixedFlow.setContractId(contractId);
|
|
|
+ fixedFlow.setStatus(1);
|
|
|
+ fixedFlow.setCreateTime(new Date());
|
|
|
return fixedFlowServiceImpl.save(fixedFlow);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void saveFixedFlowLink(Long fixedFlowId, String name, Integer type, String userIds, Long projectId, Long contractId, Integer sortBranch) {
|
|
|
+ public void saveFixedFlowLink(Long fixedFlowId, String name, Integer type, String userIds, Long projectId, Long contractId, Integer sort) {
|
|
|
Map<Long, String> userMap = iUserClient.selectUserAll().stream().filter(f -> ObjectUtil.isNotEmpty(f.getRealName())).collect(Collectors.toMap(User::getId, User::getRealName));
|
|
|
- int sort = 1;
|
|
|
+ int sortLink = 1;
|
|
|
for (String userId : userIds.split(",")) {
|
|
|
FixedFlowLink fixedFlowLink = new FixedFlowLink();
|
|
|
fixedFlowLink.setFixedFlowId(fixedFlowId);
|
|
@@ -221,11 +223,11 @@ public class TaskClientImpl implements TaskClient {
|
|
|
fixedFlowLink.setFixedFlowLinkUser(Long.parseLong(userId));
|
|
|
fixedFlowLink.setFixedFlowLinkUserName(userMap.get(Long.parseLong(userId)));
|
|
|
if (type.equals(1)) {
|
|
|
- fixedFlowLink.setFixedFlowLinkSort(sort++);
|
|
|
+ fixedFlowLink.setFixedFlowLinkSort(sortLink++);
|
|
|
}
|
|
|
fixedFlowLink.setProjectId(projectId);
|
|
|
fixedFlowLink.setContractId(contractId);
|
|
|
- fixedFlowLink.setFixedFlowBranchSort(sortBranch);
|
|
|
+ fixedFlowLink.setFixedFlowBranchSort(sort);
|
|
|
fixedFlowLinkServiceImpl.save(fixedFlowLink);
|
|
|
}
|
|
|
}
|
|
@@ -236,13 +238,12 @@ public class TaskClientImpl implements TaskClient {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void updateFixedFlowLink(Long fixedFlowId, String name, Integer type, String userIds, Long projectId, Long contractId, Integer sortBranch) {
|
|
|
- jdbcTemplate.update("DELETE FROM u_fixed_flow_link WHERE fixed_flow_id = ?", fixedFlowId);
|
|
|
- this.saveFixedFlowLink(fixedFlowId, name, type, userIds, projectId, contractId, sortBranch);
|
|
|
+ public void updateFixedFlowLink(Long fixedFlowId, String name, Integer type, String userIds, Long projectId, Long contractId, Integer sort) {
|
|
|
+ this.saveFixedFlowLink(fixedFlowId, name, type, userIds, projectId, contractId, sort);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Page<Map<String, Object>> getFixedFlowPage(PageFixedFlowDTO dto) {
|
|
|
+ public List<Map<String, Object>> getFixedFlowPage(PageFixedFlowDTO dto) {
|
|
|
Page<FixedFlow> page = new Page<>(dto.getCurrent(), dto.getSize());
|
|
|
IPage<FixedFlow> fixedFlowsPage = fixedFlowServiceImpl.getBaseMapper().selectPage(page,
|
|
|
Wrappers.<FixedFlow>lambdaQuery().eq(FixedFlow::getContractId, dto.getContractId()).eq(FixedFlow::getProjectId, dto.getProjectId()));
|
|
@@ -250,7 +251,7 @@ public class TaskClientImpl implements TaskClient {
|
|
|
List<Long> collect = fixedFlows.stream().map(FixedFlow::getId).collect(Collectors.toList());
|
|
|
if (collect.size() > 0) {
|
|
|
List<FixedFlowLink> fixedFlowLinkList = fixedFlowLinkServiceImpl.getBaseMapper().selectList(
|
|
|
- Wrappers.<FixedFlowLink>lambdaQuery().in(FixedFlowLink::getFixedFlowId, collect));
|
|
|
+ Wrappers.<FixedFlowLink>lambdaQuery().isNotNull(FixedFlowLink::getFixedFlowLink).in(FixedFlowLink::getFixedFlowId, collect));
|
|
|
Map<Long, List<FixedFlowLink>> group = fixedFlowLinkList.stream().collect(Collectors.groupingBy(FixedFlowLink::getFixedFlowId));
|
|
|
List<Map<String, Object>> result = new LinkedList<>();
|
|
|
for (FixedFlow fixedFlow : fixedFlows) {
|
|
@@ -264,15 +265,9 @@ public class TaskClientImpl implements TaskClient {
|
|
|
}
|
|
|
result.add(map);
|
|
|
}
|
|
|
-
|
|
|
- Page<Map<String, Object>> resultMap = new Page<>();
|
|
|
- resultMap.setCurrent(fixedFlowsPage.getCurrent());
|
|
|
- resultMap.setSize(fixedFlowsPage.getSize());
|
|
|
- resultMap.setTotal(fixedFlowsPage.getTotal());
|
|
|
- resultMap.setRecords(result);
|
|
|
- return resultMap;
|
|
|
+ return result;
|
|
|
}
|
|
|
- return new Page<>();
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
}
|