|
|
@ -1,6 +1,7 @@
|
|
|
|
package com.hw.system.common.service.impl;
|
|
|
|
package com.hw.system.common.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import java.rmi.ServerException;
|
|
|
|
import java.rmi.ServerException;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
@ -137,8 +138,6 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService {
|
|
|
|
emailAccount = emailAccountInfo.substring(0, splitIndex);
|
|
|
|
emailAccount = emailAccountInfo.substring(0, splitIndex);
|
|
|
|
emailPassword = emailAccountInfo.substring(splitIndex + 1);
|
|
|
|
emailPassword = emailAccountInfo.substring(splitIndex + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
System.out.println(emailAccount+"e:"+emailPassword);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SysPointRouter queryPointRouter = new SysPointRouter();
|
|
|
|
SysPointRouter queryPointRouter = new SysPointRouter();
|
|
|
|
List<SysPointRouter> sysPointRouterList = sysPointRouterMapper.selectEmailNotifySysPointRouterList(queryPointRouter);
|
|
|
|
List<SysPointRouter> sysPointRouterList = sysPointRouterMapper.selectEmailNotifySysPointRouterList(queryPointRouter);
|
|
|
@ -146,12 +145,31 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService {
|
|
|
|
Map<Long, List<SysPointRouter>> sysPointRouterMap = sysPointRouterList.stream()
|
|
|
|
Map<Long, List<SysPointRouter>> sysPointRouterMap = sysPointRouterList.stream()
|
|
|
|
.filter(spo -> spo.getProcessActivityId() != null).collect(Collectors.groupingBy(SysPointRouter::getProcessActivityId));
|
|
|
|
.filter(spo -> spo.getProcessActivityId() != null).collect(Collectors.groupingBy(SysPointRouter::getProcessActivityId));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String emailTitle = "";
|
|
|
|
|
|
|
|
List<String> emailTitleList = new ArrayList<>();
|
|
|
|
for (Long processActivityId : sysPointRouterMap.keySet()) {
|
|
|
|
for (Long processActivityId : sysPointRouterMap.keySet()) {
|
|
|
|
List<SysPointRouter> sysPointRoutersByActivityList = sysPointRouterMap.get(processActivityId);
|
|
|
|
List<SysPointRouter> sysPointRoutersByActivityList = sysPointRouterMap.get(processActivityId);
|
|
|
|
List<SysUser> sysUsers = sysUserMapper.selectProcessActivityAuthUserList(processActivityId);
|
|
|
|
List<SysUser> sysUsers = sysUserMapper.selectProcessActivityAuthUserList(processActivityId);
|
|
|
|
String sendMsg = "";
|
|
|
|
String sendMsg = "";
|
|
|
|
|
|
|
|
String colon = ":";
|
|
|
|
for (SysPointRouter sysPointRouter : sysPointRoutersByActivityList) {
|
|
|
|
for (SysPointRouter sysPointRouter : sysPointRoutersByActivityList) {
|
|
|
|
sendMsg += sysPointRouter.getRemark() + ";";
|
|
|
|
String remark = sysPointRouter.getRemark();
|
|
|
|
|
|
|
|
int colonIndex = remark.indexOf(colon);
|
|
|
|
|
|
|
|
if (colonIndex >= 0) {
|
|
|
|
|
|
|
|
emailTitle = remark.substring(0, colonIndex);
|
|
|
|
|
|
|
|
remark = remark.replaceFirst(colon, "\n\n");
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
emailTitle = remark;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
emailTitle = emailTitle.length() > 30 ? emailTitle.substring(0, 30) : emailTitle;
|
|
|
|
|
|
|
|
if (!emailTitleList.contains(emailTitle)) {
|
|
|
|
|
|
|
|
emailTitleList.add(emailTitle);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
remark = remark.replaceAll(";", "\n\n");
|
|
|
|
|
|
|
|
sendMsg += remark + "\n\n";
|
|
|
|
sysPointRouter.setSentEmailFlag("1");
|
|
|
|
sysPointRouter.setSentEmailFlag("1");
|
|
|
|
sysPointRouter.setUpdateTime(new Date());
|
|
|
|
sysPointRouter.setUpdateTime(new Date());
|
|
|
|
// sysPointRouter.setUpdateBy(SecurityUtils.getLoginUser().getNickname());
|
|
|
|
// sysPointRouter.setUpdateBy(SecurityUtils.getLoginUser().getNickname());
|
|
|
@ -160,7 +178,7 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService {
|
|
|
|
|
|
|
|
|
|
|
|
for (SysUser sysUser : sysUsers) {
|
|
|
|
for (SysUser sysUser : sysUsers) {
|
|
|
|
if (StringUtils.isNotEmpty(sysUser.getEmail())) {
|
|
|
|
if (StringUtils.isNotEmpty(sysUser.getEmail())) {
|
|
|
|
MailUtils.processSendEmail(emailAccount,emailPassword,sysUser.getEmail(), "通知", sendMsg);
|
|
|
|
MailUtils.processSendEmail(emailAccount, emailPassword, sysUser.getEmail(), emailTitleList.toString(), sendMsg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|