Browse Source

任务管理--查询已完成任务添加项目id参数

buzhanyi 8 months ago
parent
commit
a284ed924a

+ 1 - 1
application-webadmin/src/main/java/com/ankaibei/workFlow/webadmin/ankaibei/api/TaskInfoApi.java

@@ -32,5 +32,5 @@ public interface TaskInfoApi extends ApiMixin<TaskInfoVo, Integer> {
 
     ResMsg deleteTask(List<TaskInfoVo> taskInfoVos);
 
-    ResMsg findTaskIsFinish(String userId, Integer taskStatus);
+    ResMsg findTaskIsFinish(TaskInfoVo taskInfoVo, Integer taskStatus);
 }

+ 2 - 2
application-webadmin/src/main/java/com/ankaibei/workFlow/webadmin/ankaibei/api/TaskInfoServiceApi.java

@@ -80,8 +80,8 @@ public class TaskInfoServiceApi implements TaskInfoApi {
     }
 
     @Override
-    public ResMsg findTaskIsFinish(String userId, Integer taskStatus) {
-        return taskInfoService.findTaskIsFinish(userId, taskStatus);
+    public ResMsg findTaskIsFinish(TaskInfoVo taskInfoVo, Integer taskStatus) {
+        return taskInfoService.findTaskIsFinish(taskInfoVo, taskStatus);
     }
 
 }

+ 6 - 2
application-webadmin/src/main/java/com/ankaibei/workFlow/webadmin/ankaibei/controller/TaskInfoController.java

@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -127,9 +128,12 @@ public class TaskInfoController {
      * @return ResMsg
      */
     @RequestMapping("/findTaskIsFinish")
-    public ResMsg findTaskIsFinish() {
+    public ResMsg findTaskIsFinish(@RequestBody TaskInfoVo taskInfoVo) {
         String userId = TokenData.takeFromRequest().getUserId();
-        return taskInfoApi.findTaskIsFinish(userId, Integer.parseInt(TaskStatus.FINISH_ED.getCode()));
+        taskInfoVo.setTaskParticipant(new ArrayList<Long>() {{
+            add(Long.valueOf(userId));
+        }});
+        return taskInfoApi.findTaskIsFinish(taskInfoVo, Integer.parseInt(TaskStatus.FINISH_ED.getCode()));
     }
 
 

+ 1 - 1
application-webadmin/src/main/java/com/ankaibei/workFlow/webadmin/ankaibei/mapper/TaskInfoMapper.java

@@ -94,5 +94,5 @@ public interface TaskInfoMapper extends JpaRepository<TaskInfoEntity, Integer>,
      * 查询登录用户已完成的任务
      */
     @Query
-    List<TaskInfoEntity> findAllByTaskParticipantContainsAndTaskStatusIsAndIsDeleteIs(String userId, Integer taskStatus, String isDelete);
+    List<TaskInfoEntity> findAllByTaskParticipantContainsAndProjectIdEqualsAndTaskStatusIsAndIsDeleteIs(String userId, String projectId, Integer taskStatus, String isDelete);
 }

+ 1 - 2
application-webadmin/src/main/java/com/ankaibei/workFlow/webadmin/ankaibei/service/TaskInfoService.java

@@ -85,9 +85,8 @@ public interface TaskInfoService {
     /**
      * 查找登录用户参与的审批已完成的任务
      *
-     * @param userId
      * @param taskStatus
      * @return
      */
-    ResMsg findTaskIsFinish(String userId, Integer taskStatus);
+    ResMsg findTaskIsFinish(TaskInfoVo taskInfoVo, Integer taskStatus);
 }

+ 3 - 2
application-webadmin/src/main/java/com/ankaibei/workFlow/webadmin/ankaibei/service/impl/TaskInfoServiceImpl.java

@@ -317,8 +317,9 @@ public class TaskInfoServiceImpl implements TaskInfoService {
     }
 
     @Override
-    public ResMsg findTaskIsFinish(String userId, Integer taskStatus) {
-        List<TaskInfoEntity> contains = taskInfoMapper.findAllByTaskParticipantContainsAndTaskStatusIsAndIsDeleteIs(userId, taskStatus, DataIsDeleteEnum.NORMAL.getCode());
+    public ResMsg findTaskIsFinish(TaskInfoVo taskInfoVo, Integer taskStatus) {
+        List<TaskInfoEntity> contains = taskInfoMapper.findAllByTaskParticipantContainsAndTaskStatusIsAndIsDeleteIs(
+                taskInfoVo.getTaskParticipant().get(0).toString(), taskInfoVo.getProjectId(), taskStatus, DataIsDeleteEnum.NORMAL.getCode());
         return new ResMsg(CodeEnum.OK, contains);
     }