diff --git a/src/main/java/com/xmomen/module/pick/controller/PickController.java b/src/main/java/com/xmomen/module/pick/controller/PickController.java index 5745c64..7dd602a 100644 --- a/src/main/java/com/xmomen/module/pick/controller/PickController.java +++ b/src/main/java/com/xmomen/module/pick/controller/PickController.java @@ -17,11 +17,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; -/** - * PickController 类是一个控制器类,用于处理与采摘相关的业务请求。 - * 它使用了 Spring 的注解 @RestController,表明这是一个 RESTful 风格的控制器, - * 用于处理 HTTP 请求并返回 JSON 格式的响应(虽然在当前代码中部分方法没有返回值,但通常是这样的用途)。 - */ + @RestController public class PickController { @@ -33,16 +29,7 @@ public class PickController { @Autowired MybatisDao mybatisDao; - /** - * 采摘结算的处理方法,处理 PUT 请求到 "/pick/settleAccounts" 路径的请求。 - * 该方法用于执行采摘结算的业务逻辑。 - * - * @param pickVo 包含采摘结算相关信息的对象,通过 @RequestBody 注解从请求体中获取, - * 并使用 @Valid 注解进行数据验证。 - * @param bindingResult 用于存储数据验证的结果,如果数据验证失败,可以通过它获取错误信息。 - * @return 该方法没有返回值,它主要是调用 PickService 的方法来处理业务逻辑。 - * @throws ArgumentValidException 如果数据验证失败(即 bindingResult 中有错误),则抛出该异常。 - */ + @RequestMapping(value = "/pick/settleAccounts", method = RequestMethod.PUT) // 使用自定义日志注解记录操作名称 @Log(actionName = "采摘结算") @@ -56,16 +43,7 @@ public class PickController { pickService.pick(pickVo); } - /** - * 办理新卡的处理方法,处理 PUT 请求到 "/pick/pickCard" 路径的请求。 - * 该方法用于执行办理新卡的业务逻辑。 - * - * @param createMember 包含办理新卡相关信息的对象,通过 @RequestBody 注解从请求体中获取, - * 并使用 @Valid 注解进行数据验证。 - * @param bindingResult 用于存储数据验证的结果,如果数据验证失败,可以通过它获取错误信息。 - * @return 该方法没有返回值,它主要是调用 PickService 的方法来处理业务逻辑。 - * @throws ArgumentValidException 如果数据验证失败(即 bindingResult 中有错误),则抛出该异常。 - */ + @RequestMapping(value = "/pick/pickCard", method = RequestMethod.PUT) // 使用自定义日志注解记录操作名称 @Log(actionName = "办新卡") diff --git a/src/main/java/com/xmomen/module/pick/entity/TbExchangeCardLogExample.java b/src/main/java/com/xmomen/module/pick/entity/TbExchangeCardLogExample.java index f66d59e..d4dbb94 100644 --- a/src/main/java/com/xmomen/module/pick/entity/TbExchangeCardLogExample.java +++ b/src/main/java/com/xmomen/module/pick/entity/TbExchangeCardLogExample.java @@ -4,10 +4,7 @@ import com.xmomen.framework.mybatis.model.BaseMybatisExample; import java.util.ArrayList; import java.util.List; -/** - * TbExchangeCardLogExample 类用于构建查询 TbExchangeCardLog 表的条件。 - * 它继承自 BaseMybatisExample,提供了一系列方法来动态生成 SQL 查询的 WHERE 子句。 - */ + public class TbExchangeCardLogExample extends BaseMybatisExample { // 用于指定查询结果的排序规则,例如 "ID ASC" protected String orderByClause; @@ -16,75 +13,49 @@ public class TbExchangeCardLogExample extends BaseMybatisExample { // 存储多个查询条件集合,每个 Criteria 代表一组 AND 条件,多个 Criteria 之间是 OR 关系 protected List oredCriteria; - /** - * 构造函数,初始化 oredCriteria 列表 - */ + public TbExchangeCardLogExample() { oredCriteria = new ArrayList(); } - /** - * 设置查询结果的排序规则 - * @param orderByClause 排序规则字符串,例如 "ID ASC" - */ + public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } - /** - * 获取查询结果的排序规则 - * @return 排序规则字符串 - */ + public String getOrderByClause() { return orderByClause; } - /** - * 设置查询结果是否去重 - * @param distinct 是否去重的标志 - */ + public void setDistinct(boolean distinct) { this.distinct = distinct; } - /** - * 获取查询结果是否去重的标志 - * @return 是否去重的标志 - */ + public boolean isDistinct() { return distinct; } - /** - * 获取所有的查询条件集合 - * @return 查询条件集合列表 - */ + public List getOredCriteria() { return oredCriteria; } - /** - * 添加一个新的查询条件集合,并与现有条件集合以 OR 关系连接 - * @param criteria 新的查询条件集合 - */ + public void or(Criteria criteria) { oredCriteria.add(criteria); } - /** - * 创建一个新的查询条件集合,并与现有条件集合以 OR 关系连接 - * @return 新的查询条件集合 - */ + public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } - /** - * 创建一个新的查询条件集合,如果是第一个条件集合,则直接添加到 oredCriteria 中 - * @return 新的查询条件集合 - */ + public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { @@ -93,67 +64,46 @@ public class TbExchangeCardLogExample extends BaseMybatisExample { return criteria; } - /** - * 内部方法,用于创建一个新的查询条件集合 - * @return 新的查询条件集合 - */ + protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } - /** - * 清空所有的查询条件、排序规则和去重标志 - */ + public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } - /** - * GeneratedCriteria 是一个抽象静态类,用于生成具体的查询条件 - */ + protected abstract static class GeneratedCriteria { // 存储具体的查询条件 protected List criteria; - /** - * 构造函数,初始化 criteria 列表 - */ + protected GeneratedCriteria() { super(); criteria = new ArrayList(); } - /** - * 判断当前查询条件集合是否有效,即是否包含至少一个条件 - * @return 如果有效返回 true,否则返回 false - */ + public boolean isValid() { return criteria.size() > 0; } - /** - * 获取所有的查询条件 - * @return 查询条件列表 - */ + public List getAllCriteria() { return criteria; } - /** - * 获取所有的查询条件 - * @return 查询条件列表 - */ + public List getCriteria() { return criteria; } - /** - * 添加一个无值的查询条件,例如 "ID is null" - * @param condition 查询条件字符串 - */ + protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); @@ -161,12 +111,7 @@ public class TbExchangeCardLogExample extends BaseMybatisExample { criteria.add(new Criterion(condition)); } - /** - * 添加一个单值的查询条件,例如 "ID = 1" - * @param condition 查询条件字符串 - * @param value 条件的值 - * @param property 属性名,用于错误提示 - */ + protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); @@ -174,13 +119,7 @@ public class TbExchangeCardLogExample extends BaseMybatisExample { criteria.add(new Criterion(condition, value)); } - /** - * 添加一个范围查询条件,例如 "ID between 1 and 10" - * @param condition 查询条件字符串 - * @param value1 范围的起始值 - * @param value2 范围的结束值 - * @param property 属性名,用于错误提示 - */ + protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); @@ -190,29 +129,19 @@ public class TbExchangeCardLogExample extends BaseMybatisExample { // 以下是针对各个字段的查询条件生成方法,例如判断字段是否为空、等于某个值、大于某个值等 - /** - * 添加一个条件:ID 字段为空 - * @return 当前查询条件集合 - */ + public Criteria andIdIsNull() { addCriterion("ID is null"); return (Criteria) this; } - /** - * 添加一个条件:ID 字段不为空 - * @return 当前查询条件集合 - */ + public Criteria andIdIsNotNull() { addCriterion("ID is not null"); return (Criteria) this; } - /** - * 添加一个条件:ID 字段等于指定值 - * @param value 指定的值 - * @return 当前查询条件集合 - */ + public Criteria andIdEqualTo(Integer value) { addCriterion("ID =", value, "id"); return (Criteria) this; @@ -220,10 +149,7 @@ public class TbExchangeCardLogExample extends BaseMybatisExample { // 其他针对 ID 字段的条件生成方法,如不等于、大于、小于等 - /** - * 添加一个条件:OLD_COUPON_ID 字段为空 - * @return 当前查询条件集合 - */ + public Criteria andOldCouponIdIsNull() { addCriterion("OLD_COUPON_ID is null"); return (Criteria) this; @@ -235,22 +161,16 @@ public class TbExchangeCardLogExample extends BaseMybatisExample { } - /** - * Criteria 类继承自 GeneratedCriteria,用于具体的条件生成 - */ + public static class Criteria extends GeneratedCriteria { - /** - * 构造函数 - */ + protected Criteria() { super(); } } - /** - * Criterion 类表示一个具体的查询条件 - */ + public static class Criterion { // 查询条件的字符串表示,例如 "ID = " private String condition; @@ -269,74 +189,47 @@ public class TbExchangeCardLogExample extends BaseMybatisExample { // 类型处理器,用于处理特殊类型的值 private String typeHandler; - /** - * 获取查询条件的字符串表示 - * @return 查询条件字符串 - */ + public String getCondition() { return condition; } - /** - * 获取条件的值 - * @return 条件的值 - */ + public Object getValue() { return value; } - /** - * 获取范围查询时的第二个值 - * @return 第二个值 - */ + public Object getSecondValue() { return secondValue; } - /** - * 判断是否为无值条件 - * @return 如果是无值条件返回 true,否则返回 false - */ + public boolean isNoValue() { return noValue; } - /** - * 判断是否为单值条件 - * @return 如果是单值条件返回 true,否则返回 false - */ + public boolean isSingleValue() { return singleValue; } - /** - * 判断是否为范围查询条件 - * @return 如果是范围查询条件返回 true,否则返回 false - */ + public boolean isBetweenValue() { return betweenValue; } - /** - * 判断是否为列表值条件 - * @return 如果是列表值条件返回 true,否则返回 false - */ + public boolean isListValue() { return listValue; } - /** - * 获取类型处理器 - * @return 类型处理器字符串 - */ + public String getTypeHandler() { return typeHandler; } - /** - * 构造函数,用于创建无值条件 - * @param condition 查询条件字符串 - */ + protected Criterion(String condition) { super(); this.condition = condition; @@ -344,12 +237,7 @@ public class TbExchangeCardLogExample extends BaseMybatisExample { this.noValue = true; } - /** - * 构造函数,用于创建单值条件 - * @param condition 查询条件字符串 - * @param value 条件的值 - * @param typeHandler 类型处理器 - */ + protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; @@ -362,22 +250,12 @@ public class TbExchangeCardLogExample extends BaseMybatisExample { } } - /** - * 构造函数,用于创建单值条件,不指定类型处理器 - * @param condition 查询条件字符串 - * @param value 条件的值 - */ + protected Criterion(String condition, Object value) { this(condition, value, null); } - /** - * 构造函数,用于创建范围查询条件 - * @param condition 查询条件字符串 - * @param value 范围的起始值 - * @param secondValue 范围的结束值 - * @param typeHandler 类型处理器 - */ + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; @@ -387,12 +265,7 @@ public class TbExchangeCardLogExample extends BaseMybatisExample { this.betweenValue = true; } - /** - * 构造函数,用于创建范围查询条件,不指定类型处理器 - * @param condition 查询条件字符串 - * @param value 范围的起始值 - * @param secondValue 范围的结束值 - */ + protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } diff --git a/src/main/java/com/xmomen/module/pick/entity/TbPick.java b/src/main/java/com/xmomen/module/pick/entity/TbPick.java index f1dc99b..a239f21 100644 --- a/src/main/java/com/xmomen/module/pick/entity/TbPick.java +++ b/src/main/java/com/xmomen/module/pick/entity/TbPick.java @@ -10,71 +10,51 @@ import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Version; -/** - * TbPick 类是一个实体类,对应数据库中的 tb_pick 表。 - * 它继承自 BaseMybatisModel,用于封装采摘相关的信息。 - * 该类使用了 JPA 注解,方便与数据库进行交互。 - */ + @Entity @Table(name = "tb_pick") public class TbPick extends BaseMybatisModel { - /** - * 主键,用于唯一标识一条采摘记录。 - */ + + // 主键 private Integer id; - /** - * 卡号,关联会员的卡片信息,用于识别会员身份。 - */ + + // 优惠券编号 private String couponNo; - /** - * 采摘重量,记录本次采摘的物品重量,使用 BigDecimal 类型确保精度。 - */ + + // 拣货重量 private BigDecimal pickWeight; - /** - * 采摘付款方式,用整数表示不同的付款方式: - * 1 - 刷卡 - * 2 - 现金 + 刷卡 - * 3 - 现金 - */ + + // 拣货支付类型 private Integer pickPayType; - /** - * 采摘总金额,包含刷卡和现金支付的金额总和,使用 BigDecimal 类型确保精度。 - */ + + // 拣货总价 private BigDecimal pickTotalPrice; - /** - * 刷卡金额,记录本次采摘中使用刷卡方式支付的金额,使用 BigDecimal 类型确保精度。 - */ + + // 拣货卡费 private BigDecimal pickCradPrice; - /** - * 现金金额,记录本次采摘中使用现金方式支付的金额,使用 BigDecimal 类型确保精度。 - */ + + // 拣货箱费 private BigDecimal pickCasePrice; - /** - * 采摘日期,记录采摘行为发生的具体日期。 - */ + + // 拣货日期 private Date pickDate; - /** - * 采摘点,用整数标识采摘的具体地点。 - */ + + // 拣货地点 private Integer pickPlace; - /** - * 结算人,用整数标识负责本次采摘结算的人员。 - */ + + // 拣货地点用户 private Integer pickPlaceUser; - /** - * 获取主键值。 - * @return 主键的整数值。 - */ + @Column(name = "ID") @Id @GeneratedValue(generator = "UUIDGenerator") @@ -82,12 +62,7 @@ public class TbPick extends BaseMybatisModel { return id; } - /** - * 设置主键值。 - * 如果传入的主键值为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * @param id 要设置的主键值。 - */ + public void setId(Integer id) { this.id = id; if(id == null){ @@ -99,21 +74,13 @@ public class TbPick extends BaseMybatisModel { addValidField("id"); } - /** - * 获取卡号。 - * @return 卡号的字符串值。 - */ + @Column(name = "COUPON_NO") public String getCouponNo() { return couponNo; } - /** - * 设置卡号。 - * 如果传入的卡号为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * @param couponNo 要设置的卡号。 - */ + public void setCouponNo(String couponNo) { this.couponNo = couponNo; if(couponNo == null){ @@ -125,21 +92,13 @@ public class TbPick extends BaseMybatisModel { addValidField("couponNo"); } - /** - * 获取采摘重量。 - * @return 采摘重量的 BigDecimal 值。 - */ + @Column(name = "PICK_WEIGHT") public BigDecimal getPickWeight() { return pickWeight; } - /** - * 设置采摘重量。 - * 如果传入的采摘重量为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * @param pickWeight 要设置的采摘重量。 - */ + public void setPickWeight(BigDecimal pickWeight) { this.pickWeight = pickWeight; if(pickWeight == null){ @@ -151,21 +110,13 @@ public class TbPick extends BaseMybatisModel { addValidField("pickWeight"); } - /** - * 获取采摘付款方式。 - * @return 采摘付款方式的整数值。 - */ + @Column(name = "PICK_PAY_TYPE") public Integer getPickPayType() { return pickPayType; } - /** - * 设置采摘付款方式。 - * 如果传入的采摘付款方式为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * @param pickPayType 要设置的采摘付款方式。 - */ + public void setPickPayType(Integer pickPayType) { this.pickPayType = pickPayType; if(pickPayType == null){ @@ -177,21 +128,13 @@ public class TbPick extends BaseMybatisModel { addValidField("pickPayType"); } - /** - * 获取采摘总金额。 - * @return 采摘总金额的 BigDecimal 值。 - */ + @Column(name = "PICK_TOTAL_PRICE") public BigDecimal getPickTotalPrice() { return pickTotalPrice; } - /** - * 设置采摘总金额。 - * 如果传入的采摘总金额为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * @param pickTotalPrice 要设置的采摘总金额。 - */ + public void setPickTotalPrice(BigDecimal pickTotalPrice) { this.pickTotalPrice = pickTotalPrice; if(pickTotalPrice == null){ @@ -203,21 +146,13 @@ public class TbPick extends BaseMybatisModel { addValidField("pickTotalPrice"); } - /** - * 获取刷卡金额。 - * @return 刷卡金额的 BigDecimal 值。 - */ + @Column(name = "PICK_CRAD_PRICE") public BigDecimal getPickCradPrice() { return pickCradPrice; } - /** - * 设置刷卡金额。 - * 如果传入的刷卡金额为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * @param pickCradPrice 要设置的刷卡金额。 - */ + public void setPickCradPrice(BigDecimal pickCradPrice) { this.pickCradPrice = pickCradPrice; if(pickCradPrice == null){ @@ -229,21 +164,13 @@ public class TbPick extends BaseMybatisModel { addValidField("pickCradPrice"); } - /** - * 获取现金金额。 - * @return 现金金额的 BigDecimal 值。 - */ + @Column(name = "PICK_CASE_PRICE") public BigDecimal getPickCasePrice() { return pickCasePrice; } - /** - * 设置现金金额。 - * 如果传入的现金金额为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * @param pickCasePrice 要设置的现金金额。 - */ + public void setPickCasePrice(BigDecimal pickCasePrice) { this.pickCasePrice = pickCasePrice; if(pickCasePrice == null){ @@ -255,21 +182,13 @@ public class TbPick extends BaseMybatisModel { addValidField("pickCasePrice"); } - /** - * 获取采摘日期。 - * @return 采摘日期的 Date 对象。 - */ + @Column(name = "PICK_DATE") public Date getPickDate() { return pickDate; } - /** - * 设置采摘日期。 - * 如果传入的采摘日期为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * @param pickDate 要设置的采摘日期。 - */ + public void setPickDate(Date pickDate) { this.pickDate = pickDate; if(pickDate == null){ @@ -281,21 +200,13 @@ public class TbPick extends BaseMybatisModel { addValidField("pickDate"); } - /** - * 获取采摘点。 - * @return 采摘点的整数值。 - */ + @Column(name = "PICK_PLACE") public Integer getPickPlace() { return pickPlace; } - /** - * 设置采摘点。 - * 如果传入的采摘点为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * @param pickPlace 要设置的采摘点。 - */ + public void setPickPlace(Integer pickPlace) { this.pickPlace = pickPlace; if(pickPlace == null){ @@ -307,21 +218,13 @@ public class TbPick extends BaseMybatisModel { addValidField("pickPlace"); } - /** - * 获取结算人。 - * @return 结算人的整数值。 - */ + @Column(name = "PICK_PLACE_USER") public Integer getPickPlaceUser() { return pickPlaceUser; } - /** - * 设置结算人。 - * 如果传入的结算人为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * @param pickPlaceUser 要设置的结算人。 - */ + public void setPickPlaceUser(Integer pickPlaceUser) { this.pickPlaceUser = pickPlaceUser; if(pickPlaceUser == null){ diff --git a/src/main/java/com/xmomen/module/pick/entity/TbPickExample.java b/src/main/java/com/xmomen/module/pick/entity/TbPickExample.java index 2768bb9..637a50c 100644 --- a/src/main/java/com/xmomen/module/pick/entity/TbPickExample.java +++ b/src/main/java/com/xmomen/module/pick/entity/TbPickExample.java @@ -19,75 +19,49 @@ public class TbPickExample extends BaseMybatisExample { // 存储多个查询条件集合,每个 Criteria 代表一组 AND 条件,多个 Criteria 之间是 OR 关系 protected List oredCriteria; - /** - * 构造函数,初始化 oredCriteria 列表 - */ + public TbPickExample() { oredCriteria = new ArrayList(); } - /** - * 设置查询结果的排序规则 - * @param orderByClause 排序规则字符串,例如 "ID ASC" - */ + public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } - /** - * 获取查询结果的排序规则 - * @return 排序规则字符串 - */ + public String getOrderByClause() { return orderByClause; } - /** - * 设置查询结果是否去重 - * @param distinct 是否去重的标志 - */ + public void setDistinct(boolean distinct) { this.distinct = distinct; } - /** - * 获取查询结果是否去重的标志 - * @return 是否去重的标志 - */ + public boolean isDistinct() { return distinct; } - /** - * 获取所有的查询条件集合 - * @return 查询条件集合列表 - */ + public List getOredCriteria() { return oredCriteria; } - /** - * 添加一个新的查询条件集合,并与现有条件集合以 OR 关系连接 - * @param criteria 新的查询条件集合 - */ + public void or(Criteria criteria) { oredCriteria.add(criteria); } - /** - * 创建一个新的查询条件集合,并与现有条件集合以 OR 关系连接 - * @return 新的查询条件集合 - */ + public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } - /** - * 创建一个新的查询条件集合,如果是第一个条件集合,则直接添加到 oredCriteria 中 - * @return 新的查询条件集合 - */ + public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { @@ -96,67 +70,46 @@ public class TbPickExample extends BaseMybatisExample { return criteria; } - /** - * 内部方法,用于创建一个新的查询条件集合 - * @return 新的查询条件集合 - */ + protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } - /** - * 清空所有的查询条件、排序规则和去重标志 - */ + public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } - /** - * GeneratedCriteria 是一个抽象静态类,用于生成具体的查询条件 - */ + protected abstract static class GeneratedCriteria { // 存储具体的查询条件 protected List criteria; - /** - * 构造函数,初始化 criteria 列表 - */ + protected GeneratedCriteria() { super(); criteria = new ArrayList(); } - /** - * 判断当前查询条件集合是否有效,即是否包含至少一个条件 - * @return 如果有效返回 true,否则返回 false - */ + public boolean isValid() { return criteria.size() > 0; } - /** - * 获取所有的查询条件 - * @return 查询条件列表 - */ + public List getAllCriteria() { return criteria; } - /** - * 获取所有的查询条件 - * @return 查询条件列表 - */ + public List getCriteria() { return criteria; } - /** - * 添加一个无值的查询条件,例如 "ID is null" - * @param condition 查询条件字符串 - */ + protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); @@ -164,12 +117,7 @@ public class TbPickExample extends BaseMybatisExample { criteria.add(new Criterion(condition)); } - /** - * 添加一个单值的查询条件,例如 "ID = 1" - * @param condition 查询条件字符串 - * @param value 条件的值 - * @param property 属性名,用于错误提示 - */ + protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); @@ -177,13 +125,7 @@ public class TbPickExample extends BaseMybatisExample { criteria.add(new Criterion(condition, value)); } - /** - * 添加一个范围查询条件,例如 "ID between 1 and 10" - * @param condition 查询条件字符串 - * @param value1 范围的起始值 - * @param value2 范围的结束值 - * @param property 属性名,用于错误提示 - */ + protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); @@ -193,29 +135,19 @@ public class TbPickExample extends BaseMybatisExample { // 以下是针对 TbPick 表各个字段的查询条件生成方法 - /** - * 添加一个条件:ID 字段为空 - * @return 当前查询条件集合 - */ + public Criteria andIdIsNull() { addCriterion("ID is null"); return (Criteria) this; } - /** - * 添加一个条件:ID 字段不为空 - * @return 当前查询条件集合 - */ + public Criteria andIdIsNotNull() { addCriterion("ID is not null"); return (Criteria) this; } - /** - * 添加一个条件:ID 字段等于指定值 - * @param value 指定的值 - * @return 当前查询条件集合 - */ + public Criteria andIdEqualTo(Integer value) { addCriterion("ID =", value, "id"); return (Criteria) this; @@ -223,10 +155,7 @@ public class TbPickExample extends BaseMybatisExample { // 其他针对 ID 字段的条件生成方法,如不等于、大于、小于等 - /** - * 添加一个条件:COUPON_NO 字段为空 - * @return 当前查询条件集合 - */ + public Criteria andCouponNoIsNull() { addCriterion("COUPON_NO is null"); return (Criteria) this; @@ -238,22 +167,16 @@ public class TbPickExample extends BaseMybatisExample { } - /** - * Criteria 类继承自 GeneratedCriteria,用于具体的条件生成 - */ + public static class Criteria extends GeneratedCriteria { - /** - * 构造函数 - */ + protected Criteria() { super(); } } - /** - * Criterion 类表示一个具体的查询条件 - */ + public static class Criterion { // 查询条件的字符串表示,例如 "ID = " private String condition; @@ -272,74 +195,47 @@ public class TbPickExample extends BaseMybatisExample { // 类型处理器,用于处理特殊类型的值 private String typeHandler; - /** - * 获取查询条件的字符串表示 - * @return 查询条件字符串 - */ + public String getCondition() { return condition; } - /** - * 获取条件的值 - * @return 条件的值 - */ + public Object getValue() { return value; } - /** - * 获取范围查询时的第二个值 - * @return 第二个值 - */ + public Object getSecondValue() { return secondValue; } - /** - * 判断是否为无值条件 - * @return 如果是无值条件返回 true,否则返回 false - */ + public boolean isNoValue() { return noValue; } - /** - * 判断是否为单值条件 - * @return 如果是单值条件返回 true,否则返回 false - */ + public boolean isSingleValue() { return singleValue; } - /** - * 判断是否为范围查询条件 - * @return 如果是范围查询条件返回 true,否则返回 false - */ + public boolean isBetweenValue() { return betweenValue; } - /** - * 判断是否为列表值条件 - * @return 如果是列表值条件返回 true,否则返回 false - */ + public boolean isListValue() { return listValue; } - /** - * 获取类型处理器 - * @return 类型处理器字符串 - */ + public String getTypeHandler() { return typeHandler; } - /** - * 构造函数,用于创建无值条件 - * @param condition 查询条件字符串 - */ + protected Criterion(String condition) { super(); this.condition = condition; @@ -347,12 +243,7 @@ public class TbPickExample extends BaseMybatisExample { this.noValue = true; } - /** - * 构造函数,用于创建单值条件 - * @param condition 查询条件字符串 - * @param value 条件的值 - * @param typeHandler 类型处理器 - */ + protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; @@ -365,22 +256,12 @@ public class TbPickExample extends BaseMybatisExample { } } - /** - * 构造函数,用于创建单值条件,不指定类型处理器 - * @param condition 查询条件字符串 - * @param value 条件的值 - */ + public Criterion(String condition, Object value) { this(condition, value, null); } - /** - * 构造函数,用于创建范围查询条件 - * @param condition 查询条件字符串 - * @param value 范围的起始值 - * @param secondValue 范围的结束值 - * @param typeHandler 类型处理器 - */ + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; @@ -390,12 +271,7 @@ public class TbPickExample extends BaseMybatisExample { this.betweenValue = true; } - /** - * 构造函数,用于创建范围查询条件,不指定类型处理器 - * @param condition 查询条件字符串 - * @param value 范围的起始值 - * @param secondValue 范围的结束值 - */ + protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } diff --git a/src/main/java/com/xmomen/module/pick/entity/TbRechargeLog.java b/src/main/java/com/xmomen/module/pick/entity/TbRechargeLog.java index 34d0ea9..101c036 100644 --- a/src/main/java/com/xmomen/module/pick/entity/TbRechargeLog.java +++ b/src/main/java/com/xmomen/module/pick/entity/TbRechargeLog.java @@ -17,41 +17,25 @@ import javax.persistence.Version; @Entity @Table(name = "tb_recharge_log") public class TbRechargeLog extends BaseMybatisModel { - /** - * 充值记录的唯一标识,作为主键,用于在数据库中唯一确定一条充值记录。 - */ + private Integer id; - /** - * 充值所使用的卡号,关联到具体的卡,用于识别是哪张卡进行了充值操作。 - */ + private String couponNo; - /** - * 充值的金额,使用 BigDecimal 类型以保证精确的数值计算。 - */ + private BigDecimal rechargePrice; - /** - * 充值的具体时间,记录充值操作发生的时刻。 - */ + private Date rechargeDate; - /** - * 进行充值操作的人员标识,用于记录是谁执行了本次充值。 - */ + private Integer rechargeUser; - /** - * 充值的地点标识,用于记录充值操作是在哪个地点完成的。 - */ + private Integer rechargePlace; - /** - * 获取充值记录的主键 ID。 - * - * @return 充值记录的主键 ID - */ + @Column(name = "ID") @Id @GeneratedValue(generator = "UUIDGenerator") @@ -59,13 +43,7 @@ public class TbRechargeLog extends BaseMybatisModel { return id; } - /** - * 设置充值记录的主键 ID。 - * 如果传入的 ID 为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * - * @param id 要设置的充值记录的主键 ID - */ + public void setId(Integer id) { this.id = id; if (id == null) { @@ -77,23 +55,13 @@ public class TbRechargeLog extends BaseMybatisModel { addValidField("id"); } - /** - * 获取充值所使用的卡号。 - * - * @return 充值所使用的卡号 - */ + @Column(name = "COUPON_NO") public String getCouponNo() { return couponNo; } - /** - * 设置充值所使用的卡号。 - * 如果传入的卡号为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * - * @param couponNo 要设置的充值所使用的卡号 - */ + public void setCouponNo(String couponNo) { this.couponNo = couponNo; if (couponNo == null) { @@ -105,23 +73,13 @@ public class TbRechargeLog extends BaseMybatisModel { addValidField("couponNo"); } - /** - * 获取充值的金额。 - * - * @return 充值的金额 - */ + @Column(name = "RECHARGE_PRICE") public BigDecimal getRechargePrice() { return rechargePrice; } - /** - * 设置充值的金额。 - * 如果传入的充值金额为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * - * @param rechargePrice 要设置的充值的金额 - */ + public void setRechargePrice(BigDecimal rechargePrice) { this.rechargePrice = rechargePrice; if (rechargePrice == null) { @@ -133,23 +91,13 @@ public class TbRechargeLog extends BaseMybatisModel { addValidField("rechargePrice"); } - /** - * 获取充值的时间。 - * - * @return 充值的时间 - */ + @Column(name = "RECHARGE_DATE") public Date getRechargeDate() { return rechargeDate; } - /** - * 设置充值的时间。 - * 如果传入的充值时间为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * - * @param rechargeDate 要设置的充值的时间 - */ + public void setRechargeDate(Date rechargeDate) { this.rechargeDate = rechargeDate; if (rechargeDate == null) { @@ -161,23 +109,13 @@ public class TbRechargeLog extends BaseMybatisModel { addValidField("rechargeDate"); } - /** - * 获取进行充值操作的人员标识。 - * - * @return 进行充值操作的人员标识 - */ + @Column(name = "RECHARGE_USER") public Integer getRechargeUser() { return rechargeUser; } - /** - * 设置进行充值操作的人员标识。 - * 如果传入的人员标识为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * - * @param rechargeUser 要设置的进行充值操作的人员标识 - */ + public void setRechargeUser(Integer rechargeUser) { this.rechargeUser = rechargeUser; if (rechargeUser == null) { @@ -189,23 +127,13 @@ public class TbRechargeLog extends BaseMybatisModel { addValidField("rechargeUser"); } - /** - * 获取充值的地点标识。 - * - * @return 充值的地点标识 - */ + @Column(name = "RECHARGE_PLACE") public Integer getRechargePlace() { return rechargePlace; } - /** - * 设置充值的地点标识。 - * 如果传入的地点标识为 null,则从有效字段列表中移除该字段; - * 否则,将该字段添加到有效字段列表中。 - * - * @param rechargePlace 要设置的充值的地点标识 - */ + public void setRechargePlace(Integer rechargePlace) { this.rechargePlace = rechargePlace; if (rechargePlace == null) { diff --git a/src/main/java/com/xmomen/module/pick/entity/TbRechargeLogExample.java b/src/main/java/com/xmomen/module/pick/entity/TbRechargeLogExample.java index a166284..eefa41e 100644 --- a/src/main/java/com/xmomen/module/pick/entity/TbRechargeLogExample.java +++ b/src/main/java/com/xmomen/module/pick/entity/TbRechargeLogExample.java @@ -19,75 +19,49 @@ public class TbRechargeLogExample extends BaseMybatisExample { // 存储多个查询条件集合,每个 Criteria 代表一组 AND 条件,多个 Criteria 之间是 OR 关系 protected List oredCriteria; - /** - * 构造函数,初始化 oredCriteria 列表 - */ + public TbRechargeLogExample() { oredCriteria = new ArrayList(); } - /** - * 设置查询结果的排序规则 - * @param orderByClause 排序规则字符串,例如 "ID ASC" - */ + public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } - /** - * 获取查询结果的排序规则 - * @return 排序规则字符串 - */ + public String getOrderByClause() { return orderByClause; } - /** - * 设置查询结果是否去重 - * @param distinct 是否去重的标志 - */ + public void setDistinct(boolean distinct) { this.distinct = distinct; } - /** - * 获取查询结果是否去重的标志 - * @return 是否去重的标志 - */ + public boolean isDistinct() { return distinct; } - /** - * 获取所有的查询条件集合 - * @return 查询条件集合列表 - */ + public List getOredCriteria() { return oredCriteria; } - /** - * 添加一个新的查询条件集合,并与现有条件集合以 OR 关系连接 - * @param criteria 新的查询条件集合 - */ + public void or(Criteria criteria) { oredCriteria.add(criteria); } - /** - * 创建一个新的查询条件集合,并与现有条件集合以 OR 关系连接 - * @return 新的查询条件集合 - */ + public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } - /** - * 创建一个新的查询条件集合,如果是第一个条件集合,则直接添加到 oredCriteria 中 - * @return 新的查询条件集合 - */ + public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { @@ -96,67 +70,46 @@ public class TbRechargeLogExample extends BaseMybatisExample { return criteria; } - /** - * 内部方法,用于创建一个新的查询条件集合 - * @return 新的查询条件集合 - */ + protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } - /** - * 清空所有的查询条件、排序规则和去重标志 - */ + public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } - /** - * GeneratedCriteria 是一个抽象静态类,用于生成具体的查询条件 - */ + protected abstract static class GeneratedCriteria { // 存储具体的查询条件 protected List criteria; - /** - * 构造函数,初始化 criteria 列表 - */ + protected GeneratedCriteria() { super(); criteria = new ArrayList(); } - /** - * 判断当前查询条件集合是否有效,即是否包含至少一个条件 - * @return 如果有效返回 true,否则返回 false - */ + public boolean isValid() { return criteria.size() > 0; } - /** - * 获取所有的查询条件 - * @return 查询条件列表 - */ + public List getAllCriteria() { return criteria; } - /** - * 获取所有的查询条件 - * @return 查询条件列表 - */ + public List getCriteria() { return criteria; } - /** - * 添加一个无值的查询条件,例如 "ID is null" - * @param condition 查询条件字符串 - */ + protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); @@ -164,12 +117,7 @@ public class TbRechargeLogExample extends BaseMybatisExample { criteria.add(new Criterion(condition)); } - /** - * 添加一个单值的查询条件,例如 "ID = 1" - * @param condition 查询条件字符串 - * @param value 条件的值 - * @param property 属性名,用于错误提示 - */ + protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); @@ -177,13 +125,7 @@ public class TbRechargeLogExample extends BaseMybatisExample { criteria.add(new Criterion(condition, value)); } - /** - * 添加一个范围查询条件,例如 "ID between 1 and 10" - * @param condition 查询条件字符串 - * @param value1 范围的起始值 - * @param value2 范围的结束值 - * @param property 属性名,用于错误提示 - */ + protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); @@ -193,29 +135,19 @@ public class TbRechargeLogExample extends BaseMybatisExample { // 以下是针对 TbRechargeLog 表各个字段的查询条件生成方法 - /** - * 添加一个条件:ID 字段为空 - * @return 当前查询条件集合 - */ + public Criteria andIdIsNull() { addCriterion("ID is null"); return (Criteria) this; } - /** - * 添加一个条件:ID 字段不为空 - * @return 当前查询条件集合 - */ + public Criteria andIdIsNotNull() { addCriterion("ID is not null"); return (Criteria) this; } - /** - * 添加一个条件:ID 字段等于指定值 - * @param value 指定的值 - * @return 当前查询条件集合 - */ + public Criteria andIdEqualTo(Integer value) { addCriterion("ID =", value, "id"); return (Criteria) this; @@ -223,10 +155,7 @@ public class TbRechargeLogExample extends BaseMybatisExample { // 其他针对 ID 字段的条件生成方法,如不等于、大于、小于等 - /** - * 添加一个条件:COUPON_NO 字段为空 - * @return 当前查询条件集合 - */ + public Criteria andCouponNoIsNull() { addCriterion("COUPON_NO is null"); return (Criteria) this; @@ -234,10 +163,7 @@ public class TbRechargeLogExample extends BaseMybatisExample { // 其他针对 COUPON_NO 字段的条件生成方法 - /** - * 添加一个条件:RECHARGE_PRICE 字段为空 - * @return 当前查询条件集合 - */ + public Criteria andRechargePriceIsNull() { addCriterion("RECHARGE_PRICE is null"); return (Criteria) this; @@ -245,10 +171,7 @@ public class TbRechargeLogExample extends BaseMybatisExample { // 其他针对 RECHARGE_PRICE 字段的条件生成方法 - /** - * 添加一个条件:RECHARGE_DATE 字段为空 - * @return 当前查询条件集合 - */ + public Criteria andRechargeDateIsNull() { addCriterion("RECHARGE_DATE is null"); return (Criteria) this; @@ -256,10 +179,7 @@ public class TbRechargeLogExample extends BaseMybatisExample { // 其他针对 RECHARGE_DATE 字段的条件生成方法 - /** - * 添加一个条件:RECHARGE_USER 字段为空 - * @return 当前查询条件集合 - */ + public Criteria andRechargeUserIsNull() { addCriterion("RECHARGE_USER is null"); return (Criteria) this; @@ -267,10 +187,7 @@ public class TbRechargeLogExample extends BaseMybatisExample { // 其他针对 RECHARGE_USER 字段的条件生成方法 - /** - * 添加一个条件:RECHARGE_PLACE 字段为空 - * @return 当前查询条件集合 - */ + public Criteria andRechargePlaceIsNull() { addCriterion("RECHARGE_PLACE is null"); return (Criteria) this; @@ -280,22 +197,16 @@ public class TbRechargeLogExample extends BaseMybatisExample { } - /** - * Criteria 类继承自 GeneratedCriteria,用于具体的条件生成 - */ + public static class Criteria extends GeneratedCriteria { - /** - * 构造函数 - */ + protected Criteria() { super(); } } - /** - * Criterion 类表示一个具体的查询条件 - */ + public static class Criterion { // 查询条件的字符串表示,例如 "ID = " private String condition; diff --git a/src/main/java/com/xmomen/module/pick/model/CreateMember.java b/src/main/java/com/xmomen/module/pick/model/CreateMember.java index 7c0839e..a908406 100644 --- a/src/main/java/com/xmomen/module/pick/model/CreateMember.java +++ b/src/main/java/com/xmomen/module/pick/model/CreateMember.java @@ -3,22 +3,39 @@ package com.xmomen.module.pick.model; import java.math.BigDecimal; public class CreateMember { + // 新优惠券号 private String newCouponNo; + // 新密码 private String newPassword; + // 会员类型 private Integer memberType; + // 姓名 private String name; + // 电话号码 private String phoneNumber; + // 备用姓名 private String spareName; + // 备用姓名2 private String spareName2; + // 备用电话 private String spareTel; + // 备用电话2 private String spareTel2; + // 固定电话 private String telNumber; + // 办公电话 private String officeTel; + // 地址 private String address; + // 备用地址 private String spareAddress; + // 备用地址2 private String spareAddress2; + // 公司ID private Integer cdCompanyId; + // 用户ID private Integer cdUserId; + // 用户价格 private BigDecimal userPrice; // Getters and Setters diff --git a/src/main/java/com/xmomen/module/pick/model/PickVo.java b/src/main/java/com/xmomen/module/pick/model/PickVo.java index b23cb83..029d6f6 100644 --- a/src/main/java/com/xmomen/module/pick/model/PickVo.java +++ b/src/main/java/com/xmomen/module/pick/model/PickVo.java @@ -7,9 +7,14 @@ import lombok.Data; public @Data class PickVo implements Serializable{ + // 拣货重量 private BigDecimal pickWeight; + // 拣货价格 private BigDecimal pickPrice; + // 拣货支付类型 private Integer pickPayType; + // 拣货箱价 private BigDecimal pickCasePrice; + // 优惠券编号 private String couponNo; } diff --git a/src/main/java/com/xmomen/module/plan/controller/TablePlanController.java b/src/main/java/com/xmomen/module/plan/controller/TablePlanController.java index bdaca39..1a65151 100644 --- a/src/main/java/com/xmomen/module/plan/controller/TablePlanController.java +++ b/src/main/java/com/xmomen/module/plan/controller/TablePlanController.java @@ -47,15 +47,7 @@ public class TablePlanController { @Autowired MybatisDao mybatisDao; - /** - * 查询餐桌信息 - * @param limit 每页显示的记录数量 - * @param offset 分页查询的偏移量 - * @param id 餐桌计划的ID,可选参数 - * @param keyword 搜索关键词,可选参数 - * @param phoneNumber 电话号码,可选参数 - * @return 包含餐桌计划信息的分页对象 - */ + @RequestMapping(value = "/tablePlan", method = RequestMethod.GET) @Log(actionName = "查询餐桌信息") public Page getTablePlanList(@RequestParam(value = "limit") Integer limit, @@ -84,12 +76,7 @@ public class TablePlanController { return (Page) mybatisDao.selectPage(TablePlanMapper.TablePlanMapperNameSpace + "getTablePlanList", map, limit, offset); } - /** - * 新增餐桌计划 - * @param createTablePlan 包含新增餐桌计划信息的对象 - * @param bindingResult 数据绑定结果,用于验证数据有效性 - * @throws ArgumentValidException 如果数据验证失败,抛出该异常 - */ + @RequestMapping(value = "/tablePlan", method = RequestMethod.POST) @Log(actionName = "新增餐桌") public void createTablePlan(@RequestBody @Valid CreateTablePlan createTablePlan, BindingResult bindingResult) throws ArgumentValidException { @@ -102,11 +89,7 @@ public class TablePlanController { tablePlanService.createTablePlan(createTablePlan); } - /** - * 根据ID查询餐桌信息 - * @param id 餐桌计划的ID - * @return 包含餐桌计划详细信息的对象 - */ + @RequestMapping(value = "/tablePlan/{id}", method = RequestMethod.GET) @Log(actionName = "根据ID查询餐桌信息") public TablePlanModel getTablePlan(@PathVariable(value = "id") Integer id) { @@ -118,13 +101,7 @@ public class TablePlanController { return mybatisDao.getSqlSessionTemplate().selectOne(TablePlanMapper.TablePlanMapperNameSpace + "getTablePlanList", map); } - /** - * 修改餐桌计划信息 - * @param id 要修改的餐桌计划的ID - * @param updateTablePlan 包含更新后餐桌计划信息的对象 - * @param bindingResult 数据绑定结果,用于验证数据有效性 - * @throws ArgumentValidException 如果数据验证失败,抛出该异常 - */ + @RequestMapping(value = "/tablePlan/{id}", method = RequestMethod.PUT) @Log(actionName = "修改餐桌信息") public void updateTablePlan(@PathVariable(value = "id") Integer id, @@ -138,10 +115,7 @@ public class TablePlanController { tablePlanService.updateTablePlan(id, updateTablePlan); } - /** - * 删除餐桌计划信息 - * @param id 要删除的餐桌计划的ID - */ + @RequestMapping(value = "/tablePlan/{id}", method = RequestMethod.DELETE) @Log(actionName = "删除餐桌信息") public void deleteTablePlan(@PathVariable(value = "id") Integer id) { @@ -149,11 +123,7 @@ public class TablePlanController { tablePlanService.delete(id); } - /** - * 暂停配送 - * @param id 要暂停配送的餐桌计划的ID - * @param locked 是否暂停,true表示暂停,false表示恢复 - */ + @RequestMapping(value = "/tablePlan/{id}/stop", method = RequestMethod.PUT) @Log(actionName = "暂停配送") public void stop(@PathVariable(value = "id") Integer id, @@ -168,9 +138,7 @@ public class TablePlanController { mybatisDao.update(tablePlan); } - /** - * 手工调用创建计划订单 - */ + @RequestMapping(value = "/tablePlan/createPlanOrder", method = RequestMethod.PUT) @Log(actionName = "手工调用") public void createPlanOrder() { diff --git a/src/main/java/com/xmomen/module/plan/entity/TbTablePlanExample.java b/src/main/java/com/xmomen/module/plan/entity/TbTablePlanExample.java index c21800d..8508951 100644 --- a/src/main/java/com/xmomen/module/plan/entity/TbTablePlanExample.java +++ b/src/main/java/com/xmomen/module/plan/entity/TbTablePlanExample.java @@ -23,77 +23,49 @@ public class TbTablePlanExample extends BaseMybatisExample { // 多个Criteria之间是逻辑或(OR)的关系 protected List oredCriteria; - /** - * 构造函数,初始化oredCriteria列表,用于存储查询条件。 - */ + public TbTablePlanExample() { oredCriteria = new ArrayList(); } - /** - * 设置排序子句。 - * @param orderByClause 排序子句,例如 "column_name ASC" 或 "column_name DESC" - */ + public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } - /** - * 获取排序子句。 - * @return 排序子句 - */ + public String getOrderByClause() { return orderByClause; } - /** - * 设置是否去重查询结果。 - * @param distinct true表示去重,false表示不去重 - */ + public void setDistinct(boolean distinct) { this.distinct = distinct; } - /** - * 判断是否需要去重查询结果。 - * @return true表示去重,false表示不去重 - */ + public boolean isDistinct() { return distinct; } - /** - * 获取存储查询条件的列表。 - * @return 包含多个Criteria对象的列表,每个Criteria对象代表一个查询条件 - */ + public List getOredCriteria() { return oredCriteria; } - /** - * 将一个查询条件添加到oredCriteria列表中,多个条件之间是逻辑或(OR)的关系。 - * @param criteria 要添加的查询条件对象 - */ + public void or(Criteria criteria) { oredCriteria.add(criteria); } - /** - * 创建一个新的查询条件对象,并将其添加到oredCriteria列表中, - * 然后返回这个新的查询条件对象,方便链式调用设置具体条件。 - * @return 新创建的查询条件对象 - */ + public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } - /** - * 创建一个新的查询条件对象,如果oredCriteria列表为空,则将其添加到列表中, - * 然后返回这个新的查询条件对象,方便链式调用设置具体条件。 - * @return 新创建的查询条件对象 - */ + public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { @@ -102,69 +74,47 @@ public class TbTablePlanExample extends BaseMybatisExample { return criteria; } - /** - * 内部方法,用于创建一个新的查询条件对象。 - * @return 新创建的查询条件对象 - */ + protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } - /** - * 清空所有查询条件、排序子句和去重标记,重置TbTablePlanExample对象的状态。 - */ + public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } - /** - * 内部抽象静态类,用于生成具体的查询条件。 - * 它包含了一系列方法,用于构建各种类型的查询条件,如等于、不等于、大于等。 - */ + protected abstract static class GeneratedCriteria { // 存储具体的查询条件,每个Criterion对象代表一个条件 protected List criteria; - /** - * 构造函数,初始化criteria列表,用于存储查询条件。 - */ + protected GeneratedCriteria() { super(); criteria = new ArrayList(); } - /** - * 判断当前生成的查询条件是否有效,即是否至少有一个条件。 - * @return true表示至少有一个条件,false表示没有条件 - */ + public boolean isValid() { return criteria.size() > 0; } - /** - * 获取所有的查询条件列表。 - * @return 包含多个Criterion对象的列表,每个Criterion对象代表一个条件 - */ + public List getAllCriteria() { return criteria; } - /** - * 获取查询条件列表。 - * @return 包含多个Criterion对象的列表,每个Criterion对象代表一个条件 - */ + public List getCriteria() { return criteria; } - /** - * 添加一个不带值的查询条件,例如 "column_name is null"。 - * @param condition 查询条件字符串 - */ + protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); @@ -172,12 +122,7 @@ public class TbTablePlanExample extends BaseMybatisExample { criteria.add(new Criterion(condition)); } - /** - * 添加一个带单个值的查询条件,例如 "column_name = value"。 - * @param condition 查询条件字符串 - * @param value 查询条件对应的值 - * @param property 对应的属性名(可能用于日志或调试) - */ + protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); @@ -185,13 +130,7 @@ public class TbTablePlanExample extends BaseMybatisExample { criteria.add(new Criterion(condition)); } - /** - * 添加一个带两个值的查询条件,例如 "column_name between value1 and value2"。 - * @param condition 查询条件字符串 - * @param value1 第一个值 - * @param value2 第二个值 - * @param property 对应的属性名(可能用于日志或调试) - */ + protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); @@ -199,13 +138,7 @@ public class TbTablePlanExample extends BaseMybatisExample { criteria.add(new Criterion(condition)); } - /** - * 针对日期类型,添加一个带单个日期值的查询条件, - * 会将Java的Date类型转换为JDBC的Date类型。 - * @param condition 查询条件字符串 - * @param value 日期值 - * @param property 对应的属性名(可能用于日志或调试) - */ + protected void addCriterionForJDBCDate(String condition, Date value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); @@ -213,13 +146,7 @@ public class TbTablePlanExample extends BaseMybatisExample { addCriterion(condition, new java.sql.Date(value.getTime()), property); } - /** - * 针对日期类型,添加一个带日期值列表的查询条件, - * 会将Java的Date类型列表转换为JDBC的Date类型列表。 - * @param condition 查询条件字符串 - * @param values 日期值列表 - * @param property 对应的属性名(可能用于日志或调试) - */ + protected void addCriterionForJDBCDate(String condition, List values, String property) { if (values == null || values.size() == 0) { throw new RuntimeException("Value list for " + property + " cannot be null or empty"); @@ -232,14 +159,7 @@ public class TbTablePlanExample extends BaseMybatisExample { addCriterion(condition, dateList, property); } - /** - * 针对日期类型,添加一个带两个日期值的查询条件, - * 会将Java的Date类型转换为JDBC的Date类型。 - * @param condition 查询条件字符串 - * @param value1 第一个日期值 - * @param value2 第二个日期值 - * @param property 对应的属性名(可能用于日志或调试) - */ + protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); @@ -249,10 +169,7 @@ public class TbTablePlanExample extends BaseMybatisExample { // 以下是针对TbTablePlan实体的各个字段生成的具体查询条件方法,例如针对id字段的查询条件 - /** - * 添加一个查询条件:"ID is null"。 - * @return 当前的查询条件对象,方便链式调用 - */ + public Criteria andIdIsNull() { addCriterion("ID is null"); return (Criteria) this; @@ -264,14 +181,10 @@ public class TbTablePlanExample extends BaseMybatisExample { } - /** - * 具体的查询条件类,继承自GeneratedCriteria,用于构建具体的查询条件。 - */ + public static class Criteria extends GeneratedCriteria { - /** - * 构造函数,调用父类的构造函数初始化查询条件列表。 - */ + protected Criteria() { super(); } @@ -280,9 +193,7 @@ public class TbTablePlanExample extends BaseMybatisExample { } } - /** - * 表示单个查询条件的类,包含条件字符串、值、第二个值等信息。 - */ + public static class Criterion { // 查询条件字符串,例如 "column_name = value" 中的 "column_name =" @@ -311,10 +222,7 @@ public class TbTablePlanExample extends BaseMybatisExample { // 以下是获取各个属性值的方法 - /** - * 获取查询条件字符串。 - * @return 查询条件字符串 - */ + public String getCondition() { return condition; } @@ -325,10 +233,7 @@ public class TbTablePlanExample extends BaseMybatisExample { // 以下是不同参数的构造函数,用于创建Criterion对象 - /** - * 构造函数,创建一个不带值的查询条件对象。 - * @param condition 查询条件字符串 - */ + protected Criterion(String condition) { super(); this.condition = condition; diff --git a/src/main/java/com/xmomen/module/plan/model/CreateTablePlan.java b/src/main/java/com/xmomen/module/plan/model/CreateTablePlan.java index a444b15..068cc55 100644 --- a/src/main/java/com/xmomen/module/plan/model/CreateTablePlan.java +++ b/src/main/java/com/xmomen/module/plan/model/CreateTablePlan.java @@ -17,71 +17,43 @@ import lombok.Data; @Data public class CreateTablePlan implements Serializable { - /** - * 餐桌计划的唯一标识,用于关联具体的餐桌计划。 - * 在业务中,可能通过这个 ID 来查找对应的餐桌计划的详细信息, - * 或者与其他相关实体(如订单、会员等)进行关联操作。 - */ + + // 创建餐桌计划的ID private Integer cdPlanId; - /** - * 审核状态,取值为 0 表示未审核,1 表示审核通过。 - * 用于记录餐桌计划在创建后的审核情况,例如在提交给管理人员审核后, - * 可以根据这个状态来判断该计划是否可以继续执行后续的操作(如生成订单等)。 - */ + + // 审核状态 private Integer auditStatus; - /** - * 是否暂停的标识,0 表示不暂停,1 表示暂停。 - * 当餐桌计划需要临时停止执行(例如由于客户要求或其他特殊原因)时, - * 可以通过设置这个标识来暂停计划的推进,如暂停配送等操作。 - */ + + // 是否停止 private Integer isStop; - /** - * 会员的唯一标识,用于关联相关会员信息。 - * 通过这个 ID 可以获取到与该餐桌计划相关的会员的详细信息, - * 如会员的个人信息、购买记录等,以便更好地管理和服务会员。 - */ + + // 创建餐桌计划的会员ID private Integer cdMemberId; - /** - * 会员卡的卡号,用于识别会员的卡片。 - * 在一些业务场景中,可能会根据卡号来验证会员的身份, - * 或者关联会员的优惠信息、积分信息等。 - */ + + // 优惠券号码 private String couponNumber; - /** - * 收货人的手机号码,用于联系收货人。 - * 当进行餐桌计划的配送等操作时,需要通过这个手机号码与收货人取得联系, - * 以确认收货时间、地点等信息。 - */ + + // 收货人电话 private String consigneePhone; - /** - * 收货人的姓名,用于确认收货人员。 - * 在配送货物时,通过核对收货人姓名来确保货物送达给正确的人员。 - */ + + // 收货人姓名 private String consigneeName; - /** - * 收货人的地址,用于确定货物的送达地点。 - * 这是货物配送的关键信息,确保货物能够准确无误地送到指定的地址。 - */ + + // 收货人地址 private String consigneeAddress; - /** - * 包含多个餐桌计划标识的列表,可用于批量操作或关联多个餐桌计划。 - * 例如,在进行批量创建餐桌计划或对多个相关的餐桌计划进行统一管理时, - * 可以使用这个列表来存储和操作这些计划的 ID。 - */ + + // 创建餐桌计划的ID列表 private List cdPlanIds; - /** - * 包含多个 TbTablePlan 实体的列表,可用于批量创建或关联多个餐桌计划实体。 - * 当需要一次性创建多个餐桌计划时,可以将这些计划的实体对象存储在这个列表中, - * 然后进行统一的处理和保存到数据库等操作。 - */ + + // 餐桌计划列表 private List tablePlans; } \ No newline at end of file diff --git a/src/main/java/com/xmomen/module/plan/model/UpdateTablePlan.java b/src/main/java/com/xmomen/module/plan/model/UpdateTablePlan.java index 42e2298..8e63de7 100644 --- a/src/main/java/com/xmomen/module/plan/model/UpdateTablePlan.java +++ b/src/main/java/com/xmomen/module/plan/model/UpdateTablePlan.java @@ -18,55 +18,43 @@ import org.hibernate.validator.constraints.NotBlank; */ @Data public class UpdateTablePlan implements Serializable { - /** - * 餐桌计划的唯一标识,用于确定要更新的具体餐桌计划。 - */ + + // 计划ID private Integer cdPlanId; - /** - * 审核状态,0表示未审核,1表示审核通过。 - * 用于更新餐桌计划的审核状态。 - */ + + // 审核状态 private Integer auditStatus; - /** - * 是否暂停的标识,0表示不暂停,1表示暂停。 - * 用于更新餐桌计划的暂停状态。 - */ + + // 是否停用 private Integer isStop; - /** - * 会员的唯一标识,可能与该餐桌计划相关联的会员。 - */ + + // 会员ID private Integer cdMemberId; - /** - * 卡号,可能是会员卡或其他关联卡的号码。 - */ + + // 优惠券编号 private String couponNumber; - /** - * 收货人的手机号码,用于联系收货人。 - */ + + // 收货人电话 private String consigneePhone; - /** - * 收货人的姓名,用于确认收货人员。 - */ + + // 收货人姓名 private String consigneeName; - /** - * 收货人的地址,用于确定货物的送达地点。 - */ + + // 收货人地址 private String consigneeAddress; - /** - * 餐桌计划的生效时间,指定该计划开始生效的日期。 - */ + + // 开始时间 private Date beginTime; - /** - * 配送的星期几,指定餐桌计划在一周中的哪些天进行配送。 - */ + + // 发送星期 private String sendWeekDay; } \ No newline at end of file diff --git a/src/main/java/com/xmomen/module/product/controller/CategoryController.java b/src/main/java/com/xmomen/module/product/controller/CategoryController.java index 127c6c8..b5b14a9 100644 --- a/src/main/java/com/xmomen/module/product/controller/CategoryController.java +++ b/src/main/java/com/xmomen/module/product/controller/CategoryController.java @@ -21,11 +21,7 @@ public class CategoryController { @Autowired private CategoryService categoryService; - /** - * 处理客户端发送的GET请求,请求路径为"/wx/category" - * 该方法用于获取所有产品类别的信息 - * @return 包含所有产品类别信息的列表,列表中的每个元素是一个CategoryModel对象 - */ + @RequestMapping(value = "/category", method = RequestMethod.GET) // 将返回的对象直接转换为JSON格式的数据返回给客户端 @ResponseBody diff --git a/src/main/java/com/xmomen/module/product/entity/Category.java b/src/main/java/com/xmomen/module/product/entity/Category.java index 16baa1a..c760a3d 100644 --- a/src/main/java/com/xmomen/module/product/entity/Category.java +++ b/src/main/java/com/xmomen/module/product/entity/Category.java @@ -23,58 +23,44 @@ public class Category extends BaseMybatisModel { // 父类别ID,用于表示类别之间的层级关系 private Integer parentId; - /** - * 获取类别ID - * @return 类别ID - */ + + // 获取类别ID public Integer getId() { return id; } - /** - * 设置类别ID - * @param id 要设置的类别ID - */ + + // 设置类别ID public void setId(Integer id) { this.id = id; } - /** - * 获取类别名称 - * @return 类别名称 - */ + + // 获取类别名称 public String getName() { return name; } - /** - * 设置类别名称 - * @param name 要设置的类别名称 - */ + + // 设置类别名称 public void setName(String name) { this.name = name; } - /** - * 获取父类别ID - * @return 父类别ID - */ + + // 获取父类别ID public Integer getParentId() { return parentId; } - /** - * 设置父类别ID - * @param parentId 要设置的父类别ID - */ + + // 设置父类别ID public void setParentId(Integer parentId) { this.parentId = parentId; } - /** - * 重写toString方法,方便打印对象信息 - * @return 包含类别ID、名称和父类别ID的字符串表示 - */ + + // 重写toString方法,用于输出Category对象的字符串表示 @Override public String toString() { // 使用StringBuilder来构建字符串,提高性能 diff --git a/src/main/java/com/xmomen/module/product/model/ProductQueryFilter.java b/src/main/java/com/xmomen/module/product/model/ProductQueryFilter.java index b7f911a..6792249 100644 --- a/src/main/java/com/xmomen/module/product/model/ProductQueryFilter.java +++ b/src/main/java/com/xmomen/module/product/model/ProductQueryFilter.java @@ -17,56 +17,34 @@ public enum ProductQueryFilter { // 查询条件,可能用于构建更复杂的 SQL 查询,初始值可为 null private String condition; - /** - * 构造函数,初始化描述和字段名,条件默认为 null - * @param desc 枚举值的描述 - * @param fieldName 对应的数据库字段名 - */ + ProductQueryFilter(String desc, String fieldName) { this(desc, fieldName, null); } - /** - * 构造函数,初始化描述、字段名和查询条件 - * @param desc 枚举值的描述 - * @param fieldName 对应的数据库字段名 - * @param condition 查询条件 - */ + ProductQueryFilter(String desc, String fieldName, String condition) { this.desc = desc; this.fieldName = fieldName; this.condition = condition; } - /** - * 获取枚举值的描述 - * @return 描述信息 - */ + public String getDesc() { return this.desc; } - /** - * 获取对应的数据库字段名 - * @return 数据库字段名 - */ + public String getFieldName() { return this.fieldName; } - /** - * 获取查询条件 - * @return 查询条件 - */ + public String getCondition() { return this.condition; } - /** - * 根据描述信息查找对应的 ProductQueryFilter 枚举实例 - * @param desc 要查找的描述信息 - * @return 匹配的枚举实例,如果未找到则返回 null - */ + public static ProductQueryFilter enumOf(String desc) { // 获取所有的 ProductQueryFilter 枚举实例 ProductQueryFilter[] filters = ProductQueryFilter.values(); diff --git a/src/main/java/com/xmomen/module/product/service/impl/CategoryServiceImpl.java b/src/main/java/com/xmomen/module/product/service/impl/CategoryServiceImpl.java index 98eb5a6..8bb5262 100644 --- a/src/main/java/com/xmomen/module/product/service/impl/CategoryServiceImpl.java +++ b/src/main/java/com/xmomen/module/product/service/impl/CategoryServiceImpl.java @@ -26,10 +26,7 @@ public class CategoryServiceImpl implements CategoryService { @Autowired MybatisDao mybatisDao; - /** - * 获取所有产品类别的列表,并将其转换为树形结构的 CategoryModel 列表。 - * @return 包含所有产品类别的树形结构的 CategoryModel 列表 - */ + public List getAllProductCategory() { // 调用 MyBatis 的 SQLSessionTemplate 执行查询,获取所有产品类别的 Category 实体列表 List categoryList = mybatisDao.getSqlSessionTemplate().selectList(ProductCategoryMapper.ProductCategoryMapperNameSpace + "getProductCategoryList"); diff --git a/src/main/java/com/xmomen/module/product/service/impl/ProductServiceImpl.java b/src/main/java/com/xmomen/module/product/service/impl/ProductServiceImpl.java index 8ae61c0..ff8013e 100644 --- a/src/main/java/com/xmomen/module/product/service/impl/ProductServiceImpl.java +++ b/src/main/java/com/xmomen/module/product/service/impl/ProductServiceImpl.java @@ -28,13 +28,7 @@ public class ProductServiceImpl implements ProductService { @Autowired MybatisDao mybatisDao; - /** - * 根据查询条件分页获取产品列表,并对产品信息进行处理。 - * @param productQuery 产品查询条件对象 - * @param limit 每页显示的记录数 - * @param offset 分页偏移量 - * @return 包含产品信息的分页对象 - */ + @SuppressWarnings("unchecked") @Override public Page getProductList(ProductQuery productQuery, Integer limit, Integer offset) { @@ -62,11 +56,7 @@ public class ProductServiceImpl implements ProductService { return pageModel; } - /** - * 根据产品 ID 获取产品详细信息,并处理产品的图片信息。 - * @param id 产品 ID - * @return 包含产品详细信息的 ProductModel 对象,如果未找到则返回 null - */ + @Override public ProductModel getDetailById(Integer id) { // 调用 MyBatis 的查询方法,根据产品 ID 获取产品详细信息列表 @@ -122,11 +112,7 @@ public class ProductServiceImpl implements ProductService { return null; } - /** - * 根据产品 ID 列表获取产品列表,并对产品信息进行处理。 - * @param itemIds 产品 ID 列表 - * @return 包含产品信息的列表,如果 ID 列表为空则返回空列表 - */ + @Override public List getProducts(List itemIds) { // 如果产品 ID 列表为空