| | |
| | | import cn.iocoder.yudao.module.erp.enums.ErpPurchaseOrderInStatusEnum; |
| | | import cn.iocoder.yudao.module.erp.service.finance.ErpAccountService; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | |
| | | /** |
| | | * ERP 采购订单 Service 实现类 |
| | | * |
| | | * 注意:采购订单不需要 BPM 审批,审批流程在采购申请阶段完成。 |
| | | * 采购订单由采购申请生成,或直接创建(状态为已审核)。 |
| | | * |
| | | * @author 芋道源码 |
| | | */ |
| | |
| | | private ErpSupplierService supplierService; |
| | | @Resource |
| | | private ErpAccountService accountService; |
| | | |
| | | @Resource |
| | | @Lazy |
| | | private ErpPurchaseRequestService purchaseRequestService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | // 4. 更新采购订单入库状态 |
| | | purchaseOrderMapper.updateById(new ErpPurchaseOrderDO() |
| | | .setId(orderId).setInStatus(inStatus)); |
| | | // 5. 同步更新采购申请的入库状态(如果有关联的采购申请) |
| | | if (order.getRequestId() != null) { |
| | | purchaseRequestService.updatePurchaseRequestInStatus(order.getRequestId(), inStatus); |
| | | } |
| | | } |
| | | |
| | | /** |