瀏覽代碼

LY 周会议

ly 1 年之前
父節點
當前提交
f0d5e7e515

+ 35 - 23
master/src/main/java/com/ruoyi/project/plant/controller/TMtMeetingController.java

@@ -9,13 +9,13 @@ import com.ruoyi.common.sendEmail.IMailService;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 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.TMtPersonMapper;
 import com.ruoyi.project.plant.service.*;
 import com.ruoyi.project.production.domain.TMonthplan;
 import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysUserService;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.xwpf.usermodel.*;
@@ -24,7 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 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.domain.AjaxResult;
 import com.ruoyi.common.utils.poi.ExcelUtil;
@@ -64,6 +63,10 @@ public class TMtMeetingController extends BaseController
     private ITMtPersonService tMtPersonService;
     @Autowired
     private IMailService mailService;
+    @Resource
+    private TMtPersonMapper tMtPersonMapper;
+    @Autowired
+    private ISysUserService sysUserService;
     //系统基础配置
     @Autowired
     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; \">" +
                 "<font color=\"#333333\" style=\"line-height: 20px; \"><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>" +
-                "请前往<a href=\"requestJumpPath/plant/meeting/detail/dailyId\">会议详情</a>查看或下载邮件附件。<br>" +
+                "请前往<a href=\"requestJumpPath/plant/meeting/meeting\">周历史会议</a>查看或下载邮件附件。<br>" +
                 "<p align=\"right\">date</p>" +
                 "<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;\">" +
@@ -394,8 +397,7 @@ public class TMtMeetingController extends BaseController
 
         String one = firstcenter.replaceFirst("meetingDate", formattedDate);
         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;
         //拼接html
         String html = start + prime + end;
@@ -410,25 +412,35 @@ public class TMtMeetingController extends BaseController
         ArrayList<String> emailList = 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()]);
         emailCc = emailCcList.toArray(new String[emailCcList.size()]);
         logger.info("发送人:" + email.toString());
         logger.info("抄送人:" + emailCc.toString());
-        mailService.sendAttachmentsMail(email, "CPMS:您有一条"+ formattedDate+"装置调度会议信息", html, emailCc,filePath);
+        mailService.sendAttachmentsMail(email, "CPMS:您有一条"+ formattedDate+"装置会议信息", html, emailCc,filePath);
         return AjaxResult.success();
     }
 

+ 2 - 3
master/src/main/java/com/ruoyi/project/plant/controller/TMtdDailyController.java

@@ -243,15 +243,14 @@ public class TMtdDailyController extends BaseController
         for (TMtdEmail t: list
         ) {
             SysUser user = sysUserService.selectUserByStaffId(t.getStaffid());
-            if (user != null) {
+            if (user != null && StringUtils.isNotEmpty(user.getEmail())) {
                 if (t.getType() == 1) {
                     emailList.add(user.getEmail());
                 }
-                if (t.getType() == 2) {
+                if (t.getType() == 2 && StringUtils.isNotEmpty(user.getEmail())) {
                     emailCcList.add(user.getEmail());
                 }
             }
-
         }
         email = emailList.toArray(new String[emailList.size()]);
         emailCc = emailCcList.toArray(new String[emailCcList.size()]);

+ 0 - 1
master/src/main/java/com/ruoyi/project/plant/mapper/TMtdItemMapper.java

@@ -26,7 +26,6 @@ public interface TMtdItemMapper
      * @param tMtdItem 调度会议详情
      * @return 调度会议详情集合
      */
-    @DataScope(deptAlias = "d")
     public List<TMtdItem> selectTMtdItemList(TMtdItem tMtdItem);
 
     /**

+ 2 - 2
ui/src/App.vue

@@ -1,9 +1,9 @@
 <template>
   <div id="app">
     <keep-alive>
-      <router-view v-if="$route.meta.keepAlive"></router-view>
+      <router-view ></router-view>
     </keep-alive>
-    <router-view v-if="!$route.meta.keepAlive"></router-view>
+<!--    <router-view v-if="!$route.meta.keepAlive"></router-view>-->
   </div>
 </template>
 

+ 1 - 1
ui/src/views/plant/hismeeting/index.vue

@@ -118,7 +118,7 @@
             type="text"
             icon="el-icon-mail"
             @click="handleMail(scope.row)"
-            v-hasPermi="['plant:dailyMeeting:edit']"
+            v-hasPermi="['plant:meeting:edit']"
           >发送邮件</el-button>
         </template>
       </el-table-column>