Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -90,7 +90,8 @@ public class OperationLogAspect {
|
||||
}
|
||||
|
||||
//登录用户信息
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
Long createUserId = StpKit.USER.getLoginIdAsLong();
|
||||
//TODO SA-TOKEN 暂未整合当前登录人信息,此处仅为临时账号
|
||||
String createUserName = "temp-account";
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.czg.product.param;
|
||||
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品标记售罄参数
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-02-18 17:46
|
||||
*/
|
||||
@Data
|
||||
public class ProductIsSoldOutParam implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 售罄类型 product-商品 sku-SKU
|
||||
*/
|
||||
@NotBlank(message = "售罄类型不能为空", groups = DefaultGroup.class)
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 商品id/sku id
|
||||
*/
|
||||
@NotNull(message = "商品id/sku-id不能为空", groups = DefaultGroup.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 是否售罄 1-是,0-否
|
||||
*/
|
||||
@NotNull(message = "是否售罄不能为空", groups = DefaultGroup.class)
|
||||
@Min(value = 0, message = "是否售罄必须是0或1", groups = DefaultGroup.class)
|
||||
@Max(value = 1, message = "是否售罄必须是0或1", groups = DefaultGroup.class)
|
||||
private Integer isSoldOut;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.czg.product.param;
|
||||
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品SKU查询参数
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-02-19 09:23
|
||||
*/
|
||||
@Data
|
||||
public class ShopProductSkuParam implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@NotNull(message = "商品id不能为空", groups = DefaultGroup.class)
|
||||
private Long id;
|
||||
/**
|
||||
* 选中的规格名称,单规格传:null,多规格:如选择微辣+常温,则传递:微辣,常温,顺序不能变
|
||||
*/
|
||||
private String specInfo;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.czg.product.service;
|
||||
import com.czg.product.dto.ProductDTO;
|
||||
import com.czg.product.entity.Product;
|
||||
import com.czg.product.param.ProductIsSaleParam;
|
||||
import com.czg.product.param.ProductIsSoldOutParam;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
@@ -28,4 +29,6 @@ public interface ProductService extends IService<Product> {
|
||||
boolean deleteProduct(Long id);
|
||||
|
||||
boolean onOffProduct(ProductIsSaleParam param);
|
||||
|
||||
boolean markProductIsSoldOut(ProductIsSoldOutParam param);
|
||||
}
|
||||
@@ -2,9 +2,8 @@ package com.czg.product.service;
|
||||
|
||||
import com.czg.product.entity.Product;
|
||||
import com.czg.product.param.MiniHomeProductParam;
|
||||
import com.czg.product.vo.MiniAppHomeProductVo;
|
||||
import com.czg.product.vo.ShopGroupProductVo;
|
||||
import com.czg.product.vo.ShopProductVo;
|
||||
import com.czg.product.param.ShopProductSkuParam;
|
||||
import com.czg.product.vo.*;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
@@ -21,4 +20,8 @@ public interface UProductService extends IService<Product> {
|
||||
List<ShopProductVo> queryHotsProductList();
|
||||
|
||||
List<ShopGroupProductVo> queryGroupProductList();
|
||||
|
||||
ShopProductInfoVo getProductInfo(Long id);
|
||||
|
||||
ShopProductSkuInfoVo getProductSkuInfo(ShopProductSkuParam param);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.czg.product.vo;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 商品规格详情
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-02-19 09:23
|
||||
*/
|
||||
@Data
|
||||
public class ShopProductInfoVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 短标题--促销语
|
||||
*/
|
||||
private String shortTitle;
|
||||
/**
|
||||
* 封面图url
|
||||
*/
|
||||
private String coverImg;
|
||||
/**
|
||||
* 商品图集
|
||||
*/
|
||||
private Object images;
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
private String unitName;
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
private BigDecimal originPrice;
|
||||
/**
|
||||
* 销售价
|
||||
*/
|
||||
private BigDecimal salePrice;
|
||||
/**
|
||||
* 会员价
|
||||
*/
|
||||
private BigDecimal memberPrice;
|
||||
/**
|
||||
* 是否售罄 1-是 0-否
|
||||
*/
|
||||
private Integer isSoldStock;
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
private Integer stockNumber;
|
||||
/**
|
||||
* 商品类型 single-单规格商品 sku-多规格商品 package-套餐商品 weight-称重商品 coupon-团购券
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 套餐类型 0-固定套餐 1-可选套餐
|
||||
*/
|
||||
private String groupType;
|
||||
/**
|
||||
* 是否可售时间 1-是 0-否
|
||||
*/
|
||||
private Integer isSaleTime;
|
||||
/**
|
||||
* 起售数量
|
||||
*/
|
||||
private Integer suitNum;
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private Object selectSpecInfo;
|
||||
/**
|
||||
* 商品每周销售日 如:Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private String days;
|
||||
/**
|
||||
* 可售卖起始时间
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private LocalTime startTime;
|
||||
/**
|
||||
* 可售卖截止时间
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private LocalTime endTime;
|
||||
|
||||
public Object getImages() {
|
||||
return JSON.parseArray(Convert.toStr(images, "[]"));
|
||||
}
|
||||
|
||||
/**
|
||||
* {"口味":[{"甜度":["少甜","中甜","多甜"]},{"辣度":["微辣","重辣","变态辣"]},{"小料":["葱花","香菜","折耳根"]}]}
|
||||
*/
|
||||
public Object getSelectSpecInfo() {
|
||||
return JSON.parseObject(Convert.toStr(selectSpecInfo, "{}"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.czg.product.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品SKU详情
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-02-19 09:23
|
||||
*/
|
||||
@Data
|
||||
public class ShopProductSkuInfoVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 条形码
|
||||
*/
|
||||
private String barCode;
|
||||
/**
|
||||
* 商品Id
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
private BigDecimal originPrice;
|
||||
/**
|
||||
* 成本价
|
||||
*/
|
||||
private BigDecimal costPrice;
|
||||
/**
|
||||
* 会员价
|
||||
*/
|
||||
private BigDecimal memberPrice;
|
||||
/**
|
||||
* 售价
|
||||
*/
|
||||
private BigDecimal salePrice;
|
||||
/**
|
||||
* 起售数量
|
||||
*/
|
||||
private Integer suitNum;
|
||||
/**
|
||||
* 规格详情
|
||||
*/
|
||||
private String specInfo;
|
||||
/**
|
||||
* 商品封面图
|
||||
*/
|
||||
private String coverImg;
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
/**
|
||||
* 销量
|
||||
*/
|
||||
private BigDecimal realSalesNumber;
|
||||
/**
|
||||
* 是否售罄
|
||||
*/
|
||||
private Integer isPauseSale;
|
||||
/**
|
||||
* 商品库存
|
||||
*/
|
||||
private Integer stockNumber;
|
||||
}
|
||||
@@ -28,6 +28,10 @@ public class ShopProductVo implements Serializable {
|
||||
* 商品名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* sku id
|
||||
*/
|
||||
private Long skuId;
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user