0716 ljc 修改pipeline新增接口逻辑,使用雪花算法生成id
This commit is contained in:
parent
b953dc1228
commit
296c2211ab
@ -100,7 +100,6 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
List<PipStage> pipStageList = new ArrayList<>(0);
|
List<PipStage> pipStageList = new ArrayList<>(0);
|
||||||
List<PipTask> pipTaskList = new ArrayList<>(0);
|
List<PipTask> pipTaskList = new ArrayList<>(0);
|
||||||
|
|
||||||
Map<PipStage,Map<PipStage,List<PipTask>>> templateCopyPipelineMap = new HashMap<>();
|
|
||||||
PipPipeline pipeline = pipelineConverter.reqToDO(pipelineReq);
|
PipPipeline pipeline = pipelineConverter.reqToDO(pipelineReq);
|
||||||
|
|
||||||
// 随机颜色
|
// 随机颜色
|
||||||
@ -170,7 +169,6 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
//则代表大阶段下存在阶段子节点
|
//则代表大阶段下存在阶段子节点
|
||||||
childStageList.forEach(j->{
|
childStageList.forEach(j->{
|
||||||
PipStage childStage = templateConverter.respToStage(j);
|
PipStage childStage = templateConverter.respToStage(j);
|
||||||
Map<PipStage,List<PipTask>> stageTaskMap = new HashMap<>();
|
|
||||||
|
|
||||||
childStage.setId(idWork.nextUUID(null));
|
childStage.setId(idWork.nextUUID(null));
|
||||||
childStage.setPipelineId(pipeline.getId());
|
childStage.setPipelineId(pipeline.getId());
|
||||||
@ -196,10 +194,8 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
pipTask.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
pipTask.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
taskList.add(pipTask);
|
taskList.add(pipTask);
|
||||||
});
|
});
|
||||||
stageTaskMap.put(childStage,taskList);
|
|
||||||
pipTaskList.addAll(taskList);
|
pipTaskList.addAll(taskList);
|
||||||
}
|
}
|
||||||
templateCopyPipelineMap.put(pipStage,stageTaskMap);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -208,29 +204,6 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
}
|
}
|
||||||
pipStageDao.insertBatch(pipStageList);
|
pipStageDao.insertBatch(pipStageList);
|
||||||
pipTaskDao.insertBatch(pipTaskList);
|
pipTaskDao.insertBatch(pipTaskList);
|
||||||
|
|
||||||
//清空数组
|
|
||||||
// pipStageList.clear();
|
|
||||||
// pipTaskList.clear();
|
|
||||||
//
|
|
||||||
// templateCopyPipelineMap.forEach((parentStage, childStages) -> {
|
|
||||||
//
|
|
||||||
// childStages.forEach((childStage, tasks) -> {
|
|
||||||
// childStage.setParentId(parentStage.getId());
|
|
||||||
// pipStageList.add(childStage);
|
|
||||||
//
|
|
||||||
// tasks.forEach(task -> {
|
|
||||||
// task.setStageId(childStage.getId());
|
|
||||||
// pipTaskList.add(task);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// if (!CollectionUtils.isEmpty(pipStageList)){
|
|
||||||
// pipStageDao.updateBatch(pipStageList);
|
|
||||||
// }
|
|
||||||
// if (!CollectionUtils.isEmpty(pipTaskList)){
|
|
||||||
// pipTaskDao.updateBatch(pipTaskList);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pipeline.getId();
|
return pipeline.getId();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user