Browse Source

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

dzx 1 year ago
parent
commit
1a9cd61149
34 changed files with 885 additions and 507 deletions
  1. 30 0
      src/main/java/com/xjrsoft/module/liteflow/node/AddClaimUserNode.java
  2. 8 6
      src/main/java/com/xjrsoft/module/textbook/controller/TextbookStudentClaimController.java
  3. 0 116
      src/main/java/com/xjrsoft/module/textbook/controller/WfExerciseBookController.java
  4. 1 1
      src/main/java/com/xjrsoft/module/textbook/controller/WfTextbookClaimController.java
  5. 0 102
      src/main/java/com/xjrsoft/module/textbook/controller/WfTextbookSubscriptionController.java
  6. 48 0
      src/main/java/com/xjrsoft/module/textbook/dto/AddTextbookClaimUserDto.java
  7. 6 3
      src/main/java/com/xjrsoft/module/textbook/dto/TeacherCheckByStuDto.java
  8. 9 4
      src/main/java/com/xjrsoft/module/textbook/dto/TeacherCheckByclassDto.java
  9. 2 2
      src/main/java/com/xjrsoft/module/textbook/dto/TeacherCheckStuClaimDto.java
  10. 4 1
      src/main/java/com/xjrsoft/module/textbook/dto/TextbookClaimStudentConfirmDto.java
  11. 26 0
      src/main/java/com/xjrsoft/module/textbook/dto/TextbookClaimUserPageDto.java
  12. 32 0
      src/main/java/com/xjrsoft/module/textbook/dto/UpdateTextbookClaimUserDto.java
  13. 5 7
      src/main/java/com/xjrsoft/module/textbook/dto/WfTextbookClaimPageDto.java
  14. 98 0
      src/main/java/com/xjrsoft/module/textbook/entity/TextbookClaimUser.java
  15. 17 0
      src/main/java/com/xjrsoft/module/textbook/mapper/TextbookClaimUserMapper.java
  16. 9 6
      src/main/java/com/xjrsoft/module/textbook/mapper/TextbookStudentClaimMapper.java
  17. 17 0
      src/main/java/com/xjrsoft/module/textbook/service/ITextbookClaimUserService.java
  18. 4 3
      src/main/java/com/xjrsoft/module/textbook/service/ITextbookStudentClaimService.java
  19. 2 0
      src/main/java/com/xjrsoft/module/textbook/service/IWfTextbookClaimService.java
  20. 25 0
      src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookClaimUserServiceImpl.java
  21. 31 21
      src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java
  22. 63 169
      src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookStudentClaimServiceImpl.java
  23. 54 7
      src/main/java/com/xjrsoft/module/textbook/service/impl/WfTextbookClaimServiceImpl.java
  24. 5 0
      src/main/java/com/xjrsoft/module/textbook/vo/TeacherCheckByclassVo.java
  25. 79 0
      src/main/java/com/xjrsoft/module/textbook/vo/TextbookClaimUserPageVo.java
  26. 49 0
      src/main/java/com/xjrsoft/module/textbook/vo/TextbookClaimUserVo.java
  27. 1 1
      src/main/java/com/xjrsoft/module/textbook/vo/TextbookStudentSemesterVo.java
  28. 2 2
      src/main/java/com/xjrsoft/module/textbook/vo/WfTextbookClaimPageVo.java
  29. 29 32
      src/main/resources/mapper/textbook/TextbookStudentClaimMapper.xml
  30. 9 8
      src/main/resources/mapper/textbook/WfTextbookClaimMapper.xml
  31. 168 16
      src/main/resources/sqlScript/20231218_sql.sql
  32. 1 0
      src/test/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImplTest.java
  33. 23 0
      src/test/java/com/xjrsoft/module/textbook/service/impl/WfTextbookClaimServiceImplTest.java
  34. 28 0
      src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

+ 30 - 0
src/main/java/com/xjrsoft/module/liteflow/node/AddClaimUserNode.java

@@ -0,0 +1,30 @@
+package com.xjrsoft.module.liteflow.node;
+
+import cn.hutool.core.convert.Convert;
+import com.xjrsoft.module.textbook.service.IWfTextbookClaimService;
+import com.yomahub.liteflow.core.NodeComponent;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * 教材申领审核通过后进行领取人记录添加规则
+ */
+@Component("add_claim_user_node")
+public class AddClaimUserNode extends NodeComponent {
+    @Autowired
+    private IWfTextbookClaimService wfTextbookClaimService;
+
+    @Override
+    public void process() throws Exception {
+        // 获取表单中数据编号
+        Map<String, Object> params = this.getFirstContextBean();
+        Object value = util.getFormDatKey(params,"id");
+        Long formId = Convert.toLong(value);
+        if (formId != null) {
+            // 数据处理
+            wfTextbookClaimService.dataHandleAddClaimUserNode(formId);
+        }
+    }
+}

+ 8 - 6
src/main/java/com/xjrsoft/module/textbook/controller/TextbookStudentClaimController.java

@@ -67,17 +67,19 @@ public class TextbookStudentClaimController {
     @GetMapping(value = "/teacher-check-byClass-list")
     @ApiOperation(value="教师教材领取按班级查看页面")
     @SaCheckPermission("textbookstudentclaim:detail")
-    public RT<List<TeacherCheckByclassVo>> teacherCheckByClassList(@Valid TeacherCheckByclassDto dto){
-        List<TeacherCheckByclassVo> teacherCheckByclassList = textbookStudentClaimService.getTeacherCheckByclassList(dto);
-        return RT.ok(teacherCheckByclassList);
+    public RT<PageOutput<TeacherCheckByclassVo>> teacherCheckByClassList(@Valid TeacherCheckByclassDto dto){
+        IPage<TeacherCheckByclassVo> page = textbookStudentClaimService.getTeacherCheckByclassList(dto);
+        PageOutput<TeacherCheckByclassVo> pageOutput = ConventPage.getPageOutput(page, TeacherCheckByclassVo.class);
+        return RT.ok(pageOutput);
     }
 
     @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);
+    public RT<PageOutput<TeacherCheckByStuVo>> teacherCheckByStuList(@Valid TeacherCheckByStuDto dto){
+        IPage<TeacherCheckByStuVo> page = textbookStudentClaimService.getTeacherCheckByStuList(dto);
+        PageOutput<TeacherCheckByStuVo> pageOutput = ConventPage.getPageOutput(page, TeacherCheckByStuVo.class);
+        return RT.ok(pageOutput);
     }
 
     @GetMapping(value = "/teacher-check-stu-claim-list")

+ 0 - 116
src/main/java/com/xjrsoft/module/textbook/controller/WfExerciseBookController.java

@@ -1,116 +0,0 @@
-package com.xjrsoft.module.textbook.controller;
-
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.xjrsoft.common.constant.GlobalConstant;
-import com.baomidou.mybatisplus.core.toolkit.StringPool;
-import com.xjrsoft.common.page.ConventPage;
-import com.xjrsoft.common.page.PageOutput;
-import com.xjrsoft.common.model.result.RT;
-import com.xjrsoft.common.utils.VoToColumnUtil;
-import com.xjrsoft.module.textbook.dto.AddWfExerciseBookDto;
-import com.xjrsoft.module.textbook.dto.UpdateWfExerciseBookDto;
-import cn.dev33.satoken.annotation.SaCheckPermission;
-import com.alibaba.excel.EasyExcel;
-import com.alibaba.excel.support.ExcelTypeEnum;
-import org.springframework.http.ResponseEntity;
-import java.io.ByteArrayOutputStream;
-import java.util.ArrayList;
-
-import com.xjrsoft.module.textbook.dto.WfExerciseBookPageDto;
-import com.xjrsoft.module.textbook.entity.WfExerciseBook;
-import com.xjrsoft.module.textbook.service.IWfExerciseBookService;
-import com.xjrsoft.module.textbook.vo.WfExerciseBookPageVo;
-
-import com.xjrsoft.module.textbook.vo.WfExerciseBookVo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.*;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import java.util.List;
-
-/**
-* @title: 作业本征订
-* @Author szs
-* @Date: 2023-12-27
-* @Version 1.0
-*/
-@RestController
-@RequestMapping("/textbook" + "/wfExerciseBook")
-@Api(value = "/textbook"  + "/wfExerciseBook",tags = "作业本征订代码")
-@AllArgsConstructor
-public class WfExerciseBookController {
-
-
-    private final IWfExerciseBookService wfExerciseBookService;
-
-    @GetMapping(value = "/page")
-    @ApiOperation(value="作业本征订列表(分页)")
-    @SaCheckPermission("wfexercisebook:detail")
-    public RT<PageOutput<WfExerciseBookPageVo>> page(@Valid WfExerciseBookPageDto dto){
-
-        LambdaQueryWrapper<WfExerciseBook> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper
-                    .orderByDesc(WfExerciseBook::getId)
-                .select(WfExerciseBook.class,x -> VoToColumnUtil.fieldsToColumns(WfExerciseBookPageVo.class).contains(x.getProperty()));
-        IPage<WfExerciseBook> page = wfExerciseBookService.page(ConventPage.getPage(dto), queryWrapper);
-        PageOutput<WfExerciseBookPageVo> pageOutput = ConventPage.getPageOutput(page, WfExerciseBookPageVo.class);
-        return RT.ok(pageOutput);
-    }
-
-    @GetMapping(value = "/info")
-    @ApiOperation(value="根据id查询作业本征订信息")
-    @SaCheckPermission("wfexercisebook:detail")
-    public RT<WfExerciseBookVo> info(@RequestParam Long id){
-        WfExerciseBook wfExerciseBook = wfExerciseBookService.getByIdDeep(id);
-        if (wfExerciseBook == null) {
-           return RT.error("找不到此数据!");
-        }
-        return RT.ok(BeanUtil.toBean(wfExerciseBook, WfExerciseBookVo.class));
-    }
-
-
-    @PostMapping
-    @ApiOperation(value = "新增作业本征订")
-    @SaCheckPermission("wfexercisebook:add")
-    public RT<Boolean> add(@Valid @RequestBody AddWfExerciseBookDto dto){
-        WfExerciseBook wfExerciseBook = BeanUtil.toBean(dto, WfExerciseBook.class);
-        boolean isSuccess = wfExerciseBookService.add(wfExerciseBook);
-    return RT.ok(isSuccess);
-    }
-
-    @PutMapping
-    @ApiOperation(value = "修改作业本征订")
-    @SaCheckPermission("wfexercisebook:edit")
-    public RT<Boolean> update(@Valid @RequestBody UpdateWfExerciseBookDto dto){
-
-        WfExerciseBook wfExerciseBook = BeanUtil.toBean(dto, WfExerciseBook.class);
-        return RT.ok(wfExerciseBookService.update(wfExerciseBook));
-
-    }
-
-    @DeleteMapping
-    @ApiOperation(value = "删除作业本征订")
-    @SaCheckPermission("wfexercisebook:delete")
-    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
-        return RT.ok(wfExerciseBookService.delete(ids));
-
-    }
-
-    @GetMapping("/export")
-    @ApiOperation(value = "导出")
-    public ResponseEntity<byte[]> exportData(@Valid WfExerciseBookPageDto dto, @RequestParam(defaultValue = "false") Boolean isTemplate) {
-        List<WfExerciseBookPageVo> customerList = isTemplate != null && isTemplate ? new ArrayList<>() : ((PageOutput<WfExerciseBookPageVo>) page(dto).getData()).getList();
-        ByteArrayOutputStream bot = new ByteArrayOutputStream();
-        EasyExcel.write(bot, WfExerciseBookPageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
-
-        return RT.fileStream(bot.toByteArray(), "WfExerciseBook" + ExcelTypeEnum.XLSX.getValue());
-    }
-}

+ 1 - 1
src/main/java/com/xjrsoft/module/textbook/controller/WfTextbookClaimController.java

@@ -69,7 +69,7 @@ public class WfTextbookClaimController {
     public RT<WfTextbookClaimVo> infoDistribute(@RequestParam Long id){
         WfTextbookClaimVo wfTextbookClaimVo = wfTextbookClaimService.infoDistribute(id);
         if (wfTextbookClaimVo == null) {
-            return RT.error("找不到此数据!");
+            return RT.error("没有发放数据!");
         }
         return RT.ok(BeanUtil.toBean(wfTextbookClaimVo, WfTextbookClaimVo.class));
     }

+ 0 - 102
src/main/java/com/xjrsoft/module/textbook/controller/WfTextbookSubscriptionController.java

@@ -1,102 +0,0 @@
-package com.xjrsoft.module.textbook.controller;
-
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.xjrsoft.common.constant.GlobalConstant;
-import com.baomidou.mybatisplus.core.toolkit.StringPool;
-import com.xjrsoft.common.page.ConventPage;
-import com.xjrsoft.common.page.PageOutput;
-import com.xjrsoft.common.model.result.RT;
-import com.xjrsoft.common.utils.VoToColumnUtil;
-import com.xjrsoft.module.textbook.dto.AddWfTextbookSubscriptionDto;
-import com.xjrsoft.module.textbook.dto.UpdateWfTextbookSubscriptionDto;
-import cn.dev33.satoken.annotation.SaCheckPermission;
-
-import com.xjrsoft.module.textbook.dto.WfTextbookSubscriptionPageDto;
-import com.xjrsoft.module.textbook.entity.WfTextbookSubscription;
-import com.xjrsoft.module.textbook.service.IWfTextbookSubscriptionService;
-import com.xjrsoft.module.textbook.vo.WfTextbookSubscriptionPageVo;
-
-import com.xjrsoft.module.textbook.vo.WfTextbookSubscriptionVo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.*;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import java.util.List;
-
-/**
-* @title: 教材教辅征订
-* @Author szs
-* @Date: 2023-12-25
-* @Version 1.0
-*/
-@RestController
-@RequestMapping("/textbook" + "/wfTextbookSubscription")
-@Api(value = "/textbook"  + "/wfTextbookSubscription",tags = "教材教辅征订代码")
-@AllArgsConstructor
-public class WfTextbookSubscriptionController {
-
-
-    private final IWfTextbookSubscriptionService wfTextbookSubscriptionService;
-
-    @GetMapping(value = "/page")
-    @ApiOperation(value="教材教辅征订列表(分页)")
-    @SaCheckPermission("wftextbooksubscription:detail")
-    public RT<PageOutput<WfTextbookSubscriptionPageVo>> page(@Valid WfTextbookSubscriptionPageDto dto){
-
-        LambdaQueryWrapper<WfTextbookSubscription> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper
-                    .orderByDesc(WfTextbookSubscription::getId)
-                .select(WfTextbookSubscription.class,x -> VoToColumnUtil.fieldsToColumns(WfTextbookSubscriptionPageVo.class).contains(x.getProperty()));
-        IPage<WfTextbookSubscription> page = wfTextbookSubscriptionService.page(ConventPage.getPage(dto), queryWrapper);
-        PageOutput<WfTextbookSubscriptionPageVo> pageOutput = ConventPage.getPageOutput(page, WfTextbookSubscriptionPageVo.class);
-        return RT.ok(pageOutput);
-    }
-
-    @GetMapping(value = "/info")
-    @ApiOperation(value="根据id查询教材教辅征订信息")
-    @SaCheckPermission("wftextbooksubscription:detail")
-    public RT<WfTextbookSubscriptionVo> info(@RequestParam Long id){
-        WfTextbookSubscription wfTextbookSubscription = wfTextbookSubscriptionService.getByIdDeep(id);
-        if (wfTextbookSubscription == null) {
-           return RT.error("找不到此数据!");
-        }
-        return RT.ok(BeanUtil.toBean(wfTextbookSubscription, WfTextbookSubscriptionVo.class));
-    }
-
-
-    @PostMapping
-    @ApiOperation(value = "新增教材教辅征订")
-    @SaCheckPermission("wftextbooksubscription:add")
-    public RT<Boolean> add(@Valid @RequestBody AddWfTextbookSubscriptionDto dto){
-        WfTextbookSubscription wfTextbookSubscription = BeanUtil.toBean(dto, WfTextbookSubscription.class);
-        boolean isSuccess = wfTextbookSubscriptionService.add(wfTextbookSubscription);
-    return RT.ok(isSuccess);
-    }
-
-    @PutMapping
-    @ApiOperation(value = "修改教材教辅征订")
-    @SaCheckPermission("wftextbooksubscription:edit")
-    public RT<Boolean> update(@Valid @RequestBody UpdateWfTextbookSubscriptionDto dto){
-
-        WfTextbookSubscription wfTextbookSubscription = BeanUtil.toBean(dto, WfTextbookSubscription.class);
-        return RT.ok(wfTextbookSubscriptionService.update(wfTextbookSubscription));
-
-    }
-
-    @DeleteMapping
-    @ApiOperation(value = "删除教材教辅征订")
-    @SaCheckPermission("wftextbooksubscription:delete")
-    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
-        return RT.ok(wfTextbookSubscriptionService.delete(ids));
-
-    }
-
-}

+ 48 - 0
src/main/java/com/xjrsoft/module/textbook/dto/AddTextbookClaimUserDto.java

@@ -0,0 +1,48 @@
+package com.xjrsoft.module.textbook.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+
+/**
+* @title: 教材领取人员
+* @Author dzx
+* @Date: 2023-12-29
+* @Version 1.0
+*/
+@Data
+public class AddTextbookClaimUserDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 教材申领编号
+    */
+    @ApiModelProperty("教材申领编号")
+    private Long wfTextbookClaimId;
+    /**
+    * 用户编号
+    */
+    @ApiModelProperty("用户编号")
+    private Long userId;
+    /**
+    * 用户类型(1:学生 2=教师)
+    */
+    @ApiModelProperty("用户类型(1:学生 2=教师)")
+    private Integer userType;
+
+}

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

@@ -1,8 +1,11 @@
 package com.xjrsoft.module.textbook.dto;
 
+import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 
 /**
 * @title: 教师教材领取按学生查看页面入参
@@ -11,7 +14,7 @@ import lombok.Data;
 * @Version 1.0
 */
 @Data
-public class TeacherCheckByStuDto {
+public class TeacherCheckByStuDto extends PageInput {
     /**
      * 学生用户编号
      */
@@ -20,8 +23,8 @@ public class TeacherCheckByStuDto {
     /**
      * 班级编号
      */
-    @ApiModelProperty(value = "班级编号",hidden = true)
-    private Long classId;
+    @ApiModelProperty(value = "班级编号")
+    private List<Long> classIdList;
     /**
      * 领取情况(1=全部数据,2=该教材全部领取,3=该教材部分未领取)
      */

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

@@ -1,7 +1,11 @@
 package com.xjrsoft.module.textbook.dto;
 
+import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
 
 
 /**
@@ -11,15 +15,16 @@ import lombok.Data;
 * @Version 1.0
 */
 @Data
-public class TeacherCheckByclassDto{
+@EqualsAndHashCode(callSuper = false)
+public class TeacherCheckByclassDto extends PageInput {
     /**
      * 班级编号
      */
-    @ApiModelProperty(value = "班级编号",hidden = true)
-    private Long classId;
+    @ApiModelProperty(value = "班级编号")
+    private List<Long> classIdList;
     /**
      * 领取情况(1=全部数据,2=该教材全部领取,3=该教材部分未领取)
      */
-    @ApiModelProperty("领取情况")
+    @ApiModelProperty("领取情况(1=全部数据,2=该教材全部领取,3=该教材部分未领取)")
     private Integer claimStatus;
 }

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

@@ -15,11 +15,11 @@ public class TeacherCheckStuClaimDto {
     /**
      * 教材主键编号
      */
-    @ApiModelProperty(value = "教材主键编号")
+    @ApiModelProperty(value = "教材主键编号",required = true)
     private Long textbookId;
     /**
      * 班级编号
      */
-    @ApiModelProperty(value = "班级编号",hidden = true)
+    @ApiModelProperty(value = "班级编号",required = true)
     private Long classId;
 }

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

@@ -1,7 +1,9 @@
 package com.xjrsoft.module.textbook.dto;
 
+import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import lombok.EqualsAndHashCode;
 
 
 /**
@@ -11,7 +13,8 @@ import lombok.Data;
 * @Version 1.0
 */
 @Data
-public class TextbookClaimStudentConfirmDto {
+@EqualsAndHashCode(callSuper = false)
+public class TextbookClaimStudentConfirmDto extends PageInput {
 
     /**
      * 学期ID(base_semester)

+ 26 - 0
src/main/java/com/xjrsoft/module/textbook/dto/TextbookClaimUserPageDto.java

@@ -0,0 +1,26 @@
+package com.xjrsoft.module.textbook.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.Date;
+
+
+/**
+* @title: 教材领取人员分页查询入参
+* @Author dzx
+* @Date: 2023-12-29
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class TextbookClaimUserPageDto extends PageInput {
+
+
+}

+ 32 - 0
src/main/java/com/xjrsoft/module/textbook/dto/UpdateTextbookClaimUserDto.java

@@ -0,0 +1,32 @@
+package com.xjrsoft.module.textbook.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.List;
+import java.util.Date;
+
+
+
+/**
+* @title: 教材领取人员
+* @Author dzx
+* @Date: 2023-12-29
+* @Version 1.0
+*/
+@Data
+public class UpdateTextbookClaimUserDto extends AddTextbookClaimUserDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+}

+ 5 - 7
src/main/java/com/xjrsoft/module/textbook/dto/WfTextbookClaimPageDto.java

@@ -4,12 +4,6 @@ import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.time.LocalTime;
-import java.time.LocalDateTime;
-import java.math.BigDecimal;
-import java.util.Date;
 
 
 /**
@@ -22,5 +16,9 @@ import java.util.Date;
 @EqualsAndHashCode(callSuper = false)
 public class WfTextbookClaimPageDto extends PageInput {
 
-
+    /**
+     * 当前用户的id
+     */
+    @ApiModelProperty(value = "当前用户的id",hidden = true)
+    private Long userId;
 }

+ 98 - 0
src/main/java/com/xjrsoft/module/textbook/entity/TextbookClaimUser.java

@@ -0,0 +1,98 @@
+package com.xjrsoft.module.textbook.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.github.yulichang.annotation.EntityMapping;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+/**
+* @title: 教材领取人员
+* @Author dzx
+* @Date: 2023-12-29
+* @Version 1.0
+*/
+@Data
+@TableName("textbook_claim_user")
+@ApiModel(value = "textbook_claim_user", description = "教材领取人员")
+public class TextbookClaimUser implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    @TableId
+    private Long id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+    * 修改时间
+    */
+    @ApiModelProperty("修改时间")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+    * 有效标志
+    */
+    @ApiModelProperty("有效标志")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 教材申领编号
+    */
+    @ApiModelProperty("教材申领编号")
+    private Long wfTextbookClaimId;
+    /**
+    * 用户编号
+    */
+    @ApiModelProperty("用户编号")
+    private Long userId;
+    /**
+    * 用户类型(1:学生 2=教师)
+    */
+    @ApiModelProperty("用户类型(1:学生 2=教师)")
+    private Integer userType;
+
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/textbook/mapper/TextbookClaimUserMapper.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.textbook.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.textbook.entity.TextbookClaimUser;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 教材领取人员
+* @Author dzx
+* @Date: 2023-12-29
+* @Version 1.0
+*/
+@Mapper
+public interface TextbookClaimUserMapper extends MPJBaseMapper<TextbookClaimUser> {
+
+}

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

@@ -1,11 +1,16 @@
 package com.xjrsoft.module.textbook.mapper;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.yulichang.base.MPJBaseMapper;
 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.TextbookStudentClaim;
-import com.xjrsoft.module.textbook.vo.*;
+import com.xjrsoft.module.textbook.vo.TeacherCheckByStuVo;
+import com.xjrsoft.module.textbook.vo.TeacherCheckByclassVo;
+import com.xjrsoft.module.textbook.vo.TeacherCheckStuClaimVo;
+import com.xjrsoft.module.textbook.vo.TextbookClaimVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -22,13 +27,11 @@ public interface TextbookStudentClaimMapper extends MPJBaseMapper<TextbookStuden
 
     List<TextbookClaimVO> getTextbookClaimList(@Param("dto")TextbookClaimStudentConfirmDto dto);
 
-    List<TeacherCheckByclassVo> getTeacherCheckByclassList(Long classId);
-
-    List<TextbookStudentSemesterVo> getStudentSemesterList(Long studentUserId);
+    IPage<TeacherCheckByclassVo> getTeacherCheckByclassList(IPage<TeacherCheckByclassDto> page, @Param("dto")TeacherCheckByclassDto dto);
 
     List<TeacherCheckStuClaimVo> getTeacherCheckStuClaimList(@Param("dto")TeacherCheckStuClaimDto dto);
 
-    List<TeacherCheckByStuVo> getTeacherCheckByStuList(@Param("dto")TeacherCheckByStuDto dto);
+    IPage<TeacherCheckByStuVo> getTeacherCheckByStuList(IPage<TeacherCheckByStuDto> page, @Param("dto")TeacherCheckByStuDto dto);
 
-    List<TextbookClaimVO> getTextbookClaimVOList(Long classId, Long studentUserId);
+    List<TextbookClaimVO> getTextbookClaimVOList(Long studentUserId);
 }

+ 17 - 0
src/main/java/com/xjrsoft/module/textbook/service/ITextbookClaimUserService.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.textbook.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.textbook.entity.TextbookClaimUser;
+import lombok.Data;
+import java.util.List;
+
+/**
+* @title: 教材领取人员
+* @Author dzx
+* @Date: 2023-12-29
+* @Version 1.0
+*/
+
+public interface ITextbookClaimUserService extends MPJBaseService<TextbookClaimUser> {
+}

+ 4 - 3
src/main/java/com/xjrsoft/module/textbook/service/ITextbookStudentClaimService.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.textbook.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.textbook.dto.*;
 import com.xjrsoft.module.textbook.entity.TextbookStudentClaim;
@@ -34,14 +35,14 @@ public interface ITextbookStudentClaimService extends MPJBaseService<TextbookStu
      * @param dto
      * @return
      */
-    List<TeacherCheckByclassVo> getTeacherCheckByclassList(TeacherCheckByclassDto dto);
+    IPage<TeacherCheckByclassVo> getTeacherCheckByclassList(TeacherCheckByclassDto dto);
 
     /**
      * 教师教材领取按班级查看页面
      * @param dto
      * @return
      */
-    List<TeacherCheckByStuVo> getTeacherCheckByStuList(TeacherCheckByStuDto dto);
+    IPage<TeacherCheckByStuVo> getTeacherCheckByStuList(TeacherCheckByStuDto dto);
 
     /**
      * 学生自己确认已经领取
@@ -59,7 +60,7 @@ public interface ITextbookStudentClaimService extends MPJBaseService<TextbookStu
 
     /**
      * 教师查看一本教材的学生领取情况页面
-     * @param 
+     * @param
      * @return
      */
     List<TextbookClaimVO> getTeacherGetStuNoClaimList(Long studentUserId);

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

@@ -64,4 +64,6 @@ public interface IWfTextbookClaimService extends MPJBaseService<WfTextbookClaim>
      */
     Boolean confirmDistribute(ConfirmDistributeDto dto);
 
+    Boolean dataHandleAddClaimUserNode(Long id);
+
 }

+ 25 - 0
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookClaimUserServiceImpl.java

@@ -0,0 +1,25 @@
+package com.xjrsoft.module.textbook.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.textbook.entity.TextbookClaimUser;
+import com.xjrsoft.module.textbook.mapper.TextbookClaimUserMapper;
+import com.xjrsoft.module.textbook.service.ITextbookClaimUserService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+
+/**
+* @title: 教材领取人员
+* @Author dzx
+* @Date: 2023-12-29
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class TextbookClaimUserServiceImpl extends MPJBaseServiceImpl<TextbookClaimUserMapper, TextbookClaimUser> implements ITextbookClaimUserService {
+}

+ 31 - 21
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java

@@ -181,6 +181,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
     public Boolean dataHandleAddTextbookNode(Long dataId) {
         WfTextbookSubscription wfTextbookSubscription = iWfTextbookSubscriptionService.selectById(dataId);
         if (ObjectUtil.isNotNull(wfTextbookSubscription) && ObjectUtil.isNotNull(wfTextbookSubscription.getWfTextbookSubscriptionItemList()) && wfTextbookSubscription.getWfTextbookSubscriptionItemList().size() > 0) {
+            //遍历征订项
             for (WfTextbookSubscriptionItem wfTextbookSubscriptionItem : wfTextbookSubscription.getWfTextbookSubscriptionItemList()) {
                 Long semesterId = wfTextbookSubscription.getBaseSemesterId();
                 String issn = wfTextbookSubscriptionItem.getIssn();
@@ -190,7 +191,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
                         .eq(Textbook::getBaseSemesterId, semesterId);
                 List<Textbook> textbookList = this.list(queryWrapper);
                 //征订的教材没有在教材管理
-                if (ObjectUtil.isNull(textbookList) || textbookList.size() <= 0) {//该书不存在于教材管理
+                if (ObjectUtil.isNull(textbookList) || textbookList.size() == 0) {
                     Textbook textbook = new Textbook() {{
                         setIssn(wfTextbookSubscriptionItem.getIssn());
                         setIsbn(wfTextbookSubscriptionItem.getIsbn());
@@ -212,11 +213,12 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
                     }};
 
                     //班级不为空
+                    List<Long> classIdList = new ArrayList<>();
                     if (ObjectUtil.isNotNull(wfTextbookSubscriptionItem.getClassIds()) && !wfTextbookSubscriptionItem.getClassIds().equals("")) {
                         //将班级ids转换为List
                         String classIds = wfTextbookSubscriptionItem.getClassIds();
                         String[] classIdStrs = classIds.split(",");
-                        List<Long> classIdList = new ArrayList<>();
+
                         for (String classIdStr : classIdStrs) {
                             classIdList.add(Long.parseLong(classIdStr));
                         }
@@ -229,7 +231,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
                         List<BaseClass> baseClassList = baseClassService.list(queryWrapper1);
                         if (ObjectUtil.isNotNull(baseClassList) && baseClassList.size() == 1) {
                             textbook.setGradeId(baseClassList.get(0).getGradeId());
-                        }
+                        }}
 
                         //插入教材数据
                         textbookTextbookMapper.insert(textbook);
@@ -241,11 +243,11 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
                                 setClassId(classId);
                             }});
                         }
-                    }
+
                     //添加教材征订记录
                     textbookTextbookSubscriptionRecordMapper.insert(new TextbookSubscriptionRecord() {{
                         setTextbookId(textbook.getId());
-                        setWfTextbookSubscriptionId(wfTextbookSubscription.getId());
+                        setWfTextbookSubscriptionId(wfTextbookSubscriptionItem.getId());//该字段存入正定项的id,征订项中有所属征订记录
                     }});
                 } else {
 
@@ -267,7 +269,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
                     //添加教材征订记录
                     textbookTextbookSubscriptionRecordMapper.insert(new TextbookSubscriptionRecord() {{
                         setTextbookId(textbook.getId());
-                        setWfTextbookSubscriptionId(wfTextbookSubscription.getId());
+                        setWfTextbookSubscriptionId(wfTextbookSubscriptionItem.getId());//该字段存入正定项的id,征订项中有所属征订记录
                     }});
                 }
             }
@@ -282,6 +284,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
      * @return
      */
     @Override
+    @Transactional
     public Boolean dataHandleAddExerciseBookNode(Long dataId) {
         WfExerciseBook wfExerciseBook = wfExerciseBookService.selectById(dataId);
         if (ObjectUtil.isNotNull(wfExerciseBook) && ObjectUtil.isNotNull(wfExerciseBook.getWfExerciseBookItemList()) && wfExerciseBook.getWfExerciseBookItemList().size() > 0) {
@@ -294,17 +297,21 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
                         .eq(Textbook::getBaseSemesterId, semesterId);
                 List<Textbook> textbookList = this.list(queryWrapper);
                 //征订的作业本没有在教材管理
-                if (ObjectUtil.isNull(textbookList) || textbookList.size() <= 0) {
+                if (ObjectUtil.isNull(textbookList) || textbookList.size() == 0) {
                     Textbook textbook = new Textbook() {{
                         setBaseSemesterId(wfExerciseBook.getBaseSemesterId());
                         setBookName(wfExerciseBookItem.getSubscriptionType());
                         setTextbookType(TextbookTypeEnum.TExerciseBook.getCode());
                         //年级id
-                        LambdaQueryWrapper<BaseClass> queryWrapper1 = new LambdaQueryWrapper<>();
-                        queryWrapper1
-                                .eq(BaseClass::getId, wfExerciseBook.getClassId());
-                        BaseClass baseClass = baseClassService.getOne(queryWrapper1);
-                        setGradeId(baseClass.getGradeId());
+                        if (ObjectUtil.isNotNull(wfExerciseBook.getClassId()) && wfExerciseBook.getClassId() > 0){
+                            LambdaQueryWrapper<BaseClass> queryWrapper1 = new LambdaQueryWrapper<>();
+                            queryWrapper1
+                                    .eq(BaseClass::getId, wfExerciseBook.getClassId());
+                            BaseClass baseClass = baseClassService.getOne(queryWrapper1);
+                            if(ObjectUtil.isNotNull(baseClass)){
+                                setGradeId(baseClass.getGradeId());
+                            }
+                        }
                         setAppraisalPrice(wfExerciseBookItem.getAppraisalPrice());
                     }};
 
@@ -312,22 +319,25 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
                     textbookTextbookMapper.insert(textbook);
 
                     //插入班级和教材关系
-                    textbookTextbookClassRelationMapper.insert(new TextbookClassRelation() {{
-                        setTextbookId(textbook.getId());
-                        setClassId(wfExerciseBook.getClassId());
-                    }});
+                    if(ObjectUtil.isNotNull(wfExerciseBook.getClassId()) && wfExerciseBook.getClassId() > 0){
+                        textbookTextbookClassRelationMapper.insert(new TextbookClassRelation() {{
+                            setTextbookId(textbook.getId());
+                            setClassId(wfExerciseBook.getClassId());
+                        }});
+                    }
+
 
                     //添加教材征订记录
                     textbookTextbookSubscriptionRecordMapper.insert(new TextbookSubscriptionRecord() {{
                         setTextbookId(textbook.getId());
-                        setWfTextbookSubscriptionId(wfExerciseBook.getId());
+                        setWfTextbookSubscriptionId(wfExerciseBookItem.getId());
                     }});
                 } else {
                     //征订的教材在教材管理,进行班级的和记录的管理
                     Textbook textbook = textbookList.get(0);
 
                     //班级不为空
-                    if (ObjectUtil.isNotNull(wfExerciseBook.getClassId()) && !wfExerciseBook.getClassId().equals("")) {
+                    if (ObjectUtil.isNotNull(wfExerciseBook.getClassId()) && wfExerciseBook.getClassId() > 0) {
                         textbookTextbookClassRelationMapper.insert(new TextbookClassRelation() {{
                             setTextbookId(textbook.getId());
                             setClassId(wfExerciseBook.getClassId());
@@ -337,7 +347,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
                     //添加教材征订记录
                     textbookTextbookSubscriptionRecordMapper.insert(new TextbookSubscriptionRecord() {{
                         setTextbookId(textbook.getId());
-                        setWfTextbookSubscriptionId(wfExerciseBook.getId());
+                        setWfTextbookSubscriptionId(wfExerciseBookItem.getId());
                     }});
                 }
             }
@@ -423,9 +433,9 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
 
         //更新总的库存数量
         Textbook updateTextbook = new Textbook();
-        updateTextbook.setId(dto.getTextbookId());
+        updateTextbook.setId(textbook.getId());
         Integer oldStock = ObjectUtil.isNull(textbook.getStock()) ? 0 : textbook.getStock();
-        updateTextbook.setStock(oldStock + dto.getWarehouseNumber());
+        updateTextbook.setStock(oldStock + (ObjectUtil.isNull(dto.getWarehouseNumber()) ? 0 : dto.getWarehouseNumber()));
         boolean isSuccess = this.updateById(updateTextbook);
 
         TextbookWarehouseRecord textbookWarehouseRecord = BeanUtil.toBean(dto, TextbookWarehouseRecord.class);

+ 63 - 169
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookStudentClaimServiceImpl.java

@@ -3,10 +3,11 @@ package com.xjrsoft.module.textbook.service.impl;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 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.page.ConventPage;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseSemester;
@@ -60,11 +61,6 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
 
     @Override
     public TextbookClaimStudentConfirmVo getStudentConfirmList(TextbookClaimStudentConfirmDto dto) {
-        //判断输入的合法性
-        if(ObjectUtil.isNull(dto.getBaseSemesterId()) || dto.getBaseSemesterId() <= 0){
-            throw new MyException("请选择学期");
-        }
-
         //获取当前登录学生的信息
         MPJLambdaWrapper<XjrUser> queryUser = new MPJLambdaWrapper<>();
         queryUser
@@ -79,32 +75,13 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
                 .orderByDesc(AttendanceRecord::getId);
         TextbookClaimStudentConfirmVo textbookClaimStudentConfirmVo = xjrUserMapper.selectJoinOne(TextbookClaimStudentConfirmVo.class, queryUser);
         if(ObjectUtil.isNull(textbookClaimStudentConfirmVo)){
-            throw new MyException("未找到该学生的相关信息");
+            throw new MyException("登录信息出错,请重新登录");
         }
 
         //根据学期id查出学期名称
         BaseSemester baseSemester = baseSemesterService.getById(dto.getBaseSemesterId());
-        if(ObjectUtil.isNull(baseSemester)){
-            throw new MyException("学期不存在");
-        }
         textbookClaimStudentConfirmVo.setBaseSemesterCN(baseSemester.getName());
 
-        //查出整个学生教材认领记录集合
-        /*MPJLambdaWrapper<TextbookStudentClaim> queryTextbookClaimList = new MPJLambdaWrapper<>();
-        queryTextbookClaimList
-                .selectAs(TextbookStudentClaim::getId, TextbookClaimVO::getTextbookStudentClaimId)
-                .selectFunc(() ->"t1.price * t1.discount", TextbookClaimVO::getDiscountPrice)
-                .selectFunc("(%f * %f", arg -> arg.accept(Textbook::getPrice, Textbook::getDiscount), TextbookClaimVO::getDiscountPrice)
-                .select(TextbookStudentClaim.class, x -> VoToColumnUtil.fieldsToColumns(TextbookClaimVO.class).contains(x.getProperty()))
-                .select(Textbook.class, x -> VoToColumnUtil.fieldsToColumns(TextbookClaimVO.class).contains(x.getProperty()))
-                .leftJoin(Textbook.class, Textbook::getId, TextbookStudentClaim::getTextbookId)
-                .eq(TextbookStudentClaim::getStudentUserId, StpUtil.getLoginIdAsLong())
-                .eq(TextbookStudentClaim::getBaseSemesterId, dto.getBaseSemesterId())
-                .disableSubLogicDel()
-                .orderByDesc(AttendanceRecord::getId);
-        List<TextbookClaimVO> textbookClaimVOList = this.selectJoinList(TextbookClaimVO.class, queryTextbookClaimList);
-        textbookClaimStudentConfirmVo.setTextbookClaimVoList(textbookClaimVOList);*/
-
         dto.setStudentUserId(StpUtil.getLoginIdAsLong());
 
         List<TextbookClaimVO> textbookClaimVOList = textbookStudentClaimMapper.getTextbookClaimList(dto);
@@ -115,169 +92,98 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
 
     @Override
     public List<TextbookStudentSemesterVo> getStudentSemesterList() {
-        return textbookStudentClaimMapper.getStudentSemesterList(StpUtil.getLoginIdAsLong());
+        //获取当前学生领取记录的所有学期
+        MPJLambdaWrapper<TextbookStudentClaim> qwerySemester = new MPJLambdaWrapper<>();
+        qwerySemester
+                .disableSubLogicDel()
+                .selectAs(BaseSemester::getName,TextbookStudentSemesterVo::getBaseSemesterIdCN)
+                .leftJoin(BaseSemester.class,BaseSemester::getId,TextbookStudentClaim::getBaseSemesterId)
+                .eq(TextbookStudentClaim::getStudentUserId,StpUtil.getLoginIdAsLong());
+        List<TextbookStudentSemesterVo> textbookStudentSemesterVoList = this.selectJoinList(TextbookStudentSemesterVo.class,qwerySemester);
+        if(ObjectUtil.isNull(textbookStudentSemesterVoList) && textbookStudentSemesterVoList.size() == 0){
+            return null;
+        }
+        //为每个学期添加未领取人数
+        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;
     }
 
     @Override
-    public List<TeacherCheckByclassVo> getTeacherCheckByclassList(TeacherCheckByclassDto dto) {
+    public IPage<TeacherCheckByclassVo> getTeacherCheckByclassList(TeacherCheckByclassDto 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("班级信息获取失败");
+        List<BaseClass> baseClassList = baseClassService.list(queryWrapperClassId);
+        if(ObjectUtil.isNull(baseClassList) && baseClassList.size() == 0){
+            return null;
         }
-        Long classId = baseClass.getId();
-
-        dto.setClassId(classId);
 
-        //将班上所有发放的教材进行分组,查询出list集合
-        List<TeacherCheckByclassVo> teacherCheckByclassVoList = textbookStudentClaimMapper.getTeacherCheckByclassList(classId);
-
-        if(ObjectUtil.isNull(teacherCheckByclassVoList) || teacherCheckByclassVoList.size() == 0){
-            throw new MyException("未找到教材领取数据");
-        }
-
-        //为每种教材添加统计值
-        //实际领取教材数量
-        //根据班主任ID和班级ID找到所有班主任为该班申请的教材的所有申领记录,申领类型应该为学生
-        LambdaQueryWrapper<WfTextbookClaim> queryWrapperWfTextbookClaim = new LambdaQueryWrapper<>();
-        queryWrapperWfTextbookClaim
-                .eq(WfTextbookClaim::getApplicantUserId,StpUtil.getLoginIdAsLong())
-                .eq(WfTextbookClaim::getClaimType, ClaimTypeEnum.ClaimStudent.getCode())
-                .eq(WfTextbookClaim::getClassId,classId);
-        List<WfTextbookClaim> wfTextbookClaimList = wfTextbookClaimMapper.selectList(queryWrapperWfTextbookClaim);
-        if(ObjectUtil.isNull(wfTextbookClaimList) || wfTextbookClaimList.size() == 0){
-            throw new MyException("未找到教材申请数据");
-        }
-
-        List<Long> wfTextbookClaimIdList = new ArrayList<>();
-        for (WfTextbookClaim w : wfTextbookClaimList) {
-            wfTextbookClaimIdList.add(w.getId());
+        List<Long> classIdList = new ArrayList<>();
+        for (BaseClass baseClass : baseClassList) {
+            classIdList.add(baseClass.getId());
         }
+        dto.setClassIdList(classIdList);
 
-        //根据申领记录ID找到其关联的所有申领项中当前教材的已经发放数量数据
-        for (TeacherCheckByclassVo t: teacherCheckByclassVoList) {
-            LambdaQueryWrapper<WfTextbookClaimItem> queryWrapperWfTextbookClaimItem = new LambdaQueryWrapper<>();
-            queryWrapperWfTextbookClaimItem
-                    .in(WfTextbookClaimItem::getWfTextbookClaimId,wfTextbookClaimIdList)
-                    .eq(WfTextbookClaimItem::getTextbookId, t.getTextbookId());
-            List<WfTextbookClaimItem> wfTextbookClaimItemList = wfTextbookClaimItemMapper.selectList(queryWrapperWfTextbookClaimItem);
-            Integer issueNumber =  0;
-            for (WfTextbookClaimItem w : wfTextbookClaimItemList) {
-                issueNumber += w.getIssueNumber();
-            }
-            t.setActualReceivedNum(issueNumber);
-        }
-
-        //已经确认领取人数
-        for (TeacherCheckByclassVo t: teacherCheckByclassVoList) {
-            LambdaQueryWrapper<TextbookStudentClaim> queryWrapperTextbookStudentClaimCount = new LambdaQueryWrapper<>();
-            queryWrapperTextbookStudentClaimCount
-                    .in(TextbookStudentClaim::getClassId,classId)
-                    .eq(TextbookStudentClaim::getTextbookId, t.getTextbookId())
-                    .eq(TextbookStudentClaim::getIsClaim, 1);;
-            Long count = this.count(queryWrapperTextbookStudentClaimCount);
-            t.setActualClaimNum(count);
-        }
-
-        Integer claimStatus = 1;
-        //根据领取情况入参返回不同状态的数据
-        if(ObjectUtil.isNotNull(dto.getClaimStatus())){
-            claimStatus = dto.getClaimStatus();
-        }
+        IPage<TeacherCheckByclassVo> teacherCheckByclassVoList = textbookStudentClaimMapper.getTeacherCheckByclassList(ConventPage.getPage(dto),dto);
 
-        List<TeacherCheckByclassVo> result = new ArrayList<>();
+        //为每本书添加数据
+        for (TeacherCheckByclassVo t: teacherCheckByclassVoList.getRecords()) {
+            MPJLambdaWrapper<WfTextbookClaim> qweryActualReceivedNum = new MPJLambdaWrapper<>();
+            qweryActualReceivedNum
+                    .disableSubLogicDel()
+                    .selectSum(WfTextbookClaimItem::getIssueNumber,TeacherCheckByclassVo::getActualReceivedNum)
+                    .leftJoin(WfTextbookClaimItem.class,WfTextbookClaimItem::getWfTextbookClaimId,WfTextbookClaim::getId)
+                    .eq(WfTextbookClaim::getClassId,t.getClassId())
+                    .eq(WfTextbookClaimItem::getTextbookId,t.getTextbookId());
+            TeacherCheckByclassVo teacherCheckByclassVo = wfTextbookClaimMapper.selectJoinOne(TeacherCheckByclassVo.class,qweryActualReceivedNum);
 
-        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;
-        }
+            t.setActualReceivedNum(teacherCheckByclassVo.getActualReceivedNum());
 
-        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;
+            LambdaQueryWrapper<TextbookStudentClaim> queryActualClaimNum = new LambdaQueryWrapper<>();
+            queryActualClaimNum
+                    .eq(TextbookStudentClaim::getClassId, t.getClassId())
+                    .eq(TextbookStudentClaim::getTextbookId, t.getTextbookId());
+            Long actualClaimNum = this.count(queryActualClaimNum);
+            t.setActualClaimNum(actualClaimNum);
         }
-
-
-
         return teacherCheckByclassVoList;
     }
 
     @Override
-    public List<TeacherCheckByStuVo> getTeacherCheckByStuList(TeacherCheckByStuDto dto) {
+    public IPage<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("班级信息获取失败");
+        List<BaseClass> baseClassList = baseClassService.list(queryWrapperClassId);
+        if(ObjectUtil.isNull(baseClassList) && baseClassList.size() == 0){
+            return null;
         }
-        Long classId = baseClass.getId();
 
-        dto.setClassId(classId);
+        List<Long> classIdList = new ArrayList<>();
+        for (BaseClass baseClass : baseClassList) {
+            classIdList.add(baseClass.getId());
+        }
+        dto.setClassIdList(classIdList);
 
         //将班上所有学生进行分组,查询出list集合
-        List<TeacherCheckByStuVo> teacherCheckByStuVoList = textbookStudentClaimMapper.getTeacherCheckByStuList(dto);
-
-        if(ObjectUtil.isNull(teacherCheckByStuVoList) || teacherCheckByStuVoList.size() == 0){
-            throw new MyException("未找到学生数据");
-        }
+        IPage<TeacherCheckByStuVo> teacherCheckByStuVoList = textbookStudentClaimMapper.getTeacherCheckByStuList(ConventPage.getPage(dto),dto);
 
         //为每个学生添加教材领取记录集合
-        for (TeacherCheckByStuVo t: teacherCheckByStuVoList) {
-            List<TextbookClaimVO> textbookClaimVOList = textbookStudentClaimMapper.getTextbookClaimVOList(classId,t.getStudentUserId());
+        for (TeacherCheckByStuVo t: teacherCheckByStuVoList.getRecords()) {
+            List<TextbookClaimVO> textbookClaimVOList = textbookStudentClaimMapper.getTextbookClaimVOList(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;
     }
 
@@ -296,18 +202,6 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
 
     @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;
     }

+ 54 - 7
src/main/java/com/xjrsoft/module/textbook/service/impl/WfTextbookClaimServiceImpl.java

@@ -10,11 +10,13 @@ import com.xjrsoft.common.enums.ClaimTypeEnum;
 import com.xjrsoft.common.enums.IssueModeEnum;
 import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.module.organization.mapper.RoleMapper;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.teacher.mapper.XjrUserMapper;
 import com.xjrsoft.module.textbook.dto.ConfirmDistributeDto;
 import com.xjrsoft.module.textbook.dto.WfTextbookClaimPageDto;
 import com.xjrsoft.module.textbook.entity.*;
+import com.xjrsoft.module.textbook.mapper.TextbookClaimUserMapper;
 import com.xjrsoft.module.textbook.mapper.WfTextbookClaimItemMapper;
 import com.xjrsoft.module.textbook.mapper.WfTextbookClaimMapper;
 import com.xjrsoft.module.textbook.service.ITextbookIssueRecordService;
@@ -48,12 +50,15 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
 
     private final XjrUserMapper xjrUserMapper;
 
+    private final RoleMapper roleMapper;
+
     private final ITextbookService textbookService;
 
     private final ITextbookStudentClaimService textbookStudentClaimService;
 
     private final ITextbookIssueRecordService textbookIssueRecordService;
 
+    private final TextbookClaimUserMapper textbookClaimUserMapper;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -114,10 +119,12 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
 
     @Override
     public IPage<WfTextbookClaimPageVo> getPage(WfTextbookClaimPageDto dto) {
-        IPage<WfTextbookClaimPageVo> page = wfTextbookClaimWfTextbookClaimMapper.getPage(ConventPage.getPage(dto), dto);
+
+        dto.setUserId(StpUtil.getLoginIdAsLong());
+        IPage<WfTextbookClaimPageVo> page = wfTextbookClaimWfTextbookClaimMapper.getPage(ConventPage.getPage(dto),dto);
 
         for (WfTextbookClaimPageVo wfTextbookClaimPageVo : page.getRecords()) {
-            //拆分代领人
+            //拆分代领
             String receiveUserIdStr = wfTextbookClaimPageVo.getReceiveUserId();
             if (ObjectUtil.isNotNull(receiveUserIdStr) && !receiveUserIdStr.equals("")) {
                 String[] receiveUserIdStrs = receiveUserIdStr.split(",");
@@ -127,7 +134,7 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
                 }
                 LambdaQueryWrapper<XjrUser> queryWrapper = new LambdaQueryWrapper<>();
                 queryWrapper
-                        .in(XjrUser::getId, receiveUserIdStr);
+                        .in(XjrUser::getId, receiveUserIdList);
                 List<XjrUser> xjrUserList = xjrUserMapper.selectList(queryWrapper);
                 if (ObjectUtil.isNotNull(xjrUserList) && xjrUserList.size() > 0) {
                     StringBuilder sb = new StringBuilder();
@@ -186,7 +193,7 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
     public Boolean confirmDistribute(ConfirmDistributeDto dto) {
         WfTextbookClaim wfTextbookClaim = this.getById(dto.getTextbookClaimId());
 
-        if (ObjectUtil.isNull(wfTextbookClaim) || ObjectUtil.isNull(dto.getTextbookClaimItemList()) || dto.getTextbookClaimItemList().size() <= 0) {
+        if (ObjectUtil.isNull(wfTextbookClaim) || ObjectUtil.isNull(dto.getTextbookClaimItemList()) || dto.getTextbookClaimItemList().size() == 0) {
             throw new MyException("未找到申领数据");
         }
 
@@ -213,7 +220,7 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
                 throw new MyException(textbook.getBookName() + "发放总数量超出申领数量");
             }
 
-            //判断总发放数量是否超出该申请的申请数量
+            //判断总发放数量是否超出该申请的申请数量
             Integer stock = ObjectUtil.isNull(textbook.getStock()) ? 0 : textbook.getStock();
             if (stock < confirmNumber) {
                 throw new MyException(textbook.getBookName() + "库存不足");
@@ -251,10 +258,10 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
 
             //当申领类型为学生的时候,为班级每个学生生成领取(确认信息)认领记录
             //查出班上的所有学生id
-            if(ObjectUtil.isNotNull(wfTextbookClaim.getClaimType()) && wfTextbookClaim.getClaimType().equals(ClaimTypeEnum.ClaimStudent.getCode())){
+            if (ObjectUtil.isNotNull(wfTextbookClaim.getClaimType()) && wfTextbookClaim.getClaimType().equals(ClaimTypeEnum.ClaimStudent.getCode())) {
                 List<Long> userIdList = xjrUserMapper.getUserIdByClassId(wfTextbookClaim.getClassId());
 
-                if (ObjectUtil.isNull(userIdList) && userIdList.size() <= 0) {
+                if (ObjectUtil.isNull(userIdList) && userIdList.size() == 0) {
                     throw new MyException("申领班级有误,请核实");
                 }
 
@@ -271,4 +278,44 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
         return true;
     }
 
+    @Override
+    @Transactional
+    public Boolean dataHandleAddClaimUserNode(Long id) {
+        WfTextbookClaim wfTextbookClaim = this.getById(id);
+        if (ObjectUtil.isNotNull(wfTextbookClaim)
+                && ObjectUtil.isNotNull(wfTextbookClaim.getClaimType())) {
+            //所有需要添加的可领取人ID
+            List<TextbookClaimUser> textbookClaimUserList = new ArrayList<>();
+            textbookClaimUserList.add(new TextbookClaimUser() {{
+                setWfTextbookClaimId(wfTextbookClaim.getId());
+                setUserId(wfTextbookClaim.getApplicantUserId());
+                setUserType(2);
+            }});
+            //申领类型是学生申领,学生代表可领取
+            if (wfTextbookClaim.getClaimType().equals(ClaimTypeEnum.ClaimStudent.getCode())) {
+                textbookClaimUserList.add(new TextbookClaimUser() {{
+                    setWfTextbookClaimId(wfTextbookClaim.getId());
+                    setUserId(wfTextbookClaim.getStudentUserId());
+                    setUserType(1);
+                }});
+            }
+            //申领类型是教师申领,领取人可领取
+            if (wfTextbookClaim.getClaimType().equals(ClaimTypeEnum.ClaimTeacher.getCode())
+                    && ObjectUtil.isNotNull(wfTextbookClaim.getApplicantUserId())
+                    && ObjectUtil.isNotNull(wfTextbookClaim.getClaimUserId())
+                    && wfTextbookClaim.getApplicantUserId().equals(wfTextbookClaim.getClaimUserId())) {
+                textbookClaimUserList.add(new TextbookClaimUser() {{
+                    setWfTextbookClaimId(wfTextbookClaim.getId());
+                    setUserId(wfTextbookClaim.getClaimUserId());
+                    setUserType(2);
+                }});
+            }
+
+            for (TextbookClaimUser textbookClaimUser : textbookClaimUserList) {
+                textbookClaimUserMapper.insert(textbookClaimUser);
+            }
+        }
+        return true;
+    }
+
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/textbook/vo/TeacherCheckByclassVo.java

@@ -32,6 +32,11 @@ public class TeacherCheckByclassVo {
      */
     @ApiModelProperty("学期id")
     private String baseSemesterIdCN;
+    /**
+     * 班级id
+     */
+    @ApiModelProperty("班级id")
+    private Long classId;
     /**
     * 班级人数
     */

+ 79 - 0
src/main/java/com/xjrsoft/module/textbook/vo/TextbookClaimUserPageVo.java

@@ -0,0 +1,79 @@
+package com.xjrsoft.module.textbook.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import com.xjrsoft.common.annotation.Trans;
+import com.xjrsoft.common.enums.TransType;
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+* @title: 教材领取人员分页列表出参
+* @Author dzx
+* @Date: 2023-12-29
+* @Version 1.0
+*/
+@Data
+public class TextbookClaimUserPageVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private String id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    private Long modifyUserId;
+    /**
+    * 修改时间
+    */
+    @ApiModelProperty("修改时间")
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ApiModelProperty("删除标记")
+    private Integer deleteMark;
+    /**
+    * 有效标志
+    */
+    @ApiModelProperty("有效标志")
+    private Integer enabledMark;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 教材申领编号
+    */
+    @ApiModelProperty("教材申领编号")
+    private Long wfTextbookClaimId;
+    /**
+    * 用户编号
+    */
+    @ApiModelProperty("用户编号")
+    private Long userId;
+    /**
+    * 用户类型(1:学生 2=教师)
+    */
+    @ApiModelProperty("用户类型(1:学生 2=教师)")
+    private Integer userType;
+
+}

+ 49 - 0
src/main/java/com/xjrsoft/module/textbook/vo/TextbookClaimUserVo.java

@@ -0,0 +1,49 @@
+package com.xjrsoft.module.textbook.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+/**
+* @title: 教材领取人员表单出参
+* @Author dzx
+* @Date: 2023-12-29
+* @Version 1.0
+*/
+@Data
+public class TextbookClaimUserVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 教材申领编号
+    */
+    @ApiModelProperty("教材申领编号")
+    private Long wfTextbookClaimId;
+    /**
+    * 用户编号
+    */
+    @ApiModelProperty("用户编号")
+    private Long userId;
+    /**
+    * 用户类型(1:学生 2=教师)
+    */
+    @ApiModelProperty("用户类型(1:学生 2=教师)")
+    private Integer userType;
+
+
+
+}

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

@@ -26,6 +26,6 @@ public class TextbookStudentSemesterVo {
      * 该学生该学期未领取数量
      */
     @ApiModelProperty("该学生该学期未领取数量")
-    private Integer notClaimNum;
+    private Long notClaimNum;
 
 }

+ 2 - 2
src/main/java/com/xjrsoft/module/textbook/vo/WfTextbookClaimPageVo.java

@@ -15,8 +15,8 @@ import java.util.List;
 public class WfTextbookClaimPageVo {
 
     /**
-    * 主键编号
-    */
+     * 主键编号
+     */
     @ApiModelProperty("主键编号")
     private String id;
     /**

+ 29 - 32
src/main/resources/mapper/textbook/TextbookStudentClaimMapper.xml

@@ -23,36 +23,27 @@
         ORDER BY t.id DESC
     </select>
 
-    <select id="getStudentSemesterList" parameterType="java.lang.Long"
-            resultType="com.xjrsoft.module.textbook.vo.TextbookStudentSemesterVo">
-        SELECT t.base_semester_id,
-               t1.name as baseSemesterIdCN,
-               count(*) as notClaimNum
-        FROM textbook_student_claim t
-                 LEFT JOIN base_semester t1 ON (t1.id = t.base_semester_id)
-                 LEFT JOIN (select base_semester_id
-                            from textbook_student_claim
-                            where student_user_id = #{studentUserId}
-                            GROUP BY base_semester_id) t2 ON (t2.base_semester_id = t.base_semester_id)
-        WHERE t.delete_mark = 0 and t.is_claim = 0
-          AND (t.student_user_id = #{studentUserId})
-        GROUP BY base_semester_id
-    </select>
-
-    <select id="getTeacherCheckByclassList" parameterType="java.lang.Long"
+    <select id="getTeacherCheckByclassList" parameterType="com.xjrsoft.module.textbook.dto.TeacherCheckByclassDto"
             resultType="com.xjrsoft.module.textbook.vo.TeacherCheckByclassVo">
-        SELECT t.id               AS textbookId,
-               t.book_name        AS bookName,
-               t.base_semester_id AS baseSemesterId,
-               t3.name            AS baseSemesterIdCN,
-               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 = #{classId})
-        WHERE t.delete_mark = 0 and t.id in (SELECT textbook_id
-                                             FROM textbook_student_claim
-                                             WHERE delete_mark = 0 AND class_id = #{classId}
-                                             GROUP BY textbook_id)
+        SELECT a.class_id,
+        b.id            as textbookId,
+        b.book_name,
+        c.name,
+        d.total_student as classStudentNum
+        from textbook b
+        right join (SELECT class_id, textbook_id
+        from textbook_student_claim
+        GROUP BY class_id, textbook_id) a on a.textbook_id = b.id
+        left join base_class c on a.class_id = c.id
+        left join base_class_major_set d on c.id = d.class_id
+        where a.class_id != 0
+        <if test="dto.classIdList != null and dto.classIdList.size() > 0">
+            and a.class_id in
+            <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")"
+                     separator=",">
+                #{classId}
+            </foreach>
+        </if>
     </select>
 
     <select id="getTeacherCheckStuClaimList" parameterType="com.xjrsoft.module.textbook.dto.TeacherCheckStuClaimDto"
@@ -77,7 +68,7 @@
     <select id="getTeacherCheckByStuList" parameterType="com.xjrsoft.module.textbook.dto.TeacherCheckByStuDto"
             resultType="com.xjrsoft.module.textbook.vo.TeacherCheckByStuVo">
         SELECT
-        t.id,
+        t.id as studentUserId,
         t.name as studentUserIdCN,
         t1.student_id as studentId
         FROM xjr_user t
@@ -85,7 +76,13 @@
         where t.id in (SELECT student_user_id
         FROM textbook_student_claim
         WHERE delete_mark = 0
-        AND class_id = #{dto.classId}
+        <if test="dto.classIdList != null and dto.classIdList.size() > 0">
+            and class_id in
+            <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")"
+                     separator=",">
+                #{classId}
+            </foreach>
+        </if>
         GROUP BY student_user_id)
         <if test="dto.studentUserId != null and dto.studentUserId != 0 and dto.studentUserId != ''">
             t.id = #{dto.studentUserId}
@@ -101,7 +98,7 @@
             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}
+        where t.student_user_id = #{studentUserId}
         ORDER BY t.is_claim
     </select>
 </mapper>

+ 9 - 8
src/main/resources/mapper/textbook/WfTextbookClaimMapper.xml

@@ -12,16 +12,17 @@
             t3.name as baseSemesterIdCN,
             t4.name as studentUserIdCN,
             t5.name as claimTypeCN,
+            t6.user_id,
             t7.name as claimUserIdCN
         FROM wf_textbook_claim t
-             LEFT JOIN xjr_user t1 ON (t1.id = t.applicant_user_id)
-             LEFT JOIN base_class t2 ON (t2.id = t.class_id)
-             LEFT JOIN base_semester t3 ON (t3.id = t.base_semester_id)
-             LEFT JOIN xjr_user t4 ON (t4.id = t.student_user_id)
-             LEFT JOIN xjr_dictionary_detail t5 ON (t5.code = t.claim_type)
-             LEFT JOIN textbook_claim_user t6 ON (t6.id = t.claim_user_id)
-             LEFT JOIN xjr_user t7 ON (t7.id = t6.user_id)
-        WHERE t.delete_mark = 0
+                 LEFT JOIN xjr_user t1 ON (t1.id = t.applicant_user_id)
+                 LEFT JOIN base_class t2 ON (t2.id = t.class_id)
+                 LEFT JOIN base_semester t3 ON (t3.id = t.base_semester_id)
+                 LEFT JOIN xjr_user t4 ON (t4.id = t.student_user_id)
+                 LEFT JOIN xjr_dictionary_detail t5 ON (t5.code = t.claim_type)
+                 LEFT JOIN textbook_claim_user t6 ON (t6.wf_textbook_claim_id = t.id)
+                 LEFT JOIN xjr_user t7 ON (t7.id = t6.user_id)
+        WHERE t.delete_mark = 0 and t6.user_id = #{dto.userId}
         order by t.id;
     </select>
 

+ 168 - 16
src/main/resources/sqlScript/20231218_sql.sql

@@ -82,7 +82,7 @@ CREATE TABLE wf_head_teacher_leave
     `end_time` date NULL DEFAULT NULL COMMENT '结束时间',
     `is_substitute` INT NOT NULL default 0 COMMENT '是否有替班教师(1:是 0:否)',
     `substitute_user_id` bigint NULL DEFAULT NULL COMMENT '替换教师',
-    `remark` varchar(1000) COMMENT '备注',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     `status` int not null default 0 COMMENT '状态(1:结束 0:未结束)',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '班主任事项请假';
@@ -132,7 +132,7 @@ CREATE TABLE wf_cadre_candidate
     `cadre_dept_id` bigint NULL DEFAULT NULL COMMENT '干部部门编号',
     `class_name` VARCHAR(200) NULL DEFAULT NULL COMMENT '班级名称',
     `instructor_user_id`  bigint NULL DEFAULT NULL COMMENT '部门指导教师用户编号',
-    `remark` varchar(1000) COMMENT '备注',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     `status` int not null default 0 COMMENT '状态(1:结束 0:未结束)',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '干部候选人';
@@ -224,7 +224,7 @@ CREATE TABLE subject_group
     `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
     `group_name` varchar(100) not null default '' COMMENT '组名',
     `leader_user_id` bigint NULL DEFAULT NULL COMMENT '组长用户编号',
-    `remark` varchar(1000) COMMENT '备注',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '学科组管理';
 
@@ -265,7 +265,7 @@ CREATE TABLE wf_textbook_subscription
     `dept_id` bigint NULL DEFAULT NULL COMMENT '所在部门编号',
     `base_semester_id` bigint COMMENT '学期ID(base_semester)',
     `subject_group_id` bigint NULL COMMENT '学科组管理编号(subject_group)',
-    `remark` varchar(1000) COMMENT '备注',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     `status` int not null default 0 COMMENT '状态(1:结束 0:未结束)',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '教材教辅征订';
@@ -320,7 +320,7 @@ CREATE TABLE wf_exercise_book
     `applicant_user_id` bigint NULL DEFAULT NULL COMMENT '申请人',
     `class_id` bigint NULL DEFAULT NULL COMMENT '班级编号',
     `base_semester_id` bigint COMMENT '学期ID(base_semester)',
-    `remark` varchar(1000) COMMENT '备注',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     `status` int not null default 0 COMMENT '状态(1:结束 0:未结束)',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '作业本征订';
@@ -509,7 +509,7 @@ CREATE TABLE textbook_warehouse_record
     `subtotal` decimal(10,2) NULL DEFAULT NULL COMMENT '小计(元)',
     `total_price` decimal(10,2) NULL DEFAULT NULL COMMENT '总价(元)',
     `warehouse_mode` varchar(20) NULL DEFAULT NULL COMMENT '入库方式(xjr_dictionary_item[warehouse_mode])',
-    `remark` varchar(1000) COMMENT '备注',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '教材入库记录';
 
@@ -555,7 +555,7 @@ CREATE TABLE textbook_student_claim
     `student_user_id` BIGINT NULL DEFAULT NULL COMMENT '学生用户编号',
     `textbook_id` bigint NULL DEFAULT NULL COMMENT '教材管理编号',
     `is_claim` int not null default 0 COMMENT '是否领取(1:已领取 0:未领取)',
-    `remark` varchar(1000) COMMENT '备注',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '学生教材认领记录';
 
@@ -604,6 +604,46 @@ CREATE TABLE wf_textbook_recede_item
 -- ------------------------------------------------------------------教材管理--------------------------------------------------------------------
 
 -- ------------------------------------------------------------------寝室管理--------------------------------------------------------------------
+-- ----------------------------
+-- 寝室生成规则
+-- ----------------------------
+DROP TABLE IF EXISTS room_rule;
+CREATE TABLE room_rule
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `floor_number` int NOT NULL COMMENT '楼层',
+    `name` varchar(100) NULL DEFAULT NULL COMMENT '规则名称',
+    `rule` varchar(500) NULL DEFAULT NULL COMMENT '规则配置(多个规则用逗号隔开)',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '寝室生成规则';
+
+-- ----------------------------
+-- 寝室生成规则项
+-- ----------------------------
+DROP TABLE IF EXISTS room_rule_item;
+CREATE TABLE room_rule_item
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `room_rule_id` bigint NOT NULL COMMENT '寝室生成规则编号(room_rule)',
+    `office_build_id` bigint NOT NULL COMMENT '楼栋(base_office_build)',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '寝室生成规则项';
+
 -- ----------------------------
 -- 寝室维护
 -- ----------------------------
@@ -625,7 +665,7 @@ CREATE TABLE room
     `gender` varchar(20) NULL DEFAULT NULL COMMENT '入住性别(xjr_dictionary_item[gender])',
     `bed_count` int NULL DEFAULT 0 COMMENT '床位数',
     `is_max` int not null default 0 COMMENT '是否是混合寝室【一个寝室有多个班级的学生】(1:是 0:否)',
-    `remark` varchar(1000) COMMENT '备注',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '寝室';
 
@@ -647,12 +687,12 @@ CREATE TABLE room_bed
     `bed_number` int NULL DEFAULT 0 COMMENT '床位号',
     `student_user_id` BIGINT NULL DEFAULT NULL COMMENT '学生用户编号',
     `is_check_in` int not null default 0 COMMENT '是否入住(1:是 0:否)',
-    `remark` varchar(1000) COMMENT '备注',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '寝室床位';
 
 -- ----------------------------
--- 寝室任命(任命学生)
+-- 寝室干部任命(任命学生)
 -- ----------------------------
 DROP TABLE IF EXISTS room_student_appoint;
 CREATE TABLE room_student_appoint
@@ -668,7 +708,8 @@ CREATE TABLE room_student_appoint
     `room_id` bigint NOT NULL COMMENT '寝室编号(room)',
     `room_bed_id` bigint NOT NULL COMMENT '寝室床位编号(room_bed)',
     `student_user_id` BIGINT NULL DEFAULT NULL COMMENT '学生用户编号',
-    `remark` varchar(1000) COMMENT '备注',
+    `post_id` BIGINT NULL DEFAULT NULL COMMENT '职务编号【只取职位级别为寝室的,cadreLevel_room】(base_student_post)',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '寝室长任命';
 
@@ -688,7 +729,7 @@ CREATE TABLE room_teacher_appoint
     `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
     `room_id` bigint NOT NULL COMMENT '寝室编号(room)',
     `user_id` BIGINT NULL DEFAULT NULL COMMENT '用户编号',
-    `remark` varchar(1000) COMMENT '备注',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '宿管任命';
 
@@ -748,12 +789,13 @@ CREATE TABLE wf_room_applicant
     `enabled_mark` INT NOT NULL COMMENT '有效标志',
     `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
     `applicant_user_id` bigint NULL DEFAULT NULL COMMENT '申请人',
+    `head_teacher_id` bigint NULL DEFAULT NULL COMMENT '班主任用户编号',
     `recede_type` varchar(20) NULL DEFAULT NULL COMMENT '寝室申请类型(xjr_dictionary_item[room_applicant_type])',
     `class_name` varchar(200) NULL DEFAULT NULL COMMENT '班级名称',
     `room_bed_number`  varchar(200) NULL DEFAULT NULL COMMENT '寝室+床位名称',
     `start_time` date NULL DEFAULT NULL COMMENT '开始时间',
     `nos_reason` varchar(20) NULL DEFAULT NULL COMMENT '离宿事由(xjr_dictionary_item[nos_reason])',
-    `remark` varchar(1000) COMMENT '备注',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     `status` int not null default 0 COMMENT '状态(1:结束 0:未结束)',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '寝室申请';
@@ -773,8 +815,9 @@ CREATE TABLE wf_room_report
     `enabled_mark` INT NOT NULL COMMENT '有效标志',
     `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
     `applicant_user_id` bigint NULL DEFAULT NULL COMMENT '申请人',
+    `head_teacher_id` bigint NULL DEFAULT NULL COMMENT '班主任用户编号',
     `room_bed_number`  varchar(200) NULL DEFAULT NULL COMMENT '寝室+床位名称',
-    `remark` varchar(1000) COMMENT '备注',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
     `file_id` BIGINT NULL DEFAULT NULL COMMENT '附件文件id',
     `status` int not null default 0 COMMENT '状态(1:结束 0:未结束)',
     PRIMARY KEY (`id`)
@@ -795,6 +838,7 @@ CREATE TABLE wf_room_stay_overnight
     `enabled_mark` INT NOT NULL COMMENT '有效标志',
     `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
     `applicant_user_id` bigint NULL DEFAULT NULL COMMENT '申请人',
+    `head_teacher_id` bigint NULL DEFAULT NULL COMMENT '班主任用户编号',
     `room_bed_number`  varchar(200) NULL DEFAULT NULL COMMENT '寝室+床位名称',
     `student_id` VARCHAR(30) NULL DEFAULT NULL COMMENT '学号',
     `gender_name` VARCHAR(200) NULL DEFAULT NULL COMMENT '性别',
@@ -803,13 +847,121 @@ CREATE TABLE wf_room_stay_overnight
     `end_time` DATE NULL DEFAULT NULL COMMENT '结束时间',
     `duration` int NULL DEFAULT NULL COMMENT '时长(天)',
     `mobile` VARCHAR(30) NULL DEFAULT NULL COMMENT '联系电话',
-    `guardian_mobile` VARCHAR(30) NULL DEFAULT NULL COMMENT '联系电话',
-    `remark` varchar(1000) COMMENT '备注',
+    `guardian_mobile` VARCHAR(30) NULL DEFAULT NULL COMMENT '监护人电话',
+    `remark` varchar(1000)NULL DEFAULT NULL  COMMENT '备注',
     `status` int not null default 0 COMMENT '状态(1:结束 0:未结束)',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '留校住宿申请';
+
+-- ----------------------------
+-- 查寝记录
+-- ----------------------------
+DROP TABLE IF EXISTS room_bed_check_record;
+CREATE TABLE room_bed_check_record
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `user_id` bigint NULL DEFAULT NULL COMMENT '填写人',
+    `class_id` bigint NULL DEFAULT NULL COMMENT '班级编号',
+    `check_record_time` DATETIME NULL DEFAULT NULL COMMENT '查寝时间',
+    `condition` varchar(1000) NULL DEFAULT NULL COMMENT '情况',
+    `remark` varchar(1000) NULL DEFAULT NULL COMMENT '备注',
+    `file_id` BIGINT NULL DEFAULT NULL COMMENT '附件文件id',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '查寝记录';
+
+-- ----------------------------
+-- 查寝记录(关联寝室)
+-- ----------------------------
+DROP TABLE IF EXISTS room_bed_check_record_relation;
+CREATE TABLE room_bed_check_record_relation
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `room_bed_check_record_id` bigint NULL DEFAULT NULL COMMENT '查寝记录编号(room_bed_check_record)',
+    `room_id` bigint NOT NULL COMMENT '寝室编号(room)',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '查寝记录(关联寝室)';
+
+-- ----------------------------
+-- 宿管值班管理
+-- ----------------------------
+DROP TABLE IF EXISTS room_value_week;
+CREATE TABLE room_value_week
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `start_time` DATE NULL DEFAULT NULL COMMENT '开始时间',
+    `end_time` DATE NULL DEFAULT NULL COMMENT '结束时间',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '宿管值班管理';
+
+-- ----------------------------
+-- 宿管值班管理(人员)
+-- ----------------------------
+DROP TABLE IF EXISTS room_value_week_item;
+CREATE TABLE room_value_week
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `room_value_week_id` bigint NULL DEFAULT NULL COMMENT '宿管值班管理编号(room_value_week)',
+    `user_id` BIGINT NULL DEFAULT NULL COMMENT '值班人员用户编号',
+    `post_name` varchar(20) NULL DEFAULT NULL COMMENT '职务(宿管、教官)',
+    `room_type` varchar(20) NULL DEFAULT NULL COMMENT '负责寝室(男寝、女寝固定)',
+    `number_people` int NULL DEFAULT NULL COMMENT '人数(添加时先默认统计一个进去)',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '宿管值班管理(人员)';
 -- ------------------------------------------------------------------寝室管理--------------------------------------------------------------------
 
+-- ----------------------------
+-- 值周排班
+-- ----------------------------
+DROP TABLE IF EXISTS weekly_duty_schedule;
+CREATE TABLE weekly_duty_schedule
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `user_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '学号/工号',
+    `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '姓名',
+    `gender` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '性别',
+    `credential_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '证件号码',
+    `date_birth` DATE NULL DEFAULT NULL COMMENT '出生日期',
+    `age` int NULL DEFAULT NULL COMMENT '年龄',
+    `remark` varchar(1000)NULL DEFAULT NULL  COMMENT '备注',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '值周排班';
+
+ALTER TABLE base_office_build ADD COLUMN `build_number` INT NULL DEFAULT NULL COMMENT '楼栋号' AFTER build_type;
 
 
 

+ 1 - 0
src/test/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImplTest.java

@@ -25,4 +25,5 @@ class TextbookServiceImplTest {
     void dataHandleAddExerciseBookNode() {
         textbookService.dataHandleAddExerciseBookNode(1739576230844362752L);
     }
+
 }

+ 23 - 0
src/test/java/com/xjrsoft/module/textbook/service/impl/WfTextbookClaimServiceImplTest.java

@@ -0,0 +1,23 @@
+package com.xjrsoft.module.textbook.service.impl;
+
+import com.xjrsoft.module.textbook.service.IWfTextbookClaimService;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+/**
+ * @description:TODO
+ * @author: phoenix
+ * @create: 2023/12/29 10:34
+ * @Version 1.0
+ */
+@SpringBootTest
+class WfTextbookClaimServiceImplTest {
+
+    @Autowired
+    private IWfTextbookClaimService wfTextbookClaimService;
+    @Test
+    void dataHandleAddClaimUserNode() {
+        wfTextbookClaimService.dataHandleAddClaimUserNode(1739576121003929600L);
+    }
+}

+ 28 - 0
src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

@@ -1587,6 +1587,34 @@ public class FreeMarkerGeneratorTest {
         apiGeneratorService.generateCodes(params);
     }
 
+    /**
+     * 教材领取人员
+     * @throws IOException
+     */
+    @Test
+    public void gcTextbookClaimUser() throws IOException {
+        List<TableConfig> tableConfigs = new ArrayList<>();
+        TableConfig mainTable = new TableConfig();
+        mainTable.setTableName("textbook_claim_user");//init_sql中的表名
+        mainTable.setIsMain(true);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        tableConfigs.add(mainTable);
+
+        ApiGenerateCodesDto params = new ApiGenerateCodesDto();
+        params.setAuthor("dzx");//作者名称
+        params.setPackageName("textbook");//包名
+        params.setTableConfigs(tableConfigs);
+        params.setPage(true);//是否生成分页接口
+        params.setImport(false);//是否生成导入接口
+        params.setExport(false);//是否生成导出接口
+        params.setOutMainDir(true);//是否生成在主目录,前期测试可设置成false
+        params.setDs(ds);
+
+        IApiGeneratorService apiGeneratorService = new ApiGeneratorServiceImpl();
+
+        apiGeneratorService.generateCodes(params);
+    }
 
     /**
      * 宿管员管理