Blame view

api-doc/shopsReport/storageStatistics.md 6.62 KB
zhengwen.ge authored
1
# 查询库存列表
mali authored
2
3
> 接口名: `bigdata/getStorageStatisticsList`                      例子(http://127.0.0.1:8091/bigdata/bigdata/getStorageStatisticsList)
mali authored
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91

### 方法

> 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的操作库表

```xml
  <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| 操作失败!|  |

### 返回

``` json
{
mali authored
92
  "alg": "SALT_MD5",
mali authored
93 94
  "code": 200,
  "data": {
mali authored
95 96 97 98 99 100 101
    "additionInfo": {
      "onSaleTotalNum": 1,                  // 已上架商品数
      "outSaleTotalNum": 1,                 // 已下架商品数
      "preSaleTotalNum": 2,                 // 待上架商品数
      "storageTotalMoney": 67.3,            // 库存总金额(元)
      "storageTotalNum": 47                 // 库存总数量
    }, 
mali authored
102
    "list": [
mali authored
103
      {
mali authored
104 105 106 107 108 109 110 111 112 113
        "brandId": 11,                      // 品牌Id
        "brandName": "",                    // 品牌名称
        "colorId": 0,                       // 颜色id
        "colorName": "",     // 颜色名称
        "dateId": 0,        // 日期
        "goodsName": "",   // 商品名称
        "imageUrl": "0",   // 商品图片url
        "maxSortId": 0,    // 大分类
        "maxSortName": "0",  // 大分类的名称
        "middleSortId": 0,   // 中分类
mali authored
114
        "middleSortName": "",
mali authored
115
        "productSkc": 0,    
mali authored
116 117
        "productSkn": 0,
        "productSku": 0,
mali authored
118 119 120 121 122
        "purchasePrice": 0,        // 吊牌价
        "salesPrice": 0,              销售价
        "shopId": 0,            店铺id
        "shopName": "",         店铺名称
        "sizeId": 0,           尺码id
mali authored
123
        "sizeName": "",
mali authored
124
        "smallSortId": 0,         小分类
mali authored
125
        "smallSortName": "",
mali authored
126 127 128
        "status": "1",                 商品状态(1已上架 2待上架 3已下架)
        "storageAmount": 33.3,         库存金额
        "storeNums": 11                库存量
mali authored
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
      },
      {
        "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
mali authored
183 184
      },
      {
mali authored
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
        "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
mali authored
210 211 212 213
      }
    ],
    "page": 1,
    "size": 10,
mali authored
214 215
    "total": 4,
    "totalPage": 1
mali authored
216
  },
mali authored
217 218
  "md5": "83ccbb2eb14e08c90558b7c00d6c0b8e",
  "message": "storage statistics list"
mali authored
219 220 221
}

```