|
@@ -9,13 +9,13 @@ import com.ruoyi.common.sendEmail.IMailService;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
import com.ruoyi.framework.config.RuoYiConfig;
|
|
import com.ruoyi.framework.config.RuoYiConfig;
|
|
-import com.ruoyi.project.plant.domain.TMtOpextrack;
|
|
|
|
-import com.ruoyi.project.plant.domain.TMtdDaily;
|
|
|
|
-import com.ruoyi.project.plant.domain.TMtdEmail;
|
|
|
|
|
|
+import com.ruoyi.project.plant.domain.*;
|
|
import com.ruoyi.project.plant.mapper.TMtOpextrackMapper;
|
|
import com.ruoyi.project.plant.mapper.TMtOpextrackMapper;
|
|
|
|
+import com.ruoyi.project.plant.mapper.TMtPersonMapper;
|
|
import com.ruoyi.project.plant.service.*;
|
|
import com.ruoyi.project.plant.service.*;
|
|
import com.ruoyi.project.production.domain.TMonthplan;
|
|
import com.ruoyi.project.production.domain.TMonthplan;
|
|
import com.ruoyi.project.system.domain.SysUser;
|
|
import com.ruoyi.project.system.domain.SysUser;
|
|
|
|
+import com.ruoyi.project.system.service.ISysUserService;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
import org.apache.poi.xwpf.usermodel.*;
|
|
import org.apache.poi.xwpf.usermodel.*;
|
|
@@ -24,7 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
|
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
|
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
|
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
|
-import com.ruoyi.project.plant.domain.TMtMeeting;
|
|
|
|
import com.ruoyi.framework.web.controller.BaseController;
|
|
import com.ruoyi.framework.web.controller.BaseController;
|
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
@@ -64,6 +63,10 @@ public class TMtMeetingController extends BaseController
|
|
private ITMtPersonService tMtPersonService;
|
|
private ITMtPersonService tMtPersonService;
|
|
@Autowired
|
|
@Autowired
|
|
private IMailService mailService;
|
|
private IMailService mailService;
|
|
|
|
+ @Resource
|
|
|
|
+ private TMtPersonMapper tMtPersonMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ISysUserService sysUserService;
|
|
//系统基础配置
|
|
//系统基础配置
|
|
@Autowired
|
|
@Autowired
|
|
private RuoYiConfig ruoyiConfig;
|
|
private RuoYiConfig ruoyiConfig;
|
|
@@ -377,9 +380,9 @@ public class TMtMeetingController extends BaseController
|
|
String firstcenter = "<tr><td><div style=\"padding:25px 35px 40px; background-color:#fff;\"><h2 style=\"margin: 5px 0px; \">" +
|
|
String firstcenter = "<tr><td><div style=\"padding:25px 35px 40px; background-color:#fff;\"><h2 style=\"margin: 5px 0px; \">" +
|
|
"<font color=\"#333333\" style=\"line-height: 20px; \"><font style=\"line-height: 22px; \" size=\"4\">" +
|
|
"<font color=\"#333333\" style=\"line-height: 20px; \"><font style=\"line-height: 22px; \" size=\"4\">" +
|
|
"亲爱的 CPMS用户</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
|
|
"亲爱的 CPMS用户</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
|
|
- "<p>您有一条新的调度会议:<br>" +
|
|
|
|
|
|
+ "<p>您有一条新的周会议:<br>" +
|
|
"会议日期:<b>meetingDate</b><br>" +
|
|
"会议日期:<b>meetingDate</b><br>" +
|
|
- "请前往<a href=\"requestJumpPath/plant/meeting/detail/dailyId\">会议详情</a>查看或下载邮件附件。<br>" +
|
|
|
|
|
|
+ "请前往<a href=\"requestJumpPath/plant/meeting/meeting\">周历史会议</a>查看或下载邮件附件。<br>" +
|
|
"<p align=\"right\">date</p>" +
|
|
"<p align=\"right\">date</p>" +
|
|
"<div style=\"width:700px;margin:0 auto;\">" +
|
|
"<div style=\"width:700px;margin:0 auto;\">" +
|
|
"<div style=\"padding:10px 10px 0;border-top:1px solid #ccc;color:#747474;margin-bottom:20px;line-height:1.3em;font-size:12px;\">" +
|
|
"<div style=\"padding:10px 10px 0;border-top:1px solid #ccc;color:#747474;margin-bottom:20px;line-height:1.3em;font-size:12px;\">" +
|
|
@@ -394,8 +397,7 @@ public class TMtMeetingController extends BaseController
|
|
|
|
|
|
String one = firstcenter.replaceFirst("meetingDate", formattedDate);
|
|
String one = firstcenter.replaceFirst("meetingDate", formattedDate);
|
|
String two = one.replace("requestJumpPath", this.ruoyiConfig.getRequestJumpPath());
|
|
String two = one.replace("requestJumpPath", this.ruoyiConfig.getRequestJumpPath());
|
|
- String three = two.replace("dailyId", mtMeeting.getId().toString());
|
|
|
|
- String result = three.replaceFirst("date", dateFormat.format(new Date()));
|
|
|
|
|
|
+ String result = two.replaceFirst("date", dateFormat.format(new Date()));
|
|
prime = prime + result;
|
|
prime = prime + result;
|
|
//拼接html
|
|
//拼接html
|
|
String html = start + prime + end;
|
|
String html = start + prime + end;
|
|
@@ -410,25 +412,35 @@ public class TMtMeetingController extends BaseController
|
|
ArrayList<String> emailList = new ArrayList<>();
|
|
ArrayList<String> emailList = new ArrayList<>();
|
|
ArrayList<String> emailCcList = new ArrayList<>();
|
|
ArrayList<String> emailCcList = new ArrayList<>();
|
|
|
|
|
|
-// List<TMtdEmail> list = tMtdEmailService.selectTMtdEmailList(new TMtdEmail());
|
|
|
|
-// for (TMtdEmail t: list
|
|
|
|
-// ) {
|
|
|
|
-// SysUser user = sysUserService.selectUserByStaffId(t.getStaffid());
|
|
|
|
-// if (user != null) {
|
|
|
|
-// if (t.getType() == 1) {
|
|
|
|
-// emailList.add(user.getEmail());
|
|
|
|
-// }
|
|
|
|
-// if (t.getType() == 2) {
|
|
|
|
-// emailCcList.add(user.getEmail());
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
|
|
+ //邮件发送人
|
|
|
|
+ TMtPerson tMtPerson = new TMtPerson();
|
|
|
|
+ tMtPerson.setMeetingId(mtMeeting.getId());
|
|
|
|
+ tMtPerson.setIsCc(0l);
|
|
|
|
+ List<TMtPerson> personList = tMtPersonMapper.selectTMtPersonList(tMtPerson);
|
|
|
|
+ for (TMtPerson t :personList
|
|
|
|
+ ) {
|
|
|
|
+ SysUser user = sysUserService.selectUserByStaffId(t.getStaffid());
|
|
|
|
+ if (user != null && StringUtils.isNotEmpty(user.getEmail())) {
|
|
|
|
+ emailList.add(user.getEmail());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //邮件抄送人
|
|
|
|
+ tMtPerson.setIsCc(1l);
|
|
|
|
+ List<TMtPerson> personCcList = tMtPersonMapper.selectTMtPersonList(tMtPerson);
|
|
|
|
+ for (TMtPerson t :personCcList
|
|
|
|
+ ) {
|
|
|
|
+ SysUser user = sysUserService.selectUserByStaffId(t.getStaffid());
|
|
|
|
+ if (user != null && StringUtils.isNotEmpty(user.getEmail())) {
|
|
|
|
+ emailCcList.add(user.getEmail());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
email = emailList.toArray(new String[emailList.size()]);
|
|
email = emailList.toArray(new String[emailList.size()]);
|
|
emailCc = emailCcList.toArray(new String[emailCcList.size()]);
|
|
emailCc = emailCcList.toArray(new String[emailCcList.size()]);
|
|
logger.info("发送人:" + email.toString());
|
|
logger.info("发送人:" + email.toString());
|
|
logger.info("抄送人:" + emailCc.toString());
|
|
logger.info("抄送人:" + emailCc.toString());
|
|
- mailService.sendAttachmentsMail(email, "CPMS:您有一条"+ formattedDate+"装置调度会议信息", html, emailCc,filePath);
|
|
|
|
|
|
+ mailService.sendAttachmentsMail(email, "CPMS:您有一条"+ formattedDate+"装置周会议信息", html, emailCc,filePath);
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
|
|
|