Sfoglia il codice sorgente

我的传阅增加提醒标识

dzx 5 mesi fa
parent
commit
ad52e6f2f0

+ 18 - 0
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -94,7 +94,11 @@ import com.xjrsoft.module.system.service.IFileService;
 import com.xjrsoft.module.teacher.entity.BaseTeacher;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.workflow.constant.WorkflowConstant;
+import com.xjrsoft.module.workflow.entity.WorkflowCirculated;
+import com.xjrsoft.module.workflow.entity.WorkflowSchema;
+import com.xjrsoft.module.workflow.service.IWorkflowCirculatedService;
 import com.xjrsoft.module.workflow.service.IWorkflowExecuteService;
+import com.xjrsoft.module.workflow.vo.CirculatedTaskPageVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -160,6 +164,7 @@ public class UserController {
 
     private final IBaseStudentSchoolRollService baseStudentSchoolRollService;
     private final IWhitelistManagementService whitelistManagementService;
+    private final IWorkflowCirculatedService circulatedService;
 
     @GetMapping(value = "/list")
     @ApiOperation(value = "用户列表(不分页)")
@@ -443,6 +448,19 @@ public class UserController {
         }
         pendingCountDto.setMyApplicationCount(myApplicationCount);
 
+        long circulatedCount = circulatedService.count(
+                MPJWrappers.<WorkflowCirculated>lambdaJoin()
+                        .orderByDesc(WorkflowCirculated::getCreateTime)
+                        .eq(WorkflowCirculated::getCirculatedUserId, StpUtil.getLoginIdAsLong())
+                        .select(WorkflowCirculated::getId)
+                        .select(WorkflowCirculated.class, x -> VoToColumnUtil.fieldsToColumns(CirculatedTaskPageVo.class).contains(x.getProperty()))
+                        .selectAs(WorkflowCirculated::getTaskName, CirculatedTaskPageVo::getCurrentTaskName)
+                        .selectAs(WorkflowSchema::getName, CirculatedTaskPageVo::getSchemaName)
+                        .selectAs(User::getName, CirculatedTaskPageVo::getOriginator)
+                        .leftJoin(User.class, User::getId, WorkflowCirculated::getStartUserId)
+                        .leftJoin(WorkflowSchema.class, WorkflowSchema::getId, WorkflowCirculated::getSchemaId)
+        );
+        pendingCountDto.setCirculatedCount(circulatedCount);
         return RT.ok(pendingCountDto);
     }
 

+ 6 - 0
src/main/java/com/xjrsoft/module/organization/vo/PendingCountDto.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.organization.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -12,7 +13,12 @@ public class PendingCountDto implements Serializable {
     /**
      * 流程待办数量
      */
+    @ApiModelProperty("流程待办数量")
     private long wfPendingCount;
 
+    @ApiModelProperty("我的申请数量")
     private long myApplicationCount;
+
+    @ApiModelProperty("我的传阅数量")
+    private long circulatedCount;
 }