|
@@ -2,11 +2,14 @@ package cn.iocoder.yudao.module.as.controller.admin.task;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
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.number.NumberUtils;
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
|
-import cn.iocoder.yudao.module.as.controller.admin.aidingstudentspersonmanage.vo.AidingStudentsPersonManageClassPageReqVO;
|
|
|
|
-import cn.iocoder.yudao.module.as.controller.admin.aidingstudentspersonmanage.vo.AidingStudentsPersonManageUploadRespVO;
|
|
|
|
|
|
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentspersonmanage.vo.AidingStudentPersonManageClassVO;
|
|
|
|
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentspersonmanage.vo.AidingStudentPersonManageInfoPageReqVO;
|
|
|
|
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentspersonmanage.vo.AidingStudentPersonManageInfoRespVO;
|
|
|
|
+import cn.iocoder.yudao.module.as.controller.admin.task.vo.task.asTaskRespVO;
|
|
import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentspersonmanage.AidingStudentsPersonManageDO;
|
|
import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentspersonmanage.AidingStudentsPersonManageDO;
|
|
import cn.iocoder.yudao.module.as.service.aidingstudentspersonmanage.AidingStudentsPersonManageService;
|
|
import cn.iocoder.yudao.module.as.service.aidingstudentspersonmanage.AidingStudentsPersonManageService;
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskPageReqVO;
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskPageReqVO;
|
|
@@ -34,6 +37,7 @@ import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.function.Function;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Stream;
|
|
import java.util.stream.Stream;
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
@@ -62,12 +66,7 @@ public class asTaskController {
|
|
@GetMapping("/todo-page-aiding")
|
|
@GetMapping("/todo-page-aiding")
|
|
@Operation(summary = "获取 Todo 综测审批待办任务分页")
|
|
@Operation(summary = "获取 Todo 综测审批待办任务分页")
|
|
@PreAuthorize("@ss.hasPermission('eve:task:query')")
|
|
@PreAuthorize("@ss.hasPermission('eve:task:query')")
|
|
- public CommonResult<List<AidingStudentsPersonManageUploadRespVO>> getTaskTodoPageAiding(@Valid BpmTaskPageReqVO pageVO) {
|
|
|
|
- //获取班级id
|
|
|
|
- Long deptId = adminUserApi.getUser(getLoginUserId()).getDeptId();
|
|
|
|
- //获取所属学院id
|
|
|
|
- Long collegeId = deptApi.getCollegeId(deptId);
|
|
|
|
-
|
|
|
|
|
|
+ public CommonResult<Map<String,List<AidingStudentPersonManageInfoPageReqVO>>> getTaskTodoPageAiding(@Valid BpmTaskPageReqVO pageVO) {
|
|
//获取我的任务中家困任务的列表
|
|
//获取我的任务中家困任务的列表
|
|
List<Task> pageResult = taskService.getTaskTodoPageAidingList(getLoginUserId(), pageVO);
|
|
List<Task> pageResult = taskService.getTaskTodoPageAidingList(getLoginUserId(), pageVO);
|
|
|
|
|
|
@@ -81,22 +80,11 @@ public class asTaskController {
|
|
convertList(pageResult,Task::getProcessInstanceId),pageVO
|
|
convertList(pageResult,Task::getProcessInstanceId),pageVO
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ Map<String, List<AidingStudentPersonManageInfoPageReqVO>> classNameMap =
|
|
|
|
+ BeanUtils.toBean(aidingStudentsPersonList, AidingStudentPersonManageInfoPageReqVO.class).stream()
|
|
|
|
+ .collect(Collectors.groupingBy(AidingStudentPersonManageInfoPageReqVO::getClassName));
|
|
|
|
|
|
-// //获取任务列表中的家庭经济认定实例,aidingStudentsPersonList
|
|
|
|
-// List<AidingStudentsPersonManageUploadRespVO> aidingStudentsPersonList =
|
|
|
|
-// aidingStudentsPersonManageService.getAidingStudentsPersonManageClassPage();
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- Map<Long, ComprehensiveManageDO> comprehensiveManage =
|
|
|
|
- comprehensiveManageService.getManagetMap(convertSet(achievementList, AchievementDO::getManageId));
|
|
|
|
-
|
|
|
|
- Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
|
|
|
|
- convertSet(achievementList, AchievementDO::getUserId));
|
|
|
|
- Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(
|
|
|
|
- convertSet(userMap.values(), AdminUserRespDTO::getDeptId));
|
|
|
|
-
|
|
|
|
- return success(eveTaskConvert.INSTANCE.buildTodoTaskPageComprehensive(
|
|
|
|
- userMap,deptMap,comprehensiveManage,achievementList,deptId));
|
|
|
|
|
|
+ return success(classNameMap);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -110,7 +98,6 @@ public class asTaskController {
|
|
if (CollUtil.isEmpty(taskList)) {
|
|
if (CollUtil.isEmpty(taskList)) {
|
|
return success(Collections.emptyList());
|
|
return success(Collections.emptyList());
|
|
}
|
|
}
|
|
-
|
|
|
|
// 拼接数据
|
|
// 拼接数据
|
|
HistoricProcessInstance processInstance = processInstanceService.getHistoricProcessInstance(processInstanceId);
|
|
HistoricProcessInstance processInstance = processInstanceService.getHistoricProcessInstance(processInstanceId);
|
|
// 获得 User 和 Dept Map
|
|
// 获得 User 和 Dept Map
|
|
@@ -131,219 +118,216 @@ public class asTaskController {
|
|
@GetMapping("/done-page-comprehensive")
|
|
@GetMapping("/done-page-comprehensive")
|
|
@Operation(summary = "获取 Done 综测审批已办任务分页")
|
|
@Operation(summary = "获取 Done 综测审批已办任务分页")
|
|
@PreAuthorize("@ss.hasPermission('eve:task:query')")
|
|
@PreAuthorize("@ss.hasPermission('eve:task:query')")
|
|
- public CommonResult<List<AchievementRespVO>> getTaskDonePageComprehensive(@Valid BpmTaskPageReqVO pageVO) {
|
|
|
|
|
|
+ public CommonResult<Map<String,List<AidingStudentPersonManageInfoPageReqVO>>> getTaskDonePageComprehensive(@Valid BpmTaskPageReqVO pageVO) {
|
|
List<HistoricTaskInstance> pageResult = taskService.getTaskDonePageComprehensive(getLoginUserId(), pageVO);
|
|
List<HistoricTaskInstance> pageResult = taskService.getTaskDonePageComprehensive(getLoginUserId(), pageVO);
|
|
if (CollUtil.isEmpty(pageResult)) {
|
|
if (CollUtil.isEmpty(pageResult)) {
|
|
return success(null);
|
|
return success(null);
|
|
}
|
|
}
|
|
- List<AchievementDO> achievementList = achievementService.selectByProcessInstanceIdsGroupByUser(
|
|
|
|
- convertList(pageResult,HistoricTaskInstance::getProcessInstanceId),pageVO);
|
|
|
|
-
|
|
|
|
- // 移除当前元素
|
|
|
|
- achievementList.removeIf(achievementDO -> achievementDO.getUserId().equals(getLoginUserId()));
|
|
|
|
-
|
|
|
|
- Map<Long, ComprehensiveManageDO> comprehensiveManage =
|
|
|
|
- comprehensiveManageService.getManagetMap(convertSet(achievementList, AchievementDO::getManageId));
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
|
|
|
|
- convertSet(achievementList, AchievementDO::getUserId));
|
|
|
|
- Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(
|
|
|
|
- convertSet(userMap.values(), AdminUserRespDTO::getDeptId));
|
|
|
|
- return success(asTaskConvert.INSTANCE.buildTaskComprehensive(achievementList, userMap, deptMap,comprehensiveManage));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @GetMapping("done-user-list")
|
|
|
|
- @Operation(summary = "获取 Done 综测审批已办任务个人")
|
|
|
|
- @PreAuthorize("@ss.hasPermission('eve:task:query')")
|
|
|
|
- public CommonResult<List<eveTaskRespVO>> getTaskDoneByPeople(@Valid BpmTaskPageReqVO pageVO) {
|
|
|
|
-
|
|
|
|
- Long startUserId = pageVO.getUserId();
|
|
|
|
- List<AchievementDO> achievementList
|
|
|
|
- = achievementService.getAchievementByPeopleAndManageId(startUserId,pageVO.getManageId());
|
|
|
|
-
|
|
|
|
- Map<String, AchievementDO> achievementDOMap = convertMap(achievementList,AchievementDO::getProcessInstanceId);
|
|
|
|
- Collection<String> processInstanceIds = convertSet(achievementList,AchievementDO::getProcessInstanceId);
|
|
|
|
-
|
|
|
|
- List<HistoricTaskInstance> pageResult
|
|
|
|
- = taskService.getTaskDoneByPeopleAndProcessInstanceIds(getLoginUserId(), pageVO , processInstanceIds);
|
|
|
|
-
|
|
|
|
- // 使用 Stream API 来处理
|
|
|
|
- Map<String, HistoricTaskInstance> latestTasks = pageResult.stream()
|
|
|
|
- .collect(Collectors.toMap(
|
|
|
|
- HistoricTaskInstance::getProcessInstanceId,
|
|
|
|
- task -> task,
|
|
|
|
- (existingTask, newTask) -> newTask.getEndTime().after(existingTask.getEndTime()) ? newTask : existingTask
|
|
|
|
- ));
|
|
|
|
-
|
|
|
|
- pageResult.removeIf(task -> !latestTasks.get(task.getProcessInstanceId()).equals(task));
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (CollUtil.isEmpty(pageResult)) {
|
|
|
|
- return success(null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Map<String, HistoricProcessInstance> processInstanceMap = processInstanceService.getHistoricProcessInstanceMap(
|
|
|
|
- convertSet(pageResult, HistoricTaskInstance::getProcessInstanceId));
|
|
|
|
- Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
|
|
|
|
- convertSet(processInstanceMap.values(), instance -> Long.valueOf(instance.getStartUserId())));
|
|
|
|
-
|
|
|
|
- return success(eveTaskConvert.INSTANCE.buildTaskDoneByPeople(pageResult, processInstanceMap, userMap,achievementDOMap));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @PutMapping("/approve")
|
|
|
|
- @Operation(summary = "通过单项综测审批")
|
|
|
|
- @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
- public CommonResult<Boolean> approveTask(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
|
|
|
|
- taskService.approveTaskAchievement(getLoginUserId(), reqVO);
|
|
|
|
- return success(true);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @PutMapping("/approve-edit")
|
|
|
|
- @Operation(summary = "单项审批修改")
|
|
|
|
- @PreAuthorize("@ss.hasPermission('eve:achievement:update')")
|
|
|
|
- public CommonResult<Boolean> approveTaskEdit(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
|
|
|
|
- taskService.approveTaskAchievement(getLoginUserId(), reqVO);
|
|
|
|
- return success(true);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @PutMapping("/approve-people")
|
|
|
|
- @Operation(summary = "整体通过综测审批")
|
|
|
|
- @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
- public CommonResult<Boolean> approveTaskByPeople(@Valid @RequestBody List<BpmTaskApproveReqVO> reqVOList) {
|
|
|
|
- taskService.approveTaskAchievementByPeople(getLoginUserId(), reqVOList);
|
|
|
|
-
|
|
|
|
- return success(true);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @PostMapping("/approve-college-rank")
|
|
|
|
- @Operation(summary = "学院针对当前完成互评状态的条目进行审核并发起公示和排名")
|
|
|
|
- @PreAuthorize("@ss.hasPermission('eve:comprehensive-college-manage:update')")
|
|
|
|
- @Transactional
|
|
|
|
- public CommonResult<Boolean> approveTaskAndRankByCollege(@Valid @RequestBody BpmTaskPageReqVO pageVO) {
|
|
|
|
- Long deptId = adminUserApi.getUser(getLoginUserId()).getDeptId();
|
|
|
|
- Long collegeId = deptApi.getCollegeId(deptId);
|
|
|
|
- DeptRespDTO dept = deptApi.getDept(collegeId);
|
|
|
|
- ComprehensiveCollegeManageDO comprehensiveCollegeManage
|
|
|
|
- = comprehensiveCollegeManageService.getComprehensiveCollegeManage(pageVO.getManageId(), collegeId);
|
|
|
|
-
|
|
|
|
- if(comprehensiveCollegeManage.getComStatus() != 1){
|
|
|
|
- throw exception(ALREADY_PUBLICIZED);
|
|
|
|
- }
|
|
|
|
- comprehensiveCollegeManage.setComStatus(2);
|
|
|
|
- comprehensiveCollegeManageService.updateComprehensiveCollegeManage(
|
|
|
|
- BeanUtils.toBean(comprehensiveCollegeManage, ComprehensiveCollegeManageSaveReqVO.class)
|
|
|
|
- );
|
|
|
|
- List<Task> pageResult = taskService.getTaskTodoPageComprehensive(getLoginUserId(), pageVO);
|
|
|
|
-
|
|
|
|
- if (CollUtil.isEmpty(pageResult)) {
|
|
|
|
- return success(null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- List<AchievementDO> achievementList = achievementService.getAchievementByProcessInstanceIds(
|
|
|
|
- convertList(pageResult,Task::getProcessInstanceId),pageVO.getManageId());
|
|
|
|
|
|
|
|
- List<BpmTaskApproveReqVO> vpPageResult = new ArrayList<>();
|
|
|
|
-
|
|
|
|
- for (Task respVO : pageResult) {
|
|
|
|
- for(AchievementDO achievement : achievementList){
|
|
|
|
- if(achievement.getProcessInstanceId().equals(respVO.getProcessInstanceId())){
|
|
|
|
- BpmTaskApproveReqVO eveRespVO = BeanUtils.toBean(respVO, BpmTaskApproveReqVO.class);
|
|
|
|
- vpPageResult.add(eveRespVO);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- taskService.approveTaskAchievementByPeople(getLoginUserId(), vpPageResult);
|
|
|
|
-
|
|
|
|
- comprehensiveService.comprehensiveCalculateByCollegeID(
|
|
|
|
- collegeId,pageVO.getManageId(),1 , "学院公示"
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- comprehensiveService.comprehensiveRanking(collegeId,dept.getBs(),pageVO.getManageId());
|
|
|
|
-
|
|
|
|
- return success(true);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @GetMapping("/approve-college")
|
|
|
|
- @Operation(summary = "学院确认(即批量通过当前状态为学院公示的审批)")
|
|
|
|
- @PreAuthorize("@ss.hasPermission('eve:comprehensive-college-manage:update')")
|
|
|
|
- @Transactional
|
|
|
|
- public CommonResult<Boolean> approveTaskByCollege(@Valid BpmTaskPageReqVO pageVO) {
|
|
|
|
- List<Task> pageResult = taskService.getTaskTodoPageComprehensive(getLoginUserId(), pageVO);
|
|
|
|
- if (CollUtil.isEmpty(pageResult)) {
|
|
|
|
- return success(null);
|
|
|
|
- }
|
|
|
|
- Long deptId = adminUserApi.getUser(SecurityFrameworkUtils.getLoginUserId()).getDeptId();
|
|
|
|
- Long collegeId = deptApi.getCollegeId(deptId);
|
|
|
|
- ComprehensiveCollegeManageDO comprehensiveCollegeManage
|
|
|
|
- = comprehensiveCollegeManageService.getComprehensiveCollegeManage(pageVO.getManageId(), collegeId);
|
|
|
|
- if(comprehensiveCollegeManage.getComStatus() != 2){
|
|
|
|
- throw exception(PLEASE_START_PUBLICIZED);
|
|
|
|
- }
|
|
|
|
- comprehensiveCollegeManageService.updateComprehensiveCollegeManage(
|
|
|
|
- BeanUtils.toBean(comprehensiveCollegeManage.setComStatus(3), ComprehensiveCollegeManageSaveReqVO.class)
|
|
|
|
- );
|
|
|
|
- List<AchievementDO> achievementList = achievementService.getAchievementByProcessInstanceIds(
|
|
|
|
- convertList(pageResult,Task::getProcessInstanceId),pageVO.getManageId());
|
|
|
|
-
|
|
|
|
- List<BpmTaskApproveReqVO> vpPageResult = new ArrayList<>();
|
|
|
|
-
|
|
|
|
- for (Task respVO : pageResult) {
|
|
|
|
- for(AchievementDO achievement : achievementList){
|
|
|
|
- if(achievement.getProcessInstanceId().equals(respVO.getProcessInstanceId())){
|
|
|
|
- BpmTaskApproveReqVO eveRespVO = BeanUtils.toBean(respVO, BpmTaskApproveReqVO.class);
|
|
|
|
- vpPageResult.add(eveRespVO);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- taskService.approveTaskAchievementByPeople(getLoginUserId(), vpPageResult);
|
|
|
|
- return success(true);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @PutMapping("/reject-update")
|
|
|
|
- @Operation(summary = "不通过任务:驳回到审批人处")
|
|
|
|
- @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
- public CommonResult<Boolean> rejectAchievementTask(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
|
|
|
|
- taskService.rejectAchievementTask(getLoginUserId(), reqVO);
|
|
|
|
-
|
|
|
|
- return success(true);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @PutMapping("/reject-people-update")
|
|
|
|
- @Operation(summary = "整体不通过任务:驳回到审批人处")
|
|
|
|
- @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
- public CommonResult<Boolean> rejectAchievementTaskByPeople(@Valid @RequestBody List<BpmTaskApproveReqVO> reqVOList) {
|
|
|
|
- taskService.rejectAchievementTaskByPeople(getLoginUserId(), reqVOList);
|
|
|
|
- return success(true);
|
|
|
|
- }
|
|
|
|
|
|
+ //根据当前任务的idList获取 ,返回关于项目与班级分组的学生材料
|
|
|
|
+ List<AidingStudentsPersonManageDO> aidingStudentsPersonList =
|
|
|
|
+ aidingStudentsPersonManageService.getAidingStudentsPersonManageClassPage(
|
|
|
|
+ convertList(pageResult,HistoricTaskInstance::getProcessInstanceId),pageVO
|
|
|
|
+ );
|
|
|
|
|
|
- @PutMapping("/reject")
|
|
|
|
- @Operation(summary = "不通过任务:直接结束流程")
|
|
|
|
- @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
- public CommonResult<Boolean> rejectTask(@Valid @RequestBody BpmTaskRejectReqVO reqVO) {
|
|
|
|
- taskService.rejectTask(getLoginUserId(), reqVO);
|
|
|
|
- return success(true);
|
|
|
|
- }
|
|
|
|
|
|
+ Map<String, List<AidingStudentPersonManageInfoPageReqVO>> classNameMap =
|
|
|
|
+ BeanUtils.toBean(aidingStudentsPersonList, AidingStudentPersonManageInfoPageReqVO.class).stream()
|
|
|
|
+ .collect(Collectors.groupingBy(AidingStudentPersonManageInfoPageReqVO::getClassName));
|
|
|
|
|
|
- @PutMapping("/reject-people")
|
|
|
|
- @Operation(summary = "整体不通过综测审批:直接结束流程")
|
|
|
|
- @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
- public CommonResult<Boolean> rejectTaskByPeople(@Valid @RequestBody List<BpmTaskRejectReqVO> reqVOList) {
|
|
|
|
- taskService.rejectTaskByPeople(getLoginUserId(), reqVOList);
|
|
|
|
- return success(true);
|
|
|
|
|
|
+ return success(classNameMap);
|
|
}
|
|
}
|
|
|
|
|
|
- @PutMapping("/reject-undo")
|
|
|
|
- @Operation(summary = "在下一个人审批前退回审批")
|
|
|
|
- @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
- public CommonResult<Boolean> rejectUndoTask(@Valid @RequestBody BpmTaskUndoReqVO reqVO) {
|
|
|
|
- taskService.UndoTask(getLoginUserId(), reqVO);
|
|
|
|
|
|
+// @GetMapping("done-user-list")
|
|
|
|
+// @Operation(summary = "获取 Done 综测审批已办任务个人")
|
|
|
|
+// @PreAuthorize("@ss.hasPermission('eve:task:query')")
|
|
|
|
+// public CommonResult<List<asTaskRespVO>> getTaskDoneByPeople(@Valid BpmTaskPageReqVO pageVO) {
|
|
|
|
+//
|
|
|
|
+// Long startUserId = pageVO.getUserId();
|
|
|
|
+// List<AidingStudentsPersonManageDO> achievementList
|
|
|
|
+// = aidingStudentsPersonManageService.getAchievementByPeopleAndManageId(startUserId,pageVO.getManageId());
|
|
|
|
+//
|
|
|
|
+// Map<String, AchievementDO> achievementDOMap = convertMap(achievementList,AidingStudentsPersonManageDO::getProcessInstanceId);
|
|
|
|
+// Collection<String> processInstanceIds = convertSet(achievementList,AidingStudentsPersonManageDO::getProcessInstanceId);
|
|
|
|
+//
|
|
|
|
+// List<HistoricTaskInstance> pageResult
|
|
|
|
+// = taskService.getTaskDoneByPeopleAndProcessInstanceIds(getLoginUserId(), pageVO , processInstanceIds);
|
|
|
|
+//
|
|
|
|
+// // 使用 Stream API 来处理
|
|
|
|
+// Map<String, HistoricTaskInstance> latestTasks = pageResult.stream()
|
|
|
|
+// .collect(Collectors.toMap(
|
|
|
|
+// HistoricTaskInstance::getProcessInstanceId,
|
|
|
|
+// task -> task,
|
|
|
|
+// (existingTask, newTask) -> newTask.getEndTime().after(existingTask.getEndTime()) ? newTask : existingTask
|
|
|
|
+// ));
|
|
|
|
+//
|
|
|
|
+// pageResult.removeIf(task -> !latestTasks.get(task.getProcessInstanceId()).equals(task));
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// if (CollUtil.isEmpty(pageResult)) {
|
|
|
|
+// return success(null);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// Map<String, HistoricProcessInstance> processInstanceMap = processInstanceService.getHistoricProcessInstanceMap(
|
|
|
|
+// convertSet(pageResult, HistoricTaskInstance::getProcessInstanceId));
|
|
|
|
+// Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
|
|
|
|
+// convertSet(processInstanceMap.values(), instance -> Long.valueOf(instance.getStartUserId())));
|
|
|
|
+//
|
|
|
|
+// return success(eveTaskConvert.INSTANCE.buildTaskDoneByPeople(pageResult, processInstanceMap, userMap,achievementDOMap));
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @PutMapping("/approve")
|
|
|
|
+// @Operation(summary = "通过单项综测审批")
|
|
|
|
+// @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
+// public CommonResult<Boolean> approveTask(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
|
|
|
|
+// taskService.approveTaskAchievement(getLoginUserId(), reqVO);
|
|
|
|
+// return success(true);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @PutMapping("/approve-edit")
|
|
|
|
+// @Operation(summary = "单项审批修改")
|
|
|
|
+// @PreAuthorize("@ss.hasPermission('eve:achievement:update')")
|
|
|
|
+// public CommonResult<Boolean> approveTaskEdit(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
|
|
|
|
+// taskService.approveTaskAchievement(getLoginUserId(), reqVO);
|
|
|
|
+// return success(true);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @PutMapping("/approve-people")
|
|
|
|
+// @Operation(summary = "整体通过综测审批")
|
|
|
|
+// @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
+// public CommonResult<Boolean> approveTaskByPeople(@Valid @RequestBody List<BpmTaskApproveReqVO> reqVOList) {
|
|
|
|
+// taskService.approveTaskAchievementByPeople(getLoginUserId(), reqVOList);
|
|
|
|
+//
|
|
|
|
+// return success(true);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @PostMapping("/approve-college-rank")
|
|
|
|
+// @Operation(summary = "学院针对当前完成互评状态的条目进行审核并发起公示和排名")
|
|
|
|
+// @PreAuthorize("@ss.hasPermission('eve:comprehensive-college-manage:update')")
|
|
|
|
+// @Transactional
|
|
|
|
+// public CommonResult<Boolean> approveTaskAndRankByCollege(@Valid @RequestBody BpmTaskPageReqVO pageVO) {
|
|
|
|
+// Long deptId = adminUserApi.getUser(getLoginUserId()).getDeptId();
|
|
|
|
+// Long collegeId = deptApi.getCollegeId(deptId);
|
|
|
|
+// DeptRespDTO dept = deptApi.getDept(collegeId);
|
|
|
|
+// ComprehensiveCollegeManageDO comprehensiveCollegeManage
|
|
|
|
+// = comprehensiveCollegeManageService.getComprehensiveCollegeManage(pageVO.getManageId(), collegeId);
|
|
|
|
+//
|
|
|
|
+// if(comprehensiveCollegeManage.getComStatus() != 1){
|
|
|
|
+// throw exception(ALREADY_PUBLICIZED);
|
|
|
|
+// }
|
|
|
|
+// comprehensiveCollegeManage.setComStatus(2);
|
|
|
|
+// comprehensiveCollegeManageService.updateComprehensiveCollegeManage(
|
|
|
|
+// BeanUtils.toBean(comprehensiveCollegeManage, ComprehensiveCollegeManageSaveReqVO.class)
|
|
|
|
+// );
|
|
|
|
+// List<Task> pageResult = taskService.getTaskTodoPageComprehensive(getLoginUserId(), pageVO);
|
|
|
|
+//
|
|
|
|
+// if (CollUtil.isEmpty(pageResult)) {
|
|
|
|
+// return success(null);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// List<AchievementDO> achievementList = achievementService.getAchievementByProcessInstanceIds(
|
|
|
|
+// convertList(pageResult,Task::getProcessInstanceId),pageVO.getManageId());
|
|
|
|
+//
|
|
|
|
+// List<BpmTaskApproveReqVO> vpPageResult = new ArrayList<>();
|
|
|
|
+//
|
|
|
|
+// for (Task respVO : pageResult) {
|
|
|
|
+// for(AchievementDO achievement : achievementList){
|
|
|
|
+// if(achievement.getProcessInstanceId().equals(respVO.getProcessInstanceId())){
|
|
|
|
+// BpmTaskApproveReqVO eveRespVO = BeanUtils.toBean(respVO, BpmTaskApproveReqVO.class);
|
|
|
|
+// vpPageResult.add(eveRespVO);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// taskService.approveTaskAchievementByPeople(getLoginUserId(), vpPageResult);
|
|
|
|
+//
|
|
|
|
+// comprehensiveService.comprehensiveCalculateByCollegeID(
|
|
|
|
+// collegeId,pageVO.getManageId(),1 , "学院公示"
|
|
|
|
+// );
|
|
|
|
+//
|
|
|
|
+// comprehensiveService.comprehensiveRanking(collegeId,dept.getBs(),pageVO.getManageId());
|
|
|
|
+//
|
|
|
|
+// return success(true);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @GetMapping("/approve-college")
|
|
|
|
+// @Operation(summary = "学院确认(即批量通过当前状态为学院公示的审批)")
|
|
|
|
+// @PreAuthorize("@ss.hasPermission('eve:comprehensive-college-manage:update')")
|
|
|
|
+// @Transactional
|
|
|
|
+// public CommonResult<Boolean> approveTaskByCollege(@Valid BpmTaskPageReqVO pageVO) {
|
|
|
|
+// List<Task> pageResult = taskService.getTaskTodoPageComprehensive(getLoginUserId(), pageVO);
|
|
|
|
+// if (CollUtil.isEmpty(pageResult)) {
|
|
|
|
+// return success(null);
|
|
|
|
+// }
|
|
|
|
+// Long deptId = adminUserApi.getUser(SecurityFrameworkUtils.getLoginUserId()).getDeptId();
|
|
|
|
+// Long collegeId = deptApi.getCollegeId(deptId);
|
|
|
|
+// ComprehensiveCollegeManageDO comprehensiveCollegeManage
|
|
|
|
+// = comprehensiveCollegeManageService.getComprehensiveCollegeManage(pageVO.getManageId(), collegeId);
|
|
|
|
+// if(comprehensiveCollegeManage.getComStatus() != 2){
|
|
|
|
+// throw exception(PLEASE_START_PUBLICIZED);
|
|
|
|
+// }
|
|
|
|
+// comprehensiveCollegeManageService.updateComprehensiveCollegeManage(
|
|
|
|
+// BeanUtils.toBean(comprehensiveCollegeManage.setComStatus(3), ComprehensiveCollegeManageSaveReqVO.class)
|
|
|
|
+// );
|
|
|
|
+// List<AchievementDO> achievementList = achievementService.getAchievementByProcessInstanceIds(
|
|
|
|
+// convertList(pageResult,Task::getProcessInstanceId),pageVO.getManageId());
|
|
|
|
+//
|
|
|
|
+// List<BpmTaskApproveReqVO> vpPageResult = new ArrayList<>();
|
|
|
|
+//
|
|
|
|
+// for (Task respVO : pageResult) {
|
|
|
|
+// for(AchievementDO achievement : achievementList){
|
|
|
|
+// if(achievement.getProcessInstanceId().equals(respVO.getProcessInstanceId())){
|
|
|
|
+// BpmTaskApproveReqVO eveRespVO = BeanUtils.toBean(respVO, BpmTaskApproveReqVO.class);
|
|
|
|
+// vpPageResult.add(eveRespVO);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// taskService.approveTaskAchievementByPeople(getLoginUserId(), vpPageResult);
|
|
|
|
+// return success(true);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @PutMapping("/reject-update")
|
|
|
|
+// @Operation(summary = "不通过任务:驳回到审批人处")
|
|
|
|
+// @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
+// public CommonResult<Boolean> rejectAchievementTask(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
|
|
|
|
+// taskService.rejectAchievementTask(getLoginUserId(), reqVO);
|
|
|
|
+//
|
|
|
|
+// return success(true);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @PutMapping("/reject-people-update")
|
|
|
|
+// @Operation(summary = "整体不通过任务:驳回到审批人处")
|
|
|
|
+// @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
+// public CommonResult<Boolean> rejectAchievementTaskByPeople(@Valid @RequestBody List<BpmTaskApproveReqVO> reqVOList) {
|
|
|
|
+// taskService.rejectAchievementTaskByPeople(getLoginUserId(), reqVOList);
|
|
|
|
+// return success(true);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @PutMapping("/reject")
|
|
|
|
+// @Operation(summary = "不通过任务:直接结束流程")
|
|
|
|
+// @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
+// public CommonResult<Boolean> rejectTask(@Valid @RequestBody BpmTaskRejectReqVO reqVO) {
|
|
|
|
+// taskService.rejectTask(getLoginUserId(), reqVO);
|
|
|
|
+// return success(true);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @PutMapping("/reject-people")
|
|
|
|
+// @Operation(summary = "整体不通过综测审批:直接结束流程")
|
|
|
|
+// @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
+// public CommonResult<Boolean> rejectTaskByPeople(@Valid @RequestBody List<BpmTaskRejectReqVO> reqVOList) {
|
|
// taskService.rejectTaskByPeople(getLoginUserId(), reqVOList);
|
|
// taskService.rejectTaskByPeople(getLoginUserId(), reqVOList);
|
|
-
|
|
|
|
-// return error(400,"改流程不能修改!");
|
|
|
|
-
|
|
|
|
- return success(true);
|
|
|
|
- }
|
|
|
|
|
|
+// return success(true);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @PutMapping("/reject-undo")
|
|
|
|
+// @Operation(summary = "在下一个人审批前退回审批")
|
|
|
|
+// @PreAuthorize("@ss.hasPermission('eve:task:update')")
|
|
|
|
+// public CommonResult<Boolean> rejectUndoTask(@Valid @RequestBody BpmTaskUndoReqVO reqVO) {
|
|
|
|
+// taskService.UndoTask(getLoginUserId(), reqVO);
|
|
|
|
+//// taskService.rejectTaskByPeople(getLoginUserId(), reqVOList);
|
|
|
|
+//
|
|
|
|
+//// return error(400,"改流程不能修改!");
|
|
|
|
+//
|
|
|
|
+// return success(true);
|
|
|
|
+// }
|
|
|
|
|
|
}
|
|
}
|