代码暂存

master
土豆兄弟 4 years ago
parent 1ebfa27940
commit baee3d424b

@ -20,6 +20,7 @@ public enum ResponseCode {
// 请求结果性的错误
NODATA_ERROR(1,"查询结果为空"),
TASK_BUILD_ERROR(1,"任务建立失败"),
NO_RELEVANT_CONTENT_WAS_FOUND(1,"未查询到相关内容"),
DECRYPT_ERROR(1,"解密错误,请联系我");

@ -21,6 +21,7 @@ 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.service.TaskRecordService;
import me.zhengjie.modules.taskrecord.service.dto.TaskRecordDto;
import me.zhengjie.modules.taskrecord.service.dto.TaskRecordQueryCriteria;
import me.zhengjie.task.SendRecordTask;
import org.springframework.beans.factory.annotation.Autowired;
@ -115,6 +116,37 @@ public class TaskRecordController {
return new ResponseEntity<>(HttpStatus.OK);
}
/**
*
*
* @param sendTotal
* @param id Id
* @return
*/
@Log("发送课包数目校验")
@ApiOperation("发送课包数目校验")
@PreAuthorize("@el.check('taskRecord:list')")
@PostMapping(value = "/checkSendTotal")
public ResponseEntity<Object> checkSendTotal(@RequestParam(value = "sendTotal", defaultValue = "0") Integer sendTotal,
@RequestParam(value = "id")Integer id){
if (sendTotal == null || id == null){
return new ResponseEntity<>(CommonResponse.createByError(ResponseCode.EMPTY_ARGUMENT), HttpStatus.OK);
}
TaskRecordDto dto = taskRecordService.findById(id);
if (dto == null){
return new ResponseEntity<>(CommonResponse.createByError(ResponseCode.NO_RELEVANT_CONTENT_WAS_FOUND), HttpStatus.OK);
}
// (本次发送数目 + 最后一次发送数目) < 该任务课包总条数
// TODO: 2020/9/9 0009 编写相关逻辑代码
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("任务课包任务合并")
@ApiOperation("任务课包任务合并")
@PreAuthorize("@el.check('taskRecord:list')")

@ -61,27 +61,15 @@ public class SendRecordTask <T> {
// 遍历所有的待发送路径进行发送
readySendTasks.forEach(
task->{
String localFilePath = task.getLocalFilePath();
try {
// 先查数据库从上次该课包的指定行数开始继续读取指定的行,默认每次发送指定发送条数的数据
checkReadySendTotal();
List<String> lines = Files.readAllLines(Paths.get(task));
// 发送前已经通过前端接口进行发送数目合法性校验
List<String> lines = Files.readAllLines(Paths.get(localFilePath));
} catch (IOException e) {
log.error("read ready send file fail, send class is {}, ready send file path is {}", this.getClass().getName(), path, e);
log.error("read ready send file fail, send class is {}, ready send file path is {}", this.getClass().getName(), localFilePath, e);
}
}
);
//
}
/**
*
*/
private void checkReadySendTotal(){
}
}

Loading…
Cancel
Save