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);