|
@@ -29,13 +29,13 @@ import javax.mail.internet.MimeMessage;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 权限Service业务层处理
|
|
* 权限Service业务层处理
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @author dgtly
|
|
* @author dgtly
|
|
* @date 2022-03-22
|
|
* @date 2022-03-22
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
@Component
|
|
@Component
|
|
-public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
|
|
|
|
+public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
{
|
|
{
|
|
@Autowired
|
|
@Autowired
|
|
private SysUserOrderAuthorMapper sysUserOrderAuthorMapper;
|
|
private SysUserOrderAuthorMapper sysUserOrderAuthorMapper;
|
|
@@ -74,7 +74,7 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询权限
|
|
* 查询权限
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param authorId 权限ID
|
|
* @param authorId 权限ID
|
|
* @return 权限
|
|
* @return 权限
|
|
*/
|
|
*/
|
|
@@ -86,7 +86,7 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询权限列表
|
|
* 查询权限列表
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param sysUserOrderAuthor 权限
|
|
* @param sysUserOrderAuthor 权限
|
|
* @return 权限
|
|
* @return 权限
|
|
*/
|
|
*/
|
|
@@ -98,7 +98,7 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
|
|
|
|
/**
|
|
/**
|
|
* 新增权限
|
|
* 新增权限
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param sysUserOrderAuthor 权限
|
|
* @param sysUserOrderAuthor 权限
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@@ -111,7 +111,7 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
|
|
|
|
/**
|
|
/**
|
|
* 修改权限
|
|
* 修改权限
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param sysUserOrderAuthor 权限
|
|
* @param sysUserOrderAuthor 权限
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@@ -124,7 +124,7 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
|
|
|
|
/**
|
|
/**
|
|
* 删除权限对象
|
|
* 删除权限对象
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param ids 需要删除的数据ID
|
|
* @param ids 需要删除的数据ID
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@@ -136,7 +136,7 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
|
|
|
|
/**
|
|
/**
|
|
* 删除权限信息
|
|
* 删除权限信息
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param authorId 权限ID
|
|
* @param authorId 权限ID
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@@ -203,7 +203,7 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询权限树列表
|
|
* 查询权限树列表
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @return 所有权限信息
|
|
* @return 所有权限信息
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
@@ -564,6 +564,50 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void sendMailHanaWarning(String HanaName) {
|
|
|
|
+ // 1. 创建参数配置, 用于连接邮件服务器的参数配置
|
|
|
|
+ Properties props = new Properties(); // 参数配置
|
|
|
|
+ props.setProperty("mail.transport.protocol", "smtp"); // 使用的协议(JavaMail规范要求)
|
|
|
|
+ props.setProperty("mail.smtp.host", myEmailSMTPHost); // 发件人的邮箱的 SMTP 服务器地址
|
|
|
|
+ props.setProperty("mail.smtp.port", "25");
|
|
|
|
+ props.setProperty("mail.smtp.auth", "true"); // 需要请求认证
|
|
|
|
+ props.setProperty("mail.smtp.starttls.enable", "false"); // 需要请求认证
|
|
|
|
+ props.setProperty("mail.smtp.ssl.enable", "false"); // 需要请求认证
|
|
|
|
+ Set<String> sendEmailUser = getConfigValueSet("sendmailUnionUser");
|
|
|
|
+ Session session = Session.getDefaultInstance(props);
|
|
|
|
+ session.setDebug(true);
|
|
|
|
+
|
|
|
|
+ for (String email : sendEmailUser
|
|
|
|
+ ) {
|
|
|
|
+ Mail mail = new Mail();
|
|
|
|
+ try {
|
|
|
|
+ mail.setFrom(myEmailAccount);
|
|
|
|
+ mail.setTo(email);
|
|
|
|
+ mail.setSubject("Hana数据拉取异常");
|
|
|
|
+ mail.setContent(getHtmlHanaNameContextList(HanaName));
|
|
|
|
+ MimeMessage message = mailUtils.createMimeMessage(session, myEmailAccount, email, mail);
|
|
|
|
+
|
|
|
|
+ // 4. 根据 Session 获取邮件传输对象
|
|
|
|
+ Transport transport = session.getTransport();
|
|
|
|
+
|
|
|
|
+ transport.connect(myEmailAccount, myEmailPassword);
|
|
|
|
+
|
|
|
|
+ // 6. 发送邮件, 发到所有的收件地址, message.getAllRecipients() 获取到的是在创建邮件对象时添加的所有收件人, 抄送人, 密送人
|
|
|
|
+ transport.sendMessage(message, message.getAllRecipients());
|
|
|
|
+
|
|
|
|
+ // 7. 关闭连接
|
|
|
|
+ transport.close();
|
|
|
|
+ } catch (NoSuchProviderException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ } catch (MessagingException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void unionCustomerUser() {
|
|
public void unionCustomerUser() {
|
|
/* List<SysUser> userList = userMapper.selectAllUser();
|
|
/* List<SysUser> userList = userMapper.selectAllUser();
|
|
@@ -852,6 +896,26 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public String getHtmlHanaNameContextList(String hanaName) {
|
|
|
|
+
|
|
|
|
+ String str = "";
|
|
|
|
+
|
|
|
|
+ str += "<tr>" +
|
|
|
|
+ " <td>" + hanaName
|
|
|
|
+ + " </td>" +
|
|
|
|
+ "</tr>";
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ String html = "<table border='1' Cellspacing='0'>" +
|
|
|
|
+ " <tr>" +
|
|
|
|
+ " <th>Hana数据异常源名称</th>" +
|
|
|
|
+ " </tr>" +
|
|
|
|
+ str +
|
|
|
|
+ "</table>";
|
|
|
|
+
|
|
|
|
+ return html;
|
|
|
|
+ }
|
|
|
|
+
|
|
public String getHtmlUserContextList(List<UserVO> userList) {
|
|
public String getHtmlUserContextList(List<UserVO> userList) {
|
|
|
|
|
|
String str = "";
|
|
String str = "";
|