Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

dzx 1 год назад
Родитель
Сommit
2a41872d98

+ 38 - 5
src/main/java/com/xjrsoft/module/textbook/controller/TextbookStudentClaimController.java

@@ -64,14 +64,38 @@ public class TextbookStudentClaimController {
         return RT.ok(textbookStudentSemesterVoList);
     }
 
-    @GetMapping(value = "/teacher-check-byclass-list")
+    @GetMapping(value = "/teacher-check-byClass-list")
     @ApiOperation(value="教师教材领取按班级查看页面")
     @SaCheckPermission("textbookstudentclaim:detail")
-    public RT<List<TeacherCheckByclassVo>> teacherCheckByclassList(TeacherCheckByclassDto dto){
+    public RT<List<TeacherCheckByclassVo>> teacherCheckByClassList(@Valid TeacherCheckByclassDto dto){
         List<TeacherCheckByclassVo> teacherCheckByclassList = textbookStudentClaimService.getTeacherCheckByclassList(dto);
         return RT.ok(teacherCheckByclassList);
     }
 
+    @GetMapping(value = "/teacher-check-byStu-list")
+    @ApiOperation(value="教师教材领取按学生查看页面")
+    @SaCheckPermission("textbookstudentclaim:detail")
+    public RT<List<TeacherCheckByStuVo>> teacherCheckByStuList(@Valid TeacherCheckByStuDto dto){
+        List<TeacherCheckByStuVo> teacherCheckByStuList = textbookStudentClaimService.getTeacherCheckByStuList(dto);
+        return RT.ok(teacherCheckByStuList);
+    }
+
+    @GetMapping(value = "/teacher-check-stu-claim-list")
+    @ApiOperation(value="教师查看一本教材的学生领取情况页面")
+    @SaCheckPermission("textbookstudentclaim:detail")
+    public RT<List<TeacherCheckStuClaimVo>> teacherCheckStuClaimList(@Valid TeacherCheckStuClaimDto dto){
+        List<TeacherCheckStuClaimVo> teacherCheckStuClaimList = textbookStudentClaimService.getTeacherCheckStuClaimList(dto);
+        return RT.ok(teacherCheckStuClaimList);
+    }
+
+    @GetMapping(value = "/teacher-get-stu-noClaim-list")
+    @ApiOperation(value="班主任获取班上某个学生没有认领的教材记录")
+    @SaCheckPermission("textbookstudentclaim:detail")
+    public RT<List<TextbookClaimVO>> teacherGetStuNoClaimList(@RequestParam Long studentUserId){
+        List<TextbookClaimVO> textbookClaimVOList = textbookStudentClaimService.getTeacherGetStuNoClaimList(studentUserId);
+        return RT.ok(textbookClaimVOList);
+    }
+
     @GetMapping(value = "/info")
     @ApiOperation(value="根据id查询学生教材认领记录信息")
     @SaCheckPermission("textbookstudentclaim:detail")
@@ -103,13 +127,22 @@ public class TextbookStudentClaimController {
 
     }
 
-    @PutMapping("/confirmat")
-    @ApiOperation(value = "学生确认领取")
+    @PutMapping("/confirm")
+    @ApiOperation(value = "学生自己确认已经领取")
     @SaCheckPermission("textbookstudentclaim:edit")
-    public RT<Boolean> confirmat(@Valid @RequestBody List<Long> textbookStudentClaimIds){
+    public RT<Boolean> confirm(@Valid @RequestBody List<Long> textbookStudentClaimIds){
         return RT.ok(textbookStudentClaimService.updateByIds(textbookStudentClaimIds));
     }
 
+    @PutMapping("/teacher-confirm")
+    @ApiOperation(value = "教师帮助学生确认已经领取")
+    @SaCheckPermission("textbookstudentclaim:edit")
+    public RT<Boolean> teacherConfirm(@Valid @RequestBody TeacherConfirmDto dto){
+        TextbookStudentClaim textbookStudentClaim = BeanUtil.toBean(dto, TextbookStudentClaim.class);
+        textbookStudentClaim.setIsClaim(1);
+        textbookStudentClaim.setRemark(dto.getRemark());
+        return RT.ok(textbookStudentClaimService.updateById(textbookStudentClaim));
+    }
 
     @DeleteMapping
     @ApiOperation(value = "删除学生教材认领记录")

+ 30 - 0
src/main/java/com/xjrsoft/module/textbook/dto/TeacherCheckByStuDto.java

@@ -0,0 +1,30 @@
+package com.xjrsoft.module.textbook.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+* @title: 教师教材领取按学生查看页面入参
+* @Author szs
+* @Date: 2023-12-25
+* @Version 1.0
+*/
+@Data
+public class TeacherCheckByStuDto {
+    /**
+     * 学生用户编号
+     */
+    @ApiModelProperty("学生用户编号")
+    private Long studentUserId;
+    /**
+     * 班级编号
+     */
+    @ApiModelProperty(value = "班级编号",hidden = true)
+    private Long classId;
+    /**
+     * 领取情况(1=全部数据,2=该教材全部领取,3=该教材部分未领取)
+     */
+    @ApiModelProperty("领取情况")
+    private Integer claimStatus;
+}

+ 1 - 1
src/main/java/com/xjrsoft/module/textbook/dto/TeacherCheckByclassDto.java

@@ -21,5 +21,5 @@ public class TeacherCheckByclassDto{
      * 领取情况(1=全部数据,2=该教材全部领取,3=该教材部分未领取)
      */
     @ApiModelProperty("领取情况")
-    private Integer notclaimNum;
+    private Integer claimStatus;
 }

+ 25 - 0
src/main/java/com/xjrsoft/module/textbook/dto/TeacherCheckStuClaimDto.java

@@ -0,0 +1,25 @@
+package com.xjrsoft.module.textbook.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+* @title: 教师查看一本教材的学生领取情况页面入参
+* @Author szs
+* @Date: 2023-12-25
+* @Version 1.0
+*/
+@Data
+public class TeacherCheckStuClaimDto {
+    /**
+     * 教材主键编号
+     */
+    @ApiModelProperty(value = "教材主键编号")
+    private Long textbookId;
+    /**
+     * 班级编号
+     */
+    @ApiModelProperty(value = "班级编号",hidden = true)
+    private Long classId;
+}

+ 35 - 0
src/main/java/com/xjrsoft/module/textbook/dto/TeacherConfirmDto.java

@@ -0,0 +1,35 @@
+package com.xjrsoft.module.textbook.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+* @title: 教师帮助学生确认已经领取入参
+* @Author szs
+* @Date: 2023-12-25
+* @Version 1.0
+*/
+@Data
+public class TeacherConfirmDto {
+    /**
+     * 学生教材认领主键编号
+     */
+    @ApiModelProperty("学生教材认领主键编号")
+    private Long textbookStudentClaimId;
+    /**
+     * 教材主键编号
+     */
+    @ApiModelProperty(value = "教材主键编号")
+    private Long textbookId;
+    /**
+     * 学生id
+     */
+    @ApiModelProperty("学生id")
+    private Long studentUserId;
+    /**
+     * 备注
+     */
+    @ApiModelProperty("备注")
+    private String remark;
+}

+ 1 - 1
src/main/java/com/xjrsoft/module/textbook/dto/TextbookClaimStudentConfirmDto.java

@@ -21,7 +21,7 @@ public class TextbookClaimStudentConfirmDto {
     /**
      * 当前用户的id
      */
-    @ApiModelProperty(value = "学期ID(base_semester)",hidden = true)
+    @ApiModelProperty(value = "当前用户的id",hidden = true)
     private Long studentUserId;
     /**
      * 查看还是确认(1 = 查看,2 = 确认)

+ 9 - 3
src/main/java/com/xjrsoft/module/textbook/mapper/TextbookStudentClaimMapper.java

@@ -1,11 +1,11 @@
 package com.xjrsoft.module.textbook.mapper;
 
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.textbook.dto.TeacherCheckByStuDto;
+import com.xjrsoft.module.textbook.dto.TeacherCheckStuClaimDto;
 import com.xjrsoft.module.textbook.dto.TextbookClaimStudentConfirmDto;
 import com.xjrsoft.module.textbook.entity.TextbookStudentClaim;
-import com.xjrsoft.module.textbook.vo.TeacherCheckByclassVo;
-import com.xjrsoft.module.textbook.vo.TextbookClaimVO;
-import com.xjrsoft.module.textbook.vo.TextbookStudentSemesterVo;
+import com.xjrsoft.module.textbook.vo.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -25,4 +25,10 @@ public interface TextbookStudentClaimMapper extends MPJBaseMapper<TextbookStuden
     List<TeacherCheckByclassVo> getTeacherCheckByclassList(Long classId);
 
     List<TextbookStudentSemesterVo> getStudentSemesterList(Long studentUserId);
+
+    List<TeacherCheckStuClaimVo> getTeacherCheckStuClaimList(@Param("dto")TeacherCheckStuClaimDto dto);
+
+    List<TeacherCheckByStuVo> getTeacherCheckByStuList(@Param("dto")TeacherCheckByStuDto dto);
+
+    List<TextbookClaimVO> getTextbookClaimVOList(Long classId, Long studentUserId);
 }

+ 38 - 5
src/main/java/com/xjrsoft/module/textbook/service/ITextbookStudentClaimService.java

@@ -1,12 +1,9 @@
 package com.xjrsoft.module.textbook.service;
 
 import com.github.yulichang.base.MPJBaseService;
-import com.xjrsoft.module.textbook.dto.TeacherCheckByclassDto;
-import com.xjrsoft.module.textbook.dto.TextbookClaimStudentConfirmDto;
+import com.xjrsoft.module.textbook.dto.*;
 import com.xjrsoft.module.textbook.entity.TextbookStudentClaim;
-import com.xjrsoft.module.textbook.vo.TeacherCheckByclassVo;
-import com.xjrsoft.module.textbook.vo.TextbookClaimStudentConfirmVo;
-import com.xjrsoft.module.textbook.vo.TextbookStudentSemesterVo;
+import com.xjrsoft.module.textbook.vo.*;
 
 import java.util.List;
 
@@ -26,9 +23,45 @@ public interface ITextbookStudentClaimService extends MPJBaseService<TextbookStu
      */
     TextbookClaimStudentConfirmVo  getStudentConfirmList(TextbookClaimStudentConfirmDto dto);
 
+    /**
+     * 学生教材领取学期页面
+     * @return
+     */
     List<TextbookStudentSemesterVo> getStudentSemesterList();
 
+    /**
+     * 教师教材领取按班级查看页面
+     * @param dto
+     * @return
+     */
     List<TeacherCheckByclassVo> getTeacherCheckByclassList(TeacherCheckByclassDto dto);
 
+    /**
+     * 教师教材领取按班级查看页面
+     * @param dto
+     * @return
+     */
+    List<TeacherCheckByStuVo> getTeacherCheckByStuList(TeacherCheckByStuDto dto);
+
+    /**
+     * 学生自己确认已经领取
+     * @param textbookStudentClaimIds
+     * @return
+     */
     Boolean updateByIds(List<Long> textbookStudentClaimIds);
+
+    /**
+     * 教师查看一本教材的学生领取情况页面
+     * @param dto
+     * @return
+     */
+    List<TeacherCheckStuClaimVo> getTeacherCheckStuClaimList(TeacherCheckStuClaimDto dto);
+
+    /**
+     * 教师查看一本教材的学生领取情况页面
+     * @param 
+     * @return
+     */
+    List<TextbookClaimVO> getTeacherGetStuNoClaimList(Long studentUserId);
+
 }

+ 140 - 5
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookStudentClaimServiceImpl.java

@@ -7,6 +7,7 @@ import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.enums.ClaimTypeEnum;
 import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.base.service.IBaseClassService;
@@ -16,8 +17,11 @@ import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.teacher.entity.AttendanceRecord;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.teacher.mapper.XjrUserMapper;
+import com.xjrsoft.module.textbook.dto.TeacherCheckByStuDto;
 import com.xjrsoft.module.textbook.dto.TeacherCheckByclassDto;
+import com.xjrsoft.module.textbook.dto.TeacherCheckStuClaimDto;
 import com.xjrsoft.module.textbook.dto.TextbookClaimStudentConfirmDto;
+import com.xjrsoft.module.textbook.entity.Textbook;
 import com.xjrsoft.module.textbook.entity.TextbookStudentClaim;
 import com.xjrsoft.module.textbook.entity.WfTextbookClaim;
 import com.xjrsoft.module.textbook.entity.WfTextbookClaimItem;
@@ -25,10 +29,7 @@ import com.xjrsoft.module.textbook.mapper.TextbookStudentClaimMapper;
 import com.xjrsoft.module.textbook.mapper.WfTextbookClaimItemMapper;
 import com.xjrsoft.module.textbook.mapper.WfTextbookClaimMapper;
 import com.xjrsoft.module.textbook.service.ITextbookStudentClaimService;
-import com.xjrsoft.module.textbook.vo.TeacherCheckByclassVo;
-import com.xjrsoft.module.textbook.vo.TextbookClaimStudentConfirmVo;
-import com.xjrsoft.module.textbook.vo.TextbookClaimVO;
-import com.xjrsoft.module.textbook.vo.TextbookStudentSemesterVo;
+import com.xjrsoft.module.textbook.vo.*;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -134,6 +135,11 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
         //将班上所有发放的教材进行分组,查询出list集合
         List<TeacherCheckByclassVo> teacherCheckByclassVoList = textbookStudentClaimMapper.getTeacherCheckByclassList(classId);
 
+        if(ObjectUtil.isNull(teacherCheckByclassVoList) || teacherCheckByclassVoList.size() == 0){
+            throw new MyException("未找到教材领取数据");
+        }
+
+        //为每种教材添加统计值
         //实际领取教材数量
         //根据班主任ID和班级ID找到所有班主任为该班申请的教材的所有申领记录,申领类型应该为学生
         LambdaQueryWrapper<WfTextbookClaim> queryWrapperWfTextbookClaim = new LambdaQueryWrapper<>();
@@ -171,14 +177,111 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
             queryWrapperTextbookStudentClaimCount
                     .in(TextbookStudentClaim::getClassId,classId)
                     .eq(TextbookStudentClaim::getTextbookId, t.getTextbookId())
-                    .eq(TextbookStudentClaim::getIsClaim, 1);
+                    .eq(TextbookStudentClaim::getIsClaim, 1);;
             Long count = this.count(queryWrapperTextbookStudentClaimCount);
             t.setActualClaimNum(count);
         }
 
+        Integer claimStatus = 1;
+        //根据领取情况入参返回不同状态的数据
+        if(ObjectUtil.isNotNull(dto.getClaimStatus())){
+            claimStatus = dto.getClaimStatus();
+        }
+
+        List<TeacherCheckByclassVo> result = new ArrayList<>();
+
+        if (claimStatus == 2){
+            for (TeacherCheckByclassVo t : teacherCheckByclassVoList) {
+                if (t.getClassStudentNum().compareTo(t.getActualReceivedNum()) == 0 && Long.valueOf(t.getClassStudentNum()).compareTo(t.getActualClaimNum()) == 0){
+                    result.add(t);
+                }
+            }
+            return result;
+        }
+
+        if (claimStatus == 3){
+            for (TeacherCheckByclassVo t : teacherCheckByclassVoList) {
+                if (t.getClassStudentNum().compareTo(t.getActualReceivedNum()) > 0 || Long.valueOf(t.getClassStudentNum()).compareTo(t.getActualClaimNum()) > 0){
+                    result.add(t);
+                }
+            }
+            return result;
+        }
+
+
+
         return teacherCheckByclassVoList;
     }
 
+    @Override
+    public List<TeacherCheckByStuVo> getTeacherCheckByStuList(TeacherCheckByStuDto dto) {
+        //根据当前班主任用户查出所管理的班级Id
+        LambdaQueryWrapper<BaseClass> queryWrapperClassId = new LambdaQueryWrapper<>();
+        queryWrapperClassId
+                .eq(BaseClass::getTeacherId,StpUtil.getLoginIdAsLong());
+        BaseClass baseClass = baseClassService.getOne(queryWrapperClassId);
+        if(ObjectUtil.isNull(baseClass)){
+            throw new MyException("班级信息获取失败");
+        }
+        Long classId = baseClass.getId();
+
+        dto.setClassId(classId);
+
+        //将班上所有学生进行分组,查询出list集合
+        List<TeacherCheckByStuVo> teacherCheckByStuVoList = textbookStudentClaimMapper.getTeacherCheckByStuList(dto);
+
+        if(ObjectUtil.isNull(teacherCheckByStuVoList) || teacherCheckByStuVoList.size() == 0){
+            throw new MyException("未找到学生数据");
+        }
+
+        //为每个学生添加教材领取记录集合
+        for (TeacherCheckByStuVo t: teacherCheckByStuVoList) {
+            List<TextbookClaimVO> textbookClaimVOList = textbookStudentClaimMapper.getTextbookClaimVOList(classId,t.getStudentUserId());
+            t.setTextbookClaimVOList(textbookClaimVOList);
+        }
+
+        Integer claimStatus = 1;
+        //根据领取情况入参返回不同状态的数据
+        if(ObjectUtil.isNotNull(dto.getClaimStatus())){
+            claimStatus = dto.getClaimStatus();
+        }
+
+        List<TeacherCheckByStuVo> result = new ArrayList<>();
+
+        if (claimStatus == 2){
+            for (TeacherCheckByStuVo t : teacherCheckByStuVoList) {
+                int claimNum = 0;
+                for (TextbookClaimVO textbookClaimVO : t.getTextbookClaimVOList()) {
+                    if (textbookClaimVO.getIsClaim() == 1){
+                        claimNum++;
+                    }
+                }
+                if(claimNum == t.getTextbookClaimVOList().size()){//全部领取
+                    result.add(t);
+                }
+            }
+            return result;
+        }
+
+        if (claimStatus == 3){
+            for (TeacherCheckByStuVo t : teacherCheckByStuVoList) {
+                int claimNum = 0;
+                for (TextbookClaimVO textbookClaimVO : t.getTextbookClaimVOList()) {
+                    if (textbookClaimVO.getIsClaim() == 1){
+                        claimNum++;
+                    }
+                }
+                if(claimNum < t.getTextbookClaimVOList().size()){//部分未领取
+                    result.add(t);
+                }
+            }
+            return result;
+        }
+
+        return teacherCheckByStuVoList;
+    }
+
+
     @Override
     @Transactional
     public Boolean updateByIds(List<Long> textbookStudentClaimIds) {
@@ -190,4 +293,36 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
         }
         return true;
     }
+
+    @Override
+    public List<TeacherCheckStuClaimVo> getTeacherCheckStuClaimList(TeacherCheckStuClaimDto dto) {
+        //根据当前班主任用户查出所管理的班级Id
+        LambdaQueryWrapper<BaseClass> queryWrapperClassId = new LambdaQueryWrapper<>();
+        queryWrapperClassId
+                .eq(BaseClass::getTeacherId,StpUtil.getLoginIdAsLong());
+        BaseClass baseClass = baseClassService.getOne(queryWrapperClassId);
+        if(ObjectUtil.isNull(baseClass)){
+            throw new MyException("班级信息获取失败");
+        }
+        Long classId = baseClass.getId();
+
+        dto.setClassId(classId);
+
+        List<TeacherCheckStuClaimVo> teacherCheckStuClaimVos = textbookStudentClaimMapper.getTeacherCheckStuClaimList(dto);
+        return teacherCheckStuClaimVos;
+    }
+
+    @Override
+    public List<TextbookClaimVO> getTeacherGetStuNoClaimList( Long studentUserId) {
+        MPJLambdaWrapper<TextbookStudentClaim> queryTextbookClaimVOList = new MPJLambdaWrapper<>();
+        queryTextbookClaimVOList
+                .selectAs(TextbookStudentClaim::getId, TextbookClaimVO::getTextbookStudentClaimId)
+                .selectAs(Textbook::getBookName, TextbookClaimVO::getBookName)
+                .select(TextbookStudentClaim.class, x -> VoToColumnUtil.fieldsToColumns(TextbookClaimVO.class).contains(x.getProperty()))
+                .leftJoin(Textbook.class, Textbook::getId, TextbookStudentClaim::getTextbookId)
+                .eq(TextbookStudentClaim::getStudentUserId, studentUserId)
+                .disableSubLogicDel();
+        List<TextbookClaimVO> textbookClaimVOList = this.selectJoinList(TextbookClaimVO.class, queryTextbookClaimVOList);
+        return textbookClaimVOList;
+    }
 }

+ 38 - 0
src/main/java/com/xjrsoft/module/textbook/vo/TeacherCheckByStuVo.java

@@ -0,0 +1,38 @@
+package com.xjrsoft.module.textbook.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+* @title: 教师教材领取按学生查看页面出参
+* @Author szs
+* @Date: 2023-12-26
+* @Version 1.0
+*/
+@Data
+public class TeacherCheckByStuVo {
+
+    /**
+     * 学生用户编号
+     */
+    @ApiModelProperty("学生用户编号")
+    private Long studentUserId;
+    /**
+     * 学生用户编号
+     */
+    @ApiModelProperty("学生用户编号")
+    private String studentUserIdCN;
+    /**
+     * 学号
+     */
+    @ApiModelProperty("学号")
+    private String studentId;
+
+    /**
+     * 学生教材领取记录集合
+     */
+    @ApiModelProperty("学生教材领取记录集合")
+    List<TextbookClaimVO> textbookClaimVOList;
+}

+ 50 - 0
src/main/java/com/xjrsoft/module/textbook/vo/TeacherCheckStuClaimVo.java

@@ -0,0 +1,50 @@
+package com.xjrsoft.module.textbook.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 教师查看一本教材的学生领取情况页面出参
+* @Author szs
+* @Date: 2023-12-26
+* @Version 1.0
+*/
+@Data
+public class TeacherCheckStuClaimVo {
+
+    /**
+     * 学生教材认领主键编号
+     */
+    @ApiModelProperty("学生教材认领主键编号")
+    private Long textbookStudentClaimId;
+    /**
+    * 教材主键编号
+    */
+    @ApiModelProperty("教材主键编号")
+    private Long textbookId;
+    /**
+     * 教材名称
+     */
+    @ApiModelProperty("教材名称")
+    private String bookName;
+    /**
+     * 学生id
+     */
+    @ApiModelProperty("学生id")
+    private Long studentUserId;
+    /**
+     * 学生学号
+     */
+    @ApiModelProperty("学生学号")
+    private String studentId;
+    /**
+     * 学生姓名
+     */
+    @ApiModelProperty("学生姓名")
+    private String studentName;
+    /**
+    * 是否领取(1:已领取 0:未领取)
+    */
+    @ApiModelProperty("是否领取(1:已领取 0:未领取)")
+    private Integer isClaim;
+}

+ 1 - 1
src/main/java/com/xjrsoft/module/textbook/vo/TextbookClaimVO.java

@@ -18,7 +18,7 @@ public class TextbookClaimVO {
      * 学生教材认领主键编号
      */
     @ApiModelProperty("学生教材认领主键编号")
-    private String textbookStudentClaimId;
+    private Long textbookStudentClaimId;
     /**
      * 序号
      */

+ 52 - 2
src/main/resources/mapper/textbook/TextbookStudentClaimMapper.xml

@@ -48,10 +48,60 @@
                t4.total_student   AS classStudentNum
         FROM textbook t
                  LEFT JOIN base_semester t3 ON (t3.id = t.base_semester_id)
-                 LEFT JOIN base_class_major_set t4 ON (t4.class_id = 567891198765118)
+                 LEFT JOIN base_class_major_set t4 ON (t4.class_id = #{classId})
         WHERE t.delete_mark = 0 and t.id in (SELECT textbook_id
                                              FROM textbook_student_claim
-                                             WHERE delete_mark = 0 AND class_id = 567891198765118
+                                             WHERE delete_mark = 0 AND class_id = #{classId}
                                              GROUP BY textbook_id)
     </select>
+
+    <select id="getTeacherCheckStuClaimList" parameterType="com.xjrsoft.module.textbook.dto.TeacherCheckStuClaimDto"
+            resultType="com.xjrsoft.module.textbook.vo.TeacherCheckStuClaimVo">
+        SELECT
+            t.id as textbookStudentClaimId,
+            t.textbook_id,
+               t1.book_name as bookName,
+               t.student_user_id,
+               t2.student_id as studentId,
+               t3.name as studentName,
+               t.is_claim
+        FROM textbook_student_claim t
+                 LEFT JOIN textbook t1 ON (t1.id = t.textbook_id)
+                 LEFT JOIN base_student t2 ON (t2.user_id = t.student_user_id)
+                 LEFT JOIN xjr_user t3 ON (t3.id = t.student_user_id)
+        WHERE t.delete_mark = 0
+            and t.class_id = #{dto.classId} and  t.textbook_id = #{dto.textbookId}
+        ORDER BY t.is_claim
+    </select>
+
+    <select id="getTeacherCheckByStuList" parameterType="com.xjrsoft.module.textbook.dto.TeacherCheckByStuDto"
+            resultType="com.xjrsoft.module.textbook.vo.TeacherCheckByStuVo">
+        SELECT
+        t.id,
+        t.name as studentUserIdCN,
+        t1.student_id as studentId
+        FROM xjr_user t
+        LEFT JOIN base_student t1 ON (t1.user_id = t.id)
+        where t.id in (SELECT student_user_id
+        FROM textbook_student_claim
+        WHERE delete_mark = 0
+        AND class_id = #{dto.classId}
+        GROUP BY student_user_id)
+        <if test="dto.studentUserId != null and dto.studentUserId != 0 and dto.studentUserId != ''">
+            t.id = #{dto.studentUserId}
+        </if>
+    </select>
+
+    <select id="getTextbookClaimVOList"
+            resultType="com.xjrsoft.module.textbook.vo.TextbookClaimVO">
+        SELECT
+            t.id as textbookStudentClaimId,
+            t.textbook_id,
+            t1.book_name as bookName,
+            t.is_claim
+        FROM textbook_student_claim t
+                 LEFT JOIN textbook t1 ON (t1.id = t.textbook_id)
+        where t.class_id = #{classId} and t.student_user_id = #{studentUserId}
+        ORDER BY t.is_claim
+    </select>
 </mapper>