fs-danaus
2024-09-14 eee9d75756cf93b5fdb7096c2747774cfd175eac
src/com/yc/crm/mail/action/MailController.java
@@ -16,6 +16,7 @@
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;
@@ -342,16 +343,22 @@
            //发送
            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();
        }