From 188fae9227cdb30b7d6bdd479e71a9bef63ea009 Mon Sep 17 00:00:00 2001 From: LiuY <1622779752@qq.com> Date: Wed, 11 May 2022 09:47:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/mail/impl/MailServiceImpl.java | 57 ++++++++++--------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/main/java/cn/com/tenlion/systemoa/service/mail/impl/MailServiceImpl.java b/src/main/java/cn/com/tenlion/systemoa/service/mail/impl/MailServiceImpl.java index 058da88..5b73cdf 100644 --- a/src/main/java/cn/com/tenlion/systemoa/service/mail/impl/MailServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemoa/service/mail/impl/MailServiceImpl.java @@ -684,38 +684,41 @@ public class MailServiceImpl extends DefaultBaseService implements IMailService saveParam.put("recipientNames", recipientNames); // 处理抄送人 - saveParam.put("copyForIds", vo.getCopyForIds()); - String[] copyForArray = vo.getCopyForIds().split(","); - String copyForNames = ""; - for(String s : copyForArray){ - UserDTO userDTO = userService.get(s); - if(userDTO == null){ - continue; - } - if("".equals(copyForNames)){ - copyForNames += userDTO.getUserUsername() + "[" + userDTO.getUserName() + "]"; - } else { - copyForNames += "," + userDTO.getUserUsername() + "[" + userDTO.getUserName() + "]"; + if(vo.getCopyForIds() != null && !"".equals(vo.getCopyForIds())){ + saveParam.put("copyForIds", vo.getCopyForIds()); + String[] copyForArray = vo.getCopyForIds().split(","); + String copyForNames = ""; + for(String s : copyForArray){ + UserDTO userDTO = userService.get(s); + if(userDTO == null){ + continue; + } + if("".equals(copyForNames)){ + copyForNames += userDTO.getUserUsername() + "[" + userDTO.getUserName() + "]"; + } else { + copyForNames += "," + userDTO.getUserUsername() + "[" + userDTO.getUserName() + "]"; + } } + saveParam.put("copyForNames", copyForNames); } - saveParam.put("copyForNames", copyForNames); - // 处理密送 - saveParam.put("secretIds", vo.getSecretIds()); - String[] secretArray = vo.getSecretIds().split(","); - String secretNames = ""; - for(String s : secretArray){ - UserDTO userDTO = userService.get(s); - if(userDTO == null){ - continue; - } - if("".equals(secretNames)){ - secretNames += userDTO.getUserUsername() + "[" + userDTO.getUserName() + "]"; - } else { - secretNames += "," + userDTO.getUserUsername() + "[" + userDTO.getUserName() + "]"; + if(vo.getSecretIds() != null && !"".equals(vo.getSecretIds())){ + saveParam.put("secretIds", vo.getSecretIds()); + String[] secretArray = vo.getSecretIds().split(","); + String secretNames = ""; + for(String s : secretArray){ + UserDTO userDTO = userService.get(s); + if(userDTO == null){ + continue; + } + if("".equals(secretNames)){ + secretNames += userDTO.getUserUsername() + "[" + userDTO.getUserName() + "]"; + } else { + secretNames += "," + userDTO.getUserUsername() + "[" + userDTO.getUserName() + "]"; + } } + saveParam.put("secretNames", secretNames); } - saveParam.put("secretNames", secretNames); // 邮件内容 String uuid = UUIDUtil.getUUID(); saveParam.put("mailId", uuid);