dev798
parent
217b0e6c87
commit
c3107b22be
|
@ -1,52 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:49
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "Brand",description = "品牌表")
|
||||
public class Brand extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String brandName;
|
||||
|
||||
@ApiModelProperty(value = "首字母")
|
||||
private String firstLetter;
|
||||
|
||||
@ApiModelProperty(value = "排序 0靠后")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "是否为品牌制造商:0-不是;1-是")
|
||||
private Integer factoryStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否显示 :0-不显示;1-显示")
|
||||
private Integer showStatus;
|
||||
|
||||
@ApiModelProperty(value = "产品数量")
|
||||
private Integer productCount;
|
||||
|
||||
@ApiModelProperty(value = "产品评论数量")
|
||||
private Integer productCommentCount;
|
||||
|
||||
@ApiModelProperty(value = "品牌logo")
|
||||
private String logo;
|
||||
|
||||
@ApiModelProperty(value = "专区大图")
|
||||
private String bigPic;
|
||||
|
||||
@ApiModelProperty(value = "品牌故事")
|
||||
private String brandStory;
|
||||
|
||||
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:50
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "Category", description = "商品分类信息")
|
||||
public class Category extends BaseEntity {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "上级分类的编号:0表示一级分类")
|
||||
private Integer parentId;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String categoryName;
|
||||
|
||||
@ApiModelProperty(value = "分类级别:0->1级;1->2级")
|
||||
private Integer level;
|
||||
|
||||
@ApiModelProperty(value = "商品数量")
|
||||
private Integer productCount;
|
||||
|
||||
@ApiModelProperty(value = "商品单位")
|
||||
private String productUnit;
|
||||
|
||||
@ApiModelProperty(value = "是否显示在导航栏:0->不显示;1->显示")
|
||||
private Integer navStatus;
|
||||
|
||||
@ApiModelProperty(value = "显示状态:0->不显示;1->显示")
|
||||
private Integer showStatus;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "图标")
|
||||
private String icon;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keywords;
|
||||
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String description;
|
||||
|
||||
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:53
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "Images", description = "产品图片信息")
|
||||
public class Images extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "图片ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "产品ID")
|
||||
private Integer productId;
|
||||
|
||||
@ApiModelProperty(value = "图片URL")
|
||||
private String imagesUrl;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:53
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "Ladder", description = "阶梯信息")
|
||||
public class Ladder extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "阶梯ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "阶梯数量")
|
||||
private Integer ladderNum;
|
||||
|
||||
@ApiModelProperty(value = "阶梯折扣")
|
||||
private Double ladderDiscount;
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:55
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "Member", description = "会员信息")
|
||||
public class Member extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "会员ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "黄金会员折扣")
|
||||
private Double memberGold;
|
||||
|
||||
@ApiModelProperty(value = "白金会员折扣")
|
||||
private Double memberSilver;
|
||||
|
||||
@ApiModelProperty(value = "钻石会员折扣")
|
||||
private Double memberDiamond;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:55
|
||||
*/
|
||||
public enum Number {
|
||||
|
||||
/** 0 **/
|
||||
zero("0"),
|
||||
/** 1 **/
|
||||
one("1"),
|
||||
/** 2 **/
|
||||
two("2"),
|
||||
/** 3 **/
|
||||
three("3"),
|
||||
/** 4 **/
|
||||
four("4");
|
||||
private String value;
|
||||
|
||||
private Number(String value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:56
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "Preference", description = "特惠信息")
|
||||
public class Preference extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "特惠ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "特惠开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date preferenceStartTime;
|
||||
|
||||
@ApiModelProperty(value = "特惠结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date preferenceEndTime;
|
||||
|
||||
@ApiModelProperty(value = "促销价格")
|
||||
private Double preferencePrice;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:56
|
||||
*/
|
||||
@ApiModel(value = "Price", description = "价格信息")
|
||||
@Data
|
||||
public class Price extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "价格ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "价格最大值")
|
||||
private Double priceMax;
|
||||
|
||||
@ApiModelProperty(value = "价格减免")
|
||||
private Double priceReduction;
|
||||
}
|
|
@ -1,114 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:57
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(description = "产品实体类")
|
||||
public class Product extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "名称",required = true)
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String productName;
|
||||
|
||||
@ApiModelProperty(value = "货号",required = true)
|
||||
@NotNull(message = "货号不能为空")
|
||||
private String productNumber;
|
||||
|
||||
@ApiModelProperty(value = "审核状态 (1:通过, 2:驳回)")
|
||||
private Integer productExamine;
|
||||
|
||||
@ApiModelProperty(value = "分类",required = true)
|
||||
@NotNull(message = "分类不能不选择")
|
||||
private Integer categoryId;
|
||||
|
||||
@ApiModelProperty(value = "品牌",required = true)
|
||||
@NotNull(message = "品牌不能不选择")
|
||||
private Integer brandId;
|
||||
|
||||
@ApiModelProperty(value = "商品类型",required = true)
|
||||
private Integer typeId;
|
||||
|
||||
@ApiModelProperty(value = "副标题")
|
||||
private String productSubheading;
|
||||
|
||||
@ApiModelProperty(value = "商品介绍")
|
||||
private String productInformation;
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String productUnit;
|
||||
|
||||
@ApiModelProperty(value = "重量")
|
||||
private Double productWeight;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer productSort;
|
||||
|
||||
@ApiModelProperty(value = "市场价")
|
||||
private Integer marketPrice;
|
||||
|
||||
@ApiModelProperty(value = "积分")
|
||||
private Integer productPoints;
|
||||
|
||||
@ApiModelProperty(value = "成长值")
|
||||
private Integer productGrowth;
|
||||
|
||||
@ApiModelProperty(value = "最大积分值")
|
||||
private Integer productMaxPoints;
|
||||
|
||||
@ApiModelProperty(value = "预告商品 (1:是, 2:否)")
|
||||
private Integer productForeknow;
|
||||
|
||||
@ApiModelProperty(value = "上下架状态 (1:上架, 2:下架)")
|
||||
private Integer productStatus;
|
||||
|
||||
@ApiModelProperty(value = "新品 (1:是, 2:否)")
|
||||
private Integer productNew;
|
||||
|
||||
@ApiModelProperty(value = "推荐 (1:是, 2:否)")
|
||||
private Integer productRecommended;
|
||||
|
||||
@ApiModelProperty(value = "详情标题")
|
||||
private String detailsTitle;
|
||||
|
||||
@ApiModelProperty(value = "详情描述")
|
||||
private String detailsInformation;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String detailsKeyWord;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String detailsRemark;
|
||||
|
||||
@ApiModelProperty(value = "优惠方法")
|
||||
@NotNull(message = "优惠方式不能不选择")
|
||||
private Integer methodType;
|
||||
|
||||
@ApiModelProperty(value = "优惠Id")
|
||||
private Integer methodId;
|
||||
|
||||
@ApiModelProperty(value = "移动端信息")
|
||||
private String moveInformation;
|
||||
|
||||
@ApiModelProperty(value = "PC端信息")
|
||||
private String pcInformation;
|
||||
|
||||
private Integer sales;
|
||||
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:57
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "ProductSku", description = "商品SKU信息")
|
||||
public class ProductSku extends HashMap {
|
||||
|
||||
@ApiModelProperty(value = "SKUId",required = true)
|
||||
private long id;
|
||||
|
||||
@ApiModelProperty(value = "销售价格",required = true)
|
||||
private Double salePrice;
|
||||
|
||||
@ApiModelProperty(value = "促销价格",required = true)
|
||||
private Double promotionPrice;
|
||||
|
||||
@ApiModelProperty(value = "库存",required = true)
|
||||
private Integer stock;
|
||||
|
||||
@ApiModelProperty(value = "预警库存",required = true)
|
||||
private Integer stockAlert;
|
||||
|
||||
@ApiModelProperty(value = "商品Id")
|
||||
private Integer productId;
|
||||
|
||||
@ApiModelProperty(value = "SKU背景图地址")
|
||||
private String bgImg;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty(value= "创建时间")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private String updateTime;
|
||||
|
||||
@ApiModelProperty(value = "是否删除 0-是 1-否")
|
||||
private int isDelete;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:58
|
||||
*/
|
||||
@ApiModel(value = "ProductSkuAttr", description = "产品SKU属性信息")
|
||||
@Data
|
||||
public class ProductSkuAttr extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "SKU ID")
|
||||
private long skuId;
|
||||
|
||||
@ApiModelProperty(value = "属性ID")
|
||||
private Integer attrId;
|
||||
|
||||
@ApiModelProperty(value = "属性值ID")
|
||||
private Integer attrValueId;
|
||||
|
||||
@ApiModelProperty(value = "手工录入属性值")
|
||||
private String attrValue;
|
||||
|
||||
@ApiModelProperty(value = "类型:0-属性,1-参数")
|
||||
private Integer flag;
|
||||
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/3 10:54
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "ProductType")
|
||||
public class ProductType extends BaseEntity {
|
||||
|
||||
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(name = "类型名称" ,value = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:58
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "ProductTypeAttr", description = "产品类型属性信息")
|
||||
public class ProductTypeAttr extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商品类型ID")
|
||||
private Integer productTypeId;
|
||||
|
||||
@ApiModelProperty(value = "属性名称")
|
||||
private String attrName;
|
||||
|
||||
@ApiModelProperty(value = "是否支持多选:0-是,1-否")
|
||||
private Integer multipleChoice;
|
||||
|
||||
@ApiModelProperty(value = "录入方式:0-列表选择,1-手动")
|
||||
private Integer inputMethod;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "分类标识:0-属性,1-参数")
|
||||
private Integer flag;
|
||||
|
||||
@ApiModelProperty(value = "筛选:0-普通,1-颜色")
|
||||
private Integer screen;
|
||||
|
||||
@ApiModelProperty(value = "检索:1-不需要,2-关键字,3-范围检索")
|
||||
private Integer search;
|
||||
|
||||
@ApiModelProperty(value = "商品属性关联:1-是,2-否")
|
||||
private Integer association;
|
||||
|
||||
@ApiModelProperty(value = "属性是否可选:1-唯一,2-单选,3-复选")
|
||||
private Integer stats;
|
||||
|
||||
@ApiModelProperty(value = "属性值的录入方式:1-手工录入,2-从列表中选择")
|
||||
private Integer input;
|
||||
|
||||
@ApiModelProperty(value = "属性值可选值列表")
|
||||
private String selection;
|
||||
|
||||
@ApiModelProperty(value = "手动新增:0-是,1-否")
|
||||
private Integer manualOperation;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "类型集合")
|
||||
private List<TypeAttrs> typeAttrs;
|
||||
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:59
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "ProductTypeAttrValue", description = "产品类型属性值信息")
|
||||
public class ProductTypeAttrValue extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "属性ID")
|
||||
private Integer typeAttrId;
|
||||
|
||||
@ApiModelProperty(value = "属性值详情")
|
||||
private String typeAttrValue;
|
||||
|
||||
@ApiModelProperty(value = "录入方式:0-自动,1-手动")
|
||||
private Integer inputMethod;
|
||||
|
||||
|
||||
// 添加集合属性及其getter方法
|
||||
private List<ProductTypeAttrValue> productTypeAttrValueList;
|
||||
|
||||
public List<ProductTypeAttrValue> getProductTypeAttrValueList() {
|
||||
return productTypeAttrValueList;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 16:59
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "ServiceMiddle", description = "服务与商品关联信息")
|
||||
public class ServiceMiddle extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "Id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商品Id")
|
||||
private Integer productId;
|
||||
|
||||
@ApiModelProperty(value = "服务Id")
|
||||
private Integer serviceId;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:00
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "Services", description = "服务信息")
|
||||
public class Services extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "服务Id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "服务名称")
|
||||
private String serviceName;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/3 10:56
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "TypeAttrs")
|
||||
public class TypeAttrs extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "Id")
|
||||
private Integer typeAttrValueId;
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String typeAttrValueName;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package com.muyu.product.domain.DTO;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:01
|
||||
*/
|
||||
public class ValidationResult {
|
||||
|
||||
private boolean isValid;
|
||||
private String errorMessage;
|
||||
|
||||
public ValidationResult(boolean isValid, String errorMessage) {
|
||||
this.isValid = isValid;
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return isValid;
|
||||
}
|
||||
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
|
@ -1,890 +0,0 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PmsSkuStockExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public PmsSkuStockExample() {
|
||||
oredCriteria = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Long value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Long value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Long value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Long value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Long> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Long> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProductIdIsNull() {
|
||||
addCriterion("product_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProductIdIsNotNull() {
|
||||
addCriterion("product_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProductIdEqualTo(Long value) {
|
||||
addCriterion("product_id =", value, "productId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProductIdNotEqualTo(Long value) {
|
||||
addCriterion("product_id <>", value, "productId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProductIdGreaterThan(Long value) {
|
||||
addCriterion("product_id >", value, "productId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProductIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("product_id >=", value, "productId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProductIdLessThan(Long value) {
|
||||
addCriterion("product_id <", value, "productId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProductIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("product_id <=", value, "productId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProductIdIn(List<Long> values) {
|
||||
addCriterion("product_id in", values, "productId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProductIdNotIn(List<Long> values) {
|
||||
addCriterion("product_id not in", values, "productId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProductIdBetween(Long value1, Long value2) {
|
||||
addCriterion("product_id between", value1, value2, "productId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProductIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("product_id not between", value1, value2, "productId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeIsNull() {
|
||||
addCriterion("sku_code is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeIsNotNull() {
|
||||
addCriterion("sku_code is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeEqualTo(String value) {
|
||||
addCriterion("sku_code =", value, "skuCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeNotEqualTo(String value) {
|
||||
addCriterion("sku_code <>", value, "skuCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeGreaterThan(String value) {
|
||||
addCriterion("sku_code >", value, "skuCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("sku_code >=", value, "skuCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeLessThan(String value) {
|
||||
addCriterion("sku_code <", value, "skuCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeLessThanOrEqualTo(String value) {
|
||||
addCriterion("sku_code <=", value, "skuCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeLike(String value) {
|
||||
addCriterion("sku_code like", value, "skuCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeNotLike(String value) {
|
||||
addCriterion("sku_code not like", value, "skuCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeIn(List<String> values) {
|
||||
addCriterion("sku_code in", values, "skuCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeNotIn(List<String> values) {
|
||||
addCriterion("sku_code not in", values, "skuCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeBetween(String value1, String value2) {
|
||||
addCriterion("sku_code between", value1, value2, "skuCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSkuCodeNotBetween(String value1, String value2) {
|
||||
addCriterion("sku_code not between", value1, value2, "skuCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceIsNull() {
|
||||
addCriterion("price is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceIsNotNull() {
|
||||
addCriterion("price is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceEqualTo(BigDecimal value) {
|
||||
addCriterion("price =", value, "price");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceNotEqualTo(BigDecimal value) {
|
||||
addCriterion("price <>", value, "price");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceGreaterThan(BigDecimal value) {
|
||||
addCriterion("price >", value, "price");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceGreaterThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("price >=", value, "price");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLessThan(BigDecimal value) {
|
||||
addCriterion("price <", value, "price");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLessThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("price <=", value, "price");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceIn(List<BigDecimal> values) {
|
||||
addCriterion("price in", values, "price");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceNotIn(List<BigDecimal> values) {
|
||||
addCriterion("price not in", values, "price");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("price between", value1, value2, "price");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceNotBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("price not between", value1, value2, "price");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockIsNull() {
|
||||
addCriterion("stock is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockIsNotNull() {
|
||||
addCriterion("stock is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockEqualTo(Integer value) {
|
||||
addCriterion("stock =", value, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockNotEqualTo(Integer value) {
|
||||
addCriterion("stock <>", value, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockGreaterThan(Integer value) {
|
||||
addCriterion("stock >", value, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("stock >=", value, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockLessThan(Integer value) {
|
||||
addCriterion("stock <", value, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("stock <=", value, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockIn(List<Integer> values) {
|
||||
addCriterion("stock in", values, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockNotIn(List<Integer> values) {
|
||||
addCriterion("stock not in", values, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockBetween(Integer value1, Integer value2) {
|
||||
addCriterion("stock between", value1, value2, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("stock not between", value1, value2, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLowStockIsNull() {
|
||||
addCriterion("low_stock is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLowStockIsNotNull() {
|
||||
addCriterion("low_stock is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLowStockEqualTo(Integer value) {
|
||||
addCriterion("low_stock =", value, "lowStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLowStockNotEqualTo(Integer value) {
|
||||
addCriterion("low_stock <>", value, "lowStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLowStockGreaterThan(Integer value) {
|
||||
addCriterion("low_stock >", value, "lowStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLowStockGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("low_stock >=", value, "lowStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLowStockLessThan(Integer value) {
|
||||
addCriterion("low_stock <", value, "lowStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLowStockLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("low_stock <=", value, "lowStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLowStockIn(List<Integer> values) {
|
||||
addCriterion("low_stock in", values, "lowStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLowStockNotIn(List<Integer> values) {
|
||||
addCriterion("low_stock not in", values, "lowStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLowStockBetween(Integer value1, Integer value2) {
|
||||
addCriterion("low_stock between", value1, value2, "lowStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLowStockNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("low_stock not between", value1, value2, "lowStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicIsNull() {
|
||||
addCriterion("pic is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicIsNotNull() {
|
||||
addCriterion("pic is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicEqualTo(String value) {
|
||||
addCriterion("pic =", value, "pic");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicNotEqualTo(String value) {
|
||||
addCriterion("pic <>", value, "pic");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicGreaterThan(String value) {
|
||||
addCriterion("pic >", value, "pic");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("pic >=", value, "pic");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicLessThan(String value) {
|
||||
addCriterion("pic <", value, "pic");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicLessThanOrEqualTo(String value) {
|
||||
addCriterion("pic <=", value, "pic");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicLike(String value) {
|
||||
addCriterion("pic like", value, "pic");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicNotLike(String value) {
|
||||
addCriterion("pic not like", value, "pic");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicIn(List<String> values) {
|
||||
addCriterion("pic in", values, "pic");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicNotIn(List<String> values) {
|
||||
addCriterion("pic not in", values, "pic");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicBetween(String value1, String value2) {
|
||||
addCriterion("pic between", value1, value2, "pic");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPicNotBetween(String value1, String value2) {
|
||||
addCriterion("pic not between", value1, value2, "pic");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSaleIsNull() {
|
||||
addCriterion("sale is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSaleIsNotNull() {
|
||||
addCriterion("sale is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSaleEqualTo(Integer value) {
|
||||
addCriterion("sale =", value, "sale");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSaleNotEqualTo(Integer value) {
|
||||
addCriterion("sale <>", value, "sale");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSaleGreaterThan(Integer value) {
|
||||
addCriterion("sale >", value, "sale");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSaleGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("sale >=", value, "sale");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSaleLessThan(Integer value) {
|
||||
addCriterion("sale <", value, "sale");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSaleLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("sale <=", value, "sale");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSaleIn(List<Integer> values) {
|
||||
addCriterion("sale in", values, "sale");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSaleNotIn(List<Integer> values) {
|
||||
addCriterion("sale not in", values, "sale");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSaleBetween(Integer value1, Integer value2) {
|
||||
addCriterion("sale between", value1, value2, "sale");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSaleNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("sale not between", value1, value2, "sale");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionPriceIsNull() {
|
||||
addCriterion("promotion_price is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionPriceIsNotNull() {
|
||||
addCriterion("promotion_price is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionPriceEqualTo(BigDecimal value) {
|
||||
addCriterion("promotion_price =", value, "promotionPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionPriceNotEqualTo(BigDecimal value) {
|
||||
addCriterion("promotion_price <>", value, "promotionPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionPriceGreaterThan(BigDecimal value) {
|
||||
addCriterion("promotion_price >", value, "promotionPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionPriceGreaterThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("promotion_price >=", value, "promotionPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionPriceLessThan(BigDecimal value) {
|
||||
addCriterion("promotion_price <", value, "promotionPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionPriceLessThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("promotion_price <=", value, "promotionPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionPriceIn(List<BigDecimal> values) {
|
||||
addCriterion("promotion_price in", values, "promotionPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionPriceNotIn(List<BigDecimal> values) {
|
||||
addCriterion("promotion_price not in", values, "promotionPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionPriceBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("promotion_price between", value1, value2, "promotionPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionPriceNotBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("promotion_price not between", value1, value2, "promotionPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLockStockIsNull() {
|
||||
addCriterion("lock_stock is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLockStockIsNotNull() {
|
||||
addCriterion("lock_stock is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLockStockEqualTo(Integer value) {
|
||||
addCriterion("lock_stock =", value, "lockStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLockStockNotEqualTo(Integer value) {
|
||||
addCriterion("lock_stock <>", value, "lockStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLockStockGreaterThan(Integer value) {
|
||||
addCriterion("lock_stock >", value, "lockStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLockStockGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("lock_stock >=", value, "lockStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLockStockLessThan(Integer value) {
|
||||
addCriterion("lock_stock <", value, "lockStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLockStockLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("lock_stock <=", value, "lockStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLockStockIn(List<Integer> values) {
|
||||
addCriterion("lock_stock in", values, "lockStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLockStockNotIn(List<Integer> values) {
|
||||
addCriterion("lock_stock not in", values, "lockStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLockStockBetween(Integer value1, Integer value2) {
|
||||
addCriterion("lock_stock between", value1, value2, "lockStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLockStockNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("lock_stock not between", value1, value2, "lockStock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataIsNull() {
|
||||
addCriterion("sp_data is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataIsNotNull() {
|
||||
addCriterion("sp_data is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataEqualTo(String value) {
|
||||
addCriterion("sp_data =", value, "spData");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataNotEqualTo(String value) {
|
||||
addCriterion("sp_data <>", value, "spData");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataGreaterThan(String value) {
|
||||
addCriterion("sp_data >", value, "spData");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("sp_data >=", value, "spData");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataLessThan(String value) {
|
||||
addCriterion("sp_data <", value, "spData");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataLessThanOrEqualTo(String value) {
|
||||
addCriterion("sp_data <=", value, "spData");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataLike(String value) {
|
||||
addCriterion("sp_data like", value, "spData");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataNotLike(String value) {
|
||||
addCriterion("sp_data not like", value, "spData");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataIn(List<String> values) {
|
||||
addCriterion("sp_data in", values, "spData");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataNotIn(List<String> values) {
|
||||
addCriterion("sp_data not in", values, "spData");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataBetween(String value1, String value2) {
|
||||
addCriterion("sp_data between", value1, value2, "spData");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSpDataNotBetween(String value1, String value2) {
|
||||
addCriterion("sp_data not between", value1, value2, "spData");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,119 +0,0 @@
|
|||
package com.muyu.product.domain.Resp;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/30 12:27
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ProductResp {
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String productName;
|
||||
|
||||
@ApiModelProperty(value = "货号")
|
||||
@NotNull(message = "货号不能为空")
|
||||
private String productNumber;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "销量")
|
||||
private Integer sales;
|
||||
|
||||
@ApiModelProperty(value = "审核状态 (1:通过, 2:驳回)")
|
||||
private Integer productExamine;
|
||||
|
||||
@ApiModelProperty(value = "品牌")
|
||||
@NotNull(message = "品牌不能不选择")
|
||||
private Integer brandId;
|
||||
|
||||
@ApiModelProperty(value = "商品类型")
|
||||
@NotNull(message = "商品类型不能不选择")
|
||||
private Integer typeId;
|
||||
|
||||
@ApiModelProperty(value = "副标题")
|
||||
private String productSubheading;
|
||||
|
||||
@ApiModelProperty(value = "商品介绍")
|
||||
private String productInformation;
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String productUnit;
|
||||
|
||||
@ApiModelProperty(value = "重量")
|
||||
private Double productWeight;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer productSort;
|
||||
|
||||
@ApiModelProperty(value = "促销表id")
|
||||
private Integer promotionId;
|
||||
|
||||
@ApiModelProperty(value = "积分")
|
||||
private Integer productPoints;
|
||||
|
||||
@ApiModelProperty(value = "成长值")
|
||||
private Integer productGrowth;
|
||||
|
||||
@ApiModelProperty(value = "最大积分值")
|
||||
private Integer productMaxPoints;
|
||||
|
||||
@ApiModelProperty(value = "预告商品 (1:是, 2:否)")
|
||||
private Integer productForeknow;
|
||||
|
||||
@ApiModelProperty(value = "上下架状态 (1:上架, 2:下架)")
|
||||
private Integer productStatus;
|
||||
|
||||
@ApiModelProperty(value = "新品 (1:是, 2:否)")
|
||||
private Integer productNew;
|
||||
|
||||
@ApiModelProperty(value = "推荐 (1:是, 2:否)")
|
||||
private Integer productRecommended;
|
||||
|
||||
@ApiModelProperty(value = "详情标题")
|
||||
private String detailsTitle;
|
||||
|
||||
@ApiModelProperty(value = "详情描述")
|
||||
private String detailsInformation;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String detailsKeyWord;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String detailsRemark;
|
||||
|
||||
@ApiModelProperty(value = "优惠方法")
|
||||
@NotNull(message = "优惠方式不能不选择")
|
||||
private Integer methodType;
|
||||
|
||||
@ApiModelProperty(value = "优惠Id")
|
||||
private Integer methodId;
|
||||
|
||||
@ApiModelProperty(value = "移动端信息")
|
||||
private String moveInformation;
|
||||
|
||||
@ApiModelProperty(value = "PC端信息")
|
||||
private String pcInformation;
|
||||
|
||||
@ApiModelProperty(value = "售价")
|
||||
private Double salePrice;
|
||||
|
||||
@ApiModelProperty(value = "品牌名称")
|
||||
private String brandName;
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "图片")
|
||||
private String imagesUrl;
|
||||
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
package com.muyu.product.domain.Resp;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/1 11:19
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "ProductTypeResp", description = "类型返回值")
|
||||
public class ProductTypeResp {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "属性名称")
|
||||
private String attrName;
|
||||
|
||||
@ApiModelProperty(value = "是否支持多选:0-是,1-否")
|
||||
private Integer multipleChoice;
|
||||
|
||||
@ApiModelProperty(value = "录入方式:0-列表选择,1-手动")
|
||||
private Integer inputMethod;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "分类标识:0-属性,1-参数")
|
||||
private Integer flag;
|
||||
|
||||
@ApiModelProperty(value = "筛选:0-普通,1-颜色")
|
||||
private Integer screen;
|
||||
|
||||
@ApiModelProperty(value = "检索:1-不需要,2-关键字,3-范围检索")
|
||||
private Integer search;
|
||||
|
||||
@ApiModelProperty(value = "商品属性关联:1-是,2-否")
|
||||
private Integer association;
|
||||
|
||||
@ApiModelProperty(value = "属性是否可选:1-唯一,2-单选,3-复选")
|
||||
private Integer stats;
|
||||
|
||||
@ApiModelProperty(value = "属性值的录入方式:1-手工录入,2-从列表中选择")
|
||||
private Integer input;
|
||||
|
||||
@ApiModelProperty(value = "属性值可选值列表")
|
||||
private String selection;
|
||||
|
||||
@ApiModelProperty(value = "手动新增:0-是,1-否")
|
||||
private Integer manualOperation;
|
||||
|
||||
@ApiModelProperty(value = "属性ID")
|
||||
private Integer typeAttrId;
|
||||
|
||||
@ApiModelProperty(value = "属性值详情")
|
||||
private Integer typeAttrValue;
|
||||
|
||||
@ApiModelProperty(value = "属性数量")
|
||||
private Integer countNum;
|
||||
|
||||
@ApiModelProperty(value = "参数数量")
|
||||
private Integer countParam;
|
||||
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
package com.muyu.product.domain;//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
|
||||
|
||||
public interface StrPool {
|
||||
char C_SPACE = ' ';
|
||||
char C_TAB = '\t';
|
||||
char C_DOT = '.';
|
||||
char C_SLASH = '/';
|
||||
char C_BACKSLASH = '\\';
|
||||
char C_CR = '\r';
|
||||
char C_LF = '\n';
|
||||
char C_UNDERLINE = '_';
|
||||
char C_COMMA = ',';
|
||||
char C_DELIM_START = '{';
|
||||
char C_DELIM_END = '}';
|
||||
char C_BRACKET_START = '[';
|
||||
char C_BRACKET_END = ']';
|
||||
char C_COLON = ':';
|
||||
char C_AT = '@';
|
||||
String TAB = "\t";
|
||||
String DOT = ".";
|
||||
String DOUBLE_DOT = "..";
|
||||
String SLASH = "/";
|
||||
String BACKSLASH = "\\";
|
||||
String CR = "\r";
|
||||
String LF = "\n";
|
||||
String CRLF = "\r\n";
|
||||
String UNDERLINE = "_";
|
||||
String DASHED = "-";
|
||||
String COMMA = ",";
|
||||
String DELIM_START = "{";
|
||||
String DELIM_END = "}";
|
||||
String BRACKET_START = "[";
|
||||
String BRACKET_END = "]";
|
||||
String COLON = ":";
|
||||
String AT = "@";
|
||||
String HTML_NBSP = " ";
|
||||
String HTML_AMP = "&";
|
||||
String HTML_QUOTE = """;
|
||||
String HTML_APOS = "'";
|
||||
String HTML_LT = "<";
|
||||
String HTML_GT = ">";
|
||||
String EMPTY_JSON = "{}";
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
|
||||
|
||||
import com.muyu.product.domain.DTO.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author A3385
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "ProductReq", description = "商品添加接收信息")
|
||||
public class ProductReq {
|
||||
|
||||
@ApiModelProperty(value = "商品")
|
||||
@Valid
|
||||
private Product product;
|
||||
|
||||
@ApiModelProperty(value = "商品图片列表")
|
||||
private List<String> productImages;
|
||||
|
||||
@ApiModelProperty(value = "商品Sku集合")
|
||||
private List<ProductSku> productSkus;
|
||||
|
||||
@ApiModelProperty(value = "服务id")
|
||||
private List<Integer> serviceIds;
|
||||
|
||||
@ApiModelProperty(value = "阶梯优惠")
|
||||
private List<Ladder> ladder;
|
||||
|
||||
@ApiModelProperty(value = "会员信息")
|
||||
private Member member;
|
||||
|
||||
@ApiModelProperty(value = "优惠信息")
|
||||
private Preference preference;
|
||||
|
||||
@ApiModelProperty(value = "价格信息")
|
||||
private List<Price> price;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 20:00
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "ProductSkuNew", description = "ProductSkuNew")
|
||||
public class ProductSkuNew extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "SKUId")
|
||||
private long id;
|
||||
|
||||
@ApiModelProperty(value = "销售价格")
|
||||
private Double salePrice;
|
||||
|
||||
@ApiModelProperty(value = "促销价格")
|
||||
private Double promotionPrice;
|
||||
|
||||
@ApiModelProperty(value = "库存")
|
||||
private Integer stock;
|
||||
|
||||
@ApiModelProperty(value = "预警库存")
|
||||
private Integer stockAlert;
|
||||
|
||||
@ApiModelProperty(value = "商品Id")
|
||||
private Integer productId;
|
||||
|
||||
@ApiModelProperty(value = "SKU背景图地址")
|
||||
private String bgImg;
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import com.muyu.common.core.domain.BaseEntity;
|
||||
import com.muyu.product.domain.DTO.ProductTypeAttrValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/7 19:05
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "ProductTypeAttrReq", description = "商品类型添加值")
|
||||
public class ProductTypeAttrReq extends BaseEntity {
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商品类型ID")
|
||||
private Integer productTypeId;
|
||||
|
||||
@ApiModelProperty(value = "属性名称")
|
||||
private String attrName;
|
||||
|
||||
@ApiModelProperty(value = "是否支持多选:0-是,1-否")
|
||||
private Integer multipleChoice;
|
||||
|
||||
@ApiModelProperty(value = "录入方式:0-列表选择,1-手动")
|
||||
private Integer inputMethod;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "分类标识:0-属性,1-参数")
|
||||
private Integer flag;
|
||||
|
||||
@ApiModelProperty(value = "筛选:0-普通,1-颜色")
|
||||
private Integer screen;
|
||||
|
||||
@ApiModelProperty(value = "检索:1-不需要,2-关键字,3-范围检索")
|
||||
private Integer search;
|
||||
|
||||
@ApiModelProperty(value = "商品属性关联:1-是,2-否")
|
||||
private Integer association;
|
||||
|
||||
@ApiModelProperty(value = "属性是否可选:1-唯一,2-单选,3-复选")
|
||||
private Integer stats;
|
||||
|
||||
@ApiModelProperty(value = "属性值的录入方式:1-手工录入,2-从列表中选择")
|
||||
private Integer input;
|
||||
|
||||
@ApiModelProperty(value = "属性值可选值列表")
|
||||
private String selection;
|
||||
|
||||
@ApiModelProperty(value = "手动新增:0-是,1-否")
|
||||
private Integer manualOperation;
|
||||
|
||||
@ApiModelProperty(value = "添加类型得具体值")
|
||||
private String productTypeAttrValueList;
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 19:58
|
||||
*/
|
||||
@ApiModel(value = "QueryProductReq", description = "接收到的参数值")
|
||||
@Data
|
||||
public class QueryProductReq {
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String productName;
|
||||
|
||||
@ApiModelProperty(value = "货号")
|
||||
private String productNumber;
|
||||
|
||||
@ApiModelProperty(value = "上下架状态 (1:上架, 2:下架)")
|
||||
private Integer productStatus;
|
||||
|
||||
@ApiModelProperty(value = "审核状态 (1:通过, 2:驳回)")
|
||||
private Integer productExamine;
|
||||
|
||||
@ApiModelProperty(value = "品牌")
|
||||
private Integer brandId;
|
||||
|
||||
@ApiModelProperty(value = "商品类型")
|
||||
private Integer typeId;
|
||||
|
||||
@ApiModelProperty(value = "分页参数")
|
||||
private Integer pageNum = 1;
|
||||
|
||||
@ApiModelProperty(value = "分页参数")
|
||||
private Integer pageSize = 10;
|
||||
|
||||
}
|
|
@ -1,133 +0,0 @@
|
|||
package com.muyu.product.domain.util;
|
||||
|
||||
/**
|
||||
* 通用返回结果封装类
|
||||
* Created by macro on 2019/4/19.
|
||||
*/
|
||||
public class CommonResult<T> {
|
||||
/**
|
||||
* 状态码
|
||||
*/
|
||||
private long code;
|
||||
/**
|
||||
* 提示信息
|
||||
*/
|
||||
private String message;
|
||||
/**
|
||||
* 数据封装
|
||||
*/
|
||||
private T data;
|
||||
|
||||
protected CommonResult() {
|
||||
}
|
||||
|
||||
protected CommonResult(long code, String message, T data) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回结果
|
||||
*
|
||||
* @param data 获取的数据
|
||||
*/
|
||||
public static <T> CommonResult<T> success(T data) {
|
||||
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMessage(), data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回结果
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param message 提示信息
|
||||
*/
|
||||
public static <T> CommonResult<T> success(T data, String message) {
|
||||
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), message, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
* @param errorCode 错误码
|
||||
*/
|
||||
public static <T> CommonResult<T> failed(IErrorCode errorCode) {
|
||||
return new CommonResult<T>(errorCode.getCode(), errorCode.getMessage(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
* @param errorCode 错误码
|
||||
* @param message 错误信息
|
||||
*/
|
||||
public static <T> CommonResult<T> failed(IErrorCode errorCode,String message) {
|
||||
return new CommonResult<T>(errorCode.getCode(), message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
* @param message 提示信息
|
||||
*/
|
||||
public static <T> CommonResult<T> failed(String message) {
|
||||
return new CommonResult<T>(ResultCode.FAILED.getCode(), message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*/
|
||||
public static <T> CommonResult<T> failed() {
|
||||
return failed(ResultCode.FAILED);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数验证失败返回结果
|
||||
*/
|
||||
public static <T> CommonResult<T> validateFailed() {
|
||||
return failed(ResultCode.VALIDATE_FAILED);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数验证失败返回结果
|
||||
* @param message 提示信息
|
||||
*/
|
||||
public static <T> CommonResult<T> validateFailed(String message) {
|
||||
return new CommonResult<T>(ResultCode.VALIDATE_FAILED.getCode(), message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 未登录返回结果
|
||||
*/
|
||||
public static <T> CommonResult<T> unauthorized(T data) {
|
||||
return new CommonResult<T>(ResultCode.UNAUTHORIZED.getCode(), ResultCode.UNAUTHORIZED.getMessage(), data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 未授权返回结果
|
||||
*/
|
||||
public static <T> CommonResult<T> forbidden(T data) {
|
||||
return new CommonResult<T>(ResultCode.FORBIDDEN.getCode(), ResultCode.FORBIDDEN.getMessage(), data);
|
||||
}
|
||||
|
||||
public long getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(long code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
|
@ -1,133 +0,0 @@
|
|||
package com.muyu.product.domain.util;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/27 21:20
|
||||
*/
|
||||
public class Constants {
|
||||
/**
|
||||
* UTF-8 字符集
|
||||
*/
|
||||
public static final String UTF8 = "UTF-8";
|
||||
|
||||
/**
|
||||
* GBK 字符集
|
||||
*/
|
||||
public static final String GBK = "GBK";
|
||||
|
||||
/**
|
||||
* www主域
|
||||
*/
|
||||
public static final String WWW = "www.";
|
||||
|
||||
/**
|
||||
* RMI 远程方法调用
|
||||
*/
|
||||
public static final String LOOKUP_RMI = "rmi:";
|
||||
|
||||
/**
|
||||
* LDAP 远程方法调用
|
||||
*/
|
||||
public static final String LOOKUP_LDAP = "ldap:";
|
||||
|
||||
/**
|
||||
* LDAPS 远程方法调用
|
||||
*/
|
||||
public static final String LOOKUP_LDAPS = "ldaps:";
|
||||
|
||||
/**
|
||||
* http请求
|
||||
*/
|
||||
public static final String HTTP = "http://";
|
||||
|
||||
/**
|
||||
* https请求
|
||||
*/
|
||||
public static final String HTTPS = "https://";
|
||||
|
||||
/**
|
||||
* 成功标记
|
||||
*/
|
||||
public static final Integer SUCCESS = 200;
|
||||
|
||||
/**
|
||||
* 失败标记
|
||||
*/
|
||||
public static final Integer FAIL = 500;
|
||||
|
||||
/**
|
||||
* 登录成功状态
|
||||
*/
|
||||
public static final String LOGIN_SUCCESS_STATUS = "0";
|
||||
|
||||
/**
|
||||
* 登录失败状态
|
||||
*/
|
||||
public static final String LOGIN_FAIL_STATUS = "1";
|
||||
|
||||
/**
|
||||
* 登录成功
|
||||
*/
|
||||
public static final String LOGIN_SUCCESS = "Success";
|
||||
|
||||
/**
|
||||
* 注销
|
||||
*/
|
||||
public static final String LOGOUT = "Logout";
|
||||
|
||||
/**
|
||||
* 注册
|
||||
*/
|
||||
public static final String REGISTER = "Register";
|
||||
|
||||
/**
|
||||
* 登录失败
|
||||
*/
|
||||
public static final String LOGIN_FAIL = "Error";
|
||||
|
||||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
public static final String PAGE_NUM = "pageNum";
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
public static final String PAGE_SIZE = "pageSize";
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
public static final String ORDER_BY_COLUMN = "orderByColumn";
|
||||
|
||||
/**
|
||||
* 排序的方向 "desc" 或者 "asc".
|
||||
*/
|
||||
public static final String IS_ASC = "isAsc";
|
||||
|
||||
/**
|
||||
* 验证码有效期(分钟)
|
||||
*/
|
||||
public static final long CAPTCHA_EXPIRATION = 2;
|
||||
|
||||
/**
|
||||
* 资源映射路径 前缀
|
||||
*/
|
||||
public static final String RESOURCE_PREFIX = "/profile";
|
||||
|
||||
/**
|
||||
* 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)
|
||||
*/
|
||||
public static final String[] JSON_WHITELIST_STR = { "org.springframework", "com.bwie" };
|
||||
|
||||
/**
|
||||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
||||
*/
|
||||
public static final String[] JOB_WHITELIST_STR = { "com.bwie.job.task" };
|
||||
|
||||
/**
|
||||
* 定时任务违规的字符
|
||||
*/
|
||||
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
||||
"org.springframework", "org.apache", "com.bwie.common.core.utils.file" };
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.muyu.product.domain.util;
|
||||
|
||||
/**
|
||||
* API返回码接口
|
||||
*/
|
||||
public interface IErrorCode {
|
||||
/**
|
||||
* 返回码
|
||||
*/
|
||||
long getCode();
|
||||
|
||||
/**
|
||||
* 返回信息
|
||||
*/
|
||||
String getMessage();
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package com.muyu.product.domain.util;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/24 19:26
|
||||
*/
|
||||
public enum ResultCode implements IErrorCode{
|
||||
|
||||
SUCCESS(200, "操作成功"),
|
||||
FAILED(500, "操作失败"),
|
||||
VALIDATE_FAILED(404, "参数检验失败"),
|
||||
UNAUTHORIZED(401, "暂未登录或token已经过期"),
|
||||
FORBIDDEN(403, "没有相关权限");
|
||||
private long code;
|
||||
private String message;
|
||||
|
||||
private ResultCode(long code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public long getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.muyu.product.domain.validator;
|
||||
|
||||
import com.fasterxml.jackson.databind.introspect.Annotated;
|
||||
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/24 9:39
|
||||
*/
|
||||
public interface ConstraintValidator <A extends Annotated,T>{
|
||||
|
||||
default void initialize(A constraintAnnotation) {
|
||||
}
|
||||
|
||||
boolean isValid(T var1, ConstraintValidatorContext var2);
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package com.muyu.product.domain.validator;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import java.lang.annotation.*;
|
||||
import javax.validation.Payload;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/24 9:34
|
||||
*/
|
||||
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD,ElementType.PARAMETER})
|
||||
@Constraint(validatedBy = FlagValidatorClass.class)
|
||||
public @interface FlagValidator {
|
||||
String[] value() default {};
|
||||
|
||||
String message() default "flag is not found";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package com.muyu.product.domain.validator;
|
||||
|
||||
import com.muyu.product.domain.validator.FlagValidator;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* 状态标记校验器
|
||||
*/
|
||||
public class FlagValidatorClass implements ConstraintValidator<FlagValidator,Integer> {
|
||||
private String[] values;
|
||||
@Override
|
||||
public void initialize(FlagValidator flagValidator) {
|
||||
this.values = flagValidator.value();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
|
||||
boolean isValid = false;
|
||||
for(int i=0;i<values.length;i++){
|
||||
if(values[i].equals(String.valueOf(value))){
|
||||
isValid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return isValid;
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package com.muyu.product.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/30 12:57
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "商品类别")
|
||||
public class ProductCategoryVo {
|
||||
|
||||
@ApiModelProperty(value = "类别ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "类别名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父类别ID")
|
||||
private Integer parentId;
|
||||
|
||||
@ApiModelProperty(value = "子类别列表")
|
||||
private List<ProductCategoryVo> childrenList;
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
package com.muyu.product.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/10 下午8:47
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "ProductVo")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ProductVo {
|
||||
|
||||
@ApiModelProperty(value = "产品id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "产品名称")
|
||||
private String productName;
|
||||
|
||||
@ApiModelProperty(value = "产品信息")
|
||||
private String productInformation;
|
||||
|
||||
@ApiModelProperty(value = "详情标题")
|
||||
private String detailsTitle;
|
||||
|
||||
@ApiModelProperty(value = "详情信息")
|
||||
private String detailsInformation;
|
||||
|
||||
@ApiModelProperty(value = "品牌名称")
|
||||
private String brandName;
|
||||
|
||||
@ApiModelProperty(value = "销售价格")
|
||||
private Double salePrice;
|
||||
|
||||
@ApiModelProperty(value = "促销价格")
|
||||
private Double promotionPrice;
|
||||
|
||||
@ApiModelProperty(value = "图片链接")
|
||||
private String imagesUrl;
|
||||
|
||||
@ApiModelProperty(value = "服务名称")
|
||||
private String serviceName;
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.muyu.product;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.ComponentScans;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author A3385
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class MuYuProductApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MuYuProductApplication.class);
|
||||
}
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import com.muyu.common.core.domain.AjaxResult;
|
||||
import com.muyu.common.core.domain.R;
|
||||
import com.muyu.product.domain.DTO.Brand;
|
||||
import com.muyu.product.domain.DTO.Services;
|
||||
import com.muyu.product.domain.vo.ProductCategoryVo;
|
||||
import com.muyu.product.service.ArgumentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.muyu.common.core.domain.AjaxResult.success;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("argument")
|
||||
@Api(value = "下拉框查询")
|
||||
public class ArgumentController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ArgumentService argumentService;
|
||||
|
||||
@ApiOperation("品牌下拉框查询")
|
||||
@GetMapping("/queryBrand/{brandName}")
|
||||
public AjaxResult queryBrand(@PathVariable String brandName){
|
||||
List<Brand>list = argumentService.queryBrand(brandName);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/queryService")
|
||||
@ApiOperation("查询服务")
|
||||
public AjaxResult queryService(){
|
||||
List<Services>list=argumentService.queryService();
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/queryCategory")
|
||||
@ApiOperation("分类查询")
|
||||
public R<List<ProductCategoryVo>>queryCategory(){
|
||||
return R.ok(argumentService.queryCategory());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import com.muyu.common.core.domain.AjaxResult;
|
||||
import com.muyu.product.domain.DTO.Brand;
|
||||
import com.muyu.product.service.BrandService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/2 19:49
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/brand")
|
||||
@Api("品牌管理")
|
||||
public class BrandController {
|
||||
|
||||
@Autowired
|
||||
private BrandService brandService;
|
||||
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("品牌添加")
|
||||
public AjaxResult insertBrand(@RequestBody Brand brand){
|
||||
Integer res=brandService.insertBrand(brand);
|
||||
return AjaxResult.success(res==1?"添加成功":"添加失败");
|
||||
}
|
||||
|
||||
@DeleteMapping("/{brandId}")
|
||||
@ApiOperation("品牌删除")
|
||||
public AjaxResult deleteBrand(@PathVariable Integer brandId){
|
||||
Integer res = brandService.deleteBrand(brandId);
|
||||
return AjaxResult.success(res==1?"删除成功":"删除失败");
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("品牌修改")
|
||||
public AjaxResult updateBrand(@RequestBody Brand brand){
|
||||
Integer res = brandService.updateBrand(brand);
|
||||
return AjaxResult.success(res==1?"修改成功":"修改失败");
|
||||
}
|
||||
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import com.muyu.common.core.domain.AjaxResult;
|
||||
import com.muyu.product.domain.DTO.Category;
|
||||
import com.muyu.product.service.CategoryService;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/1 10:31
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/category")
|
||||
public class CategoryController {
|
||||
|
||||
@Autowired
|
||||
private CategoryService categoryService;
|
||||
|
||||
@GetMapping("/queryCategory")
|
||||
@ApiOperation("类型列表")
|
||||
public AjaxResult queryCategory(){
|
||||
List<Category>list=categoryService.queryCategory();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("查询分类父级")
|
||||
@GetMapping("/queryCategorParent")
|
||||
public AjaxResult queryCategorParent(){
|
||||
List<Category>list=categoryService.queryCategorParent();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@DeleteMapping("{categoryId}")
|
||||
@ApiOperation("分类删除")
|
||||
public AjaxResult deleteCategory(@PathVariable Integer categoryId){
|
||||
Integer res = categoryService.deleteCategory(categoryId);
|
||||
return AjaxResult.success(res==1?"删除成功":"删除失败");
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("分类添加")
|
||||
public AjaxResult insertCategory(@RequestBody(required = false) Category category){
|
||||
if (category == null) {
|
||||
return AjaxResult.error("请求体不能为空");
|
||||
}
|
||||
Integer res = categoryService.insertCategory(category);
|
||||
return AjaxResult.success(res == 1 ? "添加成功" : "添加失败");
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("分类修改")
|
||||
public AjaxResult updateCategory(@RequestBody Category category){
|
||||
Integer res = categoryService.updateCategory(category);
|
||||
return AjaxResult.success(res==1?"修改成功":"修改失败");
|
||||
}
|
||||
}
|
|
@ -1,107 +0,0 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.domain.AjaxResult;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.utils.file.FileTypeUtils;
|
||||
import com.muyu.common.core.utils.file.MimeTypeUtils;
|
||||
import com.muyu.common.system.domain.SysFile;
|
||||
import com.muyu.common.system.remote.RemoteFileService;
|
||||
import com.muyu.product.domain.DTO.Product;
|
||||
import com.muyu.product.domain.Resp.ProductResp;
|
||||
import com.muyu.product.domain.req.ProductReq;
|
||||
import com.muyu.product.domain.req.QueryProductReq;
|
||||
import com.muyu.common.core.domain.R;
|
||||
import com.muyu.product.domain.vo.ProductVo;
|
||||
import com.muyu.product.service.ProductService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static com.muyu.common.core.domain.AjaxResult.error;
|
||||
import static com.muyu.common.core.domain.AjaxResult.success;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/product")
|
||||
@Api(value = "商品管理")
|
||||
public class ProductController {
|
||||
|
||||
@Autowired
|
||||
private ProductService productService;
|
||||
|
||||
@Autowired
|
||||
private RemoteFileService remoteFileService;
|
||||
|
||||
|
||||
@ApiOperation("查询商品信息")
|
||||
@GetMapping("/queryProduct")
|
||||
public AjaxResult queryProduct(QueryProductReq req){
|
||||
PageInfo<ProductResp> list = productService.queryProduct(req);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("添加商品")
|
||||
@PostMapping("/productInsert")
|
||||
public R productInsert(@Valid @RequestBody ProductReq productReq){
|
||||
productService.productInsert(productReq);
|
||||
return R.ok(null,"添加成功");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品")
|
||||
@DeleteMapping("{id}")
|
||||
public AjaxResult deleteProduct(@PathVariable Integer id){
|
||||
Integer res = productService.deleteProduct(id);
|
||||
return AjaxResult.success(res==1?"删除成功":"删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品")
|
||||
@PostMapping("/productUpdate")
|
||||
public R productUpdate(@Valid @RequestBody ProductReq productReq){
|
||||
productService.productUpdate(productReq);
|
||||
return R.ok(null,"添加成功");
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("图片上传")
|
||||
@PostMapping("/upload")
|
||||
public AjaxResult avatar(@RequestParam("file") MultipartFile file)
|
||||
{
|
||||
if (!file.isEmpty())
|
||||
{
|
||||
String extension = FileTypeUtils.getExtension(file);
|
||||
if (!StringUtils.equalsAnyIgnoreCase(extension, MimeTypeUtils.IMAGE_EXTENSION))
|
||||
{
|
||||
return error("文件格式不正确,请上传" + Arrays.toString(MimeTypeUtils.IMAGE_EXTENSION) + "格式");
|
||||
}
|
||||
R<SysFile> fileResult = remoteFileService.upload(file);
|
||||
if (StringUtils.isNull(fileResult) || StringUtils.isNull(fileResult.getData()))
|
||||
{
|
||||
return error("文件服务异常,请联系管理员");
|
||||
}
|
||||
String url = fileResult.getData().getUrl();
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("imgUrl", url);
|
||||
return ajax;
|
||||
}
|
||||
return error("上传图片异常,请联系管理员");
|
||||
}
|
||||
|
||||
@ApiOperation("测试商品信息")
|
||||
@GetMapping("/queryProductDetails/{id}")
|
||||
public R<ProductVo> queryProductDetails(@PathVariable Integer id){
|
||||
ProductVo productVo = productService.queryProductDetails(id);
|
||||
return R.ok(productVo);
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import com.muyu.product.domain.DTO.ProductSku;
|
||||
import com.muyu.product.domain.util.CommonResult;
|
||||
import com.muyu.product.service.SkuService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/5 20:34
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sku")
|
||||
public class SkuController {
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private SkuService skuservice;
|
||||
|
||||
@ApiOperation("根据商品ID及sku编码模糊搜索sku库存")
|
||||
@RequestMapping(value = "/{pid}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<ProductSku>> getList(@PathVariable Long pid, @RequestParam(value = "keyword",required = false) String keyword) {
|
||||
List<ProductSku> skuStockList = skuservice.getList(pid, keyword);
|
||||
return CommonResult.success(skuStockList);
|
||||
}
|
||||
|
||||
@ApiOperation("批量更新sku库存信息")
|
||||
@RequestMapping(value = "update/{pid}",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long pid,@RequestBody List<ProductSku> skuList){
|
||||
int count = skuservice.update(pid,skuList);
|
||||
if(count>0){
|
||||
return CommonResult.success(count);
|
||||
}else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import com.muyu.common.core.domain.AjaxResult;
|
||||
import com.muyu.common.core.domain.R;
|
||||
import com.muyu.product.domain.DTO.ProductType;
|
||||
import com.muyu.product.domain.DTO.ProductTypeAttr;
|
||||
import com.muyu.product.domain.Resp.ProductTypeResp;
|
||||
import com.muyu.product.domain.req.ProductTypeAttrReq;
|
||||
import com.muyu.product.service.TypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/1 11:15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/type")
|
||||
@Api("类型管理")
|
||||
public class TypeController {
|
||||
|
||||
@Autowired
|
||||
private TypeService typeService;
|
||||
|
||||
|
||||
@GetMapping("/queryTypeAll")
|
||||
@ApiOperation("类型查询")
|
||||
public AjaxResult queryTypeAll(){
|
||||
List<ProductTypeResp> list =typeService.queryTypeAll();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型所有查询
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryTypeAttr/{flag}/{id}")
|
||||
@ApiOperation("属性/参数类型查询")
|
||||
public AjaxResult queryType(@PathVariable Integer flag,@PathVariable Integer id){
|
||||
List<ProductTypeAttr> list =typeService.queryType(flag,id);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/{typeId}")
|
||||
@ApiOperation("类型删除")
|
||||
public AjaxResult deleteType(@PathVariable Integer typeId){
|
||||
Integer res = typeService.deleteType(typeId);
|
||||
return AjaxResult.success(res==1?"删除成功":"删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("类型值删除")
|
||||
@DeleteMapping("/deleteTypeAttr/{typeId}")
|
||||
public R deleteTypeAttr(@PathVariable Integer typeId){
|
||||
Integer res = typeService.deleteTypeAttr(typeId);
|
||||
return R.ok(res==1?"删除成功":"删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("类型添加")
|
||||
@PostMapping("/insertType")
|
||||
public R insertType(@RequestBody ProductType productType){
|
||||
Integer res = typeService.insertType(productType);
|
||||
return R.ok(res==1?"添加成功":"添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("类型修改")
|
||||
@PostMapping("updateType")
|
||||
public R updateType(@RequestBody ProductType productType){
|
||||
Integer res = typeService.updateType(productType);
|
||||
return R.ok(res==1?"修改成功":"修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("类型值添加")
|
||||
@PostMapping("/insertTypeAttr")
|
||||
public R insertTypeAttr(@RequestBody ProductTypeAttrReq productTypeAttrReq){
|
||||
Integer res = typeService.insertTypeAttr(productTypeAttrReq);
|
||||
return R.ok(res==1?"添加成功":"添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("类型值修改")
|
||||
@PostMapping("/updateTypeAttr")
|
||||
public R updateTypeAttr(@RequestBody ProductTypeAttrReq productTypeAttrReq){
|
||||
Integer res = typeService.updateTypeAttr(productTypeAttrReq);
|
||||
return R.ok(res==1?"修改成功":"修改失败");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.muyu.product.domain.DTO.Brand;
|
||||
import com.muyu.product.domain.DTO.Category;
|
||||
import com.muyu.product.domain.DTO.Services;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:07
|
||||
*/
|
||||
@Mapper
|
||||
public interface ArgumentMapper {
|
||||
List<Brand> queryBrand(@PathVariable String brandName);
|
||||
|
||||
List<Services> queryService();
|
||||
|
||||
List<Category> queryCategory();
|
||||
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.muyu.product.domain.DTO.Brand;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/2 19:51
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface BrandMapper {
|
||||
|
||||
|
||||
Integer deleteBrand(Integer brandId);
|
||||
|
||||
Integer insertBrand(Brand brand);
|
||||
|
||||
Integer updateBrand(Brand brand);
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.muyu.product.domain.DTO.Category;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/1 10:32
|
||||
*/
|
||||
@Mapper
|
||||
public interface CategoryMapper {
|
||||
List<Category> queryCategory();
|
||||
|
||||
Integer deleteCategory(Integer categoryId);
|
||||
|
||||
Integer insertCategory(Category category);
|
||||
|
||||
Integer updateCategory(Category category);
|
||||
|
||||
List<Category> queryCategorParent();
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.muyu.product.domain.DTO.Product;
|
||||
import com.muyu.product.domain.Resp.ProductResp;
|
||||
import com.muyu.product.domain.req.QueryProductReq;
|
||||
import com.muyu.product.domain.vo.ProductVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:06
|
||||
*/
|
||||
public interface ProductMapper {
|
||||
|
||||
List<ProductResp> queryProduct(QueryProductReq productReq);
|
||||
|
||||
Integer insertProduct(Product product);
|
||||
|
||||
void updateMothodId(Integer id);
|
||||
|
||||
Integer findProductNumber(String productNumber);
|
||||
|
||||
|
||||
Integer deleteProduct(Integer id);
|
||||
|
||||
ProductVo queryProductDetails(Integer id);
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.muyu.product.domain.DTO.ProductSku;
|
||||
import com.muyu.product.domain.DTO.ProductSkuAttr;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:29
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProductSkuMapper {
|
||||
|
||||
void insertProductSkuAttr(@Param("productSkuAttrs") List<ProductSkuAttr> productSkuAttrs);
|
||||
|
||||
void insertProductSku(@Param("productSkus") List<ProductSku> productSkus, @Param("id") Integer id, @Param("createBy") String createBy);
|
||||
|
||||
Integer findSkuId(@Param("productSkus") List<ProductSku> productSkus);
|
||||
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.muyu.product.domain.DTO.Ladder;
|
||||
import com.muyu.product.domain.DTO.Member;
|
||||
import com.muyu.product.domain.DTO.Preference;
|
||||
import com.muyu.product.domain.DTO.Price;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:07
|
||||
*/
|
||||
public interface PromotionMapper {
|
||||
|
||||
void insertPreference(Preference preference);
|
||||
|
||||
void insertMember(Member member);
|
||||
|
||||
void insertLadder(Ladder item);
|
||||
|
||||
void insertPrice(Price item);
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:07
|
||||
*/
|
||||
@Mapper
|
||||
public interface ServicesMapper {
|
||||
|
||||
int insertProductService(@Param("id") Integer id, @Param("serviceIds") List<Integer> serviceIds);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
|
||||
import com.muyu.product.domain.DTO.ProductSku;
|
||||
import com.muyu.product.domain.PmsSkuStockExample;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/5 20:39
|
||||
*/
|
||||
@Mapper
|
||||
public interface SkuMapper {
|
||||
List<ProductSku> selectByExample(PmsSkuStockExample example);
|
||||
|
||||
int replaceList(@Param("list")List<ProductSku> fileterSkuList);
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.muyu.product.domain.DTO.ProductType;
|
||||
import com.muyu.product.domain.DTO.ProductTypeAttr;
|
||||
import com.muyu.product.domain.DTO.ProductTypeAttrValue;
|
||||
import com.muyu.product.domain.Resp.ProductTypeResp;
|
||||
import com.muyu.product.domain.req.ProductTypeAttrReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/1 11:15
|
||||
*/
|
||||
@Mapper
|
||||
public interface TypeMapper {
|
||||
|
||||
|
||||
List<ProductTypeAttr> queryType(@Param("flag") Integer flag, @Param("id") Integer id);
|
||||
|
||||
List<ProductTypeResp> queryTypeAll();
|
||||
|
||||
Integer deleteType(@Param("typeId") Integer typeId, @Param("name") String name);
|
||||
|
||||
Integer insertType(ProductType productType);
|
||||
|
||||
Integer updateType(ProductType productType);
|
||||
|
||||
Integer insertTypeAttr(ProductTypeAttrReq productTypeAttrReq);
|
||||
|
||||
|
||||
Integer deleteTypeAttr(Integer id);
|
||||
|
||||
Integer updateAttr(ProductTypeAttrReq productTypeAttrReq);
|
||||
|
||||
void deleteTypeAttrValue(Integer typeId);
|
||||
|
||||
void insertTypeValue(ProductTypeAttrValue productTypeAttrValue);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.muyu.product.domain.DTO.Brand;
|
||||
import com.muyu.product.domain.DTO.Services;
|
||||
import com.muyu.product.domain.vo.ProductCategoryVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:05
|
||||
*/
|
||||
public interface ArgumentService {
|
||||
List<Brand> queryBrand(String brandName);
|
||||
|
||||
List<Services> queryService();
|
||||
|
||||
List<ProductCategoryVo> queryCategory();
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.muyu.product.domain.DTO.Brand;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/2 19:51
|
||||
*/
|
||||
public interface BrandService {
|
||||
Integer insertBrand(Brand brand);
|
||||
|
||||
Integer deleteBrand(Integer brandId);
|
||||
|
||||
|
||||
|
||||
|
||||
Integer updateBrand(Brand brand);
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.muyu.product.domain.DTO.Category;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/1 10:31
|
||||
*/
|
||||
public interface CategoryService {
|
||||
List<Category> queryCategory();
|
||||
|
||||
Integer deleteCategory(Integer categoryId);
|
||||
|
||||
Integer insertCategory(Category category);
|
||||
|
||||
Integer updateCategory(Category category);
|
||||
|
||||
List<Category> queryCategorParent();
|
||||
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.product.domain.DTO.Product;
|
||||
import com.muyu.product.domain.DTO.ProductSku;
|
||||
import com.muyu.product.domain.DTO.ProductSkuAttr;
|
||||
import com.muyu.product.domain.Resp.ProductResp;
|
||||
import com.muyu.product.domain.req.ProductReq;
|
||||
import com.muyu.product.domain.req.QueryProductReq;
|
||||
import com.muyu.product.domain.vo.ProductVo;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:05
|
||||
*/
|
||||
public interface ProductService {
|
||||
PageInfo<ProductResp> queryProduct(QueryProductReq req);
|
||||
|
||||
void productInsert(ProductReq productReq);
|
||||
|
||||
|
||||
Integer deleteProduct(Integer id);
|
||||
|
||||
void productUpdate(ProductReq productReq);
|
||||
|
||||
ProductVo queryProductDetails(Integer id);
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:05
|
||||
*/
|
||||
public interface ProductTypeService {
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:05
|
||||
*/
|
||||
public interface ServiceService {
|
||||
|
||||
int insertProductService(Integer productId,List<Integer> serviceIds);
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.muyu.product.domain.DTO.ProductSku;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/5 20:35
|
||||
*/
|
||||
public interface SkuService {
|
||||
List<ProductSku> getList(Long pid, String keyword);
|
||||
|
||||
int update(Long pid, List<ProductSku> skuList);
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.muyu.product.domain.DTO.ProductType;
|
||||
import com.muyu.product.domain.DTO.ProductTypeAttr;
|
||||
import com.muyu.product.domain.Resp.ProductTypeResp;
|
||||
import com.muyu.product.domain.req.ProductTypeAttrReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/1 11:15
|
||||
*/
|
||||
public interface TypeService {
|
||||
|
||||
|
||||
List<ProductTypeResp> queryTypeAll();
|
||||
|
||||
List<ProductTypeAttr> queryType(Integer flag, Integer id);
|
||||
|
||||
Integer deleteType(Integer typeId);
|
||||
|
||||
Integer deleteTypeAttr(Integer typeId);
|
||||
|
||||
Integer insertType(ProductType productType);
|
||||
|
||||
Integer updateType(ProductType productType);
|
||||
|
||||
Integer insertTypeAttr(ProductTypeAttrReq productTypeAttrReq);
|
||||
|
||||
Integer updateTypeAttr(ProductTypeAttrReq productTypeAttrReq);
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
package com.muyu.product.service.impl;
|
||||
|
||||
import com.muyu.product.domain.DTO.Brand;
|
||||
import com.muyu.product.domain.DTO.Category;
|
||||
import com.muyu.product.domain.DTO.Services;
|
||||
import com.muyu.product.domain.vo.ProductCategoryVo;
|
||||
import com.muyu.product.mapper.ArgumentMapper;
|
||||
import com.muyu.product.service.ArgumentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:06
|
||||
*/
|
||||
@Service
|
||||
public class ArgumentServiceImpl implements ArgumentService {
|
||||
|
||||
@Autowired
|
||||
private ArgumentMapper argumentMapper;
|
||||
@Override
|
||||
public List<Brand> queryBrand(String brandName) {
|
||||
return argumentMapper.queryBrand(brandName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Services> queryService() {
|
||||
return argumentMapper.queryService();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductCategoryVo> queryCategory() {
|
||||
List<Category>categoryList=argumentMapper.queryCategory();
|
||||
List<ProductCategoryVo>productCategoryVos=convertToProductCategoryVoTree(categoryList);
|
||||
return productCategoryVos;
|
||||
}
|
||||
|
||||
private List<ProductCategoryVo> convertToProductCategoryVoTree(List<Category> categoryList) {
|
||||
ArrayList<ProductCategoryVo> productCategoryVos = new ArrayList<>();
|
||||
HashMap<Integer, ProductCategoryVo> idToProductCategoryVoMap = new HashMap<>();
|
||||
|
||||
for (Category category : categoryList) {
|
||||
ProductCategoryVo productCategoryVo = new ProductCategoryVo();
|
||||
productCategoryVo.setId(category.getId());
|
||||
productCategoryVo.setName(category.getCategoryName());
|
||||
productCategoryVo.setParentId(category.getParentId());
|
||||
productCategoryVo.setChildrenList(new ArrayList<>());
|
||||
idToProductCategoryVoMap.put(category.getId(),productCategoryVo);
|
||||
}
|
||||
|
||||
for (ProductCategoryVo productCategoryVo : idToProductCategoryVoMap.values()) {
|
||||
if(productCategoryVo.getParentId()==0){
|
||||
productCategoryVos.add(productCategoryVo);
|
||||
}else {
|
||||
Integer parentId = productCategoryVo.getParentId();
|
||||
ProductCategoryVo parentProductCategoryVo = idToProductCategoryVoMap.get(parentId);
|
||||
if(parentProductCategoryVo!=null){
|
||||
parentProductCategoryVo.getChildrenList().add(productCategoryVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return productCategoryVos;
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package com.muyu.product.service.impl;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.product.domain.DTO.Brand;
|
||||
import com.muyu.product.mapper.BrandMapper;
|
||||
import com.muyu.product.service.BrandService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/2 19:51
|
||||
*/
|
||||
@Service
|
||||
public class BrandServiceImpl implements BrandService {
|
||||
|
||||
@Autowired
|
||||
private BrandMapper brandMapper;
|
||||
@Override
|
||||
public Integer insertBrand(Brand brand) {
|
||||
brand.setCreateBy(SecurityUtils.getUsername());
|
||||
return brandMapper.insertBrand(brand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteBrand(Integer brandId) {
|
||||
return brandMapper.deleteBrand(brandId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Integer updateBrand(Brand brand) {
|
||||
brand.setCreateBy(SecurityUtils.getUsername());
|
||||
return brandMapper.updateBrand(brand);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package com.muyu.product.service.impl;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.product.domain.DTO.Category;
|
||||
import com.muyu.product.mapper.CategoryMapper;
|
||||
import com.muyu.product.service.CategoryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/1 10:32
|
||||
*/
|
||||
@Service
|
||||
public class CategoryServiceImpl implements CategoryService {
|
||||
|
||||
@Autowired
|
||||
private CategoryMapper categoryMapper;
|
||||
@Override
|
||||
public List<Category> queryCategory() {
|
||||
return categoryMapper.queryCategory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteCategory(Integer categoryId) {
|
||||
return categoryMapper.deleteCategory(categoryId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer insertCategory(Category category) {
|
||||
category.setCreateBy(SecurityUtils.getUsername());
|
||||
return categoryMapper.insertCategory(category);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateCategory(Category category) {
|
||||
category.setCreateBy(SecurityUtils.getUsername());
|
||||
return categoryMapper.updateCategory(category);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Category> queryCategorParent() {
|
||||
return categoryMapper.queryCategorParent();
|
||||
}
|
||||
}
|
|
@ -1,261 +0,0 @@
|
|||
package com.muyu.product.service.impl;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.github.pagehelper.PageHelper; // 导入 PageHelper 类
|
||||
import com.github.pagehelper.PageInfo; // 导入 PageInfo 类
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.product.domain.DTO.ProductSkuAttr; // 导入 ProductSkuAttr 类
|
||||
|
||||
|
||||
import com.muyu.product.domain.DTO.*;
|
||||
import com.muyu.product.domain.DTO.Number;
|
||||
import com.muyu.product.domain.Resp.ProductResp;
|
||||
import com.muyu.product.domain.req.ProductReq;
|
||||
import com.muyu.product.domain.req.ProductSkuNew;
|
||||
import com.muyu.product.domain.req.QueryProductReq;
|
||||
import com.muyu.product.domain.vo.ProductVo;
|
||||
import com.muyu.product.mapper.ProductMapper;
|
||||
import com.muyu.product.mapper.ProductSkuMapper;
|
||||
import com.muyu.product.mapper.PromotionMapper;
|
||||
import com.muyu.product.service.ProductService;
|
||||
import com.muyu.product.service.ServiceService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
|
||||
@Service
|
||||
@Log4j2
|
||||
public class ProductServiceImpl implements ProductService {
|
||||
|
||||
@Resource
|
||||
private ProductMapper productMapper;
|
||||
|
||||
@Autowired
|
||||
private ServiceService serviceService;
|
||||
|
||||
@Resource
|
||||
private PromotionMapper promotionMapper;
|
||||
|
||||
@Autowired
|
||||
private ProductSkuMapper productSkuMapper;
|
||||
|
||||
private ExecutorService executor = Executors.newFixedThreadPool(3);
|
||||
|
||||
|
||||
// 检查产品参数
|
||||
public void checkProductParams(ProductReq productReq) {
|
||||
|
||||
|
||||
try {
|
||||
// 异步执行方法类型检查
|
||||
CompletableFuture<ValidationResult> methodTypeFuture =
|
||||
CompletableFuture.supplyAsync(() -> checkMethodType(productReq), executor);
|
||||
// 异步执行查找skuId检查
|
||||
CompletableFuture<ValidationResult> skuIdFuture =
|
||||
CompletableFuture.supplyAsync(() -> findSkuId(productReq), executor);
|
||||
// 异步执行产品编号检查
|
||||
CompletableFuture<ValidationResult> productNumberFuture =
|
||||
CompletableFuture.supplyAsync(() -> checkProductNumber(productReq), executor);
|
||||
|
||||
// 组合所有的异步任务,判断是否所有检查通过
|
||||
CompletableFuture<String> allValidFuture =
|
||||
CompletableFuture.allOf(methodTypeFuture, skuIdFuture, productNumberFuture)
|
||||
.thenApply(ignored -> {
|
||||
boolean allValid = methodTypeFuture.join().isValid()
|
||||
&& skuIdFuture.join().isValid()
|
||||
&& productNumberFuture.join().isValid();
|
||||
return allValid ? "所有检查通过" : "存在检查未通过";
|
||||
})
|
||||
.exceptionally(throwable -> "校验过程发生异常: " + throwable.getMessage());
|
||||
|
||||
// 输出结果
|
||||
allValidFuture.thenAccept(System.out::println);
|
||||
} catch (Exception e) {
|
||||
System.err.println("校验过程发生异常: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// 检查产品编号
|
||||
private ValidationResult checkProductNumber(ProductReq productReq) {
|
||||
try {
|
||||
Integer productNumber = productMapper.findProductNumber(String.valueOf(productReq.getProduct().getProductNumber()));
|
||||
if (productNumber < Integer.valueOf(Number.zero.getValue())) {
|
||||
return new ValidationResult(false, "productNumber不能重复");
|
||||
}
|
||||
return new ValidationResult(true, "productNumber检查通过");
|
||||
} catch (Exception e) {
|
||||
return new ValidationResult(false, "检查产品编号时发生异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
private ValidationResult findSkuId(ProductReq productReq) {
|
||||
Integer skuId = productSkuMapper.findSkuId(productReq.getProductSkus());
|
||||
if(skuId>=Integer.valueOf(Number.zero.getValue())){
|
||||
return new ValidationResult(false,"skuID不能重复");
|
||||
}
|
||||
return new ValidationResult(true,"通过");
|
||||
}
|
||||
|
||||
private ValidationResult checkMethodType(ProductReq productReq) {
|
||||
if(productReq.getProduct().getMethodType() == null){
|
||||
return new ValidationResult(false,"method type 不能空");
|
||||
}
|
||||
return new ValidationResult(true,"通过");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageInfo<ProductResp> queryProduct(QueryProductReq productReq) {
|
||||
PageHelper.startPage(productReq.getPageNum(),productReq.getPageSize());
|
||||
List<ProductResp>products=productMapper.queryProduct(productReq);
|
||||
PageInfo<ProductResp> pageInfo = new PageInfo<>(products);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void productInsert(ProductReq productReq) {
|
||||
long start =System.currentTimeMillis();
|
||||
|
||||
checkProductParams(productReq);
|
||||
|
||||
insertProduct(productReq.getProduct());
|
||||
|
||||
insertProductService(productReq.getProduct().getId(),productReq.getServiceIds());
|
||||
|
||||
|
||||
insertProductPromotion(productReq);
|
||||
|
||||
// insertProductSku(productReq);
|
||||
|
||||
log.info("耗时:{}",(System.currentTimeMillis()-start));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteProduct(Integer id) {
|
||||
return productMapper.deleteProduct(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void productUpdate(ProductReq productReq) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductVo queryProductDetails(Integer id) {
|
||||
return productMapper.queryProductDetails(id);
|
||||
}
|
||||
|
||||
private void insertProductSku(ProductReq productReq) {
|
||||
List<ProductSku> productSkuList = productReq.getProductSkus();
|
||||
String createBy = SecurityUtils.getUsername();
|
||||
//批量添加
|
||||
productSkuMapper.insertProductSku(productSkuList,productReq.getProduct().getId(),createBy);
|
||||
//添加skuAttr除实体类以外的字段
|
||||
ArrayList<ProductSkuAttr> productSkuAttrs = new ArrayList<>();
|
||||
productSkuList.forEach(productSkusReq -> {
|
||||
//获取id
|
||||
//productSkusReq.setProductId(productReq.getProduct().getId());
|
||||
//获取map的属性值
|
||||
ProductSkuNew productSkuNew = com.alibaba.fastjson2.JSONObject.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(productSkusReq), ProductSkuNew.class);
|
||||
HashMap hashMap = com.alibaba.fastjson2.JSONObject.parseObject(JSONObject.toJSONString(productSkuNew), HashMap.class);
|
||||
Set skuReq = productSkusReq.keySet();
|
||||
Set sku = hashMap.keySet();
|
||||
//添加一个新的set
|
||||
Set set = skuReq;
|
||||
//去重
|
||||
set.removeAll(sku);
|
||||
//格属性赋值
|
||||
set.forEach(key ->{
|
||||
ProductSkuAttr productSkuAttr = new ProductSkuAttr();
|
||||
productSkuAttr.setSkuId(productSkuNew.getId());
|
||||
productSkuAttr.setAttrId(Integer.valueOf(key.toString()));
|
||||
productSkuAttr.setAttrValueId(Integer.valueOf(productSkusReq.get(key).toString()));
|
||||
productSkuAttr.setFlag(Integer.valueOf(Number.zero.getValue()));
|
||||
productSkuAttrs.add(productSkuAttr);
|
||||
});
|
||||
});
|
||||
//批量添加productSkuAttr
|
||||
productSkuMapper.insertProductSkuAttr(productSkuAttrs);
|
||||
}
|
||||
|
||||
private void insertProductPromotion(ProductReq productReq) {
|
||||
Integer methodType = productReq.getProduct().getMethodType();
|
||||
|
||||
//没有优惠
|
||||
if(Number.zero.getValue().equals(String.valueOf(methodType))){
|
||||
updateMethodId(Integer.valueOf(Number.zero.getValue()));
|
||||
}
|
||||
|
||||
//特价优惠
|
||||
if(Number.one.getValue().equals(String.valueOf(methodType))){
|
||||
Preference preference = productReq.getPreference();
|
||||
promotionMapper.insertPreference(preference);
|
||||
updateMethodId(preference.getId());
|
||||
}
|
||||
|
||||
//会员优惠
|
||||
if(Number.two.getValue().equals(String.valueOf(methodType))){
|
||||
Member member = productReq.getMember();
|
||||
promotionMapper.insertMember(member);
|
||||
updateMethodId(member.getId());
|
||||
}
|
||||
|
||||
//阶梯价格
|
||||
if(Number.three.getValue().equals(String.valueOf(methodType))){
|
||||
List<Ladder> ladder = productReq.getLadder();
|
||||
ladder.forEach(item -> {
|
||||
promotionMapper.insertLadder(item);
|
||||
});
|
||||
}
|
||||
|
||||
//满减价格
|
||||
if(Number.four.getValue().equals(String.valueOf(methodType))){
|
||||
List<Price> price = productReq.getPrice();
|
||||
price.forEach(item -> {
|
||||
promotionMapper.insertPrice(item);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void updateMethodId(Integer id) {
|
||||
productMapper.updateMothodId(id);
|
||||
}
|
||||
|
||||
private void insertProductService(Integer id, List<Integer> serviceIds) {
|
||||
serviceService.insertProductService(id,serviceIds);
|
||||
}
|
||||
|
||||
|
||||
private void insertProduct(Product product) {
|
||||
product.setCreateBy(SecurityUtils.getUsername());
|
||||
productMapper.insertProduct(product);
|
||||
}
|
||||
|
||||
private void calculateProductPrice(ProductReq productReq){
|
||||
Integer methodType = productReq.getProduct().getMethodType();
|
||||
|
||||
//特价
|
||||
if(Number.one.getValue().equals(String.valueOf(methodType))){
|
||||
|
||||
LocalDateTime now=LocalDateTime.now();
|
||||
|
||||
LocalDateTime start = productReq.getPreference().getPreferenceStartTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||
LocalDateTime end = productReq.getPreference().getPreferenceEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||
|
||||
|
||||
if(now.isAfter(start)&&now.isBefore(end)){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.muyu.product.service.impl;
|
||||
|
||||
import com.muyu.product.mapper.ServicesMapper;
|
||||
import com.muyu.product.service.ServiceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/3/29 17:05
|
||||
*/
|
||||
@Service
|
||||
public class ServiceServiceImpl implements ServiceService {
|
||||
|
||||
@Autowired
|
||||
private ServicesMapper servicesMapper;
|
||||
@Override
|
||||
public int insertProductService(Integer productId, List<Integer> serviceIds) {
|
||||
return servicesMapper.insertProductService(productId,serviceIds);
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package com.muyu.product.service.impl;
|
||||
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.product.domain.DTO.ProductSku;
|
||||
import com.muyu.product.domain.PmsSkuStockExample;
|
||||
import com.muyu.product.mapper.SkuMapper;
|
||||
import com.muyu.product.service.SkuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/5 20:35
|
||||
*/
|
||||
@Service
|
||||
public class SkuServiceImpl implements SkuService {
|
||||
|
||||
@Autowired
|
||||
private SkuMapper skuMapper;
|
||||
@Override
|
||||
public List<ProductSku> getList(Long pid, String keyword) {
|
||||
PmsSkuStockExample example = new PmsSkuStockExample();
|
||||
PmsSkuStockExample.Criteria criteria = example.createCriteria().andProductIdEqualTo(pid);
|
||||
if (!StringUtils.isEmpty(keyword)) {
|
||||
criteria.andSkuCodeLike("%" + keyword + "%");
|
||||
}
|
||||
return skuMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(Long pid, List<ProductSku> skuList) {
|
||||
List<ProductSku>fileterSkuList=skuList.stream()
|
||||
.filter(item -> pid.equals(item.getProductId()))
|
||||
.collect(Collectors.toList());
|
||||
return skuMapper.replaceList(fileterSkuList);
|
||||
}
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
package com.muyu.product.service.impl;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.product.domain.DTO.ProductType;
|
||||
import com.muyu.product.domain.DTO.ProductTypeAttr;
|
||||
import com.muyu.product.domain.DTO.ProductTypeAttrValue;
|
||||
import com.muyu.product.domain.Resp.ProductTypeResp;
|
||||
import com.muyu.product.domain.req.ProductTypeAttrReq;
|
||||
import com.muyu.product.mapper.TypeMapper;
|
||||
import com.muyu.product.service.TypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/1 11:15
|
||||
*/
|
||||
@Service
|
||||
public class TypeServiceImpl implements TypeService {
|
||||
|
||||
@Autowired
|
||||
private TypeMapper typeMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<ProductTypeResp> queryTypeAll() {
|
||||
return typeMapper.queryTypeAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductTypeAttr> queryType(Integer flag, Integer id) {
|
||||
return typeMapper.queryType(flag, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteType(Integer typeId) {
|
||||
String name = SecurityUtils.getUsername();
|
||||
return typeMapper.deleteType(typeId, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteTypeAttr(Integer typeId) {
|
||||
typeMapper.deleteTypeAttrValue(typeId);
|
||||
return typeMapper.deleteTypeAttr(typeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer insertType(ProductType productType) {
|
||||
productType.setCreateBy(SecurityUtils.getUsername());
|
||||
return typeMapper.insertType(productType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateType(ProductType productType) {
|
||||
productType.setCreateBy(SecurityUtils.getUsername());
|
||||
return typeMapper.updateType(productType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer insertTypeAttr(ProductTypeAttrReq productTypeAttrReq) {
|
||||
productTypeAttrReq.setCreateBy(SecurityUtils.getUsername());
|
||||
Integer res = typeMapper.insertTypeAttr(productTypeAttrReq);
|
||||
|
||||
String[] split = productTypeAttrReq.getProductTypeAttrValueList().split(",");
|
||||
|
||||
if (res > 0) {
|
||||
Integer typeAttrId = productTypeAttrReq.getId();
|
||||
ProductTypeAttrValue productTypeAttrValue = new ProductTypeAttrValue();
|
||||
for (String s : split) {
|
||||
productTypeAttrValue.setCreateBy(SecurityUtils.getUsername());
|
||||
productTypeAttrValue.setTypeAttrId(typeAttrId);
|
||||
productTypeAttrValue.setTypeAttrValue(s);
|
||||
typeMapper.insertTypeValue(productTypeAttrValue);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateTypeAttr(ProductTypeAttrReq productTypeAttrReq) {
|
||||
productTypeAttrReq.setCreateBy(SecurityUtils.getUsername());
|
||||
typeMapper.deleteTypeAttrValue(productTypeAttrReq.getId());
|
||||
Integer res = typeMapper.updateAttr(productTypeAttrReq);
|
||||
String[] split = productTypeAttrReq.getProductTypeAttrValueList().split(",");
|
||||
if (res > 0) {
|
||||
Integer typeAttrId = productTypeAttrReq.getId();
|
||||
ProductTypeAttrValue productTypeAttrValue = new ProductTypeAttrValue();
|
||||
for (String s : split) {
|
||||
productTypeAttrValue.setCreateBy(SecurityUtils.getUsername());
|
||||
productTypeAttrValue.setTypeAttrId(typeAttrId);
|
||||
productTypeAttrValue.setTypeAttrValue(s);
|
||||
typeMapper.insertTypeValue(productTypeAttrValue);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ server:
|
|||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: muyu-product-wxy
|
||||
name: muyu-product
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
|
@ -14,9 +14,8 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 43.142.117.78:8848
|
||||
server-addr: 111.231.174.71:8848
|
||||
namespace: 9facbf7b-873b-4e11-b54f-00627208906d
|
||||
ip: 111.231.174.71
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 111.231.174.71:8848
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.ArgumentMapper">
|
||||
|
||||
|
||||
<sql id="sql">id,
|
||||
brand_name,first_letter,sort,factory_status,show_status,product_count,product_comment_count,logo,big_pic,brand_story
|
||||
</sql>
|
||||
|
||||
<select id="queryBrand" resultType="com.muyu.product.domain.DTO.Brand">
|
||||
select <include refid="sql"></include>
|
||||
from t_product_brand
|
||||
<where>
|
||||
id_delete= 1
|
||||
<if test="brandName != null and brandName != 'null' and brandName != ''">
|
||||
and brand_Name like concat('%',#{brandName},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="queryService" resultType="com.muyu.product.domain.DTO.Services">
|
||||
select id,service_name from
|
||||
t_product_service where id_delete =1
|
||||
</select>
|
||||
|
||||
<select id="queryCategory" resultType="com.muyu.product.domain.DTO.Category">
|
||||
select id,parent_id,category_name from t_product_category where id_delete =1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -1,51 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.BrandMapper">
|
||||
<insert id="insertBrand">
|
||||
INSERT INTO `product`.`t_product_brand` (
|
||||
`brand_name`,
|
||||
`first_letter`,
|
||||
`sort`,
|
||||
`factory_status`,
|
||||
`show_status`,
|
||||
`product_count`,
|
||||
`product_comment_count`,
|
||||
`logo`,
|
||||
`big_pic`,
|
||||
`brand_story`,
|
||||
`create_by`,
|
||||
`create_time`
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{brandName},
|
||||
#{firstLetter},
|
||||
#{sort},
|
||||
#{factoryStatus},
|
||||
#{showStatus},
|
||||
#{productCount},
|
||||
#{productCommentCount},
|
||||
#{logo},
|
||||
#{bigPic},
|
||||
#{brandStory},
|
||||
#{createBy},
|
||||
now()
|
||||
);
|
||||
</insert>
|
||||
<update id="updateBrand">
|
||||
update t_product_brand set brand_name= #{brandName},first_letter=#{firstLetter},sort=#{sort},factory_status=#{factoryStatus}
|
||||
,show_status=#{showStatus},product_count=#{productCount},product_comment_count=#{productCommentCount},logo=#{logo},
|
||||
big_pic=#{bigPic},brand_story=#{brandStory},create_by=#{createBy},update_time=now() where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 添加其他操作方法如插入、更新、删除等 -->
|
||||
|
||||
<delete id="deleteBrand">
|
||||
update t_product_brand set id_delete = 0 where id = #{id} <!--逻辑删除id_delete=0为删除-->
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -1,80 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.CategoryMapper">
|
||||
|
||||
<sql id="sqlCategory">
|
||||
id,parent_id,category_name,level,product_count
|
||||
,product_unit,nav_status,show_status,sort,icon,keywords,description
|
||||
</sql>
|
||||
|
||||
<insert id="insertCategory">
|
||||
INSERT INTO `t_product_category` (
|
||||
`parent_id`,
|
||||
`category_name`,
|
||||
`level`,
|
||||
`product_count`,
|
||||
`product_unit`,
|
||||
`nav_status`,
|
||||
`show_status`,
|
||||
`sort`,
|
||||
`icon`,
|
||||
`keywords`,
|
||||
`description`,
|
||||
`create_time`,
|
||||
`create_by`
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{parentId},
|
||||
#{categoryName},
|
||||
#{level},
|
||||
#{productCount},
|
||||
#{productUnit},
|
||||
#{navStatus},
|
||||
#{showStatus},
|
||||
#{sort},
|
||||
#{icon},
|
||||
#{keywords},
|
||||
#{description},
|
||||
now(),
|
||||
#{createBy}
|
||||
);
|
||||
</insert>
|
||||
|
||||
<update id="deleteCategory">
|
||||
update t_product_category set id_delete = 0 where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateCategory">
|
||||
UPDATE `t_product_category`
|
||||
SET `parent_id` = #{parentId},
|
||||
`category_name` = #{categoryName},
|
||||
`level` = #{level},
|
||||
`product_count` = #{productCount},
|
||||
`product_unit` = #{productUnit},
|
||||
`nav_status` = #{navStatus},
|
||||
`show_status` = #{showStatus},
|
||||
`sort` = #{sort},
|
||||
`icon` = #{icon},
|
||||
`keywords` = #{keywords},
|
||||
`description` = #{description},
|
||||
`update_time` = now(),
|
||||
`create_by` = #{createBy}
|
||||
WHERE
|
||||
`id` = #{id};
|
||||
</update>
|
||||
|
||||
|
||||
<select id="queryCategory" resultType="com.muyu.product.domain.DTO.Category">
|
||||
select <include refid="sqlCategory"></include> from t_product_category where id_delete =1
|
||||
</select>
|
||||
|
||||
<select id="queryCategorParent" resultType="com.muyu.product.domain.DTO.Category">
|
||||
select <include refid="sqlCategory"></include> from t_product_category where id_delete =1 and parent_Id =0
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -1,135 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.ProductMapper">
|
||||
|
||||
|
||||
<sql id="sql">
|
||||
t_product.id,product_name,product_number,brand_id,type_id,product_subheading,product_examine,
|
||||
product_information,product_unit,product_weight,product_sort,product_points,
|
||||
product_growth,product_max_points,product_foreknow,product_status,product_new,
|
||||
product_recommended,details_title,details_information,details_key_word,details_remark,
|
||||
method_type,t_product_brand.brand_name,t_product_type.type_name,sale_price,images_url,sales
|
||||
</sql>
|
||||
<insert id="insertProduct" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO `t_product` (
|
||||
`product_name`,
|
||||
`product_number`,
|
||||
`brand_id`,
|
||||
`type_id`,
|
||||
`product_subheading`,
|
||||
`product_examine`,
|
||||
`product_information`,
|
||||
`product_unit`,
|
||||
`product_weight`,
|
||||
`product_sort`,
|
||||
`product_points`,
|
||||
`product_growth`,
|
||||
`product_max_points`,
|
||||
`product_foreknow`,
|
||||
`product_status`,
|
||||
`product_new`,
|
||||
`product_recommended`,
|
||||
`details_title`,
|
||||
`details_information`,
|
||||
`details_key_word`,
|
||||
`details_remark`,
|
||||
`method_type`,
|
||||
`create_by`,
|
||||
`create_time`,
|
||||
`sales`
|
||||
) VALUES (
|
||||
#{productName},
|
||||
#{productNumber},
|
||||
#{brandId},
|
||||
#{typeId},
|
||||
#{productSubheading},
|
||||
#{productExamine},
|
||||
#{productInformation},
|
||||
#{productUnit},
|
||||
#{productWeight},
|
||||
#{productSort},
|
||||
#{productPoints},
|
||||
#{productGrowth},
|
||||
#{productMaxPoints},
|
||||
#{productForeknow},
|
||||
#{productStatus},
|
||||
#{productNew},
|
||||
#{productRecommended},
|
||||
#{detailsTitle},
|
||||
#{detailsInformation},
|
||||
#{detailsKeyWord},
|
||||
#{detailsRemark},
|
||||
#{methodType},
|
||||
#{createBy},
|
||||
NOW(),
|
||||
#{sales}
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateMothodId">
|
||||
update t_product set method_id =#{methodId} where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteProduct">
|
||||
update t_product set id_delete = 0 where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="queryProduct" resultType="com.muyu.product.domain.Resp.ProductResp">
|
||||
select <include refid="sql"></include> from t_product
|
||||
LEFT JOIN t_product_brand ON t_product.brand_id = t_product_brand.id
|
||||
LEFT join t_product_type ON t_product.type_id = t_product_type.id
|
||||
left JOIN t_product_sku on t_product_sku.product_id = t_product.id
|
||||
left join t_product_images on t_product.id = t_product_images.product_id
|
||||
<where>
|
||||
t_product.id_delete = 1
|
||||
<if test="productName != null and productName != ''">
|
||||
and product_name like concat('%',#{productName},'%')
|
||||
</if>
|
||||
<if test="productNumber != null and productNumber != ''">
|
||||
and product_number like concat('%',#{productNumber},'%')
|
||||
</if>
|
||||
<if test="productStatus != null">
|
||||
and product_status = #{productStatus}
|
||||
</if>
|
||||
<if test="productExamine != null">
|
||||
and product_examine = #{productExamine}
|
||||
</if>
|
||||
<if test="brandId != null and brandId>0">
|
||||
and t_product.brand_id = #{brandId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId >0">
|
||||
and t_product.type_id = #{typeId}
|
||||
</if>
|
||||
</where>
|
||||
order by product_sort
|
||||
</select>
|
||||
|
||||
<select id="findProductNumber" resultType="java.lang.Integer">
|
||||
select count(id) from t_product where id_delete = 1 and product_number = #{productNumber}
|
||||
</select>
|
||||
|
||||
<select id="queryProductDetails" resultType="com.muyu.product.domain.vo.ProductVo">
|
||||
SELECT
|
||||
p.id,
|
||||
product_name,
|
||||
p.product_information,
|
||||
details_title,
|
||||
details_information,
|
||||
brand_name,
|
||||
sale_price,
|
||||
promotion_price,
|
||||
images_url,
|
||||
GROUP_CONCAT( service_name ) service_name ,
|
||||
type_name
|
||||
FROM
|
||||
t_product p
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 添加其他操作方法如插入、更新、删除等 -->
|
||||
|
||||
</mapper>
|
|
@ -1,66 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.ProductSkuMapper">
|
||||
|
||||
|
||||
|
||||
<!-- 添加其他操作方法如插入、更新、删除等 -->
|
||||
|
||||
<insert id="insertProductSku">
|
||||
insert t_product_sku (
|
||||
id,
|
||||
sale_price,
|
||||
promotion_price,
|
||||
stock,
|
||||
stock_alert,
|
||||
product_id,
|
||||
bg_img,
|
||||
create_time
|
||||
)
|
||||
values
|
||||
<foreach collection="productSkus" item="productSku" separator=",">
|
||||
(
|
||||
#{productSku.id},
|
||||
#{productSku.salePrice},
|
||||
#{productSku.promotionPrice},
|
||||
#{productSku.stock},
|
||||
#{productSku.stockAlert},
|
||||
${id},
|
||||
#{productSku.bgImg},
|
||||
now()
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="insertProductSkuAttr">
|
||||
INSERT INTO `t_product_sku_attr` (
|
||||
`sku_id`, `attr_id`, `attr_value_id`, `attr_value`, `flag`, `create_time`, `create_by`
|
||||
) VALUES
|
||||
<foreach collection="productSkuAttrs" separator="," item="productSkuAttr">
|
||||
(
|
||||
#{productSkuAttr.skuId},
|
||||
#{productSkuAttr.attrId},
|
||||
#{productSkuAttr.attrValueId},
|
||||
#{productSkuAttr.attrValue},
|
||||
#{productSkuAttr.flag},
|
||||
now(),
|
||||
#{productSkuAttr.createBy}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="findSkuId" resultType="java.lang.Integer">
|
||||
select count(id) from t_product_sku where id_delete = 1 and id in
|
||||
<foreach collection="productSkus" separator="," open="(" close=")" item="id">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="querySku" resultType="com.muyu.product.domain.DTO.ProductSku">
|
||||
select * from t_product_sku
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -1,39 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.PromotionMapper">
|
||||
|
||||
|
||||
|
||||
<!-- 添加其他操作方法如插入、更新、删除等 -->
|
||||
|
||||
|
||||
<insert id="insertPreference">
|
||||
INSERT INTO `t_product_preference` ( `preference_start_time`, `preference_end_time`, `preference_price`, `create_time`, `create_by`)
|
||||
VALUES (#{preferenceStartTime},#{preferenceEndTime},#{preferencePrice}, now(), #{createBy})
|
||||
</insert>
|
||||
|
||||
<insert id="insertMember">
|
||||
INSERT INTO `t_product_member` ( `member_gold`, `member_silver`, `member_diamond`, `create_time`, `create_by` )
|
||||
VALUES
|
||||
( #{memberGold},#{memberSilver},#{memberDiamond},now(),#{createBy} )
|
||||
</insert>
|
||||
<insert id="insertLadder">
|
||||
INSERT INTO `t_product_ladder` ( `ladder_num`, `ladder_discount`, `create_time`, `create_by` )
|
||||
VALUES
|
||||
(
|
||||
#{ladderNum},
|
||||
#{ladderDiscount},
|
||||
now(),
|
||||
#{createBy}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertPrice">
|
||||
INSERT INTO `t_product_price` ( `price_max`, `price_reduction`, `create_time`, `create_by`)
|
||||
VALUES (#{priceMax},#{priceReduction},now(),#{createBy})
|
||||
</insert>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.ServicesMapper">
|
||||
|
||||
|
||||
|
||||
<!-- 添加其他操作方法如插入、更新、删除等 -->
|
||||
|
||||
|
||||
<insert id="insertProductService">
|
||||
insert into t_product_service_middle(product_id, service_id) values (1, 2);
|
||||
</insert>
|
||||
|
||||
</mapper>
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.SkuMapper">
|
||||
|
||||
|
||||
|
||||
<insert id="replaceList">
|
||||
REPLACE INTO t_product_sku (id,sale_price, promotion_price, stock, stock_alert, product_id,bg_img) VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.id,jdbcType=BIGINT},
|
||||
#{item.sale_price,jdbcType=DECIMAL},
|
||||
#{item.promotion_price,jdbcType=DECIMAL},
|
||||
#{item.stock,jdbcType=INTEGER},
|
||||
#{item.stick_alert,jdbcType=INTEGER},
|
||||
#{item.product_id,jdbcType=INTEGER},
|
||||
#{item.bg_img,jdbcType=VARCHAR},
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectByExample" resultType="com.muyu.product.domain.DTO.ProductSku">
|
||||
select
|
||||
*
|
||||
from t_product_sku
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -1,160 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.TypeMapper">
|
||||
|
||||
<insert id="insertType">
|
||||
insert t_product_type(type_name,create_by,create_time) value (#{typeName},#{createBy},now())
|
||||
</insert>
|
||||
|
||||
<insert id="insertTypeAttr" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO `product`.`t_product_type_attr` (
|
||||
`product_type_id`,
|
||||
`attr_name`,
|
||||
`multiple_choice`,
|
||||
`input_method`,
|
||||
`sort`,
|
||||
`flag`,
|
||||
`screen`,
|
||||
`search`,
|
||||
`association`,
|
||||
`stats`,
|
||||
`input`,
|
||||
`selection`,
|
||||
`manual_operation`,
|
||||
`create_time`,
|
||||
`create_by`
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{productTypeId},
|
||||
#{attrName},
|
||||
#{multipleChoice},
|
||||
#{input},
|
||||
#{sort},
|
||||
#{flag},
|
||||
#{screen},
|
||||
#{search},
|
||||
#{association},
|
||||
#{stats},
|
||||
#{input},
|
||||
#{selection},
|
||||
#{manualOperation},
|
||||
now(),
|
||||
#{createBy}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertTypeValue">
|
||||
INSERT INTO `product`.`t_product_type_attr_value` ( `type_attr_id`, `type_attr_value`, `input_method`, `create_time`, `create_by` )
|
||||
VALUES
|
||||
(
|
||||
#{typeAttrId},
|
||||
#{typeAttrValue},
|
||||
#{inputMethod},
|
||||
now(),
|
||||
#{createBy}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="deleteType">
|
||||
update t_product_type set id_delete = 0,update_time = now(),create_by=#{name} where id = #{typeId}
|
||||
</update>
|
||||
|
||||
<update id="updateType">
|
||||
update t_product_type set type_name = #{typeName},update_time = now(),create_by=#{createBy} where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateAttr">
|
||||
UPDATE `product`.`t_product_type_attr`
|
||||
SET `product_type_id` = #{productTypeId},
|
||||
`attr_name` = #{attrName},
|
||||
`multiple_choice` = #{multipleChoice},
|
||||
`input_method` = #{inputMethod},
|
||||
`sort` = #{sort},
|
||||
`flag` = #{flag},
|
||||
`screen` = #{screen},
|
||||
`search` = #{search},
|
||||
`association` = #{association},
|
||||
`stats` = #{stats},
|
||||
`input` = #{input},
|
||||
`selection` = #{selection},
|
||||
`manual_operation` = #{manualOperation},
|
||||
`update_time` = now(),
|
||||
`create_by` = #{createBy}
|
||||
WHERE
|
||||
`id` = #{id}
|
||||
</update>
|
||||
<delete id="deleteTypeAttr">
|
||||
delete from t_product_type_attr where product_type_id = #{id}
|
||||
</delete>
|
||||
<delete id="deleteTypeAttrValue">
|
||||
delete from t_product_type_attr_value where type_attr_id = #{id}
|
||||
</delete>
|
||||
<resultMap id="productTypeAttrResultMap" type="com.muyu.product.domain.DTO.ProductTypeAttr">
|
||||
<id column="id" property="id"/>
|
||||
<result column="product_type_id" property="productTypeId"/>
|
||||
<result column="attr_name" property="attrName"/>
|
||||
<result column="multiple_choice" property="multipleChoice"/>
|
||||
<result column="input_method" property="inputMethod"/>
|
||||
<result column="sort" property="sort"/>
|
||||
<result column="flag" property="flag"/>
|
||||
<result column="screen" property="screen"/>
|
||||
<result column="search" property="search"/>
|
||||
<result column="association" property="association"/>
|
||||
<result column="stats" property="stats"/>
|
||||
<result column="input" property="input"/>
|
||||
<result column="selection" property="selection"/>
|
||||
<result column="manual_operation" property="manualOperation"/>
|
||||
<result column="type_name" property="typeName"/>
|
||||
<!-- 集合属性映射 -->
|
||||
<collection property="typeAttrs" ofType="com.muyu.product.domain.DTO.TypeAttrs">
|
||||
<result column="tavId" property="typeAttrValueId"/>
|
||||
<result column="type_attr_value" property="typeAttrValueName"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<select id="queryType" resultMap="productTypeAttrResultMap">
|
||||
SELECT
|
||||
ta.id as id,
|
||||
tav.id as tavId,
|
||||
type_name,
|
||||
ta.product_type_id,
|
||||
attr_name,
|
||||
multiple_choice,
|
||||
ta.input_method,
|
||||
sort,
|
||||
flag,
|
||||
screen,
|
||||
search,
|
||||
association,
|
||||
stats,
|
||||
input,
|
||||
selection,
|
||||
manual_operation,
|
||||
tav.id as tavId,
|
||||
tav.type_attr_value
|
||||
FROM
|
||||
t_product_type t
|
||||
INNER JOIN t_product_type_attr ta ON t.id = ta.product_type_id
|
||||
INNER JOIN t_product_type_attr_value tav ON tav.type_attr_id = ta.id
|
||||
where ta.id_delete=1 and ta.flag = #{flag} and t.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="queryTypeAll" resultType="com.muyu.product.domain.Resp.ProductTypeResp">
|
||||
SELECT
|
||||
t.id,
|
||||
t.type_name,
|
||||
COALESCE(attr_counts.countNum, 0) AS countNum,
|
||||
COALESCE(param_counts.countParam, 0) AS countParam
|
||||
FROM
|
||||
t_product_type t
|
||||
LEFT JOIN
|
||||
(SELECT product_type_id, COUNT(id) AS countNum FROM t_product_type_attr WHERE flag = 0 AND id_delete = 1 GROUP BY product_type_id) attr_counts
|
||||
ON t.id = attr_counts.product_type_id
|
||||
LEFT JOIN
|
||||
(SELECT product_type_id, COUNT(id) AS countParam FROM t_product_type_attr WHERE flag = 1 AND id_delete = 1 GROUP BY product_type_id) param_counts
|
||||
ON t.id = param_counts.product_type_id
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue