Authored by TANLING

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

... ... @@ -20,7 +20,11 @@ public class BuyerRefundOrder {
private String productName;
private String goodsImageUrl;
// 色系
private String colorSystemName;
// 颜色
private String colorName;
// 尺寸
private String sizeName;
// 发售日期(品牌上市日期)
... ...
... ... @@ -11,12 +11,8 @@ import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.BuyerOrderGoods;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.product.BrandMapper;
import com.yohoufo.dal.product.ProductMapper;
import com.yohoufo.dal.product.ProductSortMapper;
import com.yohoufo.dal.product.model.Brand;
import com.yohoufo.dal.product.model.Product;
import com.yohoufo.dal.product.model.ProductSort;
import com.yohoufo.dal.product.*;
import com.yohoufo.dal.product.model.*;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.model.bo.BuyerRefundOrder;
import com.yohoufo.order.service.support.BuyerOrderMetaMapperSupport;
... ... @@ -43,6 +39,8 @@ public class BuyerRefundOrderBuilder {
@Autowired
private ProductMapper productMapper;
@Autowired
private ProductColorMapper productColorMapper;
@Autowired
private ProductSortMapper productSortMapper;
@Autowired
private BrandMapper brandMapper;
... ... @@ -62,6 +60,8 @@ public class BuyerRefundOrderBuilder {
throwServiceExceptionIf(Objects.isNull(sellerOrderGoods), "卖家订单商品不存在");
Product product = productMapper.selectByPrimaryKey(sellerOrderGoods.getProductId());
throwServiceExceptionIf(Objects.isNull(sellerOrderGoods), "商品不存在");
ProductColor productColor = productColorMapper.selectByPrimaryKey(sellerOrderGoods.getColorId());
throwServiceExceptionIf(Objects.isNull(sellerOrderGoods), "商品颜色不存在");
List<Integer> sortIds = new ArrayList<>();
CollectionUtils.addIgnoreNull(sortIds, product.getMaxSortId());
CollectionUtils.addIgnoreNull(sortIds, product.getMidSortId());
... ... @@ -69,13 +69,14 @@ public class BuyerRefundOrderBuilder {
: productSortMapper.selectByIds(sortIds).stream()
.collect(Collectors.toMap(ProductSort::getId, ProductSort::getSortName, (a, b) -> a));
Brand brand = Optional.ofNullable(product.getBrandId()).map(brandMapper::selectByPrimaryKey).orElse(null);
return build(buyerOrder, sellerOrderGoods, buyerAddress, product, sort, brand);
return build(buyerOrder, sellerOrderGoods, buyerAddress, product, productColor, sort, brand);
}
private BuyerRefundOrder build(BuyerOrder buyerOrder,
SellerOrderGoods sellerOrderGoods,
AddressInfo buyerAddress,
Product product,
ProductColor productColor,
Map<Integer, String> sort,
Brand brand) {
BuyerRefundOrder refund = new BuyerRefundOrder();
... ... @@ -97,6 +98,8 @@ public class BuyerRefundOrderBuilder {
refund.setGenderName(getGenderName(product.getGender()));
refund.setSaleTime(product.getSaleTime());
refund.setOfferPrice(product.getOfferPrice());
// copy from product color
refund.setColorSystemName(productColor.getColorName());
// copy from product sort
refund.setSortName(Joiner.on("|").skipNulls()
.join(sort.get(product.getMaxSortId()), sort.get(product.getMidSortId())));
... ...
... ... @@ -40,6 +40,7 @@ datasources:
- com.yohoufo.dal.product.TransferRecordsMapper
- com.yohoufo.dal.product.TransferRecordsHistoryMapper
- com.yohoufo.dal.product.ProductSalesMapper
- com.yohoufo.dal.product.ProductColorMapper
- com.yohoufo.dal.product.ProductLimitSaleMapper
- com.yohoufo.dal.product.ProductSelfShelvesMapper
- com.yohoufo.dal.product.ProductSelfShelvesPicMapper
... ...
... ... @@ -43,6 +43,7 @@ datasources:
- com.yohoufo.dal.product.TransferRecordsHistoryMapper
- com.yohoufo.dal.product.ProductLimitSaleMapper
- com.yohoufo.dal.product.ProductSalesMapper
- com.yohoufo.dal.product.ProductColorMapper
- com.yohoufo.dal.product.ProductSelfShelvesMapper
- com.yohoufo.dal.product.ProductSelfShelvesPicMapper
- com.yohoufo.dal.product.SecondhandFlawMapper
... ...