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;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -55,13 +57,6 @@ public class ProductController {
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build();
}
private ProductDetailResp mockProductDetail(Integer productId){
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\"}}";
ProductDetailResp resp = UfoJsonUtil.safelyParseObject(mockJson, ProductDetailResp.class);
return resp;
}
@ApiOperation(name = "ufo.product.sort.template", desc="商品列表")
@IgnoreSignature
@IgnoreSession
... ... @@ -70,7 +65,7 @@ public class ProductController {
public ApiResponse querySortTemplateData(
@RequestParam(value = "skns", required = false) String skns) {
if (null == skns) {
if (StringUtils.isBlank(skns)) {
return new ApiResponse(500, "skns Is Null", null);
}
return new ApiResponse.ApiResponseBuilder().data(querySortTemplateData()).code(200).message("product data").build();
... ... @@ -92,18 +87,10 @@ public class ProductController {
if (storageId == null) {
return null;
}
StorageLeastPriceResp resp = productService.queryStorageLeastPrice(storageId);
return queryStorageLeastprice();
return productService.queryStorageLeastPrice(storageId);
}
private StorageLeastPriceResp queryStorageLeastprice(){
String mockJson = "{\"storage_id\":2,\"least_price\":124.3,\"skup\":1}";
StorageLeastPriceResp resp = UfoJsonUtil.safelyParseObject(mockJson, StorageLeastPriceResp.class);
return resp;
}
@ApiOperation(name = "ufo.product.storage.data", desc="sku信息")
@RequestMapping(params = "method=ufo.product.storage.data")
//@Cachable(expire=600)
... ... @@ -113,17 +100,7 @@ public class ProductController {
if (storageId == null) {
return null;
}
StorageDataResp resp = productService.queryStorageInfo(storageId);
return queryStorageData();
}
private StorageDataResp queryStorageData(){
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\"}}";
StorageDataResp resp = UfoJsonUtil.safelyParseObject(mockJson, StorageDataResp.class);
return resp;
return productService.queryStorageInfo(storageId);
}
// 增加库存
... ...
... ... @@ -5,6 +5,9 @@ import com.alibaba.fastjson.annotation.JSONField;
public class ProductSeriesTemplate {
@JSONField(name = "product_id")
private String productId;
@JSONField(name = "image_url")
private String imageUrl;
@JSONField(name = "series_id")
... ... @@ -12,6 +15,14 @@ public class ProductSeriesTemplate {
@JSONField(name = "series_name")
private String seriesName;
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getImageUrl() {
return imageUrl;
}
... ...
... ... @@ -3,6 +3,7 @@ package com.yohoufo.product.service;
import com.yohoufo.dal.product.model.StoragePrice;
import com.yohoufo.product.request.StoragePriceBo;
import com.yohoufo.product.response.ProductDetailResp;
import com.yohoufo.product.response.ProductSeriesTemplateResp;
import com.yohoufo.product.response.StorageDataResp;
import com.yohoufo.product.response.StorageLeastPriceResp;
... ... @@ -22,5 +23,7 @@ public interface ProductService {
StoragePrice getStoragePriceBySkup(Integer skup);
ProductSeriesTemplateResp querySortTemplateData(String skns);
}
... ...
... ... @@ -4,8 +4,10 @@ import java.math.BigDecimal;
import java.util.*;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.ToIntFunction;
import java.util.stream.Collectors;
import com.google.common.collect.Lists;
import com.yoho.core.common.helpers.ImagesHelper;
import com.yohoufo.dal.product.*;
import com.yohoufo.dal.product.model.*;
... ... @@ -13,6 +15,7 @@ import com.yohoufo.product.model.GoodsImageBO;
import com.yohoufo.product.model.GoodsSize;
import com.yohoufo.product.model.GoodsBO;
import com.yohoufo.product.model.ProductInfo;
import com.yohoufo.product.response.ProductSeriesTemplateResp;
import com.yohoufo.product.response.StorageDataResp;
import com.yohoufo.product.response.StorageLeastPriceResp;
import org.apache.commons.lang3.StringUtils;
... ... @@ -135,7 +138,17 @@ public class ProductServiceImpl implements ProductService{
public StoragePrice getStoragePriceBySkup(Integer skup) {
return storagePriceMapper.selectBySkup(skup);
}
@Override
public ProductSeriesTemplateResp querySortTemplateData(String skns) {
ProductSeriesTemplateResp resp = new ProductSeriesTemplateResp();
List<String> sknlist = Lists.newArrayList(skns.split(","));
return null;
}
@Override
public void createSkup(StoragePriceBo skupBo) {
storagePriceMapper.insert(exchangeCreateSkupBo(skupBo));
... ...