فهرست منبع

修改预约开票邮件发送规则
修改装置经理装置工程师查询范围
修复了目标协议-判定标准中出现","的问题

jiangbiao 2 سال پیش
والد
کامیت
3038211571

+ 38 - 2
master/src/main/java/com/ruoyi/project/invoice/controller/TApproveReserveInvoiceController.java

@@ -15,6 +15,8 @@ import com.ruoyi.project.invoice.mapper.TInvoiceWorkcontentMapper;
 import com.ruoyi.project.invoice.service.ITApproveReserveInvoiceService;
 import com.ruoyi.project.invoice.service.ITInvoiceBookingworkticketService;
 import com.ruoyi.project.listener.invoiceApprove.*;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysUserService;
 import org.activiti.engine.ProcessEngine;
 import org.activiti.engine.ProcessEngines;
 import org.activiti.engine.RuntimeService;
@@ -22,6 +24,7 @@ import org.activiti.engine.TaskService;
 import org.activiti.engine.impl.identity.Authentication;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -50,6 +53,9 @@ public class TApproveReserveInvoiceController extends BaseController {
     @Autowired
     private TInvoiceWorkcontentMapper invoiceWorkcontentMapper;
 
+    @Autowired
+    private ISysUserService iSysUserService;
+
 
     /**
      * 查询预约开票申请列表
@@ -163,11 +169,35 @@ public class TApproveReserveInvoiceController extends BaseController {
         variables.put("applyUser", userid.toString());
         variables.put("yhzgusers", tApproveReserveInvoice.getUserSupId().toString());//用户主管
         variables.put("zzzgusers", devSupId);//装置主管
+        SysUser sysUser = new SysUser();
+        sysUser.setDeptId(103L);
         if ("1".equals(tApproveReserveInvoice.getIsToday())) {
-            variables.put("zzgcsusers", tApproveReserveInvoice.getDevEngineerId().toString());//装置工程师
+            String devEngineerId="";
+            sysUser.setRoleId(20003L);//装置工程师
+            List<SysUser> sysUsers = iSysUserService.selectUserListByRoleAndDept(sysUser);
+            if (CollectionUtils.isNotEmpty(sysUsers))  {
+                for (SysUser user : sysUsers) {
+                    devEngineerId+=user.getUserId()+",";
+                }
+                devEngineerId = devEngineerId.substring(0, devEngineerId.length() - 1);
+                variables.put("zzgcsusers", devEngineerId);//装置工程师
+            }else{
+                return AjaxResult.error("该部门不存在装置工程师");
+            }
         }
         if ("1".equals(tApproveReserveInvoice.getIsSpecial())) {
-            variables.put("zzjlusers", tApproveReserveInvoice.getManagerconId().toString());//装置经理
+            String managerconId="";
+            sysUser.setRoleId(20006L);//装置经理
+            List<SysUser> sysUsers = iSysUserService.selectUserListByRoleAndDept(sysUser);
+            if (CollectionUtils.isNotEmpty(sysUsers)) {
+                for (SysUser user : sysUsers) {
+                    managerconId+=user.getUserId()+",";
+                }
+                managerconId = managerconId.substring(0, managerconId.length() - 1);
+                variables.put("zzjlusers", managerconId);//装置经理
+            }else{
+                return AjaxResult.error("该部门不存在装置经理");
+            }
         }
         variables.put("yhzgTaskCreateListener", new YhzgTaskCreateListener());//用户主管监听发送邮件
         variables.put("zzzgTaskCreateListener", new ZzzgTaskCreateListener());//装置主管监听发送邮件
@@ -214,6 +244,12 @@ public class TApproveReserveInvoiceController extends BaseController {
         if (task.getName().equals("装置主管签字确认")) {
             invoice.setDevSupId(getUserId());
         }
+        if (task.getName().equals("装置工程师签字确认")) {
+            invoice.setDevEngineerId(getUserId());
+        }
+        if (task.getName().equals("装置经理签字确认")) {
+            invoice.setManagerconId(getUserId());
+        }
         if (DateUtils.dateTime(invoiceBook.getCreatedate()).equals(DateUtils.dateTime(invoiceBook.getWorkStartTime()))) {
             param.put("istoday", "1");
         } else {

+ 46 - 44
master/src/main/java/com/ruoyi/project/listener/invoiceApprove/ZzgcsTaskCreateListener.java

@@ -28,53 +28,55 @@ public class ZzgcsTaskCreateListener implements Serializable, TaskListener {
         ITApproveReserveInvoiceService tApproveReserveInvoiceService = (ITApproveReserveInvoiceService) SpringContextUtils.getBean("tApproveReserveInvoiceService");
         ISysUserService sysUserService = (ISysUserService) SpringContextUtils.getBean("sysUserService");
         IMailService mailService = (IMailService) SpringContextUtils.getBean("mailService");
-        TApproveReserveInvoice approveEntity = tApproveReserveInvoiceService.selectTApproveReserveInvoiceById(Long.parseLong(id)) ;
+        TApproveReserveInvoice approveEntity = tApproveReserveInvoiceService.selectTApproveReserveInvoiceById(Long.parseLong(id));
         logger.info("approveEntity:" + approveEntity);
         //发送邮件
         try {
-            String email = sysUserService.selectUserById(Long.parseLong(zzgcsusers)).getEmail();
-            String apNo = approveEntity.getApNo();
-            logger.info("apNo:" + apNo);
-            String username = sysUserService.selectUserById(Long.parseLong(zzgcsusers)).getNickName();
-            String usernameEN = PinyinHelper.convertToPinyinString(username, " ", PinyinFormat.WITHOUT_TONE);
-            logger.info("email:" + email);
-            logger.info("username:" + username);
-            //写html开始内容
-            String start = "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title></title></head><body><div style=\"background-color:#ECECEC; padding: 35px;\">" +
-                    "<table cellpadding=\"0\" align=\"center\"" +
-                    "style=\"width: 600px; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family:微软雅黑, 黑体; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial;background:#fff;\">" +
-                    "<tbody><tr><th valign=\"middle\" style=\"height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #42a3d3; background-color: #49bcff; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">" +
-                    "<font face=\"微软雅黑\" size=\"5\" style=\"color: rgb(255, 255, 255); \">预约开票管理系统 </font><font face=\"微软雅黑\" size=\"3\" style=\"color: rgb(255, 255, 255); \">Reserve Invoice</font></th></tr>";
-            //表html中间内容
-            String prime = "";
-            String center = "<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\">" +
-                    "亲爱的 username</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
-                    "Dear usernameEN</font></font></h2>" +
-                    "<p>您有一个新的待办任务:<br>" +
-                    "You have a new to-do task:<br>" +
-                    "任务编号:<b>apNo</b><br>" +
-                    "Task Number: <b>apNoEN</b><br>" +
-                    "请登录<a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">预约开票申请流程</a>查看。<br>" +
-                    "Please log in the <a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">InvoiceApprove</a> to handle it.</p>" +
-                    "<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;\">" +
-                    "<p>此为系统邮件,请勿回复<br>This e-Mail is an automatic reminder sent by SEMS, please do not reply</p>" +
-                    "</div></div></div></td></tr>";
-            String one = center.replaceFirst("username", username);
-            String two = one.replaceFirst("usernameEN", usernameEN);
-            String four = two.replaceFirst("apNo", apNo);
-            String five = four.replaceFirst("apNoEN", apNo);
-            String result = five.replaceFirst("date", String.valueOf(new Date()));
-            prime = prime + result;
-            //写html结尾内容
-            String end = "</tbody></table></div></body></html>";
-            //拼接html
-            String html = start + prime + end;
-            logger.info("html:" + html);
-            //mailService.sendHtmlMail(email, "预约开票:您有一个新的待办任务 Reserve Invoice:You have a new to-do task (" + apNo + ")", html);
-        }catch (Exception e) {
+            for (String zzgcsuser : zzgcsusers.split(",")) {
+                String email = sysUserService.selectUserById(Long.parseLong(zzgcsuser)).getEmail();
+                String apNo = approveEntity.getApNo();
+                logger.info("apNo:" + apNo);
+                String username = sysUserService.selectUserById(Long.parseLong(zzgcsuser)).getNickName();
+                String usernameEN = PinyinHelper.convertToPinyinString(username, " ", PinyinFormat.WITHOUT_TONE);
+                logger.info("email:" + email);
+                logger.info("username:" + username);
+                //写html开始内容
+                String start = "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title></title></head><body><div style=\"background-color:#ECECEC; padding: 35px;\">" +
+                        "<table cellpadding=\"0\" align=\"center\"" +
+                        "style=\"width: 600px; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family:微软雅黑, 黑体; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial;background:#fff;\">" +
+                        "<tbody><tr><th valign=\"middle\" style=\"height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #42a3d3; background-color: #49bcff; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">" +
+                        "<font face=\"微软雅黑\" size=\"5\" style=\"color: rgb(255, 255, 255); \">预约开票管理系统 </font><font face=\"微软雅黑\" size=\"3\" style=\"color: rgb(255, 255, 255); \">Reserve Invoice</font></th></tr>";
+                //表html中间内容
+                String prime = "";
+                String center = "<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\">" +
+                        "亲爱的 username</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
+                        "Dear usernameEN</font></font></h2>" +
+                        "<p>您有一个新的待办任务:<br>" +
+                        "You have a new to-do task:<br>" +
+                        "任务编号:<b>apNo</b><br>" +
+                        "Task Number: <b>apNoEN</b><br>" +
+                        "请登录<a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">预约开票申请流程</a>查看。<br>" +
+                        "Please log in the <a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">InvoiceApprove</a> to handle it.</p>" +
+                        "<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;\">" +
+                        "<p>此为系统邮件,请勿回复<br>This e-Mail is an automatic reminder sent by SEMS, please do not reply</p>" +
+                        "</div></div></div></td></tr>";
+                String one = center.replaceFirst("username", username);
+                String two = one.replaceFirst("usernameEN", usernameEN);
+                String four = two.replaceFirst("apNo", apNo);
+                String five = four.replaceFirst("apNoEN", apNo);
+                String result = five.replaceFirst("date", String.valueOf(new Date()));
+                prime = prime + result;
+                //写html结尾内容
+                String end = "</tbody></table></div></body></html>";
+                //拼接html
+                String html = start + prime + end;
+                logger.info("html:" + html);
+//                mailService.sendHtmlMail(email, "预约开票:您有一个新的待办任务 Reserve Invoice:You have a new to-do task (" + apNo + ")", html);
+            }
+        } catch (Exception e) {
             logger.error("邮件发送失败" + JSON.toJSONString(e));
         }
     }

+ 46 - 45
master/src/main/java/com/ruoyi/project/listener/invoiceApprove/ZzjlTaskCreateListener.java

@@ -28,55 +28,56 @@ public class ZzjlTaskCreateListener implements Serializable, TaskListener {
         ITApproveReserveInvoiceService tApproveReserveInvoiceService = (ITApproveReserveInvoiceService) SpringContextUtils.getBean("tApproveReserveInvoiceService");
         ISysUserService sysUserService = (ISysUserService) SpringContextUtils.getBean("sysUserService");
         IMailService mailService = (IMailService) SpringContextUtils.getBean("mailService");
-        TApproveReserveInvoice approveEntity = tApproveReserveInvoiceService.selectTApproveReserveInvoiceById(Long.parseLong(id)) ;
+        TApproveReserveInvoice approveEntity = tApproveReserveInvoiceService.selectTApproveReserveInvoiceById(Long.parseLong(id));
         logger.info("approveEntity:" + approveEntity);
         //发送邮件
         try {
-            String email = sysUserService.selectUserById(Long.parseLong(zzjlusers)).getEmail();
-            String apNo = approveEntity.getApNo();
-            logger.info("apNo:" + apNo);
-            String username = sysUserService.selectUserById(Long.parseLong(zzjlusers)).getNickName();
-            String usernameEN = PinyinHelper.convertToPinyinString(username, " ", PinyinFormat.WITHOUT_TONE);
-            logger.info("email:" + email);
-            logger.info("username:" + username);
-            //写html开始内容
-            String start = "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title></title></head><body><div style=\"background-color:#ECECEC; padding: 35px;\">" +
-                    "<table cellpadding=\"0\" align=\"center\"" +
-                    "style=\"width: 600px; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family:微软雅黑, 黑体; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial;background:#fff;\">" +
-                    "<tbody><tr><th valign=\"middle\" style=\"height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #42a3d3; background-color: #49bcff; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">" +
-                    "<font face=\"微软雅黑\" size=\"5\" style=\"color: rgb(255, 255, 255); \">预约开票管理系统 </font><font face=\"微软雅黑\" size=\"3\" style=\"color: rgb(255, 255, 255); \">Reserve Invoice</font></th></tr>";
-            //表html中间内容
-            String prime = "";
-            String center = "<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\">" +
-                    "亲爱的 username</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
-                    "Dear usernameEN</font></font></h2>" +
-                    "<p>您有一个新的待办任务:<br>" +
-                    "You have a new to-do task:<br>" +
-                    "任务编号:<b>apNo</b><br>" +
-                    "Task Number: <b>apNoEN</b><br>" +
-                    "请登录<a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">预约开票申请流程</a>查看。<br>" +
-                    "Please log in the <a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">InvoiceApprove</a> to handle it.</p>" +
-                    "<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;\">" +
-                    "<p>此为系统邮件,请勿回复<br>This e-Mail is an automatic reminder sent by SEMS, please do not reply</p>" +
-                    "</div></div></div></td></tr>";
-            String one = center.replaceFirst("username", username);
-            String two = one.replaceFirst("usernameEN", usernameEN);
-            String four = two.replaceFirst("apNo", apNo);
-            String five = four.replaceFirst("apNoEN", apNo);
-            String result = five.replaceFirst("date", String.valueOf(new Date()));
-            prime = prime + result;
-            //写html结尾内容
-            String end = "</tbody></table></div></body></html>";
-            //拼接html
-            String html = start + prime + end;
-            logger.info("html:" + html);
-           // mailService.sendHtmlMail(email, "预约开票:您有一个新的待办任务 Reserve Invoice:You have a new to-do task (" + apNo + ")", html);
-        }catch (Exception e) {
+            for (String zzjluser : zzjlusers.split(",")) {
+                String email = sysUserService.selectUserById(Long.parseLong(zzjluser)).getEmail();
+                String apNo = approveEntity.getApNo();
+                logger.info("apNo:" + apNo);
+                String username = sysUserService.selectUserById(Long.parseLong(zzjlusers)).getNickName();
+                String usernameEN = PinyinHelper.convertToPinyinString(username, " ", PinyinFormat.WITHOUT_TONE);
+                logger.info("email:" + email);
+                logger.info("username:" + username);
+                //写html开始内容
+                String start = "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title></title></head><body><div style=\"background-color:#ECECEC; padding: 35px;\">" +
+                        "<table cellpadding=\"0\" align=\"center\"" +
+                        "style=\"width: 600px; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family:微软雅黑, 黑体; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial;background:#fff;\">" +
+                        "<tbody><tr><th valign=\"middle\" style=\"height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #42a3d3; background-color: #49bcff; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">" +
+                        "<font face=\"微软雅黑\" size=\"5\" style=\"color: rgb(255, 255, 255); \">预约开票管理系统 </font><font face=\"微软雅黑\" size=\"3\" style=\"color: rgb(255, 255, 255); \">Reserve Invoice</font></th></tr>";
+                //表html中间内容
+                String prime = "";
+                String center = "<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\">" +
+                        "亲爱的 username</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
+                        "Dear usernameEN</font></font></h2>" +
+                        "<p>您有一个新的待办任务:<br>" +
+                        "You have a new to-do task:<br>" +
+                        "任务编号:<b>apNo</b><br>" +
+                        "Task Number: <b>apNoEN</b><br>" +
+                        "请登录<a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">预约开票申请流程</a>查看。<br>" +
+                        "Please log in the <a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">InvoiceApprove</a> to handle it.</p>" +
+                        "<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;\">" +
+                        "<p>此为系统邮件,请勿回复<br>This e-Mail is an automatic reminder sent by SEMS, please do not reply</p>" +
+                        "</div></div></div></td></tr>";
+                String one = center.replaceFirst("username", username);
+                String two = one.replaceFirst("usernameEN", usernameEN);
+                String four = two.replaceFirst("apNo", apNo);
+                String five = four.replaceFirst("apNoEN", apNo);
+                String result = five.replaceFirst("date", String.valueOf(new Date()));
+                prime = prime + result;
+                //写html结尾内容
+                String end = "</tbody></table></div></body></html>";
+                //拼接html
+                String html = start + prime + end;
+                logger.info("html:" + html);
+//                 mailService.sendHtmlMail(email, "预约开票:您有一个新的待办任务 Reserve Invoice:You have a new to-do task (" + apNo + ")", html);
+            }
+        } catch (Exception e) {
             logger.error("邮件发送失败" + JSON.toJSONString(e));
         }
     }
-
 }

+ 44 - 49
master/src/main/java/com/ruoyi/project/listener/invoiceApprove/ZzzgTaskCreateListener.java

@@ -15,9 +15,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import java.io.Serializable;
-import java.util.ArrayList;
 import java.util.Date;
-import java.util.List;
 
 @Service("zzzgTaskCreateListener")
 public class ZzzgTaskCreateListener implements Serializable, TaskListener {
@@ -30,58 +28,55 @@ public class ZzzgTaskCreateListener implements Serializable, TaskListener {
         ITApproveReserveInvoiceService tApproveReserveInvoiceService = (ITApproveReserveInvoiceService) SpringContextUtils.getBean("tApproveReserveInvoiceService");
         ISysUserService sysUserService = (ISysUserService) SpringContextUtils.getBean("sysUserService");
         IMailService mailService = (IMailService) SpringContextUtils.getBean("mailService");
-        TApproveReserveInvoice approveEntity = tApproveReserveInvoiceService.selectTApproveReserveInvoiceById(Long.parseLong(id)) ;
+        TApproveReserveInvoice approveEntity = tApproveReserveInvoiceService.selectTApproveReserveInvoiceById(Long.parseLong(id));
         logger.info("approveEntity:" + approveEntity);
         //发送邮件
         try {
-            List<String> emails  = new ArrayList<>();
             for (String zzzguser : zzzgusers.split(",")) {
-                emails.add(sysUserService.selectUserById(Long.parseLong(zzzguser)).getEmail());
+                String email = sysUserService.selectUserById(Long.parseLong(zzzguser)).getEmail();
+                String apNo = approveEntity.getApNo();
+                logger.info("apNo:" + apNo);
+                String username = sysUserService.selectUserById(Long.parseLong(zzzguser)).getNickName();
+                String usernameEN = PinyinHelper.convertToPinyinString(username, " ", PinyinFormat.WITHOUT_TONE);
+                logger.info("email:" + email);
+                logger.info("username:" + username);
+                //写html开始内容
+                String start = "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title></title></head><body><div style=\"background-color:#ECECEC; padding: 35px;\">" +
+                        "<table cellpadding=\"0\" align=\"center\"" +
+                        "style=\"width: 600px; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family:微软雅黑, 黑体; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial;background:#fff;\">" +
+                        "<tbody><tr><th valign=\"middle\" style=\"height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #42a3d3; background-color: #49bcff; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">" +
+                        "<font face=\"微软雅黑\" size=\"5\" style=\"color: rgb(255, 255, 255); \">预约开票管理系统 </font><font face=\"微软雅黑\" size=\"3\" style=\"color: rgb(255, 255, 255); \">Reserve Invoice</font></th></tr>";
+                //表html中间内容
+                String prime = "";
+                String center = "<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\">" +
+                        "亲爱的 username</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
+                        "Dear usernameEN</font></font></h2>" +
+                        "<p>您有一个新的待办任务:<br>" +
+                        "You have a new to-do task:<br>" +
+                        "任务编号:<b>apNo</b><br>" +
+                        "Task Number: <b>apNoEN</b><br>" +
+                        "请登录<a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">预约开票申请流程</a>查看。<br>" +
+                        "Please log in the <a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">InvoiceApprove</a> to handle it.</p>" +
+                        "<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;\">" +
+                        "<p>此为系统邮件,请勿回复<br>This e-Mail is an automatic reminder sent by SEMS, please do not reply</p>" +
+                        "</div></div></div></td></tr>";
+                String one = center.replaceFirst("username", username);
+                String two = one.replaceFirst("usernameEN", usernameEN);
+                String four = two.replaceFirst("apNo", apNo);
+                String five = four.replaceFirst("apNoEN", apNo);
+                String result = five.replaceFirst("date", String.valueOf(new Date()));
+                prime = prime + result;
+                //写html结尾内容
+                String end = "</tbody></table></div></body></html>";
+                //拼接html
+                String html = start + prime + end;
+                logger.info("html:" + html);
+//                mailService.sendHtmlMail(email, "预约开票:您有一个新的待办任务 Reserve Invoice:You have a new to-do task (" + apNo + ")", html);
             }
-            String apNo = approveEntity.getApNo();
-            logger.info("apNo:" + apNo);
-            String username = sysUserService.selectUserById(Long.parseLong(zzzgusers)).getNickName();
-            String usernameEN = PinyinHelper.convertToPinyinString(username, " ", PinyinFormat.WITHOUT_TONE);
-            logger.info("email:" + JSON.toJSONString(emails));
-            logger.info("username:" + username);
-            //写html开始内容
-            String start = "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title></title></head><body><div style=\"background-color:#ECECEC; padding: 35px;\">" +
-                    "<table cellpadding=\"0\" align=\"center\"" +
-                    "style=\"width: 600px; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family:微软雅黑, 黑体; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial;background:#fff;\">" +
-                    "<tbody><tr><th valign=\"middle\" style=\"height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #42a3d3; background-color: #49bcff; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">" +
-                    "<font face=\"微软雅黑\" size=\"5\" style=\"color: rgb(255, 255, 255); \">预约开票管理系统 </font><font face=\"微软雅黑\" size=\"3\" style=\"color: rgb(255, 255, 255); \">Reserve Invoice</font></th></tr>";
-            //表html中间内容
-            String prime = "";
-            String center = "<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\">" +
-                    "亲爱的 username</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
-                    "Dear usernameEN</font></font></h2>" +
-                    "<p>您有一个新的待办任务:<br>" +
-                    "You have a new to-do task:<br>" +
-                    "任务编号:<b>apNo</b><br>" +
-                    "Task Number: <b>apNoEN</b><br>" +
-                    "请登录<a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">预约开票申请流程</a>查看。<br>" +
-                    "Please log in the <a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">InvoiceApprove</a> to handle it.</p>" +
-                    "<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;\">" +
-                    "<p>此为系统邮件,请勿回复<br>This e-Mail is an automatic reminder sent by SEMS, please do not reply</p>" +
-                    "</div></div></div></td></tr>";
-            String one = center.replaceFirst("username", username);
-            String two = one.replaceFirst("usernameEN", usernameEN);
-            String four = two.replaceFirst("apNo", apNo);
-            String five = four.replaceFirst("apNoEN", apNo);
-            String result = five.replaceFirst("date", String.valueOf(new Date()));
-            prime = prime + result;
-            //写html结尾内容
-            String end = "</tbody></table></div></body></html>";
-            //拼接html
-            String html = start + prime + end;
-            logger.info("html:" + html);
-            for (String email : emails) {
-                //mailService.sendHtmlMail(email, "预约开票:您有一个新的待办任务 Reserve Invoice:You have a new to-do task (" + apNo + ")", html);
-            }
-        }catch (Exception e) {
+        } catch (Exception e) {
             logger.error("邮件发送失败" + JSON.toJSONString(e));
         }
     }

+ 20 - 7
master/src/main/java/com/ruoyi/project/system/domain/SysUser.java

@@ -1,12 +1,6 @@
 package com.ruoyi.project.system.domain;
 
-import java.util.Date;
-import java.util.List;
-import javax.validation.constraints.Email;
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.Size;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ruoyi.common.utils.StringUtils;
@@ -15,6 +9,14 @@ import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
 import com.ruoyi.framework.aspectj.lang.annotation.Excel.Type;
 import com.ruoyi.framework.aspectj.lang.annotation.Excels;
 import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import javax.validation.constraints.Email;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 用户对象 sys_user
@@ -108,6 +110,17 @@ public class SysUser extends BaseEntity
 
     private String signUrl;
 
+    @TableField(exist = false)
+    private Long roleId;
+
+    public Long getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(Long roleId) {
+        this.roleId = roleId;
+    }
+
     public String getStaffId() {
         return staffId;
     }

+ 3 - 5
master/src/main/java/com/ruoyi/project/system/mapper/SysUserMapper.java

@@ -1,12 +1,9 @@
 package com.ruoyi.project.system.mapper;
 
-import java.util.List;
-
-import com.ruoyi.project.system.domain.SysPost;
-import com.ruoyi.project.system.domain.SysRole;
+import com.ruoyi.project.system.domain.SysUser;
 import org.apache.ibatis.annotations.Param;
 
-import com.ruoyi.project.system.domain.SysUser;
+import java.util.List;
 
 /**
  * 用户表 数据层
@@ -38,6 +35,7 @@ public interface SysUserMapper
      * @return 用户信息
      */
     public List<SysUser> selectUserByDept(Long deptId);
+    public List<SysUser> selectUserListByRoleAndDept(SysUser sysUser);
 
     /**
      * 通过用户ID查询用户

+ 4 - 3
master/src/main/java/com/ruoyi/project/system/service/ISysUserService.java

@@ -1,11 +1,10 @@
 package com.ruoyi.project.system.service;
 
-import java.util.List;
-
-import com.ruoyi.project.system.domain.SysPost;
 import com.ruoyi.project.system.domain.SysUser;
 import com.ruoyi.project.system.domain.SysUserRole;
 
+import java.util.List;
+
 /**
  * 用户 业务层
  *
@@ -22,6 +21,8 @@ public interface ISysUserService
      */
     public List<SysUser> selectUserList(SysUser user);
 
+    public List<SysUser> selectUserListByRoleAndDept(SysUser user);
+
     /**
      * 通过用户ID查询用户和角色关联
      *

+ 16 - 10
master/src/main/java/com/ruoyi/project/system/service/impl/SysUserServiceImpl.java

@@ -1,24 +1,23 @@
 package com.ruoyi.project.system.service.impl;
 
-import java.util.ArrayList;
-import java.util.List;
-
-import com.ruoyi.project.system.domain.*;
-import com.ruoyi.project.system.mapper.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.exception.CustomException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.system.domain.*;
+import com.ruoyi.project.system.mapper.*;
 import com.ruoyi.project.system.service.ISysConfigService;
 import com.ruoyi.project.system.service.ISysUserService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * 用户 业务层处理
@@ -64,6 +63,13 @@ public class SysUserServiceImpl implements ISysUserService
         return userMapper.selectUserList(user);
     }
 
+    @Override
+    @DataScope(deptAlias = "d", userAlias = "u")
+    public List<SysUser> selectUserListByRoleAndDept(SysUser user)
+    {
+        return userMapper.selectUserListByRoleAndDept(user);
+    }
+
     /**
      * 通过用户ID查询用户和角色关联
      *

+ 17 - 0
master/src/main/resources/mybatis/system/SysUserMapper.xml

@@ -153,6 +153,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		</if>
 	</select>
 
+	<select id="selectUserListByRoleAndDept" parameterType="SysUser" resultMap="SysUserResult">
+		select u.user_id,u.staffid,u.email, u.dept_id, u.user_name, u.nick_name ,d.dept_name,r.ROLE_ID
+		from sys_user u
+		left join sys_dept d on u.dept_id = d.dept_id
+		left join sys_user_role ur on u.user_id = ur.user_id
+		left join sys_role r on r.role_id = ur.role_id
+		LEFT JOIN SYS_USER_POST sp on u.USER_ID = sp.USER_ID
+		LEFT JOIN SYS_POST p on p.POST_ID = sp.POST_ID
+		where u.del_flag = '0' and u.staffid is not null
+		<if test="roleId != null and roleId != ''">
+			and r.role_id = #{roleId}
+		</if>
+		<if test="deptId != null and deptId != ''">
+			and d.dept_id = #{deptId}
+		</if>
+	</select>
+
 	<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
 		<include refid="selectUserVo"/>
 

+ 2 - 2
master/src/main/resources/processes/reserveInvoice.bpmn

@@ -15,12 +15,12 @@
     <sequenceFlow id="flow2" name="通过" sourceRef="yhzgtask" targetRef="zzzgtask">
       <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
     </sequenceFlow>
-    <userTask id="zzgcstask" name="装置工程师签字确认" activiti:assignee="#{zzgcsusers}">
+    <userTask id="zzgcstask" name="装置工程师签字确认" activiti:candidateUsers="#{zzgcsusers}">
       <extensionElements>
         <activiti:taskListener event="create" delegateExpression="${zzgcsTaskCreateListener}"></activiti:taskListener>
       </extensionElements>
     </userTask>
-    <userTask id="zzjltask" name="装置经理签字确认" activiti:assignee="#{zzjlusers}">
+    <userTask id="zzjltask" name="装置经理签字确认" activiti:candidateUsers="#{zzjlusers}">
       <extensionElements>
         <activiti:taskListener event="create" delegateExpression="${zzjlTaskCreateListener}"></activiti:taskListener>
       </extensionElements>

+ 11 - 11
ui/src/views/invoice/bookingworkticket/index.vue

@@ -625,17 +625,17 @@ export default {
           if (row.workType===1||row.workType===2||row.workType===3||row.workType===15){
             this.approveForm.isSpecial = 1
           }
-
-        this.approveForm.userSupId=10000;
-        this.approveForm.devSupId=10081;
-        this.approveForm.devEngineerId=10082;
-        this.approveForm.managerconId=10084;
-        this.$refs.addApprove.init(rows)
-        // addInvoice(this.approveForm).then(response => {
-        //   this.msgSuccess(this.$t('预约成功'));
-        //   // this.visible = false;
-        //   // this.getList();
-        // })
+        this.approveForm.userSupId=row.bookingworkticket.userMg;
+        // this.approveForm.userSupId=10000;
+        // this.approveForm.devSupId=10081;
+        // this.approveForm.devEngineerId=10082;
+        // this.approveForm.managerconId=10084;
+        // this.$refs.addApprove.init(rows)
+        addInvoice(this.approveForm).then(response => {
+          this.msgSuccess(this.$t('预约成功'));
+          // this.visible = false;
+          // this.getList();
+        })
       })
       this.addAprroveVisible = true
     },

+ 4 - 4
ui/src/views/plant/targetagreement/index.vue

@@ -604,9 +604,7 @@ export default {
     selectFocus(year){
       this.queryParams.year=year;
       getAllContent(this.queryParams).then(response => {
-        console.log(response)
         this.contentList = response.data;
-        console.log(this.contentList)
       });
     },
     selectChange(content){
@@ -783,6 +781,10 @@ export default {
                 }
               });
             }
+            if (value.yardstick!=null){
+              let yardstick=value.yardstick.replaceAll(",","");
+              _this.targetyardstickList[key].yardstick=yardstick;
+            }
             _this.targetyardstickList[key].partners = partners;
             _this.targetyardstickList[key].partnersName = partnersName;
           })
@@ -818,14 +820,12 @@ export default {
       this.yardstickForm = row;
       this.yardstickForm.agreementId = this.yardstickQueryParams.agreementId;
       let newYardstick="";
-      console.log(row.yardstick)
       row.yardstick.forEach(
         item=>{
           newYardstick+=item+",";
         }
       )
       row.yardstick = newYardstick.substring(0,newYardstick.length-1)
-      console.log(row.yardstick)
       if (this.rowActualpost !== "24") {
         var partner = null;
         this.yardstickForm.partners.forEach(function (value,key,arr) {