| | |
| | | import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpFinancePaymentDO; |
| | | import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpFinancePaymentItemDO; |
| | | import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseInvoiceDO; |
| | | import cn.iocoder.yudao.module.erp.enums.finance.ErpFinancePaymentSourceTypeEnum; |
| | | import cn.iocoder.yudao.module.srm.api.supplier.SrmSupplierApi; |
| | | import cn.iocoder.yudao.module.srm.api.supplier.dto.SrmSupplierRespDTO; |
| | | import cn.iocoder.yudao.module.erp.service.finance.ErpFinancePaymentService; |
| | |
| | | ErpPurchaseInvoiceRespVO invoiceFinal = invoiceVO; |
| | | return BeanUtils.toBean(payment, ErpFinancePaymentRespVO.class, financePaymentVO -> |
| | | financePaymentVO.setInvoice(invoiceFinal) |
| | | .setSourceTypeName(resolveSourceTypeName(payment.getSourceType())) |
| | | .setItems(BeanUtils.toBean(paymentItemList, ErpFinancePaymentRespVO.Item.class)) |
| | | .setAttachmentList(storageAttachmentApi.listAttachments("erp_finance_payment", payment.getId()))); |
| | | } |
| | |
| | | ExcelUtils.write(response, "付款单.xls", "数据", ErpFinancePaymentRespVO.class, list); |
| | | } |
| | | |
| | | private String resolveSourceTypeName(Integer sourceType) { |
| | | ErpFinancePaymentSourceTypeEnum sourceTypeEnum = ErpFinancePaymentSourceTypeEnum.valueOf(sourceType); |
| | | return sourceTypeEnum != null ? sourceTypeEnum.getName() : null; |
| | | } |
| | | |
| | | private PageResult<ErpFinancePaymentRespVO> buildFinancePaymentVOPageResult(PageResult<ErpFinancePaymentDO> pageResult) { |
| | | if (CollUtil.isEmpty(pageResult.getList())) { |
| | | return PageResult.empty(pageResult.getTotal()); |
| | |
| | | // 2. 开始拼接 |
| | | return BeanUtils.toBean(pageResult, ErpFinancePaymentRespVO.class, payment -> { |
| | | payment.setItems(BeanUtils.toBean(financePaymentItemMap.get(payment.getId()), ErpFinancePaymentRespVO.Item.class)); |
| | | payment.setSourceTypeName(resolveSourceTypeName(payment.getSourceType())); |
| | | MapUtils.findAndThen(supplierMap, payment.getSupplierId(), supplier -> payment.setSupplierName(supplier.getName())); |
| | | MapUtils.findAndThen(userMap, Long.parseLong(payment.getCreator()), user -> payment.setCreatorName(user.getNickname())); |
| | | MapUtils.findAndThen(userMap, payment.getFinanceUserId(), user -> payment.setFinanceUserName(user.getNickname())); |