| | |
| | | throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
| | | }
|
| | | String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
| | | String filePath = RuoYiConfig.getDownloadPath() + fileName;
|
| | |
|
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
| | | FileUtils.setAttachmentResponseHeader(response, realFileName);
|
| | | FileUtils.writeBytes(filePath, response.getOutputStream());
|
| | | if (delete)
|
| | | {
|
| | | FileUtils.deleteFile(filePath);
|
| | | }
|
| | | FileUtils.writeBytes(fileName, response.getOutputStream());
|
| | | // if (delete)
|
| | | // {
|
| | | // FileUtils.deleteFile(fileName);
|
| | | // }
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | |
| | | public List<PaymentHistoryRecordVo> getPaymentRecordList(Long supplierId) { |
| | | List<PaymentHistoryRecordVo> paymentRecordList = paymentRegistrationMapper.getPaymentRecordList(supplierId); |
| | | List<PaymentHistoryRecordVo> result = new ArrayList<>(); |
| | | List<PaymentHistoryRecordVo> newResult = new ArrayList<>(); |
| | | // 应付总金额金额计算 |
| | | BigDecimal amountTotal = BigDecimal.ZERO; |
| | | if(CollectionUtils.isNotEmpty(paymentRecordList)) { |
| | |
| | | result.add(paymentHistoryRecordVo); |
| | | } |
| | | |
| | | |
| | | for (int i = 0; i < result.size(); i++) { |
| | | PaymentHistoryRecordVo paymentHistoryRecordVo = result.get(i); |
| | | if (i == 0) { |
| | | paymentHistoryRecordVo.setPayableAmount(paymentHistoryRecordVo.getInvoiceAmount().subtract(paymentHistoryRecordVo.getCurrentPaymentAmount())); |
| | | }else { |
| | | PaymentHistoryRecordVo paymentHistoryRecordVo1 = result.get(i-1); |
| | | paymentHistoryRecordVo.setPayableAmount(paymentHistoryRecordVo1.getPayableAmount() |
| | | .add(paymentHistoryRecordVo.getInvoiceAmount()).subtract(paymentHistoryRecordVo.getCurrentPaymentAmount())); |
| | | } |
| | | newResult.add(paymentHistoryRecordVo); |
| | | } |
| | | } |
| | | return result; |
| | | return newResult; |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.vo.FileVo; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.InvoiceLedgerFile; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistrationProduct; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "发票文件名") |
| | | private String invoiceFileName; |
| | | |
| | | private List<InvoiceLedgerFile> commonFiles; |
| | | |
| | | private String searchText; |
| | | |
| | | private Boolean status; |
| | |
| | | |
| | | @Autowired |
| | | private SalesLedgerProductMapper salesLedgerProductMapper; |
| | | @Autowired |
| | | private CommonFileMapper commonFileMapper; |
| | | |
| | | /** |
| | | * 开票台账新增 |
| | |
| | | if (registrationProductDto.getStatus()) { |
| | | invoiceRegistrationProductDtoIPage.getRecords().removeIf(invoiceRegistrationProduct -> !StringUtils.isEmpty(invoiceRegistrationProduct.getInvoiceNo())); |
| | | } |
| | | invoiceRegistrationProductDtoIPage.getRecords().forEach(invoiceRegistrationProductDto -> { |
| | | invoiceRegistrationProductDto.setCommonFiles(invoiceLedgerFileMapper.selectList(new QueryWrapper<InvoiceLedgerFile>().lambda() |
| | | .eq(InvoiceLedgerFile::getInvoiceLedgerId, invoiceRegistrationProductDto.getInvoiceLedgerId()))); |
| | | }); |
| | | return invoiceRegistrationProductDtoIPage; |
| | | } |
| | | |
| | |
| | | invoiceLedger.setInvoiceTotal(invoiceRegistrationProduct.getInvoiceAmount()); |
| | | invoiceLedger.setInvoiceNo(salesLedgerDto.getInvoiceNo()); |
| | | invoiceLedger.setCreateUser(SecurityUtils.getUserId().intValue()); |
| | | invoiceLedger.setInvoicePerson(productDatum.getRegister()); |
| | | |
| | | invoiceLedgerMapper.insert(invoiceLedger); |
| | | } |
| | |
| | | customerInteractionDto.setUnReceiptAmount(amountTotal); |
| | | result.add(customerInteractionDto); |
| | | } |
| | | return result; |
| | | ArrayList<CustomerInteractionDto> newResult = new ArrayList<>(); |
| | | for (int i = 0; i < result.size(); i++) { |
| | | CustomerInteractionDto customerInteractionDto = result.get(i); |
| | | if (i == 0) { |
| | | customerInteractionDto.setUnReceiptAmount(customerInteractionDto.getInvoiceAmount().subtract(customerInteractionDto.getReceiptAmount())); |
| | | }else { |
| | | CustomerInteractionDto customerInteractionDto1 = result.get(i-1); |
| | | customerInteractionDto.setUnReceiptAmount(customerInteractionDto1.getUnReceiptAmount() |
| | | .add(customerInteractionDto.getInvoiceAmount()).subtract(customerInteractionDto.getReceiptAmount())); |
| | | } |
| | | newResult.add(customerInteractionDto); |
| | | } |
| | | return newResult; |
| | | } |
| | | |
| | | /** |
| | |
| | | T2.customer_contract_no, |
| | | T2.customer_name, |
| | | T3.invoice_no, |
| | | T3.id as invoice_ledger_id, |
| | | IFNULL(T3.invoice_total,0) AS invoice_total, |
| | | T3.invoice_person, |
| | | T3.invoice_date, |