|
@@ -6,10 +6,7 @@ import com.google.common.collect.Lists; |
|
@@ -6,10 +6,7 @@ import com.google.common.collect.Lists; |
6
|
import com.yohobuy.ufo.model.ProductInfo;
|
6
|
import com.yohobuy.ufo.model.ProductInfo;
|
7
|
import com.yohobuy.ufo.model.enums.StorageCheckEnum;
|
7
|
import com.yohobuy.ufo.model.enums.StorageCheckEnum;
|
8
|
import com.yohobuy.ufo.model.order.bo.SellerBo;
|
8
|
import com.yohobuy.ufo.model.order.bo.SellerBo;
|
9
|
-import com.yohobuy.ufo.model.order.common.OrderAttributes;
|
|
|
10
|
-import com.yohobuy.ufo.model.order.common.OrderStatus;
|
|
|
11
|
-import com.yohobuy.ufo.model.order.common.SellerFuncEnum;
|
|
|
12
|
-import com.yohobuy.ufo.model.order.common.SkupStatus;
|
9
|
+import com.yohobuy.ufo.model.order.common.*;
|
13
|
import com.yohobuy.ufo.model.order.constants.SkupType;
|
10
|
import com.yohobuy.ufo.model.order.constants.SkupType;
|
14
|
import com.yohobuy.ufo.model.order.req.*;
|
11
|
import com.yohobuy.ufo.model.order.req.*;
|
15
|
import com.yohobuy.ufo.model.order.resp.*;
|
12
|
import com.yohobuy.ufo.model.order.resp.*;
|
|
@@ -109,6 +106,9 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
@@ -109,6 +106,9 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
109
|
SellerOrderGoodsMapper sellerOrderGoodsMapper;
|
106
|
SellerOrderGoodsMapper sellerOrderGoodsMapper;
|
110
|
|
107
|
|
111
|
@Autowired
|
108
|
@Autowired
|
|
|
109
|
+ ExpressRecordMapper expressRecordMapper;
|
|
|
110
|
+
|
|
|
111
|
+ @Autowired
|
112
|
private TradeBillsMapper tradeBillsMapper;
|
112
|
private TradeBillsMapper tradeBillsMapper;
|
113
|
|
113
|
|
114
|
private static final String ADDRESS_STR = "{\"address\":\"松金公路2758号sneakerburger仓储中心\",\"address_id\":17560803,\"area\":\"上海 金山区 张堰镇\",\"areaCode\":\"310116103\",\"consignee\":\"阿津\",\"isUpdate\":\"N\",\"mobile\":\"18121153590\",\"phone\":\"\",\"zipCode\":\"\"}";
|
114
|
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 { |
|
@@ -213,8 +213,11 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
213
|
|
213
|
|
214
|
List<BuyerOrderGoods> buyerOrderGoodList = buyerOrderGoodsMapper.selectOrderBySkups(req.getSkup());
|
214
|
List<BuyerOrderGoods> buyerOrderGoodList = buyerOrderGoodsMapper.selectOrderBySkups(req.getSkup());
|
215
|
|
215
|
|
|
|
216
|
+
|
|
|
217
|
+
|
216
|
Map<Long, BuyerOrder> orderCodeToBuyer = null;
|
218
|
Map<Long, BuyerOrder> orderCodeToBuyer = null;
|
217
|
Map<Long, List<TradeBills>> buyerOrderToTradeBills = null;
|
219
|
Map<Long, List<TradeBills>> buyerOrderToTradeBills = null;
|
|
|
220
|
+ Map<Long, ExpressRecord> expressRecordMap = null;
|
218
|
if (CollectionUtils.isNotEmpty(buyerOrderGoodList)){
|
221
|
if (CollectionUtils.isNotEmpty(buyerOrderGoodList)){
|
219
|
List<Long> buyerOrderCodeList = buyerOrderGoodList.stream().map(BuyerOrderGoods::getOrderCode).collect(Collectors.toList());
|
222
|
List<Long> buyerOrderCodeList = buyerOrderGoodList.stream().map(BuyerOrderGoods::getOrderCode).collect(Collectors.toList());
|
220
|
|
223
|
|
|
@@ -222,6 +225,10 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
@@ -222,6 +225,10 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
222
|
// 买家订单信息
|
225
|
// 买家订单信息
|
223
|
orderCodeToBuyer = buyerOrderList.stream().collect(Collectors.toMap(BuyerOrder::getOrderCode, Function.identity(), (key1, key2) -> key2));
|
226
|
orderCodeToBuyer = buyerOrderList.stream().collect(Collectors.toMap(BuyerOrder::getOrderCode, Function.identity(), (key1, key2) -> key2));
|
224
|
|
227
|
|
|
|
228
|
+ // 查询是否存在寄回信息
|
|
|
229
|
+ List<ExpressRecord> expressRecords = expressRecordMapper.selectByOrderCodesAndExpressType(buyerOrderCodeList, EnumExpressType.EXPRESS_TYPE_3.getCode());
|
|
|
230
|
+ expressRecordMap = expressRecords.stream().collect(Collectors.toMap(ExpressRecord::getOrderCode, Function.identity(), (key1, key2) -> key2));
|
|
|
231
|
+
|
225
|
List<TradeBills> tradeBillsList = tradeBillsMapper.selectByOrderCodeList(buyerOrderCodeList);
|
232
|
List<TradeBills> tradeBillsList = tradeBillsMapper.selectByOrderCodeList(buyerOrderCodeList);
|
226
|
// 根据买家订单号查对账信息
|
233
|
// 根据买家订单号查对账信息
|
227
|
buyerOrderToTradeBills = tradeBillsList.stream().collect(Collectors.groupingBy(TradeBills::getOrderCode));
|
234
|
buyerOrderToTradeBills = tradeBillsList.stream().collect(Collectors.groupingBy(TradeBills::getOrderCode));
|
|
@@ -231,12 +238,13 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
@@ -231,12 +238,13 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
231
|
// 鉴定通过 -- 货款收入
|
238
|
// 鉴定通过 -- 货款收入
|
232
|
// 鉴定不通过 -- 保证金扣款
|
239
|
// 鉴定不通过 -- 保证金扣款
|
233
|
// 买家取消时 -- 扣款
|
240
|
// 买家取消时 -- 扣款
|
234
|
- return covertToFastDeliveryShelfResp(productInfo, orderCodeToBuyer, buyerOrderToTradeBills, sellerOrder);
|
241
|
+ return covertToFastDeliveryShelfResp(productInfo, orderCodeToBuyer, buyerOrderToTradeBills,expressRecordMap, sellerOrder);
|
235
|
}
|
242
|
}
|
236
|
|
243
|
|
237
|
private FastDeliveryGetShelfDetailResp covertToFastDeliveryShelfResp(ProductInfo productInfo,
|
244
|
private FastDeliveryGetShelfDetailResp covertToFastDeliveryShelfResp(ProductInfo productInfo,
|
238
|
Map<Long, BuyerOrder> orderCodeToBuyer,
|
245
|
Map<Long, BuyerOrder> orderCodeToBuyer,
|
239
|
Map<Long, List<TradeBills>> buyerOrderToTradeBills,
|
246
|
Map<Long, List<TradeBills>> buyerOrderToTradeBills,
|
|
|
247
|
+ Map<Long, ExpressRecord> expressRecordMap,
|
240
|
FastDeliveryGetShelfDetailResp sellerOrder) {
|
248
|
FastDeliveryGetShelfDetailResp sellerOrder) {
|
241
|
|
249
|
|
242
|
if (productInfo != null){
|
250
|
if (productInfo != null){
|
|
@@ -269,6 +277,10 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
|
@@ -269,6 +277,10 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService { |
269
|
tradeBillResp.setBuyerOrderStatus(buyerOrder.getStatus());
|
277
|
tradeBillResp.setBuyerOrderStatus(buyerOrder.getStatus());
|
270
|
tradeBillResp.setBuyerOrderStatusDesc(OrderStatus.getOrderStatus(buyerOrder.getStatus()).getDesc());
|
278
|
tradeBillResp.setBuyerOrderStatusDesc(OrderStatus.getOrderStatus(buyerOrder.getStatus()).getDesc());
|
271
|
|
279
|
|
|
|
280
|
+ if (expressRecordMap!=null && expressRecordMap.get(buyerOrderCode)!=null){
|
|
|
281
|
+ sellerOrder.setWaybillCode(expressRecordMap.get(buyerOrderCode).getWaybillCode());
|
|
|
282
|
+ }
|
|
|
283
|
+
|
272
|
if (buyerOrderToTradeBills.get(buyerOrderCode) == null || CollectionUtils.isEmpty(buyerOrderToTradeBills.get(buyerOrderCode))){
|
284
|
if (buyerOrderToTradeBills.get(buyerOrderCode) == null || CollectionUtils.isEmpty(buyerOrderToTradeBills.get(buyerOrderCode))){
|
273
|
continue;
|
285
|
continue;
|
274
|
}
|
286
|
}
|