From 49afbb309657585aa82095bf3b7dfc14b1265ac6 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 21 三月 2025 16:04:24 +0800
Subject: [PATCH] 首页消息

---
 business/src/main/java/com/ycl/service/impl/ProjectProcessServiceImpl.java |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/business/src/main/java/com/ycl/service/impl/ProjectProcessServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectProcessServiceImpl.java
index 0c283e6..5579d72 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectProcessServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectProcessServiceImpl.java
@@ -18,6 +18,7 @@
 import com.ycl.domain.entity.*;
 import com.ycl.domain.form.*;
 import com.ycl.domain.json.*;
+import com.ycl.domain.query.ProcessLogQuery;
 import com.ycl.domain.vo.*;
 import com.ycl.event.event.TaskLogEvent;
 import com.ycl.mapper.ProjectEngineeringMapper;
@@ -28,6 +29,7 @@
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ycl.domain.query.ProjectProcessQuery;
 import com.ycl.service.common.TaskCommonService;
+import com.ycl.system.domain.base.AbsQuery;
 import com.ycl.system.service.ISysDeptService;
 import com.ycl.system.service.ISysDictTypeService;
 import com.ycl.system.service.ISysRoleService;
@@ -923,6 +925,37 @@
         return Result.ok("鎿嶄綔鎴愬姛");
     }
 
+    @Override
+    public Result getProcessMsg(AbsQuery q) {
+        // 鏌ヨ嚜宸辩殑鏃ュ織
+        ProcessLogQuery query = new ProcessLogQuery();
+        if (! SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
+            query.setUserId(SecurityUtils.getUserId());
+        }
+        query.setEventTypeList(Arrays.asList(ProcessLogEventTypeEnum.DELEGATE.getValue(),
+                ProcessLogEventTypeEnum.REJECT.getValue(),
+                ProcessLogEventTypeEnum.JUMP.getValue(),
+                ProcessLogEventTypeEnum.FINISHED.getValue(),
+                ProcessLogEventTypeEnum.WAIT.getValue()));
+        query.setCurrentPage(q.getCurrentPage());
+        query.setPageSize(q.getPageSize());
+        Result result = processLogService.projectProcessLogPage(query);
+        List<ProcessLogVO> logs = (List<ProcessLogVO>) result.get("data");
+
+        logs.stream().forEach(log -> {
+            if (ProcessLogEventTypeEnum.FINISHED.equals(log.getEventType())) {
+                log.setContent("鎮ㄥ畬鎴愪簡浠诲姟锛�" + log.getTaskName());
+            } else if (ProcessLogEventTypeEnum.REJECT.equals(log.getEventType())) {
+                log.setContent("鎮ㄩ┏鍥炰簡浠诲姟锛�" + log.getTaskName());
+            } else if (ProcessLogEventTypeEnum.WAIT.equals(log.getEventType())) {
+                log.setContent("鎮ㄥ缂轰簡浠诲姟锛�" + log.getTaskName());
+            } else if (ProcessLogEventTypeEnum.JUMP.equals(log.getEventType())) {
+                log.setContent("鎮ㄨ烦杩囦簡浠诲姟锛�" + log.getTaskName());
+            }
+        });
+        return Result.ok().data(logs).total((Long) result.get("total"));
+    }
+
     /**
      * 鏌ヨ寰呭姙浠诲姟
      *

--
Gitblit v1.8.0