Authored by sailing-PC\sailing

Merge branch 'dev' of http://git.yoho.cn/ufo/yohoufo-fore into dev

@@ -2,6 +2,8 @@ package com.yohoufo.product.controller; @@ -2,6 +2,8 @@ package com.yohoufo.product.controller;
2 2
3 import java.util.concurrent.ExecutorService; 3 import java.util.concurrent.ExecutorService;
4 import java.util.concurrent.Executors; 4 import java.util.concurrent.Executors;
  5 +
  6 +import org.apache.commons.lang3.StringUtils;
5 import org.slf4j.Logger; 7 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory; 8 import org.slf4j.LoggerFactory;
7 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
@@ -55,13 +57,6 @@ public class ProductController { @@ -55,13 +57,6 @@ public class ProductController {
55 return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build(); 57 return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build();
56 } 58 }
57 59
58 - private ProductDetailResp mockProductDetail(Integer productId){  
59 - String mockJson = "{\"product_info\":{\"brand_name\":\"Air Jordan\",\"goods_list\":[{\"color_name\":\"蓝\",\"goods_id\":40328,\"images_list\":[{\"image_url\":\"http://img13.static.yhbimg.com/goodsimg/2012/11/07/15/02c24ff8521007bad91dfa5d55e667d8f7.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80\"},{\"image_url\":\"http://img11.static.yhbimg.com/goodsimg/2013/01/09/09/0168a03a9a7df1f8ef0c1beba642a5e887.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80\"}],\"size_list\":[{\"least_price\":1,\"order_by\":1,\"size_id\":213,\"size_name\":\"XS\",\"storage_num\":1},{\"least_price\":12,\"order_by\":2,\"size_id\":207,\"size_name\":\"S\",\"storage_num\":0}]}],\"least_price\":12,\"product_code\":\"QW123456\",\"product_id\":50031387,\"product_name\":\"Carrots by Anwar X AKOP. X Champion  LOGO鞋\",\"sale_time\":\"2018-08-08\",\"series_name\":\"Air Jordan 4\"}}";  
60 - ProductDetailResp resp = UfoJsonUtil.safelyParseObject(mockJson, ProductDetailResp.class);  
61 -  
62 - return resp;  
63 - }  
64 -  
65 @ApiOperation(name = "ufo.product.sort.template", desc="商品列表") 60 @ApiOperation(name = "ufo.product.sort.template", desc="商品列表")
66 @IgnoreSignature 61 @IgnoreSignature
67 @IgnoreSession 62 @IgnoreSession
@@ -70,7 +65,7 @@ public class ProductController { @@ -70,7 +65,7 @@ public class ProductController {
70 public ApiResponse querySortTemplateData( 65 public ApiResponse querySortTemplateData(
71 @RequestParam(value = "skns", required = false) String skns) { 66 @RequestParam(value = "skns", required = false) String skns) {
72 67
73 - if (null == skns) { 68 + if (StringUtils.isBlank(skns)) {
74 return new ApiResponse(500, "skns Is Null", null); 69 return new ApiResponse(500, "skns Is Null", null);
75 } 70 }
76 return new ApiResponse.ApiResponseBuilder().data(querySortTemplateData()).code(200).message("product data").build(); 71 return new ApiResponse.ApiResponseBuilder().data(querySortTemplateData()).code(200).message("product data").build();
@@ -92,18 +87,10 @@ public class ProductController { @@ -92,18 +87,10 @@ public class ProductController {
92 if (storageId == null) { 87 if (storageId == null) {
93 return null; 88 return null;
94 } 89 }
95 -  
96 - StorageLeastPriceResp resp = productService.queryStorageLeastPrice(storageId);  
97 - return queryStorageLeastprice(); 90 + return productService.queryStorageLeastPrice(storageId);
98 } 91 }
99 92
100 93
101 - private StorageLeastPriceResp queryStorageLeastprice(){  
102 - String mockJson = "{\"storage_id\":2,\"least_price\":124.3,\"skup\":1}";  
103 - StorageLeastPriceResp resp = UfoJsonUtil.safelyParseObject(mockJson, StorageLeastPriceResp.class);  
104 - return resp;  
105 - }  
106 -  
107 @ApiOperation(name = "ufo.product.storage.data", desc="sku信息") 94 @ApiOperation(name = "ufo.product.storage.data", desc="sku信息")
108 @RequestMapping(params = "method=ufo.product.storage.data") 95 @RequestMapping(params = "method=ufo.product.storage.data")
109 //@Cachable(expire=600) 96 //@Cachable(expire=600)
@@ -113,17 +100,7 @@ public class ProductController { @@ -113,17 +100,7 @@ public class ProductController {
113 if (storageId == null) { 100 if (storageId == null) {
114 return null; 101 return null;
115 } 102 }
116 -  
117 - StorageDataResp resp = productService.queryStorageInfo(storageId);  
118 -  
119 - return queryStorageData();  
120 - }  
121 -  
122 -  
123 - private StorageDataResp queryStorageData(){  
124 - String mockJson = "{\"product_id\":50031387,\"product_name\":\"Carrots by Anwar X AKOP. X Champion  LOGO鞋\",\"color_id\":2,\"color_name\":\"黄\",\"image_url\":\"http://img13.static.yhbimg.com/goodsimg/2012/11/07/15/02c24ff8521007bad91dfa5d55e667d8f7.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80\",\"size\":{\"size_id\":2,\"size_name\":\"S\"}}";  
125 - StorageDataResp resp = UfoJsonUtil.safelyParseObject(mockJson, StorageDataResp.class);  
126 - return resp; 103 + return productService.queryStorageInfo(storageId);
127 } 104 }
128 105
129 // 增加库存 106 // 增加库存
@@ -5,6 +5,9 @@ import com.alibaba.fastjson.annotation.JSONField; @@ -5,6 +5,9 @@ import com.alibaba.fastjson.annotation.JSONField;
5 5
6 public class ProductSeriesTemplate { 6 public class ProductSeriesTemplate {
7 7
  8 +
  9 + @JSONField(name = "product_id")
  10 + private String productId;
8 @JSONField(name = "image_url") 11 @JSONField(name = "image_url")
9 private String imageUrl; 12 private String imageUrl;
10 @JSONField(name = "series_id") 13 @JSONField(name = "series_id")
@@ -12,6 +15,14 @@ public class ProductSeriesTemplate { @@ -12,6 +15,14 @@ public class ProductSeriesTemplate {
12 @JSONField(name = "series_name") 15 @JSONField(name = "series_name")
13 private String seriesName; 16 private String seriesName;
14 17
  18 + public String getProductId() {
  19 + return productId;
  20 + }
  21 +
  22 + public void setProductId(String productId) {
  23 + this.productId = productId;
  24 + }
  25 +
15 public String getImageUrl() { 26 public String getImageUrl() {
16 return imageUrl; 27 return imageUrl;
17 } 28 }
@@ -3,6 +3,7 @@ package com.yohoufo.product.service; @@ -3,6 +3,7 @@ package com.yohoufo.product.service;
3 import com.yohoufo.dal.product.model.StoragePrice; 3 import com.yohoufo.dal.product.model.StoragePrice;
4 import com.yohoufo.product.request.StoragePriceBo; 4 import com.yohoufo.product.request.StoragePriceBo;
5 import com.yohoufo.product.response.ProductDetailResp; 5 import com.yohoufo.product.response.ProductDetailResp;
  6 +import com.yohoufo.product.response.ProductSeriesTemplateResp;
6 import com.yohoufo.product.response.StorageDataResp; 7 import com.yohoufo.product.response.StorageDataResp;
7 import com.yohoufo.product.response.StorageLeastPriceResp; 8 import com.yohoufo.product.response.StorageLeastPriceResp;
8 9
@@ -22,5 +23,7 @@ public interface ProductService { @@ -22,5 +23,7 @@ public interface ProductService {
22 23
23 StoragePrice getStoragePriceBySkup(Integer skup); 24 StoragePrice getStoragePriceBySkup(Integer skup);
24 25
  26 + ProductSeriesTemplateResp querySortTemplateData(String skns);
  27 +
25 28
26 } 29 }
@@ -4,8 +4,10 @@ import java.math.BigDecimal; @@ -4,8 +4,10 @@ import java.math.BigDecimal;
4 import java.util.*; 4 import java.util.*;
5 import java.util.function.BinaryOperator; 5 import java.util.function.BinaryOperator;
6 import java.util.function.Function; 6 import java.util.function.Function;
  7 +import java.util.function.ToIntFunction;
7 import java.util.stream.Collectors; 8 import java.util.stream.Collectors;
8 9
  10 +import com.google.common.collect.Lists;
9 import com.yoho.core.common.helpers.ImagesHelper; 11 import com.yoho.core.common.helpers.ImagesHelper;
10 import com.yohoufo.dal.product.*; 12 import com.yohoufo.dal.product.*;
11 import com.yohoufo.dal.product.model.*; 13 import com.yohoufo.dal.product.model.*;
@@ -13,6 +15,7 @@ import com.yohoufo.product.model.GoodsImageBO; @@ -13,6 +15,7 @@ import com.yohoufo.product.model.GoodsImageBO;
13 import com.yohoufo.product.model.GoodsSize; 15 import com.yohoufo.product.model.GoodsSize;
14 import com.yohoufo.product.model.GoodsBO; 16 import com.yohoufo.product.model.GoodsBO;
15 import com.yohoufo.product.model.ProductInfo; 17 import com.yohoufo.product.model.ProductInfo;
  18 +import com.yohoufo.product.response.ProductSeriesTemplateResp;
16 import com.yohoufo.product.response.StorageDataResp; 19 import com.yohoufo.product.response.StorageDataResp;
17 import com.yohoufo.product.response.StorageLeastPriceResp; 20 import com.yohoufo.product.response.StorageLeastPriceResp;
18 import org.apache.commons.lang3.StringUtils; 21 import org.apache.commons.lang3.StringUtils;
@@ -135,7 +138,17 @@ public class ProductServiceImpl implements ProductService{ @@ -135,7 +138,17 @@ public class ProductServiceImpl implements ProductService{
135 public StoragePrice getStoragePriceBySkup(Integer skup) { 138 public StoragePrice getStoragePriceBySkup(Integer skup) {
136 return storagePriceMapper.selectBySkup(skup); 139 return storagePriceMapper.selectBySkup(skup);
137 } 140 }
138 - 141 +
  142 + @Override
  143 + public ProductSeriesTemplateResp querySortTemplateData(String skns) {
  144 + ProductSeriesTemplateResp resp = new ProductSeriesTemplateResp();
  145 +
  146 +
  147 + List<String> sknlist = Lists.newArrayList(skns.split(","));
  148 +
  149 + return null;
  150 + }
  151 +
139 @Override 152 @Override
140 public void createSkup(StoragePriceBo skupBo) { 153 public void createSkup(StoragePriceBo skupBo) {
141 storagePriceMapper.insert(exchangeCreateSkupBo(skupBo)); 154 storagePriceMapper.insert(exchangeCreateSkupBo(skupBo));