Browse Source

教材征订项更改历史记录

大数据与最优化研究所 1 month ago
parent
commit
10866ad0f5

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

@@ -84,7 +84,6 @@ public class TextbookSubscriptionController {
         return RT.ok(list);
     }
 
-
     @GetMapping(value = "/instockroom-list")
     @ApiOperation(value = "教材教辅征订入库用页面")
     @SaCheckPermission("textbooksubscription:detail")

+ 26 - 69
src/main/java/com/xjrsoft/module/textbook/controller/TextbookSubscriptionItemHistoryController.java

@@ -21,8 +21,6 @@ import com.xjrsoft.module.textbook.dto.UpdateTextbookSubscriptionItemHistoryDto;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import com.alibaba.excel.EasyExcel;
 import com.xjrsoft.module.textbook.entity.Textbook;
-import com.xjrsoft.module.textbook.entity.WfTextbookSubscriptionItemHistory;
-import com.xjrsoft.module.textbook.vo.WfTextbookSubscriptionItemHistoryPageVo;
 import org.springframework.web.multipart.MultipartFile;
 import java.io.IOException;
 import com.alibaba.excel.support.ExcelTypeEnum;
@@ -48,12 +46,12 @@ import java.util.List;
 /**
 * @title: 教材教辅征订项变更历史
 * @Author phoenix
-* @Date: 2025-01-22
+* @Date: 2025-01-23
 * @Version 1.0
 */
 @RestController
 @RequestMapping("/textbook" + "/textbookSubscriptionItemHistory")
-@Api(value = "/textbook"  + "/textbookSubscriptionItemHistory",tags = "教材教辅征订项变更历史代码(新)")
+@Api(value = "/textbook"  + "/textbookSubscriptionItemHistory",tags = "教材教辅征订项变更历史代码")
 @AllArgsConstructor
 public class TextbookSubscriptionItemHistoryController {
 
@@ -64,19 +62,34 @@ public class TextbookSubscriptionItemHistoryController {
     @ApiOperation(value="教材教辅征订项变更历史列表(分页)")
     @SaCheckPermission("textbooksubscriptionitemhistory:detail")
     public RT<PageOutput<TextbookSubscriptionItemHistoryPageVo>> page(@Valid TextbookSubscriptionItemHistoryPageDto dto){
-
         MPJLambdaWrapper<TextbookSubscriptionItemHistory> mpjLambdaWrapper = new MPJLambdaWrapper<>();
         mpjLambdaWrapper
+                .disableSubLogicDel()
                 .select(TextbookSubscriptionItemHistory::getId)
-                .selectAs(BaseCourseSubject::getName, TextbookSubscriptionItemHistoryPageVo::getCourseName)
-                .selectAs(XjrUser::getName, TextbookSubscriptionItemHistoryPageVo::getCreateUserIdCn)
-                .select(Textbook.class, x -> VoToColumnUtil.fieldsToColumns(TextbookSubscriptionItemHistoryPageVo.class).contains(x.getProperty()))
+
                 .select(TextbookSubscriptionItemHistory.class, x -> VoToColumnUtil.fieldsToColumns(TextbookSubscriptionItemHistoryPageVo.class).contains(x.getProperty()))
-                .leftJoin(Textbook.class, Textbook::getId, TextbookSubscriptionItemHistory::getTextbookId)
-                .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, Textbook::getTextbookType,
-                        ext -> ext.selectAs(DictionaryDetail::getName, TextbookSubscriptionItemHistoryPageVo::getTextbookTypeCn))
-                .leftJoin(BaseCourseSubject.class, BaseCourseSubject::getId, Textbook::getCourseSubjectId)
-                .leftJoin(XjrUser.class, XjrUser::getId, TextbookSubscriptionItemHistory::getCreateUserId)
+
+                .leftJoin(Textbook.class, Textbook::getId, TextbookSubscriptionItemHistory::getOldTextbookId,
+                        wrapper -> wrapper
+                                .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, Textbook::getTextbookType,
+                                        ext -> ext.selectAs(DictionaryDetail::getName, TextbookSubscriptionItemHistoryPageVo::getOldTextbookTypeCn))
+                                .leftJoin(BaseCourseSubject.class, BaseCourseSubject::getId, Textbook::getCourseSubjectId,
+                                ext -> ext.selectAs(BaseCourseSubject::getName, TextbookSubscriptionItemHistoryPageVo::getOldCourseName))
+                )
+
+                .leftJoin(Textbook.class, Textbook::getId, TextbookSubscriptionItemHistory::getNewTextbookId,
+                        wrapper -> wrapper
+                                .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, Textbook::getTextbookType,
+                                        ext -> ext.selectAs(DictionaryDetail::getName, TextbookSubscriptionItemHistoryPageVo::getNewTextbookTypeCn))
+                                .leftJoin(BaseCourseSubject.class, BaseCourseSubject::getId, Textbook::getCourseSubjectId,
+                                        ext -> ext.selectAs(BaseCourseSubject::getName, TextbookSubscriptionItemHistoryPageVo::getNewCourseName))
+                )
+
+
+                .leftJoin(XjrUser.class, XjrUser::getId, TextbookSubscriptionItemHistory::getCreateUserId,
+                        wrapper -> wrapper
+                                .selectAs(XjrUser::getName, TextbookSubscriptionItemHistoryPageVo::getCreateUserIdCn)
+                )
                 .eq(dto.getTextbookSubscriptionItemId() != null && dto.getTextbookSubscriptionItemId() > 0, TextbookSubscriptionItemHistory::getTextbookSubscriptionItemId, dto.getTextbookSubscriptionItemId())
                 .eq(dto.getTextbookSubscriptionId() != null && dto.getTextbookSubscriptionId() > 0, TextbookSubscriptionItemHistory::getTextbookSubscriptionId, dto.getTextbookSubscriptionId())
                 .eq(dto.getTextbookType() != null && !dto.getTextbookType().isEmpty(), Textbook::getTextbookType, dto.getTextbookType())
@@ -88,60 +101,4 @@ public class TextbookSubscriptionItemHistoryController {
         PageOutput<TextbookSubscriptionItemHistoryPageVo> pageOutput = ConventPage.getPageOutput(page, TextbookSubscriptionItemHistoryPageVo.class);
         return RT.ok(pageOutput);
     }
-
-    @GetMapping(value = "/info")
-    @ApiOperation(value="根据id查询教材教辅征订项变更历史信息")
-    @SaCheckPermission("textbooksubscriptionitemhistory:detail")
-    public RT<TextbookSubscriptionItemHistoryVo> info(@RequestParam Long id){
-        TextbookSubscriptionItemHistory textbookSubscriptionItemHistory = textbookSubscriptionItemHistoryService.getById(id);
-        if (textbookSubscriptionItemHistory == null) {
-           return RT.error("找不到此数据!");
-        }
-        return RT.ok(BeanUtil.toBean(textbookSubscriptionItemHistory, TextbookSubscriptionItemHistoryVo.class));
-    }
-
-
-    @PostMapping
-    @ApiOperation(value = "新增教材教辅征订项变更历史")
-    @SaCheckPermission("textbooksubscriptionitemhistory:add")
-    public RT<Boolean> add(@Valid @RequestBody AddTextbookSubscriptionItemHistoryDto dto){
-        TextbookSubscriptionItemHistory textbookSubscriptionItemHistory = BeanUtil.toBean(dto, TextbookSubscriptionItemHistory.class);
-        boolean isSuccess = textbookSubscriptionItemHistoryService.save(textbookSubscriptionItemHistory);
-    return RT.ok(isSuccess);
-    }
-
-    @PutMapping
-    @ApiOperation(value = "修改教材教辅征订项变更历史")
-    @SaCheckPermission("textbooksubscriptionitemhistory:edit")
-    public RT<Boolean> update(@Valid @RequestBody UpdateTextbookSubscriptionItemHistoryDto dto){
-
-        TextbookSubscriptionItemHistory textbookSubscriptionItemHistory = BeanUtil.toBean(dto, TextbookSubscriptionItemHistory.class);
-        return RT.ok(textbookSubscriptionItemHistoryService.updateById(textbookSubscriptionItemHistory));
-
-    }
-
-    @DeleteMapping
-    @ApiOperation(value = "删除教材教辅征订项变更历史")
-    @SaCheckPermission("textbooksubscriptionitemhistory:delete")
-    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
-        return RT.ok(textbookSubscriptionItemHistoryService.removeBatchByIds(ids));
-
-    }
-    @PostMapping("/import")
-    @ApiOperation(value = "导入")
-    public RT<Boolean> importData(@RequestParam MultipartFile file) throws IOException {
-        List<TextbookSubscriptionItemHistoryPageVo> savedDataList = EasyExcel.read(file.getInputStream()).head(TextbookSubscriptionItemHistoryPageVo.class).sheet().doReadSync();
-        Boolean result = textbookSubscriptionItemHistoryService.saveBatch(BeanUtil.copyToList(savedDataList, TextbookSubscriptionItemHistory.class));
-        return RT.ok(result);
-    }
-
-    @GetMapping("/export")
-    @ApiOperation(value = "导出")
-    public ResponseEntity<byte[]> exportData(@Valid TextbookSubscriptionItemHistoryPageDto dto, @RequestParam(defaultValue = "false") Boolean isTemplate) {
-        List<TextbookSubscriptionItemHistoryPageVo> customerList = isTemplate != null && isTemplate ? new ArrayList<>() : ((PageOutput<TextbookSubscriptionItemHistoryPageVo>) page(dto).getData()).getList();
-        ByteArrayOutputStream bot = new ByteArrayOutputStream();
-        EasyExcel.write(bot, TextbookSubscriptionItemHistoryPageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
-
-        return RT.fileStream(bot.toByteArray(), "TextbookSubscriptionItemHistory" + ExcelTypeEnum.XLSX.getValue());
-    }
 }

+ 50 - 10
src/main/java/com/xjrsoft/module/textbook/dto/AddTextbookSubscriptionItemHistoryDto.java

@@ -16,7 +16,7 @@ import java.util.Date;
 /**
 * @title: 教材教辅征订项变更历史
 * @Author phoenix
-* @Date: 2025-01-22
+* @Date: 2025-01-23
 * @Version 1.0
 */
 @Data
@@ -43,41 +43,81 @@ public class AddTextbookSubscriptionItemHistoryDto implements Serializable {
     * 教材表主键(textbook)
     */
     @ApiModelProperty("教材表主键(textbook)")
-    private Long textbookId;
+    private Long oldTextbookId;
     /**
     * 学生用书征订数量
     */
     @ApiModelProperty("学生用书征订数量")
-    private Integer studentNum;
+    private Integer oldStudentNum;
     /**
     * 教师用书征订数量
     */
     @ApiModelProperty("教师用书征订数量")
-    private Integer teacherNum;
+    private Integer oldTeacherNum;
     /**
     * 实际折扣
     */
     @ApiModelProperty("实际折扣")
-    private Double discount;
+    private Double oldDiscount;
     /**
     * 实际价格(元)
     */
     @ApiModelProperty("实际价格(元)")
-    private BigDecimal price;
+    private BigDecimal oldPrice;
     /**
     * 当前征订任务征订项入库数量
     */
     @ApiModelProperty("当前征订任务征订项入库数量")
-    private Integer inStockNum;
+    private Integer oldInStockNum;
     /**
     * 当前征订任务征订项出库数量
     */
     @ApiModelProperty("当前征订任务征订项出库数量")
-    private Integer outStockNum;
+    private Integer oldOutStockNum;
     /**
-    * 变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)
+    * 教材表主键(textbook)
+    */
+    @ApiModelProperty("教材表主键(textbook)")
+    private Long newTextbookId;
+    /**
+    * 学生用书征订数量
+    */
+    @ApiModelProperty("学生用书征订数量")
+    private Integer newStudentNum;
+    /**
+    * 教师用书征订数量
+    */
+    @ApiModelProperty("教师用书征订数量")
+    private Integer newTeacherNum;
+    /**
+    * 实际折扣
+    */
+    @ApiModelProperty("实际折扣")
+    private Double newDiscount;
+    /**
+    * 实际价格(元)
+    */
+    @ApiModelProperty("实际价格(元)")
+    private BigDecimal newPrice;
+    /**
+    * 当前征订任务征订项入库数量
+    */
+    @ApiModelProperty("当前征订任务征订项入库数量")
+    private Integer newInStockNum;
+    /**
+    * 当前征订任务征订项出库数量
+    */
+    @ApiModelProperty("当前征订任务征订项出库数量")
+    private Integer newOutStockNum;
+    /**
+    * 当前征订项变更历史记录版本
+    */
+    @ApiModelProperty("当前征订项变更历史记录版本")
+    private Integer historyVersion;
+    /**
+    * 变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,4:学生用书征订数量和教师用书征订数量)
     */
-    @ApiModelProperty("变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)")
+    @ApiModelProperty("变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,4:学生用书征订数量和教师用书征订数量)")
     private Integer alterationType;
 
 }

+ 3 - 9
src/main/java/com/xjrsoft/module/textbook/dto/TextbookSubscriptionItemHistoryPageDto.java

@@ -17,7 +17,7 @@ import java.util.Date;
 /**
 * @title: 教材教辅征订项变更历史分页查询入参
 * @Author phoenix
-* @Date: 2025-01-22
+* @Date: 2025-01-23
 * @Version 1.0
 */
 @Data
@@ -26,15 +26,11 @@ public class TextbookSubscriptionItemHistoryPageDto extends PageInput {
     /**
      * 教材教辅征订编号
      */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("教材教辅征订编号")
     @ApiModelProperty("教材教辅征订编号")
     private Long textbookSubscriptionId;
     /**
      * 教材教辅征订项编号
      */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("教材教辅征订项编号")
     @ApiModelProperty("教材教辅征订项编号")
     private Long textbookSubscriptionItemId;
     /**
@@ -47,9 +43,7 @@ public class TextbookSubscriptionItemHistoryPageDto extends PageInput {
      */
     @ApiModelProperty("书名")
     private String bookName;
-    /**
-     * 课程编号(base_course_subject)
-     */
-    @ApiModelProperty("课程编号(base_course_subject)")
+
+    @ApiModelProperty("课程名称")
     private String courseSubjectIdCn;
 }

+ 20 - 0
src/main/java/com/xjrsoft/module/textbook/dto/UpdateTextbookSubscriptionItemDto.java

@@ -38,4 +38,24 @@ public class UpdateTextbookSubscriptionItemDto implements Serializable {
     */
     @ApiModelProperty("教师用书征订数量")
     private Integer teacherNum;
+    /**
+     * 实际折扣
+     */
+    @ApiModelProperty("实际折扣")
+    private Double discount;
+    /**
+     * 实际价格(元)
+     */
+    @ApiModelProperty("实际价格(元)")
+    private BigDecimal price;
+    /**
+     * 当前征订任务征订项入库数量
+     */
+    @ApiModelProperty("当前征订任务征订项入库数量")
+    private Integer inStockNum;
+    /**
+     * 当前征订任务征订项出库数量
+     */
+    @ApiModelProperty("当前征订任务征订项出库数量")
+    private Integer outStockNum;
 }

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

@@ -16,7 +16,7 @@ import java.util.Date;
 /**
 * @title: 教材教辅征订项变更历史
 * @Author phoenix
-* @Date: 2025-01-22
+* @Date: 2025-01-23
 * @Version 1.0
 */
 @Data

+ 50 - 14
src/main/java/com/xjrsoft/module/textbook/entity/TextbookSubscriptionItemHistory.java

@@ -20,7 +20,7 @@ import java.util.Date;
 /**
 * @title: 教材教辅征订项变更历史
 * @Author phoenix
-* @Date: 2025-01-22
+* @Date: 2025-01-23
 * @Version 1.0
 */
 @Data
@@ -92,46 +92,82 @@ public class TextbookSubscriptionItemHistory implements Serializable {
     * 教材表主键(textbook)
     */
     @ApiModelProperty("教材表主键(textbook)")
-    private Long textbookId;
+    private Long oldTextbookId;
     /**
     * 学生用书征订数量
     */
     @ApiModelProperty("学生用书征订数量")
-    private Integer studentNum;
+    private Integer oldStudentNum;
     /**
     * 教师用书征订数量
     */
     @ApiModelProperty("教师用书征订数量")
-    private Integer teacherNum;
+    private Integer oldTeacherNum;
     /**
     * 实际折扣
     */
     @ApiModelProperty("实际折扣")
-    private Double discount;
+    private Double oldDiscount;
     /**
     * 实际价格(元)
     */
     @ApiModelProperty("实际价格(元)")
-    private BigDecimal price;
+    private BigDecimal oldPrice;
     /**
     * 当前征订任务征订项入库数量
     */
     @ApiModelProperty("当前征订任务征订项入库数量")
-    private Integer inStockNum;
+    private Integer oldInStockNum;
     /**
     * 当前征订任务征订项出库数量
     */
     @ApiModelProperty("当前征订任务征订项出库数量")
-    private Integer outStockNum;
+    private Integer oldOutStockNum;
     /**
-     * 当前征订项变更历史记录
-     */
-    @ApiModelProperty("当前征订项变更历史记录")
+    * 教材表主键(textbook)
+    */
+    @ApiModelProperty("教材表主键(textbook)")
+    private Long newTextbookId;
+    /**
+    * 学生用书征订数量
+    */
+    @ApiModelProperty("学生用书征订数量")
+    private Integer newStudentNum;
+    /**
+    * 教师用书征订数量
+    */
+    @ApiModelProperty("教师用书征订数量")
+    private Integer newTeacherNum;
+    /**
+    * 实际折扣
+    */
+    @ApiModelProperty("实际折扣")
+    private Double newDiscount;
+    /**
+    * 实际价格(元)
+    */
+    @ApiModelProperty("实际价格(元)")
+    private BigDecimal newPrice;
+    /**
+    * 当前征订任务征订项入库数量
+    */
+    @ApiModelProperty("当前征订任务征订项入库数量")
+    private Integer newInStockNum;
+    /**
+    * 当前征订任务征订项出库数量
+    */
+    @ApiModelProperty("当前征订任务征订项出库数量")
+    private Integer newOutStockNum;
+    /**
+    * 当前征订项变更历史记录版本
+    */
+    @ApiModelProperty("当前征订项变更历史记录版本")
     private Integer historyVersion;
-
     /**
-    * 变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)
+    * 变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,4:学生用书征订数量和教师用书征订数量
     */
-    @ApiModelProperty("变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)")
+    @ApiModelProperty("变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,4:学生用书征订数量和教师用书征订数量)")
     private Integer alterationType;
+
+
 }

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

@@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
 /**
 * @title: 教材教辅征订项变更历史
 * @Author phoenix
-* @Date: 2025-01-22
+* @Date: 2025-01-23
 * @Version 1.0
 */
 @Mapper

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

@@ -9,7 +9,7 @@ import java.util.List;
 /**
 * @title: 教材教辅征订项变更历史
 * @Author phoenix
-* @Date: 2025-01-22
+* @Date: 2025-01-23
 * @Version 1.0
 */
 

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

@@ -16,7 +16,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 /**
 * @title: 教材教辅征订项变更历史
 * @Author phoenix
-* @Date: 2025-01-22
+* @Date: 2025-01-23
 * @Version 1.0
 */
 @Service

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

@@ -610,8 +610,25 @@ public class TextbookSubscriptionServiceImpl extends MPJBaseServiceImpl<Textbook
 
         // 将变更前的数据记录在历史表中
         TextbookSubscriptionItemHistory textbookSubscriptionItemHistory = new TextbookSubscriptionItemHistory();
-        BeanUtils.copyProperties(old, textbookSubscriptionItemHistory);
-        textbookSubscriptionItemHistory.setId(null);
+        // 变更前
+        textbookSubscriptionItemHistory.setOldTextbookId(old.getTextbookId());
+        textbookSubscriptionItemHistory.setOldStudentNum(old.getStudentNum());
+        textbookSubscriptionItemHistory.setOldTeacherNum(old.getTeacherNum());
+        textbookSubscriptionItemHistory.setOldDiscount(old.getDiscount());
+        textbookSubscriptionItemHistory.setOldPrice(old.getPrice());
+        textbookSubscriptionItemHistory.setOldInStockNum(old.getInStockNum());
+        textbookSubscriptionItemHistory.setOldOutStockNum(old.getOutStockNum());
+
+        // 变更后
+        textbookSubscriptionItemHistory.setNewTextbookId(dto.getTextbookId());
+        textbookSubscriptionItemHistory.setNewStudentNum(dto.getStudentNum());
+        textbookSubscriptionItemHistory.setNewTeacherNum(dto.getTeacherNum());
+        textbookSubscriptionItemHistory.setNewDiscount(dto.getDiscount());
+        textbookSubscriptionItemHistory.setNewPrice(dto.getPrice());
+        textbookSubscriptionItemHistory.setNewInStockNum(dto.getInStockNum());
+        textbookSubscriptionItemHistory.setNewOutStockNum(dto.getOutStockNum());
+
+        textbookSubscriptionItemHistory.setTextbookSubscriptionId(old.getTextbookSubscriptionId());
         textbookSubscriptionItemHistory.setTextbookSubscriptionItemId(old.getId());
         textbookSubscriptionItemHistory.setCreateDate(new Date());
         textbookSubscriptionItemHistory.setCreateUserId(StpUtil.getLoginIdAsLong());

+ 81 - 16
src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionItemHistoryPageVo.java

@@ -17,7 +17,7 @@ import java.util.Date;
 /**
 * @title: 教材教辅征订项变更历史分页列表出参
 * @Author phoenix
-* @Date: 2025-01-22
+* @Date: 2025-01-23
 * @Version 1.0
 */
 @Data
@@ -37,10 +37,13 @@ public class TextbookSubscriptionItemHistoryPageVo {
     @ExcelProperty("创建人")
     @ApiModelProperty("创建人")
     private Long createUserId;
-
+    /**
+     * 创建人
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("创建人")
     @ApiModelProperty("创建人")
     private String createUserIdCn;
-
     /**
     * 创建时间
     */
@@ -68,13 +71,13 @@ public class TextbookSubscriptionItemHistoryPageVo {
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("教材表主键(textbook)")
     @ApiModelProperty("教材表主键(textbook)")
-    private Long textbookId;
+    private Long oldTextbookId;
 
-    @ApiModelProperty("课程名称")
-    private String courseName;
+    @ApiModelProperty("教材名称")
+    private String oldCourseName;
 
     @ApiModelProperty("教材类型")
-    private String textbookTypeCn;
+    private String oldTextbookTypeCn;
 
     /**
     * 学生用书征订数量
@@ -82,48 +85,110 @@ public class TextbookSubscriptionItemHistoryPageVo {
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("学生用书征订数量")
     @ApiModelProperty("学生用书征订数量")
-    private Integer studentNum;
+    private Integer oldStudentNum;
     /**
     * 教师用书征订数量
     */
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("教师用书征订数量")
     @ApiModelProperty("教师用书征订数量")
-    private Integer teacherNum;
+    private Integer oldTeacherNum;
     /**
     * 实际折扣
     */
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("实际折扣")
     @ApiModelProperty("实际折扣")
-    private Double discount;
+    private Double oldDiscount;
     /**
     * 实际价格(元)
     */
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("实际价格(元)")
     @ApiModelProperty("实际价格(元)")
-    private BigDecimal price;
+    private BigDecimal oldPrice;
     /**
     * 当前征订任务征订项入库数量
     */
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("当前征订任务征订项入库数量")
     @ApiModelProperty("当前征订任务征订项入库数量")
-    private Integer inStockNum;
+    private Integer oldInStockNum;
     /**
     * 当前征订任务征订项出库数量
     */
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("当前征订任务征订项出库数量")
     @ApiModelProperty("当前征订任务征订项出库数量")
-    private Integer outStockNum;
+    private Integer oldOutStockNum;
+    /**
+    * 教材表主键(textbook)
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("教材表主键(textbook)")
+    @ApiModelProperty("教材表主键(textbook)")
+    private Long newTextbookId;
+
+    @ApiModelProperty("教材名称")
+    private String newCourseName;
+
+    @ApiModelProperty("教材类型")
+    private String newTextbookTypeCn;
+    /**
+    * 学生用书征订数量
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生用书征订数量")
+    @ApiModelProperty("学生用书征订数量")
+    private Integer newStudentNum;
+    /**
+    * 教师用书征订数量
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("教师用书征订数量")
+    @ApiModelProperty("教师用书征订数量")
+    private Integer newTeacherNum;
+    /**
+    * 实际折扣
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("实际折扣")
+    @ApiModelProperty("实际折扣")
+    private Double newDiscount;
+    /**
+    * 实际价格(元)
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("实际价格(元)")
+    @ApiModelProperty("实际价格(元)")
+    private BigDecimal newPrice;
+    /**
+    * 当前征订任务征订项入库数量
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("当前征订任务征订项入库数量")
+    @ApiModelProperty("当前征订任务征订项入库数量")
+    private Integer newInStockNum;
+    /**
+    * 当前征订任务征订项出库数量
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("当前征订任务征订项出库数量")
+    @ApiModelProperty("当前征订任务征订项出库数量")
+    private Integer newOutStockNum;
+    /**
+    * 当前征订项变更历史记录版本
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("当前征订项变更历史记录版本")
+    @ApiModelProperty("当前征订项变更历史记录版本")
+    private Integer historyVersion;
     /**
-    * 变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)
+    * 变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,4:学生用书征订数量和教师用书征订数量
     */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)")
-    @ApiModelProperty("变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)")
+    @ExcelProperty("变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,4:学生用书征订数量和教师用书征订数量)")
+    @ApiModelProperty("变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,4:学生用书征订数量和教师用书征订数量)")
     private Integer alterationType;
 
 }

+ 50 - 10
src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionItemHistoryVo.java

@@ -12,7 +12,7 @@ import java.util.Date;
 /**
 * @title: 教材教辅征订项变更历史表单出参
 * @Author phoenix
-* @Date: 2025-01-22
+* @Date: 2025-01-23
 * @Version 1.0
 */
 @Data
@@ -42,41 +42,81 @@ public class TextbookSubscriptionItemHistoryVo {
     * 教材表主键(textbook)
     */
     @ApiModelProperty("教材表主键(textbook)")
-    private Long textbookId;
+    private Long oldTextbookId;
     /**
     * 学生用书征订数量
     */
     @ApiModelProperty("学生用书征订数量")
-    private Integer studentNum;
+    private Integer oldStudentNum;
     /**
     * 教师用书征订数量
     */
     @ApiModelProperty("教师用书征订数量")
-    private Integer teacherNum;
+    private Integer oldTeacherNum;
     /**
     * 实际折扣
     */
     @ApiModelProperty("实际折扣")
-    private Double discount;
+    private Double oldDiscount;
     /**
     * 实际价格(元)
     */
     @ApiModelProperty("实际价格(元)")
-    private BigDecimal price;
+    private BigDecimal oldPrice;
     /**
     * 当前征订任务征订项入库数量
     */
     @ApiModelProperty("当前征订任务征订项入库数量")
-    private Integer inStockNum;
+    private Integer oldInStockNum;
     /**
     * 当前征订任务征订项出库数量
     */
     @ApiModelProperty("当前征订任务征订项出库数量")
-    private Integer outStockNum;
+    private Integer oldOutStockNum;
     /**
-    * 变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)
+    * 教材表主键(textbook)
+    */
+    @ApiModelProperty("教材表主键(textbook)")
+    private Long newTextbookId;
+    /**
+    * 学生用书征订数量
+    */
+    @ApiModelProperty("学生用书征订数量")
+    private Integer newStudentNum;
+    /**
+    * 教师用书征订数量
+    */
+    @ApiModelProperty("教师用书征订数量")
+    private Integer newTeacherNum;
+    /**
+    * 实际折扣
+    */
+    @ApiModelProperty("实际折扣")
+    private Double newDiscount;
+    /**
+    * 实际价格(元)
+    */
+    @ApiModelProperty("实际价格(元)")
+    private BigDecimal newPrice;
+    /**
+    * 当前征订任务征订项入库数量
+    */
+    @ApiModelProperty("当前征订任务征订项入库数量")
+    private Integer newInStockNum;
+    /**
+    * 当前征订任务征订项出库数量
+    */
+    @ApiModelProperty("当前征订任务征订项出库数量")
+    private Integer newOutStockNum;
+    /**
+    * 当前征订项变更历史记录版本
+    */
+    @ApiModelProperty("当前征订项变更历史记录版本")
+    private Integer historyVersion;
+    /**
+    * 变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,4:学生用书征订数量和教师用书征订数量)
     */
-    @ApiModelProperty("变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)")
+    @ApiModelProperty("变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,4:学生用书征订数量和教师用书征订数量)")
     private Integer alterationType;
 
 

+ 17 - 9
src/main/resources/sqlScript/textbook_sql.sql

@@ -167,15 +167,23 @@ create table `textbook_subscription_item_history`
     textbook_subscription_id      bigint         not null comment '教材教辅征订编号',
     textbook_subscription_item_id bigint         not null comment '教材教辅征订项编号',
 
-    textbook_id                   bigint         null comment '教材表主键(textbook)',
-
-    student_num                   int            null default 0 comment '学生用书征订数量',
-    teacher_num                   int            null default 0 comment '教师用书征订数量',
-    discount                      float          null default 10 comment '实际折扣',
-    price                         decimal(10, 2) null default 0 comment '实际价格(元)',
-    in_stock_num                  int            null default 0 comment '当前征订任务征订项入库数量',
-    out_stock_num                 int            null default 0 comment '当前征订任务征订项出库数量',
-    history_version               int                 default 0 null comment '当前征订项变更历史记录',
+    old_textbook_id                   bigint         null comment '教材表主键(textbook)',
+    old_student_num                   int            null default 0 comment '学生用书征订数量',
+    old_teacher_num                   int            null default 0 comment '教师用书征订数量',
+    old_discount                      float          null default 10 comment '实际折扣',
+    old_price                         decimal(10, 2) null default 0 comment '实际价格(元)',
+    old_in_stock_num                  int            null default 0 comment '当前征订任务征订项入库数量',
+    old_out_stock_num                 int            null default 0 comment '当前征订任务征订项出库数量',
+
+    new_textbook_id                   bigint         null comment '教材表主键(textbook)',
+    new_student_num                   int            null default 0 comment '学生用书征订数量',
+    new_teacher_num                   int            null default 0 comment '教师用书征订数量',
+    new_discount                      float          null default 10 comment '实际折扣',
+    new_price                         decimal(10, 2) null default 0 comment '实际价格(元)',
+    new_in_stock_num                  int            null default 0 comment '当前征订任务征订项入库数量',
+    new_out_stock_num                 int            null default 0 comment '当前征订任务征订项出库数量',
+
+    history_version               int                 default 0 null comment '当前征订项变更历史记录版本',
     alteration_type               int            null default 0 comment '变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,4:学生用书征订数量和教师用书征订数量)'
 ) engine = innodb
   default charset = utf8mb4