Browse Source

实习管理

dzx 5 months ago
parent
commit
cf040bd09e

+ 10 - 3
src/main/java/com/xjrsoft/module/internship/controller/InternshipPlanManageParticipantController.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xjrsoft.common.annotation.XjrLog;
 import com.xjrsoft.common.model.result.RT;
-import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.module.internship.dto.AddInternshipPlanManageParticipantDto;
 import com.xjrsoft.module.internship.dto.EvaluateInternshipPlanManageParticipantDto;
@@ -16,7 +15,6 @@ import com.xjrsoft.module.internship.entity.InternshipPlanManageParticipant;
 import com.xjrsoft.module.internship.service.IInternshipPlanManageParticipantService;
 import com.xjrsoft.module.internship.vo.InternshipPlanManageParticipantPageVo;
 import com.xjrsoft.module.internship.vo.InternshipPlanManageParticipantVo;
-import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -47,11 +45,20 @@ public class InternshipPlanManageParticipantController {
 
     private final IInternshipPlanManageParticipantService internshipPlanManageParticipantService;
 
+    @GetMapping(value = "/page")
+    @ApiOperation(value="所有参与人(分页)")
+    @SaCheckPermission("internshipplanmanageparticipant:detail")
+    @XjrLog(value = "所有参与人(分页)")
+    public RT<PageOutput<InternshipPlanManageParticipantPageVo>> page(@Valid InternshipPlanManageParticipantPageDto dto){
+        PageOutput<InternshipPlanManageParticipantPageVo> pageOutput = internshipPlanManageParticipantService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        return RT.ok(pageOutput);
+    }
+
     @GetMapping(value = "/team-student-page")
     @ApiOperation(value="实习计划参与人表列表(分页)")
     @SaCheckPermission("internshipplanmanageparticipant:detail")
     @XjrLog(value = "实习计划参与人表列表(分页)")
-    public RT<PageOutput<InternshipPlanManageParticipantPageVo>> page(@Valid InternshipPlanManageParticipantPageDto dto){
+    public RT<PageOutput<InternshipPlanManageParticipantPageVo>> teamStudentPage(@Valid InternshipPlanManageParticipantPageDto dto){
         PageOutput<InternshipPlanManageParticipantPageVo> pageOutput = internshipPlanManageParticipantService.getTeamStudentPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
         return RT.ok(pageOutput);
     }

+ 2 - 0
src/main/java/com/xjrsoft/module/internship/service/IInternshipPlanManageParticipantService.java

@@ -25,4 +25,6 @@ public interface IInternshipPlanManageParticipantService extends MPJBaseService<
     PageOutput<InternshipPlanManageParticipantPageVo> getChooseStudentPage(Page<BaseStudentInfoPageVo> page, InternshipPlanManageParticipantPageDto dto);
 
     PageOutput<InternshipPlanManageParticipantPageVo> getTeamStudentPage(Page<BaseStudentInfoPageVo> page, InternshipPlanManageParticipantPageDto dto);
+
+    PageOutput<InternshipPlanManageParticipantPageVo> getPage(Page<BaseStudentInfoPageVo> page, InternshipPlanManageParticipantPageDto dto);
 }

+ 19 - 1
src/main/java/com/xjrsoft/module/internship/service/impl/InternshipPlanManageParticipantServiceImpl.java

@@ -189,7 +189,25 @@ public class InternshipPlanManageParticipantServiceImpl extends MPJBaseServiceIm
                         .eq(InternshipPlanManageParticipant::getTeacherId, teacherId)
         );
 
-        Map<Long, String> collect = list.stream().collect(Collectors.toMap(InternshipPlanManageParticipant::getParticipantUserId, InternshipPlanManageParticipant::getResult));
+        Map<Long, String> collect = list.stream().filter(x -> x.getResult() != null).collect(Collectors.toMap(InternshipPlanManageParticipant::getParticipantUserId, InternshipPlanManageParticipant::getResult));
+
+        BaseStudentInfoPageDto studentInfoPageDto = new BaseStudentInfoPageDto();
+        studentInfoPageDto.setInIds(list.stream().map(InternshipPlanManageParticipant::getParticipantUserId).collect(Collectors.toList()));
+        studentInfoPageDto.setKeyWord(dto.getKeyword());
+
+        Page<BaseStudentInfoPageVo> mobilePage = baseStudentSchoolRollService.getMobilePage(page, studentInfoPageDto);
+        PageOutput<InternshipPlanManageParticipantPageVo> pageOutput = ConventPage.getPageOutput(mobilePage, InternshipPlanManageParticipantPageVo.class);
+        for (InternshipPlanManageParticipantPageVo vo : pageOutput.getList()) {
+            vo.setEvaluateResult(collect.get(vo.getId()));
+        }
+        return pageOutput;
+    }
+
+    @Override
+    public PageOutput<InternshipPlanManageParticipantPageVo> getPage(Page<BaseStudentInfoPageVo> page, InternshipPlanManageParticipantPageDto dto) {
+        List<InternshipPlanManageParticipant> list = this.list();
+
+        Map<Long, String> collect = list.stream().filter(x -> x.getResult() != null).collect(Collectors.toMap(InternshipPlanManageParticipant::getParticipantUserId, InternshipPlanManageParticipant::getResult));
 
         BaseStudentInfoPageDto studentInfoPageDto = new BaseStudentInfoPageDto();
         studentInfoPageDto.setInIds(list.stream().map(InternshipPlanManageParticipant::getParticipantUserId).collect(Collectors.toList()));