use of com.whoiszxl.dto.OrderItemDTO in project shopzz by whoiszxl.
the class PayOrderStockUpdaterFactory method createCommand.
@Override
protected StockUpdater createCommand(T parameter) {
OrderInfoDTO orderInfoDTO = (OrderInfoDTO) parameter;
Map<Long, OrderItemDTO> orderItemDTOMap = new HashMap<>(100);
for (OrderItemDTO orderItemDTO : orderInfoDTO.getOrderItemDTOList()) {
orderItemDTOMap.put(orderItemDTO.getSkuId(), orderItemDTO);
}
return new PayOrderStockUpdater(productStockService, orderItemDTOMap);
}
use of com.whoiszxl.dto.OrderItemDTO in project shopzz by whoiszxl.
the class SubmitOrderStockUpdaterFactory method createCommand.
@Override
public StockUpdater createCommand(T parameter) {
OrderCreateInfoDTO orderCreateInfoDTO = (OrderCreateInfoDTO) parameter;
Map<Long, OrderItemDTO> orderItemDTOMap = new HashMap<>();
for (OrderItemDTO item : orderCreateInfoDTO.getOrderItemList()) {
orderItemDTOMap.put(item.getSkuId(), item);
}
return new SubmitOrderStockUpdater(productStockService, orderItemDTOMap);
}
use of com.whoiszxl.dto.OrderItemDTO in project shopzz by whoiszxl.
the class SubmitOrderStockUpdaterFactory method getProductSkuIds.
@Override
protected List<Long> getProductSkuIds(T parameter) {
OrderCreateInfoDTO orderCreateInfoDTO = (OrderCreateInfoDTO) parameter;
List<Long> productSkuIds = new ArrayList<>();
for (OrderItemDTO item : orderCreateInfoDTO.getOrderItemList()) {
productSkuIds.add(item.getSkuId());
}
return productSkuIds;
}
use of com.whoiszxl.dto.OrderItemDTO in project shopzz by whoiszxl.
the class WmsFeignClientImpl method notifyPayOrderSuccess.
@Override
public ResponseResult<Boolean> notifyPayOrderSuccess(OrderInfoDTO orderInfo) {
// 更新WMS中心库存
for (OrderItemDTO orderItemDTO : orderInfo.getOrderItemDTOList()) {
SaleDeliveryScheduleResult scheduleResult = saleDeliveryScheduler.getScheduleResult(orderItemDTO);
WmsStockUpdater stockUpdater = wmsStockUpdaterFactory.create(WmsStockUpdateEventConstants.PAY_ORDER, scheduleResult);
stockUpdater.update();
}
return ResponseResult.buildSuccess();
}
use of com.whoiszxl.dto.OrderItemDTO in project shopzz by whoiszxl.
the class SubmitOrderWmsStockUpdater method updateProductStock.
@Override
protected void updateProductStock() {
// 更新商品库存
OrderItemDTO orderItem = scheduleResult.getOrderItem();
// 提交订单,减去可用,增加锁定
warehouseProductStockService.subAvailableStockAndAddLockedStock(orderItem.getQuantity(), orderItem.getSkuId());
}
Aggregations