Forráskód Böngészése

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

dzx 1 éve
szülő
commit
f2d6ee96fa
42 módosított fájl, 1485 hozzáadás és 55 törlés
  1. 193 0
      src/main/java/com/xjrsoft/module/base/controller/BaseClassCourseController.java
  2. 48 0
      src/main/java/com/xjrsoft/module/base/dto/AddBaseClassCourseDto.java
  3. 35 0
      src/main/java/com/xjrsoft/module/base/dto/BaseClassCoursePageDto.java
  4. 32 0
      src/main/java/com/xjrsoft/module/base/dto/UpdateBaseClassCourseDto.java
  5. 98 0
      src/main/java/com/xjrsoft/module/base/entity/BaseClassCourse.java
  6. 17 0
      src/main/java/com/xjrsoft/module/base/entity/ClassCourseTextbook.java
  7. 16 0
      src/main/java/com/xjrsoft/module/base/entity/CourseBookInfo.java
  8. 42 0
      src/main/java/com/xjrsoft/module/base/mapper/BaseClassCourseMapper.java
  9. 47 0
      src/main/java/com/xjrsoft/module/base/service/IBaseClassCourseService.java
  10. 112 0
      src/main/java/com/xjrsoft/module/base/service/impl/BaseClassCourseServiceImpl.java
  11. 127 0
      src/main/java/com/xjrsoft/module/base/vo/BaseClassCoursePageVo.java
  12. 49 0
      src/main/java/com/xjrsoft/module/base/vo/BaseClassCourseVo.java
  13. 1 1
      src/main/java/com/xjrsoft/module/liteflow/node/AddTextbookNode.java
  14. 64 0
      src/main/java/com/xjrsoft/module/textbook/controller/TextbookController.java
  15. 188 0
      src/main/java/com/xjrsoft/module/textbook/controller/WfTextbookSubscriptionController.java
  16. 13 2
      src/main/java/com/xjrsoft/module/textbook/dto/AddWfTextbookSubscriptionDto.java
  17. 6 1
      src/main/java/com/xjrsoft/module/textbook/dto/AddWfTextbookSubscriptionItemDto.java
  18. 3 0
      src/main/java/com/xjrsoft/module/textbook/dto/TextbookPageDto.java
  19. 25 0
      src/main/java/com/xjrsoft/module/textbook/dto/TextbookSubscriptionListDto.java
  20. 11 1
      src/main/java/com/xjrsoft/module/textbook/dto/UpdateWfTextbookSubscriptionDto.java
  21. 1 1
      src/main/java/com/xjrsoft/module/textbook/dto/WfTextbookSubscriptionPageDto.java
  22. 5 1
      src/main/java/com/xjrsoft/module/textbook/entity/Textbook.java
  23. 10 1
      src/main/java/com/xjrsoft/module/textbook/entity/WfTextbookSubscription.java
  24. 6 2
      src/main/java/com/xjrsoft/module/textbook/entity/WfTextbookSubscriptionItem.java
  25. 1 0
      src/main/java/com/xjrsoft/module/textbook/mapper/TextbookIssueRecordMapper.java
  26. 2 1
      src/main/java/com/xjrsoft/module/textbook/mapper/WfTextbookSubscriptionItemMapper.java
  27. 2 1
      src/main/java/com/xjrsoft/module/textbook/mapper/WfTextbookSubscriptionMapper.java
  28. 1 1
      src/main/java/com/xjrsoft/module/textbook/service/ITextbookService.java
  29. 3 11
      src/main/java/com/xjrsoft/module/textbook/service/IWfTextbookSubscriptionService.java
  30. 3 10
      src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java
  31. 4 16
      src/main/java/com/xjrsoft/module/textbook/service/impl/WfTextbookSubscriptionServiceImpl.java
  32. 26 0
      src/main/java/com/xjrsoft/module/textbook/vo/GradeClassListVo.java
  33. 25 0
      src/main/java/com/xjrsoft/module/textbook/vo/GradeClassTreeVo.java
  34. 5 0
      src/main/java/com/xjrsoft/module/textbook/vo/TextbookPageVo.java
  35. 63 0
      src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionListVo.java
  36. 5 0
      src/main/java/com/xjrsoft/module/textbook/vo/TextbookVo.java
  37. 1 1
      src/main/java/com/xjrsoft/module/textbook/vo/WfTextbookSubscriptionItemVo.java
  38. 45 1
      src/main/java/com/xjrsoft/module/textbook/vo/WfTextbookSubscriptionPageVo.java
  39. 6 1
      src/main/java/com/xjrsoft/module/textbook/vo/WfTextbookSubscriptionVo.java
  40. 142 0
      src/main/resources/mapper/base/BaseClassCourse.xml
  41. 1 1
      src/main/resources/mapper/teacher/XjrUserMapper.xml
  42. 1 1
      src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

+ 193 - 0
src/main/java/com/xjrsoft/module/base/controller/BaseClassCourseController.java

@@ -0,0 +1,193 @@
+package com.xjrsoft.module.base.controller;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.module.base.dto.AddBaseClassCourseDto;
+import com.xjrsoft.module.base.dto.UpdateBaseClassCourseDto;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.alibaba.excel.EasyExcel;
+import com.xjrsoft.module.base.entity.ClassCourseTextbook;
+import com.xjrsoft.module.base.entity.CourseBookInfo;
+import com.xjrsoft.module.base.service.impl.BaseCourseSubjectServiceImpl;
+import com.xjrsoft.module.textbook.service.impl.TextbookServiceImpl;
+import org.apache.ibatis.annotations.Param;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.multipart.MultipartFile;
+import java.io.IOException;
+import com.alibaba.excel.support.ExcelTypeEnum;
+import org.springframework.http.ResponseEntity;
+import java.io.ByteArrayOutputStream;
+import java.util.ArrayList;
+
+import com.xjrsoft.module.base.dto.BaseClassCoursePageDto;
+import com.xjrsoft.module.base.entity.BaseClassCourse;
+import com.xjrsoft.module.base.service.IBaseClassCourseService;
+import com.xjrsoft.module.base.vo.BaseClassCoursePageVo;
+
+import com.xjrsoft.module.base.vo.BaseClassCourseVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+* @title: 班级课程
+* @Author brealinxx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/base" + "/baseClassCourse")
+@Api(value = "/base"  + "/baseClassCourse",tags = "班级课程代码")
+@AllArgsConstructor
+public class BaseClassCourseController {
+
+
+    private static final Logger log = LoggerFactory.getLogger(BaseClassCourseController.class);
+    private final IBaseClassCourseService baseClassCourseService;
+    private final BaseCourseSubjectServiceImpl baseCourseSubjectServiceImpl;
+    private final TextbookServiceImpl textbookServiceImpl;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="班级课程列表(分页)")
+    @SaCheckPermission("baseclasscourse:detail")
+    public RT<PageOutput<BaseClassCoursePageVo>> page(@Valid BaseClassCoursePageDto dto){
+        Page<BaseClassCoursePageVo> page = baseClassCourseService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<BaseClassCoursePageVo> pageOutput = ConventPage.getPageOutput(page, BaseClassCoursePageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping("/getSemesterTree")
+    @ApiOperation("获取年级树结构")
+    @SaCheckPermission("baseclasscourse:detail")
+    public RT<Map<String, Map<String, Object>>> semesterTree(){
+        Map<String, Map<String, Object>> tree = baseClassCourseService.getSemesterTree();
+        return RT.ok(tree);
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询班级课程信息")
+    @SaCheckPermission("baseclasscourse:detail")
+    public RT<BaseClassCourseVo> info(@RequestParam Long id){
+        BaseClassCourse baseClassCourse = baseClassCourseService.getById(id);
+        if (baseClassCourse == null) {
+           return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(baseClassCourse, BaseClassCourseVo.class));
+    }
+
+    @GetMapping("/getAllCoursesAndTextbooks")
+    @ApiOperation(value="获取所有课程教材")
+    @SaCheckPermission("baseclasscourse:detail")
+    public RT<List<CourseBookInfo>> getAllCoursesAndTextbooks(@RequestParam(required = false) Long subjectGroupId) {
+        List<CourseBookInfo> data = baseClassCourseService.getAllCourseBook(subjectGroupId);
+        return RT.ok(data);
+    }
+
+    @GetMapping("/getAllSelectedCoursesAndTextbooks")
+    @ApiOperation(value="获取所有以选择课程教材")
+    @SaCheckPermission("baseclasscourse:detail")
+    public RT<List<CourseBookInfo>> getAllSelectedCoursesAndTextbooks(@RequestParam(required = false) Long[] classIds) {
+        List<CourseBookInfo> data = baseClassCourseService.getSelectedCourseBook(classIds);
+        return RT.ok(data);
+    }
+
+    @GetMapping("/updateAddCoursesAndTextbooks")
+    @ApiOperation(value="更新增加课程教材")
+    @SaCheckPermission("baseclasscourse:detail")
+    public RT updateAddCoursesAndTextbooks(@Valid ClassCourseTextbook list) {
+        baseClassCourseService.updateAddCourseBook(list.getClassId(), list.getCourseId(), list.getTextbookId());
+        return RT.ok();
+    }
+
+    @GetMapping("/updateRemoveCoursesAndTextbooks")
+    @ApiOperation(value="更新减少课程教材")
+    @SaCheckPermission("baseclasscourse:detail")
+    public RT updateRemoveCoursesAndTextbooks(@Valid ClassCourseTextbook list) {
+        baseClassCourseService.updateRemoveCourseBook(list.getClassId(), list.getCourseId(), list.getTextbookId());
+        return RT.ok();
+    }
+
+    @GetMapping("/insertClassCourseTextbookCombinations")
+    @ApiOperation(value="复用课程教材")
+    @SaCheckPermission("baseclasscourse:detail")
+    public RT insertClassCourseTextbookCombinations(@RequestParam  Long newClassId, @RequestParam Long sourceClassId) {
+        baseClassCourseService.markExistingRecordsAsDeleted(newClassId, sourceClassId);
+        baseClassCourseService.duplicateCourseBook(newClassId, sourceClassId);
+        return RT.ok();
+    }
+
+    @PostMapping
+    @ApiOperation(value = "新增班级课程")
+    @SaCheckPermission("baseclasscourse:add")
+    public RT<Boolean> add(@Valid @RequestBody AddBaseClassCourseDto dto){
+        BaseClassCourse baseClassCourse = BeanUtil.toBean(dto, BaseClassCourse.class);
+        boolean isSuccess = baseClassCourseService.save(baseClassCourse);
+    return RT.ok(isSuccess);
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改班级课程")
+    @SaCheckPermission("baseclasscourse:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateBaseClassCourseDto dto){
+
+        BaseClassCourse baseClassCourse = BeanUtil.toBean(dto, BaseClassCourse.class);
+        return RT.ok(baseClassCourseService.updateById(baseClassCourse));
+
+    }
+
+    @DeleteMapping
+    @ApiOperation(value = "删除班级课程")
+    @SaCheckPermission("baseclasscourse:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(baseClassCourseService.removeBatchByIds(ids));
+
+    }
+
+    @PostMapping("/import")
+    @ApiOperation(value = "导入")
+    public RT<Boolean> importData(@RequestParam MultipartFile file) throws IOException {
+        List<BaseClassCoursePageVo> savedDataList = EasyExcel.read(file.getInputStream()).head(BaseClassCoursePageVo.class).sheet().doReadSync();
+
+        List<BaseClassCourse> baseClassCourses = new ArrayList<>();
+        for (BaseClassCoursePageVo vo : savedDataList) {
+            Long classId = Long.parseLong(baseClassCourseService.GetClassIdByName(vo.getClassName()).toString());
+            Long courseId = Long.parseLong(baseClassCourseService.GetCourseIdByName(vo.getCourseName()).toString());
+            Long textbookId = Long.parseLong(baseClassCourseService.GetTextbookIdByName(vo.getTextbookName()).toString());
+
+            if (baseClassCourseService.checkExits(classId, courseId, textbookId)) continue;
+
+            if (classId != null && courseId != null && textbookId != null) {
+                BaseClassCourse baseClassCourse = new BaseClassCourse();
+                baseClassCourse.setClassId(classId);
+                baseClassCourse.setCourseId(courseId);
+                baseClassCourse.setTextbookId(textbookId);
+                baseClassCourse.setCreateDate(new Date());
+                baseClassCourse.setDeleteMark(0);
+                baseClassCourses.add(baseClassCourse);
+            }
+        }
+
+        Boolean result = baseClassCourseService.saveBatch(baseClassCourses);
+        return RT.ok(result);
+    }
+
+    @GetMapping("/export")
+    @ApiOperation(value = "导出")
+    public ResponseEntity<byte[]> exportData(@Valid BaseClassCoursePageDto dto, @RequestParam(defaultValue = "false") Boolean isTemplate) {
+        List<BaseClassCoursePageVo> customerList = isTemplate != null && isTemplate ? new ArrayList<>() : ((PageOutput<BaseClassCoursePageVo>) page(dto).getData()).getList();
+        ByteArrayOutputStream bot = new ByteArrayOutputStream();
+        EasyExcel.write(bot, BaseClassCoursePageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
+
+        return RT.fileStream(bot.toByteArray(), "BaseClassCourse" + ExcelTypeEnum.XLSX.getValue());
+    }
+}

+ 48 - 0
src/main/java/com/xjrsoft/module/base/dto/AddBaseClassCourseDto.java

@@ -0,0 +1,48 @@
+package com.xjrsoft.module.base.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 brealinxx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@Data
+public class AddBaseClassCourseDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Integer sortCode;
+    /**
+    * 班级id(base_class)
+    */
+    @ApiModelProperty("班级id(base_class)")
+    private Long classId;
+    /**
+    * 课程id(base_course_subject)
+    */
+    @ApiModelProperty("课程id(base_course_subject)")
+    private Long courseId;
+    /**
+    * 教材id(textbook)
+    */
+    @ApiModelProperty("教材id(textbook)")
+    private Long textbookId;
+
+}

+ 35 - 0
src/main/java/com/xjrsoft/module/base/dto/BaseClassCoursePageDto.java

@@ -0,0 +1,35 @@
+package com.xjrsoft.module.base.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 brealinxx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class BaseClassCoursePageDto extends PageInput {
+    @ApiModelProperty("班级名称")
+    private String className;
+
+    @ApiModelProperty("所属机构")
+    private Long deptId;
+
+    @ApiModelProperty("教学课程设置(0:全部 1:已设置 2:未设置)")
+    private Integer courseSet;
+
+    @ApiModelProperty("学期id")
+    private Long semester;
+}

+ 32 - 0
src/main/java/com/xjrsoft/module/base/dto/UpdateBaseClassCourseDto.java

@@ -0,0 +1,32 @@
+package com.xjrsoft.module.base.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 brealinxx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@Data
+public class UpdateBaseClassCourseDto extends AddBaseClassCourseDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+}

+ 98 - 0
src/main/java/com/xjrsoft/module/base/entity/BaseClassCourse.java

@@ -0,0 +1,98 @@
+package com.xjrsoft.module.base.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 brealinxx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@Data
+@TableName("base_class_course")
+@ApiModel(value = "base_class_course", description = "班级课程")
+public class BaseClassCourse 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;
+    /**
+    * 班级id(base_class)
+    */
+    @ApiModelProperty("班级id(base_class)")
+    private Long classId;
+    /**
+    * 课程id(base_course_subject)
+    */
+    @ApiModelProperty("课程id(base_course_subject)")
+    private Long courseId;
+    /**
+    * 教材id(textbook)
+    */
+    @ApiModelProperty("教材id(textbook)")
+    private Long textbookId;
+
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/base/entity/ClassCourseTextbook.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.base.entity;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class ClassCourseTextbook {
+    @ApiModelProperty("班级id")
+    private Long classId;
+
+    @ApiModelProperty("课程id")
+    private Long courseId;
+
+    @ApiModelProperty("教材id")
+    private Long textbookId;
+}

+ 16 - 0
src/main/java/com/xjrsoft/module/base/entity/CourseBookInfo.java

@@ -0,0 +1,16 @@
+package com.xjrsoft.module.base.entity;
+
+import lombok.Data;
+
+@Data
+public class CourseBookInfo {
+    private Long courseId;
+    private String courseName;
+    private String bookName;
+
+    public CourseBookInfo(Long courseId, String courseName,String bookName) {
+        this.courseId = courseId;
+        this.courseName = courseName;
+        this.bookName = bookName;
+    }
+}

+ 42 - 0
src/main/java/com/xjrsoft/module/base/mapper/BaseClassCourseMapper.java

@@ -0,0 +1,42 @@
+package com.xjrsoft.module.base.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.base.dto.BaseClassCoursePageDto;
+import com.xjrsoft.module.base.entity.BaseClassCourse;
+import com.xjrsoft.module.base.entity.CourseBookInfo;
+import com.xjrsoft.module.base.vo.BaseClassCoursePageVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+* @title: 班级课程
+* @Author brealinxx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@Mapper
+public interface BaseClassCourseMapper extends MPJBaseMapper<BaseClassCourse> {
+    Page<BaseClassCoursePageVo> getPage(Page<BaseClassCoursePageVo> page, BaseClassCoursePageDto dto);
+
+    @Select("SELECT id, name FROM base_semester")
+    List<Map<String, Object>> getAllSemesterNames();
+
+    List<CourseBookInfo> getAllCourseBook(Long subjectGroupId);
+    List<CourseBookInfo> getSelectedCourseBook(Long[] classIds);
+
+
+    void updateAddClassCourseTextbooks(Long classId,Long courseId,Long textbookId);
+    void updateRemoveClassCourseTextbooks(Long classId,Long courseId,Long textbookId);
+
+    void markExistingRecordsAsDeleted(Long newClassId, Long sourceClassId);
+    void insertClassCourseTextbookCombinations(Long newClassId, Long sourceClassId);
+
+    Long getClassIdByName(String name);
+    Long getCourseIdByName(String name);
+    Long getBookIdByName(String name);
+    boolean checkExits(Long classId,Long courseId,Long textbookId);
+}

+ 47 - 0
src/main/java/com/xjrsoft/module/base/service/IBaseClassCourseService.java

@@ -0,0 +1,47 @@
+package com.xjrsoft.module.base.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.base.dto.BaseClassCoursePageDto;
+import com.xjrsoft.module.base.entity.BaseClassCourse;
+import com.xjrsoft.module.base.entity.ClassCourseTextbook;
+import com.xjrsoft.module.base.entity.CourseBookInfo;
+import com.xjrsoft.module.base.vo.BaseClassCoursePageVo;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+* @title: 班级课程
+* @Author brealinxx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+
+public interface IBaseClassCourseService extends MPJBaseService<BaseClassCourse> {
+
+    Page<BaseClassCoursePageVo> getPage(Page<BaseClassCoursePageVo> objectPage, BaseClassCoursePageDto dto);
+
+
+    List<CourseBookInfo> getAllCourseBook(Long subjectGroupId);
+
+    List<CourseBookInfo> getSelectedCourseBook(Long[] subjectGroupId);
+
+
+    void updateAddCourseBook(Long classId,Long courseId,Long textbookId);
+    void updateRemoveCourseBook(Long classId, Long courseId, Long textbookId);
+
+    void markExistingRecordsAsDeleted(Long newClassId, Long sourceClassId);
+
+    void duplicateCourseBook(Long newClassId, Long sourceClassId);
+
+    Map<String, Map<String, Object>> getSemesterTree();
+
+    Long GetClassIdByName(String name);
+
+    Long GetCourseIdByName(String name);
+
+    Long GetTextbookIdByName(String name);
+
+    boolean checkExits(Long classId, Long courseId, Long textbookId);
+}

+ 112 - 0
src/main/java/com/xjrsoft/module/base/service/impl/BaseClassCourseServiceImpl.java

@@ -0,0 +1,112 @@
+package com.xjrsoft.module.base.service.impl;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.base.dto.BaseClassCoursePageDto;
+import com.xjrsoft.module.base.entity.BaseClassCourse;
+import com.xjrsoft.module.base.entity.CourseBookInfo;
+import com.xjrsoft.module.base.mapper.BaseClassCourseMapper;
+import com.xjrsoft.module.base.service.IBaseClassCourseService;
+import com.xjrsoft.module.base.vo.BaseClassCoursePageVo;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+* @title: 班级课程
+* @Author brealinxx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class BaseClassCourseServiceImpl extends MPJBaseServiceImpl<BaseClassCourseMapper, BaseClassCourse> implements IBaseClassCourseService {
+    private final BaseClassCourseMapper baseClassCourseMapper;
+
+    @Override
+    public Page<BaseClassCoursePageVo> getPage(Page<BaseClassCoursePageVo> page, BaseClassCoursePageDto dto) {
+        return baseClassCourseMapper.getPage(page, dto);
+    }
+
+    @Override
+    public List<CourseBookInfo> getAllCourseBook(Long subjectGroupId){
+        return baseClassCourseMapper.getAllCourseBook(subjectGroupId);
+    }
+
+    @Override
+    public List<CourseBookInfo> getSelectedCourseBook(Long[] subjectGroupId){
+        return baseClassCourseMapper.getSelectedCourseBook(subjectGroupId);
+    }
+
+    @Override
+    public void updateAddCourseBook(Long classId,Long courseId,Long textbookId){
+        baseClassCourseMapper.updateAddClassCourseTextbooks(classId, courseId, textbookId);
+    }
+
+    @Override
+    public void updateRemoveCourseBook(Long classId, Long courseId, Long textbookId){
+        baseClassCourseMapper.updateRemoveClassCourseTextbooks(classId, courseId, textbookId);
+    }
+
+    @Override
+    public void markExistingRecordsAsDeleted(Long newClassId, Long sourceClassId){
+        baseClassCourseMapper.markExistingRecordsAsDeleted(newClassId, sourceClassId);
+    }
+
+    @Override
+    public void duplicateCourseBook(Long newClassId, Long sourceClassId){
+        baseClassCourseMapper.insertClassCourseTextbookCombinations(newClassId, sourceClassId);
+    }
+
+    @Override
+    public Map<String, Map<String, Object>> getSemesterTree() {
+        List<Map<String, Object>> semesterData = baseClassCourseMapper.getAllSemesterNames();
+
+        Map<String, Map<String, Object>> tree = new TreeMap<>();
+
+        for (Map<String, Object> data : semesterData) {
+            String name = (String) data.get("name");
+            String[] parts = name.split("年");
+            String year = parts[0]; // 年份
+            String semesterType = parts[1].substring(0, parts[1].length() - 1); // 学期类型(春期/秋期)
+            Long id = Long.parseLong(data.get("id").toString());
+
+            if (!tree.containsKey(year + "年")) {
+                tree.put(year + "年", new HashMap<>());
+            }
+
+            Map<String, Object> yearMap = tree.get(year + "年");
+
+            if (semesterType.equals("春")) {
+                yearMap.put("springName", name);
+                yearMap.put("springId", id);
+            } else if (semesterType.equals("秋")) {
+                yearMap.put("autumnName", name);
+                yearMap.put("autumnId", id);
+            }
+        }
+
+        return tree;
+    }
+
+    @Override
+    public Long GetClassIdByName(String name){
+        return baseClassCourseMapper.getClassIdByName(name);
+    }
+
+    @Override
+    public Long GetCourseIdByName(String name){
+        return baseClassCourseMapper.getCourseIdByName(name);
+    }
+
+    @Override
+    public Long GetTextbookIdByName(String name){
+        return baseClassCourseMapper.getBookIdByName(name);
+    }
+
+    @Override
+    public boolean checkExits(Long classId,Long courseId,Long textbookId){
+        return baseClassCourseMapper.checkExits(classId, courseId, textbookId);
+    }
+}

+ 127 - 0
src/main/java/com/xjrsoft/module/base/vo/BaseClassCoursePageVo.java

@@ -0,0 +1,127 @@
+package com.xjrsoft.module.base.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+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 brealinxx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@Data
+public class BaseClassCoursePageVo {
+
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("")
+    @ApiModelProperty("")
+    private String id;
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("")
+    @ApiModelProperty("")
+    private Long createUserId;
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("")
+    @ApiModelProperty("")
+    private Date createDate;
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("")
+    @ApiModelProperty("")
+    private Long modifyUserId;
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("")
+    @ApiModelProperty("")
+    private Date modifyDate;
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("")
+    @ApiModelProperty("")
+    private Integer deleteMark;
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("")
+    @ApiModelProperty("")
+    private Integer enabledMark;
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("")
+    @ApiModelProperty("")
+    private Integer sortCode;
+    /**
+    * 班级id(base_class)
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("班级id(base_class)")
+    @ApiModelProperty("班级id(base_class)")
+    private Long classId;
+    /**
+    * 课程id(base_course_subject)
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("课程id(base_course_subject)")
+    @ApiModelProperty("课程id(base_course_subject)")
+    private Long courseId;
+    /**
+    * 教材id(textbook)
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("教材id(textbook)")
+    @ApiModelProperty("教材id(textbook)")
+    private Long textbookId;
+
+    @ApiModelProperty("班级名称")
+    @ExcelProperty("班级名称")
+    private String className;
+
+    @ApiModelProperty("教师名称")
+    private String teacherName;
+
+    @ApiModelProperty("专业方向")
+    private String majorName;
+
+    @ApiModelProperty("所属机构")
+    private String deptName;
+
+    @ApiModelProperty("教学课程")
+    @ExcelProperty("教学课程")
+    private String courseName;
+
+    @ApiModelProperty("对应教材")
+    @ExcelProperty("对应教材")
+    private String textbookName;
+
+    @ExcelProperty("年级")
+    private String semester;
+}

+ 49 - 0
src/main/java/com/xjrsoft/module/base/vo/BaseClassCourseVo.java

@@ -0,0 +1,49 @@
+package com.xjrsoft.module.base.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 brealinxx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@Data
+public class BaseClassCourseVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Integer sortCode;
+    /**
+    * 班级id(base_class)
+    */
+    @ApiModelProperty("班级id(base_class)")
+    private Long classId;
+    /**
+    * 课程id(base_course_subject)
+    */
+    @ApiModelProperty("课程id(base_course_subject)")
+    private Long courseId;
+    /**
+    * 教材id(textbook)
+    */
+    @ApiModelProperty("教材id(textbook)")
+    private Long textbookId;
+
+
+
+}

+ 1 - 1
src/main/java/com/xjrsoft/module/liteflow/node/AddTextbookNode.java

@@ -25,7 +25,7 @@ AddTextbookNode extends NodeComponent {
         Long formId = Convert.toLong(value);
         if (formId != null) {
             // 数据处理
-            textbookService.dataHandleAddTextbookNode(formId);
+            //textbookService.dataHandleAddTextbookNode(formId);
         }
     }
 }

+ 64 - 0
src/main/java/com/xjrsoft/module/textbook/controller/TextbookController.java

@@ -5,15 +5,25 @@ import cn.hutool.core.bean.BeanUtil;
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.support.ExcelTypeEnum;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.model.result.R;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.asset.entity.WfAssetManage;
+import com.xjrsoft.module.asset.vo.WfAssetManageVo;
+import com.xjrsoft.module.base.entity.BaseCourseSubject;
 import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.base.service.IBaseSemesterService;
+import com.xjrsoft.module.student.entity.BaseClassMajorSet;
+import com.xjrsoft.module.system.entity.DictionaryDetail;
 import com.xjrsoft.module.textbook.dto.*;
 import com.xjrsoft.module.textbook.entity.Textbook;
+import com.xjrsoft.module.textbook.entity.TextbookClassRelation;
+import com.xjrsoft.module.textbook.entity.WfTextbookSubscription;
 import com.xjrsoft.module.textbook.service.ITextbookService;
 import com.xjrsoft.module.textbook.vo.*;
 import io.swagger.annotations.Api;
@@ -28,6 +38,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -55,6 +66,59 @@ public class TextbookController {
         return RT.ok(pageOutput);
     }
 
+    @GetMapping(value = "/page-subscription")
+    @ApiOperation(value="教材管理列表(分页,教材征订用)")
+    @SaCheckPermission("textbook:detail")
+    public RT<PageOutput<TextbookSubscriptionListVo>> pageSubscription(@Valid TextbookSubscriptionListDto dto){
+        List<String> classIdList = new ArrayList<>();
+        if(dto.getClassIds() != null && !dto.getClassIds().equals("")){
+            String[] classIdArr =  dto.getClassIds().split(",");
+            classIdList = Arrays.asList(classIdArr);
+        }
+
+        MPJLambdaWrapper<Textbook> textbookMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        textbookMPJLambdaWrapper
+                .select(Textbook::getId)
+                .selectAs(BaseCourseSubject::getName, TextbookSubscriptionListVo::getCourseSubjectIdCn)
+                .selectSum(BaseClassMajorSet::getTotalStudent, TextbookSubscriptionListVo::getNumber)
+                .select(Textbook.class, x -> VoToColumnUtil.fieldsToColumns(TextbookSubscriptionListVo.class).contains(x.getProperty()))
+                .leftJoin(TextbookClassRelation.class, TextbookClassRelation::getTextbookId, Textbook::getId)
+                .leftJoin(BaseClassMajorSet.class, BaseClassMajorSet::getClassId, TextbookClassRelation::getClassId)
+                .leftJoin(BaseCourseSubject.class, BaseCourseSubject::getId, Textbook::getCourseSubjectId)
+                .in(!classIdList.isEmpty(),TextbookClassRelation::getClassId, classIdList)
+                .groupBy(Textbook::getId)
+        ;
+        IPage<TextbookSubscriptionListVo> page = textbookService.selectJoinListPage(ConventPage.getPage(dto),TextbookSubscriptionListVo.class,textbookMPJLambdaWrapper);
+        PageOutput<TextbookSubscriptionListVo> pageOutput = ConventPage.getPageOutput(page, TextbookSubscriptionListVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/List-subscription")
+    @ApiOperation(value="教材管理列表(不分页,教材征订用)")
+    @SaCheckPermission("textbook:detail")
+    public RT<List<TextbookSubscriptionListVo>> ListSubscription(@Valid TextbookSubscriptionListDto dto){
+        List<String> classIdList = new ArrayList<>();
+        if(dto.getClassIds() != null && !dto.getClassIds().equals("")){
+            String[] classIdArr =  dto.getClassIds().split(",");
+            classIdList = Arrays.asList(classIdArr);
+        }
+
+        MPJLambdaWrapper<Textbook> textbookMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        textbookMPJLambdaWrapper
+                .select(Textbook::getId)
+                .selectAs(BaseCourseSubject::getName, TextbookSubscriptionListVo::getCourseSubjectIdCn)
+                .selectSum(BaseClassMajorSet::getTotalStudent, TextbookSubscriptionListVo::getNumber)
+                .select(Textbook.class, x -> VoToColumnUtil.fieldsToColumns(TextbookSubscriptionListVo.class).contains(x.getProperty()))
+                .leftJoin(TextbookClassRelation.class, TextbookClassRelation::getTextbookId, Textbook::getId)
+                .leftJoin(BaseClassMajorSet.class, BaseClassMajorSet::getClassId, TextbookClassRelation::getClassId)
+                .leftJoin(BaseCourseSubject.class, BaseCourseSubject::getId, Textbook::getCourseSubjectId)
+                .in(!classIdList.isEmpty(),TextbookClassRelation::getClassId, classIdList)
+                .groupBy(Textbook::getId)
+                ;
+        List<TextbookSubscriptionListVo> list = textbookService.selectJoinList(TextbookSubscriptionListVo.class,textbookMPJLambdaWrapper);
+        return RT.ok(list);
+    }
+
     @GetMapping(value = "/info-detail")
     @ApiOperation(value="根据id查询教材管理信息")
     @SaCheckPermission("textbook:detail")

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

@@ -0,0 +1,188 @@
+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.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.common.constant.GlobalConstant;
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.common.utils.TreeUtil;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.base.entity.BaseClass;
+import com.xjrsoft.module.base.entity.BaseGrade;
+import com.xjrsoft.module.base.entity.BaseSemester;
+import com.xjrsoft.module.base.mapper.BaseClassMapper;
+import com.xjrsoft.module.oa.vo.NewsGradeClassTreeVo;
+import com.xjrsoft.module.student.vo.BaseClassQfCountVo;
+import com.xjrsoft.module.student.vo.BaseClassTreeVo;
+import com.xjrsoft.module.textbook.dto.AddWfTextbookSubscriptionDto;
+import com.xjrsoft.module.textbook.dto.UpdateWfTextbookSubscriptionDto;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.support.ExcelTypeEnum;
+import com.xjrsoft.module.textbook.vo.GradeClassListVo;
+import com.xjrsoft.module.textbook.vo.GradeClassTreeVo;
+import org.springframework.http.ResponseEntity;
+import java.io.ByteArrayOutputStream;
+import java.util.ArrayList;
+
+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.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+* @title: 教材教辅征订
+* @Author szs
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/textbook" + "/wfTextbookSubscription")
+@Api(value = "/textbook"  + "/wfTextbookSubscription",tags = "教材教辅征订代码")
+@AllArgsConstructor
+public class WfTextbookSubscriptionController {
+
+
+    private final IWfTextbookSubscriptionService wfTextbookSubscriptionService;
+
+    private final BaseClassMapper baseClassMapper;
+
+    @GetMapping(value = "/tree")
+    @ApiOperation(value = "学生年级班级树")
+    @SaCheckPermission("studentmanager:detail")
+    public RT<List<GradeClassTreeVo>> tree() {
+        List<GradeClassTreeVo> voList = new ArrayList<>();
+
+        voList.add(new GradeClassTreeVo() {{
+            setId("666666");
+            setName("班级");
+        }});
+
+        //获取班级List(包含年级信息)
+        MPJLambdaWrapper<BaseClass> baseClassMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        baseClassMPJLambdaWrapper
+                .selectAs(BaseClass::getId, GradeClassListVo::getClassId)
+                .selectAs(BaseClass::getName, GradeClassListVo::getClassName)
+                .selectAs(BaseClass::getGradeId, GradeClassListVo::getGradeId)
+                .selectAs(BaseGrade::getName, GradeClassListVo::getGradeName)
+                .leftJoin(BaseGrade.class, BaseGrade::getId, BaseClass::getGradeId)
+                .eq(BaseClass::getDeleteMark, 0)
+                .eq(BaseClass::getIsGraduate, 1)
+        ;
+        List<GradeClassListVo> gradeClassTreeVoList = baseClassMapper.selectJoinList(GradeClassListVo.class, baseClassMPJLambdaWrapper);
+
+        //年级Map
+        Map<String, GradeClassTreeVo> gradeMap = new HashMap<>();
+        for (GradeClassListVo gradeClassListVo : gradeClassTreeVoList){
+            if(gradeClassListVo.getGradeId() != null && gradeMap.get(gradeClassListVo.getGradeId()) == null){
+                gradeMap.put(gradeClassListVo.getGradeId(), new GradeClassTreeVo(){{
+                    setId(gradeClassListVo.getGradeId());
+                    setName(gradeClassListVo.getGradeName());
+                    setParentId("666666");
+                }});
+            }
+            voList.add(new GradeClassTreeVo() {{
+                setId(gradeClassListVo.getClassId());
+                setName(gradeClassListVo.getClassName());
+                setParentId(gradeClassListVo.getGradeId());
+            }});
+        }
+
+        List<GradeClassTreeVo> gradeList = new ArrayList<>(gradeMap.values());
+        voList.addAll(gradeList);
+
+        List<GradeClassTreeVo> treeVoList = TreeUtil.build(voList);
+
+        return RT.ok(treeVoList);
+    }
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="教材教辅征订列表(分页)")
+    @SaCheckPermission("wftextbooksubscription:detail")
+    public RT<PageOutput<WfTextbookSubscriptionPageVo>> page(@Valid WfTextbookSubscriptionPageDto dto){
+
+        MPJLambdaWrapper<WfTextbookSubscription> queryWrapper = new MPJLambdaWrapper<>();
+        queryWrapper
+                .select(WfTextbookSubscription::getId)
+                .selectAs(BaseSemester::getName, WfTextbookSubscriptionPageVo::getBaseSemesterIdCn)
+                .select("(select sum(student_subscription_number) + sum(teacher_subscription_number) from wf_textbook_subscription_item a where a.wf_textbook_subscription_id = t.id) as sum")
+                .select(WfTextbookSubscription.class,x -> VoToColumnUtil.fieldsToColumns(WfTextbookSubscriptionPageVo.class).contains(x.getProperty()))
+                .leftJoin(BaseSemester.class, BaseSemester::getId, WfTextbookSubscription::getBaseSemesterId)
+                .orderByDesc(WfTextbookSubscription::getCreateDate)
+        ;
+        IPage<WfTextbookSubscription> page = wfTextbookSubscriptionService.selectJoinListPage(ConventPage.getPage(dto),WfTextbookSubscription.class, 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));
+
+    }
+
+    @GetMapping("/export")
+    @ApiOperation(value = "导出")
+    public ResponseEntity<byte[]> exportData(@Valid WfTextbookSubscriptionPageDto dto, @RequestParam(defaultValue = "false") Boolean isTemplate) {
+        List<WfTextbookSubscriptionPageVo> customerList = isTemplate != null && isTemplate ? new ArrayList<>() : ((PageOutput<WfTextbookSubscriptionPageVo>) page(dto).getData()).getList();
+        ByteArrayOutputStream bot = new ByteArrayOutputStream();
+        EasyExcel.write(bot, WfTextbookSubscriptionPageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
+
+        return RT.fileStream(bot.toByteArray(), "WfTextbookSubscription" + ExcelTypeEnum.XLSX.getValue());
+    }
+}

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

@@ -3,14 +3,21 @@ 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;
+import com.xjrsoft.module.textbook.entity.WfTextbookSubscriptionItem;
+
 
 
 /**
 * @title: 教材教辅征订
 * @Author szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 @Data
@@ -53,7 +60,11 @@ public class AddWfTextbookSubscriptionDto implements Serializable {
     */
     @ApiModelProperty("状态(1:结束 0:未结束)")
     private Integer status;
-
+    /**
+     * 征订方式(1:结束 2:未结束)
+     */
+    @ApiModelProperty("征订方式(1:按班级征订 2:按教材征订)")
+    private Integer subscription_method;
     /**
     * wfTextbookSubscriptionItem
     */

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

@@ -16,7 +16,7 @@ import java.util.Date;
 /**
 * @title: 教材教辅征订项
 * @Author szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 @Data
@@ -29,6 +29,11 @@ public class AddWfTextbookSubscriptionItemDto implements Serializable {
     */
     @ApiModelProperty("序号")
     private Integer sortCode;
+    /**
+     * 教材编号
+     */
+    @ApiModelProperty("教材编号")
+    private Long textbookId;
     /**
     * 教材教辅征订编号
     */

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

@@ -1,5 +1,7 @@
 package com.xjrsoft.module.textbook.dto;
 
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
 import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -10,6 +12,7 @@ import java.time.LocalTime;
 import java.time.LocalDateTime;
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 
 /**

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

@@ -0,0 +1,25 @@
+package com.xjrsoft.module.textbook.dto;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+* @title: 教材管理分页查询入参
+* @Author szs
+* @Date: 2023-12-25
+* @Version 1.0
+*/
+@Data
+public class TextbookSubscriptionListDto extends PageInput {
+    /**
+     * 使用班级
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("使用班级")
+    @ApiModelProperty("使用班级")
+    private String classIds;
+}

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

@@ -2,12 +2,22 @@ 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;
+import com.xjrsoft.module.textbook.entity.WfTextbookSubscriptionItem;
+
 
 
 /**
 * @title: 教材教辅征订
 * @Author szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 @Data

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

@@ -15,7 +15,7 @@ import java.util.Date;
 /**
 * @title: 教材教辅征订分页查询入参
 * @Author szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 @Data

+ 5 - 1
src/main/java/com/xjrsoft/module/textbook/entity/Textbook.java

@@ -184,5 +184,9 @@ public class Textbook implements Serializable {
     @EntityMapping(thisField = "id", joinField = "wfTextbookSubscriptionId")
     private List<TextbookSubscriptionRecord> textbookSubscriptionRecordList;
 
-
+    /**
+     * 使用类型(单位:学期)
+     */
+    @ApiModelProperty("使用类型(单位:学期)")
+    private Integer useType;
 }

+ 10 - 1
src/main/java/com/xjrsoft/module/textbook/entity/WfTextbookSubscription.java

@@ -10,6 +10,9 @@ 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;
 
@@ -17,7 +20,7 @@ import java.util.Date;
 /**
 * @title: 教材教辅征订
 * @Author szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 @Data
@@ -106,6 +109,12 @@ public class WfTextbookSubscription implements Serializable {
     @ApiModelProperty("状态(1:结束 0:未结束)")
     private Integer status;
 
+    /**
+     * 征订方式(1:结束 2:未结束)
+     */
+    @ApiModelProperty("征订方式(1:按班级征订 2:按教材征订)")
+    private Integer subscription_method;
+
     /**
     * wfTextbookSubscriptionItem
     */

+ 6 - 2
src/main/java/com/xjrsoft/module/textbook/entity/WfTextbookSubscriptionItem.java

@@ -20,7 +20,7 @@ import java.util.Date;
 /**
 * @title: 教材教辅征订项
 * @Author szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 @Data
@@ -159,5 +159,9 @@ public class WfTextbookSubscriptionItem implements Serializable {
     @ApiModelProperty("版本")
     private String version;
 
-
+    /**
+     * 教材编号
+     */
+    @ApiModelProperty("教材编号")
+    private Long textbookId;
 }

+ 1 - 0
src/main/java/com/xjrsoft/module/textbook/mapper/TextbookIssueRecordMapper.java

@@ -23,3 +23,4 @@ public interface TextbookIssueRecordMapper extends MPJBaseMapper<TextbookIssueRe
 
     List<TextbookIssueRecordPageVo> getList(@Param("dto") TextbookIssueRecordExportDto dto);
 }
+

+ 2 - 1
src/main/java/com/xjrsoft/module/textbook/mapper/WfTextbookSubscriptionItemMapper.java

@@ -1,5 +1,6 @@
 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.WfTextbookSubscriptionItem;
 import org.apache.ibatis.annotations.Mapper;
@@ -7,7 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
 /**
 * @title: 教材教辅征订项
 * @Author szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 @Mapper

+ 2 - 1
src/main/java/com/xjrsoft/module/textbook/mapper/WfTextbookSubscriptionMapper.java

@@ -1,5 +1,6 @@
 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.WfTextbookSubscription;
 import org.apache.ibatis.annotations.Mapper;
@@ -7,7 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
 /**
 * @title: 教材教辅征订
 * @Author szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 @Mapper

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

@@ -56,7 +56,7 @@ public interface ITextbookService extends MPJBaseService<Textbook> {
      * @param dataId
      * @return
      */
-    Boolean dataHandleAddTextbookNode(Long dataId);
+//    Boolean dataHandleAddTextbookNode(Long dataId);
 
     /**
      * 添加作业本规则

+ 3 - 11
src/main/java/com/xjrsoft/module/textbook/service/IWfTextbookSubscriptionService.java

@@ -1,14 +1,15 @@
 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.WfTextbookSubscription;
-
+import lombok.Data;
 import java.util.List;
 
 /**
 * @title: 教材教辅征订
 * @Author szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 
@@ -36,13 +37,4 @@ public interface IWfTextbookSubscriptionService extends MPJBaseService<WfTextboo
     * @return
     */
     Boolean delete(List<Long> ids);
-
-    /**
-     * 根据Id查询征订项
-     *
-     * @param id
-     * @return
-     */
-    WfTextbookSubscription selectById(Long id);
-
 }

+ 3 - 10
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java

@@ -19,11 +19,9 @@ 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.ExerciseBookeTypeEnum;
-import com.xjrsoft.common.enums.SubscriptionTypeEnum;
 import com.xjrsoft.common.enums.TextbookTypeEnum;
 import com.xjrsoft.common.enums.WarehouseModeEnum;
 import com.xjrsoft.common.exception.MyException;
-import com.xjrsoft.common.utils.excel.CustomCellWriteWidthConfig;
 import com.xjrsoft.common.utils.excel.ExcelFillCellMergePrevColUtil;
 import com.xjrsoft.common.utils.excel.ExcelMergeUtil;
 import com.xjrsoft.module.base.entity.BaseClass;
@@ -34,8 +32,6 @@ import com.xjrsoft.module.base.mapper.BaseCourseSubjectMapper;
 import com.xjrsoft.module.base.mapper.BaseGradeMapper;
 import com.xjrsoft.module.base.mapper.BaseSemesterMapper;
 import com.xjrsoft.module.base.service.IBaseClassService;
-import com.xjrsoft.module.courseTable.entity.CourseTable;
-import com.xjrsoft.module.teacher.entity.BaseTeacher;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.textbook.dto.*;
 import com.xjrsoft.module.textbook.entity.*;
@@ -45,14 +41,12 @@ import com.xjrsoft.module.textbook.vo.*;
 import lombok.AllArgsConstructor;
 import org.apache.poi.ss.usermodel.BorderStyle;
 import org.apache.poi.ss.usermodel.HorizontalAlignment;
-import org.apache.poi.ss.usermodel.IndexedColors;
 import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.io.ByteArrayOutputStream;
-import java.io.IOException;
 import java.io.InputStream;
 import java.math.BigDecimal;
 import java.util.*;
@@ -212,11 +206,10 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
 
     @Override
     public Page<TextbookPageVo> getPage(Page<TextbookPageDto> page, TextbookPageDto dto) {
-        Page<TextbookPageVo> result = textbookTextbookMapper.getPage(page, dto);
-        return result;
+        return textbookTextbookMapper.getPage(page, dto);
     }
 
-    @Override
+   /* @Override
     @Transactional
     public Boolean dataHandleAddTextbookNode(Long dataId) {
         WfTextbookSubscription wfTextbookSubscription = iWfTextbookSubscriptionService.selectById(dataId);
@@ -328,7 +321,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
             }
         }
         return true;
-    }
+    }*/
 
     /**
      * 添加作业本规则

+ 4 - 16
src/main/java/com/xjrsoft/module/textbook/service/impl/WfTextbookSubscriptionServiceImpl.java

@@ -1,25 +1,24 @@
 package com.xjrsoft.module.textbook.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.yulichang.base.MPJBaseServiceImpl;
-import com.xjrsoft.module.textbook.entity.WfTextbookSubscription;
 import com.xjrsoft.module.textbook.entity.WfTextbookSubscriptionItem;
 import com.xjrsoft.module.textbook.mapper.WfTextbookSubscriptionItemMapper;
+import com.xjrsoft.module.textbook.entity.WfTextbookSubscription;
 import com.xjrsoft.module.textbook.mapper.WfTextbookSubscriptionMapper;
 import com.xjrsoft.module.textbook.service.IWfTextbookSubscriptionService;
 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 szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 @Service
@@ -86,15 +85,4 @@ public class WfTextbookSubscriptionServiceImpl extends MPJBaseServiceImpl<WfText
 
         return true;
     }
-
-    @Override
-    public WfTextbookSubscription selectById(Long id) {
-        WfTextbookSubscription wfTextbookSubscription = this.getById(id);
-        LambdaQueryWrapper<WfTextbookSubscriptionItem> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper
-                .eq(WfTextbookSubscriptionItem::getWfTextbookSubscriptionId,id);
-        List<WfTextbookSubscriptionItem> wfTextbookSubscriptionItemList = wfTextbookSubscriptionWfTextbookSubscriptionItemMapper.selectList(queryWrapper);
-        wfTextbookSubscription.setWfTextbookSubscriptionItemList(wfTextbookSubscriptionItemList);
-        return wfTextbookSubscription;
-    }
 }

+ 26 - 0
src/main/java/com/xjrsoft/module/textbook/vo/GradeClassListVo.java

@@ -0,0 +1,26 @@
+package com.xjrsoft.module.textbook.vo;
+
+import com.xjrsoft.common.model.tree.ITreeNode;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class GradeClassListVo{
+
+
+    @ApiModelProperty("班级ID")
+    private String classId;
+
+    @ApiModelProperty("班级名称")
+    private String className;
+
+    @ApiModelProperty("年级ID")
+    private String gradeId;
+
+    @ApiModelProperty("班级名称")
+    private String gradeName;
+}
+

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

@@ -0,0 +1,25 @@
+package com.xjrsoft.module.textbook.vo;
+
+import com.xjrsoft.common.model.tree.ITreeNode;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class GradeClassTreeVo implements ITreeNode<GradeClassTreeVo,String>, Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    @ApiModelProperty("")
+    private String name;
+
+    @ApiModelProperty("")
+    private String parentId;
+
+    private List<GradeClassTreeVo> children;
+}
+

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

@@ -160,4 +160,9 @@ public class TextbookPageVo {
     @ExcelProperty("使用班级")
     @ApiModelProperty("使用班级")
     private String useClass;
+    /**
+     * 使用类型(单位:学期)
+     */
+    @ApiModelProperty("使用类型(单位:学期)")
+    private Integer useType;
 }

+ 63 - 0
src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionListVo.java

@@ -0,0 +1,63 @@
+package com.xjrsoft.module.textbook.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+* @title: 教材管理表单出参
+* @Author szs
+* @Date: 2023-12-25
+* @Version 1.0
+*/
+@Data
+public class TextbookSubscriptionListVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+    /**
+     * 课程编号(base_course_subject)
+     */
+    @ApiModelProperty("课程编号(base_course_subject)")
+    private Long courseSubjectId;
+    /**
+     * 课程编号(base_course_subject)
+     */
+    @ApiModelProperty("课程编号(base_course_subject)")
+    private String courseSubjectIdCn;
+    /**
+    * 书名
+    */
+    @ApiModelProperty("书名")
+    private String bookName;
+    /**
+    * 出版社
+    */
+    @ApiModelProperty("出版社")
+    private String publishingHouse;
+    /**
+    * 教材类型(xjr_dictionary_item[textbook_type])
+    */
+    @ApiModelProperty("教材类型(xjr_dictionary_item[textbook_type])")
+    private String textbookType;
+    /**
+     * 教材类型(xjr_dictionary_item[textbook_type])
+     */
+    @ApiModelProperty("教材类型(xjr_dictionary_item[textbook_type])")
+    private String textbookTypeCn;
+    /**
+     * 使用类型(单位:学期)
+     */
+    @ApiModelProperty("使用类型(单位:学期)")
+    private Integer useType;
+    /**
+     * 学生用书征订数量
+     */
+    @ApiModelProperty("学生用书征订数量")
+    private Integer number;
+}

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

@@ -113,4 +113,9 @@ public class TextbookVo {
     @ApiModelProperty("使用班级")
     private List<TextbookClassRelationVo> textbookClassRelationList;
 
+    /**
+     * 使用类型(单位:学期)
+     */
+    @ApiModelProperty("使用类型(单位:学期)")
+    private Integer useType;
 }

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

@@ -12,7 +12,7 @@ import java.util.Date;
 /**
 * @title: 教材教辅征订项表单出参
 * @Author szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 @Data

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

@@ -1,5 +1,8 @@
 package com.xjrsoft.module.textbook.vo;
 
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -14,7 +17,7 @@ import java.util.Date;
 /**
 * @title: 教材教辅征订分页列表出参
 * @Author szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 @Data
@@ -23,72 +26,113 @@ public class WfTextbookSubscriptionPageVo {
     /**
     * 主键编号
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("主键编号")
     @ApiModelProperty("主键编号")
     private String id;
     /**
     * 创建人
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("创建人")
     @ApiModelProperty("创建人")
     private Long createUserId;
     /**
     * 创建时间
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("创建时间")
     @ApiModelProperty("创建时间")
     private Date createDate;
     /**
     * 修改人
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("修改人")
     @ApiModelProperty("修改人")
     private Long modifyUserId;
     /**
     * 修改时间
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("修改时间")
     @ApiModelProperty("修改时间")
     private Date modifyDate;
     /**
     * 删除标记
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("删除标记")
     @ApiModelProperty("删除标记")
     private Integer deleteMark;
     /**
     * 有效标志
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("有效标志")
     @ApiModelProperty("有效标志")
     private Integer enabledMark;
     /**
     * 序号
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("序号")
     @ApiModelProperty("序号")
     private Integer sortCode;
     /**
     * 申请人
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("申请人")
     @ApiModelProperty("申请人")
     private Long applicantUserId;
     /**
     * 所在部门编号
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("所在部门编号")
     @ApiModelProperty("所在部门编号")
     private Long deptId;
     /**
     * 学期ID(base_semester)
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学期ID(base_semester)")
     @ApiModelProperty("学期ID(base_semester)")
     private Long baseSemesterId;
+    /**
+     * 学期ID(base_semester)
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学期ID(base_semester)")
+    @ApiModelProperty("学期ID(base_semester)")
+    private String baseSemesterIdCn;
     /**
     * 学科组管理编号(subject_group)
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学科组管理编号(subject_group)")
     @ApiModelProperty("学科组管理编号(subject_group)")
     private Long subjectGroupId;
     /**
     * 备注
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("备注")
     @ApiModelProperty("备注")
     private String remark;
     /**
     * 状态(1:结束 0:未结束)
     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("状态(1:结束 0:未结束)")
     @ApiModelProperty("状态(1:结束 0:未结束)")
     private Integer status;
+    /**
+     * 征订方式(1:结束 2:未结束)
+     */
+    @ApiModelProperty("征订方式(1:按班级征订 2:按教材征订)")
+    private Integer subscription_method;
 
+    private Integer sum;
 }

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

@@ -3,12 +3,17 @@ 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;
+import com.xjrsoft.module.textbook.entity.WfTextbookSubscriptionItem;
 
 /**
 * @title: 教材教辅征订表单出参
 * @Author szs
-* @Date: 2023-12-25
+* @Date: 2024-06-04
 * @Version 1.0
 */
 @Data

+ 142 - 0
src/main/resources/mapper/base/BaseClassCourse.xml

@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xjrsoft.module.base.mapper.BaseClassCourseMapper">
+    <select id="getPage" parameterType="com.xjrsoft.module.base.dto.BaseClassCoursePageDto" resultType="com.xjrsoft.module.base.vo.BaseClassCoursePageVo">
+        select t5.id, t.name as class_name, t1.name as teacher_name, t3.name as major_name, t4.name as dept_name,
+               GROUP_CONCAT(t6.name SEPARATOR '、') as course_name, GROUP_CONCAT(t7.book_name SEPARATOR '、') as textbook_name
+        from base_class t
+        left join xjr_user t1 on t1.id = t.teacher_id
+        left join base_class_major_set t2 on t2.class_id = t.id
+        left join base_major_set t3 on t3.id = t2.major_set_id
+        left join xjr_department t4 on t4.id = t.org_id
+        left join base_class_course t5 on t5.class_id = t.id
+        left join base_course_subject t6 on t6.id = t5.course_id
+        left join textbook t7 on t7.id = t5.textbook_id
+        where t5.delete_mark = 0
+        <if test="dto.className != null">
+            and t.name = #{dto.className}
+        </if>
+        <if test="dto.deptId != null">
+            and t4.id = #{dto.deptId}
+        </if>
+
+        <if test="dto.semester != null">
+            and (
+            SELECT base_semester_id
+            FROM textbook
+            WHERE t5.textbook_id = id
+            GROUP BY base_semester_id
+            HAVING COUNT(DISTINCT base_semester_id) = 1
+            ) = #{dto.semester}
+        </if>
+        GROUP BY t5.id, t.name, t1.name, t3.name, t4.name
+        <if test="dto.courseSet == 1">
+            HAVING LENGTH(course_name) > 0
+        </if>
+        <if test="dto.courseSet == 2">
+            HAVING LENGTH(course_name) = 0
+        </if>
+    </select>
+
+    <select id="getAllCourseBook" resultType="com.xjrsoft.module.base.entity.CourseBookInfo">
+        select t1.id as courseId, t1.name as courseName,t.book_name as bookName
+        from textbook t
+        left join base_course_subject t1 on t.course_subject_id = t1.id
+        left join subject_group t2 on t2.id = t.subject_group_id
+        where t.delete_mark = 0
+        <if test="subjectGroupId != null">
+            AND t2.id = #{subjectGroupId}
+        </if>
+    </select>
+
+    <select id="getSelectedCourseBook" resultType="com.xjrsoft.module.base.entity.CourseBookInfo">
+        select t.id as courseId, t2.name as courseName, t1.book_name as bookName
+        from base_class_course t
+        left join textbook t1 on t1.id = t.textbook_id
+        left join base_course_subject t2 on t.course_id = t2.id
+        where t.delete_mark = 0
+        <if test="classIds != null">
+            AND t.class_id in
+            <foreach item="classIds" collection="classIds" open="(" separator="," close=")">
+                #{classIds}
+            </foreach>
+        </if>
+<!--        <if test="subjectGroupId != null">-->
+<!--            AND-->
+<!--        </if>-->
+    </select>
+
+    <insert id="updateAddClassCourseTextbooks">
+        INSERT INTO base_class_course (class_id, course_id, textbook_id, create_date, delete_mark, enabled_mark)
+        VALUES (#{classId}, #{courseId}, #{textbookId},now(),0,1)
+            ON DUPLICATE KEY UPDATE
+                                 class_id = #{classId},
+                                 course_id = #{courseId},
+                                 textbook_id = #{textbookId}
+
+    </insert>
+
+    <update id="updateRemoveClassCourseTextbooks">
+        UPDATE base_class_course
+        SET delete_mark = 1
+        WHERE class_id = #{classId}
+          AND course_id = #{courseId}
+          AND textbook_id = #{textbookId}
+    </update>
+
+    <update id="markExistingRecordsAsDeleted" parameterType="map">
+        UPDATE base_class_course
+        SET delete_mark = 1
+        WHERE class_id = #{newClassId} AND (course_id IS NULL OR textbook_id IS NULL)
+    </update>
+
+    <insert id="insertClassCourseTextbookCombinations" parameterType="map">
+        INSERT INTO base_class_course (class_id, course_id, textbook_id, create_date, delete_mark,enabled_mark)
+        SELECT #{newClassId}, t.course_id, t.textbook_id, now(), 0, 1
+        FROM (
+                 SELECT course_id, textbook_id
+                 FROM base_class_course
+                 WHERE class_id = #{sourceClassId}
+                   AND delete_mark = 0
+                 GROUP BY course_id, textbook_id
+             ) t
+            ON DUPLICATE KEY UPDATE delete_mark = 0
+    </insert>
+
+    <select id="getClassIdByName" resultType="java.lang.Long">
+        select t.id
+        from base_class t
+        where t.delete_mark = 0
+        <if test="name != null">
+            AND t.name = #{name}
+        </if>
+    </select>
+
+    <select id="getCourseIdByName" resultType="java.lang.Long">
+        select t.id
+        from base_course_subject t
+        where t.delete_mark = 0
+        <if test="name != null">
+            AND t.name = #{name}
+        </if>
+    </select>
+
+    <select id="getBookIdByName" resultType="java.lang.Long">
+        select t.id
+        from textbook t
+        where t.delete_mark = 0
+        <if test="name != null">
+            AND t.book_name = #{name}
+        </if>
+    </select>
+
+    <select id="checkExits" resultType="java.lang.Boolean">
+        SELECT COUNT(1)
+        from base_class_course
+        WHERE class_id = #{classId}
+          AND course_id = #{courseId}
+          AND textbook_id = #{textbookId}
+    </select>
+</mapper>

+ 1 - 1
src/main/resources/mapper/teacher/XjrUserMapper.xml

@@ -34,6 +34,6 @@
         LEFT JOIN base_teacher t1 ON (t1.user_id = t.id)
         LEFT JOIN xjr_user_dept_relation t2 ON (t2.user_id = t.id) WHERE t.delete_mark = 0 AND t1.delete_mark = 0
         AND t1.delete_mark = 0
-        <if test="dto."></if>
+        <!--<if test="dto."></if>-->
     </select>
 </mapper>

+ 1 - 1
src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

@@ -1300,7 +1300,7 @@ public class FreeMarkerGeneratorTest {
         params.setTableConfigs(tableConfigs);
         params.setPage(true);//是否生成分页接口
         params.setImport(false);//是否生成导入接口
-        params.setExport(false);//是否生成导出接口
+        params.setExport(true);//是否生成导出接口
         params.setOutMainDir(true);//是否生成在主目录,前期测试可设置成false
         params.setDs(ds);