opt:1.去除取消任务时取消调度任务注解。
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.nl.api.task.core.TaskRequestParam;
|
||||
import org.nl.logging.annotation.Log;
|
||||
import org.nl.response.WebResponse;
|
||||
import org.nl.sys.modular.qrcode.dao.QRcodeInfo;
|
||||
import org.nl.sys.modular.qrcode.param.GenerateQRCodeParam;
|
||||
import org.nl.sys.modular.qrcode.param.QueryQRCodeParam;
|
||||
@@ -56,24 +57,28 @@ public class QRCodeController {
|
||||
return new ResponseEntity<>(qrCodeService.deleteQRCodeInfo(qRcodeInfo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@SaIgnore
|
||||
@GetMapping("/queryTaskInfoByRoom")
|
||||
@Log("获取当前队列信息")
|
||||
public ResponseEntity<Object> queryTaskInfoByRoom(@RequestParam String room){
|
||||
return new ResponseEntity<>(qrCodeService.queryTaskInfoByRoom(room),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@SaIgnore
|
||||
@PostMapping("/createTask")
|
||||
@Log("二维码创建任务")
|
||||
public ResponseEntity<Object> createTask(@RequestBody TaskRequestParam param){
|
||||
return new ResponseEntity<>(qrCodeService.createTask(param),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@SaIgnore
|
||||
@PostMapping("/cancelTask")
|
||||
@Log("二维码取消任务")
|
||||
public ResponseEntity<Object> cancelTask(@RequestParam String taskCode){
|
||||
return new ResponseEntity<>(qrCodeService.cancelTask(taskCode),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@SaIgnore
|
||||
@PostMapping("/taskOperationConfirm")
|
||||
@Log("二维码任务操作确认")
|
||||
public ResponseEntity<Object> taskOperationConfirm(@RequestParam String taskCode){
|
||||
|
||||
@@ -51,7 +51,7 @@ public interface QRCodeService {
|
||||
WebResponse createTask(TaskRequestParam qrCodeTaskRequestParam);
|
||||
|
||||
/**
|
||||
* 二维码创建任务
|
||||
* 二维码取消任务
|
||||
* @return
|
||||
*/
|
||||
WebResponse cancelTask(String taskCode);
|
||||
|
||||
@@ -182,11 +182,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper,Task> implements Tas
|
||||
throw new BadRequestException(LangProcess.msg("task_code_empty"));
|
||||
}
|
||||
|
||||
// HttpResponse result = scheduleTaskAPI.cancelTask(cancelTaskRequestParam.getTask_code());
|
||||
// if (result == null || !result.isOk()){
|
||||
// log.info("取消调度任务失败");
|
||||
// throw new BadRequestException("取消调度任务失败");
|
||||
// }
|
||||
HttpResponse result = scheduleTaskAPI.cancelTask(cancelTaskRequestParam.getTask_code());
|
||||
if (result == null || !result.isOk()){
|
||||
log.info("取消调度任务失败");
|
||||
throw new BadRequestException("取消调度任务失败");
|
||||
}
|
||||
|
||||
taskMapper.update(new LambdaUpdateWrapper<>(Task.class)
|
||||
.set(Task::getStatus,TaskStatusEnum.CANCELED.getCode())
|
||||
|
||||
Reference in New Issue
Block a user