|
@@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
|
|
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.framework.security.core.LoginUser;
|
|
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
|
|
import cn.iocoder.yudao.module.as.controller.admin.aidingstudentspersonmanage.vo.AidingStudentPersonManageClassVO;
|
|
|
import cn.iocoder.yudao.module.as.controller.admin.aidingstudentspersonmanage.vo.AidingStudentPersonManageInfoPageReqVO;
|
|
@@ -66,34 +67,73 @@ public class asTaskController {
|
|
|
private AidingStudentsPersonManageService aidingStudentsPersonManageService;
|
|
|
@Resource
|
|
|
private AidingStudentsManageService aidingStudentsManageService;
|
|
|
+
|
|
|
@GetMapping("/todo-page-aiding")
|
|
|
- @Operation(summary = "获取 Todo 家庭经济困难认定审批待办任务分页")
|
|
|
+ @Operation(summary = "获取 Todo 家庭经济困难认定审批资助助理初审任务")
|
|
|
@PreAuthorize("@ss.hasPermission('eve:task:query')")
|
|
|
public CommonResult<List<AidingStudentPersonManageClassVO>> getTaskTodoPageAiding(
|
|
|
@Valid BpmTaskPageReqVO pageVO) {
|
|
|
- //获取我的任务中家困任务的列表
|
|
|
- List<Task> ListResult = taskService.getTaskTodoPageAidingList(getLoginUserId(), pageVO);
|
|
|
+ AdminUserRespDTO user = adminUserApi.getUser(getLoginUserId());
|
|
|
+ Long collegeId = deptApi.getCollegeId(user.getDeptId());
|
|
|
+ Set<Long> deptIds = new HashSet<>();
|
|
|
+ deptIds.add(collegeId);
|
|
|
+
|
|
|
+ //获取学院的所有学生信息
|
|
|
+ List<AdminUserRespDTO> userList = adminUserApi.getUserListByDeptIds(deptIds);
|
|
|
+
|
|
|
+ //将本学院学生提交的全部查找并分班
|
|
|
+ List<AidingStudentsPersonManageDO> aidingStudentsPersonList =
|
|
|
+ aidingStudentsPersonManageService.getAidingStudentsByUserIds(
|
|
|
+ convertList(userList,AdminUserRespDTO::getId),pageVO
|
|
|
+ );
|
|
|
|
|
|
- if (CollUtil.isEmpty(ListResult)) {
|
|
|
+ if (CollUtil.isEmpty(aidingStudentsPersonList)) {
|
|
|
return success(null);
|
|
|
}
|
|
|
|
|
|
- List<AidingStudentsPersonManageDO> aidingStudentsPersonList =
|
|
|
- aidingStudentsPersonManageService.selectByProcessInstanceIdsGroupByClass(
|
|
|
- convertList(ListResult,Task::getProcessInstanceId),pageVO
|
|
|
+ //根据提交的流程全部查找
|
|
|
+ List<HistoricTaskInstance> pageResult = taskService.getTaskTodoPageAidingListByProcessInstanceIds(
|
|
|
+ getLoginUserId(), pageVO,
|
|
|
+ convertList(aidingStudentsPersonList,AidingStudentsPersonManageDO::getProcessInstanceId)
|
|
|
);
|
|
|
|
|
|
- Map<Long, AidingStudentsManageDO> aidingStudentsManageMap =
|
|
|
- aidingStudentsManageService.getAidingStudentsManageMap(convertSet(aidingStudentsPersonList
|
|
|
- , AidingStudentsPersonManageDO::getManageId));
|
|
|
|
|
|
- Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
|
|
|
- convertSet(aidingStudentsPersonList, AidingStudentsPersonManageDO::getUserId));
|
|
|
- Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(
|
|
|
- convertSet(userMap.values(), AdminUserRespDTO::getDeptId));
|
|
|
|
|
|
- return success(asTaskConvert.INSTANCE.buildTodoTaskPageAiding(
|
|
|
- userMap,deptMap,aidingStudentsManageMap,aidingStudentsPersonList));
|
|
|
+//
|
|
|
+// // 使用 Stream API 来处理
|
|
|
+// Map<String, HistoricTaskInstance> latestTasks = pageResult.stream()
|
|
|
+// .collect(Collectors.toMap(
|
|
|
+// HistoricTaskInstance::getProcessInstanceId,
|
|
|
+// task -> task,
|
|
|
+// (existingTask, newTask) -> newTask.getEndTime().after(existingTask.getEndTime()) ? newTask : existingTask
|
|
|
+// ));
|
|
|
+//
|
|
|
+// //获取我的任务中家困任务的列表
|
|
|
+// List<Task> ListResult = taskService.getTaskTodoPageAidingList(getLoginUserId(), pageVO);
|
|
|
+
|
|
|
+
|
|
|
+// // 进行筛选,只保留名称为“资助助理初审”的任务
|
|
|
+// ListResult = ListResult.stream()
|
|
|
+// .filter(t -> Objects.equals(t.getName(), "资助助理初审"))
|
|
|
+// .collect(Collectors.toList());
|
|
|
+
|
|
|
+// if (CollUtil.isEmpty(ListResult)) {
|
|
|
+// return success(null);
|
|
|
+// }
|
|
|
+
|
|
|
+// List<AidingStudentsPersonManageDO> aidingStudentsPersonList =
|
|
|
+// aidingStudentsPersonManageService.selectByProcessInstanceIdsGroupByClass(
|
|
|
+// convertList(ListResult,Task::getProcessInstanceId),pageVO
|
|
|
+// );
|
|
|
+
|
|
|
+// Map<Long, AidingStudentsManageDO> aidingStudentsManageMap =
|
|
|
+// aidingStudentsManageService.getAidingStudentsManageMap(convertSet(aidingStudentsPersonList
|
|
|
+// , AidingStudentsPersonManageDO::getManageId));
|
|
|
+
|
|
|
+// return success(asTaskConvert.INSTANCE.buildTodoTaskPageAiding(ListResult,
|
|
|
+// aidingStudentsManageMap,aidingStudentsPersonList));
|
|
|
+
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
@GetMapping("/done-page-aiding")
|