|
@@ -3456,8 +3456,14 @@ public class TaskController extends BladeController {
|
|
|
if (ObjectUtil.isEmpty(dto.getFixedBranchList()) || dto.getFixedBranchList().size() == 0) {
|
|
|
return R.fail("请选择任务流程人员");
|
|
|
}
|
|
|
- if (ObjectUtil.isNotEmpty(dto.getFixedName())) {
|
|
|
+ List<Task> tasks = jdbcTemplate
|
|
|
+ .query("SELECT * FROM u_task WHERE contract_id = ? and is_deleted = 0 AND fixed_flow_id = ? ",
|
|
|
+ new Object[]{dto.getContractId(),dto.getFixedFlowId()}, new BeanPropertyRowMapper<>(Task.class));
|
|
|
+ if (tasks.size() > 0){
|
|
|
+ return R.fail("当前流程已经使用,不能修改");
|
|
|
+ }
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getFixedName())) {
|
|
|
List<UpdateFixedFlowDTO.FixedBranch> fixedBranchList = dto.getFixedBranchList();
|
|
|
Set<String> allUserIds = new HashSet<>();
|
|
|
Set<String> duplicateUserIds = new HashSet<>();
|
|
@@ -3511,6 +3517,12 @@ public class TaskController extends BladeController {
|
|
|
@ApiOperationSupport(order = 27)
|
|
|
@ApiOperation(value = "计量刪除预设流程", notes = "传入预设流程id")
|
|
|
public R<Object> deleteFixedFlow(@RequestParam String id) {
|
|
|
+ List<Task> tasks = jdbcTemplate
|
|
|
+ .query("SELECT * FROM u_task WHERE is_deleted = 0 AND fixed_flow_id = ? ",
|
|
|
+ new Object[]{id}, new BeanPropertyRowMapper<>(Task.class));
|
|
|
+ if (tasks.size() > 0){
|
|
|
+ return R.fail("当前流程已经使用,不能删除");
|
|
|
+ }
|
|
|
jdbcTemplate.update("DELETE FROM u_fixed_flow WHERE id = ?", new Object[]{id});
|
|
|
jdbcTemplate.update("DELETE FROM u_fixed_flow_link WHERE fixed_flow_id = ?", new Object[]{id});
|
|
|
return R.success("操作成功");
|