拼团商品
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
|
||||
package com.czg.market.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 拼团商品 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-12-15
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class GbWareDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* only-仅本店 all全部 /custom 指定
|
||||
*/
|
||||
@NotBlank(message = "可用门店不能为空")
|
||||
private String useShopType;
|
||||
|
||||
/**
|
||||
* 可用门店(指定门店时存储门店ID,逗号分隔)
|
||||
*/
|
||||
private String useShops;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@NotBlank(message = "商品名称不能为空")
|
||||
private String wareName;
|
||||
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
private String wareDetail;
|
||||
|
||||
/**
|
||||
* 商品图片(多个用逗号分隔)
|
||||
*/
|
||||
@NotBlank(message = "商品图片不能为空")
|
||||
private String wareImgs;
|
||||
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
@NotNull(message = "原价不能为空")
|
||||
private BigDecimal originalPrice;
|
||||
|
||||
/**
|
||||
* 拼团价
|
||||
*/
|
||||
@NotNull(message = "拼团价不能为空")
|
||||
private BigDecimal groupPrice;
|
||||
|
||||
/**
|
||||
* 成团人数 最小为1
|
||||
*/
|
||||
@NotNull(message = "成团人数不能为空")
|
||||
private Integer groupPeopleNum;
|
||||
|
||||
/**
|
||||
* 成团期限(小时)不低于1小时,最大72小时
|
||||
*/
|
||||
@NotNull(message = "成团期限不能为空")
|
||||
private Integer groupTimeoutHour;
|
||||
|
||||
/**
|
||||
* 限购数量(每人最多购买次数) -10086
|
||||
*/
|
||||
private Integer limitBuyNum;
|
||||
|
||||
/**
|
||||
* 上架状态(0下架 1上架)
|
||||
*/
|
||||
private Integer onlineStatus;
|
||||
|
||||
/**
|
||||
* 商品详情图片(多个用逗号分隔)
|
||||
*/
|
||||
private String wareCommentImgs;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.czg.market.dto;
|
||||
|
||||
import com.czg.TimeQueryParam;
|
||||
import com.czg.utils.CzgStrUtils;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 拼团商品查询参数
|
||||
* @author ww
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class GbWareQueryParamDTO extends TimeQueryParam {
|
||||
|
||||
|
||||
/**
|
||||
* 商品名称 模糊查询
|
||||
*/
|
||||
private String wareName;
|
||||
|
||||
/**
|
||||
* 上架状态(0下架 1上架)
|
||||
*/
|
||||
private Boolean onlineStatus;
|
||||
|
||||
public String getWareName() {
|
||||
return CzgStrUtils.getStrOrNull(wareName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.czg.market.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 拼团商品 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-12-15
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("gb_ware")
|
||||
public class GbWare implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* only-仅本店 all全部 /custom 指定
|
||||
*/
|
||||
private String useShopType;
|
||||
|
||||
/**
|
||||
* 可用门店(指定门店时存储门店ID,逗号分隔)
|
||||
*/
|
||||
private String useShops;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String wareName;
|
||||
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
private String wareDetail;
|
||||
|
||||
/**
|
||||
* 商品图片(多个用逗号分隔)
|
||||
*/
|
||||
private String wareImgs;
|
||||
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
private BigDecimal originalPrice;
|
||||
|
||||
/**
|
||||
* 拼团价
|
||||
*/
|
||||
private BigDecimal groupPrice;
|
||||
|
||||
/**
|
||||
* 成团人数 最小为1
|
||||
*/
|
||||
private Integer groupPeopleNum;
|
||||
|
||||
/**
|
||||
* 成团期限(小时)不低于1小时,最大72小时
|
||||
*/
|
||||
private Integer groupTimeoutHour;
|
||||
|
||||
/**
|
||||
* 限购数量(每人最多购买次数) -10086
|
||||
*/
|
||||
private Integer limitBuyNum;
|
||||
|
||||
/**
|
||||
* 上架状态(0下架 1上架)
|
||||
*/
|
||||
private Integer onlineStatus;
|
||||
|
||||
/**
|
||||
* 商品详情图片(多个用逗号分隔)
|
||||
*/
|
||||
private String wareCommentImgs;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0否1是
|
||||
*/
|
||||
@Column(isLogicDelete = true)
|
||||
private Boolean isDel;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.market.dto.GbWareDTO;
|
||||
import com.czg.market.dto.GbWareQueryParamDTO;
|
||||
import com.czg.market.entity.GbWare;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
/**
|
||||
* 拼团商品 服务层。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-12-15
|
||||
*/
|
||||
public interface GbWareService extends IService<GbWare> {
|
||||
//拼团 活动 注意分店 主店的 问题
|
||||
Page<GbWare> getGbWarePage(GbWareQueryParamDTO param, Long shopId);
|
||||
|
||||
//添加
|
||||
boolean addGbWare(GbWareDTO param);
|
||||
|
||||
//修改 上架状态可修改
|
||||
boolean editGbWareOnlineStatus(Long id, Integer onlineStatus);
|
||||
|
||||
//修改 下架状态可修改
|
||||
boolean updateGbWareById(GbWareDTO param);
|
||||
|
||||
//删除 下架状态可删除
|
||||
boolean deleteGbWare(Long id);
|
||||
}
|
||||
Reference in New Issue
Block a user