|
@@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
@@ -39,18 +40,18 @@ public class OcrGoodsServiceImpl implements OcrGoodsService {
|
|
|
@Autowired
|
|
|
private SubImgRetMapper subImgRetMapper;
|
|
|
|
|
|
+ @Async("recAndSaveExecutor")
|
|
|
@Override
|
|
|
public void recAndSave(OcrGoods ocrGoods) {
|
|
|
Map<String, Object> map = Maps.newHashMap();
|
|
|
map.put("upload_id", ocrGoods.getUploadId());
|
|
|
List<UpGoods> upGoods = upGoodsMapper.selectByMap(map);
|
|
|
- if (CollectionUtils.isNotEmpty(upGoods)) {
|
|
|
+ GoodsLog goodsLog = goodsLogMapper.selectById(ocrGoods.getUploadId());
|
|
|
+ if (goodsLog != null && CollectionUtils.isNotEmpty(upGoods)) {
|
|
|
+ goodsLog.setGStartTime(DateTimeUtils.dateTimeNow());
|
|
|
for (UpGoods ug : upGoods) {
|
|
|
startOcr(ocrGoods.getUploadId(), ug);
|
|
|
}
|
|
|
- }
|
|
|
- GoodsLog goodsLog = goodsLogMapper.selectById(ocrGoods.getUploadId());
|
|
|
- if (goodsLog != null) {
|
|
|
List<ErrGoods> errs = errGoodsMapper.selectByMap(map);
|
|
|
if (CollectionUtils.isNotEmpty(errs)) {
|
|
|
goodsLog.setGError(true);
|