|
@@ -25,6 +25,8 @@ import org.jeecg.modules.flowpath.service.IItdmRunFlowPathService;
|
|
|
import org.jeecg.modules.flowpath.service.IItdmRunFlowPathStepService;
|
|
|
import org.jeecg.modules.flowpath.vo.ItdmRunFlowPathInfoVO;
|
|
|
import org.jeecg.modules.flowpath.vo.ItdmRunFlowPathStepVO;
|
|
|
+import org.jeecg.modules.itdmFirstPage.entity.ItdmTask;
|
|
|
+import org.jeecg.modules.itdmFirstPage.service.IItdmTaskService;
|
|
|
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
|
|
import org.jeecg.modules.weituo.entity.ItdmWeituoInfo;
|
|
|
import org.jeecg.modules.weituo.service.IItdmWeituoInfoService;
|
|
@@ -34,10 +36,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Comparator;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -68,6 +67,10 @@ public class ItdmRunFlowPathController extends JeecgController<ItdmRunFlowPath,
|
|
|
@Autowired
|
|
|
private SysBaseApiImpl sysBaseApi;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ private IItdmTaskService taskService;
|
|
|
+
|
|
|
|
|
|
//@AutoLog(value = "运行流程表-分页列表查询")
|
|
|
@ApiOperation(value = "运行流程表-分页列表查询", notes = "运行流程表-分页列表查询")
|
|
@@ -147,8 +150,34 @@ public class ItdmRunFlowPathController extends JeecgController<ItdmRunFlowPath,
|
|
|
//@RequiresPermissions("org.jeecg.modules:itdm_run_flow_path:delete")
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
|
|
+
|
|
|
+ //查询对应的运行流程对象
|
|
|
+ ItdmRunFlowPath runFlowPath = itdmRunFlowPathService.getById(id);
|
|
|
+ int sort = Integer.parseInt(iItdmFlowPathStepService.getById(runFlowPath.getDqSetp()).getSort());
|
|
|
+ //委托id
|
|
|
+ Map<String, Object> weituoMap = new HashMap<>();
|
|
|
+ weituoMap.put("weituo_no",runFlowPath.getWeituoNo());
|
|
|
+ String weituoId = iItdmWeituoInfoService.listByMap(weituoMap).get(0).getId();
|
|
|
+
|
|
|
+ //流程步骤表——12步
|
|
|
+ List<ItdmFlowPathStep> stepList = iItdmFlowPathStepService.list();
|
|
|
+ //删除对应的任务
|
|
|
+ for(ItdmFlowPathStep step : stepList){
|
|
|
+ int sort1 = Integer.parseInt(step.getSort());
|
|
|
+ if(sort1<=sort){
|
|
|
+ ItdmTask task = new ItdmTask();
|
|
|
+ task.setWeituoId(weituoId);
|
|
|
+ task.setTaskContent(step.getName());
|
|
|
+ QueryWrapper<ItdmTask> queryWrapper = new QueryWrapper<>(task);
|
|
|
+ ItdmTask dTask = taskService.getOne(queryWrapper);
|
|
|
+ taskService.removeById(dTask);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
itdmRunFlowPathService.removeById(id);
|
|
|
itdmRunFlowPathStepService.remove(Wrappers.lambdaQuery(ItdmRunFlowPathStep.class).eq(ItdmRunFlowPathStep::getRunFlowPath, id));
|
|
|
+
|
|
|
return Result.OK("删除成功!");
|
|
|
}
|
|
|
|
|
@@ -163,10 +192,38 @@ public class ItdmRunFlowPathController extends JeecgController<ItdmRunFlowPath,
|
|
|
//@RequiresPermissions("org.jeecg.modules:itdm_run_flow_path:deleteBatch")
|
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
+
|
|
|
+ for (String id : Arrays.asList(ids.split(","))){
|
|
|
+ //查询对应的运行流程对象
|
|
|
+ ItdmRunFlowPath runFlowPath = itdmRunFlowPathService.getById(id);
|
|
|
+ int sort = Integer.parseInt(iItdmFlowPathStepService.getById(runFlowPath.getDqSetp()).getSort());
|
|
|
+ //委托id
|
|
|
+ Map<String, Object> weituoMap = new HashMap<>();
|
|
|
+ weituoMap.put("weituo_no",runFlowPath.getWeituoNo());
|
|
|
+ String weituoId = iItdmWeituoInfoService.listByMap(weituoMap).get(0).getId();
|
|
|
+
|
|
|
+ //流程步骤表——12步
|
|
|
+ List<ItdmFlowPathStep> stepList = iItdmFlowPathStepService.list();
|
|
|
+ //删除对应的任务
|
|
|
+ for(ItdmFlowPathStep step : stepList){
|
|
|
+ int sort1 = Integer.parseInt(step.getSort());
|
|
|
+ if(sort1<=sort){
|
|
|
+ ItdmTask task = new ItdmTask();
|
|
|
+ task.setWeituoId(weituoId);
|
|
|
+ task.setTaskContent(step.getName());
|
|
|
+ QueryWrapper<ItdmTask> queryWrapper = new QueryWrapper<>(task);
|
|
|
+ ItdmTask dTask = taskService.getOne(queryWrapper);
|
|
|
+ taskService.removeById(dTask);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
this.itdmRunFlowPathService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
itdmRunFlowPathStepService.remove(Wrappers.lambdaQuery(ItdmRunFlowPathStep.class)
|
|
|
.in(ItdmRunFlowPathStep::getRunFlowPath, Arrays.asList(ids.split(","))));
|
|
|
|
|
|
+
|
|
|
return Result.OK("批量删除成功!");
|
|
|
}
|
|
|
|