Commit 8ce0c93a authored by W_Y's avatar W_Y

删除任务

parent 5c34a6b9
......@@ -26,8 +26,6 @@ public class Task {
@TableField(exist = false)
public static final String STATUS_NEW = "NEW";
@TableField(exist = false)
public static final String STATUS_PENDING = "PENDING";
@TableField(exist = false)
public static final String STATUS_FINISH = "FINISH";
@TableField(exist = false)
......@@ -58,7 +56,7 @@ public class Task {
@ApiModelProperty("任务名称")
private String taskName;
@ApiModelProperty("任务状态(NEW、PENDING、FINISH)")
@ApiModelProperty("任务状态(NEW、FINISH)")
private String taskStatus;
@ApiModelProperty("产品名称")
......
......@@ -34,4 +34,6 @@ public interface TaskService extends IService<Task> {
List<Task> findFinish(TaskFindFinishRequest request);
void editTask(TaskEditRequest request);
void deleteTask(TaskDeleteRequest request);
}
......@@ -8,6 +8,8 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SnowflakeUtil;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.domain.*;
import com.ruoyi.mapper.CarReviewTaskMapper;
import com.ruoyi.mapper.SystemReviewTaskMapper;
import com.ruoyi.mapper.TaskMapper;
import com.ruoyi.service.*;
import com.ruoyi.system.service.ISysUserService;
......@@ -46,6 +48,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
@Autowired
private CarReviewTaskService carReviewTaskService;
@Autowired
private SystemReviewTaskMapper systemReviewTaskMapper;
@Autowired
private CarReviewTaskMapper carReviewTaskMapper;
@Override
public List<Task> findList(TaskListRequest request) {
return taskMapper.findList(request);
......@@ -146,6 +154,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
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) {
// 构建并保存任务信息
......
......@@ -99,4 +99,14 @@ public class TaskController extends BaseController {
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