|
|
|
@ -3,6 +3,7 @@ package com.zh.project0512.controller.manage;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import com.zh.project0512.annotation.adminTokenValid;
|
|
|
|
@ -20,12 +21,14 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
import lombok.Data;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.validation.constraints.Min;
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -69,6 +72,8 @@ public class TaskController {
|
|
|
|
|
private ITaskTeachRefeService taskTeachRefeService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ITaskDepartmentService taskDepartmentService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IVideoService videoService;
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "新增")
|
|
|
|
|
@PostMapping("/add")
|
|
|
|
@ -289,11 +294,23 @@ public class TaskController {
|
|
|
|
|
return MybatisPlusUtil.sqlResult(taskService.updateById(task), "修改");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "删除")
|
|
|
|
|
// @Operation(summary = "删除")
|
|
|
|
|
// @PostMapping("/del")
|
|
|
|
|
// @adminTokenValid
|
|
|
|
|
// public Result del(@Validated @RequestBody DelTaskParam param) {
|
|
|
|
|
// return MybatisPlusUtil.sqlResult(taskService.removeById(param.getId()), "删除");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "终止任务")
|
|
|
|
|
@PostMapping("/del")
|
|
|
|
|
@adminTokenValid
|
|
|
|
|
public Result del(@Validated @RequestBody DelTaskParam param) {
|
|
|
|
|
return MybatisPlusUtil.sqlResult(taskService.removeById(param.getId()), "删除");
|
|
|
|
|
@Transactional
|
|
|
|
|
public void del(DetTaskParam param) {
|
|
|
|
|
UpdateWrapper<Task> ew = new UpdateWrapper<>();
|
|
|
|
|
ew.eq("status",1).eq("id",param.getId())
|
|
|
|
|
.set("status",2).set("updateAt",LocalDateTime.now());
|
|
|
|
|
taskService.update(ew);
|
|
|
|
|
videoService.updStatusByTaskId(param.getId(),LocalDateTime.now());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Data
|
|
|
|
|