|
|
@ -18,11 +18,11 @@ package me.zhengjie.modules.taskrecord.rest;
|
|
|
|
import me.zhengjie.annotation.Log;
|
|
|
|
import me.zhengjie.annotation.Log;
|
|
|
|
import me.zhengjie.common.CommonResponse;
|
|
|
|
import me.zhengjie.common.CommonResponse;
|
|
|
|
import me.zhengjie.common.ResponseCode;
|
|
|
|
import me.zhengjie.common.ResponseCode;
|
|
|
|
import me.zhengjie.modules.abmessage.rest.vo.AbMessageVO;
|
|
|
|
|
|
|
|
import me.zhengjie.modules.taskrecord.domain.TaskRecord;
|
|
|
|
import me.zhengjie.modules.taskrecord.domain.TaskRecord;
|
|
|
|
import me.zhengjie.modules.taskrecord.service.TaskRecordService;
|
|
|
|
import me.zhengjie.modules.taskrecord.service.TaskRecordService;
|
|
|
|
import me.zhengjie.modules.taskrecord.service.dto.TaskRecordDto;
|
|
|
|
import me.zhengjie.modules.taskrecord.service.dto.TaskRecordDto;
|
|
|
|
import me.zhengjie.modules.taskrecord.service.dto.TaskRecordQueryCriteria;
|
|
|
|
import me.zhengjie.modules.taskrecord.service.dto.TaskRecordQueryCriteria;
|
|
|
|
|
|
|
|
import me.zhengjie.task.ProduceLocalFileTask;
|
|
|
|
import me.zhengjie.task.SendRecordTask;
|
|
|
|
import me.zhengjie.task.SendRecordTask;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
@ -53,7 +53,8 @@ public class TaskRecordController {
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private SendRecordTask sendRecordTask;
|
|
|
|
private SendRecordTask sendRecordTask;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private ProduceLocalFileTask produceLocalFileTask;
|
|
|
|
|
|
|
|
|
|
|
|
@Log("导出数据")
|
|
|
|
@Log("导出数据")
|
|
|
|
@ApiOperation("导出数据")
|
|
|
|
@ApiOperation("导出数据")
|
|
|
@ -63,6 +64,14 @@ public class TaskRecordController {
|
|
|
|
taskRecordService.download(taskRecordService.queryAll(criteria), response);
|
|
|
|
taskRecordService.download(taskRecordService.queryAll(criteria), response);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping
|
|
|
|
|
|
|
|
@Log("新增taskRecord")
|
|
|
|
|
|
|
|
@ApiOperation("新增taskRecord")
|
|
|
|
|
|
|
|
@PreAuthorize("@el.check('taskRecord:add')")
|
|
|
|
|
|
|
|
public ResponseEntity<Object> create(@Validated @RequestBody TaskRecord resources){
|
|
|
|
|
|
|
|
return new ResponseEntity<>(taskRecordService.create(resources),HttpStatus.CREATED);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping
|
|
|
|
@GetMapping
|
|
|
|
@Log("查询taskRecord")
|
|
|
|
@Log("查询taskRecord")
|
|
|
|
@ApiOperation("查询taskRecord")
|
|
|
|
@ApiOperation("查询taskRecord")
|
|
|
@ -71,13 +80,6 @@ public class TaskRecordController {
|
|
|
|
return new ResponseEntity<>(taskRecordService.queryAll(criteria,pageable),HttpStatus.OK);
|
|
|
|
return new ResponseEntity<>(taskRecordService.queryAll(criteria,pageable),HttpStatus.OK);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping
|
|
|
|
|
|
|
|
@Log("新增taskRecord")
|
|
|
|
|
|
|
|
@ApiOperation("新增taskRecord")
|
|
|
|
|
|
|
|
@PreAuthorize("@el.check('taskRecord:add')")
|
|
|
|
|
|
|
|
public ResponseEntity<Object> create(@Validated @RequestBody TaskRecord resources){
|
|
|
|
|
|
|
|
return new ResponseEntity<>(taskRecordService.create(resources),HttpStatus.CREATED);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PutMapping
|
|
|
|
@PutMapping
|
|
|
|
@Log("修改taskRecord")
|
|
|
|
@Log("修改taskRecord")
|
|
|
@ -99,6 +101,24 @@ public class TaskRecordController {
|
|
|
|
|
|
|
|
|
|
|
|
// ================ 自定义功能实现 start ================
|
|
|
|
// ================ 自定义功能实现 start ================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 新建课包任务
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param resources 新建任务的条件
|
|
|
|
|
|
|
|
* @return 返回建立任务完成的状态
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@PostMapping("/buildTask")
|
|
|
|
|
|
|
|
@Log("新建课包任务")
|
|
|
|
|
|
|
|
@ApiOperation("新建课包任务")
|
|
|
|
|
|
|
|
@PreAuthorize("@el.check('taskRecord:add')")
|
|
|
|
|
|
|
|
public ResponseEntity<Object> buildTask(@Validated @RequestBody TaskRecord resources){
|
|
|
|
|
|
|
|
// 启动建立课包任务
|
|
|
|
|
|
|
|
produceLocalFileTask.doRunTask(resources);
|
|
|
|
|
|
|
|
// 返回结果
|
|
|
|
|
|
|
|
return new ResponseEntity<>(CommonResponse.createBySuccess(), HttpStatus.OK);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 发送课包任务,支持同事发送多个课包任务,然后进行发送
|
|
|
|
* 发送课包任务,支持同事发送多个课包任务,然后进行发送
|
|
|
|
* @param idList
|
|
|
|
* @param idList
|
|
|
|