use of com.whoiszxl.stock.WmsStockUpdater 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.stock.WmsStockUpdater in project shopzz by whoiszxl.
the class UpdateStockHandler method doExecute.
@Override
protected PurchaseInboundOrderResult doExecute(PurchaseOrderResponse purchaseOrderResponse) {
// 通过库存更新工厂创建一个采购入库库存更新组件来更新
WmsStockUpdater wmsStockUpdater = stockUpdaterFactory.create(WmsStockUpdateEventConstants.PURCHASE_INBOUND, purchaseOrderResponse);
wmsStockUpdater.update();
return new PurchaseInboundOrderResult(true);
}
use of com.whoiszxl.stock.WmsStockUpdater in project shopzz by whoiszxl.
the class WmsFeignClientImpl method notifyPayOrderSuccess.
@Override
public ResponseResult<Boolean> notifyPayOrderSuccess(OrderInfoDTO orderInfo) {
// 更新WMS中心库存
for (OrderItemDTO orderItemDTO : orderInfo.getOrderItemDTOList()) {
WmsStockUpdater stockUpdater = wmsStockUpdaterFactory.create(WmsStockUpdateEventConstants.PAY_ORDER, null);
stockUpdater.update();
}
// TODO 新增出库单,需要创建发货单,物流单,构建好出库单信息
return ResponseResult.buildSuccess();
}
use of com.whoiszxl.stock.WmsStockUpdater in project shopzz by whoiszxl.
the class SubmitOrderConsumer method submitOrderSub.
@KafkaListener(topics = MQConstants.SUBMIT_ORDER_QUEUE, groupId = "default-group")
public void submitOrderSub(ConsumerRecord<String, String> record, @Header(KafkaHeaders.RECEIVED_TOPIC) String topic, Consumer consumer) {
log.info("订阅到新的提交订单,开始处理, 主题为:{}, 消息值为:{}", topic, record.value());
OrderCreateInfoDTO orderCreateInfoDTO = JsonUtil.fromJson(record.value(), OrderCreateInfoDTO.class);
List<OrderItemDTO> orderItemList = orderCreateInfoDTO.getOrderItemList();
for (OrderItemDTO orderItem : orderItemList) {
// 7.1 通过商品的SKU ID查询到货位库存的明细条目,并进行遍历,一个SKU可能在多个货位上
SaleDeliveryScheduleResult scheduleResult = saleDeliveryScheduler.schedule(orderItem);
List<SaleDeliveryOrderPickingItem> pickingItems = scheduleResult.getPickingItems();
// 7.2 创建出需要拣货的条目和发货的条目并进行批量入库
saleDeliveryPickingItemService.saveBatch(pickingItems);
// 7.3 更新wms中心的库存
WmsStockUpdater stockUpdater = wmsStockUpdaterFactory.create(WmsStockUpdateEventConstants.SUBMIT_ORDER, scheduleResult);
stockUpdater.update();
}
}
use of com.whoiszxl.stock.WmsStockUpdater in project shopzz by whoiszxl.
the class UpdateStockHandler method doExecute.
@Override
protected PurchaseInboundOrderResult doExecute(PurchaseOrderDTO purchaseOrderDTO) {
// 通过库存更新工厂创建一个采购入库库存更新组件来更新
WmsStockUpdater wmsStockUpdater = stockUpdaterFactory.create(WmsStockUpdateEventConstants.PURCHASE_INBOUND, purchaseOrderDTO);
wmsStockUpdater.update();
return new PurchaseInboundOrderResult(true);
}
Aggregations