Commit b6c4afe1ed115680f0ae18d45761546b9f422184
1 parent
16ad67e3
发货模块:生成发货单时,没有草稿要车单需要生成草稿要车单,不能跟随回滚
Showing
1 changed file
with
5 additions
and
1 deletions
| ... | ... | @@ -38,6 +38,7 @@ import org.springframework.stereotype.Service; |
| 38 | 38 | import org.springframework.transaction.annotation.Propagation; |
| 39 | 39 | import org.springframework.transaction.annotation.Transactional; |
| 40 | 40 | |
| 41 | +import org.springframework.context.ApplicationContext; | |
| 41 | 42 | import javax.annotation.Resource; |
| 42 | 43 | import java.io.Serializable; |
| 43 | 44 | import java.util.ArrayList; |
| ... | ... | @@ -60,6 +61,8 @@ public class DraftRequestCarTicketServiceImpl extends BaseMpServiceImpl<DraftReq |
| 60 | 61 | private ShipmentsPlanDetailService shipmentsPlanDetailService; |
| 61 | 62 | @Resource |
| 62 | 63 | private MqProducerService mqProducerService; |
| 64 | + @Resource | |
| 65 | + private ApplicationContext applicationContext; | |
| 63 | 66 | |
| 64 | 67 | @Override |
| 65 | 68 | public PageResult<DraftRequestCarTicket> query(Integer pageIndex, Integer pageSize, QueryDraftRequestCarTicketVo vo) { |
| ... | ... | @@ -326,7 +329,8 @@ public class DraftRequestCarTicketServiceImpl extends BaseMpServiceImpl<DraftReq |
| 326 | 329 | */ |
| 327 | 330 | @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) |
| 328 | 331 | public void createDraftAndNotify(CreateDraftRequestCarTicketVo vo) { |
| 329 | - this.create(vo); | |
| 332 | + // 通过 Spring 代理调用 create,确保 @OpLog 切面生效,避免 OpLogUtil 空指针 | |
| 333 | + applicationContext.getBean(DraftRequestCarTicketServiceImpl.class).create(vo); | |
| 330 | 334 | PurchaseOrderInfo info = purchaseOrderInfoService.findById(vo.getPurchaseOrderId()); |
| 331 | 335 | if (info == null) { |
| 332 | 336 | return; | ... | ... |