Duan_xu 2 年之前
父节点
当前提交
e78906fe9f

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

@@ -23,138 +23,184 @@ public interface ShopMapper {
      */
     List<ProductListVo> getMainProducts(Integer shopId, List<Integer> visibilityList);
 
+    /**
+     * 上架费过期数量
+     */
+    Integer listingfeeExpire(Integer shopID);
+
+    /**
+     * 上架费数量
+     */
+    Integer listingFee(Integer shopID);
+    /**
+     * 是否有免除上架费
+     */
+    Integer receStatct(Integer shopID);
     /**
      * 主推商品数量
      */
     int getMainProductsCount(Integer shopId);
+
     /**
      * 获取供应商-我的商品列表
      */
-    List<ProductItemVo> getShopProductsSelect(Integer showFlag,Integer newvalidFlag,Integer shopId, String name, String productCode, Integer validFlag, Integer featuredFlag, Integer commodityType, Integer bigTypeId, Integer smallTypeId, Integer tinyTypeId);
+    List<ProductItemVo> getShopProductsSelect(Integer showFlag, Integer newvalidFlag, Integer shopId, String name, String productCode, Integer validFlag, Integer featuredFlag, Integer commodityType, Integer bigTypeId, Integer smallTypeId, Integer tinyTypeId);
+
     /**
      * 列表显示分类
      */
     String getTypeName(Integer bigTypeId, Integer smallTypeId, Integer tinyTypeId);
+
     /**
      * 根据供应商Id获取userId
      */
     Integer getUserIdByshopId(Integer shopId);
+
     /**
      * 根据分类获取商品货号
      */
     String getCodeByTypeId(Integer bigTypeId, Integer smallTypeId, Integer tinyTypeId);
+
     /**
      * 发布商品
      */
     void insertProduct(ProductPo product);
+
     /**
      * 编辑商品
      */
     void updateProduct(ProductPo product);
+
     /**
      * 获取商品图片
      */
     List<ProductImagePo> getImageByProductId(Integer productId);
+
     /**
      * 新增商品图片
      */
     void insertProductImage(ProductImagePo productImage);
+
     /**
      * 更新商品图片
      */
     void updateProductImage(ProductImagePo productImage);
+
     /**
      * 删除商品图片
      */
     void deleteProductImage(Integer id);
+
     /**
      * 删除相关参数
      */
     void deleteProductParameters(Integer productId);
+
     /**
      * 保存相关参数
      */
     void insertProductParameters(ProductParameterPo parameters);
+
     /**
      * 保存商品详情
      */
     void insertProductDetailInfo(ProductDetailInfoPo productDetail);
+
     /**
      * 修改商品详情
      */
     void updateProductDetailInfo(ProductDetailInfoPo productDetail);
+
     /**
      * 供应商-商品编辑回显
      */
     ProductFormVo getProductForm(Integer productId);
+
     /**
      * 获取品牌名称
      */
     String getBrandNameById(Integer brandId);
+
     /**
      * 获取相关参数
      */
     List<ProductParameterPo> getProductParameters(Integer productId);
+
     /**
      * 获取商品图片
      */
     List<ProductImagePo> getProductImages(Integer productId);
+
     /**
      * 获取商品详情
      */
     ProductDetailInfoPo getProductDetailInfo(Integer productId);
+
     /**
      * 供应商信息
      */
     ShopVo getProductShopById(Integer shopId);
+
     /**
      * 上架商品数量
      */
     Integer getProductNumById(Integer shopId);
+
     /**
      * 获取用户身份
      */
     Integer getUserIdentityById(Integer userId);
+
     /**
      * 供应商-商品编辑-品牌联想
      */
     List<BrandVo> getBrandAssociation(Integer userId, String name);
+
     /**
      * 供应商-商品编辑-品牌检测
      */
     BrandVo getBrandByName(String name);
+
     /**
      * 供应商-提交新品牌
      */
     void insertBrand(BrandPo brand);
+
     /**
      * 供应商-更新品牌
      */
     void updateBrand(BrandPo brand);
+
     /**
      * 供应商-品牌管理
      */
     List<BrandVo> getShopBrandList(String name, Integer status, Integer userId);
+
     /**
      * 供应商-添加,删除主页推荐
      */
     int updateProductFeatured(Integer productId, Integer shopId, Integer featuredFlag);
+
     /**
      * 供应商-下架商品
      */
     void updateProductValidFlag(Integer productId, Integer validFlag);
+
     /**
      * 供应商-更新商品编码
      */
     void updateProductCode(String productCode, Integer productId);
+
     /**
-     *  获取商品pc云上美博会活动状态
+     * 获取商品pc云上美博会活动状态
      */
     Integer getPcBeautyStatusById(Integer productId);
+
     /**
-     *  获取商品小程序云上美博会活动状态
+     * 获取商品小程序云上美博会活动状态
      */
     Integer getAppletsBeautyStatusById(Integer productId);
+
     /**
      * 获取供应商名称
      */

+ 10 - 0
src/main/java/com/caimei365/commodity/service/impl/ShopServiceImpl.java

@@ -122,6 +122,16 @@ public class ShopServiceImpl implements ShopService {
         map.put("productPage", productPage);
         int featuredNum = shopMapper.getMainProductsCount(shopId);
         map.put("featuredNum", featuredNum);
+       Integer listingFeeCount= shopMapper.listingFee(shopId);
+        Integer listingfeeExpireCount= shopMapper.listingfeeExpire(shopId);
+        Integer receStatctCount=shopMapper.receStatct(shopId);
+        Integer listingFee=0;
+        if(listingFeeCount>0 || listingfeeExpireCount<0){
+            if(receStatctCount<=0){
+                listingFee=1;
+            }
+        }
+        map.put("listingFee", listingFee);
         return ResponseJson.success(map);
     }
 

+ 13 - 0
src/main/resources/mapper/ShopMapper.xml

@@ -704,4 +704,17 @@
         from shop
         where shopID = #{shopId}
     </select>
+
+    <select id="listingFee" resultType="java.lang.Integer">
+        SELECT COUNT(1) FROM `cm_discern_receipt` WHERE newReceiptType=1 AND shopID=#{shopID}
+    </select>
+
+    <select id="listingfeeExpire" resultType="java.lang.Integer">
+        SELECT COUNT(1) FROM `cm_discern_receipt` WHERE newReceiptType=1 AND shopID=#{shopID} AND NOW()> DATE_ADD(receiptDate, INTERVAL 1 YEAR)
+    </select>
+
+    <select id="receStatct" resultType="java.lang.Integer">
+        SELECT COUNT(1) FROM `cm_discern_receipt` WHERE newReceiptType=1 AND shopID=#{shopID} AND receStatct=2
+    </select>
+
 </mapper>