...
|
...
|
@@ -6,10 +6,7 @@ import com.google.common.collect.Lists; |
|
|
import com.yohobuy.ufo.model.ProductInfo;
|
|
|
import com.yohobuy.ufo.model.enums.StorageCheckEnum;
|
|
|
import com.yohobuy.ufo.model.order.bo.SellerBo;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderAttributes;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderStatus;
|
|
|
import com.yohobuy.ufo.model.order.common.SellerFuncEnum;
|
|
|
import com.yohobuy.ufo.model.order.common.SkupStatus;
|
|
|
import com.yohobuy.ufo.model.order.common.*;
|
|
|
import com.yohobuy.ufo.model.order.constants.SkupType;
|
|
|
import com.yohobuy.ufo.model.order.req.*;
|
|
|
import com.yohobuy.ufo.model.order.resp.*;
|
...
|
...
|
@@ -109,6 +106,9 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
|
SellerOrderGoodsMapper sellerOrderGoodsMapper;
|
|
|
|
|
|
@Autowired
|
|
|
ExpressRecordMapper expressRecordMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private TradeBillsMapper tradeBillsMapper;
|
|
|
|
|
|
private static final String ADDRESS_STR = "{\"address\":\"松金公路2758号sneakerburger仓储中心\",\"address_id\":17560803,\"area\":\"上海 金山区 张堰镇\",\"areaCode\":\"310116103\",\"consignee\":\"阿津\",\"isUpdate\":\"N\",\"mobile\":\"18121153590\",\"phone\":\"\",\"zipCode\":\"\"}";
|
...
|
...
|
@@ -213,8 +213,11 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
|
|
|
|
List<BuyerOrderGoods> buyerOrderGoodList = buyerOrderGoodsMapper.selectOrderBySkups(req.getSkup());
|
|
|
|
|
|
|
|
|
|
|
|
Map<Long, BuyerOrder> orderCodeToBuyer = null;
|
|
|
Map<Long, List<TradeBills>> buyerOrderToTradeBills = null;
|
|
|
Map<Long, ExpressRecord> expressRecordMap = null;
|
|
|
if (CollectionUtils.isNotEmpty(buyerOrderGoodList)){
|
|
|
List<Long> buyerOrderCodeList = buyerOrderGoodList.stream().map(BuyerOrderGoods::getOrderCode).collect(Collectors.toList());
|
|
|
|
...
|
...
|
@@ -222,6 +225,10 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
|
// 买家订单信息
|
|
|
orderCodeToBuyer = buyerOrderList.stream().collect(Collectors.toMap(BuyerOrder::getOrderCode, Function.identity(), (key1, key2) -> key2));
|
|
|
|
|
|
// 查询是否存在寄回信息
|
|
|
List<ExpressRecord> expressRecords = expressRecordMapper.selectByOrderCodesAndExpressType(buyerOrderCodeList, EnumExpressType.EXPRESS_TYPE_3.getCode());
|
|
|
expressRecordMap = expressRecords.stream().collect(Collectors.toMap(ExpressRecord::getOrderCode, Function.identity(), (key1, key2) -> key2));
|
|
|
|
|
|
List<TradeBills> tradeBillsList = tradeBillsMapper.selectByOrderCodeList(buyerOrderCodeList);
|
|
|
// 根据买家订单号查对账信息
|
|
|
buyerOrderToTradeBills = tradeBillsList.stream().collect(Collectors.groupingBy(TradeBills::getOrderCode));
|
...
|
...
|
@@ -231,12 +238,13 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
|
// 鉴定通过 -- 货款收入
|
|
|
// 鉴定不通过 -- 保证金扣款
|
|
|
// 买家取消时 -- 扣款
|
|
|
return covertToFastDeliveryShelfResp(productInfo, orderCodeToBuyer, buyerOrderToTradeBills, sellerOrder);
|
|
|
return covertToFastDeliveryShelfResp(productInfo, orderCodeToBuyer, buyerOrderToTradeBills,expressRecordMap, sellerOrder);
|
|
|
}
|
|
|
|
|
|
private FastDeliveryGetShelfDetailResp covertToFastDeliveryShelfResp(ProductInfo productInfo,
|
|
|
Map<Long, BuyerOrder> orderCodeToBuyer,
|
|
|
Map<Long, List<TradeBills>> buyerOrderToTradeBills,
|
|
|
Map<Long, ExpressRecord> expressRecordMap,
|
|
|
FastDeliveryGetShelfDetailResp sellerOrder) {
|
|
|
|
|
|
if (productInfo != null){
|
...
|
...
|
@@ -269,6 +277,10 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
|
tradeBillResp.setBuyerOrderStatus(buyerOrder.getStatus());
|
|
|
tradeBillResp.setBuyerOrderStatusDesc(OrderStatus.getOrderStatus(buyerOrder.getStatus()).getDesc());
|
|
|
|
|
|
if (expressRecordMap!=null && expressRecordMap.get(buyerOrderCode)!=null){
|
|
|
sellerOrder.setWaybillCode(expressRecordMap.get(buyerOrderCode).getWaybillCode());
|
|
|
}
|
|
|
|
|
|
if (buyerOrderToTradeBills.get(buyerOrderCode) == null || CollectionUtils.isEmpty(buyerOrderToTradeBills.get(buyerOrderCode))){
|
|
|
continue;
|
|
|
}
|
...
|
...
|
|