...
|
...
|
@@ -3,17 +3,18 @@ package com.yohoufo.order.service.impl; |
|
|
import com.google.common.base.Splitter;
|
|
|
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
|
|
|
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
|
|
|
import com.yohobuy.ufo.model.order.bo.ProductInfo;
|
|
|
import com.yohobuy.ufo.model.order.common.ButtonShow;
|
|
|
import com.yohobuy.ufo.model.order.common.SellerOrderListType;
|
|
|
import com.yohobuy.ufo.model.order.common.SellerType;
|
|
|
import com.yohobuy.ufo.model.order.common.SkupStatus;
|
|
|
import com.yohobuy.ufo.model.order.req.SellerGoodsRequest;
|
|
|
import com.yohobuy.ufo.model.order.resp.OrderListInfo;
|
|
|
import com.yohobuy.ufo.model.order.resp.PageResp;
|
|
|
import com.yohobuy.ufo.model.order.resp.SellerGoodsPageResp;
|
|
|
import com.yohoufo.common.helper.ImageUrlAssist;
|
|
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
|
|
import com.yohoufo.dal.order.SellerOrderGoodsViewMapper;
|
|
|
import com.yohoufo.dal.order.model.SellerOrder;
|
|
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
|
|
import com.yohoufo.order.model.request.OrderListRequest;
|
|
|
import com.yohoufo.order.model.request.SellerGoodsListRequest;
|
...
|
...
|
@@ -206,14 +207,34 @@ public class SkupListService { |
|
|
return respBuilder.build();
|
|
|
}
|
|
|
final SellerType sellerType = SellerType.ENTRY;
|
|
|
List<OrderListInfo> data = buildPrdSkuList(sogList, sellerType);
|
|
|
respBuilder.data(data);
|
|
|
|
|
|
List<OrderListInfo> orderListInfos = buildPrdSkuList(sogList, sellerType);
|
|
|
respBuilder.data(orderListInfos);
|
|
|
ProductInfo productInfo = buildProductInfo(sogList);
|
|
|
respBuilder.productInfo(productInfo);
|
|
|
return respBuilder.build();
|
|
|
}
|
|
|
|
|
|
public List<OrderListInfo> buildPrdSkuList(List<SellerOrderGoods> sogList, SellerType sellerType){
|
|
|
ProductInfo buildProductInfo(List<SellerOrderGoods> sogList){
|
|
|
ProductInfo productInfo = new ProductInfo();
|
|
|
SellerOrderGoods sog = sogList.get(0);
|
|
|
productInfo.setProductId(sog.getProductId());
|
|
|
productInfo.setProductName(sog.getProductName());
|
|
|
productInfo.setColorId(sog.getColorId());
|
|
|
productInfo.setColorName(sog.getColorName());
|
|
|
String imageUrl = ImageUrlAssist.getAllProductPicUrl(sog.getImageUrl(), "goodsimg", "center", "d2hpdGU=");
|
|
|
productInfo.setImageUrl(imageUrl);
|
|
|
//
|
|
|
productInfo.setSizeNum(sogList.size());
|
|
|
int storageNum = 0;
|
|
|
for(SellerOrderGoods csog : sogList){
|
|
|
storageNum += csog.getStorageNum();
|
|
|
}
|
|
|
productInfo.setStorageNum(storageNum);
|
|
|
return productInfo;
|
|
|
}
|
|
|
|
|
|
public List<OrderListInfo> buildPrdSkuList(List<SellerOrderGoods> sogList, SellerType sellerType){
|
|
|
ProductInfo productInfo = new ProductInfo();
|
|
|
Map<String, String> overPriceTipsMap = sellerOrderListService.buildOverPriceTipsMap(sogList);
|
|
|
List<OrderListInfo> data ;
|
|
|
data = sogList.parallelStream()
|
...
|
...
|
@@ -234,6 +255,27 @@ public class SkupListService { |
|
|
return data;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据单个商品id查询入驻后商品
|
|
|
* @param req
|
|
|
* @return
|
|
|
*/
|
|
|
public OrderListInfo getOrderListInfo(SellerGoodsRequest req){
|
|
|
Integer status = SkupStatus.CAN_SELL.getCode();
|
|
|
Integer uid = req.getUid();
|
|
|
SellerOrderGoods sogCondition = new SellerOrderGoods();
|
|
|
Integer productId;
|
|
|
sogCondition.setProductId(productId=req.getProductId());
|
|
|
sogCondition.setUid(uid);
|
|
|
sogCondition.setStatus(status);
|
|
|
List<SellerOrderGoods> sogList = sellerOrderGoodsViewMapper.selectEntryListByUidStatusGBSku(sogCondition, 0, 1);
|
|
|
if (CollectionUtils.isEmpty(sogList)){
|
|
|
logger.warn("in getOrderListInfo soglist is empty req {}", req);
|
|
|
return null;
|
|
|
}
|
|
|
return buildOrderListInfo(sogList.get(0), Arrays.asList(status));
|
|
|
}
|
|
|
|
|
|
OrderListInfo buildOrderListInfo(SellerOrderGoods sellerOrderGoods, List<Integer> statusList) {
|
|
|
Integer uid;
|
|
|
OrderListInfo orderListInfo = new OrderListInfo();
|
...
|
...
|
@@ -291,9 +333,10 @@ public class SkupListService { |
|
|
productInfo.setColorName(sellerOrderGoods.getColorName());
|
|
|
productInfo.setProductName(sellerOrderGoods.getProductName());
|
|
|
String imageUrl = ImageUrlAssist.getAllProductPicUrl(sellerOrderGoods.getImageUrl(), "goodsimg", "center", "d2hpdGU=");
|
|
|
productInfo.setImageUrl(imageUrl);
|
|
|
productInfo.setGoodImg(imageUrl);
|
|
|
Integer productId;
|
|
|
productInfo.setProductId(productId=sellerOrderGoods.getProductId());
|
|
|
productInfo.setStorageNum(sellerOrderGoods.getStorageNum());
|
|
|
//
|
|
|
|
|
|
orderListInfo.setGoodsInfo(productInfo);
|
...
|
...
|
|