chao 4 سال پیش
والد
کامیت
6958c7f44c

+ 0 - 4
src/main/java/com/caimei365/commodity/components/PriceUtilService.java

@@ -86,7 +86,6 @@ public class PriceUtilService {
             price.setActStatus(0);
             // 设置划线价
             price.setOriginalPrice(price.getPrice());
-            price.setRetailPrice(price.getPrice());
             //税费标志
             boolean taxFlag = "0".equals(price.getIncludedTax()) && ("1".equals(price.getInvoiceType()) || "2".equals(price.getInvoiceType()));
             // 根据商品id查询商品活动
@@ -142,7 +141,6 @@ public class PriceUtilService {
             price.setPrice(0d);
             price.setOriginalPrice(0d);
             price.setUserIdentity(0);
-            price.setRetailPrice(0d);
         }
         // 屏蔽成本价
         price.setCostProportional(0d);
@@ -158,7 +156,6 @@ public class PriceUtilService {
     public void setItemPriceByUserId(ProductItemVo product, Integer userId) {
         // 设置价格等级
         product.setPriceGrade(getPriceGrade(product.getPrice()));
-        product.setRetailPrice(product.getPrice());
         // 根据用户Id查询用户身份
         Integer identity = priceMapper.getIdentityByUserId(userId);
         if (null != identity && identity > 0) {
@@ -223,7 +220,6 @@ public class PriceUtilService {
             product.setPrice(0d);
             product.setOriginalPrice(0d);
             product.setUserIdentity(0);
-            product.setRetailPrice(0d);
         }
     }
 }

+ 51 - 14
src/main/java/com/caimei365/commodity/controller/ProductShopApi.java

@@ -1,17 +1,13 @@
 package com.caimei365.commodity.controller;
 
 import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.dto.ProductDto;
 import com.caimei365.commodity.model.search.ProductListVo;
 import com.caimei365.commodity.service.ShopService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.*;
 import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 import java.util.Map;
@@ -37,7 +33,7 @@ public class ProductShopApi {
         @ApiImplicitParam(required = true, name = "shopId", value = "供应商Id(旧:supplierId)"),
         @ApiImplicitParam(required = false, name = "identity", value = "用户身份:1协销,2会员机构,3供应商,4普通机构")
     })
-    @GetMapping("/home/products")
+    @GetMapping("/product/main")
     public ResponseJson<List<ProductListVo>> getSupplierMainProducts(Integer shopId, @RequestParam(value = "identity", defaultValue = "0") Integer identity) {
         return shopService.getMainProducts(shopId, identity);
     }
@@ -52,21 +48,62 @@ public class ProductShopApi {
         @ApiImplicitParam(required = false, name = "productCode", value = "货号"),
         @ApiImplicitParam(required = false, name = "validFlag", value = "状态:0逻辑删除,1待审核,2已上架,3已下架,8审核未通过,9已隐身,10已冻结"),
         @ApiImplicitParam(required = false, name = "featuredFlag", value = "是否主推:0否,1是"),
-        @ApiImplicitParam(required = false, name = "typeSort", value = "分类类型:1产品,2仪器"),
+        @ApiImplicitParam(required = false, name = "commodityType", value = "商品属性:1产品,2仪器"),
         @ApiImplicitParam(required = false, name = "bigTypeId", value = "一级分类Id"),
         @ApiImplicitParam(required = false, name = "smallTypeId", value = "二级分类Id"),
         @ApiImplicitParam(required = false, name = "tinyTypeId", value = "三级级分类Id"),
         @ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
         @ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
     })
-    @GetMapping("/products")
+    @GetMapping("/product/list")
     public ResponseJson<Map<String, Object>> getShopProducts(Integer shopId, String name, String productCode,
-                                                             Integer validFlag, Integer featuredFlag, Integer typeSort, Integer bigTypeId, Integer smallTypeId, Integer tinyTypeId,
+                                                             Integer validFlag, Integer featuredFlag, Integer commodityType, Integer bigTypeId, Integer smallTypeId, Integer tinyTypeId,
                                                              @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
                                                              @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
-        return shopService.getShopProducts(shopId, name, productCode, validFlag, featuredFlag, typeSort, bigTypeId, smallTypeId, tinyTypeId, pageNum, pageSize);
+        return shopService.getShopProducts(shopId, name, productCode, validFlag, featuredFlag, commodityType, bigTypeId, smallTypeId, tinyTypeId, pageNum, pageSize);
     }
 
-
+    /**
+     * 供应商-发布商品
+     *
+     * @param productDto {
+     *                   aliasName	    内部商品名称
+     *                   allAreaFlag	销售区域:1全部区域, 0指定区域
+     *                   bigTypeId	    一级分类id
+     *                   brandId	    品牌id
+     *                   brandName	    品牌名称
+     *                   commodityType	商品属性:1产品,2仪器
+     *                   costPrice	    成本价
+     *                   detailInfo	    商品详情信息
+     *                   includedTax	是否含税:0不含税,1含税,2未知
+     *                   invoiceType	发票类型
+     *                   machineType	械字号类型
+     *                   minBuyNumber	最小购买量
+     *                   name	        商品名称
+     *                   normalPrice	市场价
+     *                   orderInfo	    订购方案
+     *                   price	        机构价格
+     *                   productCode	商品货号
+     *                   productType	商品类型:0其它,1妆字号,2械字号
+     *                   provinceIds	指定的销售区域
+     *                   qualificationImg 械字号资质证书图
+     *                   searchKey	      搜索关键词
+     *                   serviceInfo	  服务详情
+     *                   shopId	         供应商id
+     *                   smallTypeId	 二级分类id
+     *                   step	         购买数量
+     *                   stock	         库存
+     *                   tags	         商品标签,逗号隔开
+     *                   taxPoint	     开票税点
+     *                   tinyTypeId	     三级分类id
+     *                   unit	         包装规格
+     *                   userId	         用户Id
+     *                   }
+     */
+    @ApiOperation("供应商-发布商品(旧:/supplier/releaseProduct)")
+    @PostMapping("/product/release")
+    public ResponseJson releaseProduct(ProductDto productDto){
+        return shopService.releaseProduct(productDto);
+    }
 
 }

+ 13 - 2
src/main/java/com/caimei365/commodity/mapper/PageMapper.java

@@ -53,15 +53,26 @@ public interface PageMapper {
     List<PageFloorVo> getFloorByPageId(Integer pageId, Integer source);
     /**
      * 查询楼层内容
-     * @param id 页面信息楼层id
+     * @param id 页面id
      */
     FloorContentVo getFloorContentById(Integer id);
     /**
      * 查询楼层相关图片
-     * @param id 页面信息楼层id
+     * @param id 页面id
      * @param source
      */
     List<FloorImageVo> getFloorImageById(Integer id, Integer source);
+    /**
+     * 查询楼层内容
+     * @param id 楼层id
+     */
+    FloorContentVo getFloorContentByCentreId(Integer id);
+    /**
+     * 查询楼层相关图片
+     * @param id 楼层id
+     * @param source
+     */
+    List<FloorImageVo> getFloorImageByCentreId(Integer id, Integer source);
     /**
      * 获取商品及价格
      * @param productId

+ 1 - 1
src/main/java/com/caimei365/commodity/mapper/ShopMapper.java

@@ -26,7 +26,7 @@ public interface ShopMapper {
     /**
      * 获取供应商-我的商品列表
      */
-    List<ProductItemVo> getShopProductsSelect(Integer shopId, String name, String productCode, Integer validFlag, Integer featuredFlag, Integer typeSort, Integer bigTypeId, Integer smallTypeId, Integer tinyTypeId);
+    List<ProductItemVo> getShopProductsSelect(Integer shopId, String name, String productCode, Integer validFlag, Integer featuredFlag, Integer commodityType, Integer bigTypeId, Integer smallTypeId, Integer tinyTypeId);
     /**
      * 列表显示分类
      */

+ 175 - 0
src/main/java/com/caimei365/commodity/model/dto/ProductDto.java

@@ -0,0 +1,175 @@
+package com.caimei365.commodity.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/4/20
+ */
+@ApiModel("商品发布")
+@Data
+public class ProductDto implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 用户Id
+     */
+    @ApiModelProperty("用户Id")
+    private Integer userId;
+    /**
+     * 供应商id
+     */
+    @ApiModelProperty("供应商id")
+    private Integer shopId;
+    /**
+     * 名称
+     */
+    @ApiModelProperty("商品名称")
+    private String name;
+    /**
+     * 内部商品名称
+     */
+    @ApiModelProperty("内部商品名称")
+    private String aliasName;
+    /**
+     * 商品属性:1产品,2仪器
+     */
+    @ApiModelProperty("商品属性:1产品,2仪器")
+    private Integer commodityType;
+    /**
+     * 一级分类id
+     */
+    @ApiModelProperty("一级分类id")
+    private Integer bigTypeId;
+    /**
+     * 二级分类id
+     */
+    @ApiModelProperty("二级分类id")
+    private Integer smallTypeId;
+    /**
+     * 三级分类Id
+     */
+    @ApiModelProperty("三级分类id")
+    private Integer tinyTypeId;
+    /**
+     * 品牌Id
+     */
+    @ApiModelProperty("品牌id")
+    private Integer brandId;
+    /**
+     * 商品类型:0其它类型(默认),1妆字号,2械字号
+     */
+    @ApiModelProperty("商品类型:0其它,1妆字号,2械字号")
+    private String productType;
+    /**
+     * 商品标签用英文逗号隔开,中文逗号或其它一律不作切割
+     */
+    @ApiModelProperty("商品标签,逗号隔开")
+    private String tags;
+    /**
+     * 包装规格
+     */
+    @ApiModelProperty("包装规格")
+    private String unit;
+    /**
+     * 机构价格
+     */
+    @ApiModelProperty("机构价格")
+    private Double price;
+    /**
+     * 市场价
+     */
+    @ApiModelProperty("市场价")
+    private Double normalPrice;
+    /**
+     * 是否含税:0不含税,1含税,2未知
+     */
+    @ApiModelProperty("是否含税:0不含税,1含税,2未知")
+    private String includedTax;
+    /**
+     * 最小购买量
+     */
+    @ApiModelProperty("最小购买量")
+    private Integer minBuyNumber;
+    /**
+     * 库存
+     */
+    @ApiModelProperty("库存")
+    private Integer stock;
+    /**
+     * 品牌名称
+     */
+    @ApiModelProperty("品牌名称")
+    private String brandName;
+    /**
+     * 商品货号
+     */
+    @ApiModelProperty("商品货号")
+    private String productCode;
+    /**
+     * 械字号类型   (基于械字号基础),1:一类,2:二类,3:三类
+     */
+    @ApiModelProperty("械字号类型")
+    private String machineType;
+    /**
+     * 搜索关键词,4个用英文逗号区分,不存在的直接逗号隔空(顺序参考:品牌,学名,市场称呼,大类别,小类别)
+     */
+    @ApiModelProperty("搜索关键词")
+    private String searchKey;
+    /**
+     * 购买数量: 1逐步增长,2以起订量增长(起订量的倍数增长)
+     */
+    @ApiModelProperty("购买数量")
+    private Integer step;
+    /**
+     * 械字号资质证书图  (基于械字号基础)
+     */
+    @ApiModelProperty("械字号资质证书图")
+    private String qualificationImg;
+    /**
+     * 成本价
+     */
+    @ApiModelProperty("成本价")
+    private Double costPrice;
+    /**
+     * 发票类型(基于是否含税基础)   1增值税票,2普通票, 3不能开票
+     */
+    @ApiModelProperty("发票类型")
+    private String invoiceType;
+    /**
+     * 开票税点(基于不含税基础) :增值税默认13%,普通票6%取值范围[0-100]
+     */
+    @ApiModelProperty("开票税点")
+    private Double taxPoint;
+    /**
+     * 销售区域:1全部区域, 0指定区域
+     */
+    @ApiModelProperty("销售区域:1全部区域, 0指定区域")
+    private String allAreaFlag;
+    /**
+     * 指定的销售区域
+     */
+    @ApiModelProperty("指定的销售区域")
+    private String provinceIds;
+    /**
+     * 商品详情信息
+     */
+    @ApiModelProperty("商品详情信息")
+    private String detailInfo;
+    /**
+     * 服务详情
+     */
+    @ApiModelProperty("服务详情")
+    private String serviceInfo;
+    /**
+     * 订购方案
+     */
+    @ApiModelProperty("订购方案")
+    private String orderInfo;
+
+}

+ 0 - 1
src/main/java/com/caimei365/commodity/model/vo/PriceVo.java

@@ -26,7 +26,6 @@ public class PriceVo implements Serializable {
      * 价格(计算后)
      */
     private Double price;
-    private Double retailPrice;
     /**
      * 划线价格
      */

+ 2 - 3
src/main/java/com/caimei365/commodity/model/vo/ProductItemVo.java

@@ -31,7 +31,6 @@ public class ProductItemVo implements Serializable {
     private String code;
     /** 机构价 */
     private Double price;
-    private Double retailPrice;
     /** 是否公开机构价 0公开价格 1不公开价格 */
     private Integer priceFlag;
     /** 计算后价格等级 */
@@ -101,9 +100,9 @@ public class ProductItemVo implements Serializable {
      */
     private Integer featuredFlag;
     /**
-     * 分类类型,1产品,2仪器
+     * 商品属性:1产品,2仪器
      */
-    private Integer typeSort;
+    private Integer commodityType;
     /**
      * 一级分类ID
      */

+ 43 - 2
src/main/java/com/caimei365/commodity/service/ShopService.java

@@ -1,6 +1,7 @@
 package com.caimei365.commodity.service;
 
 import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.dto.ProductDto;
 import com.caimei365.commodity.model.search.ProductListVo;
 
 import java.util.List;
@@ -30,7 +31,7 @@ public interface ShopService {
      * @param productCode   货号
      * @param validFlag     状态:0逻辑删除,1待审核,2已上架,3已下架,8审核未通过,9已隐身,10已冻结
      * @param featuredFlag  是否主推:0否,1是
-     * @param typeSort      分类类型:1产品,2仪器
+     * @param commodityType 商品属性:1产品,2仪器
      * @param bigTypeId     一级分类Id
      * @param smallTypeId   二级分类Id
      * @param tinyTypeId    三级级分类Id
@@ -38,5 +39,45 @@ public interface ShopService {
      * @param pageSize      每页数量
      * @return PageInfo<ProductShopVO>
      */
-    ResponseJson<Map<String, Object>> getShopProducts(Integer shopId, String name, String productCode, Integer validFlag, Integer featuredFlag, Integer typeSort, Integer bigTypeId, Integer smallTypeId, Integer tinyTypeId, int pageNum, int pageSize);
+    ResponseJson<Map<String, Object>> getShopProducts(Integer shopId, String name, String productCode, Integer validFlag, Integer featuredFlag, Integer commodityType, Integer bigTypeId, Integer smallTypeId, Integer tinyTypeId, int pageNum, int pageSize);
+
+    /**
+     * 供应商-发布商品
+     *
+     * @param productDto {
+     *                   aliasName	    内部商品名称
+     *                   allAreaFlag	销售区域:1全部区域, 0指定区域
+     *                   bigTypeId	    一级分类id
+     *                   brandId	    品牌id
+     *                   brandName	    品牌名称
+     *                   commodityType	商品属性:1产品,2仪器
+     *                   costPrice	    成本价
+     *                   detailInfo	    商品详情信息
+     *                   includedTax	是否含税:0不含税,1含税,2未知
+     *                   invoiceType	发票类型
+     *                   machineType	械字号类型
+     *                   minBuyNumber	最小购买量
+     *                   name	        商品名称
+     *                   normalPrice	市场价
+     *                   orderInfo	    订购方案
+     *                   price	        机构价格
+     *                   productCode	商品货号
+     *                   productType	商品类型:0其它,1妆字号,2械字号
+     *                   provinceIds	指定的销售区域
+     *                   qualificationImg 械字号资质证书图
+     *                   searchKey	      搜索关键词
+     *                   serviceInfo	  服务详情
+     *                   shopId	         供应商id
+     *                   smallTypeId	 二级分类id
+     *                   step	         购买数量
+     *                   stock	         库存
+     *                   tags	         商品标签,逗号隔开
+     *                   taxPoint	     开票税点
+     *                   tinyTypeId	     三级分类id
+     *                   unit	         包装规格
+     *                   userId	         用户Id
+     *                   }
+     */
+    ResponseJson releaseProduct(ProductDto productDto);
+
 }

+ 4 - 4
src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java

@@ -43,7 +43,7 @@ public class PageServiceImpl implements PageService {
      * @param source   请求来源:www,crm
      */
     @Override
-    @Cacheable(value = "getClassify", key = "#typeSort +'-'+ #source", unless = "#result == null")
+    // @Cacheable(value = "getClassify", key = "#typeSort +'-'+ #source", unless = "#result == null")
     public ResponseJson<List<BigTypeVo>> getClassify(String typeSort, String source) {
         List<BigTypeVo> bigTypeList = pageMapper.getBigTypeList(typeSort,source);
         bigTypeList.forEach(bigType -> {
@@ -78,7 +78,7 @@ public class PageServiceImpl implements PageService {
      * @param source 来源:1网站,2小程序
      */
     @Override
-    @Cacheable(value = "instrumentData", key = "#pageId+'-'+#userId+'-'+#source", unless = "#result == null")
+    // @Cacheable(value = "instrumentData", key = "#pageId+'-'+#userId+'-'+#source", unless = "#result == null")
     public ResponseJson<Map<String, Object>> getClassifyData(Integer pageId, Integer userId, Integer source) {
         source = source == null ? 1 : source;
         Map<String, Object> map = new HashMap<>(3);
@@ -86,10 +86,10 @@ public class PageServiceImpl implements PageService {
         List<HotSearchVo> hotSearchList = pageMapper.getHotSearchByPageId(pageId, source);
         List<PageFloorVo> floorList = pageMapper.getFloorByPageId(pageId, source);
         for (PageFloorVo floor : floorList) {
-            FloorContentVo floorContent = pageMapper.getFloorContentById(floor.getId());
+            FloorContentVo floorContent = pageMapper.getFloorContentByCentreId(floor.getId());
             setFloorLinkType(floorContent);
             floor.setFloorContent(floorContent);
-            List<FloorImageVo> floorImageList = pageMapper.getFloorImageById(floor.getId(), source);
+            List<FloorImageVo> floorImageList = pageMapper.getFloorImageByCentreId(floor.getId(), source);
             setFloorImageProduct(userId, floorImageList);
             floor.setFloorImageList(floorImageList);
         }

+ 93 - 3
src/main/java/com/caimei365/commodity/service/impl/ShopServiceImpl.java

@@ -3,6 +3,7 @@ package com.caimei365.commodity.service.impl;
 import com.caimei365.commodity.components.PriceUtilService;
 import com.caimei365.commodity.mapper.ShopMapper;
 import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.dto.ProductDto;
 import com.caimei365.commodity.model.search.ProductListVo;
 import com.caimei365.commodity.model.vo.PaginationVo;
 import com.caimei365.commodity.model.vo.ProductItemVo;
@@ -10,6 +11,7 @@ import com.caimei365.commodity.service.ShopService;
 import com.caimei365.commodity.utils.ImageUtils;
 import com.github.pagehelper.PageHelper;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
@@ -74,7 +76,7 @@ public class ShopServiceImpl implements ShopService {
      * @param productCode  货号
      * @param validFlag    状态:0逻辑删除,1待审核,2已上架,3已下架,8审核未通过,9已隐身,10已冻结
      * @param featuredFlag 是否主推:0否,1是
-     * @param typeSort     分类类型:1产品,2仪器
+     * @param commodityType 商品属性:1产品,2仪器
      * @param bigTypeId    一级分类Id
      * @param smallTypeId  二级分类Id
      * @param tinyTypeId    三级级分类Id
@@ -83,13 +85,13 @@ public class ShopServiceImpl implements ShopService {
      * @return Map<String, Object>
      */
     @Override
-    public ResponseJson<Map<String, Object>> getShopProducts(Integer shopId, String name, String productCode, Integer validFlag, Integer featuredFlag, Integer typeSort, Integer bigTypeId, Integer smallTypeId, Integer tinyTypeId, int pageNum, int pageSize) {
+    public ResponseJson<Map<String, Object>> getShopProducts(Integer shopId, String name, String productCode, Integer validFlag, Integer featuredFlag, Integer commodityType, Integer bigTypeId, Integer smallTypeId, Integer tinyTypeId, int pageNum, int pageSize) {
         if (null == shopId) {
             return ResponseJson.error("参数异常:缺少供应商Id", null);
         }
         Map<String, Object> map = new HashMap<>();
         PageHelper.startPage(pageNum, pageSize);
-        List<ProductItemVo> productList = shopMapper.getShopProductsSelect(shopId, name, productCode, validFlag, featuredFlag, typeSort, bigTypeId, smallTypeId, tinyTypeId);
+        List<ProductItemVo> productList = shopMapper.getShopProductsSelect(shopId, name, productCode, validFlag, featuredFlag, commodityType, bigTypeId, smallTypeId, tinyTypeId);
         if (null != productList && productList.size() > 0) {
             for (ProductItemVo product : productList) {
                 product.setImage(ImageUtils.getImageURL("product", product.getImage(), 0, domain));
@@ -106,4 +108,92 @@ public class ShopServiceImpl implements ShopService {
         map.put("featuredNum", featuredNum);
         return ResponseJson.success(map);
     }
+
+    /**
+     * 供应商-发布商品
+     *
+     * @param productDto {
+     *                   aliasName	    内部商品名称
+     *                   allAreaFlag	销售区域:1全部区域, 0指定区域
+     *                   bigTypeId	    一级分类id
+     *                   brandId	    品牌id
+     *                   brandName	    品牌名称
+     *                   commodityType	商品属性:1产品,2仪器
+     *                   costPrice	    成本价
+     *                   detailInfo	    商品详情信息
+     *                   includedTax	是否含税:0不含税,1含税,2未知
+     *                   invoiceType	发票类型
+     *                   machineType	械字号类型
+     *                   minBuyNumber	最小购买量
+     *                   name	        商品名称
+     *                   normalPrice	市场价
+     *                   orderInfo	    订购方案
+     *                   price	        机构价格
+     *                   productCode	商品货号
+     *                   productType	商品类型:0其它,1妆字号,2械字号
+     *                   provinceIds	指定的销售区域
+     *                   qualificationImg 械字号资质证书图
+     *                   searchKey	      搜索关键词
+     *                   serviceInfo	  服务详情
+     *                   shopId	         供应商id
+     *                   smallTypeId	 二级分类id
+     *                   step	         购买数量
+     *                   stock	         库存
+     *                   tags	         商品标签,逗号隔开
+     *                   taxPoint	     开票税点
+     *                   tinyTypeId	     三级分类id
+     *                   unit	         包装规格
+     *                   userId	         用户Id
+     *                   }
+     */
+    @Override
+    public ResponseJson releaseProduct(ProductDto productDto) {
+        // 参数校验
+        if (null == productDto.getShopId()) {
+            return ResponseJson.error("参数异常:供应商id不能为空!", null);
+        }
+        if (StringUtils.isBlank(productDto.getName())) {
+            return ResponseJson.error("参数异常:商品名称不能为空!", null);
+        }
+        if (StringUtils.isBlank(productDto.getAliasName())) {
+            return ResponseJson.error("参数异常:内部商品名称不能为空!", null);
+        }
+        if (null == productDto.getCommodityType()) {
+            return ResponseJson.error("参数异常:商品属性不能为空!", null);
+        }
+        if (null == productDto.getBigTypeId()) {
+            return ResponseJson.error("参数异常:商品分类不能为空!", null);
+        }
+        if (null == productDto.getBrandId()) {
+            return ResponseJson.error("参数异常:品牌id不能为空!", null);
+        }
+        if (null == productDto.getProductType()) {
+            return ResponseJson.error("参数异常:商品类型不能为空!", null);
+        }
+        if (StringUtils.isBlank(productDto.getTags())) {
+            return ResponseJson.error("参数异常:商品标签不能为空!", null);
+        }
+        if (StringUtils.isBlank(productDto.getUnit())) {
+            return ResponseJson.error("参数异常:包装规格不能为空!", null);
+        }
+        if (null == productDto.getNormalPrice()) {
+            return ResponseJson.error("参数异常:市场价不能为空!", null);
+        }
+        if (null == productDto.getPrice()) {
+            return ResponseJson.error("参数异常:机构价格不能为空!", null);
+        }
+        if (StringUtils.isBlank(productDto.getIncludedTax())) {
+            return ResponseJson.error("参数异常:是否含税不能为空!", null);
+        }
+        if (null == productDto.getMinBuyNumber()) {
+            return ResponseJson.error("参数异常:最小购买量不能为空!", null);
+        }
+        if (null == productDto.getStock()) {
+            return ResponseJson.error("参数异常:库存不能为空!", null);
+        }
+        if (StringUtils.isBlank(productDto.getDetailInfo())) {
+            return ResponseJson.error("参数异常:商品详情信息不能为空!", null);
+        }
+        return null;
+    }
 }

+ 1 - 1
src/main/java/com/caimei365/commodity/utils/Json2PojoUtil.java

@@ -24,9 +24,9 @@ public class Json2PojoUtil {
      */
     public static List<ProductListVo> toProductList(JSONArray jsonArray) {
         List<ProductListVo> productList = new ArrayList<>();
-        ProductListVo product = new ProductListVo();
         for (int i=0; i<jsonArray.length(); i++) {
             JSONObject json = jsonArray.getJSONObject(i);
+            ProductListVo product = new ProductListVo();
             /* 主键Id */
             product.setMainId(json.getInt("id"));
             /* 商品Id */

+ 20 - 1
src/main/resources/mapper/PageMapper.xml

@@ -47,7 +47,7 @@
     </select>
     <select id="getHotSearchByPageId" resultType="com.caimei365.commodity.model.vo.HotSearchVo">
         select
-            id, pageId, name, isHot, link, linkParam, linkType, pcStatus, sort, appletsStatus, creationTime,
+            id, pageId, name, isHot, link, pcStatus, sort, appletsStatus, creationTime
         from
           cm_page_hot_search
         where
@@ -103,6 +103,25 @@
         </if>
         order by -sort desc, createDate desc
     </select>
+    <select id="getFloorContentByCentreId" resultType="com.caimei365.commodity.model.vo.FloorContentVo">
+        select
+         id, floorId, centreId, templateType, pcAdsImage1, pcAdsImage2, pcAdsImage3,
+         appletsAdsImage1, appletsAdsImage2, appletsAdsImage3, adsLink1, adsLink2, adsLink3
+         from new_page_floor_content where centreId = #{id}
+    </select>
+    <select id="getFloorImageByCentreId" resultType="com.caimei365.commodity.model.vo.FloorImageVo">
+        select
+            id, floorId, centreId, productId, name, link, image, label, pcStatus, appletsStatus, sort, createDate
+        from new_page_floor_image
+        where centreId = #{id}
+        <if test="source == 1">
+            and pcStatus = 1
+        </if>
+        <if test="source == 2">
+            and appletsStatus = 1
+        </if>
+        order by -sort desc, createDate desc
+    </select>
     <select id="getProductItemById" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
         select
             p.productID as productId,

+ 4 - 6
src/main/resources/mapper/ShopMapper.xml

@@ -23,11 +23,9 @@
     <select id="getShopProductsSelect" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
         select
             p.productID as productId, p.name, p.aliasName, p.price, p.normalPrice, p.mainImage,
-            p.validFlag, p.featuredFlag, p.productCode, p.bigTypeID as bigTypeId,
-            p.smallTypeID as smallTypeId, p.tinyTypeID as tinyTypeId,
-            b.typeSort as typeSort
+            p.validFlag, p.featuredFlag, p.productCode, p.commodityType as commodityType,
+            p.bigTypeID as bigTypeId, p.smallTypeID as smallTypeId, p.tinyTypeID as tinyTypeId
         from product p
-        left join bigtype b on p.bigTypeID = b.bigTypeID
         <where>
             p.shopID = #{shopId}
             <if test="productCode != null and productCode != ''">
@@ -48,8 +46,8 @@
             <if test="bigTypeId != null and bigTypeId != 0">
                 and p.bigTypeID = #{bigTypeId}
             </if>
-            <if test="typeSort != null and typeSort != ''">
-                and b.typeSort = #{typeSort}
+            <if test="commodityType != null and commodityType != ''">
+                and p.commodityType = #{commodityType}
             </if>
             <if test="name != null and name != ''">
                 and p.name like CONCAT("%",#{name},"%")