Browse Source

refactor(national-motion-system):重构课程相关实体和DTO

- 移除了 AppCourses 实体中的部分字段
- 新增了 AppCoursesCuDTO 和 AppCoursesRuleDTO 两个 DTO 类
- 优化了课程信息的结构,提高了代码的可维护性和扩展性
lix 2 tuần trước cách đây
mục cha
commit
6c6db1d318

+ 94 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/dto/AppCoursesCuDTO.java

@@ -0,0 +1,94 @@
+package org.jeecg.modules.system.app.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+
+/**
+ * @author DM
+ * @date 2025/7/7 20:58
+ * @description
+ */
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@AllArgsConstructor
+@NoArgsConstructor
+@Schema(description="课程入参DTO")
+public class AppCoursesCuDTO {
+    @Schema(description = "id")
+    private String id;
+    /**部门id*/
+    @Excel(name = "部门id", width = 15)
+    @Schema(description = "部门id")
+    private String orgCode;
+    @Excel(name = "教练ID", width = 15)
+    @Schema(description = "教练ID")
+    private String userId;
+    /**商户/场地id;场馆/学校等场地*/
+    @Excel(name = "商户/场地id;场馆/学校等场地", width = 15)
+    @Schema(description = "商户/场地id;场馆/学校等场地")
+    private String tenantId;
+    /**产品名称*/
+    @Excel(name = "产品名称", width = 15)
+    @Schema(description = "产品名称")
+    private String name;
+    /**类目;0足球 1篮球 2羽毛球 3跑步...仅包场*/
+    @Excel(name = "类目;0足球 1篮球 2羽毛球 3跑步...仅包场", width = 15)
+    @Schema(description = "类目;0足球 1篮球 2羽毛球 3跑步...仅包场")
+    private String categoryId;
+    /**费用类型;0 精品 1免费 仅课程*/
+    @Excel(name = "费用类型;0 精品 1免费 仅课程", width = 15)
+    @Schema(description = "费用类型;0 精品 1免费 仅课程")
+    private Integer priceType;
+    /**原价*/
+    @Excel(name = "原价", width = 15)
+    @Schema(description = "原价")
+    private BigDecimal originalPrice;
+    /**售价*/
+    @Excel(name = "售价", width = 15)
+    @Schema(description = "售价")
+    private BigDecimal sellingPrice;
+    /**上课场地*/
+    @Excel(name = "上课场地", width = 15)
+    @Schema(description = "上课场地")
+    private String siteId;
+    /**保险id;可能有多个险种*/
+    @Excel(name = "保险id;可能有多个险种", width = 15)
+    @Schema(description = "保险id;可能有多个险种")
+    private String insureIds;
+    /**封面*/
+    @Excel(name = "封面", width = 15)
+    @Schema(description = "封面")
+    private String cover;
+    /**背景图;可能数组*/
+    @Excel(name = "背景图;可能数组", width = 15)
+    @Schema(description = "背景图;可能数组")
+    private String backgroundImage;
+    /**提示/须知*/
+    @Excel(name = "提示/须知", width = 15)
+    @Schema(description = "提示/须知")
+    private String reminder;
+    /**上架状态;0上架 1下架*/
+    @Excel(name = "上架状态;0上架 1下架", width = 15)
+    @Schema(description = "上架状态;0上架 1下架")
+    private Integer rackingStatus;
+    /**视频*/
+    @Excel(name = "视频", width = 15)
+    @Schema(description = "视频")
+    private String video;
+    /**好评*/
+    @Excel(name = "好评", width = 15)
+    @Schema(description = "好评")
+    private BigDecimal goodRate;
+    /**排序*/
+    @Excel(name = "排序", width = 15)
+    @Schema(description = "排序")
+    private Integer sort;
+}

+ 43 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/dto/AppCoursesRuleDTO.java

@@ -0,0 +1,43 @@
+package org.jeecg.modules.system.app.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @author DM
+ * @date 2025/7/7 20:52
+ * @description
+ */
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@AllArgsConstructor
+@NoArgsConstructor
+@Schema(description="课时表入参DTO")
+public class AppCoursesRuleDTO {
+    /**名称*/
+    @Excel(name = "名称", width = 15)
+    @Schema(description = "名称")
+    private String name;
+    /**开始时间*/
+    @Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "开始时间")
+    private Date startTime;
+    /**结束时间*/
+    @Excel(name = "结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "结束时间")
+    private Date endTime;
+}

+ 4 - 28
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppCourses.java

@@ -81,22 +81,6 @@ public class AppCourses implements Serializable {
 	@Excel(name = "背景图;可能数组", width = 15)
     @Schema(description = "背景图;可能数组")
     private String backgroundImage;
-	/**退款类型;0可退/到期自动退 1限时退 2不可退*/
-	@Excel(name = "退款类型;0可退/到期自动退 1限时退 2不可退", width = 15)
-    @Schema(description = "退款类型;0可退/到期自动退 1限时退 2不可退")
-    private Integer refundType;
-	/**有效期;单位:天 仅无固定场*/
-	@Excel(name = "有效期;单位:天 仅无固定场", width = 15)
-    @Schema(description = "有效期;单位:天 仅无固定场")
-    private Integer indate;
-	/**提前预约时间;单位:时 0面预约*/
-	@Excel(name = "提前预约时间;单位:时 0面预约", width = 15)
-    @Schema(description = "提前预约时间;单位:时 0面预约")
-    private Integer advanceTime;
-	/**适用人数*/
-	@Excel(name = "适用人数", width = 15)
-    @Schema(description = "适用人数")
-    private Integer usableCount;
 	/**提示/须知*/
 	@Excel(name = "提示/须知", width = 15)
     @Schema(description = "提示/须知")
@@ -109,18 +93,10 @@ public class AppCourses implements Serializable {
 	@Excel(name = "视频", width = 15)
     @Schema(description = "视频")
     private String video;
-	/**开始时间*/
-	@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "开始时间")
-    private Date startTime;
-	/**结束时间*/
-	@Excel(name = "结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "结束时间")
-    private Date endTime;
+	/**好评*/
+	@Excel(name = "好评", width = 15)
+    @Schema(description = "好评")
+    private BigDecimal goodRate;
 	/**排序*/
 	@Excel(name = "排序", width = 15)
     @Schema(description = "排序")