storageStatistics.md 6.06 KB

查询网销信息

接口名: /shop/getStorageStatisticsList

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 长度限制
productSkn number 商品skn N 10
factory_code 字符串 商品厂家编码 N 30
productSku number 商品sku N 10
shopId number 店铺Id N 10
brandId number 品牌Id Y 10
maxSortId 数字型 一级分类Id N 10
middleSortId 数字型 二级分类Id N 10
smallSortId 数字型 三级分类Id N 10

对应SQL的操作库表

  <select id="selectCountByConf" parameterType="com.yoho.bigData.dal.model.StockStorage" resultType="java.lang.Integer">
    select   count(0) from stock_storage where 1 = 1
      <if test="productSkn != null" >
        And product_skn = #{productSkn, jdbcType=BIGINT}
      </if>
      <if test="productSkn != null" >
        And product_sku = #{productSku, jdbcType=BIGINT}
      </if>
      <if test="factoryCode != null" >
        And factory_code = #{factoryCode, jdbcType=VARCHAR}
      </if>
      <if test="maxSortId != null" >
        And max_sort_id = #{maxSortId, jdbcType=INTEGER}
      </if>
      <if test="middleSortId != null" >
        And middle_sort_id = #{middleSortId, jdbcType=INTEGER}
      </if>
      <if test="smallSortId != null" >
        And small_sort_id = #{smallSortId, jdbcType=INTEGER}
      </if>
  </select>
  <select id="selectListByConf" parameterType="com.yoho.bigData.dal.model.StockStorage" resultType="BaseResultMap">
    select   <include refid="Base_Column_List" /> from stock_storage where 1 = 1
    <if test="productSkn != null" >
        And product_skn = #{productSkn, jdbcType=BIGINT}
      </if>
      <if test="productSkn != null" >
        And product_sku = #{productSku, jdbcType=BIGINT}
      </if>
      <if test="factoryCode != null" >
        And factory_code = #{factoryCode, jdbcType=VARCHAR}
      </if>
      <if test="maxSortId != null" >
        And max_sort_id = #{maxSortId, jdbcType=INTEGER}
      </if>
      <if test="middleSortId != null" >
        And middle_sort_id = #{middleSortId, jdbcType=INTEGER}
      </if>
      <if test="smallSortId != null" >
        And small_sort_id = #{smallSortId, jdbcType=INTEGER}
      </if>
  </select>


  <select id="selectStorageStatistics" resultType="com.yoho.bigData.dal.model.StorageStatisticsDo">
    select sum(store_nums) as storageTotalNum, sum(storage_amount) as storageTotalMoney, sum(1) as totalNum, status as status from stock_storage 
    where brand_id = #{brandId, jdbcType=BIGINT}  group by status;
  </select>

错误编码


错误码code 消息 说明
200 查询成功!
400 操作失败!
500 操作失败!

返回

{
  "alg": "SALT_MD5",
  "code": 200,
  "data": {
    "additionInfo": {
      "onSaleTotalNum": 1,                  // 已上架商品数
      "outSaleTotalNum": 1,                 // 已下架商品数
      "preSaleTotalNum": 2,                 // 待上架商品数
      "storageTotalMoney": 67.3,            // 库存总金额(元)
      "storageTotalNum": 47                 // 库存总数量
    }, 
    "list": [
      {
        "brandId": 11,
        "brandName": "",
        "colorId": 0,
        "colorName": "",
        "dateId": 0,
        "goodsName": "",
        "imageUrl": "0",
        "maxSortId": 0,
        "maxSortName": "0",
        "middleSortId": 0,
        "middleSortName": "",
        "productSkc": 0,
        "productSkn": 0,
        "productSku": 0,
        "purchasePrice": 0,
        "salesPrice": 0,
        "shopId": 0,
        "shopName": "",
        "sizeId": 0,
        "sizeName": "",
        "smallSortId": 0,
        "smallSortName": "",
        "status": "1",
        "storageAmount": 33.3,
        "storeNums": 11
      },
      {
        "brandId": 11,
        "brandName": "",
        "colorId": 0,
        "colorName": "",
        "dateId": 0,
        "goodsName": "",
        "imageUrl": "0",
        "maxSortId": 0,
        "maxSortName": "0",
        "middleSortId": 0,
        "middleSortName": "",
        "productSkc": 0,
        "productSkn": 0,
        "productSku": 0,
        "purchasePrice": 0,
        "salesPrice": 0,
        "shopId": 0,
        "shopName": "",
        "sizeId": 0,
        "sizeName": "",
        "smallSortId": 0,
        "smallSortName": "",
        "status": "2",
        "storageAmount": 22,
        "storeNums": 22
      },
      {
        "brandId": 11,
        "brandName": "",
        "colorId": 0,
        "colorName": "",
        "dateId": 0,
        "goodsName": "",
        "imageUrl": "0",
        "maxSortId": 0,
        "maxSortName": "0",
        "middleSortId": 0,
        "middleSortName": "",
        "productSkc": 0,
        "productSkn": 0,
        "productSku": 0,
        "purchasePrice": 0,
        "salesPrice": 0,
        "shopId": 0,
        "shopName": "",
        "sizeId": 0,
        "sizeName": "",
        "smallSortId": 0,
        "smallSortName": "",
        "status": "3",
        "storageAmount": 11,
        "storeNums": 13
      },
      {
        "brandId": 11,
        "brandName": "",
        "colorId": 0,
        "colorName": "",
        "dateId": 0,
        "goodsName": "",
        "imageUrl": "0",
        "maxSortId": 0,
        "maxSortName": "0",
        "middleSortId": 0,
        "middleSortName": "",
        "productSkc": 0,
        "productSkn": 0,
        "productSku": 0,
        "purchasePrice": 0,
        "salesPrice": 0,
        "shopId": 0,
        "shopName": "",
        "sizeId": 0,
        "sizeName": "",
        "smallSortId": 0,
        "smallSortName": "",
        "status": "2",
        "storageAmount": 1,
        "storeNums": 1
      }
    ],
    "page": 1,
    "size": 10,
    "total": 4,
    "totalPage": 1
  },
  "md5": "83ccbb2eb14e08c90558b7c00d6c0b8e",
  "message": "storage statistics list"
}