|
|
@ -58,6 +58,7 @@ import java.time.ZoneId; |
|
|
import java.time.format.DateTimeFormatter; |
|
|
import java.time.format.DateTimeFormatter; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
@Slf4j |
|
|
@Slf4j |
|
|
@ -786,7 +787,11 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
String textHead = headerData.getDelNo()+"【发票:"+ headerData.getCmcInvoice()+"】改单"; |
|
|
String textHead = headerData.getDelNo()+"【发票:"+ headerData.getCmcInvoice()+"】改单"; |
|
|
String[] mailAddress = coDelMapper.queryUsersByRoleName("关务仓库",headerData.getSite()).stream().map(SysUserEntity::getEmail).toArray(String[]::new); |
|
|
String[] mailAddress = coDelMapper.queryUsersByRoleName("关务仓库",headerData.getSite()).stream().map(SysUserEntity::getEmail).toArray(String[]::new); |
|
|
String[] mailAddress2 = new String[]{coDelMapper.queryByUserName(headerData.getCreateBy()).getEmail()}; |
|
|
String[] mailAddress2 = new String[]{coDelMapper.queryByUserName(headerData.getCreateBy()).getEmail()}; |
|
|
String[] mailAddressAll = ArrayUtils.addAll(mailAddress, mailAddress2); |
|
|
|
|
|
|
|
|
// 合并 + 去重 |
|
|
|
|
|
String[] mailAddressAll = Stream.concat(Arrays.stream(mailAddress), Arrays.stream(mailAddress2)) |
|
|
|
|
|
.filter(Objects::nonNull) // 防止 null |
|
|
|
|
|
.distinct() // 去重 |
|
|
|
|
|
.toArray(String[]::new); |
|
|
if (mailAddressAll.length>0) { |
|
|
if (mailAddressAll.length>0) { |
|
|
sendMailUtil(textHead, emailContent.toString(), mailAddressAll, headerData); |
|
|
sendMailUtil(textHead, emailContent.toString(), mailAddressAll, headerData); |
|
|
} |
|
|
} |
|
|
|