diff --git a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/mail/MailHttpHelper.java b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/mail/MailHttpHelper.java index 5190c15..24051d8 100644 --- a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/mail/MailHttpHelper.java +++ b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/mail/MailHttpHelper.java @@ -95,7 +95,7 @@ public class MailHttpHelper extends MailHelper{ StringBuilder str = new StringBuilder(); for (String s : content.split("")) { if (StringUtils.isNotBlank(str) && s.equals(" ")){ - this.fillMap(map,str.toString(),index); + this.fillMap(map,str.toString(),index,content); str = new StringBuilder(); index ++; continue; @@ -110,7 +110,7 @@ public class MailHttpHelper extends MailHelper{ } return map; } - private void fillMap(Map map,String msg,Integer index){ + private void fillMap(Map map,String msg,Integer index,String originStr){ switch (index){ case 1: map.put("学生姓名",msg); @@ -119,17 +119,34 @@ public class MailHttpHelper extends MailHelper{ map.put("省市",msg); break; case 3: + Boolean exist = Boolean.FALSE; for (String degree : degreeList) { if (msg.contains(degree)){ + exist = Boolean.TRUE; map.put("现有学历",msg); } } + if (!exist) { + for (String degree : degreeList) { + if (originStr.contains(degree)) { + map.put("现有学历", degree); + } + } + } break; case 4: + Boolean phoneExist = Boolean.FALSE; int startIndex = msg.indexOf("1"); if (startIndex >= 0 && msg.length() - startIndex >= 11){ + phoneExist = Boolean.TRUE; map.put("手机号码",msg.substring(startIndex,startIndex + 11)); } + if (!phoneExist) { + startIndex = originStr.indexOf("1"); + if (startIndex >= 0 && originStr.length() - startIndex >= 11) { + map.put("手机号码", originStr.substring(startIndex, startIndex + 11)); + } + } break; case 5: break; diff --git a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/mail/request/MailRequest.java b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/mail/request/MailRequest.java index e2d1ab3..dc5d3ae 100644 --- a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/mail/request/MailRequest.java +++ b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/mail/request/MailRequest.java @@ -49,6 +49,10 @@ public class MailRequest { * 是否需要反馈已读信息 */ private Boolean readFeedback; + /** + * 已读标记 + */ + private Boolean readFlag; private void fillDefault(Boolean readFeedback){ this.emailProtocol = "imap"; diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/MailInfoController.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/MailInfoController.java index 7f2f06f..ce1e489 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/MailInfoController.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/MailInfoController.java @@ -16,8 +16,8 @@ public class MailInfoController extends BaseController { private MailSyncTask mailSyncTask; @PostMapping("/syncEmail") - public void syncEmail() { - mailSyncTask.syncMail(); + public void syncEmail(Boolean readFlag) { + mailSyncTask.syncMail(readFlag); } } diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/MailSyncTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/MailSyncTask.java index 5a379dd..fba5f54 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/MailSyncTask.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/MailSyncTask.java @@ -38,8 +38,8 @@ public class MailSyncTask { @Autowired private LarkTableRelationMapper larkTableRelationMapper; - public void syncMail() { - log.info("MailSyncTask start"); + public void syncMail(Boolean readFlag) { + log.info("MailSyncTask start readFlag:{}",readFlag); MailInfo mailInfo = new MailInfo(); mailInfo.setFlag(FlagStatus.OK.getCode()); List mailInfos = iMailInfoService.selectMailInfoList(mailInfo); @@ -53,6 +53,7 @@ public class MailSyncTask { continue; } MailRequest request = new MailRequest(info, Boolean.TRUE); + request.setReadFlag(Boolean.TRUE.equals(readFlag)); mailHttpHelper.receiveMail(request,addRequest); } log.info("MailSyncTask end");