浏览代码

商品增加商品中文名

Gaosheng 1 天之前
父节点
当前提交
d595acc107

+ 2 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/dto/GoodsPublishFrontParamDTO.java

@@ -27,6 +27,8 @@ public class GoodsPublishFrontParamDTO implements Serializable {
     //基本信息
     @ApiModelProperty(value = "商品名称为3到50个字符(商品副标题)", required = true)
     private String goodsName;
+    @ApiModelProperty(value = "商品中文名称")
+    private String goodsNameCn;
     @ApiModelProperty(value = "商品副标题,长度建议140个字符内")
     private String goodsBrief;
     @ApiModelProperty(value = "品牌ID")

+ 10 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/example/GoodsExample.java

@@ -55,6 +55,16 @@ public class GoodsExample implements Serializable {
     private String goodsNameLike;
 
     /**
+     * 商品中文名称
+     */
+    private String goodsNameCn;
+
+    /**
+     * 商品中文名称,用于模糊查询
+     */
+    private String goodsNameCnLike;
+
+    /**
      * 商品副标题,长度建议140个字符内
      */
     private String goodsBrief;

+ 10 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/example/ProductExample.java

@@ -53,6 +53,16 @@ public class ProductExample implements Serializable {
     private String goodsNameLike;
 
     /**
+     * 商品中文名称
+     */
+    private String goodsNameCn;
+
+    /**
+     * 商品中文名称
+     */
+    private String goodsNameCnLike;
+
+    /**
      * 规格值,用逗号分隔
      */
     private String specValues;

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/pojo/Goods.java

@@ -25,6 +25,9 @@ public class Goods implements Serializable {
     @ApiModelProperty("商品名称为3到50个字符(商品副标题)")
     private String goodsName;
 
+    @ApiModelProperty("商品中文名称")
+    private String goodsNameCn;
+
     @ApiModelProperty("商品副标题,长度建议140个字符内")
     private String goodsBrief;
 

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/goods/pojo/Product.java

@@ -27,6 +27,9 @@ public class Product implements Serializable {
     @ApiModelProperty("商品名称为3到50个字符(商品副标题)")
     private String goodsName;
 
+    @ApiModelProperty("商品中文名称)")
+    private String goodsNameCn;
+
     @ApiModelProperty("规格值,用逗号分隔")
     private String specValues;
 

+ 2 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/goods/GoodsSellerModel.java

@@ -350,6 +350,7 @@ public class GoodsSellerModel {
         product.setGoodsId(goods.getGoodsId());
         product.setWebSite(goods.getWebSite());
         product.setGoodsName(goods.getGoodsName());
+        product.setGoodsNameCn(goods.getGoodsNameCn());
         product.setSpecValues(productInsertInfo.getSpecValues());
         product.setSpecValueIds(productInsertInfo.getSpecValueIds());
         product.setBrandId(goods.getBrandId());
@@ -917,6 +918,7 @@ public class GoodsSellerModel {
             Product product = new Product();
             product.setProductId(productInsertInfo.getProductId());
             product.setGoodsName(updateGoods.getGoodsName());
+            product.setGoodsNameCn(updateGoods.getGoodsNameCn());
             product.setSpecValues(productInsertInfo.getSpecValues());
             product.setSpecValueIds(productInsertInfo.getSpecValueIds());
             product.setBrandId(StringUtil.isNullOrZero(updateGoods.getBrandId()) ? 0 : updateGoods.getBrandId());

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/GoodsVO.java

@@ -31,6 +31,9 @@ public class GoodsVO {
     @ApiModelProperty("商品名称")
     private String goodsName;
 
+    @ApiModelProperty("商品中文名称")
+    private String goodsNameCn;
+
     @ApiModelProperty("商品副标题")
     private String goodsBrief;
 
@@ -121,6 +124,7 @@ public class GoodsVO {
         this.goodsId = goods.getGoodsId();
         this.webSite = goods.getWebSite();
         this.goodsName = goods.getGoodsName();
+        this.goodsNameCn = goods.getGoodsNameCn();
         this.goodsBrief = goods.getGoodsBrief();
         this.categoryPath = goods.getCategoryPath();
         this.marketPrice = goods.getMarketPrice();

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/ProductVO.java

@@ -18,6 +18,7 @@ public class ProductVO {
         this.productId = product.getProductId();
         this.goodsId = product.getGoodsId();
         this.goodsName = product.getGoodsName();
+        this.goodsNameCn = product.getGoodsNameCn();
         this.specValueIds = product.getSpecValueIds();
         this.specValues = StringUtils.isEmpty(product.getSpecValues()) ? "默认" : product.getSpecValues();
         this.productPrice = product.getProductPrice();
@@ -43,6 +44,9 @@ public class ProductVO {
     @ApiModelProperty("商品名称为3到50个字符(商品副标题)")
     private String goodsName;
 
+    @ApiModelProperty("商品中文名称")
+    private String goodsNameCn;
+
     @ApiModelProperty("规格值,用逗号分隔")
     private String specValues;
 

+ 3 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/goods/SellerGoodsDetailVO.java

@@ -35,6 +35,8 @@ public class SellerGoodsDetailVO implements Serializable {
     private String webSite;
     @ApiModelProperty("商品名称为3到50个字符(商品副标题)")
     private String goodsName;
+    @ApiModelProperty("商品中文名称")
+    private String goodsNameCn;
     @ApiModelProperty("商品副标题,长度建议140个字符内")
     private String goodsBrief;
     @ApiModelProperty("品牌ID")
@@ -178,6 +180,7 @@ public class SellerGoodsDetailVO implements Serializable {
         //基本信息
         this.webSite = goods.getWebSite();
         this.goodsName = goods.getGoodsName();
+        this.goodsNameCn = goods.getGoodsNameCn();
         this.goodsBrief = goods.getGoodsBrief();
         this.brandId = goods.getBrandId();
         this.brandName = goods.getBrandName();

+ 7 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/goods/GoodsReadMapper.xml

@@ -5,6 +5,7 @@
     <id column="goods_id" property="goodsId" />
     <result column="web_site" property="webSite" />
     <result column="goods_name" property="goodsName" />
+    <result column="goods_name_cn" property="goodsNameCn" />
     <result column="goods_brief" property="goodsBrief" />
     <result column="keyword" property="keyword" />
     <result column="brand_id" property="brandId" />
@@ -78,6 +79,12 @@
         <if test="example.goodsNameLike != null">
           AND `goods_name` like concat('%',#{example.goodsNameLike},'%')
         </if>
+        <if test="example.goodsNameCn != null">
+          AND `goods_name_cn` = #{example.goodsNameCn}
+        </if>
+        <if test="example.goodsNameCnLike != null">
+          AND `goods_name_cn` like concat('%',#{example.goodsNameCnLike},'%')
+        </if>
         <if test="example.goodsBrief != null">
           AND `goods_brief` = #{example.goodsBrief}
         </if>

+ 7 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/goods/ProductReadMapper.xml

@@ -6,6 +6,7 @@
     <result column="web_site" property="webSite" />
     <result column="goods_id" property="goodsId" />
     <result column="goods_name" property="goodsName" />
+    <result column="goods_name_cn" property="goodsNameCn" />
     <result column="spec_values" property="specValues" />
     <result column="spec_value_ids" property="specValueIds" />
     <result column="brand_id" property="brandId" />
@@ -59,6 +60,12 @@
         <if test="example.goodsNameLike != null">
           AND `goods_name` like concat('%',#{example.goodsNameLike},'%')
         </if>
+        <if test="example.goodsNameCn != null">
+          AND `goods_name_cn` = #{example.goodsNameCn}
+        </if>
+        <if test="example.goodsNameCnLike != null">
+          AND `goods_name_cn` like concat('%',#{example.goodsNameCnLike},'%')
+        </if>
         <if test="example.specValues != null">
           AND `spec_values` = #{example.specValues}
         </if>

+ 19 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/write/goods/GoodsWriteMapper.xml

@@ -5,6 +5,7 @@
     <id column="goods_id" property="goodsId" />
     <result column="web_site" property="webSite" />
     <result column="goods_name" property="goodsName" />
+    <result column="goods_name_cn" property="goodsNameCn" />
     <result column="goods_brief" property="goodsBrief" />
     <result column="keyword" property="keyword" />
     <result column="brand_id" property="brandId" />
@@ -61,6 +62,9 @@
       <if test="goodsName != null">
         `goods_name`,
       </if>
+      <if test="goodsNameCn != null">
+        `goods_name_cn`,
+      </if>
       <if test="goodsBrief != null">
         `goods_brief`,
       </if>
@@ -215,6 +219,12 @@
         <if test="example.goodsNameLike != null">
           AND `goods_name` like concat('%',#{example.goodsNameLike},'%')
         </if>
+        <if test="example.goodsNameCn != null">
+          AND `goods_name_cn` = #{example.goodsNameCn}
+        </if>
+        <if test="example.goodsNameCnLike != null">
+          AND `goods_name_cn` like concat('%',#{example.goodsNameCnLike},'%')
+        </if>
         <if test="example.goodsBrief != null">
           AND `goods_brief` = #{example.goodsBrief}
         </if>
@@ -505,6 +515,9 @@
       <if test="goodsName != null">
         #{goodsName},
       </if>
+      <if test="goodsNameCn != null">
+        #{goodsNameCn}
+      </if>
       <if test="goodsBrief != null">
         #{goodsBrief},
       </if>
@@ -647,6 +660,9 @@
       <if test="record.goodsName != null">
         `goods_name` = #{record.goodsName},
       </if>
+      <if test="record.goodsNameCn != null">
+        `goods_name_cn` = #{record.goodsNameCn},
+      </if>
       <if test="record.goodsBrief != null">
         `goods_brief` = #{record.goodsBrief},
       </if>
@@ -789,6 +805,9 @@
       <if test="goodsName != null">
         `goods_name` = #{goodsName},
       </if>
+      <if test="goodsNameCn != null">
+        `goods_name_cn` = #{goodsNameCn},
+      </if>
       <if test="goodsBrief != null">
         `goods_brief` = #{goodsBrief},
       </if>

+ 19 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/write/goods/ProductWriteMapper.xml

@@ -6,6 +6,7 @@
     <result column="web_site" property="webSite" />
     <result column="goods_id" property="goodsId" />
     <result column="goods_name" property="goodsName" />
+    <result column="goods_name_cn" property="goodsNameCn" />
     <result column="spec_values" property="specValues" />
     <result column="spec_value_ids" property="specValueIds" />
     <result column="brand_id" property="brandId" />
@@ -48,6 +49,9 @@
       <if test="goodsName != null">
         `goods_name`,
       </if>
+      <if test="goodsNameCn != null">
+        `goods_name_cn`,
+      </if>
       <if test="specValues != null">
         `spec_values`,
       </if>
@@ -154,6 +158,12 @@
         <if test="example.goodsNameLike != null">
           AND `goods_name` like concat('%',#{example.goodsNameLike},'%')
         </if>
+        <if test="example.goodsNameCn != null">
+          AND `goods_name_cn` = #{example.goodsNameCn}
+        </if>
+        <if test="example.goodsNameCnLike != null">
+          AND `goods_name_cn` like concat('%',#{example.goodsNameCnLike},'%')
+        </if>
         <if test="example.specValues != null">
           AND `spec_values` = #{example.specValues}
         </if>
@@ -393,6 +403,9 @@
       <if test="goodsName != null">
         #{goodsName},
       </if>
+      <if test="goodsNameCn != null">
+        #{goodsNameCn},
+      </if>
       <if test="specValues != null">
         #{specValues},
       </if>
@@ -487,6 +500,9 @@
       <if test="record.goodsName != null">
         `goods_name` = #{record.goodsName},
       </if>
+      <if test="record.goodsNameCn != null">
+        `goods_name_cn` = #{record.goodsNameCn},
+      </if>
       <if test="record.specValues != null">
         `spec_values` = #{record.specValues},
       </if>
@@ -581,6 +597,9 @@
       <if test="goodsName != null">
         `goods_name` = #{goodsName},
       </if>
+      <if test="goodsNameCn != null">
+        `goods_name_cn` = #{goodsNameCn},
+      </if>
       <if test="specValues != null">
         `spec_values` = #{specValues},
       </if>

+ 4 - 0
xinkeaboard-server/doc/DDL/update.sql

@@ -5,8 +5,12 @@ ADD COLUMN web_site TINYINT NOT NULL DEFAULT 1 COMMENT '会员类型 1:海外门
 
 ALTER TABLE goods ADD COLUMN web_site TINYINT NOT NULL DEFAULT 1 COMMENT '发布站点 1:国外站 2:国内站' AFTER goods_id;
 
+ALTER TABLE goods ADD COLUMN goods_name_cn VARCHAR(200) NOT NULL COMMENT '商品中文名' AFTER goods_name ;
+
 ALTER TABLE product ADD COLUMN web_site TINYINT NOT NULL DEFAULT 1 COMMENT '发布站点 1:国外站 2:国内站' AFTER product_id;
 
+ALTER TABLE product ADD COLUMN goods_name_cn VARCHAR(200) NOT NULL COMMENT '商品中文名' AFTER goods_name;
+
 ALTER TABLE goods_related_template ADD COLUMN web_site TINYINT NOT NULL DEFAULT 1 COMMENT '站点 1:海外门户 2:国内分销门户';
 
 ALTER TABLE goods_parameter_group ADD COLUMN web_site TINYINT NOT NULL DEFAULT 1 COMMENT '站点 1:海外门户 2:国内分销门户';