Browse Source

学生实习记录

dzx 5 months ago
parent
commit
7417f11a32

+ 8 - 4
src/main/java/com/xjrsoft/module/internship/controller/InternshipPlanManageParticipantController.java

@@ -2,6 +2,7 @@ package com.xjrsoft.module.internship.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
+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;
@@ -50,9 +51,8 @@ public class InternshipPlanManageParticipantController {
     @ApiOperation(value="实习计划参与人表列表(分页)")
     @SaCheckPermission("internshipplanmanageparticipant:detail")
     @XjrLog(value = "实习计划参与人表列表(分页)")
-    public RT<PageOutput<BaseStudentInfoPageVo>> page(@Valid InternshipPlanManageParticipantPageDto dto){
-        Page<BaseStudentInfoPageVo> teamStudentPage = internshipPlanManageParticipantService.getTeamStudentPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
-        PageOutput<BaseStudentInfoPageVo> pageOutput = ConventPage.getPageOutput(teamStudentPage, BaseStudentInfoPageVo.class);
+    public RT<PageOutput<InternshipPlanManageParticipantPageVo>> page(@Valid InternshipPlanManageParticipantPageDto dto){
+        PageOutput<InternshipPlanManageParticipantPageVo> pageOutput = internshipPlanManageParticipantService.getTeamStudentPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
         return RT.ok(pageOutput);
     }
 
@@ -101,7 +101,11 @@ public class InternshipPlanManageParticipantController {
     @SaCheckPermission("internshipplanmanageparticipant:evaluate")
     @XjrLog(value = "评价学生实习")
     public RT<Boolean> evaluate(@Valid @RequestBody EvaluateInternshipPlanManageParticipantDto dto){
-        InternshipPlanManageParticipant participant = internshipPlanManageParticipantService.getById(dto.getId());
+        InternshipPlanManageParticipant participant = internshipPlanManageParticipantService.getOne(
+                new QueryWrapper<InternshipPlanManageParticipant>().lambda()
+                        .eq(InternshipPlanManageParticipant::getInternshipPlanManageId, dto.getInternshipPlanManageId())
+                        .eq(InternshipPlanManageParticipant::getParticipantUserId, dto.getId())
+        );
         participant.setResult(dto.getResult());
         internshipPlanManageParticipantService.updateById(participant);
         return RT.ok(true);

+ 3 - 0
src/main/java/com/xjrsoft/module/internship/dto/EvaluateInternshipPlanManageParticipantDto.java

@@ -28,4 +28,7 @@ public class EvaluateInternshipPlanManageParticipantDto implements Serializable
     @ApiModelProperty("实习结果评价")
     private String result;
 
+    @ApiModelProperty("实习评价id")
+    private Long internshipPlanManageId;
+
 }

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

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

+ 11 - 2
src/main/java/com/xjrsoft/module/internship/service/impl/InternshipPlanManageParticipantServiceImpl.java

@@ -180,7 +180,7 @@ public class InternshipPlanManageParticipantServiceImpl extends MPJBaseServiceIm
      * @return
      */
     @Override
-    public Page<BaseStudentInfoPageVo> getTeamStudentPage(Page<BaseStudentInfoPageVo> page, InternshipPlanManageParticipantPageDto dto) {
+    public PageOutput<InternshipPlanManageParticipantPageVo> getTeamStudentPage(Page<BaseStudentInfoPageVo> page, InternshipPlanManageParticipantPageDto dto) {
         long teacherId = StpUtil.getLoginIdAsLong();
 
         List<InternshipPlanManageParticipant> list = this.list(
@@ -188,9 +188,18 @@ public class InternshipPlanManageParticipantServiceImpl extends MPJBaseServiceIm
                         .eq(InternshipPlanManageParticipant::getInternshipPlanManageId, dto.getInternshipPlanManageId())
                         .eq(InternshipPlanManageParticipant::getTeacherId, teacherId)
         );
+
+        Map<Long, String> collect = list.stream().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());
-        return baseStudentSchoolRollService.getMobilePage(page, studentInfoPageDto);
+
+        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;
     }
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/internship/vo/InternshipPlanManageParticipantPageVo.java

@@ -110,4 +110,7 @@ public class InternshipPlanManageParticipantPageVo {
     @ApiModelProperty("是否已被选择(1:是 0:否)")
     private Integer isSelected;
 
+    @ApiModelProperty("评价结果")
+    private String evaluateResult;
+
 }