Commit 8ce0c93a authored by W_Y's avatar W_Y

删除任务

parent 5c34a6b9
...@@ -26,8 +26,6 @@ public class Task { ...@@ -26,8 +26,6 @@ public class Task {
@TableField(exist = false) @TableField(exist = false)
public static final String STATUS_NEW = "NEW"; public static final String STATUS_NEW = "NEW";
@TableField(exist = false) @TableField(exist = false)
public static final String STATUS_PENDING = "PENDING";
@TableField(exist = false)
public static final String STATUS_FINISH = "FINISH"; public static final String STATUS_FINISH = "FINISH";
@TableField(exist = false) @TableField(exist = false)
...@@ -58,7 +56,7 @@ public class Task { ...@@ -58,7 +56,7 @@ public class Task {
@ApiModelProperty("任务名称") @ApiModelProperty("任务名称")
private String taskName; private String taskName;
@ApiModelProperty("任务状态(NEW、PENDING、FINISH)") @ApiModelProperty("任务状态(NEW、FINISH)")
private String taskStatus; private String taskStatus;
@ApiModelProperty("产品名称") @ApiModelProperty("产品名称")
......
...@@ -34,4 +34,6 @@ public interface TaskService extends IService<Task> { ...@@ -34,4 +34,6 @@ public interface TaskService extends IService<Task> {
List<Task> findFinish(TaskFindFinishRequest request); List<Task> findFinish(TaskFindFinishRequest request);
void editTask(TaskEditRequest request); void editTask(TaskEditRequest request);
void deleteTask(TaskDeleteRequest request);
} }
...@@ -8,6 +8,8 @@ import com.ruoyi.common.utils.SecurityUtils; ...@@ -8,6 +8,8 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SnowflakeUtil; import com.ruoyi.common.utils.SnowflakeUtil;
import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
import com.ruoyi.mapper.CarReviewTaskMapper;
import com.ruoyi.mapper.SystemReviewTaskMapper;
import com.ruoyi.mapper.TaskMapper; import com.ruoyi.mapper.TaskMapper;
import com.ruoyi.service.*; import com.ruoyi.service.*;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
...@@ -46,6 +48,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -46,6 +48,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
@Autowired @Autowired
private CarReviewTaskService carReviewTaskService; private CarReviewTaskService carReviewTaskService;
@Autowired
private SystemReviewTaskMapper systemReviewTaskMapper;
@Autowired
private CarReviewTaskMapper carReviewTaskMapper;
@Override @Override
public List<Task> findList(TaskListRequest request) { public List<Task> findList(TaskListRequest request) {
return taskMapper.findList(request); return taskMapper.findList(request);
...@@ -146,6 +154,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -146,6 +154,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
taskUserRelationService.updateBatchById(auditors); taskUserRelationService.updateBatchById(auditors);
} }
@Override
public void deleteTask(TaskDeleteRequest request) {
Task task = taskMapper.selectById(request.getId());
systemReviewTaskMapper.deleteById(task.getSystemReviewTaskId());
carReviewTaskMapper.deleteById(task.getCarReviewTaskId());
taskMapper.deleteById(request.getId());
}
public Long saveSystemReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) { public Long saveSystemReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) {
// 构建并保存任务信息 // 构建并保存任务信息
......
...@@ -99,4 +99,14 @@ public class TaskController extends BaseController { ...@@ -99,4 +99,14 @@ public class TaskController extends BaseController {
return R.ok(); return R.ok();
} }
@ApiOperation("删除任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "删除任务", businessType = BusinessType.DELETE)
@RequestMapping(method = RequestMethod.POST, value = "/deleteTask")
public R<String> deleteTask(@Validated @RequestBody TaskDeleteRequest request) {
taskService.deleteTask(request);
return R.ok();
}
} }
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "TaskDeleteRequest", description = "删除任务")
@Data
public class TaskDeleteRequest {
@ApiModelProperty("ID")
private Long id;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment