|
|
@ -197,8 +197,9 @@ public class OcrService implements IOcrService { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public List<QuestionOcrVo.CodeAndAnswer> discernWords(List<MultipartFile> param, Long userId,Long firstAidId) throws IOException, ParseException { |
|
|
|
FirstAid firstAidInfo = firstAidDao.selectByPrimaryKey(firstAidId); |
|
|
|
public List<QuestionOcrVo.CodeAndAnswer> discernWords(List<MultipartFile> param, Long userId,Long projectId) throws IOException, ParseException { |
|
|
|
// FirstAid firstAidInfo = firstAidDao.selectByPrimaryKey(firstAidId);
|
|
|
|
FirstAid firstAidInfo = firstAidDao.queryByProjectId(projectId); |
|
|
|
if (ObjectUtil.isNull(firstAidInfo)) { |
|
|
|
throw new BaseException("急救信息错误"); |
|
|
|
} |
|
|
@ -219,7 +220,7 @@ public class OcrService implements IOcrService { |
|
|
|
int year = instance.get(Calendar.YEAR); |
|
|
|
|
|
|
|
//查询发病时间
|
|
|
|
Long time = firstAidRecordDao.queryDiseaseTime(firstAidId); |
|
|
|
Long time = firstAidRecordDao.queryDiseaseTime(firstAidInfo.getId()); |
|
|
|
|
|
|
|
//识别图片,放入文字集合
|
|
|
|
List<String> strList = new ArrayList<>(); |
|
|
@ -240,7 +241,7 @@ public class OcrService implements IOcrService { |
|
|
|
String extName = FileUtil.extName(file.getOriginalFilename()); |
|
|
|
String dir = PropUtil.path + File.separator + Constant.OrcImg.FILE_DIR; |
|
|
|
String extraPath = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
|
String path = extraPath + File.separator+firstAidId+firstAidInfo.getName()+File.separator+ IdUtil.simpleUUID() + "." + extName; |
|
|
|
String path = extraPath + File.separator+firstAidInfo.getId()+firstAidInfo.getName()+File.separator+ IdUtil.simpleUUID() + "." + extName; |
|
|
|
//转成file
|
|
|
|
File saveFile = new File(dir + extraPath); |
|
|
|
if (!saveFile.exists()) { |
|
|
|