|
|
|
@ -76,6 +76,12 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Set<String> purOrderIds = new HashSet<>(orderIdAndPurOrderIdMap.values());
|
|
|
|
|
|
|
|
|
|
List<PlatformPurchaseOrder> platformPurchaseOrders = platformPurchaseOrderMapper.getListByPurOrderIds(new ArrayList<>(purOrderIds));
|
|
|
|
|
if (platformPurchaseOrders.isEmpty()) {
|
|
|
|
|
storeCreateOrders(shopId, param.getOrders(), purOrderIds);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
storeCreateOrders(shopId, param.getOrders(), purOrderIds);
|
|
|
|
|
|
|
|
|
|
BatchCreateDistributionOrdersRequestDTO request = buildBatchCreateDistributionOrdersRequestDTO(param);
|
|
|
|
@ -109,9 +115,11 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
data.setOrderResults(orderResults);
|
|
|
|
|
|
|
|
|
|
purchaseOrderMapper.insertBatch(purchaseOrders);
|
|
|
|
|
purchaseOrderItemMapper.insertBatch(purchaseOrderItems);
|
|
|
|
|
PurchaseOrder purchaseOrder = purchaseOrderMapper.getByPurOrderId(purOrderIds.iterator().next());
|
|
|
|
|
if (purchaseOrder == null) {
|
|
|
|
|
purchaseOrderMapper.insertBatch(purchaseOrders);
|
|
|
|
|
purchaseOrderItemMapper.insertBatch(purchaseOrderItems);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private PurchaseOrder buildPurchaseOrderByDTO(Long shopId, PurchaseOrderDTO purchaseOrderDTO, String purOrderId) {
|
|
|
|
|