Commit 230c1b94 authored by 332784038@qq.com's avatar 332784038@qq.com

订单修改审批通过后重置订单提单文件

parent 3240a058
package cn.iocoder.yudao.framework.apollo.core.event.box;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* 重置订单的提单 Event
*
* @author zhengYi
*/
@Data
@AllArgsConstructor
public class BoxCheckOrderRemoveLadingBillEvent {
/**
* 订单ID
*/
private Long orderId;
}
...@@ -9,6 +9,7 @@ import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderYeJiType ...@@ -9,6 +9,7 @@ import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderYeJiType
import cn.iocoder.yudao.framework.apollo.core.event.Order.OrderApprovalTypeCheckEvent; import cn.iocoder.yudao.framework.apollo.core.event.Order.OrderApprovalTypeCheckEvent;
import cn.iocoder.yudao.framework.apollo.core.event.Order.OrderAssociationOfferInfoEvent; import cn.iocoder.yudao.framework.apollo.core.event.Order.OrderAssociationOfferInfoEvent;
import cn.iocoder.yudao.framework.apollo.core.event.box.BoxCheckOrderApprovalEvent; import cn.iocoder.yudao.framework.apollo.core.event.box.BoxCheckOrderApprovalEvent;
import cn.iocoder.yudao.framework.apollo.core.event.box.BoxCheckOrderRemoveLadingBillEvent;
import cn.iocoder.yudao.framework.apollo.core.event.box.BoxOrderDynamicEstTimeEvent; import cn.iocoder.yudao.framework.apollo.core.event.box.BoxOrderDynamicEstTimeEvent;
import cn.iocoder.yudao.framework.apollo.core.event.warehouseIn.WarehouseInOrderChangeChannelEvent; import cn.iocoder.yudao.framework.apollo.core.event.warehouseIn.WarehouseInOrderChangeChannelEvent;
import cn.iocoder.yudao.framework.apollo.core.event.warehouseIn.WarehouseInOrderChangeTransportEvent; import cn.iocoder.yudao.framework.apollo.core.event.warehouseIn.WarehouseInOrderChangeTransportEvent;
...@@ -6083,11 +6084,13 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -6083,11 +6084,13 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (isDisassociation) { if (isDisassociation) {
orderGuanlianService.deleteRelationByOrderId(orderDO.getOrderId()); orderGuanlianService.deleteRelationByOrderId(orderDO.getOrderId());
} }
// TODO 当运输方式出现变更时需要重置入仓业务 // 当运输方式出现变更时需要重置入仓业务
if (orderBackVO.getIsTransport()) { if (orderBackVO.getIsTransport()) {
applicationContext.publishEvent( applicationContext.publishEvent(
new WarehouseInOrderChangeTransportEvent(orderDO.getOrderId())); new WarehouseInOrderChangeTransportEvent(orderDO.getOrderId()));
} }
// 订单信息修改后需要重置提单信息
applicationContext.publishEvent(new BoxCheckOrderRemoveLadingBillEvent(orderDO.getOrderId()));
} }
......
package cn.iocoder.yudao.module.shipment.listener;
import cn.iocoder.yudao.framework.apollo.core.event.box.BoxCheckOrderRemoveLadingBillEvent;
import cn.iocoder.yudao.framework.apollo.core.event.box.BoxCheckOrderSchedulingEvent;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO;
import cn.iocoder.yudao.module.shipment.service.box.BoxService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
import java.util.Collections;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.WAREHOUSE_IN_BOX_EXCEPTION;
/**
* 当订单修改审批通过后,需要对已制作的提单进行重置
*
* @author zhengYi
*/
@Component("BoxOrderUpdateRemoveLadingBillListener")
@AllArgsConstructor
@Slf4j
public class BoxOrderUpdateRemoveLadingBillListener {
private final BoxService boxService;
/**
* 当订单修改审批通过后,需要对已制作的提单进行重置
*
* @param event 订单id
*/
@EventListener(BoxCheckOrderRemoveLadingBillEvent.class)
public void removeLadingBill(BoxCheckOrderRemoveLadingBillEvent event) {
Long orderId = event.getOrderId();
log.info("重置提单订单 orderId={}", orderId);
boxService.removeLadingBill(Collections.singleton(orderId));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment