邮箱采集-增加日志

release
zhenghaiyang@ele-cloud.com 2 years ago
parent 6e7df467bd
commit 8154749352
  1. 4
      dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java

@ -79,6 +79,7 @@ public class SnEmailGatherTask {
} }
log.info("邮箱采集接口执行结束--"); log.info("邮箱采集接口执行结束--");
} catch (Exception e) { } catch (Exception e) {
log.error("邮箱采集错误日志:{}", e);
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
log.info("邮箱采集--重置执行状态"); log.info("邮箱采集--重置执行状态");
@ -164,6 +165,7 @@ public class SnEmailGatherTask {
map.put("emailName",emailName); map.put("emailName",emailName);
String pdfStream = map.get("pdfStream"); String pdfStream = map.get("pdfStream");
if(StringUtils.isNotBlank(pdfStream)){ if(StringUtils.isNotBlank(pdfStream)){
log.debug("开始调用山能OCR识别---------");
List<OpenServiceOcr> openServiceOcrs = openServicePlatformService.ocrInvoice(pdfStream); List<OpenServiceOcr> openServiceOcrs = openServicePlatformService.ocrInvoice(pdfStream);
if(openServiceOcrs != null && !openServiceOcrs.isEmpty()){ if(openServiceOcrs != null && !openServiceOcrs.isEmpty()){
Map<String, Object> ocrResult = convertToOcrResult(openServiceOcrs, map, maintainVo); Map<String, Object> ocrResult = convertToOcrResult(openServiceOcrs, map, maintainVo);
@ -213,8 +215,10 @@ public class SnEmailGatherTask {
store.close(); store.close();
log.info("邮箱采集使用时间:{}",System.currentTimeMillis() - startTime); log.info("邮箱采集使用时间:{}",System.currentTimeMillis() - startTime);
} catch (MessagingException e) { } catch (MessagingException e) {
log.error("邮箱采集邮件解析异常:{}", e);
throw new RuntimeException(e); throw new RuntimeException(e);
} catch (IOException e) { } catch (IOException e) {
log.error("邮箱采集IO异常:{}", e);
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }

Loading…
Cancel
Save