| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.time.ZoneId; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | List<ReceiptPaymentRecordDto> receiptPaymentRecordDtos = new ArrayList<>(); |
| | | salesLedgerIPage.getRecords().forEach(receiptPaymentRecordDto -> { |
| | | ReceiptPaymentRecordDto receiptPaymentRecordDto1 = new ReceiptPaymentRecordDto(); |
| | | BeanUtils.copyBeanProp(receiptPaymentRecordDto, receiptPaymentRecordDto1); |
| | | // copyBeanProp(Object dest, Object src):第一个参数是目标,第二个是源 |
| | | BeanUtils.copyBeanProp(receiptPaymentRecordDto1, receiptPaymentRecordDto); |
| | | // 字段名不一致的手动补齐 |
| | | receiptPaymentRecordDto1.setReceiptPaymentAmountTotal(receiptPaymentRecordDto.getReceiptPaymentAmount()); |
| | | if (receiptPaymentRecordDto1.getReceiptPaymentType() == null) { |
| | | receiptPaymentRecordDto1.setReceiptPaymentType(receiptPaymentRecordDto.getReceiptPaymentType()); |
| | | } |
| | | if (receiptPaymentRecordDto.getCreateTime() != null) { |
| | | receiptPaymentRecordDto1.setInvoiceDate(Date.from( |
| | | receiptPaymentRecordDto.getCreateTime().atZone(ZoneId.systemDefault()).toInstant())); |
| | | } |
| | | receiptPaymentRecordDtos.add(receiptPaymentRecordDto1); |
| | | }); |
| | | util.exportExcel(response, receiptPaymentRecordDtos, "导出开票登记列表"); |
| | | util.exportExcel(response, receiptPaymentRecordDtos, "回款流水列表"); |
| | | } |
| | | |
| | | /** |