diff --git a/src/main/java/com/hxtec/polaris/controller/CartController.java b/src/main/java/com/hxtec/polaris/controller/CartController.java index 168dcd6b01ef7f7472e8589393b5da7d9831a438..ea865d738d6957ce73068647fd1b9770efbbbe6b 100644 --- a/src/main/java/com/hxtec/polaris/controller/CartController.java +++ b/src/main/java/com/hxtec/polaris/controller/CartController.java @@ -12,6 +12,7 @@ import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -45,18 +46,12 @@ public class CartController { }) public Result addToCart(@PathVariable int sku,@PathVariable int quantity){ Map map = cartService.addTocart(sku, quantity); - if(StringUtils.equals("success",map.get(CommonContants.STATUS).toString())){ - if (StringUtils.equals(map.get(CommonContants.COUNTS).toString(),"1")){ - //更新库存 - stockService.updateStockInfoBySku(sku); - } - } return Result.ok(map); } @ApiOperation(value = "获取购物车列表") - @PostMapping("cartList") + @GetMapping("cartList") public Result cartList(){ List cartItemList= cartService.getCartList(); return Result.ok(cartItemList); diff --git a/src/main/java/com/hxtec/polaris/entity/ShopCartItem.java b/src/main/java/com/hxtec/polaris/entity/ShopCartItem.java index 9d595e3f93cffb32de8e6d4c32cdab01e2e07ba7..150d7a4ffc3e00902b2eb3170fa32f6922ede4b4 100644 --- a/src/main/java/com/hxtec/polaris/entity/ShopCartItem.java +++ b/src/main/java/com/hxtec/polaris/entity/ShopCartItem.java @@ -14,13 +14,13 @@ import lombok.NoArgsConstructor; /** * @author Caps - * @date 2019/11/25 + * @date 2019/11/29 */ -@ApiModel(value = "com.hxtec.polaris.entity.ShopCartItem") +@ApiModel(value="com.hxtec.polaris.entity.ShopCartItem") +@Data @Builder @AllArgsConstructor @NoArgsConstructor -@Data @Table(name = "shop_cart_item") public class ShopCartItem implements Serializable { /** @@ -29,104 +29,112 @@ public class ShopCartItem implements Serializable { @Id @Column(name = "id") @GeneratedValue(generator = "JDBC") - @ApiModelProperty(value = "主键") + @ApiModelProperty(value="主键") private Integer id; /** * spu_id */ @Column(name = "product_id") - @ApiModelProperty(value = "spu_id") + @ApiModelProperty(value="spu_id") private Integer productId; /** * sku_id */ @Column(name = "product_sku_id") - @ApiModelProperty(value = "sku_id") + @ApiModelProperty(value="sku_id") private Integer productSkuId; /** * 用户id */ @Column(name = "member_id") - @ApiModelProperty(value = "用户id") + @ApiModelProperty(value="用户id") private Integer memberId; /** * 购买数量 */ @Column(name = "quantity") - @ApiModelProperty(value = "购买数量") + @ApiModelProperty(value="购买数量") private Integer quantity; /** * 添加到购物车的价格 */ @Column(name = "price") - @ApiModelProperty(value = "添加到购物车的价格") + @ApiModelProperty(value="添加到购物车的价格") private BigDecimal price; /** * 商品主图 */ @Column(name = "product_pic") - @ApiModelProperty(value = "商品主图") + @ApiModelProperty(value="商品主图") private String productPic; + /** + * 库存 + */ + @Column(name = "stock") + @ApiModelProperty(value="库存") + private Integer stock; + /** * 商品名称 */ @Column(name = "product_name") - @ApiModelProperty(value = "商品名称") + @ApiModelProperty(value="商品名称") private String productName; /** * 商品副标题(卖点) */ @Column(name = "product_sub_title") - @ApiModelProperty(value = "商品副标题(卖点)") + @ApiModelProperty(value="商品副标题(卖点)") private String productSubTitle; /** * 会员昵称 */ @Column(name = "member_nickname") - @ApiModelProperty(value = "会员昵称") + @ApiModelProperty(value="会员昵称") private String memberNickname; /** * 创建时间 */ @Column(name = "create_time") - @ApiModelProperty(value = "创建时间") + @ApiModelProperty(value="创建时间") private Date createTime; /** * 修改时间 */ @Column(name = "update_time") - @ApiModelProperty(value = "修改时间") + @ApiModelProperty(value="修改时间") private Date updateTime; /** * 是否删除 */ @Column(name = "delete_status") - @ApiModelProperty(value = "是否删除") + @ApiModelProperty(value="是否删除") private Integer deleteStatus; /** * 商品分类 */ @Column(name = "product_category_id") - @ApiModelProperty(value = "商品分类") + @ApiModelProperty(value="商品分类") private Integer productCategoryId; /** * 商品销售属性:[{"key":"颜色","value":"颜色"},{"key":"容量","value":"4G"}] */ @Column(name = "product_attr") + @ApiModelProperty(value="商品销售属性:") private String productAttr; private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/hxtec/polaris/entity/ShopOrder.java b/src/main/java/com/hxtec/polaris/entity/ShopOrder.java index 598013e7d828c999a718f5998a9e3f4abac1a8d1..8acad299a99ee4b75f91cc3ba6d6c0c6d3b91a19 100644 --- a/src/main/java/com/hxtec/polaris/entity/ShopOrder.java +++ b/src/main/java/com/hxtec/polaris/entity/ShopOrder.java @@ -1,437 +1,176 @@ package com.hxtec.polaris.entity; -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; - -@Table(name = "hx_tec_shop.shop_order") -public class ShopOrder { +import javax.persistence.*; +import lombok.Data; + +/** + * @author Caps + * @date 2019/12/2 + */ +@ApiModel(value="com.hxtec.polaris.entity.ShopOrder") +@Data +@Table(name = "shop_order") +public class ShopOrder implements Serializable { /** * 订单表主键 */ @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private String id; + @Column(name = "id") + @GeneratedValue(generator = "JDBC") + @ApiModelProperty(value="订单表主键") + private Integer id; + + /** + * 用户id + */ + @Column(name = "member_id") + @ApiModelProperty(value="用户id") + private Integer memberId; /** * 订单号 */ @Column(name = "order_code") - private String orderCode; + @ApiModelProperty(value="订单号") + private Integer orderCode; /** - * 下单时的总价格 + * 订单总金额 */ @Column(name = "total_price") + @ApiModelProperty(value="订单总金额") private BigDecimal totalPrice; /** - * 订单状态 + * 运费金额 + */ + @Column(name = "freight_amount") + @ApiModelProperty(value="运费金额") + private Long freightAmount; + + /** + * 支付方式:0->未支付;1->支付宝;2->微信 + */ + @Column(name = "pay_type") + @ApiModelProperty(value="支付方式:0->未支付;1->支付宝;2->微信") + private Integer payType; + + /** + * 应付金额(实际支付金额) */ - private String state; + @Column(name = "pay_amount") + @ApiModelProperty(value="应付金额(实际支付金额)") + private Long payAmount; + + /** + * 订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单 + */ + @Column(name = "`state`") + @ApiModelProperty(value="订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单") + private Integer state; /** * 是否被删除(Y是/N否) */ @Column(name = "is_delete") + @ApiModelProperty(value="是否被删除(Y是/N否)") private String isDelete; /** * 物流公司 */ @Column(name = "delivery_company") + @ApiModelProperty(value="物流公司") private String deliveryCompany; /** * 物流单号 */ @Column(name = "delivery_code") + @ApiModelProperty(value="物流单号") private String deliveryCode; + /** + * 收货人姓名 + */ + @Column(name = "receiver_name") + @ApiModelProperty(value="收货人姓名") + private String receiverName; + + /** + * 收货人电话 + */ + @Column(name = "receiver_phone") + @ApiModelProperty(value="收货人电话") + private String receiverPhone; + + /** + * 收货人邮编 + */ + @Column(name = "receiver_post_code") + @ApiModelProperty(value="收货人邮编") + private String receiverPostCode; + /** * 省 */ + @Column(name = "province") + @ApiModelProperty(value="省") private String province; /** * 市 */ + @Column(name = "city") + @ApiModelProperty(value="市") private String city; /** * 区 */ + @Column(name = "region") + @ApiModelProperty(value="区") private String region; /** * 订单详细地址 */ @Column(name = "address_detail") + @ApiModelProperty(value="订单详细地址") private String addressDetail; /** * 创建时间 */ @Column(name = "create_time") + @ApiModelProperty(value="创建时间") private Date createTime; /** * 修改时间 */ @Column(name = "update_time") + @ApiModelProperty(value="修改时间") private Date updateTime; /** - * 备用字段1 - */ - private String comment1; - - /** - * 备用字段2 - */ - private String comment2; - - /** - * 备用字段3 - */ - private String comment3; - - /** - * 支付方式 - */ - private String payment; - - /** - * 支付价格 - */ - @Column(name = "payment_price") - private BigDecimal paymentPrice; - - /** - * 获取订单表主键 - * - * @return id - 订单表主键 - */ - public String getId() { - return id; - } - - /** - * 设置订单表主键 - * - * @param id 订单表主键 - */ - public void setId(String id) { - this.id = id; - } - - /** - * 获取订单号 - * - * @return order_code - 订单号 - */ - public String getOrderCode() { - return orderCode; - } - - /** - * 设置订单号 - * - * @param orderCode 订单号 - */ - public void setOrderCode(String orderCode) { - this.orderCode = orderCode; - } - - /** - * 获取下单时的总价格 - * - * @return total_price - 下单时的总价格 - */ - public BigDecimal getTotalPrice() { - return totalPrice; - } - - /** - * 设置下单时的总价格 - * - * @param totalPrice 下单时的总价格 - */ - public void setTotalPrice(BigDecimal totalPrice) { - this.totalPrice = totalPrice; - } - - /** - * 获取订单状态 - * - * @return state - 订单状态 - */ - public String getState() { - return state; - } - - /** - * 设置订单状态 - * - * @param state 订单状态 - */ - public void setState(String state) { - this.state = state; - } - - /** - * 获取是否被删除(Y是/N否) - * - * @return is_delete - 是否被删除(Y是/N否) - */ - public String getIsDelete() { - return isDelete; - } - - /** - * 设置是否被删除(Y是/N否) - * - * @param isDelete 是否被删除(Y是/N否) - */ - public void setIsDelete(String isDelete) { - this.isDelete = isDelete; - } - - /** - * 获取物流公司 - * - * @return delivery_company - 物流公司 - */ - public String getDeliveryCompany() { - return deliveryCompany; - } - - /** - * 设置物流公司 - * - * @param deliveryCompany 物流公司 - */ - public void setDeliveryCompany(String deliveryCompany) { - this.deliveryCompany = deliveryCompany; - } - - /** - * 获取物流单号 - * - * @return delivery_code - 物流单号 - */ - public String getDeliveryCode() { - return deliveryCode; - } - - /** - * 设置物流单号 - * - * @param deliveryCode 物流单号 - */ - public void setDeliveryCode(String deliveryCode) { - this.deliveryCode = deliveryCode; - } - - /** - * 获取省 - * - * @return province - 省 + * 自动确认时间(天) */ - public String getProvince() { - return province; - } + @Column(name = "auto_confirm_day") + @ApiModelProperty(value="自动确认时间(天)") + private Integer autoConfirmDay; /** - * 设置省 - * - * @param province 省 + * 确认收货状态:0->未确认;1->已确认 */ - public void setProvince(String province) { - this.province = province; - } + @Column(name = "confirm_status") + @ApiModelProperty(value="确认收货状态:0->未确认;1->已确认") + private Integer confirmStatus; - /** - * 获取市 - * - * @return city - 市 - */ - public String getCity() { - return city; - } - - /** - * 设置市 - * - * @param city 市 - */ - public void setCity(String city) { - this.city = city; - } - - /** - * 获取区 - * - * @return region - 区 - */ - public String getRegion() { - return region; - } - - /** - * 设置区 - * - * @param region 区 - */ - public void setRegion(String region) { - this.region = region; - } - - /** - * 获取订单详细地址 - * - * @return address_detail - 订单详细地址 - */ - public String getAddressDetail() { - return addressDetail; - } - - /** - * 设置订单详细地址 - * - * @param addressDetail 订单详细地址 - */ - public void setAddressDetail(String addressDetail) { - this.addressDetail = addressDetail; - } - - /** - * 获取创建时间 - * - * @return create_time - 创建时间 - */ - public Date getCreateTime() { - return createTime; - } - - /** - * 设置创建时间 - * - * @param createTime 创建时间 - */ - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - /** - * 获取修改时间 - * - * @return update_time - 修改时间 - */ - public Date getUpdateTime() { - return updateTime; - } - - /** - * 设置修改时间 - * - * @param updateTime 修改时间 - */ - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - /** - * 获取备用字段1 - * - * @return comment1 - 备用字段1 - */ - public String getComment1() { - return comment1; - } - - /** - * 设置备用字段1 - * - * @param comment1 备用字段1 - */ - public void setComment1(String comment1) { - this.comment1 = comment1; - } - - /** - * 获取备用字段2 - * - * @return comment2 - 备用字段2 - */ - public String getComment2() { - return comment2; - } - - /** - * 设置备用字段2 - * - * @param comment2 备用字段2 - */ - public void setComment2(String comment2) { - this.comment2 = comment2; - } - - /** - * 获取备用字段3 - * - * @return comment3 - 备用字段3 - */ - public String getComment3() { - return comment3; - } - - /** - * 设置备用字段3 - * - * @param comment3 备用字段3 - */ - public void setComment3(String comment3) { - this.comment3 = comment3; - } - - /** - * 获取支付方式 - * - * @return payment - 支付方式 - */ - public String getPayment() { - return payment; - } - - /** - * 设置支付方式 - * - * @param payment 支付方式 - */ - public void setPayment(String payment) { - this.payment = payment; - } - - /** - * 获取支付价格 - * - * @return payment_price - 支付价格 - */ - public BigDecimal getPaymentPrice() { - return paymentPrice; - } - - /** - * 设置支付价格 - * - * @param paymentPrice 支付价格 - */ - public void setPaymentPrice(BigDecimal paymentPrice) { - this.paymentPrice = paymentPrice; - } + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/entity/ShopOrderDetail.java b/src/main/java/com/hxtec/polaris/entity/ShopOrderDetail.java deleted file mode 100644 index 719fe9551dfa1fe5ba1a64f5dc1fa2677be8bafb..0000000000000000000000000000000000000000 --- a/src/main/java/com/hxtec/polaris/entity/ShopOrderDetail.java +++ /dev/null @@ -1,412 +0,0 @@ -package com.hxtec.polaris.entity; - -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import java.math.BigDecimal; -import java.util.Date; - -@Table(name = "hx_tec_shop.shop_order_detail") -public class ShopOrderDetail { - /** - * 订单详情表主键 - */ - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private String id; - - /** - * 订单号 - */ - @Column(name = "order_code") - private String orderCode; - - /** - * 商品数量 - */ - private Integer number; - - /** - * 下单时的商品价格 - */ - private BigDecimal price; - - /** - * 是否被删除(Y是/N否) - */ - @Column(name = "is_delete") - private String isDelete; - - /** - * 商品名称 - */ - @Column(name = "product_base_name") - private String productBaseName; - - /** - * 下单时的sku - */ - private String sku; - - /** - * 图片 - */ - private String image; - - /** - * 产品规格 - */ - @Column(name = "attribute_name") - private String attributeName; - - /** - * 产品描述 - */ - private String description; - - /** - * 创建时间 - */ - @Column(name = "create_time") - private Date createTime; - - /** - * 修改时间 - */ - @Column(name = "update_time") - private Date updateTime; - - /** - * 权重 - */ - private Double weight; - - /** - * 备用字段1 - */ - private String comment1; - - /** - * 备用字段2 - */ - private String comment2; - - /** - * 备用字段3 - */ - private String comment3; - - /** - * 商品介绍 - */ - @Column(name = "product_base_detail") - private String productBaseDetail; - - /** - * 获取订单详情表主键 - * - * @return id - 订单详情表主键 - */ - public String getId() { - return id; - } - - /** - * 设置订单详情表主键 - * - * @param id 订单详情表主键 - */ - public void setId(String id) { - this.id = id; - } - - /** - * 获取订单号 - * - * @return order_code - 订单号 - */ - public String getOrderCode() { - return orderCode; - } - - /** - * 设置订单号 - * - * @param orderCode 订单号 - */ - public void setOrderCode(String orderCode) { - this.orderCode = orderCode; - } - - /** - * 获取商品数量 - * - * @return number - 商品数量 - */ - public Integer getNumber() { - return number; - } - - /** - * 设置商品数量 - * - * @param number 商品数量 - */ - public void setNumber(Integer number) { - this.number = number; - } - - /** - * 获取下单时的商品价格 - * - * @return price - 下单时的商品价格 - */ - public BigDecimal getPrice() { - return price; - } - - /** - * 设置下单时的商品价格 - * - * @param price 下单时的商品价格 - */ - public void setPrice(BigDecimal price) { - this.price = price; - } - - /** - * 获取是否被删除(Y是/N否) - * - * @return is_delete - 是否被删除(Y是/N否) - */ - public String getIsDelete() { - return isDelete; - } - - /** - * 设置是否被删除(Y是/N否) - * - * @param isDelete 是否被删除(Y是/N否) - */ - public void setIsDelete(String isDelete) { - this.isDelete = isDelete; - } - - /** - * 获取商品名称 - * - * @return product_base_name - 商品名称 - */ - public String getProductBaseName() { - return productBaseName; - } - - /** - * 设置商品名称 - * - * @param productBaseName 商品名称 - */ - public void setProductBaseName(String productBaseName) { - this.productBaseName = productBaseName; - } - - /** - * 获取下单时的sku - * - * @return sku - 下单时的sku - */ - public String getSku() { - return sku; - } - - /** - * 设置下单时的sku - * - * @param sku 下单时的sku - */ - public void setSku(String sku) { - this.sku = sku; - } - - /** - * 获取图片 - * - * @return image - 图片 - */ - public String getImage() { - return image; - } - - /** - * 设置图片 - * - * @param image 图片 - */ - public void setImage(String image) { - this.image = image; - } - - /** - * 获取产品规格 - * - * @return attribute_name - 产品规格 - */ - public String getAttributeName() { - return attributeName; - } - - /** - * 设置产品规格 - * - * @param attributeName 产品规格 - */ - public void setAttributeName(String attributeName) { - this.attributeName = attributeName; - } - - /** - * 获取产品描述 - * - * @return description - 产品描述 - */ - public String getDescription() { - return description; - } - - /** - * 设置产品描述 - * - * @param description 产品描述 - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * 获取创建时间 - * - * @return create_time - 创建时间 - */ - public Date getCreateTime() { - return createTime; - } - - /** - * 设置创建时间 - * - * @param createTime 创建时间 - */ - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - /** - * 获取修改时间 - * - * @return update_time - 修改时间 - */ - public Date getUpdateTime() { - return updateTime; - } - - /** - * 设置修改时间 - * - * @param updateTime 修改时间 - */ - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - /** - * 获取权重 - * - * @return weight - 权重 - */ - public Double getWeight() { - return weight; - } - - /** - * 设置权重 - * - * @param weight 权重 - */ - public void setWeight(Double weight) { - this.weight = weight; - } - - /** - * 获取备用字段1 - * - * @return comment1 - 备用字段1 - */ - public String getComment1() { - return comment1; - } - - /** - * 设置备用字段1 - * - * @param comment1 备用字段1 - */ - public void setComment1(String comment1) { - this.comment1 = comment1; - } - - /** - * 获取备用字段2 - * - * @return comment2 - 备用字段2 - */ - public String getComment2() { - return comment2; - } - - /** - * 设置备用字段2 - * - * @param comment2 备用字段2 - */ - public void setComment2(String comment2) { - this.comment2 = comment2; - } - - /** - * 获取备用字段3 - * - * @return comment3 - 备用字段3 - */ - public String getComment3() { - return comment3; - } - - /** - * 设置备用字段3 - * - * @param comment3 备用字段3 - */ - public void setComment3(String comment3) { - this.comment3 = comment3; - } - - /** - * 获取商品介绍 - * - * @return product_base_detail - 商品介绍 - */ - public String getProductBaseDetail() { - return productBaseDetail; - } - - /** - * 设置商品介绍 - * - * @param productBaseDetail 商品介绍 - */ - public void setProductBaseDetail(String productBaseDetail) { - this.productBaseDetail = productBaseDetail; - } -} \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/entity/ShopOrderItem.java b/src/main/java/com/hxtec/polaris/entity/ShopOrderItem.java new file mode 100644 index 0000000000000000000000000000000000000000..0c30e65bf460230c5f395e393f4764555dac5819 --- /dev/null +++ b/src/main/java/com/hxtec/polaris/entity/ShopOrderItem.java @@ -0,0 +1,109 @@ +package com.hxtec.polaris.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.*; +import lombok.Data; + +/** + * @author Caps + * @date 2019/12/2 + */ +@ApiModel(value="com.hxtec.polaris.entity.ShopOrderItem") +@Data +@Table(name = "shop_order_item") +public class ShopOrderItem implements Serializable { + @Id + @Column(name = "id") + @GeneratedValue(generator = "JDBC") + @ApiModelProperty(value="null") + private Integer id; + + /** + * 订单id + */ + @Column(name = "order_id") + @ApiModelProperty(value="订单id") + private Integer orderId; + + /** + * 商品spu + */ + @Column(name = "product_id") + @ApiModelProperty(value="商品spu") + private Integer productId; + + /** + * 商品图片 + */ + @Column(name = "product_pic") + @ApiModelProperty(value="商品图片") + private String productPic; + + /** + * 商品名称 + */ + @Column(name = "product_name") + @ApiModelProperty(value="商品名称") + private String productName; + + /** + * 商品介绍 + */ + @Column(name = "product_introduce") + @ApiModelProperty(value="商品介绍") + private String productIntroduce; + + /** + * 销售价格 + */ + @Column(name = "product_price") + @ApiModelProperty(value="销售价格") + private BigDecimal productPrice; + + /** + * 购买数量 + */ + @Column(name = "product_quantity") + @ApiModelProperty(value="购买数量") + private Integer productQuantity; + + /** + * 商品sku编号 + */ + @Column(name = "product_sku_id") + @ApiModelProperty(value="商品sku编号") + private Integer productSkuId; + + /** + * 商品分类id + */ + @Column(name = "product_category_id") + @ApiModelProperty(value="商品分类id") + private Integer productCategoryId; + + /** + * 商品销售属性:[{"key":"颜色","value":"颜色"},{"key":"容量","value":"4G"}] + */ + @Column(name = "product_attr") + @ApiModelProperty(value="商品销售属性") + private String productAttr; + + /** + * 权重 + */ + @Column(name = "weight") + @ApiModelProperty(value="权重") + private Double weight; + + /** + * 是否被删除(Y是/N否) + */ + @Column(name = "is_delete") + @ApiModelProperty(value="是否被删除(Y是/N否)") + private String isDelete; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/entity/ShopProductBase.java b/src/main/java/com/hxtec/polaris/entity/ShopProductBase.java index 3defad81d359877aca83c789b06acb38e8f0b4c5..c4e44b196ab5600ec649711bc5a0b6e4a4369983 100644 --- a/src/main/java/com/hxtec/polaris/entity/ShopProductBase.java +++ b/src/main/java/com/hxtec/polaris/entity/ShopProductBase.java @@ -2,22 +2,18 @@ package com.hxtec.polaris.entity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Table; import java.io.Serializable; import java.util.Date; +import javax.persistence.*; +import lombok.Data; /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ @ApiModel(value = "com.hxtec.polaris.entity.ShopProductBase") @Data -@Table(name = "hx_tec_shop.shop_product_base") +@Table(name = "shop_product_base") public class ShopProductBase implements Serializable { /** * 商品base主表主键 @@ -42,6 +38,13 @@ public class ShopProductBase implements Serializable { @ApiModelProperty(value = "商品名称") private String name; + /** + * 商品介绍 + */ + @Column(name = "detail") + @ApiModelProperty(value = "商品介绍") + private String detail; + /** * 创建时间 */ @@ -84,12 +87,5 @@ public class ShopProductBase implements Serializable { @ApiModelProperty(value = "备用字段3") private String comment3; - /** - * 商品介绍 - */ - @Column(name = "detail") - @ApiModelProperty(value = "商品介绍") - private String detail; - private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/entity/ShopProductImage.java b/src/main/java/com/hxtec/polaris/entity/ShopProductImage.java index 79f1fa2b588d35c5c82ac13e89477b746146ce8d..702c37086349d43520e7897fead572e9e1963ffa 100644 --- a/src/main/java/com/hxtec/polaris/entity/ShopProductImage.java +++ b/src/main/java/com/hxtec/polaris/entity/ShopProductImage.java @@ -2,38 +2,34 @@ package com.hxtec.polaris.entity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Table; import java.io.Serializable; +import javax.persistence.*; +import lombok.Data; /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ -@ApiModel(value="com.hxtec.polaris.entity.ShopProductImage") +@ApiModel(value = "com.hxtec.polaris.entity.ShopProductImage") @Data -@Table(name = "hx_tec_shop.shop_product_image") +@Table(name = "shop_product_image") public class ShopProductImage implements Serializable { @Id @Column(name = "id") @GeneratedValue(generator = "JDBC") - @ApiModelProperty(value="null") - private Long id; + @ApiModelProperty(value = "null") + private Integer id; @Column(name = "product_id") - @ApiModelProperty(value="null") - private Long productId; + @ApiModelProperty(value = "null") + private Integer productId; @Column(name = "img_name") - @ApiModelProperty(value="null") + @ApiModelProperty(value = "null") private String imgName; @Column(name = "img_url") - @ApiModelProperty(value="null") + @ApiModelProperty(value = "null") private String imgUrl; private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/hxtec/polaris/entity/ShopProductSaleAttr.java b/src/main/java/com/hxtec/polaris/entity/ShopProductSaleAttr.java index 3e585fd45ccb6d45f3b36df4c127bd82af70b232..9c9b6b87f89146535232c46f8baa1467a08f3f22 100644 --- a/src/main/java/com/hxtec/polaris/entity/ShopProductSaleAttr.java +++ b/src/main/java/com/hxtec/polaris/entity/ShopProductSaleAttr.java @@ -2,56 +2,49 @@ package com.hxtec.polaris.entity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable;import java.util.List; +import javax.persistence.*; import lombok.Data; -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.Transient; -import java.io.Serializable; -import java.util.List; - /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ -@ApiModel(value="com.hxtec.polaris.entity.ShopProductSaleAttr") +@ApiModel(value = "com.hxtec.polaris.entity.ShopProductSaleAttr") @Data -@Table(name = "hx_tec_shop.shop_product_sale_attr") +@Table(name = "shop_product_sale_attr") public class ShopProductSaleAttr implements Serializable { + @Transient + List spuSaleAttrValueList; /** * id */ @Id @Column(name = "id") @GeneratedValue(generator = "JDBC") - @ApiModelProperty(value="id") + @ApiModelProperty(value = "id") private Integer id; /** * 商品id */ @Column(name = "product_id") - @ApiModelProperty(value="商品id") + @ApiModelProperty(value = "商品id") private Integer productId; /** * 销售属性id */ @Column(name = "sale_attr_id") - @ApiModelProperty(value="销售属性id") + @ApiModelProperty(value = "销售属性id") private Integer saleAttrId; /** * 销售属性名称 */ @Column(name = "sale_attr_name") - @ApiModelProperty(value="销售属性名称") + @ApiModelProperty(value = "销售属性名称") private String saleAttrName; - @Transient - List spuSaleAttrValueList; - private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/entity/ShopProductSaleAttrValue.java b/src/main/java/com/hxtec/polaris/entity/ShopProductSaleAttrValue.java index 5e51a113e7f4997297dbf44a23dd2ed9ec87886e..4e6c8a86fd208f9fbce46503c5b0983a7db983ef 100644 --- a/src/main/java/com/hxtec/polaris/entity/ShopProductSaleAttrValue.java +++ b/src/main/java/com/hxtec/polaris/entity/ShopProductSaleAttrValue.java @@ -2,22 +2,17 @@ package com.hxtec.polaris.entity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.Transient; import java.io.Serializable; +import javax.persistence.*; +import lombok.Data; /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ -@ApiModel(value="com.hxtec.polaris.entity.ShopProductSaleAttrValue") +@ApiModel(value = "com.hxtec.polaris.entity.ShopProductSaleAttrValue") @Data -@Table(name = "hx_tec_shop.shop_product_sale_attr_value") +@Table(name = "shop_product_sale_attr_value") public class ShopProductSaleAttrValue implements Serializable { /** * id @@ -25,28 +20,28 @@ public class ShopProductSaleAttrValue implements Serializable { @Id @Column(name = "id") @GeneratedValue(generator = "JDBC") - @ApiModelProperty(value="id") + @ApiModelProperty(value = "id") private Integer id; /** * 商品id */ @Column(name = "product_id") - @ApiModelProperty(value="商品id") + @ApiModelProperty(value = "商品id") private Integer productId; /** * 销售属性id */ @Column(name = "sale_attr_id") - @ApiModelProperty(value="销售属性id") + @ApiModelProperty(value = "销售属性id") private Integer saleAttrId; /** * 销售属性值名称 */ @Column(name = "sale_attr_value_name") - @ApiModelProperty(value="销售属性值名称") + @ApiModelProperty(value = "销售属性值名称") private String saleAttrValueName; @Transient diff --git a/src/main/java/com/hxtec/polaris/entity/ShopProductVariant.java b/src/main/java/com/hxtec/polaris/entity/ShopProductVariant.java index 57bfdc872c1a6eb27721fc3b1c4bf6aa356f843f..73410de24bc738931612e432c43fc69971f55942 100644 --- a/src/main/java/com/hxtec/polaris/entity/ShopProductVariant.java +++ b/src/main/java/com/hxtec/polaris/entity/ShopProductVariant.java @@ -2,37 +2,28 @@ package com.hxtec.polaris.entity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.Transient; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import java.util.List; +import javax.persistence.*; +import lombok.Data; /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ @ApiModel(value = "com.hxtec.polaris.entity.ShopProductVariant") @Data -@Table(name = "hx_tec_shop.shop_product_variant") +@Table(name = "shop_product_variant") public class ShopProductVariant implements Serializable { - @Transient - List skuImageList; - @Transient - List skuSaleAttrValueList; /** - * 商品sku主键 + * 商品sku */ - @ApiModelProperty(value = "商品sku主键") @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "sku") + @GeneratedValue(generator = "JDBC") + @ApiModelProperty(value = "商品sku") private Integer sku; /** @@ -43,19 +34,26 @@ public class ShopProductVariant implements Serializable { private Integer spu; /** - * 商品价格 + * 商品原价 */ @Column(name = "price") - @ApiModelProperty(value = "商品价格") + @ApiModelProperty(value = "商品原价") private BigDecimal price; + /** + * 商品折扣价 + */ + @Column(name = "discount_price") + @ApiModelProperty(value = "商品折扣价") + private BigDecimal discountPrice; + + /** + * 折扣 + */ @Column(name = "discount") @ApiModelProperty(value = "折扣") private String discount; - @Column(name = "discount_price") - @ApiModelProperty(value = "折扣价") - private BigDecimal discountPrice; /** * 图片 */ @@ -126,5 +124,11 @@ public class ShopProductVariant implements Serializable { @ApiModelProperty(value = "备用字段3") private String comment3; + @Transient + List skuSaleAttrValueList; + + @Transient + List skuImageList; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/entity/ShopProductVariantAttrValue.java b/src/main/java/com/hxtec/polaris/entity/ShopProductVariantAttrValue.java index cd9695fbb5346f22e5e426eecebd1a1483bd3a2d..4e572ed07d24c450130e1e02a200a48c93909c2e 100644 --- a/src/main/java/com/hxtec/polaris/entity/ShopProductVariantAttrValue.java +++ b/src/main/java/com/hxtec/polaris/entity/ShopProductVariantAttrValue.java @@ -2,21 +2,17 @@ package com.hxtec.polaris.entity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Table; import java.io.Serializable; +import javax.persistence.*; +import lombok.Data; /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ -@ApiModel(value="com.hxtec.polaris.entity.ShopProductVariantAttrValue") +@ApiModel(value = "com.hxtec.polaris.entity.ShopProductVariantAttrValue") @Data -@Table(name = "hx_tec_shop.shop_product_variant_attr_value") +@Table(name = "shop_product_variant_attr_value") public class ShopProductVariantAttrValue implements Serializable { /** * 编号 @@ -24,29 +20,43 @@ public class ShopProductVariantAttrValue implements Serializable { @Id @Column(name = "id") @GeneratedValue(generator = "JDBC") - @ApiModelProperty(value="编号") + @ApiModelProperty(value = "编号") private Integer id; /** * 属性id */ @Column(name = "attr_id") - @ApiModelProperty(value="属性id") + @ApiModelProperty(value = "属性id") private Integer attrId; /** * 属性值id */ @Column(name = "value_id") - @ApiModelProperty(value="属性值id") + @ApiModelProperty(value = "属性值id") private Integer valueId; /** * skuid */ @Column(name = "sku_id") - @ApiModelProperty(value="skuid") + @ApiModelProperty(value = "skuid") private Integer skuId; + /** + * 销售属性名称 + */ + @Column(name = "sale_attr_name") + @ApiModelProperty(value = "销售属性名称") + private String saleAttrName; + + /** + * 销售属性值名称 + */ + @Column(name = "sale_attr_value_name") + @ApiModelProperty(value = "销售属性值名称") + private String saleAttrValueName; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/entity/ShopProductVariantImage.java b/src/main/java/com/hxtec/polaris/entity/ShopProductVariantImage.java index e160210b91d664af673791725bf11f1c5d2c3258..900c436e87f96e4040a41139caa326164ba41e06 100644 --- a/src/main/java/com/hxtec/polaris/entity/ShopProductVariantImage.java +++ b/src/main/java/com/hxtec/polaris/entity/ShopProductVariantImage.java @@ -2,21 +2,17 @@ package com.hxtec.polaris.entity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Table; import java.io.Serializable; +import javax.persistence.*; +import lombok.Data; /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ -@ApiModel(value="com.hxtec.polaris.entity.ShopProductVariantImage") +@ApiModel(value = "com.hxtec.polaris.entity.ShopProductVariantImage") @Data -@Table(name = "hx_tec_shop.shop_product_variant_image") +@Table(name = "shop_product_variant_image") public class ShopProductVariantImage implements Serializable { /** * 编号 @@ -24,42 +20,42 @@ public class ShopProductVariantImage implements Serializable { @Id @Column(name = "id") @GeneratedValue(generator = "JDBC") - @ApiModelProperty(value="编号") - private Long id; + @ApiModelProperty(value = "编号") + private Integer id; /** * 商品id */ @Column(name = "sku_id") - @ApiModelProperty(value="商品id") - private Long skuId; + @ApiModelProperty(value = "商品id") + private Integer skuId; /** * 图片名称 */ @Column(name = "img_name") - @ApiModelProperty(value="图片名称") + @ApiModelProperty(value = "图片名称") private String imgName; /** * 图片路径 */ @Column(name = "img_url") - @ApiModelProperty(value="图片路径") + @ApiModelProperty(value = "图片路径") private String imgUrl; /** * 商品图片id */ @Column(name = "product_img_id") - @ApiModelProperty(value="商品图片id") - private Long productImgId; + @ApiModelProperty(value = "商品图片id") + private Integer productImgId; /** * 是否默认 */ @Column(name = "is_default") - @ApiModelProperty(value="是否默认") + @ApiModelProperty(value = "是否默认") private String isDefault; private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/hxtec/polaris/entity/ShopStock.java b/src/main/java/com/hxtec/polaris/entity/ShopStock.java index 5a6246b0398d6e26e84a35bf486a71e92dec6b4b..f516672c3323325dbb229460d14ba1d4e0f07b6a 100644 --- a/src/main/java/com/hxtec/polaris/entity/ShopStock.java +++ b/src/main/java/com/hxtec/polaris/entity/ShopStock.java @@ -9,7 +9,7 @@ import lombok.Data; /** * @author Caps - * @date 2019/11/23 + * @date 2019/11/29 */ @ApiModel(value = "com.hxtec.polaris.entity.ShopStock") @Data diff --git a/src/main/java/com/hxtec/polaris/mapper/ShopCartItemMapper.java b/src/main/java/com/hxtec/polaris/mapper/ShopCartItemMapper.java index 2c432dbb3b6c6095b67b46a815fc13fa4f166017..7c6ef455a66496e4754c475c6c825fe388ea757a 100644 --- a/src/main/java/com/hxtec/polaris/mapper/ShopCartItemMapper.java +++ b/src/main/java/com/hxtec/polaris/mapper/ShopCartItemMapper.java @@ -5,7 +5,7 @@ import tk.mybatis.mapper.MyMapper; /** * @author Caps - * @date 2019/11/25 + * @date 2019/11/29 */ public interface ShopCartItemMapper extends MyMapper { } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/mapper/ShopOrderDetailMapper.java b/src/main/java/com/hxtec/polaris/mapper/ShopOrderItemMapper.java similarity index 30% rename from src/main/java/com/hxtec/polaris/mapper/ShopOrderDetailMapper.java rename to src/main/java/com/hxtec/polaris/mapper/ShopOrderItemMapper.java index 2f013c67c34deb5ae50a1ee70b9fb1c6175e9699..4066817f626dfc53c12aa75d760126e4260f418a 100644 --- a/src/main/java/com/hxtec/polaris/mapper/ShopOrderDetailMapper.java +++ b/src/main/java/com/hxtec/polaris/mapper/ShopOrderItemMapper.java @@ -1,7 +1,11 @@ package com.hxtec.polaris.mapper; -import com.hxtec.polaris.entity.ShopOrderDetail; +import com.hxtec.polaris.entity.ShopOrderItem; import tk.mybatis.mapper.MyMapper; -public interface ShopOrderDetailMapper extends MyMapper { +/** + * @author Caps + * @date 2019/12/2 + */ +public interface ShopOrderItemMapper extends MyMapper { } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/mapper/ShopOrderMapper.java b/src/main/java/com/hxtec/polaris/mapper/ShopOrderMapper.java index c40ac54cfff37af0451f933d6dad4e4afb8c7bec..3da274b364128c292953df24009f84b69ede4803 100644 --- a/src/main/java/com/hxtec/polaris/mapper/ShopOrderMapper.java +++ b/src/main/java/com/hxtec/polaris/mapper/ShopOrderMapper.java @@ -3,5 +3,9 @@ package com.hxtec.polaris.mapper; import com.hxtec.polaris.entity.ShopOrder; import tk.mybatis.mapper.MyMapper; +/** + * @author Caps + * @date 2019/12/2 + */ public interface ShopOrderMapper extends MyMapper { } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/mapper/ShopProductBaseMapper.java b/src/main/java/com/hxtec/polaris/mapper/ShopProductBaseMapper.java index 3f98171ddafd38f93aaeb6a83ff26d94a9d400b7..6989d05491c6ef64096c6affcb543909fdda704e 100644 --- a/src/main/java/com/hxtec/polaris/mapper/ShopProductBaseMapper.java +++ b/src/main/java/com/hxtec/polaris/mapper/ShopProductBaseMapper.java @@ -1,52 +1,56 @@ package com.hxtec.polaris.mapper; import com.hxtec.polaris.entity.ShopProductBase; -import org.apache.ibatis.annotations.Param; -import tk.mybatis.mapper.MyMapper; - -import java.util.List; -import java.util.Map; +import org.apache.ibatis.annotations.Param;import tk.mybatis.mapper.MyMapper;import java.util.List;import java.util.Map; +/** + * @author Caps + * @date 2019/11/29 + */ public interface ShopProductBaseMapper extends MyMapper { - /** * 分页获取商品 + * * @param start * @param rows * @param order 1 综合排序(weight降序) 2销量优先(降序) 3价格(price升序)4价格(price降序) * @return */ - List> getAllGoods(@Param("start") Integer start, @Param("rows") Integer rows, @Param("order") String order); + List> getAllGoods(@Param("start") Integer start, @Param("rows") Integer rows, @Param("order") String order); /** - * 获取猜你喜欢数据 + * 获取猜你喜欢数据 + * * @param start * @param rows * @return */ - List> getGuessLikeGoods(@Param("start") Integer start, @Param("rows") Integer rows, @Param("order") String order); + List> getGuessLikeGoods(@Param("start") Integer start, @Param("rows") Integer rows, @Param("order") String order); /** - * 获取分类精选数据 + * 获取分类精选数据 + * * @param start * @param rows * @return */ - List> getClassifiedSelectGoods(@Param("start") Integer start, @Param("rows") Integer rows); + List> getClassifiedSelectGoods(@Param("start") Integer start, @Param("rows") Integer rows); /** * 获取某个分类下的商品列表 + * * @param start * @param rows * @return */ - List> getTargrtGroupGoods(@Param("start") Integer start, @Param("rows") Integer rows,@Param("cid")String cid, @Param("order") String order); + List> getTargrtGroupGoods(@Param("start") Integer start, @Param("rows") Integer rows, @Param("cid") String cid, @Param("order") String order); /** * 获取某个分类下的商品列表总数 + * * @param start * @param rows * @return */ - List> getTargrtGroupGoodsCount(@Param("start") Integer start, @Param("rows") Integer rows,@Param("cid")String cid, @Param("order") String order); + List> getTargrtGroupGoodsCount(@Param("start") Integer start, @Param("rows") Integer rows, @Param("cid") String cid, @Param("order") String order); } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/mapper/ShopProductImageMapper.java b/src/main/java/com/hxtec/polaris/mapper/ShopProductImageMapper.java index 1edc7cbe572b7e94f5f9606462060b7236c59e5c..913c304cb8977de429840b9f437475bc0e897fa9 100644 --- a/src/main/java/com/hxtec/polaris/mapper/ShopProductImageMapper.java +++ b/src/main/java/com/hxtec/polaris/mapper/ShopProductImageMapper.java @@ -5,7 +5,7 @@ import tk.mybatis.mapper.MyMapper; /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ public interface ShopProductImageMapper extends MyMapper { } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/mapper/ShopProductSaleAttrMapper.java b/src/main/java/com/hxtec/polaris/mapper/ShopProductSaleAttrMapper.java index 173f954e5873c06b4d4994b81d8d49a5b21595c5..de8659773ecf5723457db83b7649c67d56e1251d 100644 --- a/src/main/java/com/hxtec/polaris/mapper/ShopProductSaleAttrMapper.java +++ b/src/main/java/com/hxtec/polaris/mapper/ShopProductSaleAttrMapper.java @@ -1,15 +1,12 @@ package com.hxtec.polaris.mapper; import com.hxtec.polaris.entity.ShopProductSaleAttr; -import org.apache.ibatis.annotations.Param; -import tk.mybatis.mapper.MyMapper; - -import java.util.List; +import org.apache.ibatis.annotations.Param;import tk.mybatis.mapper.MyMapper;import java.util.List; /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ public interface ShopProductSaleAttrMapper extends MyMapper { - List selectSpuSaleAttrListCheckBySku(@Param("spu") Integer spu, @Param("sku")Integer sku); + List selectSpuSaleAttrListCheckBySku(@Param("spu") Integer spu, @Param("sku") Integer sku); } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/mapper/ShopProductSaleAttrValueMapper.java b/src/main/java/com/hxtec/polaris/mapper/ShopProductSaleAttrValueMapper.java index f57ccee5e78d2d26f3066b5525471d2069d68ed2..40f8b642d0f7b574003248cd2fa7a56ec288303b 100644 --- a/src/main/java/com/hxtec/polaris/mapper/ShopProductSaleAttrValueMapper.java +++ b/src/main/java/com/hxtec/polaris/mapper/ShopProductSaleAttrValueMapper.java @@ -5,7 +5,7 @@ import tk.mybatis.mapper.MyMapper; /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ public interface ShopProductSaleAttrValueMapper extends MyMapper { } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/mapper/ShopProductVariantAttrValueMapper.java b/src/main/java/com/hxtec/polaris/mapper/ShopProductVariantAttrValueMapper.java index 52e31cef07b5cbc9a2ab6dd836f03f8b72b046f0..645e2e28aa0c8736dc23fc276479cfbb287f2fa5 100644 --- a/src/main/java/com/hxtec/polaris/mapper/ShopProductVariantAttrValueMapper.java +++ b/src/main/java/com/hxtec/polaris/mapper/ShopProductVariantAttrValueMapper.java @@ -1,11 +1,12 @@ package com.hxtec.polaris.mapper; import com.hxtec.polaris.entity.ShopProductVariantAttrValue; -import tk.mybatis.mapper.MyMapper; +import org.apache.ibatis.annotations.Param;import tk.mybatis.mapper.MyMapper;import java.util.List; /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ public interface ShopProductVariantAttrValueMapper extends MyMapper { + List selectSkuSaleAttrValueBySku(@Param("sku") Integer sku); } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/mapper/ShopProductVariantImageMapper.java b/src/main/java/com/hxtec/polaris/mapper/ShopProductVariantImageMapper.java index 26b84f31265bb00a364cad6c4ac4d0fbe88ad02b..cfb7951e59d6c0d991264120d50b0038588a292e 100644 --- a/src/main/java/com/hxtec/polaris/mapper/ShopProductVariantImageMapper.java +++ b/src/main/java/com/hxtec/polaris/mapper/ShopProductVariantImageMapper.java @@ -5,7 +5,7 @@ import tk.mybatis.mapper.MyMapper; /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ public interface ShopProductVariantImageMapper extends MyMapper { } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/mapper/ShopProductVariantMapper.java b/src/main/java/com/hxtec/polaris/mapper/ShopProductVariantMapper.java index fe0b616192712c64a454ecb2d7d98f378e68c93c..636985c222b45f6d47a81b132fb6911f2f23c57e 100644 --- a/src/main/java/com/hxtec/polaris/mapper/ShopProductVariantMapper.java +++ b/src/main/java/com/hxtec/polaris/mapper/ShopProductVariantMapper.java @@ -1,14 +1,11 @@ package com.hxtec.polaris.mapper; import com.hxtec.polaris.entity.ShopProductVariant; -import tk.mybatis.mapper.MyMapper; - -import java.util.List; -import java.util.Map; +import tk.mybatis.mapper.MyMapper;import java.util.List;import java.util.Map; /** * @author Caps - * @date 2019/11/17 + * @date 2019/11/29 */ public interface ShopProductVariantMapper extends MyMapper { Map getProductInfoBySku(Integer sku); diff --git a/src/main/java/com/hxtec/polaris/mapper/ShopStockMapper.java b/src/main/java/com/hxtec/polaris/mapper/ShopStockMapper.java index da10b7359fc0c5e4cc3b2f6cf85f976086d28ff7..97d08d7b74657c76b890c9b820438e4c0c36978d 100644 --- a/src/main/java/com/hxtec/polaris/mapper/ShopStockMapper.java +++ b/src/main/java/com/hxtec/polaris/mapper/ShopStockMapper.java @@ -5,7 +5,7 @@ import tk.mybatis.mapper.MyMapper; /** * @author Caps - * @date 2019/11/23 + * @date 2019/11/29 */ public interface ShopStockMapper extends MyMapper { } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/mapper/ShopUserMapper.java b/src/main/java/com/hxtec/polaris/mapper/ShopUserMapper.java index f2a21512a9710c95fc4970e962dfb6871cb90ef5..46c4766c7cd8d532712b1e63003aa2fc27574a9a 100644 --- a/src/main/java/com/hxtec/polaris/mapper/ShopUserMapper.java +++ b/src/main/java/com/hxtec/polaris/mapper/ShopUserMapper.java @@ -3,5 +3,9 @@ package com.hxtec.polaris.mapper; import com.hxtec.polaris.entity.ShopUser; import tk.mybatis.mapper.MyMapper; +/** + * @author Caps + * @date 2019/11/28 + */ public interface ShopUserMapper extends MyMapper { } \ No newline at end of file diff --git a/src/main/java/com/hxtec/polaris/service/ProductService.java b/src/main/java/com/hxtec/polaris/service/ProductService.java index 33231303180bf3e7e4e092c0665345acef6ce963..3a663fd5e2f3bd39c159d11f030854c582ed3d21 100644 --- a/src/main/java/com/hxtec/polaris/service/ProductService.java +++ b/src/main/java/com/hxtec/polaris/service/ProductService.java @@ -2,7 +2,10 @@ package com.hxtec.polaris.service; import com.hxtec.polaris.entity.ShopProductBase; import com.hxtec.polaris.entity.ShopProductSaleAttr; +import com.hxtec.polaris.entity.ShopProductSaleAttrValue; import com.hxtec.polaris.entity.ShopProductVariant; +import com.hxtec.polaris.entity.ShopProductVariantAttrValue; +import io.swagger.models.auth.In; import java.util.List; @@ -18,4 +21,7 @@ public interface ProductService { List getSkuSaleAttrValueListBySpu(Integer spu); ShopProductBase getSpuInfoBySpu(Integer spu); + + List getSkuSaleAttrValueBySku(Integer sku); + } diff --git a/src/main/java/com/hxtec/polaris/service/ShopOrderItemService.java b/src/main/java/com/hxtec/polaris/service/ShopOrderItemService.java new file mode 100644 index 0000000000000000000000000000000000000000..3338a961c0c9202b9e77c7baad8124c5ac78beb3 --- /dev/null +++ b/src/main/java/com/hxtec/polaris/service/ShopOrderItemService.java @@ -0,0 +1,10 @@ +package com.hxtec.polaris.service; + + /** + * @author Caps + * @date 2019/12/2 + */ +public interface ShopOrderItemService{ + + +} diff --git a/src/main/java/com/hxtec/polaris/service/ShopOrderService.java b/src/main/java/com/hxtec/polaris/service/ShopOrderService.java new file mode 100644 index 0000000000000000000000000000000000000000..97cd12cb9644f47675e493db5c864ca1162ec6b3 --- /dev/null +++ b/src/main/java/com/hxtec/polaris/service/ShopOrderService.java @@ -0,0 +1,10 @@ +package com.hxtec.polaris.service; + + /** + * @author Caps + * @date 2019/12/2 + */ +public interface ShopOrderService{ + + +} diff --git a/src/main/java/com/hxtec/polaris/service/StockService.java b/src/main/java/com/hxtec/polaris/service/StockService.java index 300d4d3adbe5bcfcf22dd4cef2dccd6aebd5bf3a..40a8cdf96ae7f1fdda7f09f573f7e0ab26748a9b 100644 --- a/src/main/java/com/hxtec/polaris/service/StockService.java +++ b/src/main/java/com/hxtec/polaris/service/StockService.java @@ -7,7 +7,7 @@ import com.hxtec.polaris.entity.ShopStock; * @date 2019/11/23 */ public interface StockService { - ShopStock getStockInfoBuSku(Integer sku); + ShopStock getStockInfoBuSku(int sku); void updateStockInfoBySku(int sku); } diff --git a/src/main/java/com/hxtec/polaris/service/impl/CartItemServiceImpl.java b/src/main/java/com/hxtec/polaris/service/impl/CartItemServiceImpl.java index 8c19f769adfd2369cc4b6c219ac6b4f40fcf9844..1238771b0fee7297da6fa5c10c053fdbbf23bc35 100644 --- a/src/main/java/com/hxtec/polaris/service/impl/CartItemServiceImpl.java +++ b/src/main/java/com/hxtec/polaris/service/impl/CartItemServiceImpl.java @@ -1,13 +1,15 @@ package com.hxtec.polaris.service.impl; +import com.hxtec.polaris.commons.MapperUtils; import com.hxtec.polaris.commons.contants.CommonContants; import com.hxtec.polaris.entity.ShopCartItem; import com.hxtec.polaris.entity.ShopProductBase; import com.hxtec.polaris.entity.ShopProductVariant; +import com.hxtec.polaris.entity.ShopProductVariantAttrValue; +import com.hxtec.polaris.entity.ShopStock; import com.hxtec.polaris.entity.ShopUser; -import com.hxtec.polaris.mapper.ShopCartItemMapper; -import com.hxtec.polaris.service.CartItemService; import com.hxtec.polaris.service.ProductService; +import com.hxtec.polaris.service.StockService; import com.hxtec.polaris.service.UserService; import org.apache.commons.lang3.StringUtils; import org.springframework.security.core.context.SecurityContextHolder; @@ -17,6 +19,7 @@ import tk.mybatis.mapper.entity.Example; import javax.annotation.Resource; import java.util.*; + /** * @author Caps * @date 2019/11/25 @@ -34,9 +37,13 @@ public class CartItemServiceImpl implements CartItemService { @Resource private UserService userService; + @Resource + private StockService stockService; + @Override public Map addTocart(int sku, int quantity) { - String phone = this.getUser(); +// String phone = this.getUser(); + String phone="12345678900"; Map map=new HashMap<>(); //未登录 if(StringUtils.equals("anonymousUser",phone)){ @@ -46,6 +53,13 @@ public class CartItemServiceImpl implements CartItemService { } ShopProductVariant skuInfo = productService.getSkuProductBySku(sku); ShopProductBase spuInfo=productService.getSpuInfoBySpu(skuInfo.getSpu()); + List skuSaleAttrValueBySku = productService.getSkuSaleAttrValueBySku(sku); + StringBuilder skuSaleAttr= new StringBuilder(); + for (ShopProductVariantAttrValue variantAttrValue : skuSaleAttrValueBySku) { + String skuSale = variantAttrValue.getSaleAttrName() +":"+ variantAttrValue.getSaleAttrValueName() + "|"; + skuSaleAttr.append(skuSale); + } + String substring = skuSaleAttr.substring(0, skuSaleAttr.length() - 1); ShopCartItem cartItem= ShopCartItem.builder() .quantity(quantity) .createTime(new Date()) @@ -57,8 +71,10 @@ public class CartItemServiceImpl implements CartItemService { .productSkuId(skuInfo.getSku()) .productPic(skuInfo.getImage()) .productSubTitle(skuInfo.getDescription()) - .productAttr("1111111").build(); + .productAttr(substring).build(); + ShopStock stockInfo = stockService.getStockInfoBuSku(skuInfo.getSku()); + cartItem.setStock(stockInfo.getAvailable()); if (StringUtils.isNotEmpty(skuInfo.getDiscount())){ cartItem.setPrice(skuInfo.getDiscountPrice()); } @@ -68,7 +84,7 @@ public class CartItemServiceImpl implements CartItemService { ShopUser userInfo=userService.getUserInfoByPhone(phone); ShopCartItem shopCartItem=this.ifCartExistByUser(userInfo.getId(),sku); - int i; + Integer i; if(null ==shopCartItem){ //沒有加过 cartItem.setMemberId(userInfo.getId()); @@ -77,9 +93,14 @@ public class CartItemServiceImpl implements CartItemService { } else { shopCartItem.setQuantity(shopCartItem.getQuantity()+quantity); - i=this.updateCart(cartItem); + i=this.updateCart(shopCartItem); + } + if(i.equals(1)){ + map.put(CommonContants.STATUS,"success"); + } + else { + map.put(CommonContants.STATUS,"updateError"); } - map.put(CommonContants.STATUS,"success"); map.put(CommonContants.COUNTS,i); return map; } @@ -90,17 +111,21 @@ public class CartItemServiceImpl implements CartItemService { */ @Override public List getCartList() { +/* String phone = this.getUser(); +*/ + String phone="12345678900"; List cartList=new ArrayList<>(); if(!StringUtils.equals("anonymousUser",phone)){ - ShopCartItem cartItem=new ShopCartItem(); ShopUser userInfo=userService.getUserInfoByPhone(phone); - cartItem.setMemberId(userInfo.getId()); - cartList = cartItemMapper.select(cartItem); + Example example=new Example(ShopCartItem.class); + example.createCriteria().andEqualTo("memberId",userInfo.getId()); + cartList = cartItemMapper.selectByExample(example); } return cartList; } + private String getUser(){ return SecurityContextHolder.getContext().getAuthentication().getName(); } @@ -128,5 +153,24 @@ public class CartItemServiceImpl implements CartItemService { example.createCriteria().andEqualTo("id",cartItem.getId()); return cartItemMapper.updateByExampleSelective(cartItem,example); } + + + /** + * 当前购物车数据库是否存在 + * @param shopCartItems + * @param cartItem + * @return + */ + private boolean if_cart_exist(List shopCartItems, ShopCartItem cartItem) { + boolean flag = false; + for (ShopCartItem shopCartItem : shopCartItems) { + Integer productSkuId = shopCartItem.getProductSkuId(); + + if (productSkuId.equals(cartItem.getProductSkuId())) { + flag = true; + } + } + return flag; + } } diff --git a/src/main/java/com/hxtec/polaris/service/impl/ProductServiceImpl.java b/src/main/java/com/hxtec/polaris/service/impl/ProductServiceImpl.java index 185415972507448cc1cd9f1b54da1c971a0758d3..0ca185b74045cbe746f041366f2bed17e157940b 100644 --- a/src/main/java/com/hxtec/polaris/service/impl/ProductServiceImpl.java +++ b/src/main/java/com/hxtec/polaris/service/impl/ProductServiceImpl.java @@ -2,9 +2,14 @@ package com.hxtec.polaris.service.impl; import com.hxtec.polaris.entity.ShopProductBase; import com.hxtec.polaris.entity.ShopProductSaleAttr; +import com.hxtec.polaris.entity.ShopProductSaleAttrValue; import com.hxtec.polaris.entity.ShopProductVariant; +import com.hxtec.polaris.entity.ShopProductVariantAttrValue; import com.hxtec.polaris.entity.ShopProductVariantImage; +import com.hxtec.polaris.mapper.ShopProductBaseMapper; import com.hxtec.polaris.mapper.ShopProductSaleAttrMapper; +import com.hxtec.polaris.mapper.ShopProductSaleAttrValueMapper; +import com.hxtec.polaris.mapper.ShopProductVariantAttrValueMapper; import com.hxtec.polaris.mapper.ShopProductVariantImageMapper; import com.hxtec.polaris.mapper.ShopProductVariantMapper; import com.hxtec.polaris.service.ProductService; @@ -22,7 +27,10 @@ import java.util.List; public class ProductServiceImpl implements ProductService { @Autowired - private ShopProductVariantMapper productMapper; + private ShopProductVariantMapper skuMapper; + + @Autowired + private ShopProductBaseMapper spumapper; @Autowired private ShopProductSaleAttrMapper productSaleAttrMapper; @@ -30,9 +38,12 @@ public class ProductServiceImpl implements ProductService { @Autowired private ShopProductVariantImageMapper imageMapper; + @Autowired + private ShopProductVariantAttrValueMapper variantAttrValueMapper; + @Override public ShopProductVariant getSkuProductBySku(Integer sku) { - ShopProductVariant shopProductVariant = productMapper.selectByPrimaryKey(sku); + ShopProductVariant shopProductVariant = skuMapper.selectByPrimaryKey(sku); Example example=new Example(ShopProductVariantImage.class); example.createCriteria().andEqualTo("skuId",sku); List shopProductVariantImages = imageMapper.selectByExample(example); @@ -48,11 +59,16 @@ public class ProductServiceImpl implements ProductService { @Override public List getSkuSaleAttrValueListBySpu(Integer spu) { - return productMapper.selectSkuSaleAttrValueListBySpu(spu); + return skuMapper.selectSkuSaleAttrValueListBySpu(spu); } @Override public ShopProductBase getSpuInfoBySpu(Integer spu) { - return null; + return spumapper.selectByPrimaryKey(spu); + } + + @Override + public List getSkuSaleAttrValueBySku(Integer sku) { + return variantAttrValueMapper.selectSkuSaleAttrValueBySku(sku); } } diff --git a/src/main/java/com/hxtec/polaris/service/impl/ShopOrderItemServiceImpl.java b/src/main/java/com/hxtec/polaris/service/impl/ShopOrderItemServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..4788dd07060009206f7b77c9ccf73a226f6b442b --- /dev/null +++ b/src/main/java/com/hxtec/polaris/service/impl/ShopOrderItemServiceImpl.java @@ -0,0 +1,17 @@ +package com.hxtec.polaris.service.impl; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import com.hxtec.polaris.mapper.ShopOrderItemMapper; +import com.hxtec.polaris.service.ShopOrderItemService; +/** + * @author Caps + * @date 2019/12/2 + */ +@Service +public class ShopOrderItemServiceImpl implements ShopOrderItemService{ + + @Resource + private ShopOrderItemMapper shopOrderItemMapper; + +} diff --git a/src/main/java/com/hxtec/polaris/service/impl/ShopOrderServiceImpl.java b/src/main/java/com/hxtec/polaris/service/impl/ShopOrderServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..4dd909b7c83b091a662d4fc22c8929d9170497f1 --- /dev/null +++ b/src/main/java/com/hxtec/polaris/service/impl/ShopOrderServiceImpl.java @@ -0,0 +1,17 @@ +package com.hxtec.polaris.service.impl; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import com.hxtec.polaris.mapper.ShopOrderMapper; +import com.hxtec.polaris.service.ShopOrderService; +/** + * @author Caps + * @date 2019/12/2 + */ +@Service +public class ShopOrderServiceImpl implements ShopOrderService{ + + @Resource + private ShopOrderMapper shopOrderMapper; + +} diff --git a/src/main/java/com/hxtec/polaris/service/impl/StockServiceImpl.java b/src/main/java/com/hxtec/polaris/service/impl/StockServiceImpl.java index 6a6082e2049912b66663e265e16d86f22d7b3c48..50028c532982d2725077a4d5cbe4c576f22d1175 100644 --- a/src/main/java/com/hxtec/polaris/service/impl/StockServiceImpl.java +++ b/src/main/java/com/hxtec/polaris/service/impl/StockServiceImpl.java @@ -21,7 +21,7 @@ public class StockServiceImpl implements StockService { * @return */ @Override - public ShopStock getStockInfoBuSku(Integer sku) { + public ShopStock getStockInfoBuSku(int sku) { ShopStock shopStock=new ShopStock(); shopStock.setSku(sku); return shopStockMapper.selectOne(shopStock); diff --git a/src/main/java/com/hxtec/polaris/service/impl/UserServiceImpl.java b/src/main/java/com/hxtec/polaris/service/impl/UserServiceImpl.java index 93459e337f9f09040b9552b3b9ea3566fdcb5c46..245d6cefd19b6e9188e925add88ca0c7a17b34e2 100644 --- a/src/main/java/com/hxtec/polaris/service/impl/UserServiceImpl.java +++ b/src/main/java/com/hxtec/polaris/service/impl/UserServiceImpl.java @@ -44,6 +44,13 @@ public class UserServiceImpl implements UserService { userRepository.save(user); } + @Override + public ShopUser getUserInfoByPhone(String phone) { + Example example=new Example(ShopUser.class); + example.createCriteria().andEqualTo("mobile",phone); + return shopUserMapper.selectOneByExample(example); + } + @Override @Cacheable(value = "verifyCode") public int verify(String number) { diff --git a/src/main/resources/mapper/ShopCartItemMapper.xml b/src/main/resources/mapper/ShopCartItemMapper.xml index ccc0c17d3c1fbefa802a79c148c9e2c517b84670..101fb8f62a2fcd77921f78ab88155504d97db892 100644 --- a/src/main/resources/mapper/ShopCartItemMapper.xml +++ b/src/main/resources/mapper/ShopCartItemMapper.xml @@ -2,26 +2,27 @@ - + - - - + + + + - + - - id, product_id, product_sku_id, member_id, quantity, price, product_pic, product_name, + + id, product_id, product_sku_id, member_id, quantity, price, product_pic, stock, product_name, product_sub_title, member_nickname, create_time, update_time, delete_status, product_category_id, product_attr diff --git a/src/main/resources/mapper/ShopOrderDetailMapper.xml b/src/main/resources/mapper/ShopOrderDetailMapper.xml deleted file mode 100644 index 977f3f14aa406c567fc77f59ba1c69ba2803c2c0..0000000000000000000000000000000000000000 --- a/src/main/resources/mapper/ShopOrderDetailMapper.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/mapper/ShopOrderItemMapper.xml b/src/main/resources/mapper/ShopOrderItemMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..6cb9bf779bafd641940c8029532db9ab5acd0fd5 --- /dev/null +++ b/src/main/resources/mapper/ShopOrderItemMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + id, order_id, product_id, product_pic, product_name, product_introduce, product_price, + product_quantity, product_sku_id, product_category_id, product_attr, weight, is_delete + + \ No newline at end of file diff --git a/src/main/resources/mapper/ShopOrderMapper.xml b/src/main/resources/mapper/ShopOrderMapper.xml index 400bb88b88c7ac0e7bb75ac6bfa7c23d8f5a67c9..f7e24855727efaf883048ccfbad9830de7372557 100644 --- a/src/main/resources/mapper/ShopOrderMapper.xml +++ b/src/main/resources/mapper/ShopOrderMapper.xml @@ -2,26 +2,35 @@ - - - + + + + - + + + + + + + - - - - - + + + + + id, member_id, order_code, total_price, freight_amount, pay_type, pay_amount, `state`, + is_delete, delivery_company, delivery_code, receiver_name, receiver_phone, receiver_post_code, + province, city, region, address_detail, create_time, update_time, auto_confirm_day, + confirm_status + \ No newline at end of file diff --git a/src/main/resources/mapper/ShopProductBaseMapper.xml b/src/main/resources/mapper/ShopProductBaseMapper.xml index cf1db9c2544b134dff74e355cf6bce1f06f39e0a..700df65314191027eac3e964ef5e94dc18da4c52 100644 --- a/src/main/resources/mapper/ShopProductBaseMapper.xml +++ b/src/main/resources/mapper/ShopProductBaseMapper.xml @@ -2,22 +2,25 @@ - - - + + + + - + + + spu, category_id, `name`, detail, create_time, update_time, weight, comment1, comment2, + comment3 + - + pb.spu,pb.comment2,pb.category_id,pb.name,pv.image,pv.price,pv.sku @@ -28,20 +31,20 @@ left join shop_product_base pb on pv.spu=pb.spu group by pb.spu - + order by pb.weight desc - + order by pb.comment2*1 desc - + order by pv.price asc - + order by pv.price desc - + limit #{start},#{rows} @@ -54,21 +57,21 @@ group by pb.spu order by - + pb.weight desc, - + pb.comment2*1 desc, - + pv.price asc, - + pv.price desc, pb.weight desc - + limit #{start},#{rows} @@ -87,7 +90,7 @@ ORDER BY pb.weight DESC ) aa GROUP BY aa.category_id - + limit #{start},#{rows} @@ -105,21 +108,21 @@ group by pb.spu order by - + pb.weight desc, - + pb.comment2*1 desc, - + pv.price asc, - + pv.price desc, pb.weight desc - + limit #{start},#{rows} @@ -137,16 +140,16 @@ group by pb.spu order by - + pb.weight desc, - + pb.comment2*1 desc, - + pv.price asc, - + pv.price desc, diff --git a/src/main/resources/mapper/ShopProductImageMapper.xml b/src/main/resources/mapper/ShopProductImageMapper.xml index a193148b6fbf971f5de692e3312a896562e46d3b..9b5b321eb58268ddd650b0905e7686997738fb61 100644 --- a/src/main/resources/mapper/ShopProductImageMapper.xml +++ b/src/main/resources/mapper/ShopProductImageMapper.xml @@ -2,14 +2,14 @@ - - - + + + - + id, product_id, img_name, img_url \ No newline at end of file diff --git a/src/main/resources/mapper/ShopProductSaleAttrMapper.xml b/src/main/resources/mapper/ShopProductSaleAttrMapper.xml index 790d3399fa397e68253d45b8775e350e7aaa298d..1f8c9c7802060935dbe918aff70bc49d46bd6ac6 100644 --- a/src/main/resources/mapper/ShopProductSaleAttrMapper.xml +++ b/src/main/resources/mapper/ShopProductSaleAttrMapper.xml @@ -2,14 +2,14 @@ - - - - + + + + - + id, product_id, sale_attr_id, sale_attr_name @@ -29,10 +29,10 @@ - - - - + + + + diff --git a/src/main/resources/mapper/ShopProductSaleAttrValueMapper.xml b/src/main/resources/mapper/ShopProductSaleAttrValueMapper.xml index e2133141ceee7a50ba870e8a5c5c1e865ddf3127..0f18d833212175001954cbfffe18b202571f7d0c 100644 --- a/src/main/resources/mapper/ShopProductSaleAttrValueMapper.xml +++ b/src/main/resources/mapper/ShopProductSaleAttrValueMapper.xml @@ -2,14 +2,14 @@ - + - - + + - + id, product_id, sale_attr_id, sale_attr_value_name \ No newline at end of file diff --git a/src/main/resources/mapper/ShopProductVariantAttrValueMapper.xml b/src/main/resources/mapper/ShopProductVariantAttrValueMapper.xml index 3acd086c7f234692c67345a1057ce901bc8e6c8a..11316db70d29f3fa11f6565b76c0ef192474338b 100644 --- a/src/main/resources/mapper/ShopProductVariantAttrValueMapper.xml +++ b/src/main/resources/mapper/ShopProductVariantAttrValueMapper.xml @@ -2,14 +2,26 @@ - - - + + + - + + + - - id, attr_id, value_id, sku_id + + id, attr_id, value_id, sku_id, sale_attr_name, sale_attr_value_name + + \ No newline at end of file diff --git a/src/main/resources/mapper/ShopProductVariantImageMapper.xml b/src/main/resources/mapper/ShopProductVariantImageMapper.xml index 3ce6729ef4ba5e3ff0eefb0efb8fb0c544be6e94..4f4fc6eb58a074c00e62eb5967b8e29a0e8223e8 100644 --- a/src/main/resources/mapper/ShopProductVariantImageMapper.xml +++ b/src/main/resources/mapper/ShopProductVariantImageMapper.xml @@ -2,16 +2,16 @@ - - - + + + - + - + id, sku_id, img_name, img_url, product_img_id, is_default \ No newline at end of file diff --git a/src/main/resources/mapper/ShopProductVariantMapper.xml b/src/main/resources/mapper/ShopProductVariantMapper.xml index 6fb7f045ba3ff8401dae47339f83586ae5f22f81..f65184d60315d47d242ed4ffb1b12484043261ff 100644 --- a/src/main/resources/mapper/ShopProductVariantMapper.xml +++ b/src/main/resources/mapper/ShopProductVariantMapper.xml @@ -2,13 +2,12 @@ - - - - + + + + + @@ -20,7 +19,6 @@ - sp.`name`,sp.detail,sv.sku,sv.media_container_code as containerCode,sv.price,sv.image,sv.state,sv.attribute_name as attributeName,sv.description, sv.comment1,sv.comment2,sv.comment3 @@ -39,18 +37,19 @@ + diff --git a/src/main/resources/mapper/ShopStockMapper.xml b/src/main/resources/mapper/ShopStockMapper.xml index 26ba4b45a5ed5db2af599a965d47bffd8e3320c1..bea7986248a0bcfab512480a1e05e42135488f1e 100644 --- a/src/main/resources/mapper/ShopStockMapper.xml +++ b/src/main/resources/mapper/ShopStockMapper.xml @@ -2,9 +2,9 @@ - - - + + + @@ -14,7 +14,7 @@ - + id, sku, available, `lock`, create_time, update_time, comment1, comment2, comment3 \ No newline at end of file diff --git a/src/main/resources/mapper/ShopUserMapper.xml b/src/main/resources/mapper/ShopUserMapper.xml index f53dc77a02475fe61b548e71fef2f9291042e78b..3d7a470250fc0bea1564d0e0e112e9d7f7c73156 100644 --- a/src/main/resources/mapper/ShopUserMapper.xml +++ b/src/main/resources/mapper/ShopUserMapper.xml @@ -2,9 +2,7 @@ - + @@ -22,4 +20,9 @@ + + + id, wx_id, mobile, username, nickname, portrait, `password`, gender, create_time, + update_time, birthday, `state`, is_delete, comment1, comment2, comment3 + \ No newline at end of file