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,6 +38,7 @@ import org.springframework.stereotype.Service; | ||
| 38 | import org.springframework.transaction.annotation.Propagation; | 38 | import org.springframework.transaction.annotation.Propagation; |
| 39 | import org.springframework.transaction.annotation.Transactional; | 39 | import org.springframework.transaction.annotation.Transactional; |
| 40 | 40 | ||
| 41 | +import org.springframework.context.ApplicationContext; | ||
| 41 | import javax.annotation.Resource; | 42 | import javax.annotation.Resource; |
| 42 | import java.io.Serializable; | 43 | import java.io.Serializable; |
| 43 | import java.util.ArrayList; | 44 | import java.util.ArrayList; |
| @@ -60,6 +61,8 @@ public class DraftRequestCarTicketServiceImpl extends BaseMpServiceImpl<DraftReq | @@ -60,6 +61,8 @@ public class DraftRequestCarTicketServiceImpl extends BaseMpServiceImpl<DraftReq | ||
| 60 | private ShipmentsPlanDetailService shipmentsPlanDetailService; | 61 | private ShipmentsPlanDetailService shipmentsPlanDetailService; |
| 61 | @Resource | 62 | @Resource |
| 62 | private MqProducerService mqProducerService; | 63 | private MqProducerService mqProducerService; |
| 64 | + @Resource | ||
| 65 | + private ApplicationContext applicationContext; | ||
| 63 | 66 | ||
| 64 | @Override | 67 | @Override |
| 65 | public PageResult<DraftRequestCarTicket> query(Integer pageIndex, Integer pageSize, QueryDraftRequestCarTicketVo vo) { | 68 | public PageResult<DraftRequestCarTicket> query(Integer pageIndex, Integer pageSize, QueryDraftRequestCarTicketVo vo) { |
| @@ -326,7 +329,8 @@ public class DraftRequestCarTicketServiceImpl extends BaseMpServiceImpl<DraftReq | @@ -326,7 +329,8 @@ public class DraftRequestCarTicketServiceImpl extends BaseMpServiceImpl<DraftReq | ||
| 326 | */ | 329 | */ |
| 327 | @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) | 330 | @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) |
| 328 | public void createDraftAndNotify(CreateDraftRequestCarTicketVo vo) { | 331 | public void createDraftAndNotify(CreateDraftRequestCarTicketVo vo) { |
| 329 | - this.create(vo); | 332 | + // 通过 Spring 代理调用 create,确保 @OpLog 切面生效,避免 OpLogUtil 空指针 |
| 333 | + applicationContext.getBean(DraftRequestCarTicketServiceImpl.class).create(vo); | ||
| 330 | PurchaseOrderInfo info = purchaseOrderInfoService.findById(vo.getPurchaseOrderId()); | 334 | PurchaseOrderInfo info = purchaseOrderInfoService.findById(vo.getPurchaseOrderId()); |
| 331 | if (info == null) { | 335 | if (info == null) { |
| 332 | return; | 336 | return; |