|
@@ -14,6 +14,8 @@ import org.activiti.engine.task.Task;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Component
|
|
@@ -25,12 +27,13 @@ public class SpecTodoTask extends BaseController {
|
|
|
public void execute() {
|
|
|
List<SysUser> sysUsers = sysUserService.selectAllUser();
|
|
|
IMailService mailService = (IMailService) SpringContextUtils.getBean("mailService");
|
|
|
+ String[] array = {"myProcess", "semsAddDelProcess", "yearProcess", "monthProcess", "yearProcess", "semsWeekcheck"};
|
|
|
+ List<String> processInstanceIds = new ArrayList<>(Arrays.asList(array));
|
|
|
for (SysUser item : sysUsers) {
|
|
|
try {
|
|
|
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
|
|
|
List<Task> taskList = processEngine.getTaskService()//获取任务service
|
|
|
- .createTaskQuery()//创建查询对象
|
|
|
- .processDefinitionName("特种设备审批流程")//根据任务流程id查询
|
|
|
+ .createTaskQuery().processDefinitionKeyIn(processInstanceIds)//创建查询对象
|
|
|
.taskCandidateOrAssigned(item.getUserId().toString())
|
|
|
// .taskAssignee(getUserId().toString())
|
|
|
.orderByTaskCreateTime().desc().list();//参与者,组任务查询
|
|
@@ -44,13 +47,13 @@ public class SpecTodoTask extends BaseController {
|
|
|
"<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); \">To-Do Task</font></th></tr>";
|
|
|
+ "<font face=\"微软雅黑\" size=\"5\" style=\"color: rgb(255, 255, 255); \">待办任务提醒 </font><font face=\"微软雅黑\" size=\"3\" style=\"color: rgb(255, 255, 255); \">To-Do Task</font></th></tr>";
|
|
|
//表html中间内容
|
|
|
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(loginName)</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
|
|
|
"Dear usernameEN(loginName)</font></font></h2>" +
|
|
|
- "<p>您有" + taskList.size() + "条新的待办任务尚未完成:<br>" +
|
|
|
+ "<p>您有" + taskList.size() + "条待办任务尚未完成:<br>" +
|
|
|
"You have " + taskList.size() + " new to-do tasks that have not been completed :<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\">My To-Do List</a> to handle it.</p>" +
|
|
@@ -67,7 +70,7 @@ public class SpecTodoTask extends BaseController {
|
|
|
//拼接html
|
|
|
String html = start + result + end;
|
|
|
logger.info("html:" + html);
|
|
|
- mailService.sendHtmlMail(email, "特种设备系统:您有新的待办任务尚未完成 SEMS:You have new to-do tasks that have not been completed", html);
|
|
|
+ mailService.sendHtmlMail(email, "特种设备系统:您有待办任务尚未完成 SEMS:You have new to-do tasks that have not been completed", html);
|
|
|
}
|
|
|
} catch (Exception ignored) {
|
|
|
}
|