|
@@ -367,12 +367,20 @@ public class FixedFlowController extends BladeController {
|
|
|
}
|
|
|
Long number = nameCountMap.get(fixedFlow.getFixedFlowName());
|
|
|
if (number == null) {
|
|
|
- number = this.fixedFlowService.count(Wrappers.<FixedFlow>lambdaQuery().likeRight(FixedFlow::getFixedFlowName, fixedFlow.getFixedFlowName()).eq(FixedFlow::getContractId, fixedFlow.getContractId()).ne(FixedFlow::getId, fixedFlow.getId()));
|
|
|
+ List<FixedFlow> list = this.fixedFlowService.list(Wrappers.<FixedFlow>lambdaQuery().select(FixedFlow::getFixedFlowName).likeRight(FixedFlow::getFixedFlowName, fixedFlow.getFixedFlowName())
|
|
|
+ .eq(FixedFlow::getContractId, fixedFlow.getContractId()).ne(FixedFlow::getId, fixedFlow.getId()));
|
|
|
+ if (list.isEmpty()) {
|
|
|
+ number = 0L;
|
|
|
+ } else {
|
|
|
+ int length = fixedFlow.getFixedFlowName().split("_").length;
|
|
|
+ number = list.stream().filter(item -> item.getFixedFlowName().split("_").length == length + 1).count();
|
|
|
+ }
|
|
|
}
|
|
|
nameCountMap.put(fixedFlow.getFixedFlowName(), number + 1);
|
|
|
fixedFlow.setId(fixedFlowId);
|
|
|
fixedFlow.setFixedFlowName(fixedFlow.getFixedFlowName() + "_" + (number + 1));
|
|
|
fixedFlow.setCreateTime(new Date());
|
|
|
+ fixedFlow.setCreateDept(fixedFlow.getId());
|
|
|
fixedFlow.setUpdateTime(new Date());
|
|
|
fixedFlow.setCreateUser(AuthUtil.getUserId());
|
|
|
});
|