master
周文涛 2 years ago
parent 03e46c3c39
commit 2609cc2e3b

@ -198,15 +198,6 @@ public class ApiController {
return JSONObject.parseObject("{\"requestId\":\"10001\",\"result\":{\"retrieveReviewCompliance\":\"80\",\"imageTagRetrievePercentage\":\"66.6\",\"failureReason\":\"图片不清晰\"}}");
}
//==========================================================================================
@ApiOperation(value = "刷新为完成的任务", notes = "任务完结通知")
@GetMapping("/test")
public Result test(){
JSONObject jsonObject=new JSONObject();
for (int i = 0; i < 100; i++) {
}
return Result.OK("111");
}
@ApiOperation(value = "刷新为完成的任务", notes = "任务完结通知")
@GetMapping("/restartTask")

@ -36,6 +36,10 @@ public class HandleTransInit implements ApplicationRunner {
TaskService taskService;
@Resource
IOcrIdentifyService ocrIdentifyService;
public static void main(String[] args) {
}
/**
*
*

@ -245,12 +245,18 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
updateWrapper.set(OcrIdentify::getEndTime, new Date());
updateWrapper.set(OcrIdentify::getStatus, "1");
super.update(updateWrapper);
//this.callbackWly(id);
this.callbackWly(id);
System.out.println("已通过一条!");
}
@Override
@Async
public void callbackWly(String ocrIdentifyId){
try {
Thread.sleep(10000l);
} catch (InterruptedException e) {
e.printStackTrace();
}
LambdaUpdateWrapper<OcrIdentify> updateWrapper = new LambdaUpdateWrapper<OcrIdentify>();
updateWrapper.eq(OcrIdentify::getId, ocrIdentifyId);
long time = new Date().getTime();

@ -40,17 +40,10 @@ public class TaskService {
//拼接子任务id
String taskId = null;
StringBuffer task_master = new StringBuffer();
for (int i = 0; i < identifyUrlList.size(); i++) {
taskId = String.format(id + "_" + (i + 1));
task_master.append(taskId).append(",");
}
//执行子任务.
JSONObject requestBody = new JSONObject();
TaskModel taskModel = new TaskModel();
if (identifyUrlList.size()>0) {
redisUtil.set("identify_" + id, task_master.toString());
TaskModel taskModel = new TaskModel();
for (int i = 0; i < identifyUrlList.size(); i++) {
taskId = String.format(id + "_" + (i + 1));
identifyUrl = identifyUrlList.get(i);
taskModel.setTaskId(taskId);
taskModel.setTaskType("identify");
@ -59,9 +52,10 @@ public class TaskService {
taskModel.setParameter(id + "," + taskId + "," + identifyUrl);
//保存子任务
saveTask(taskModel);
task_master.append(taskId).append(",");
}
redisUtil.set("identify_" + id, task_master.toString());
}
}
public Result saveTask(TaskModel taskModel) {

Loading…
Cancel
Save