执行任务的流程逻辑 变更
devhuozheluoji
周文涛 2 years ago
parent 9286533797
commit 09fe33ce1e

@ -9,6 +9,7 @@ import org.jeecg.common.util.AssertUtils;
import org.jeecg.common.util.RestUtil; import org.jeecg.common.util.RestUtil;
import org.jeecg.modules.ocr.dto.OcrIdentifyDTO; import org.jeecg.modules.ocr.dto.OcrIdentifyDTO;
import org.jeecg.modules.ocr.entity.OcrIdentify; import org.jeecg.modules.ocr.entity.OcrIdentify;
import org.jeecg.modules.ocr.service.IOcrIdentifyDetailService;
import org.jeecg.modules.ocr.service.IOcrIdentifyService; import org.jeecg.modules.ocr.service.IOcrIdentifyService;
import org.jeecg.modules.ocr.service.impl.TaskService; import org.jeecg.modules.ocr.service.impl.TaskService;
import org.jeecg.modules.ocr.utils.FileOUtils; import org.jeecg.modules.ocr.utils.FileOUtils;
@ -36,6 +37,8 @@ public class HandleTaskInit implements ApplicationRunner {
@Resource @Resource
IOcrIdentifyService ocrIdentifyService; IOcrIdentifyService ocrIdentifyService;
@Resource @Resource
IOcrIdentifyDetailService ocrIdentifyDetailService;
@Resource
TaskService taskService; TaskService taskService;
@Resource @Resource
private ISysDictService sysDictService; private ISysDictService sysDictService;
@ -90,6 +93,9 @@ public class HandleTaskInit implements ApplicationRunner {
//判断是不是网络图片 //判断是不是网络图片
Boolean onlineFile = FileOUtils.isOnlineFile(ocrIdentify.getIdentifyUrl()); Boolean onlineFile = FileOUtils.isOnlineFile(ocrIdentify.getIdentifyUrl());
//把过去执行过的明细给删掉
ocrIdentifyDetailService.deleteByOcrIdentifyId(ocrIdentify.getId());
//最终要请求ocr识别的图片对象 //最终要请求ocr识别的图片对象
JSONObject requestBody = new JSONObject(); JSONObject requestBody = new JSONObject();
if (onlineFile) { if (onlineFile) {

@ -18,4 +18,6 @@ public interface IOcrIdentifyDetailService extends IService<OcrIdentifyDetail> {
* @return * @return
*/ */
List<OcrIdentifyDetail> listByIdentifyId(String identifyId); List<OcrIdentifyDetail> listByIdentifyId(String identifyId);
boolean deleteByOcrIdentifyId(String id);
} }

@ -23,4 +23,11 @@ public class OcrIdentifyDetailServiceImpl extends ServiceImpl<OcrIdentifyDetailM
List<OcrIdentifyDetail> list = super.list(new LambdaQueryWrapper<OcrIdentifyDetail>().eq(OcrIdentifyDetail::getIdentifyId, identifyId)); List<OcrIdentifyDetail> list = super.list(new LambdaQueryWrapper<OcrIdentifyDetail>().eq(OcrIdentifyDetail::getIdentifyId, identifyId));
return list; return list;
} }
@Override
public boolean deleteByOcrIdentifyId(String identifyId) {
LambdaQueryWrapper<OcrIdentifyDetail> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(OcrIdentifyDetail::getIdentifyId,identifyId);
return this.remove(queryWrapper);
}
} }

Loading…
Cancel
Save