接口传参修改,联调bug修改,converter修改
This commit is contained in:
parent
a5a05bb382
commit
2d20dc7e09
@ -61,7 +61,7 @@ public class ParallelDispatcher implements BaseDispatcher{
|
||||
latch.await();
|
||||
// TODO 检查是否全部执行成功 ,目前没有逻辑就是忽略错误
|
||||
}
|
||||
// 入库
|
||||
// TODO 入库
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -143,7 +143,6 @@ public abstract class BaseRunContext {
|
||||
}
|
||||
/**
|
||||
* 查找子类是否存在开始运行的,如果有则父状态变成running
|
||||
* TODO 逻辑可能有点问题
|
||||
* */
|
||||
public void checkChildRunning() throws ServiceException{
|
||||
Boolean runningFlag = false;
|
||||
|
@ -81,5 +81,5 @@ public interface StageService extends IService<PipStage> {
|
||||
|
||||
|
||||
void copyStage(@NotEmpty String stageId);
|
||||
|
||||
void deleteFirstStage(String stageId);
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
||||
List<PipStage> secondStageList = findSecondStage(stageId);
|
||||
if (!CollectionUtils.isEmpty(secondStageList)) {
|
||||
List<String> stageIdList = secondStageList.stream().map(PipStage::getId).toList();
|
||||
List<PipTask> taskList = taskService.listByIds(stageIdList);
|
||||
List<PipTask> taskList = taskService.getTaskByStageIdList(stageIdList);
|
||||
Map<String, List<PipTask>> stageIdMap = taskList.stream().collect(Collectors.groupingBy(PipTask::getStageId));
|
||||
for (PipStage secondStage : secondStageList) {
|
||||
secondStage.setCreator(String.valueOf(loginUserId));
|
||||
@ -362,6 +362,32 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteFirstStage(String stageId) {
|
||||
List<PipStage> secondStageAndTask = findSecondStageAndTask(stageId);
|
||||
for (PipStage stage : secondStageAndTask) {
|
||||
List<PipTask> taskValues = stage.getTaskValues();
|
||||
if (!CollectionUtils.isEmpty(taskValues)) {
|
||||
List<String> taskIdList = taskValues.stream().map(PipTask::getId).toList();
|
||||
taskService.removeBatchByIds(taskIdList);
|
||||
}
|
||||
}
|
||||
List<String> secondStageIdList = secondStageAndTask.stream().map(PipStage::getId).toList();
|
||||
removeBatchByIds(secondStageIdList);
|
||||
PipStage byId = getById(stageId);
|
||||
List<PipStage> allMainStage = findAllMainStage(byId.getPipelineId());
|
||||
List<PipStage> updateList = new ArrayList<>(allMainStage.size());
|
||||
for (PipStage stage : allMainStage) {
|
||||
if (byId.getStageSort()<stage.getStageSort()) {
|
||||
stage.setStageSort(stage.getStageSort()-1);
|
||||
updateList.add(stage);
|
||||
}
|
||||
}
|
||||
stageDao.updateBatch(updateList);
|
||||
stageDao.deleteById(stageId);
|
||||
}
|
||||
|
||||
public List<PipStage> findSecondStageAndTask(String stagesId){
|
||||
List<PipStage> otherStage = findSecondStage(stagesId);
|
||||
List<PipStage> list = new ArrayList<>();
|
||||
|
@ -9,7 +9,7 @@ import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//@Mapper
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface DictDataConvert {
|
||||
|
||||
DictDataConvert INSTANCE = Mappers.getMapper(DictDataConvert.class);
|
||||
|
@ -9,7 +9,7 @@ import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//@Mapper
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface DictTypeConvert {
|
||||
|
||||
DictTypeConvert INSTANCE = Mappers.getMapper(DictTypeConvert.class);
|
||||
|
@ -49,8 +49,8 @@ public class StageController {
|
||||
* @pi.param: name=pipelineId;dataType=string;value=pipelineId;
|
||||
*/
|
||||
@PermitAll
|
||||
@RequestMapping(path="/finAllStage",method = RequestMethod.POST)
|
||||
public CommonResult<List<StageResp>> finAllPipelineTaskOrTask(@NotNull String pipelineId){
|
||||
@RequestMapping(path="/findAllStage/{pipelineId}",method = RequestMethod.POST)
|
||||
public CommonResult<List<StageResp>> findAllPipelineTaskOrTask(@NotNull @PathVariable String pipelineId){
|
||||
List<StageResp> stageRespList = stageService.findAllStagesTask(pipelineId);
|
||||
return CommonResult.success(stageRespList);
|
||||
}
|
||||
@ -75,19 +75,24 @@ public class StageController {
|
||||
* @pi.request-type: formdata
|
||||
* @pi.param: name=taskId;dataType=string;value=taskId;
|
||||
*/
|
||||
@PostMapping(path="/deleteTasksOrStage")
|
||||
public CommonResult<Void> deleteTasksOrStage(@NotNull String taskId){
|
||||
@PostMapping(path="/deleteTasksOrStage/{taskId}")
|
||||
public CommonResult<Void> deleteTasksOrStage(@NotNull@PathVariable String taskId){
|
||||
stageService.deleteStagesOrTask(taskId);
|
||||
return CommonResult.success();
|
||||
}
|
||||
/**
|
||||
* 复制stage节点
|
||||
* */
|
||||
@PostMapping(path="/copyStage")
|
||||
public CommonResult<Void> copyStage(@NotEmpty String stageId){
|
||||
@PostMapping(path="/copyStage/{stageId}")
|
||||
public CommonResult<Void> copyStage(@NotEmpty@PathVariable String stageId){
|
||||
stageService.copyStage(stageId);
|
||||
return CommonResult.success();
|
||||
}
|
||||
@PostMapping("/deleteFirstStage")
|
||||
public CommonResult<Void> deleteFirstStage(@PathVariable String stageId){
|
||||
stageService.deleteFirstStage(stageId);
|
||||
return CommonResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -8,10 +8,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -27,15 +24,15 @@ public class TasksController {
|
||||
* @pi.request-type: formdata
|
||||
* @pi.param: name=taskId;dataType=string;value=taskId;
|
||||
*/
|
||||
@PostMapping(path="/findOneTasksOrTask")
|
||||
public CommonResult<TasksResp> findOneTasksOrTask(@NotNull String taskId){
|
||||
@PostMapping(path="/findOneTasksOrTask/{taskId}")
|
||||
public CommonResult<TasksResp> findOneTasksOrTask(@NotNull @PathVariable String taskId){
|
||||
return CommonResult.success(taskService.getRespById(taskId));
|
||||
}
|
||||
/**
|
||||
* 复制task节点
|
||||
* */
|
||||
@PostMapping(path="/copyTask")
|
||||
public CommonResult<Void> copyTask(@NotEmpty String taskId){
|
||||
@PostMapping(path="/copyTask/{taskId}")
|
||||
public CommonResult<Void> copyTask(@NotEmpty @PathVariable String taskId){
|
||||
taskService.copyTask(taskId);
|
||||
return CommonResult.success();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user