2 次代码提交 388e239c92 ... 28e881a6a5

作者 SHA1 备注 提交日期
  buzhanyi 28e881a6a5 任务管理--查询已完成任务添加项目id参数 6 月之前
  buzhanyi a284ed924a 任务管理--查询已完成任务添加项目id参数 6 月之前

+ 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);
     }
 
 }

+ 7 - 3
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;
 
 /**
@@ -122,14 +123,17 @@ 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()));
     }
 
 

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

@@ -91,8 +91,14 @@ public interface TaskInfoMapper extends JpaRepository<TaskInfoEntity, Integer>,
 
 
     /**
-     * 查询登录用户已完成的任务
+     * 查询登录用户已完成的任务(全部)
      */
     @Query
-    List<TaskInfoEntity> findAllByTaskParticipantContainsAndTaskStatusIsAndIsDeleteIs(String userId, Integer taskStatus, String isDelete);
+    List<TaskInfoEntity> findAllByTaskParticipantContainsAndTaskStatusEqualsAndIsDeleteEquals(String userId, String taskStatus, String isDelete);
+
+    /**
+     * 查询登录用户已完成的任务(指定项目)
+     */
+    @Query
+    List<TaskInfoEntity> findAllByTaskParticipantContainsAndProjectIdEqualsAndTaskStatusEqualsAndIsDeleteEquals(String userId, String projectId, String taskStatus, String isDelete);
 }

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

@@ -83,11 +83,10 @@ public interface TaskInfoService {
     ResMsg performTask(TaskInfoEntity taskInfoEntity);
 
     /**
-     * 查找登录用户参与的审批已完成的任务
+     * 查询登录用户已完成的任务(指定项目)
      *
-     * @param userId
      * @param taskStatus
      * @return
      */
-    ResMsg findTaskIsFinish(String userId, Integer taskStatus);
+    ResMsg findTaskIsFinish(TaskInfoVo taskInfoVo, Integer taskStatus);
 }

+ 1 - 1
application-webadmin/src/main/java/com/ankaibei/workFlow/webadmin/ankaibei/service/impl/ManHourServiceImpl.java

@@ -67,7 +67,7 @@ public class ManHourServiceImpl implements ManHourService {
         Page<Map<String, String>> manHourAll = manHourMapper.findManHourAll(userId, manHourInfoEntity.getFlowTaskStatus(), manHourInfoEntity.getStartDate(), endDate, page);
         //匹配项目信息和任务信息
         List<ProjectInfoEntity> projectInfos = projectInfoMapper.findAll();
-        List<TaskInfoEntity> finishedTasks = taskInfoMapper.findAllByTaskParticipantContainsAndTaskStatusIsAndIsDeleteIs(userId, FlowTaskStatus.FINISHED, DataIsDeleteEnum.NORMAL.getCode());
+        List<TaskInfoEntity> finishedTasks = taskInfoMapper.findAllByTaskParticipantContainsAndTaskStatusEqualsAndIsDeleteEquals(userId, String.valueOf(FlowTaskStatus.FINISHED), (DataIsDeleteEnum.NORMAL.getCode()));
         return new ResMsg(CodeEnum.OK, ResMsg.getMap(manHourAll.map(map -> {
             Map<Object, Object> map1 = new HashMap<>(map);
             for (TaskInfoEntity taskInfo : finishedTasks) {

+ 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.findAllByTaskParticipantContainsAndProjectIdEqualsAndTaskStatusEqualsAndIsDeleteEquals(
+                taskInfoVo.getTaskParticipant().get(0).toString(), taskInfoVo.getProjectId(), String.valueOf(taskStatus), (DataIsDeleteEnum.NORMAL.getCode()));
         return new ResMsg(CodeEnum.OK, contains);
     }