24282 преди 2 години
родител
ревизия
72c08e2c02

+ 3 - 3
bladex-saas-project/new-mail/src/main/java/com/fjhx/config/TaskPoolConfig.java

@@ -27,10 +27,10 @@ public class TaskPoolConfig {
                 20,
                 60,
                 TimeUnit.SECONDS,
-                new ArrayBlockingQueue<>(20),
+                new ArrayBlockingQueue<>(30),
                 (runnable, executor) -> {
-                    // 等待30秒之后重新入线程池
-                    ThreadUtil.sleep(30 * 1000);
+                    // 等待5秒之后重新入线程池
+                    ThreadUtil.sleep(3000);
                     executor.execute(runnable);
                 }
         );

+ 7 - 3
bladex-saas-project/new-mail/src/main/java/com/fjhx/controller/MailInfoController.java

@@ -1,6 +1,7 @@
 package com.fjhx.controller;
 
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.dto.SendDto;
 import com.fjhx.entity.MailFolder;
 import com.fjhx.entity.MailInfo;
@@ -62,10 +63,13 @@ public class MailInfoController {
      * 获取邮件列表
      */
     @GetMapping
-    public R getMailInfo(@RequestParam("folderId") Long folderId) {
-        List<MailInfo> list = mailInfoService.list(
+    public R getMailInfo(@RequestParam("pageNum") Integer pageNum,
+                         @RequestParam("pageSize") Integer pageSize,
+                         @RequestParam("folderId") Long folderId) {
+
+        Page<MailInfo> page = mailInfoService.page(new Page<>((long) pageSize * (pageNum - 1), pageSize),
                 Wrappers.<MailInfo>lambdaQuery().eq(MailInfo::getFolderId, folderId).orderByDesc(MailInfo::getId));
-        return R.data(list);
+        return R.data(page);
     }
 
     /**

+ 38 - 22
bladex-saas-project/new-mail/src/main/java/com/fjhx/service/impl/CoreServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fjhx.service.impl;
 
+import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSON;
@@ -51,7 +52,7 @@ public class CoreServiceImpl {
     // 单次同步邮件总次数
     private static int mailCount;
     // 最小等待时间
-    private static final long minWaitingTime = 1000 * 60 * 3;
+    private static final long minWaitingTime = 1000 * 30;
     // 初始化同步邮件天数
     private static final int initDay = 7;
 
@@ -70,7 +71,7 @@ public class CoreServiceImpl {
             }
 
             countDownLatch.countDown();
-            log.info("第 {} 伦同步还剩余 {} 封邮箱需要同步", num, countDownLatch.getCount());
+            // log.info("第 {} 伦同步还剩余 {} 封邮箱需要同步", num, countDownLatch.getCount());
         }
     }
 
@@ -80,9 +81,20 @@ public class CoreServiceImpl {
         new Thread(this::monitorMail).start();
     }
 
-
     public void monitorMail() {
 
+        try {
+            doMonitorMail();
+        } catch (Exception e) {
+            log.error("未知异常", e);
+        }
+
+        new Thread(this::monitorMail).start();
+
+    }
+
+    private void doMonitorMail() {
+
         // 开始处理时间
         long start = System.currentTimeMillis();
 
@@ -93,29 +105,29 @@ public class CoreServiceImpl {
         num++;
 
         // 查询所有需要同步的邮件
-        List<Mailbox> list = mailboxService.list();
+        List<Mailbox> list = mailboxService.list(Wrappers.<Mailbox>lambdaQuery().eq(Mailbox::getStatus, 0));
 
         log.info("开始第 {} 伦邮件同步,共同步 {} 个邮箱", num, list.size());
 
         // 定义一个线程计数器
-        // CountDownLatch countDownLatch = new CountDownLatch(list.size());
+        CountDownLatch countDownLatch = new CountDownLatch(list.size());
 
         // 开启抓取邮件任务
         for (Mailbox mailbox : list) {
 
-            // // 创建异步任务
-            // Task task = new Task(countDownLatch, mailbox);
-            // // 开启异步操作
-            // emailTaskExecutor.execute(task);
+            // 创建异步任务
+            Task task = new Task(countDownLatch, mailbox);
+
+            // 开启异步操作
+            emailTaskExecutor.execute(task);
 
-            synchronousMail(mailbox);
         }
 
-        // try {
-        //     countDownLatch.await();
-        // } catch (InterruptedException e) {
-        //     log.error("countDownLatch.await() 发生异常", e);
-        // }
+        try {
+            countDownLatch.await();
+        } catch (InterruptedException e) {
+            log.error("countDownLatch.await() 发生异常", e);
+        }
 
         // 结束处理时间
         long end = System.currentTimeMillis();
@@ -131,9 +143,6 @@ public class CoreServiceImpl {
             ThreadUtil.sleep(minWaitingTime - handleTime);
         }
 
-        // 发起一轮新的邮件同步
-        new Thread(this::monitorMail).start();
-
     }
 
     /**
@@ -149,8 +158,8 @@ public class CoreServiceImpl {
             store = EmailUtil.getIMAPStore(mailbox.getMailHost(), mailbox.getMailboxName(), mailbox.getMailboxPwd());
 
             // 获取所有文件夹
-            List<MailFolder> mailFolderList = mailFolderService.list(
-                    Wrappers.<MailFolder>lambdaQuery().eq(MailFolder::getMailboxId, mailbox.getId()));
+            List<MailFolder> mailFolderList = mailFolderService.list(Wrappers.<MailFolder>lambdaQuery()
+                    .eq(MailFolder::getMailboxId, mailbox.getId()));
 
             // 文件夹为空,代表初始化,从官方邮箱拉取文件夹
             if (mailFolderList.size() == 0) {
@@ -220,9 +229,16 @@ public class CoreServiceImpl {
     private List<MailInfo> getMailInfoList(MailFolder mailFolder, Message[] messages) throws MessagingException {
         // 获取最后一次发件id
         String lastMessageId = mailFolder.getLastMessageId();
+
+        DateTime date = DateUtil.offsetDay(new Date(), -initDay);
+
         // 获取最好一次收件的发送时间
-        Date lastReceivedDate = ObjectUtil.defaultIfNull(mailFolder.getLastReceivedDate(),
-                DateUtil.offsetDay(new Date(), -initDay));
+        Date lastReceivedDate = mailFolder.getLastReceivedDate();
+
+        // 最多只同步 initDay 天数据
+        if (lastReceivedDate == null || lastReceivedDate.before(date)) {
+            lastReceivedDate = date;
+        }
 
         // 收件列表
         List<MailInfo> mailInfoList = new ArrayList<>();

+ 79 - 40
bladex-saas-project/new-mail/src/main/java/com/fjhx/service/impl/MailFolderServiceImpl.java

@@ -158,67 +158,106 @@ public class MailFolderServiceImpl extends ServiceImpl<MailFolderMapper, MailFol
 
     // 保存附件和正文
     private void saveMessageAndAttachment(MailDetailsVo mailDetailsVo, Part part) throws MessagingException, IOException {
-
         MailMessage message = mailDetailsVo.getMessage();
         List<MailAttachment> mailAttachmentList = mailDetailsVo.getMailAttachmentList();
-        String contentType = part.getContentType();
-
-        String disposition = part.getDisposition();
-
-        // 处理附件
-        if ((disposition != null && (disposition.equalsIgnoreCase(Part.ATTACHMENT) || disposition.equalsIgnoreCase(Part.INLINE)))
-                || (contentType.contains("name") || contentType.contains("application"))) {
-
-            InputStream is = part.getInputStream();
-            String fileName = decodeText(part.getFileName());
-
-            String path = uploadFile(is, fileName);
-            MailAttachment mailAttachment = new MailAttachment();
-            mailAttachment.setName(fileName);
-            mailAttachment.setUrl(path);
-            mailAttachment.setMailInfoId(message.getMailInfoId());
-            mailAttachmentList.add(mailAttachment);
 
+        // 正文:文本格式
+        if (part.isMimeType("text/plain")) {
+            addPlain(part, message);
         }
-        // html格式
+        // 正文:html格式
         else if (part.isMimeType("text/html")) {
-            Object content = part.getContent();
-            if (content != null) {
-                message.setContent(content.toString());
-            } else {
-                message.setContent(StringPool.EMPTY);
-            }
-            message.setMimeType("text/html");
-        }
-        // 文本格式
-        else if (part.isMimeType("text/plain")) {
-            Object content = part.getContent();
-            if (content != null) {
-                if (ObjectUtil.notEqual(message.getMimeType(), "text/html")) {
-                    message.setContent(content.toString());
-                    message.setMimeType("text/plain");
-                }
-            }
+            addHtml(part, message);
         }
-        // 复杂体邮件
+        // 大对象
         else if (part.isMimeType("multipart/*")) {
+            // 复杂体邮件
             Multipart multipart = (Multipart) part.getContent();
+
             // 复杂体邮件包含多个邮件体
             int partCount = multipart.getCount();
+
             for (int i = 0; i < partCount; i++) {
                 // 获得复杂体邮件中其中一个邮件体
                 BodyPart bodyPart = multipart.getBodyPart(i);
-                saveMessageAndAttachment(mailDetailsVo, bodyPart);
-            }
+                // 某一个邮件体也有可能是由多个邮件体组成的复杂体
+                String disposition = bodyPart.getDisposition();
+
+                // 正文:html格式
+                if (bodyPart.isMimeType("text/html")) {
+                    addHtml(bodyPart, message);
+                }
+
+                // 正文:文本格式
+                if (bodyPart.isMimeType("text/plain")) {
+                    addPlain(bodyPart, message);
+                }
+
+                // 附件
+                else if (disposition != null && (disposition.equalsIgnoreCase(Part.ATTACHMENT) || disposition.equalsIgnoreCase(Part.INLINE))) {
+                    addFile(bodyPart, mailAttachmentList, message.getMailInfoId());
+                }
 
+                // 大对象
+                else if (bodyPart.isMimeType("multipart/*")) {
+                    saveMessageAndAttachment(mailDetailsVo, bodyPart);
+                }
+                // 其他类型
+                else {
+                    String contentType = bodyPart.getContentType();
+                    if (contentType.contains("name") || contentType.contains("application")) {
+                        addFile(bodyPart, mailAttachmentList, message.getMailInfoId());
+                    } else {
+                        log.error("未知文件格式:{} ,待解析", contentType);
+                    }
+                }
+
+            }
+        }
+        // rfc822
+        else if (part.isMimeType("message/rfc822")) {
+            saveMessageAndAttachment(mailDetailsVo, (Part) part.getContent());
         }
         // 未知格式
         else {
-            log.error("未知文件格式:{} ,待解析", contentType);
+            log.error("未知文件格式:{} ,待解析", part.getContentType());
         }
 
     }
 
+    private void addFile(Part part, List<MailAttachment> mailAttachmentList, Long mailInfoId) throws MessagingException, IOException {
+        InputStream is = part.getInputStream();
+        String fileName = decodeText(part.getFileName());
+
+        String path = uploadFile(is, fileName);
+        MailAttachment mailAttachment = new MailAttachment();
+        mailAttachment.setName(fileName);
+        mailAttachment.setUrl(path);
+        mailAttachment.setMailInfoId(mailInfoId);
+        mailAttachmentList.add(mailAttachment);
+    }
+
+    private void addHtml(Part part, MailMessage message) throws MessagingException, IOException {
+        Object content = part.getContent();
+        if (content != null) {
+            message.setContent(content.toString());
+        } else {
+            message.setContent(StringPool.EMPTY);
+        }
+        message.setMimeType("text/html");
+    }
+
+    private void addPlain(Part part, MailMessage message) throws MessagingException, IOException {
+        Object content = part.getContent();
+        if (content != null) {
+            if (ObjectUtil.notEqual(message.getMimeType(), "text/html")) {
+                message.setContent(content.toString());
+                message.setMimeType("text/plain");
+            }
+        }
+    }
+
+
     /**
      * 文本解码
      *

+ 37 - 31
bladex-saas-project/new-mail/src/main/java/com/fjhx/utils/EmailUtil.java

@@ -8,13 +8,17 @@ import com.fjhx.entity.MailFolder;
 import com.fjhx.enums.MailFlagEnum;
 import com.sun.mail.imap.IMAPFolder;
 import com.sun.mail.imap.IMAPStore;
+import com.sun.mail.smtp.SMTPMessage;
 import com.sun.mail.util.MailSSLSocketFactory;
 import org.springblade.core.tool.utils.StringPool;
 import org.springblade.system.attachment.entity.Attachment;
 
 import javax.activation.DataHandler;
 import javax.mail.*;
-import javax.mail.internet.*;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMultipart;
+import javax.mail.internet.MimeUtility;
 import java.io.UnsupportedEncodingException;
 import java.net.URL;
 import java.util.*;
@@ -41,8 +45,12 @@ public class EmailUtil {
      */
     public static IMAPStore getIMAPStore(String host, String user, String password) throws MessagingException {
         IMAPStore store = (IMAPStore) session.getStore("imap");
-        store.connect(host, 993, user, password);
-        store.id(map);
+
+        synchronized (EmailUtil.class) {
+            store.id(map);
+            store.connect(host, 993, user, password);
+        }
+
         return store;
     }
 
@@ -94,37 +102,37 @@ public class EmailUtil {
         return mailAddressList;
     }
 
-    public static void main(String[] args) throws Exception {
-
-        Attachment attachment = new Attachment();
-        attachment.setPath("https://os.winfaster.cn/fjhx/saas/GOLDSUN/2023/03/06/pdf/a69898863c834e68b19942ad26a49e10.pdf");
-        attachment.setRealName("测试.pdf");
-
-        SendDto sendDto = new SendDto();
-        SendDto.Address address = new SendDto.Address();
-        address.setAddress("2428241269@qq.com");
-        address.setPersonal("测试小小张");
-        sendDto.setTo(Arrays.asList(address));
-
-        sendDto.setAttachmentList(Arrays.asList(attachment));
-
-        sendDto.setSubject("测试标题");
-        sendDto.setContent("测试内容");
-        sendMail("imap.qq.com", "2428241269@qq.com", "kdypajdrwfhtdihb", sendDto);
-    }
+    // public static void main(String[] args) throws Exception {
+    //
+    //     Attachment attachment = new Attachment();
+    //     attachment.setPath("https://os.winfaster.cn/fjhx/saas/GrandStar/2023/03/08/png/3092592f2d614d83854fad5e4c107143.png");
+    //     attachment.setRealName("board-1.png");
+    //
+    //     SendDto.Address address = new SendDto.Address();
+    //     address.setAddress("2428241269@qq.com");
+    //
+    //     SendDto sendDto = new SendDto();
+    //     sendDto.setTo(Collections.singletonList(address));
+    //     sendDto.setAttachmentList(Collections.singletonList(attachment));
+    //     sendDto.setSubject("测试标题");
+    //     sendDto.setContent("测试内容");
+    //
+    //     sendMail("imap.qq.com", "2428241269@qq.com", "kdypajdrwfhtdihb", sendDto);
+    //     // sendMail("imap.163.com", "l17689260703@163.com", "WFARTAFVZZKOVNUF", sendDto);
+    // }
 
 
     public static void sendMail(String host, String user, String password, SendDto sendDto) throws Exception {
 
+        // QQ存在一个特性设置SSL加密
+        MailSSLSocketFactory sf = new MailSSLSocketFactory();
+        sf.setTrustAllHosts(true);
+
         // 创建一个配置文件并保存
         Properties properties = new Properties();
         properties.setProperty("mail.host", host);
         properties.setProperty("mail.transport.protocol", "smtp");
         properties.setProperty("mail.smtp.auth", "true");
-
-        // QQ存在一个特性设置SSL加密
-        MailSSLSocketFactory sf = new MailSSLSocketFactory();
-        sf.setTrustAllHosts(true);
         properties.put("mail.smtp.ssl.enable", "true");
         properties.put("mail.smtp.ssl.socketFactory", sf);
 
@@ -139,11 +147,8 @@ public class EmailUtil {
         // 获取连接对象
         Transport transport = session.getTransport();
 
-        // 连接服务器
-        transport.connect(host, user, password);
-
         // 创建邮件对象
-        MimeMessage mimeMessage = new MimeMessage(session);
+        SMTPMessage mimeMessage = new SMTPMessage(session);
 
         // // 邮件发送人
         mimeMessage.setFrom(new InternetAddress(user));
@@ -194,9 +199,10 @@ public class EmailUtil {
 
         mimeMessage.setContent(mimeMultipart);
 
+        // 连接服务器
+        transport.connect(host, user, password);
         // 发送邮件
-        transport.sendMessage(mimeMessage, mimeMessage.getAllRecipients());
-
+        transport.sendMessage(mimeMessage, new Address[]{new InternetAddress(user)});
         // 关闭连接
         transport.close();
 

+ 2 - 1
bladex-saas-project/saas-common/src/main/java/com/fjhx/activiti/controller/FlowTaskSettingDeployController.java

@@ -110,7 +110,8 @@ public class FlowTaskSettingDeployController extends BladeController {
     @GetMapping("/getTodoRoute")
     public R getTodoRoute(FlowTaskSettingDeploy flowTaskSettingDeploy) {
 
-        TaskEntity currentTask = (TaskEntity) taskService.createTaskQuery().processInstanceId(flowTaskSettingDeploy.getProcessInstanceId()).singleResult();
+        TaskEntity currentTask = (TaskEntity) taskService.createTaskQuery().processInstanceId
+                (flowTaskSettingDeploy.getProcessInstanceId()).singleResult();
         if (StringUtils.isEmpty(currentTask.getAssignee())) {
             return R.fail("请重新签收");
         }

+ 8 - 4
bladex-saas-project/saas-common/src/main/java/com/fjhx/activiti/controller/TaskController.java

@@ -9,10 +9,7 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.page.PageDomain;
 import org.springblade.core.tool.utils.page.TableSupport;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 import java.util.Map;
@@ -40,6 +37,13 @@ public class TaskController extends BladeController {
         return R.count(count);
     }
 
+
+    @GetMapping("donePage")
+    public R donePage(@RequestParam("pageSize") Integer pageSize, @RequestParam("pageNum") Integer pageNum) {
+        Map<String, Object> result = actTaskService.donePage(pageNum, pageSize);
+        return R.success(result);
+    }
+
     @GetMapping(value = "/getHistoryLog/{processInstanceId}")
     public R getHistoryLog(@PathVariable("processInstanceId") String processInstanceId) {
         List<HistoricActivity> historicActivityList = actTaskService.selectHistorActivityList(processInstanceId);

+ 97 - 0
bladex-saas-project/saas-common/src/main/java/com/fjhx/activiti/entity/vo/FlowTaskDto.java

@@ -0,0 +1,97 @@
+package com.fjhx.activiti.entity.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>工作流任务<p>
+ *
+ * @author Tony
+ * @date 2021-04-03
+ */
+@Getter
+@Setter
+@ApiModel("工作流任务相关-返回参数")
+public class FlowTaskDto implements Serializable {
+
+    @ApiModelProperty("任务编号")
+    private String taskId;
+
+    @ApiModelProperty("任务执行编号")
+    private String executionId;
+
+    @ApiModelProperty("任务名称")
+    private String taskName;
+
+    @ApiModelProperty("任务Key")
+    private String taskDefKey;
+
+    @ApiModelProperty("任务执行人Id")
+    private Long assigneeId;
+
+    @ApiModelProperty("部门名称")
+    private String deptName;
+
+    @ApiModelProperty("流程发起人部门名称")
+    private String startDeptName;
+
+    @ApiModelProperty("任务执行人名称")
+    private String assigneeName;
+
+    @ApiModelProperty("流程发起人Id")
+    private String startUserId;
+
+    @ApiModelProperty("流程发起人名称")
+    private String startUserName;
+
+    @ApiModelProperty("流程类型")
+    private String category;
+
+    @ApiModelProperty("流程变量信息")
+    private Object procVars;
+
+    @ApiModelProperty("局部变量信息")
+    private Object taskLocalVars;
+
+    @ApiModelProperty("流程部署编号")
+    private String deployId;
+
+    @ApiModelProperty("流程ID")
+    private String procDefId;
+
+    @ApiModelProperty("流程key")
+    private String procDefKey;
+
+    @ApiModelProperty("流程定义名称")
+    private String procDefName;
+
+    @ApiModelProperty("流程定义内置使用版本")
+    private int procDefVersion;
+
+    @ApiModelProperty("流程实例ID")
+    private String procInsId;
+
+    @ApiModelProperty("历史流程实例ID")
+    private String hisProcInsId;
+
+    @ApiModelProperty("任务耗时")
+    private String duration;
+
+    @ApiModelProperty("候选执行人")
+    private String candidate;
+
+    @ApiModelProperty("任务创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @ApiModelProperty("任务完成时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date finishTime;
+
+}

+ 8 - 0
bladex-saas-project/saas-common/src/main/java/com/fjhx/activiti/mapper/ActReModelProcessMapper.java

@@ -2,9 +2,11 @@ package com.fjhx.activiti.mapper;
 
 import com.fjhx.activiti.entity.ActReModelProcess;
 import com.fjhx.activiti.entity.HistoricActivity;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 流程节点配置Mapper接口
@@ -71,4 +73,10 @@ public interface ActReModelProcessMapper {
     void updateHistorActivityByActinst(HistoricActivity activity);
 
     ActReModelProcess selectActReModelProcessByTaskDefKey(String taskDefKey);
+
+    List<Map<String, Object>> donePage(@Param("pageNum") int pageNum, @Param("pageSize") Integer pageSize,
+                                       @Param("userIdStr") String userIdStr, @Param("tenantId") String tenantId);
+
+    int donePageCount(@Param("userIdStr") String userIdStr, @Param("tenantId") String tenantId);
+
 }

+ 24 - 0
bladex-saas-project/saas-common/src/main/java/com/fjhx/activiti/mapper/ActReModelProcessMapper.xml

@@ -154,4 +154,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectActReModelProcessVo"/>
         where TASK_DEF_KEY = #{taskDefKey}
     </select>
+    <select id="donePage" resultType="java.util.Map">
+        select ahp.ID_           id,
+               ahp.NAME_         name,
+               ahp.END_TIME_     endTime,
+               ahp.START_TIME_   startTime,
+               ahp.PROC_DEF_ID_  processId,
+               aht.TASK_DEF_KEY_ taskDefKey,
+               aht.EXECUTION_ID_ processInstanceId
+        from act_hi_procinst ahp
+                 inner join act_hi_taskinst aht on ahp.PROC_DEF_ID_ = aht.PROC_DEF_ID_ AND aht.ASSIGNEE_ = #{userIdStr}
+        where ahp.TENANT_ID_ = #{tenantId}
+        GROUP BY ahp.ID_
+        limit #{pageNum},#{pageSize}
+    </select>
+
+    <select id="donePageCount" resultType="java.lang.Integer">
+        select count(0)
+        from (select 1
+              from act_hi_procinst ahp
+                       inner join act_hi_taskinst aht
+                                  on ahp.PROC_DEF_ID_ = aht.PROC_DEF_ID_ AND aht.ASSIGNEE_ = #{userIdStr}
+              where ahp.TENANT_ID_ = #{tenantId}
+              GROUP BY ahp.ID_) t
+    </select>
 </mapper>

+ 4 - 0
bladex-saas-project/saas-common/src/main/java/com/fjhx/activiti/service/IActTaskService.java

@@ -6,6 +6,7 @@ import org.activiti.engine.impl.persistence.entity.TaskEntity;
 import org.springblade.core.tool.utils.page.PageDomain;
 
 import java.util.List;
+import java.util.Map;
 
 
 public interface IActTaskService {
@@ -21,4 +22,7 @@ public interface IActTaskService {
     List<HistoricActivity> selectHistorActivityListByDesc(String processInstanceId);
 
     void updateHistorActivityList(TaskEntity currentTask);
+
+    Map<String, Object> donePage(Integer pageNum, Integer pageSize);
+
 }

+ 22 - 5
bladex-saas-project/saas-common/src/main/java/com/fjhx/activiti/service/impl/ActTaskServiceImpl.java

@@ -32,11 +32,7 @@ import org.springblade.system.user.feign.IUserClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
@@ -244,4 +240,25 @@ public class ActTaskServiceImpl implements IActTaskService {
         }
     }
 
+    @Override
+    public Map<String, Object> donePage(Integer pageNum, Integer pageSize) {
+
+        Map<String, Object> result = new HashMap<>();
+
+        String userIdStr = AuthUtil.getUserIdStr();
+        String tenantId = AuthUtil.getTenantId();
+
+        int count = actReModelProcessMapper.donePageCount(userIdStr, tenantId);
+        result.put("count", count);
+
+        if (count > 0) {
+            List<Map<String, Object>> list = actReModelProcessMapper.donePage(pageSize * (pageNum - 1), pageSize, userIdStr, tenantId);
+            result.put("list", list);
+        } else {
+            result.put("list", new ArrayList<>());
+        }
+
+        return result;
+    }
+
 }