优化执行任务逻辑
devhuozheluoji
周文涛 2 years ago
parent 09fe33ce1e
commit 96573a1c92

@ -96,6 +96,9 @@ public class HandleTaskInit implements ApplicationRunner {
//把过去执行过的明细给删掉
ocrIdentifyDetailService.deleteByOcrIdentifyId(ocrIdentify.getId());
//更新开始时间
ocrIdentifyService.updateMasterTaskStartTime(ocrIdentify.getId());
//最终要请求ocr识别的图片对象
JSONObject requestBody = new JSONObject();
if (onlineFile) {

@ -49,6 +49,12 @@ public interface IOcrIdentifyService extends IService<OcrIdentify> {
*/
Result pushTask(JSONObject jsonObject);
/**
*
*/
void updateOcrIdentifyStartTime(String id);
@Deprecated
void updateMasterTaskStartTime(String id);
/**

@ -656,6 +656,15 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
return Result.OK("已追加到任务");
}
@Override
public void updateOcrIdentifyStartTime(String id) {
LambdaUpdateWrapper<OcrIdentify> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(OcrIdentify::getStartTime, new Date());
updateWrapper.set(OcrIdentify::getEndTime,null);
updateWrapper.eq(OcrIdentify::getId, id);
super.update(updateWrapper);
}
@Override
public void updateMasterTaskStartTime(String id) {
LambdaUpdateWrapper<OcrIdentify> updateWrapper = new LambdaUpdateWrapper<>();

Loading…
Cancel
Save