| | |
| | | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.mail.MessagingException; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.servlet.http.HttpSession; |
| | |
| | | //发送 |
| | | mailServiceIfc.sendEmails(t482101H, request); |
| | | msg.setOk("发送成功"); |
| | | } catch (Exception e) { |
| | | } catch (MessagingException e) { |
| | | String error = e.getCause() != null ? e.getCause().getMessage() : e.getMessage(); |
| | | String[] arrayError = error.split("#"); |
| | | if (arrayError.length == 2) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("docCode", arrayError[1]); |
| | | msg.setError(arrayError[0], map); |
| | | if (StringUtils.isNotBlank(error)) { |
| | | String[] arrayError = error.split("#"); |
| | | if (arrayError.length == 2) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("docCode", arrayError[1]); |
| | | msg.setError(arrayError[0], map); |
| | | } else { |
| | | msg.setFail(error); |
| | | } |
| | | } else { |
| | | msg.setFail(error); |
| | | } |
| | | } catch (Exception e) { |
| | | msg.setFail(e.getCause() != null ? e.getCause().getMessage() : e.getMessage()); |
| | | } finally { |
| | | SpObserver.setDBtoInstance(); |
| | | } |