Procházet zdrojové kódy

Merge branch 'pre'

dzx před 9 měsíci
rodič
revize
3a6ecc92ce
16 změnil soubory, kde provedl 770 přidání a 167 odebrání
  1. 4 1
      src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentAssessmentInspectionServiceImpl.java
  2. 11 4
      src/main/java/com/xjrsoft/module/textbook/controller/TextbookStudentClaimController.java
  3. 21 0
      src/main/java/com/xjrsoft/module/textbook/dto/StudentConfirmDetailDto.java
  4. 31 0
      src/main/java/com/xjrsoft/module/textbook/dto/StudentConfirmDto.java
  5. 1 1
      src/main/java/com/xjrsoft/module/textbook/dto/TeacherCheckByStuDto.java
  6. 8 4
      src/main/java/com/xjrsoft/module/textbook/dto/TeacherConfirmBatchByTextbookDto.java
  7. 25 0
      src/main/java/com/xjrsoft/module/textbook/dto/TeacherConfirmBatchTextbookListDto.java
  8. 3 0
      src/main/java/com/xjrsoft/module/textbook/dto/TextbookInstockroomListDto.java
  9. 5 1
      src/main/java/com/xjrsoft/module/textbook/service/ITextbookStudentClaimService.java
  10. 537 151
      src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookStudentClaimServiceImpl.java
  11. 2 0
      src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookSubscriptionServiceImpl.java
  12. 15 0
      src/main/java/com/xjrsoft/module/textbook/vo/HeadTeaLookClassBookCategoryDetailVo.java
  13. 25 0
      src/main/java/com/xjrsoft/module/textbook/vo/TeacherConfirmBatchTextbookListVo.java
  14. 11 5
      src/main/java/com/xjrsoft/module/textbook/vo/TextbookClaimStudentConfirmVo.java
  15. 39 0
      src/main/resources/sqlScript/20250212_sql.sql
  16. 32 0
      src/main/resources/sqlScript/学生异动视图.sql

+ 4 - 1
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentAssessmentInspectionServiceImpl.java

@@ -25,6 +25,7 @@ import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.common.utils.excel.ExcelMergeUtil;
+import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.mapper.BaseClassMapper;
 import com.xjrsoft.module.evaluate.dto.TeaEvaluateClassDto;
@@ -134,6 +135,8 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
 
     private final IQuotaFormulaRuleService quotaFormulaRuleService;
 
+    private final CommonPropertiesConfig commonPropertiesConfig;
+
     @Override
     public Page<BaseStudentAssessmentInspectionPageVo> getPage(Page<BaseStudentAssessmentInspectionPageDto> page, BaseStudentAssessmentInspectionPageDto dto) {
         Page<BaseStudentAssessmentInspectionPageVo> result = assessmentInspectionMapper.getPage(page, dto);
@@ -758,7 +761,7 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
             weChatSendMessageDto.setUserId(user.getOpenId());
             weChatSendMessageDto.setTemplateId(wechatTemplate);
             weChatSendMessageDto.setMsgId(IdUtil.getSnowflakeNextId() + "");
-
+            weChatSendMessageDto.setUrl(StrUtil.format("{}pages/student/mentinspection/index", commonPropertiesConfig.getDomainApp()));
             JSONObject data = new JSONObject();
             String thing4 = "";
             String thing1 = "";

+ 11 - 4
src/main/java/com/xjrsoft/module/textbook/controller/TextbookStudentClaimController.java

@@ -127,8 +127,8 @@ public class TextbookStudentClaimController {
     @PutMapping("/confirm")
     @ApiOperation(value = "学生自己确认已经领取")
     @SaCheckPermission("textbookstudentclaim:edit")
-    public RT<Boolean> confirm(@Valid @RequestBody List<Long> textbookStudentClaimIds){
-        return RT.ok(textbookStudentClaimService.updateByIds(textbookStudentClaimIds));
+    public RT<Boolean> studentConfirm(@Valid @RequestBody StudentConfirmDto dto){
+        return RT.ok(textbookStudentClaimService.studentConfirm(dto));
     }
 
     @PutMapping("/teacher-confirm")
@@ -138,11 +138,18 @@ public class TextbookStudentClaimController {
         return RT.ok( textbookStudentClaimService.teacherConfirm(teacherConfirmDtoList));
     }
 
+    @GetMapping(value = "/teacher-confirm-batch-textbook-list")
+    @ApiOperation(value="教师根据教材帮助学生批量确认已经领取教材列表")
+    @SaCheckPermission("textbookstudentclaim:detail")
+    public RT<List<TeacherConfirmBatchTextbookListVo>> teacherConfirmBatchTextbookList(@Valid TeacherConfirmBatchTextbookListDto dto){
+        return RT.ok(textbookStudentClaimService.teacherConfirmBatchTextbookList(dto));
+    }
+
     @PutMapping("/teacher-confirm-batch-by-textbook")
     @ApiOperation(value = "教师根据教材帮助学生批量确认已经领取")
     @SaCheckPermission("textbookstudentclaim:edit")
-    public RT<Boolean> teacherConfirmBatchBytTextbook(@Valid @RequestBody List<TeacherConfirmBatchByTextbookDto> dtos){
-        return RT.ok(textbookStudentClaimService.teacherConfirmBatchBytTextbook(dtos));
+    public RT<Boolean> teacherConfirmBatchBytTextbook(@Valid @RequestBody TeacherConfirmBatchByTextbookDto dto){
+        return RT.ok(textbookStudentClaimService.teacherConfirmBatchBytTextbook(dto));
     }
 
     @GetMapping(value = "/info")

+ 21 - 0
src/main/java/com/xjrsoft/module/textbook/dto/StudentConfirmDetailDto.java

@@ -0,0 +1,21 @@
+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 StudentConfirmDetailDto {
+
+    @ApiModelProperty(value = "教材主键编号")
+    private Long textbookId;
+
+    @ApiModelProperty("学生教材领取主键")
+    private Long textbookStudentClaimId;
+}

+ 31 - 0
src/main/java/com/xjrsoft/module/textbook/dto/StudentConfirmDto.java

@@ -0,0 +1,31 @@
+package com.xjrsoft.module.textbook.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+
+/**
+* @title: 教师帮助学生确认已经领取入参
+* @Author szs
+* @Date: 2023-12-25
+* @Version 1.0
+*/
+@Data
+public class StudentConfirmDto {
+    @ApiModelProperty(value = "学期主键编号")
+    private Long baseSemesterId;
+
+    @ApiModelProperty(value = "教材主键编号")
+    private List<StudentConfirmDetailDto> studentConfirmDetail;
+
+    @ApiModelProperty("备注")
+    private String remark;
+
+    @ApiModelProperty("是否领取(1:已领取 0:未领取)")
+    private Integer isClaim;
+
+
+
+}

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

@@ -27,7 +27,7 @@ public class TeacherCheckByStuDto extends PageInput {
      * 班级编号
      */
     @ApiModelProperty(value = "班级编号")
-    private List<Long> classIdList;
+    private Long classId;
     /**
      * 领取情况(1=全部数据,2=该学生教材全部领取,3=该学生教材部分未领取)
      */

+ 8 - 4
src/main/java/com/xjrsoft/module/textbook/dto/TeacherConfirmBatchByTextbookDto.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.List;
 
 @Data
 public class TeacherConfirmBatchByTextbookDto implements Serializable {
@@ -11,14 +12,17 @@ public class TeacherConfirmBatchByTextbookDto implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @ApiModelProperty("学期主键编号")
-    private Long baseSemesterId;;
-
-    @ApiModelProperty("教材主键编号")
-    private Long textbookId;
+    private Long baseSemesterId;
 
     @ApiModelProperty("班级主键编号")
     private Long classId;
 
+    @ApiModelProperty("教材主键编号")
+    private List<Long> textbookIds;
+
+    @ApiModelProperty("学生主键编号")
+    private List<Long> userIds;
+
     @ApiModelProperty("是否领取(1:已领取 0:未领取)")
     private Integer isClaim;
 }

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

@@ -0,0 +1,25 @@
+package com.xjrsoft.module.textbook.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+
+/**
+* @title: 教师教材领取按班级查看页面
+* @Author szs
+* @Date: 2023-12-25
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class TeacherConfirmBatchTextbookListDto {
+
+    @ApiModelProperty("学期主键编号")
+    private String baseSemesterId;
+
+    @ApiModelProperty(value = "班级编号")
+    private Long classId;
+}

+ 3 - 0
src/main/java/com/xjrsoft/module/textbook/dto/TextbookInstockroomListDto.java

@@ -31,6 +31,9 @@ public class TextbookInstockroomListDto {
      */
     @ApiModelProperty("书名")
     private String bookName;
+
+    @ApiModelProperty("issn")
+    private String issn;
     /**
      * 教材类型(xjr_dictionary_item[textbook_type])
      */

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

@@ -78,7 +78,11 @@ public interface ITextbookStudentClaimService extends MPJBaseService<TextbookStu
      */
     List<TextbookClaimVO> getTeacherGetStuNoClaimList(Long studentUserId);
 
-    Boolean teacherConfirmBatchBytTextbook(List<TeacherConfirmBatchByTextbookDto> dtos);
+    Boolean teacherConfirmBatchBytTextbook(TeacherConfirmBatchByTextbookDto dto);
 
     Boolean teacherConfirm(List<TeacherConfirmDto> dtos);
+
+    Boolean studentConfirm(StudentConfirmDto dto);
+
+    List<TeacherConfirmBatchTextbookListVo> teacherConfirmBatchTextbookList(TeacherConfirmBatchTextbookListDto dto);
 }

+ 537 - 151
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookStudentClaimServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.enums.ArchivesStatusEnum;
@@ -20,6 +21,7 @@ import com.xjrsoft.module.base.entity.BaseClassCourse;
 import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.base.mapper.BaseClassAdminCourseMapper;
 import com.xjrsoft.module.base.mapper.BaseClassCourseMapper;
+import com.xjrsoft.module.base.mapper.BaseSemesterMapper;
 import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseSemesterService;
 import com.xjrsoft.module.student.entity.BaseStudent;
@@ -37,6 +39,7 @@ import com.xjrsoft.module.textbook.entity.WfTextbookClaimItem;
 import com.xjrsoft.module.textbook.mapper.TextbookMapper;
 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.*;
 import lombok.AllArgsConstructor;
@@ -46,11 +49,9 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * @title: 学生教材认领记录
@@ -76,10 +77,14 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
 
     private final WfTextbookClaimItemMapper wfTextbookClaimItemMapper;
 
+    private final WfTextbookClaimMapper wfTextbookClaimMapper;
+
     private final BaseStudentSchoolRollMapper baseStudentSchoolRollMapper;
 
     private final TextbookMapper textbookMapper;
 
+    private final BaseSemesterMapper baseSemesterMapper;
+
     @Override
     public HeadTeaLookClassBookVo headTeaLookClassBook(HeadTeaLookClassBookDto dto) {
         HeadTeaLookClassBookVo result = new HeadTeaLookClassBookVo();
@@ -102,10 +107,10 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
                 .eq(WfTextbookClaim::getBaseSemesterId, dto.getBaseSemesterId())
                 .eq(WfTextbookClaim::getClassId, dto.getBaseClassId())
                 .eq(WfTextbookClaim::getClaimType, ClaimTypeEnum.ClaimClass.getCode())
-                ;
+        ;
         List<HeadTeaLookClassBookCategoryDetailVo> claimResultList = wfTextbookClaimItemMapper.selectJoinList(HeadTeaLookClassBookCategoryDetailVo.class, wfTextbookClaimItemMPJLambdaWrapper);
 
-        if(ObjectUtils.isEmpty(claimResultList)){
+        if (ObjectUtils.isEmpty(claimResultList)) {
             MPJLambdaWrapper<BaseClassCourse> baseClassCourseMPJLambdaWrapper = new MPJLambdaWrapper<>();
             baseClassCourseMPJLambdaWrapper
                     .disableSubLogicDel()
@@ -116,8 +121,8 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
                     .innerJoin(BaseClassAdminCourse.class, BaseClassAdminCourse::getId, BaseClassCourse::getClassId)
                     .innerJoin(Textbook.class, Textbook::getId, BaseClassCourse::getTextbookId)
                     .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, Textbook::getTextbookType,
-                        wrapper -> wrapper
-                                .selectAs(DictionaryDetail::getName, HeadTeaLookClassBookCategoryDetailVo::getTextbookTypeCn)
+                            wrapper -> wrapper
+                                    .selectAs(DictionaryDetail::getName, HeadTeaLookClassBookCategoryDetailVo::getTextbookTypeCn)
                     )
                     .eq(BaseClassAdminCourse::getBaseSemesterId, dto.getBaseSemesterId())
                     .eq(BaseClassAdminCourse::getClassId, dto.getBaseClassId())
@@ -125,7 +130,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
             claimResultList = baseClassCourseMapper.selectJoinList(HeadTeaLookClassBookCategoryDetailVo.class, baseClassCourseMPJLambdaWrapper);
         }
 
-        if(ObjectUtils.isNotEmpty(claimResultList)){
+        if (ObjectUtils.isNotEmpty(claimResultList)) {
             // 处理数据
             // 根据类型分组
             Map<String, List<HeadTeaLookClassBookCategoryDetailVo>> detailByCategoryMap = claimResultList.stream()
@@ -136,19 +141,19 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
             List<HeadTeaLookClassBookCategoryVo> categoryVos = new ArrayList<>();
             BigDecimal categoryTotalPrice;
             HeadTeaLookClassBookCategoryVo headTeaLookClassBookCategoryVo;
-            for (Map.Entry<String, List<HeadTeaLookClassBookCategoryDetailVo>> entry : detailByCategoryMap.entrySet()){
+            for (Map.Entry<String, List<HeadTeaLookClassBookCategoryDetailVo>> entry : detailByCategoryMap.entrySet()) {
                 String key = entry.getKey();
                 List<HeadTeaLookClassBookCategoryDetailVo> value = entry.getValue();
 
-                if(ObjectUtils.isNotEmpty(value)){
+                if (ObjectUtils.isNotEmpty(value)) {
                     headTeaLookClassBookCategoryVo = new HeadTeaLookClassBookCategoryVo();
                     headTeaLookClassBookCategoryVo.setTextbookType(key);
                     headTeaLookClassBookCategoryVo.setTextbookTypeCn(value.get(0).getTextbookTypeCn());
                     headTeaLookClassBookCategoryVo.setCategoryDetailVos(value);
 
                     categoryTotalPrice = BigDecimal.ZERO;
-                    for (HeadTeaLookClassBookCategoryDetailVo vo : value){
-                        if(ObjectUtils.isEmpty(vo.getPrice())){
+                    for (HeadTeaLookClassBookCategoryDetailVo vo : value) {
+                        if (ObjectUtils.isEmpty(vo.getPrice())) {
                             vo.setPrice(BigDecimal.ZERO);
                         }
                         categoryTotalPrice = categoryTotalPrice.add(vo.getPrice().multiply(BigDecimal.valueOf(vo.getClaimNum())));
@@ -181,74 +186,238 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
                 .leftJoin(BaseSemester.class, BaseSemester::getId, BaseClassAdminCourse::getBaseSemesterId)
                 .eq(BaseClass::getTeacherId, loginId)
                 .orderByDesc(BaseSemester::getName)
-                ;
+        ;
         return baseClassAdminCourseMapper.selectJoinList(HeadTeaLookClassBookSemesterVo.class, baseClassAdminCourseMPJLambdaWrapper);
     }
 
     @Override
     public TextbookClaimStudentConfirmVo getStudentConfirmList(TextbookClaimStudentConfirmDto dto) {
-        //获取当前登录学生的信息
-        MPJLambdaWrapper<XjrUser> queryUser = new MPJLambdaWrapper<>();
-        queryUser
+        // 获取学期
+        BaseSemester baseSemester = baseSemesterMapper.selectById(dto.getBaseSemesterId());
+
+        Long loginId = StpUtil.getLoginIdAsLong();
+
+        dto.setStudentUserId(loginId);
+        // 获取当前学生的信息
+        MPJLambdaWrapper<BaseStudentSchoolRoll> baseStudentSchoolRollMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        baseStudentSchoolRollMPJLambdaWrapper
                 .selectAs(XjrUser::getName, TextbookClaimStudentConfirmVo::getStudentName)
                 .selectAs(BaseStudent::getStudentId, TextbookClaimStudentConfirmVo::getStudentId)
                 .selectAs(BaseClass::getName, TextbookClaimStudentConfirmVo::getClassCN)
-                .leftJoin(BaseStudent.class, BaseStudent::getUserId, XjrUser::getId)
-                .leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, XjrUser::getId)
+                .selectAs(BaseStudentSchoolRoll::getClassId, TextbookClaimStudentConfirmVo::getClassId)
                 .leftJoin(BaseClass.class, BaseClass::getId, BaseStudentSchoolRoll::getClassId)
-                .eq(XjrUser::getId, StpUtil.getLoginIdAsLong())
-                .disableSubLogicDel()
-                .orderByDesc(AttendanceRecord::getId);
-        TextbookClaimStudentConfirmVo textbookClaimStudentConfirmVo = xjrUserMapper.selectJoinOne(TextbookClaimStudentConfirmVo.class, queryUser);
-        if (ObjectUtil.isNull(textbookClaimStudentConfirmVo)) {
-            throw new MyException("登录信息出错,请重新登录");
+                .leftJoin(XjrUser.class, XjrUser::getId, BaseStudentSchoolRoll::getUserId)
+                .leftJoin(BaseStudent.class, BaseStudent::getUserId, BaseStudentSchoolRoll::getUserId)
+                .eq(BaseStudentSchoolRoll::getUserId, loginId)
+                .last("limit 1")
+                ;
+        TextbookClaimStudentConfirmVo result = baseStudentSchoolRollMapper.selectJoinOne(TextbookClaimStudentConfirmVo.class, baseStudentSchoolRollMPJLambdaWrapper);
+
+        if(ObjectUtils.isEmpty(result)){
+            throw new MyException("用户信息错误,请重新登录");
+        }
+
+        if(ObjectUtils.isNotEmpty(baseSemester)){
+            result.setBaseSemesterCN(baseSemester.getName());
         }
 
-        //根据学期id查出学期名称
-        BaseSemester baseSemester = baseSemesterService.getById(dto.getBaseSemesterId());
-        textbookClaimStudentConfirmVo.setBaseSemesterCN(baseSemester.getName());
+        // 学生查看自己的教材来源于两个方面,一个是班级申领教材,一个是个人申领的教材
+        // 班级申领教材
+        MPJLambdaWrapper<WfTextbookClaimItem> classMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        classMPJLambdaWrapper
+                .disableSubLogicDel()
+                .selectAs(WfTextbookClaimItem::getTextbookId, HeadTeaLookClassBookCategoryDetailVo::getTextbookId)
+                .selectAs(Textbook::getBookName, HeadTeaLookClassBookCategoryDetailVo::getBookName)
+                .selectAs(Textbook::getPrice, HeadTeaLookClassBookCategoryDetailVo::getPrice)
+                .selectAs(Textbook::getTextbookType, HeadTeaLookClassBookCategoryDetailVo::getTextbookType)
+                .selectAs(WfTextbookClaimItem::getCreateDate, HeadTeaLookClassBookCategoryDetailVo::getClaimTime)
+                .selectAs(WfTextbookClaim::getClaimType, HeadTeaLookClassBookCategoryDetailVo::getClaimType)
+                .select("1 as claim_num")
+                .innerJoin(WfTextbookClaim.class, WfTextbookClaim::getId, WfTextbookClaimItem::getWfTextbookClaimId)
+                .innerJoin(Textbook.class, Textbook::getId, WfTextbookClaimItem::getTextbookId)
+                .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, Textbook::getTextbookType,
+                        wrapper -> wrapper
+                                .selectAs(DictionaryDetail::getName, HeadTeaLookClassBookCategoryDetailVo::getTextbookTypeCn)
+                )
+                .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, WfTextbookClaim::getClaimType,
+                        wrapper -> wrapper
+                                .selectAs(DictionaryDetail::getName, HeadTeaLookClassBookCategoryDetailVo::getClaimTypeCn)
+                )
+                .eq(WfTextbookClaim::getBaseSemesterId, dto.getBaseSemesterId())
+                .eq(WfTextbookClaim::getClassId, result.getClassId())
+                .eq(WfTextbookClaim::getClaimType, ClaimTypeEnum.ClaimClass.getCode())
+        ;
+        List<HeadTeaLookClassBookCategoryDetailVo> classList = wfTextbookClaimItemMapper.selectJoinList(HeadTeaLookClassBookCategoryDetailVo.class, classMPJLambdaWrapper);
+
+        MPJLambdaWrapper<WfTextbookClaimItem> personalMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        personalMPJLambdaWrapper
+                .disableSubLogicDel()
+                .selectAs(WfTextbookClaimItem::getTextbookId, HeadTeaLookClassBookCategoryDetailVo::getTextbookId)
+                .selectAs(Textbook::getBookName, HeadTeaLookClassBookCategoryDetailVo::getBookName)
+                .selectAs(Textbook::getPrice, HeadTeaLookClassBookCategoryDetailVo::getPrice)
+                .selectAs(Textbook::getTextbookType, HeadTeaLookClassBookCategoryDetailVo::getTextbookType)
+                .selectAs(WfTextbookClaimItem::getCreateDate, HeadTeaLookClassBookCategoryDetailVo::getClaimTime)
+                .selectAs(WfTextbookClaim::getClaimType, HeadTeaLookClassBookCategoryDetailVo::getClaimType)
+                .select("1 as claim_num")
+                .innerJoin(WfTextbookClaim.class, WfTextbookClaim::getId, WfTextbookClaimItem::getWfTextbookClaimId)
+                .innerJoin(Textbook.class, Textbook::getId, WfTextbookClaimItem::getTextbookId)
+                .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, Textbook::getTextbookType,
+                        wrapper -> wrapper
+                                .selectAs(DictionaryDetail::getName, HeadTeaLookClassBookCategoryDetailVo::getTextbookTypeCn)
+                )
+                .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, WfTextbookClaim::getClaimType,
+                        wrapper -> wrapper
+                                .selectAs(DictionaryDetail::getName, HeadTeaLookClassBookCategoryDetailVo::getClaimTypeCn)
+                )
+                .eq(WfTextbookClaim::getBaseSemesterId, dto.getBaseSemesterId())
+                .eq(WfTextbookClaim::getApplicantUserId, dto.getStudentUserId())
+                .eq(WfTextbookClaim::getClaimType, ClaimTypeEnum.ClaimStudent.getCode())
+        ;
+        List<HeadTeaLookClassBookCategoryDetailVo> personalList = wfTextbookClaimItemMapper.selectJoinList(HeadTeaLookClassBookCategoryDetailVo.class, personalMPJLambdaWrapper);
+
+        // 合并两个列表
+        List<HeadTeaLookClassBookCategoryDetailVo> mergedList = Stream.concat(classList.stream(), personalList.stream())
+                .collect(Collectors.toList());
+
+        // 根据 textbookId 去重
+        List<HeadTeaLookClassBookCategoryDetailVo> distinctList = new ArrayList<>(mergedList.stream()
+                .collect(Collectors.toMap(
+                        HeadTeaLookClassBookCategoryDetailVo::getTextbookId, // 以 textbookId 作为去重依据
+                        vo -> vo, // 保留原始对象
+                        (existing, replacement) -> existing // 如果重复,保留已存在的对象
+                ))
+                .values());
+
+        // 获取当前学生当前学期所有已经领取的数据
+        LambdaQueryWrapper<TextbookStudentClaim> textbookStudentClaimLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        textbookStudentClaimLambdaQueryWrapper
+                .eq(TextbookStudentClaim::getBaseSemesterId, dto.getBaseSemesterId())
+                .eq(TextbookStudentClaim::getStudentUserId, dto.getStudentUserId())
+                .eq(TextbookStudentClaim::getDeleteMark, DeleteMark.NODELETE.getCode())
+                ;
+        List<TextbookStudentClaim> textbookStudentClaimList = textbookStudentClaimMapper.selectList(textbookStudentClaimLambdaQueryWrapper);
+
+        Map<Long, TextbookStudentClaim> byTextbookId = textbookStudentClaimList.stream()
+                .collect(Collectors.toMap(TextbookStudentClaim::getTextbookId, t -> t, (t1, t2) -> t1));
+
+        if (ObjectUtils.isNotEmpty(distinctList)) {
+            // 处理数据
+            // 根据类型分组
+            Map<String, List<HeadTeaLookClassBookCategoryDetailVo>> detailByCategoryMap = distinctList.stream()
+                    .filter(detail -> StringUtils.isNotEmpty(detail.getTextbookType())) // Exclude entries where textbookType is null
+                    .collect(Collectors.groupingBy(HeadTeaLookClassBookCategoryDetailVo::getTextbookType));
 
-        dto.setStudentUserId(StpUtil.getLoginIdAsLong());
+            BigDecimal totalPrice = BigDecimal.ZERO;
+            List<HeadTeaLookClassBookCategoryVo> categoryVos = new ArrayList<>();
+            BigDecimal categoryTotalPrice;
+            HeadTeaLookClassBookCategoryVo headTeaLookClassBookCategoryVo;
+            TextbookStudentClaim textbookStudentClaim;
+            for (Map.Entry<String, List<HeadTeaLookClassBookCategoryDetailVo>> entry : detailByCategoryMap.entrySet()) {
+                String key = entry.getKey();
+                List<HeadTeaLookClassBookCategoryDetailVo> value = entry.getValue();
 
-        List<TextbookClaimVO> textbookClaimVOList = textbookStudentClaimMapper.getTextbookClaimList(dto);
+                if (ObjectUtils.isNotEmpty(value)) {
+                    headTeaLookClassBookCategoryVo = new HeadTeaLookClassBookCategoryVo();
+                    headTeaLookClassBookCategoryVo.setTextbookType(key);
+                    headTeaLookClassBookCategoryVo.setTextbookTypeCn(value.get(0).getTextbookTypeCn());
+                    headTeaLookClassBookCategoryVo.setCategoryDetailVos(value);
 
-        textbookClaimStudentConfirmVo.setTextbookClaimVoList(textbookClaimVOList);
-        return textbookClaimStudentConfirmVo;
+                    categoryTotalPrice = BigDecimal.ZERO;
+                    for (HeadTeaLookClassBookCategoryDetailVo vo : value) {
+                        textbookStudentClaim = byTextbookId.get(vo.getTextbookId());
+                        if(ObjectUtils.isNotEmpty(textbookStudentClaim)){
+                            vo.setTextbookStudentClaimId(textbookStudentClaim.getId());
+                            vo.setIsClaim(textbookStudentClaim.getIsClaim());
+                        }else {
+                            vo.setIsClaim(0);
+                        }
+                        if (ObjectUtils.isEmpty(vo.getPrice())) {
+                            vo.setPrice(BigDecimal.ZERO);
+                        }
+                        categoryTotalPrice = categoryTotalPrice.add(vo.getPrice().multiply(BigDecimal.valueOf(vo.getClaimNum())));
+                        totalPrice = totalPrice.add(vo.getPrice().multiply(BigDecimal.valueOf(vo.getClaimNum())));
+                    }
+                    headTeaLookClassBookCategoryVo.setCategoryTotalPrice(categoryTotalPrice);
+
+                    categoryVos.add(headTeaLookClassBookCategoryVo);
+                }
+
+                result.setTotalPrice(totalPrice);
+                result.setCategoryVos(categoryVos);
+            }
+        }
+        return result;
     }
 
     @Override
     public List<TextbookStudentSemesterVo> getStudentSemesterList() {
-        //获取当前学生领取记录的所有学期
-        MPJLambdaWrapper<TextbookStudentClaim> qwerySemester = new MPJLambdaWrapper<>();
-        qwerySemester
-                .distinct()
-                .disableSubLogicDel()
-                .selectAs(BaseSemester::getName, TextbookStudentSemesterVo::getBaseSemesterIdCN)
-                .select(TextbookStudentClaim.class, x -> VoToColumnUtil.fieldsToColumns(TextbookStudentSemesterVo.class).contains(x.getProperty()))
-                .innerJoin(BaseSemester.class, BaseSemester::getId, TextbookStudentClaim::getBaseSemesterId)
-                .eq(TextbookStudentClaim::getStudentUserId, StpUtil.getLoginIdAsLong());
-        List<TextbookStudentSemesterVo> textbookStudentSemesterVoList = this.selectJoinList(TextbookStudentSemesterVo.class, qwerySemester);
-        if (ObjectUtil.isNull(textbookStudentSemesterVoList) && textbookStudentSemesterVoList.isEmpty()) {
-            return null;
+        // 获取当前学生的信息
+        BaseStudentSchoolRoll baseStudentSchoolRoll = baseStudentSchoolRollMapper.selectOne(
+                Wrappers.lambdaQuery(BaseStudentSchoolRoll.class)
+                        .eq(BaseStudentSchoolRoll::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(BaseStudentSchoolRoll::getUserId, StpUtil.getLoginIdAsLong())
+        );
+
+        if(ObjectUtils.isEmpty(baseStudentSchoolRoll)){
+            throw new MyException("用户信息错误,请重新登录");
         }
 
-        //为每个学期添加未领取人数
-        for (TextbookStudentSemesterVo textbookStudentSemesterVo : textbookStudentSemesterVoList) {
-            LambdaQueryWrapper<TextbookStudentClaim> queryWrapperNotClaimNum = new LambdaQueryWrapper<>();
-            queryWrapperNotClaimNum
-                    .eq(TextbookStudentClaim::getStudentUserId, StpUtil.getLoginIdAsLong())
-                    .eq(TextbookStudentClaim::getBaseSemesterId, textbookStudentSemesterVo.getBaseSemesterId())
-                    .eq(TextbookStudentClaim::getIsClaim, 0);
-            Long notClaimNum = this.count(queryWrapperNotClaimNum);
-            textbookStudentSemesterVo.setNotClaimNum(notClaimNum);
-        }
-        return textbookStudentSemesterVoList;
+        // 学生查看自己的教材来源于两个方面,一个是班级申领教材,一个是个人申领的教材
+        // 班级申领教材
+        MPJLambdaWrapper<WfTextbookClaim>classMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        classMPJLambdaWrapper
+                .selectAs(WfTextbookClaim::getBaseSemesterId, TextbookStudentSemesterVo::getBaseSemesterId)
+                .selectAs(BaseSemester::getName, TextbookStudentSemesterVo::getBaseSemesterIdCN)
+                .leftJoin(BaseSemester.class, BaseSemester::getId, WfTextbookClaim::getBaseSemesterId)
+                .eq(WfTextbookClaim::getClassId, baseStudentSchoolRoll.getClassId())
+                .eq(WfTextbookClaim::getClaimType, ClaimTypeEnum.ClaimClass.getCode())
+                ;
+        List<TextbookStudentSemesterVo> classList = wfTextbookClaimMapper.selectJoinList(TextbookStudentSemesterVo.class, classMPJLambdaWrapper);
+
+        // 个人申领的教材
+        MPJLambdaWrapper<WfTextbookClaim> personalMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        personalMPJLambdaWrapper
+                .selectAs(WfTextbookClaim::getBaseSemesterId, TextbookStudentSemesterVo::getBaseSemesterId)
+                .selectAs(BaseSemester::getName, TextbookStudentSemesterVo::getBaseSemesterIdCN)
+                .leftJoin(BaseSemester.class, BaseSemester::getId, WfTextbookClaim::getBaseSemesterId)
+                .eq(WfTextbookClaim::getApplicantUserId, baseStudentSchoolRoll.getUserId())
+                .eq(WfTextbookClaim::getClaimType, ClaimTypeEnum.ClaimStudent.getCode())
+        ;
+        List<TextbookStudentSemesterVo> personalList = wfTextbookClaimMapper.selectJoinList(TextbookStudentSemesterVo.class, personalMPJLambdaWrapper);
+
+        // 合并两个列表
+        List<TextbookStudentSemesterVo> mergedList = Stream.concat(classList.stream(), personalList.stream())
+                .collect(Collectors.toList());
+
+        // 根据 baseSemesterId 去重
+        List<TextbookStudentSemesterVo> distinctList = new ArrayList<>(mergedList.stream()
+                .collect(Collectors.toMap(
+                        TextbookStudentSemesterVo::getBaseSemesterId, // 以 baseSemesterId 作为去重依据
+                        vo -> vo, // 保留原始对象
+                        (existing, replacement) -> existing // 如果重复,保留已存在的对象
+                ))
+                .values());
+
+        // 根据 baseSemesterIdCN 排序
+        distinctList.sort(Comparator.comparing(TextbookStudentSemesterVo::getBaseSemesterIdCN));
+
+//        //为每个学期添加未领取人数
+//        for (TextbookStudentSemesterVo textbookStudentSemesterVo : textbookStudentSemesterVoList) {
+//            LambdaQueryWrapper<TextbookStudentClaim> queryWrapperNotClaimNum = new LambdaQueryWrapper<>();
+//            queryWrapperNotClaimNum
+//                    .eq(TextbookStudentClaim::getStudentUserId, StpUtil.getLoginIdAsLong())
+//                    .eq(TextbookStudentClaim::getBaseSemesterId, textbookStudentSemesterVo.getBaseSemesterId())
+//                    .eq(TextbookStudentClaim::getIsClaim, 0);
+//            Long notClaimNum = this.count(queryWrapperNotClaimNum);
+//            textbookStudentSemesterVo.setNotClaimNum(notClaimNum);
+//        }
+        return distinctList;
     }
 
     @Override
     public IPage<TeacherCheckByclassVo> getTeacherCheckByclassList(TeacherCheckByclassDto dto) {
         // 如果没有传入班级id
-        if(ObjectUtils.isEmpty(dto.getClassIdList())){
+        if (ObjectUtils.isEmpty(dto.getClassIdList())) {
             //根据当前班主任用户查出所管理的班级Id
             LambdaQueryWrapper<BaseClass> queryWrapperClassId = new LambdaQueryWrapper<>();
             queryWrapperClassId
@@ -294,33 +463,18 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
 
     @Override
     public IPage<TeacherCheckByStuVo> getTeacherCheckByStuList(TeacherCheckByStuDto dto) {
-        // 如果没有传入班级id
-        if(ObjectUtils.isEmpty(dto.getClassIdList())) {
-            //根据当前班主任用户查出所管理的班级Id
-            LambdaQueryWrapper<BaseClass> queryWrapperClassId = new LambdaQueryWrapper<>();
-            queryWrapperClassId.eq(BaseClass::getTeacherId, StpUtil.getLoginIdAsLong());
-            List<BaseClass> baseClassList = baseClassService.list(queryWrapperClassId);
-            if (ObjectUtil.isNull(baseClassList) && baseClassList.isEmpty()) {
-                return null;
-            }
-
-            List<Long> classIdList = new ArrayList<>();
-            for (BaseClass baseClass : baseClassList) {
-                classIdList.add(baseClass.getId());
-            }
-            dto.setClassIdList(classIdList);
-        }
-
         // 获取班级申领的所有教材
         MPJLambdaWrapper<WfTextbookClaimItem> wfTextbookClaimItemMPJLambdaWrapper = new MPJLambdaWrapper<>();
         wfTextbookClaimItemMPJLambdaWrapper
+                .distinct()
                 .selectAs(WfTextbookClaim::getClassId, TextbookClaimVO::getTextbookStudentClaimId)
                 .selectAs(WfTextbookClaimItem::getTextbookId, TextbookClaimVO::getTextbookId)
                 .selectAs(Textbook::getBookName, TextbookClaimVO::getBookName)
                 .innerJoin(WfTextbookClaim.class, WfTextbookClaim::getId, WfTextbookClaimItem::getWfTextbookClaimId)
                 .leftJoin(Textbook.class, Textbook::getId, WfTextbookClaimItem::getTextbookId)
-                .in(WfTextbookClaim::getClassId, dto.getClassIdList())
+                .eq(WfTextbookClaim::getClassId, dto.getClassId())
                 .eq(WfTextbookClaim::getBaseSemesterId, dto.getBaseSemesterId())
+                .eq(WfTextbookClaim::getClaimType, ClaimTypeEnum.ClaimClass.getCode())
         ;
         List<TextbookClaimVO> textbookClaimVOList = wfTextbookClaimItemMapper.selectJoinList(TextbookClaimVO.class, wfTextbookClaimItemMPJLambdaWrapper);
 
@@ -331,7 +485,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
         LambdaQueryWrapper<TextbookStudentClaim> textbookStudentClaimLambdaQueryWrapper = new LambdaQueryWrapper<>();
         textbookStudentClaimLambdaQueryWrapper
                 .eq(TextbookStudentClaim::getBaseSemesterId, dto.getBaseSemesterId())
-                .in(TextbookStudentClaim::getClassId, dto.getClassIdList())
+                .eq(TextbookStudentClaim::getClassId, dto.getClassId())
                 .eq(TextbookStudentClaim::getDeleteMark, DeleteMark.NODELETE.getCode())
         ;
         List<TextbookStudentClaim> textbookStudentClaimList = textbookStudentClaimMapper.selectList(textbookStudentClaimLambdaQueryWrapper);
@@ -339,19 +493,41 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
         Map<String, TextbookStudentClaim> byClassIdAndUserIdAndBook = textbookStudentClaimList.stream()
                 .collect(Collectors.toMap(t -> "" + t.getStudentUserId() + t.getTextbookId(), t -> t, (t1, t2) -> t1));
 
-//       Map<Long, List<TextbookStudentClaim>> groupByUserId = textbookStudentClaimList.stream()
-//               .collect(Collectors.groupingBy(TextbookStudentClaim::get))
-//
-//        List<Long> userIds = recordsInPage.stream()
-//                .map(TeacherCheckByStuVo::getStudentUserId)
-//                .collect(Collectors.toList());
-//        if(ObjectUtils.isNotEmpty(dto.getClaimStatus())
-//            && dto.getClaimStatus() != 1
-//        ){
-//            // 获取已经完全领取的学生的id
-//            // 获取所有学生已经领取的教材的数量
-//            MPJLambdaWrapper<>
-//        }
+        Map<Long, List<TextbookStudentClaim>> groupByUserId = textbookStudentClaimList.stream()
+                .collect(Collectors.groupingBy(TextbookStudentClaim::getStudentUserId));
+
+        // 已经全部发完的用户
+        List<Long> allClaimUserIds = new ArrayList<>();
+        List<Long> partClaimUserIds = new ArrayList<>();
+        for (Map.Entry<Long, List<TextbookStudentClaim>> entry : groupByUserId.entrySet()) {
+            Long key = entry.getKey();
+            List<TextbookStudentClaim> value = entry.getValue();
+            if(ObjectUtils.isEmpty(value)){
+                continue;
+            }
+
+            Set<Long> distinctTextbookIds = value.stream()
+                    .filter(t -> t.getIsClaim() == 1)
+                    .map(TextbookStudentClaim::getTextbookId) // 提取 textbookId
+                    .collect(Collectors.toSet()); // 收集到 Set 中自动去重
+
+            TextbookStudentClaim one = value.get(0);
+            Long classId = one.getClassId();
+            if(ObjectUtils.isEmpty(classId)){
+                continue;
+            }
+
+            List<TextbookClaimVO> classTextbook = textbookByClassIdMap.get(classId);
+            if(ObjectUtils.isEmpty(classTextbook)){
+                continue;
+            }
+
+            if(distinctTextbookIds.size() == classTextbook.size()){
+                allClaimUserIds.add(key);
+            }else {
+                partClaimUserIds.add(key);
+            }
+        }
 
         // 获取班上所有在读学生
         MPJLambdaWrapper<BaseStudentSchoolRoll> baseStudentSchoolRollMPJLambdaWrapper = new MPJLambdaWrapper<>();
@@ -363,23 +539,44 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
                 .leftJoin(XjrUser.class, XjrUser::getId, BaseStudentSchoolRoll::getUserId)
                 .leftJoin(BaseStudent.class, BaseStudent::getUserId, BaseStudentSchoolRoll::getUserId)
                 .eq(BaseStudentSchoolRoll::getArchivesStatus, ArchivesStatusEnum.FB2901.getCode())
-                .in(BaseStudentSchoolRoll::getClassId, dto.getClassIdList())
-                .eq(ObjectUtils.isNotEmpty(dto.getStudentUserId()), BaseStudentSchoolRoll::getUserId, dto.getStudentUserId())
-                ;
+        ;
+        if(ObjectUtils.isNotEmpty(dto.getStudentUserId())){
+            baseStudentSchoolRollMPJLambdaWrapper
+                .eq(BaseStudentSchoolRoll::getUserId, dto.getStudentUserId());
+        } else if(ObjectUtils.isNotEmpty(dto.getClaimStatus()) && dto.getClaimStatus() == 2){
+            if(ObjectUtils.isEmpty(allClaimUserIds)){
+                return new Page<>();
+            }
+            baseStudentSchoolRollMPJLambdaWrapper
+                    .in(BaseStudentSchoolRoll::getUserId, allClaimUserIds);
+        } else if(ObjectUtils.isNotEmpty(dto.getClaimStatus()) && dto.getClaimStatus() == 3){
+            if(ObjectUtils.isEmpty(partClaimUserIds)){
+                return new Page<>();
+            }
+            baseStudentSchoolRollMPJLambdaWrapper
+                    .in(BaseStudentSchoolRoll::getUserId, partClaimUserIds);
+        } else {
+            if(ObjectUtils.isEmpty(dto.getClassId())){
+                return new Page<>();
+            }
+            baseStudentSchoolRollMPJLambdaWrapper
+                    .eq(BaseStudentSchoolRoll::getClassId, dto.getClassId());
+        }
+
         IPage<TeacherCheckByStuVo> teacherCheckByStuVoList = baseStudentSchoolRollMapper.selectJoinPage(ConventPage.getPage(dto), TeacherCheckByStuVo.class, baseStudentSchoolRollMPJLambdaWrapper);
 
         TextbookStudentClaim oldTextbookStudentClaim;
-        for (TeacherCheckByStuVo vo : teacherCheckByStuVoList.getRecords()){
+        for (TeacherCheckByStuVo vo : teacherCheckByStuVoList.getRecords()) {
             List<TextbookClaimVO> stuTextbooks = textbookByClassIdMap.get(vo.getClassId());
-            for (TextbookClaimVO textbookClaimVO : stuTextbooks){
+            for (TextbookClaimVO textbookClaimVO : stuTextbooks) {
                 textbookClaimVO.setTextbookStudentClaimId(null);
                 textbookClaimVO.setStudentUserId(vo.getStudentUserId());
                 String key = "" + vo.getStudentUserId() + textbookClaimVO.getTextbookId();
                 oldTextbookStudentClaim = byClassIdAndUserIdAndBook.get(key);
-                if(ObjectUtils.isNotEmpty(oldTextbookStudentClaim)){
+                if (ObjectUtils.isNotEmpty(oldTextbookStudentClaim)) {
                     textbookClaimVO.setTextbookStudentClaimId(oldTextbookStudentClaim.getId());
                     textbookClaimVO.setIsClaim(oldTextbookStudentClaim.getIsClaim());
-                }else {
+                } else {
                     textbookClaimVO.setIsClaim(0);
                 }
             }
@@ -414,7 +611,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
             setModifyUserId(StpUtil.getLoginIdAsLong());
             setModifyDate(new Date());
             setIsClaim(1);
-        }},Wrappers.<TextbookStudentClaim>query().lambda()
+        }}, Wrappers.<TextbookStudentClaim>query().lambda()
                 .in(TextbookStudentClaim::getId, textbookStudentClaimIds));
 //        for (Long textbookStudentClaimId : textbookStudentClaimIds) {
 //            this.updateById(new TextbookStudentClaim() {{
@@ -431,7 +628,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
     public List<TeacherCheckStuClaimVo> getTeacherCheckStuClaimList(TeacherCheckStuClaimDto dto) {
 //        List<TeacherCheckStuClaimVo> teacherCheckStuClaimVos = textbookStudentClaimMapper.getTeacherCheckStuClaimList(dto);
         Textbook textbook = textbookMapper.selectById(dto.getTextbookId());
-        if(ObjectUtils.isEmpty(textbook)){
+        if (ObjectUtils.isEmpty(textbook)) {
             throw new MyException("教材不存在,请刷新重试");
         }
 
@@ -465,26 +662,26 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
                 .eq(TextbookStudentClaim::getBaseSemesterId, dto.getBaseSemesterId())
                 .eq(TextbookStudentClaim::getTextbookId, dto.getTextbookId())
                 .eq(TextbookStudentClaim::getClassId, dto.getClassId())
-                ;
+        ;
         List<TeacherCheckStuClaimVo> isClaimList = textbookStudentClaimMapper.selectJoinList(TeacherCheckStuClaimVo.class, textbookStudentClaimMPJLambdaWrapper);
 
         Map<Long, TeacherCheckStuClaimVo> isClaimByUserIdMap = isClaimList.stream()
                 .collect(Collectors.toMap(TeacherCheckStuClaimVo::getStudentUserId, t -> t, (t1, t2) -> t1));
 
-        for (TeacherCheckStuClaimVo stu : stuList){
+        for (TeacherCheckStuClaimVo stu : stuList) {
             stu.setTextbookId(textbook.getId());
             stu.setBookName(textbook.getBookName());
 
             TeacherCheckStuClaimVo isClaim = isClaimByUserIdMap.get(stu.getStudentUserId());
-            if(ObjectUtils.isNotEmpty(isClaim)){
+            if (ObjectUtils.isNotEmpty(isClaim)) {
                 stu.setTextbookStudentClaimId(isClaim.getTextbookStudentClaimId());
                 stu.setIsClaim(isClaim.getIsClaim());
-                if(isClaim.getIsClaim() == 1){
+                if (isClaim.getIsClaim() == 1) {
                     result.add(stu);
-                }else {
+                } else {
                     result.add(0, stu);
                 }
-            }else {
+            } else {
                 stu.setIsClaim(0);
                 result.add(0, stu);
             }
@@ -497,51 +694,66 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
     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;
+        return this.selectJoinList(TextbookClaimVO.class, queryTextbookClaimVOList);
     }
 
     @Override
     @Transactional
-    public Boolean teacherConfirmBatchBytTextbook(List<TeacherConfirmBatchByTextbookDto> dtos) {
+    public Boolean teacherConfirmBatchBytTextbook(TeacherConfirmBatchByTextbookDto dto) {
+        // 根据学期,班级,学生,教材信息获取记录
+        LambdaQueryWrapper<TextbookStudentClaim> textbookStudentClaimLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        textbookStudentClaimLambdaQueryWrapper
+                .eq(TextbookStudentClaim::getBaseSemesterId, dto.getBaseSemesterId())
+                .eq(TextbookStudentClaim::getClassId, dto.getClassId())
+                .in(TextbookStudentClaim::getStudentUserId, dto.getUserIds())
+                .in(TextbookStudentClaim::getTextbookId, dto.getTextbookIds())
+        ;
+        List<TextbookStudentClaim> textbookStudentClaimList = textbookStudentClaimMapper.selectList(textbookStudentClaimLambdaQueryWrapper);
+
+        Map<String, TextbookStudentClaim> byUserIdAndTextbookId = textbookStudentClaimList.stream()
+                .collect(Collectors.toMap(t -> "" + t.getStudentUserId() + t.getTextbookId(), t -> t, (t1, t2) -> t1));
+
+
         List<TextbookStudentClaim> insertList = new ArrayList<>();
-        TextbookStudentClaim textbookStudentClaim;
-        for (TeacherConfirmBatchByTextbookDto dto : dtos) {
-            // 根据当前教材和当前班级获取到没有领取的学生
-            MPJLambdaWrapper<BaseStudentSchoolRoll> baseStudentSchoolRollMPJLambdaWrapper = new MPJLambdaWrapper<>();
-            baseStudentSchoolRollMPJLambdaWrapper
-                    .select(BaseStudentSchoolRoll::getId)
-                    .select(BaseStudentSchoolRoll.class,x -> VoToColumnUtil.fieldsToColumns(BaseStudentSchoolRoll.class).contains(x.getProperty()))
-                    .eq(BaseStudentSchoolRoll::getArchivesStatus, ArchivesStatusEnum.FB2901.getCode())
-                    .eq(BaseStudentSchoolRoll::getClassId, dto.getClassId())
-                    .notExists("SELECT 1" +
-                            "        FROM textbook_student_claim t1" +
-                            "        WHERE t1.student_user_id = t.user_id" +
-                            "          AND t1.base_semester_id = {0}" +
-                            "          AND t1.textbook_id = {1}" +
-                            "          AND t1.class_id = {2}", dto.getBaseSemesterId(), dto.getTextbookId(), dto.getClassId())
-                    ;
-            List<BaseStudentSchoolRoll> baseStudentSchoolRolls = baseStudentSchoolRollMapper.selectJoinList(BaseStudentSchoolRoll.class, baseStudentSchoolRollMPJLambdaWrapper);
-            if(ObjectUtils.isEmpty(baseStudentSchoolRolls)){
-                continue;
+        List<TextbookStudentClaim> updateList = new ArrayList<>();
+        TextbookStudentClaim oldTextbookStudentClaim;
+        TextbookStudentClaim insertTextbookStudentClaim;
+        TextbookStudentClaim updateTextbookStudentClaim;
+        Date nowDate = new Date();
+        Long loginUserId = StpUtil.getLoginIdAsLong();
+        for (Long textbookId : dto.getTextbookIds()){
+            for (Long userId : dto.getUserIds()){
+                oldTextbookStudentClaim = byUserIdAndTextbookId.get("" + userId + textbookId);
+                if(ObjectUtils.isNotEmpty(oldTextbookStudentClaim)){
+                    updateTextbookStudentClaim = new TextbookStudentClaim();
+                    updateTextbookStudentClaim.setId(oldTextbookStudentClaim.getId());
+                    updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
+                    updateTextbookStudentClaim.setModifyDate(nowDate);
+                    updateTextbookStudentClaim.setModifyUserId(loginUserId);
+                    updateList.add(updateTextbookStudentClaim);
+                }else {
+                    insertTextbookStudentClaim = new TextbookStudentClaim();
+                    insertTextbookStudentClaim.setBaseSemesterId(dto.getBaseSemesterId());
+                    insertTextbookStudentClaim.setClassId(dto.getClassId());
+                    insertTextbookStudentClaim.setStudentUserId(userId);
+                    insertTextbookStudentClaim.setTextbookId(textbookId);
+                    insertTextbookStudentClaim.setIsClaim(dto.getIsClaim());
+                    insertTextbookStudentClaim.setCreateDate(nowDate);
+                    insertTextbookStudentClaim.setCreateUserId(loginUserId);
+                    insertList.add(insertTextbookStudentClaim);
+                }
             }
+        }
 
-            for (BaseStudentSchoolRoll baseStudentSchoolRoll : baseStudentSchoolRolls){
-                textbookStudentClaim = new TextbookStudentClaim();
-                textbookStudentClaim.setBaseSemesterId(dto.getBaseSemesterId());
-                textbookStudentClaim.setTextbookId(dto.getTextbookId());
-                textbookStudentClaim.setClassId(dto.getClassId());
-                textbookStudentClaim.setStudentUserId(baseStudentSchoolRoll.getUserId());
-                textbookStudentClaim.setIsClaim(ObjectUtils.isNotEmpty(dto.getIsClaim()) ? dto.getIsClaim() : 1);
-                textbookStudentClaim.setCreateUserId(StpUtil.getLoginIdAsLong());
-                textbookStudentClaim.setCreateDate(new Date());
-                insertList.add(textbookStudentClaim);
+        if (ObjectUtils.isNotEmpty(insertList)) {
+            for (TextbookStudentClaim insert : insertList) {
+                textbookStudentClaimMapper.insert(insert);
             }
         }
 
-        if(ObjectUtils.isNotEmpty(insertList)){
-            for (TextbookStudentClaim insert : insertList){
-                textbookStudentClaimMapper.insert(insert);
+        if (ObjectUtils.isNotEmpty(updateList)) {
+            for (TextbookStudentClaim update : updateList) {
+                textbookStudentClaimMapper.updateById(update);
             }
         }
 
@@ -551,22 +763,196 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
     @Override
     @Transactional
     public Boolean teacherConfirm(List<TeacherConfirmDto> dtos) {
-        TextbookStudentClaim textbookStudentClaim;
+        List<Long> baseSemesterIds = dtos.stream()
+                .map(TeacherConfirmDto::getBaseSemesterId)
+                .distinct()
+                .collect(Collectors.toList());
+
+        List<Long> classIds = dtos.stream()
+                .map(TeacherConfirmDto::getClassId)
+                .distinct()
+                .collect(Collectors.toList());
+
+        List<Long> textbookIds = dtos.stream()
+                .map(TeacherConfirmDto::getTextbookId)
+                .distinct()
+                .collect(Collectors.toList());
+
+        List<Long> studentUserIds = dtos.stream()
+                .map(TeacherConfirmDto::getStudentUserId)
+                .distinct()
+                .collect(Collectors.toList());
+
+        // 根据学期,班级,学生,教材信息获取记录
+        LambdaQueryWrapper<TextbookStudentClaim> textbookStudentClaimLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        textbookStudentClaimLambdaQueryWrapper
+                .in(TextbookStudentClaim::getBaseSemesterId, baseSemesterIds)
+                .in(TextbookStudentClaim::getClassId, classIds)
+                .in(TextbookStudentClaim::getStudentUserId, studentUserIds)
+                .in(TextbookStudentClaim::getTextbookId, textbookIds)
+        ;
+        List<TextbookStudentClaim> textbookStudentClaimList = textbookStudentClaimMapper.selectList(textbookStudentClaimLambdaQueryWrapper);
+
+        Map<String, TextbookStudentClaim> byUserIdAndTextbookId = textbookStudentClaimList.stream()
+                .collect(Collectors.toMap(t -> "" + t.getBaseSemesterId() + t.getClassId() + t.getStudentUserId() + t.getTextbookId(), t -> t, (t1, t2) -> t1));
+
+
+        List<TextbookStudentClaim> insertList = new ArrayList<>();
+        List<TextbookStudentClaim> updateList = new ArrayList<>();
+        TextbookStudentClaim oldTextbookStudentClaim;
+        TextbookStudentClaim insertTextbookStudentClaim;
+        TextbookStudentClaim updateTextbookStudentClaim;
+        Date nowDate = new Date();
+        Long loginUserId = StpUtil.getLoginIdAsLong();
         for (TeacherConfirmDto dto : dtos){
-            if(ObjectUtils.isNotEmpty(dto.getTextbookStudentClaimId()) && dto.getTextbookStudentClaimId() != 0){
-                textbookStudentClaim = new TextbookStudentClaim();
-                textbookStudentClaim.setId(dto.getTextbookStudentClaimId());
-                textbookStudentClaim.setIsClaim(dto.getIsClaim());
-                textbookStudentClaim.setModifyUserId(StpUtil.getLoginIdAsLong());
-                textbookStudentClaim.setModifyDate(new Date());
-                textbookStudentClaimMapper.updateById(textbookStudentClaim);
-            }else {
-                textbookStudentClaim = BeanUtil.toBean(dto, TextbookStudentClaim.class);
-                textbookStudentClaim.setCreateUserId(StpUtil.getLoginIdAsLong());
-                textbookStudentClaim.setCreateDate(new Date());
-                textbookStudentClaimMapper.insert(textbookStudentClaim);
+            if (ObjectUtils.isNotEmpty(dto.getTextbookStudentClaimId()) && dto.getTextbookStudentClaimId() != 0) {
+                updateTextbookStudentClaim = new TextbookStudentClaim();
+                updateTextbookStudentClaim.setId(dto.getTextbookStudentClaimId());
+                updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
+                updateTextbookStudentClaim.setModifyUserId(loginUserId);
+                updateTextbookStudentClaim.setModifyDate(nowDate);
+                updateList.add(updateTextbookStudentClaim);
+            } else {
+                oldTextbookStudentClaim = byUserIdAndTextbookId.get("" + dto.getBaseSemesterId() + dto.getClassId() + dto.getStudentUserId() + dto.getTextbookId());
+                if(ObjectUtils.isNotEmpty(oldTextbookStudentClaim)){
+                    updateTextbookStudentClaim = new TextbookStudentClaim();
+                    updateTextbookStudentClaim.setId(oldTextbookStudentClaim.getId());
+                    updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
+                    updateTextbookStudentClaim.setModifyDate(nowDate);
+                    updateTextbookStudentClaim.setModifyUserId(loginUserId);
+                    updateList.add(updateTextbookStudentClaim);
+                }else {
+                    insertTextbookStudentClaim = new TextbookStudentClaim();
+                    insertTextbookStudentClaim.setBaseSemesterId(dto.getBaseSemesterId());
+                    insertTextbookStudentClaim.setClassId(dto.getClassId());
+                    insertTextbookStudentClaim.setStudentUserId(dto.getStudentUserId());
+                    insertTextbookStudentClaim.setTextbookId(dto.getTextbookId());
+                    insertTextbookStudentClaim.setIsClaim(dto.getIsClaim());
+                    insertTextbookStudentClaim.setCreateDate(nowDate);
+                    insertTextbookStudentClaim.setCreateUserId(loginUserId);
+                    insertList.add(insertTextbookStudentClaim);
+                }
             }
         }
+
+        if (ObjectUtils.isNotEmpty(insertList)) {
+            for (TextbookStudentClaim insert : insertList) {
+                textbookStudentClaimMapper.insert(insert);
+            }
+        }
+
+        if (ObjectUtils.isNotEmpty(updateList)) {
+            for (TextbookStudentClaim update : updateList) {
+                textbookStudentClaimMapper.updateById(update);
+            }
+        }
+
         return true;
     }
+
+    @Override
+    public Boolean studentConfirm(StudentConfirmDto dto) {
+        Long loginId = StpUtil.getLoginIdAsLong();
+        // 获取当前学生的信息
+        LambdaQueryWrapper<BaseStudentSchoolRoll> baseStudentSchoolRollLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        baseStudentSchoolRollLambdaQueryWrapper
+                .eq(BaseStudentSchoolRoll::getUserId, loginId)
+                .eq(BaseStudentSchoolRoll::getDeleteMark, DeleteMark.NODELETE.getCode())
+                .last("limit 1")
+        ;
+        BaseStudentSchoolRoll baseStudentSchoolRoll = baseStudentSchoolRollMapper.selectOne(baseStudentSchoolRollLambdaQueryWrapper);
+
+        if(ObjectUtils.isEmpty(baseStudentSchoolRoll)){
+            throw new MyException("学生信息有误,请重新登录");
+        }
+
+        List<Long> textbookIds = dto.getStudentConfirmDetail().stream()
+                .map(StudentConfirmDetailDto::getTextbookId)
+                .collect(Collectors.toList());
+
+        if(ObjectUtils.isEmpty(textbookIds)){
+            throw new MyException("请选择需要确认的教材");
+        }
+
+        // 根据学期,班级,学生,教材信息获取记录
+        LambdaQueryWrapper<TextbookStudentClaim> textbookStudentClaimLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        textbookStudentClaimLambdaQueryWrapper
+                .eq(TextbookStudentClaim::getBaseSemesterId, dto.getBaseSemesterId())
+                .eq(TextbookStudentClaim::getClassId, baseStudentSchoolRoll.getClassId())
+                .eq(TextbookStudentClaim::getStudentUserId, baseStudentSchoolRoll.getUserId())
+                .in(TextbookStudentClaim::getTextbookId, textbookIds)
+        ;
+        List<TextbookStudentClaim> textbookStudentClaimList = textbookStudentClaimMapper.selectList(textbookStudentClaimLambdaQueryWrapper);
+
+        Map<String, TextbookStudentClaim> byUserIdAndTextbookId = textbookStudentClaimList.stream()
+                .collect(Collectors.toMap(t -> "" + t.getStudentUserId() + t.getTextbookId(), t -> t, (t1, t2) -> t1));
+
+        List<TextbookStudentClaim> insertList = new ArrayList<>();
+        List<TextbookStudentClaim> updateList = new ArrayList<>();
+        TextbookStudentClaim oldTextbookStudentClaim;
+        TextbookStudentClaim insertTextbookStudentClaim;
+        TextbookStudentClaim updateTextbookStudentClaim;
+        Date nowDate = new Date();
+        Long loginUserId = StpUtil.getLoginIdAsLong();
+        for (StudentConfirmDetailDto studentConfirmDetailDto : dto.getStudentConfirmDetail()){
+            if (ObjectUtils.isNotEmpty(studentConfirmDetailDto.getTextbookStudentClaimId()) && studentConfirmDetailDto.getTextbookStudentClaimId() != 0 ) {
+                updateTextbookStudentClaim = new TextbookStudentClaim();
+                updateTextbookStudentClaim.setId(studentConfirmDetailDto.getTextbookStudentClaimId());
+                updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
+                updateTextbookStudentClaim.setModifyUserId(loginUserId);
+                updateTextbookStudentClaim.setModifyDate(nowDate);
+                updateList.add(updateTextbookStudentClaim);
+            } else {
+                oldTextbookStudentClaim = byUserIdAndTextbookId.get("" + baseStudentSchoolRoll.getUserId() + studentConfirmDetailDto.getTextbookId());
+                if(ObjectUtils.isNotEmpty(oldTextbookStudentClaim)){
+                    updateTextbookStudentClaim = new TextbookStudentClaim();
+                    updateTextbookStudentClaim.setId(oldTextbookStudentClaim.getId());
+                    updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
+                    updateTextbookStudentClaim.setModifyDate(nowDate);
+                    updateTextbookStudentClaim.setModifyUserId(loginUserId);
+                    updateList.add(updateTextbookStudentClaim);
+                }else {
+                    insertTextbookStudentClaim = new TextbookStudentClaim();
+                    insertTextbookStudentClaim.setBaseSemesterId(dto.getBaseSemesterId());
+                    insertTextbookStudentClaim.setClassId(baseStudentSchoolRoll.getClassId());
+                    insertTextbookStudentClaim.setStudentUserId(baseStudentSchoolRoll.getUserId());
+                    insertTextbookStudentClaim.setTextbookId(studentConfirmDetailDto.getTextbookId());
+                    insertTextbookStudentClaim.setIsClaim(dto.getIsClaim());
+                    insertTextbookStudentClaim.setCreateDate(nowDate);
+                    insertTextbookStudentClaim.setCreateUserId(loginUserId);
+                    insertList.add(insertTextbookStudentClaim);
+                }
+            }
+        }
+
+        if (ObjectUtils.isNotEmpty(insertList)) {
+            for (TextbookStudentClaim insert : insertList) {
+                textbookStudentClaimMapper.insert(insert);
+            }
+        }
+
+        if (ObjectUtils.isNotEmpty(updateList)) {
+            for (TextbookStudentClaim update : updateList) {
+                textbookStudentClaimMapper.updateById(update);
+            }
+        }
+
+        return null;
+    }
+
+    @Override
+    public List<TeacherConfirmBatchTextbookListVo> teacherConfirmBatchTextbookList(TeacherConfirmBatchTextbookListDto dto) {
+        MPJLambdaWrapper<WfTextbookClaimItem> wfTextbookClaimItemMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        wfTextbookClaimItemMPJLambdaWrapper
+                .disableSubLogicDel()
+                .distinct()
+                .selectAs(WfTextbookClaimItem::getTextbookId, TeacherConfirmBatchTextbookListVo::getTextbookId)
+                .selectAs(Textbook::getBookName, TeacherConfirmBatchTextbookListVo::getBookName)
+                .innerJoin(WfTextbookClaim.class, WfTextbookClaim::getId, WfTextbookClaimItem::getWfTextbookClaimId)
+                .leftJoin(Textbook.class, Textbook::getId, WfTextbookClaimItem::getTextbookId)
+                .eq(WfTextbookClaim::getBaseSemesterId, dto.getBaseSemesterId())
+                .eq(WfTextbookClaim::getClassId, dto.getClassId())
+                ;
+        return wfTextbookClaimItemMapper.selectJoinList(TeacherConfirmBatchTextbookListVo.class, wfTextbookClaimItemMPJLambdaWrapper);
+    }
 }

+ 2 - 0
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookSubscriptionServiceImpl.java

@@ -149,6 +149,7 @@ public class TextbookSubscriptionServiceImpl extends MPJBaseServiceImpl<Textbook
                 .leftJoin(BaseCourseSubject.class, BaseCourseSubject::getId, Textbook::getCourseSubjectId,
                         wrapper -> wrapper
                                 .selectAs(BaseCourseSubject::getName, TextbookInstockroomListVo::getCourseName)
+                                .like(StringUtils.isNotEmpty(dto.getCourseName()), BaseCourseSubject::getName, dto.getCourseName())
                 )
                 .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, Textbook::getTextbookType,
                         wrapper -> wrapper
@@ -157,6 +158,7 @@ public class TextbookSubscriptionServiceImpl extends MPJBaseServiceImpl<Textbook
 
                 .eq(TextbookSubscriptionItem::getTextbookSubscriptionId, dto.getTextbookSubscriptionId())
                 .like(StringUtils.isNotEmpty(dto.getBookName()), Textbook::getBookName, dto.getBookName())
+                .like(StringUtils.isNotEmpty(dto.getIssn()), Textbook::getIssn, dto.getIssn())
                 .orderByAsc(TextbookSubscriptionItem::getInStockNum)
         ;
 

+ 15 - 0
src/main/java/com/xjrsoft/module/textbook/vo/HeadTeaLookClassBookCategoryDetailVo.java

@@ -9,6 +9,12 @@ import java.time.LocalDateTime;
 @Data
 public class HeadTeaLookClassBookCategoryDetailVo {
 
+    @ApiModelProperty("书名")
+    private Long textbookStudentClaimId;
+
+    @ApiModelProperty("书名")
+    private Long textbookId;
+
     @ApiModelProperty("书名")
     private String bookName;
 
@@ -26,4 +32,13 @@ public class HeadTeaLookClassBookCategoryDetailVo {
 
     @ApiModelProperty("申领数量")
     private Integer claimNum;
+
+    @ApiModelProperty("是否已经领取")
+    private Integer isClaim;
+
+    @ApiModelProperty("申领类型")
+    private String claimType;
+
+    @ApiModelProperty("申领类型")
+    private String claimTypeCn;
 }

+ 25 - 0
src/main/java/com/xjrsoft/module/textbook/vo/TeacherConfirmBatchTextbookListVo.java

@@ -0,0 +1,25 @@
+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 TeacherConfirmBatchTextbookListVo {
+
+    /**
+    * 教材主键编号
+    */
+    @ApiModelProperty("教材主键编号")
+    private Long textbookId;
+    /**
+     * 教材名称
+     */
+    @ApiModelProperty("教材名称")
+    private String bookName;
+}

+ 11 - 5
src/main/java/com/xjrsoft/module/textbook/vo/TextbookClaimStudentConfirmVo.java

@@ -3,6 +3,7 @@ package com.xjrsoft.module.textbook.vo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -14,11 +15,8 @@ import java.util.List;
 @Data
 public class TextbookClaimStudentConfirmVo {
 
-    /**
-     * 学生教材认领记录集合
-     */
-    @ApiModelProperty("学生教材认领记录集合")
-    private List<TextbookClaimVO> textbookClaimVoList;
+    @ApiModelProperty("教材教辅详细列表")
+    List<HeadTeaLookClassBookCategoryVo> categoryVos;
     /**
      * 学生姓名
      */
@@ -38,5 +36,13 @@ public class TextbookClaimStudentConfirmVo {
      * 班级
      */
     @ApiModelProperty("班级")
+    private Long classId;
+    /**
+     * 班级
+     */
+    @ApiModelProperty("班级")
     private String classCN;
+
+    @ApiModelProperty("教材教辅合计总价")
+    private BigDecimal totalPrice;
 }

+ 39 - 0
src/main/resources/sqlScript/20250212_sql.sql

@@ -0,0 +1,39 @@
+-- ---------------------------------------------------------------
+-- 学生复学流程
+-- ---------------------------------------------------------------
+DROP TABLE IF EXISTS wf_student_resume_schooling;
+CREATE TABLE `wf_student_resume_schooling`  (
+  `id` BIGINT NOT NULL COMMENT '主键',
+  `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+  `create_date` DATETIME(3) NULL DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人id',
+  `modify_date` DATETIME(3) NULL DEFAULT NULL COMMENT '修改日期',
+  `delete_mark` SMALLINT NULL DEFAULT NULL COMMENT '删除标记(0:未删除 1:已删除)',
+  `enabled_mark` SMALLINT NULL DEFAULT NULL COMMENT '有效标记(0:未启用 1:已启用)',
+  `grade_id` BIGINT NULL DEFAULT NULL COMMENT '年级id(base_grade)',
+  `user_id` BIGINT NULL DEFAULT NULL COMMENT '学生id(xjr_user)',
+  `credential_number` VARCHAR(30) NULL DEFAULT NULL COMMENT '身份证',
+  `archives_status` VARCHAR(20) NULL DEFAULT NULL COMMENT '在校状态',
+  `class_id` BIGINT NULL DEFAULT NULL COMMENT '所在班级id(base_class)',
+  `class_name` VARCHAR(30) NULL DEFAULT NULL COMMENT '所在班级id',
+  `teacher_id` BIGINT NULL DEFAULT NULL COMMENT '班主任id(xjr_user)',
+  `teacher_name` VARCHAR(20) NULL DEFAULT NULL COMMENT '班主任姓名',
+  `remarks` VARCHAR(500) NULL DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = INNODB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '学生复学流程';
+
+-- 异动类型字典
+INSERT INTO `xjr_dictionary_item` (`id`, `name`, `code`, `sort_code`, `remark`, `create_user_id`, `create_date`, `modify_user_id`, `modify_date`, `delete_mark`, `enabled_mark`) VALUES (1881186538301730818, '异动记录类型', 'student_change_type', NULL, NULL, 1000000000000000000, '2025-01-20 11:46:36.145', NULL, NULL, 0, 1);
+INSERT INTO `xjr_dictionary_detail` (`id`, `name`, `code`, `item_id`, `value`, `sort_code`, `remark`, `create_user_id`, `create_date`, `modify_user_id`, `modify_date`, `delete_mark`, `enabled_mark`, `p_id`, `extend_field1`, `extend_field2`, `extend_field3`, `extend_field4`, `extend_field5`) VALUES (1881186639761944577, '转班', 'change_class', 1881186538301730818, 'change_class', NULL, NULL, 1000000000000000000, '2025-01-20 11:47:00.335', NULL, NULL, 0, 1, 0, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `xjr_dictionary_detail` (`id`, `name`, `code`, `item_id`, `value`, `sort_code`, `remark`, `create_user_id`, `create_date`, `modify_user_id`, `modify_date`, `delete_mark`, `enabled_mark`, `p_id`, `extend_field1`, `extend_field2`, `extend_field3`, `extend_field4`, `extend_field5`) VALUES (1881186682485125122, '就读方式', 'stduy_status', 1881186538301730818, 'stduy_status', NULL, NULL, 1000000000000000000, '2025-01-20 11:47:10.520', NULL, NULL, 0, 1, 0, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `xjr_dictionary_detail` (`id`, `name`, `code`, `item_id`, `value`, `sort_code`, `remark`, `create_user_id`, `create_date`, `modify_user_id`, `modify_date`, `delete_mark`, `enabled_mark`, `p_id`, `extend_field1`, `extend_field2`, `extend_field3`, `extend_field4`, `extend_field5`) VALUES (1881186726055555073, '学生类别', 'student_type', 1881186538301730818, 'student_type', NULL, NULL, 1000000000000000000, '2025-01-20 11:47:20.909', NULL, NULL, 0, 1, 0, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `xjr_dictionary_detail` (`id`, `name`, `code`, `item_id`, `value`, `sort_code`, `remark`, `create_user_id`, `create_date`, `modify_user_id`, `modify_date`, `delete_mark`, `enabled_mark`, `p_id`, `extend_field1`, `extend_field2`, `extend_field3`, `extend_field4`, `extend_field5`) VALUES (1881186764286636033, '学习形式', 'learn_status', 1881186538301730818, 'learn_status', NULL, NULL, 1000000000000000000, '2025-01-20 11:47:30.024', NULL, NULL, 0, 1, 0, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `xjr_dictionary_detail` (`id`, `name`, `code`, `item_id`, `value`, `sort_code`, `remark`, `create_user_id`, `create_date`, `modify_user_id`, `modify_date`, `delete_mark`, `enabled_mark`, `p_id`, `extend_field1`, `extend_field2`, `extend_field3`, `extend_field4`, `extend_field5`) VALUES (1881186814458900482, '在读状态', 'archives_status', 1881186538301730818, 'archives_status', NULL, NULL, 1000000000000000000, '2025-01-20 11:47:41.985', NULL, NULL, 0, 1, 0, NULL, NULL, NULL, NULL, NULL);
+
+
+ALTER TABLE `base_student_family`   
+  ADD INDEX (`user_id`);
+ALTER TABLE `xjr_role`   
+  ADD COLUMN `is_system` INT DEFAULT 0  NULL   COMMENT '是否是系统角色(1:是 0:否)' AFTER `enabled_mark`;
+
+UPDATE xjr_role SET is_system = 1 WHERE id IN (1,2,3,4,5,1745630294430511106);

+ 32 - 0
src/main/resources/sqlScript/学生异动视图.sql

@@ -0,0 +1,32 @@
+DROP VIEW IF EXISTS cse_feeobj_change1;
+CREATE VIEW cse_feeobj_change1 AS
+SELECT '1001' AS Pk_corp,NULL AS remarks,t1.user_id AS pkfeeobj,t4.classcode,t7.speccode AS pkspec,
+IF(t1.change_type = 'student_type',t1.before_data,NULL) AS resourcecode, 
+IF(t1.change_type = 'stduy_status',t1.before_data,NULL) AS quartercode,t9.deptcode,
+NULL AS enteryear, NULL AS leaveyear,NULL AS ratetypecode,
+IF(t1.change_type = 'archives_status',t1.before_data,NULL) AS state,
+t10.classcode AS newclasscode,t13.speccode AS newpkspec,
+IF(t1.change_type = 'student_type',t1.after_data,NULL) AS newresourcecode, 
+IF(t1.change_type = 'stduy_status',t1.after_data,NULL) AS newquartercode,
+t15.deptcode AS newdeptcode,NULL AS newenteryear, NULL AS newleaveyear,NULL AS newratetypecode,
+IF(t1.change_type = 'archives_status',t1.after_data,NULL) AS newstate,
+t16.name AS operator,DATE_FORMAT(t1.create_date, '%Y-%m-%d') AS opertordate,t1.id AS pkfeeobjchange,t2.credential_number AS Personalid,t2.name AS Feeobjname,
+t17.student_id AS Studentcode,NULL AS biztype,NULL AS delflag,NULL AS updateflag,NULL AS fid
+FROM student_change_record t1
+INNER JOIN xjr_user t2 ON t1.user_id = t2.id
+LEFT JOIN base_student_school_roll t3 ON t1.user_id = t3.user_id
+LEFT JOIN pb_cse_class1 t4 ON t4.specname = t1.before_data AND t1.change_type = 'change_class'
+LEFT JOIN base_class t5 ON t1.before_data_code = t5.id AND t1.change_type = 'change_class'
+LEFT JOIN base_major_set t6 ON t5.major_set_id = t6.id
+LEFT JOIN pb_cse_spec1 t7 ON t6.name = t7.specname
+LEFT JOIN xjr_department t8 ON t5.org_id = t8.id AND t1.change_type = 'change_class'
+LEFT JOIN pb_bd_dept1 t9 ON t8.name = t9.deptname
+LEFT JOIN pb_cse_class1 t10 ON t10.specname = t1.after_data AND t1.change_type = 'change_class'
+LEFT JOIN base_class t11 ON t1.after_data_code = t11.id AND t1.change_type = 'change_class'
+LEFT JOIN base_major_set t12 ON t11.major_set_id = t12.id
+LEFT JOIN pb_cse_spec1 t13 ON t12.name = t13.specname
+LEFT JOIN xjr_department t14 ON t11.org_id = t14.id AND t1.change_type = 'change_class'
+LEFT JOIN pb_bd_dept1 t15 ON t14.name = t15.deptname
+LEFT JOIN xjr_user t16 ON t16.id = t1.create_user_id
+INNER JOIN base_student t17 ON t1.user_id = t17.user_id
+WHERE t1.delete_mark = 0 AND t1.enabled_mark = 1;