| | |
| | | |
| | | import com.yc.crm.mail.entity.*; |
| | | import com.yc.crm.mail.service.MailAccountIfc; |
| | | import com.yc.crm.mail.service.MailFileIfc; |
| | | import com.yc.crm.mail.service.MailIfc; |
| | | import com.yc.crm.mail.service.MailServiceIfc; |
| | | import com.yc.crm.mail.util.AllBackMsg; |
| | |
| | | MailIfc emailIfc; |
| | | @Autowired |
| | | MailServiceIfc mailServiceIfc; |
| | | @Autowired |
| | | MailFileIfc mailFileIfc; |
| | | |
| | | private static final Pattern EMAIL_PATTERN = |
| | | Pattern.compile("^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$"); |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getMailList.do") |
| | | public AllBackMsg getMailList(String mail, @RequestParam(defaultValue = "1") Integer mailType, boolean isNoRead, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | public AllBackMsg getMailList(String mail, @RequestParam(defaultValue = "1") Integer mailType, |
| | | @RequestParam(defaultValue = "1") Integer page,@RequestParam(defaultValue = "20") Integer limit, boolean isNoRead, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | AllBackMsg msg = new AllBackMsg(); |
| | | try { |
| | | if (StringUtils.isNotBlank(mail)) { |
| | |
| | | } |
| | | DataSourceEntity dataSourceEntity = MultiDataSource.getDataSourceMap(request);//获取数据源信息 |
| | | SpObserver.setDBtoInstance("_" + dataSourceEntity.getDbId());//切换数据源 |
| | | List<t482101HList> t482101HEntityList = emailIfc.getReceivingMailList(mail, mailType, isNoRead, userCode); |
| | | List<t482101HList> t482101HEntityList = emailIfc.getReceivingMailList(mail, mailType, isNoRead, userCode,page,limit); |
| | | if (t482101HEntityList.size() > 0) { |
| | | msg.setSuccess("执行完成", t482101HEntityList); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getHandleMailList.do") |
| | | public AllBackMsg getHandleMailList(String mail, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | public AllBackMsg getHandleMailList(String mail,@RequestParam(defaultValue = "1") Integer page,@RequestParam(defaultValue = "20") Integer limit, |
| | | HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | AllBackMsg msg = new AllBackMsg(); |
| | | try { |
| | | if (StringUtils.isNotBlank(mail)) { |
| | |
| | | } |
| | | DataSourceEntity dataSourceEntity = MultiDataSource.getDataSourceMap(request);//获取数据源信息 |
| | | SpObserver.setDBtoInstance("_" + dataSourceEntity.getDbId());//切换数据源 |
| | | List<t482101HList> t482101HEntityList = emailIfc.getHandleMailList(mail, userCode); |
| | | List<t482101HList> t482101HEntityList = emailIfc.getHandleMailList(mail, userCode,page,limit); |
| | | if (t482101HEntityList.size() > 0) { |
| | | msg.setSuccess("执行完成", t482101HEntityList); |
| | | } |
| | |
| | | if (t482101HEntity != null) { |
| | | if (StringUtils.isNotBlank(t482101HEntity.getAttachmentList())) {//附件的处理 |
| | | //获取到附件内容 |
| | | List<AttachmentEntity> attachmentEntities = emailIfc.getAttachmentEntityList(t482101HEntity.getAttachmentList()); |
| | | List<AttachmentEntity> attachmentEntities = mailFileIfc.getAttachmentEntityList(t482101HEntity.getAttachmentList()); |
| | | List<String> list = new ArrayList<>(); |
| | | if (attachmentEntities.size() > 0) { |
| | | for (AttachmentEntity a : attachmentEntities) { |
| | | list.add(shoppingImageServer + "/uploads/attachment/" + dataSourceEntity.getDbId() + "/482101/" + a.getUnid() + "@p@" + a.getPhysicalFile()); |
| | | list.add(shoppingImageServer + "/uploads/email/" + dataSourceEntity.getDbId() + "/482101/" + a.getUnid() + "@p@" + a.getPhysicalFile()); |
| | | } |
| | | t482101HEntity.setAttachmentPath(list); |
| | | } |