|
|
|
@ -89,7 +89,7 @@ public class TaskController {
|
|
|
|
|
@Operation(summary = "新增")
|
|
|
|
|
@PostMapping("/add")
|
|
|
|
|
@AdminTokenValid
|
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "2")
|
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "102")
|
|
|
|
|
@Transactional
|
|
|
|
|
public Result add(@Validated(TaskValidGroup1.class) @RequestBody Task task) {
|
|
|
|
|
if (LocalDateTime.now().isAfter(task.getStart())) {
|
|
|
|
@ -190,7 +190,7 @@ public class TaskController {
|
|
|
|
|
@Operation(summary = "新增任务标签")
|
|
|
|
|
@PostMapping("/addTag")
|
|
|
|
|
@AdminTokenValid
|
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "2")
|
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "144")
|
|
|
|
|
public Result addTag(@Validated @RequestBody AddTaskTagParam param) {
|
|
|
|
|
Integer taskId = param.getId();
|
|
|
|
|
Integer tagId = param.getTagId();
|
|
|
|
@ -216,6 +216,7 @@ public class TaskController {
|
|
|
|
|
@Operation(summary = "新增任务品牌")
|
|
|
|
|
@PostMapping("/addBrand")
|
|
|
|
|
@AdminTokenValid
|
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "144")
|
|
|
|
|
public Result addBrand(@Validated @RequestBody AddTaskBrandParam param) {
|
|
|
|
|
Integer taskId = param.getId();
|
|
|
|
|
Integer brandId = param.getBrandId();
|
|
|
|
@ -241,6 +242,7 @@ public class TaskController {
|
|
|
|
|
@Operation(summary = "删除任务标签")
|
|
|
|
|
@PostMapping("/delTag")
|
|
|
|
|
@AdminTokenValid
|
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "144")
|
|
|
|
|
public Result delTag(@Validated @RequestBody DelTaskTagParam param) {
|
|
|
|
|
return MybatisPlusUtil.sqlResult(taskTagService.remove(Wrappers.<TaskTag>query().lambda().eq(TaskTag::getTaskId, param.getId()).eq(TaskTag::getTagId, param.getTagId())), "删除");
|
|
|
|
|
}
|
|
|
|
@ -260,6 +262,7 @@ public class TaskController {
|
|
|
|
|
@Operation(summary = "删除任务品牌")
|
|
|
|
|
@PostMapping("/delBrand")
|
|
|
|
|
@AdminTokenValid
|
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "144")
|
|
|
|
|
public Result delBrand(@Validated @RequestBody DelTaskBrandParam param) {
|
|
|
|
|
return MybatisPlusUtil.sqlResult(taskBrandService.remove(Wrappers.<TaskBrand>query().lambda().eq(TaskBrand::getTaskId, param.getId()).eq(TaskBrand::getBrandId, param.getBrandId())), "删除");
|
|
|
|
|
}
|
|
|
|
@ -279,6 +282,7 @@ public class TaskController {
|
|
|
|
|
@Operation(summary = "新增任务素材")
|
|
|
|
|
@PostMapping("/addReference")
|
|
|
|
|
@AdminTokenValid
|
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "144")
|
|
|
|
|
public Result addBrand(@Validated @RequestBody AddTaskReferenceParam param) {
|
|
|
|
|
Integer taskId = param.getId();
|
|
|
|
|
Integer referenceId = param.getReferenceId();
|
|
|
|
@ -304,6 +308,7 @@ public class TaskController {
|
|
|
|
|
@Operation(summary = "删除任务素材")
|
|
|
|
|
@PostMapping("/delReference")
|
|
|
|
|
@AdminTokenValid
|
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "144")
|
|
|
|
|
public Result delTag(@Validated @RequestBody DelTaskReferenceParam param) {
|
|
|
|
|
return MybatisPlusUtil.sqlResult(taskReferenceService.remove(Wrappers.<TaskReference>query().lambda().eq(TaskReference::getTaskId, param.getId()).eq(TaskReference::getReferenceId, param.getReferenceId())), "删除");
|
|
|
|
|
}
|
|
|
|
@ -315,6 +320,12 @@ public class TaskController {
|
|
|
|
|
if (LocalDateTime.now().isAfter(task.getStart())) {
|
|
|
|
|
task.setStatus(1);
|
|
|
|
|
}
|
|
|
|
|
int id = task.getId();
|
|
|
|
|
List tagList = task.getTagList();
|
|
|
|
|
// List<Map> tagList = taskTagService.selByTaskId(id);
|
|
|
|
|
// if (tagList != null && tagList.size() > 0) {
|
|
|
|
|
// taskTagService.addGroup(tagList, id);
|
|
|
|
|
// }
|
|
|
|
|
task.setUpdateAt(LocalDateTime.now());
|
|
|
|
|
return MybatisPlusUtil.sqlResult(taskService.updateById(task), "修改");
|
|
|
|
|
}
|
|
|
|
@ -330,7 +341,7 @@ public class TaskController {
|
|
|
|
|
@PostMapping("/del")
|
|
|
|
|
@AdminTokenValid
|
|
|
|
|
@Transactional
|
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "3")
|
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "103")
|
|
|
|
|
public Result del(@Validated @RequestBody DetTaskParam param) {
|
|
|
|
|
UpdateWrapper<Task> ew = new UpdateWrapper<>();
|
|
|
|
|
ew.eq("status", 1).eq("id", param.getId())
|
|
|
|
|