|
|
|
@ -299,7 +299,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|
|
|
|
List<String> orderIds = orderList.stream().map(OpOrder::getOrderId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
Map<String, List<PurchaseOrderBO>> orderIdAndPurchaseOrdersMap = getOrderIdAndPurchaseOrdersMap(shopIds, orderIds, filter, true, false);
|
|
|
|
|
Map<Long, Shop> shopIdAndShopInfoMap = shopService.getShopByIds(shopIds).stream().collect(Collectors.toMap(Shop::getShopId, x -> x));
|
|
|
|
|
Map<Long, Shop> shopIdAndShopInfoMap = shopService.getShopByIds(shopIds).stream().collect(Collectors.toMap(Shop::getShopId, x -> x,(v1,v2)->v1));
|
|
|
|
|
Map<String, String> orderIdAndSameOrderIdsMap = new HashMap<>();
|
|
|
|
|
// TODO: 2023/8/28 配置表已经没有相关字段 跳过
|
|
|
|
|
// if (ObjectUtil.isNotNull(filter.getIsShowSameReceiverOrder()) && filter.getIsShowSameReceiverOrder()) {
|
|
|
|
@ -331,7 +331,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|
|
|
|
}
|
|
|
|
|
List<OpOrderOutstorageHistory> opOrderOutstorageHistoryRows = opOrderOutstorageHistoryService.getByIdList(opOrderOutstorageHistoryIds);
|
|
|
|
|
|
|
|
|
|
Map<String, OpOrderOutstorageHistory> orderIdAndOpOrderOutstrorageHistoryMap = opOrderOutstorageHistoryRows.stream().collect(Collectors.toMap(OpOrderOutstorageHistory::getOrderId, x -> x));
|
|
|
|
|
Map<String, OpOrderOutstorageHistory> orderIdAndOpOrderOutstrorageHistoryMap = opOrderOutstorageHistoryRows.stream().collect(Collectors.toMap(OpOrderOutstorageHistory::getOrderId, x -> x,(v1,v2)->v1));
|
|
|
|
|
|
|
|
|
|
for (JSONObject order : orders) {
|
|
|
|
|
if (isDs && !OrderConst.ORDER_STATUS_WAIT_SELLER_SEND_GOODS.equals(order.get("orderStatus"))) {
|
|
|
|
@ -694,7 +694,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|
|
|
|
|
|
|
|
|
if (needItems) {
|
|
|
|
|
List<String> purchaseOrderIds = purchaseOrders.stream().map(x -> x.getPurchaseOrderId().toString()).collect(Collectors.toList());
|
|
|
|
|
Map<Integer, PurchaseOrderItem> purchaseOrderItemsMap = getPurchaseOrderItemsMapByPurchaseOrderIds(shopIds, purchaseOrderIds, StatusConst.normal).stream().collect(Collectors.toMap(PurchaseOrderItem::getPurchaseOrderId, x -> x));
|
|
|
|
|
Map<Integer, PurchaseOrderItem> purchaseOrderItemsMap = getPurchaseOrderItemsMapByPurchaseOrderIds(shopIds, purchaseOrderIds, StatusConst.normal).stream().collect(Collectors.toMap(PurchaseOrderItem::getPurchaseOrderId, x -> x,(v1,v2)->v1));
|
|
|
|
|
for (PurchaseOrderBO purchaseOrder : purchaseOrders) {
|
|
|
|
|
if (purchaseOrderItemsMap.containsKey(purchaseOrder.getPurchaseOrderId().intValue())) {
|
|
|
|
|
purchaseOrder.setItem(purchaseOrderItemsMap.get(purchaseOrder.getPurchaseOrderId().intValue()));
|
|
|
|
@ -739,7 +739,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return rows.stream().collect(Collectors.toMap(PurchaseOrderSetting::getPurchaseOrderId, x -> x));
|
|
|
|
|
return rows.stream().collect(Collectors.toMap(PurchaseOrderSetting::getPurchaseOrderId, x -> x,(v1,v2)->v1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -1339,7 +1339,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|
|
|
|
List<OpOrderChildBO> items = orderIdAndOpOrderChildMap.get(orderId);
|
|
|
|
|
Map<Long, OpOrderChildBO> skuIdAndOrderChildMap = this.mergeOpOrderChildSameSku(items);
|
|
|
|
|
List<AfterSale> currentOrderAfterSales = ObjectUtil.isNotEmpty(orderIdAndAftersalesMap.get(orderId)) ? orderIdAndAftersalesMap.get(orderId) : new ArrayList<>();
|
|
|
|
|
Map<String, AfterSale> childOrderIdAndAfterSaleMap = currentOrderAfterSales.stream().collect(Collectors.toMap(AfterSale::getOrderId, x -> x));
|
|
|
|
|
Map<String, AfterSale> childOrderIdAndAfterSaleMap = currentOrderAfterSales.stream().collect(Collectors.toMap(AfterSale::getOrderId, x -> x,(v1,v2)->v1));
|
|
|
|
|
attachSourceItemInfoToOpOrderChilds(skuIdAndOrderChildMap, productIdAndProductToDsItemMap, childOrderIdAndAfterSaleMap);
|
|
|
|
|
List<String> sourceItemIds = skuIdAndOrderChildMap.values().stream().map(OpOrderChildBO::getSourceItemId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
@ -1372,7 +1372,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|
|
|
|
|
|
|
|
|
// orderAddressChangeApply = orderIdAndOrderAddressChangeApplyMap[orderId];
|
|
|
|
|
|
|
|
|
|
Map<Object, JSONObject> purchasePlatforms = returnPurchaseOrders.values().stream().collect(Collectors.toMap(x -> x.get("purchasePlatform"), x -> x));
|
|
|
|
|
Map<String, JSONObject> purchasePlatforms = ObjectUtil.isEmpty(returnPurchaseOrders) ? new HashMap<>() : returnPurchaseOrders.values().stream().collect(Collectors.toMap(x -> x.getString("purchasePlatform"), x -> x,(v1,v2)->v1));
|
|
|
|
|
if (ObjectUtil.isEmpty(sourceItemIds) && purchasePlatforms.containsKey(PurchaseOrderConst.PURCHASE_PLATFORM1688_D_S)) {
|
|
|
|
|
needDeleteOpOrderDsOrderIds.add(orderId);
|
|
|
|
|
}
|
|
|
|
@ -1566,7 +1566,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|
|
|
|
private void rebuildNoPurchaseOrderItems(Map<Long, OpOrderChildBO> skuIdAndOrderChildMap, List<Long> hasPurchaseSkuIds, List<OpOrderChildLogistics> childOrderLogistics, List<OpOrderPriceProtection> priceProtectionList,
|
|
|
|
|
Map<Long, List<OpOrderGivenProduct>> childOrderIdAndGivenProductsMap, List<JSONObject> returnOrderItems, List<JSONObject> noPurchaseOrderItems, BigDecimal orderTotalAmount) {
|
|
|
|
|
Map<String, List<OpOrderChildLogistics>> childOrderIdAndLogisticsMap = childOrderLogistics.stream().collect(Collectors.groupingBy(OpOrderChildLogistics::getChildOrderId));
|
|
|
|
|
Map<String, OpOrderPriceProtection> childOrderIdAndPriceProtectionMap = priceProtectionList.stream().collect(Collectors.toMap(OpOrderPriceProtection::getChildOrderId, x -> x));
|
|
|
|
|
Map<String, OpOrderPriceProtection> childOrderIdAndPriceProtectionMap = priceProtectionList.stream().collect(Collectors.toMap(OpOrderPriceProtection::getChildOrderId, x -> x,(v1,v2)->v1));
|
|
|
|
|
for (Map.Entry<Long, OpOrderChildBO> entry : skuIdAndOrderChildMap.entrySet()) {
|
|
|
|
|
OpOrderChildBO item = entry.getValue();
|
|
|
|
|
String skuSubNames = item.getSkuSubName();
|
|
|
|
|