12 小时以前 16338016e73791cecbbdbdd73e972b29a06c59b1
src/main/java/com/ruoyi/approve/service/impl/ApprovalInstanceServiceImpl.java
@@ -105,6 +105,30 @@
        }
        records.forEach(vo -> {
            vo.setBusinessName(TypeEnums.getLabelByValue(vo.getBusinessType()));
            // 根据业务类型查询对应的单号
            if (vo.getBusinessType() != null && vo.getBusinessId() != null) {
                if (TypeEnums.PURCHASE_APPROVAL.getCode().equals(vo.getBusinessType())) {
                    // 采购审批 - 查询采购单号
                    PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(vo.getBusinessId());
                    System.out.println("业务类型:" + purchaseLedger.getPurchaseContractNumber());
                    if (purchaseLedger != null) {
                        vo.setPurchaseContractNumber(purchaseLedger.getPurchaseContractNumber());
                    }
                } else if (TypeEnums.QUOTATION_APPROVAL.getCode().equals(vo.getBusinessType())) {
                    // 报价审批 - 查询报价单号
                    SalesQuotation salesQuotation = salesQuotationMapper.selectById(vo.getBusinessId());
                    if (salesQuotation != null) {
                        vo.setQuotationNo(salesQuotation.getQuotationNo());
                    }
                } else if (TypeEnums.SHIPPING_APPROVAL.getCode().equals(vo.getBusinessType())) {
                    // 发货审批 - 查询发货单号
                    ShippingInfo shippingInfo = shippingInfoMapper.selectById(vo.getBusinessId());
                    if (shippingInfo != null) {
                        vo.setShippingNo(shippingInfo.getShippingNo());
                    }
                }
            }
        });
        Long currentUserId = SecurityUtils.getUserId();