| | |
| | | modify sale_ledger_id bigint default 0 null comment '销售台账id'; |
| | | |
| | | |
| | | alter table ticket_registration |
| | | add enter_date timestamp null; |
| | | |
| | |
| | | package com.ruoyi.project.common;
|
| | |
|
| | | import java.io.File;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
| | | {
|
| | | throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
| | | }
|
| | | String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
| | | String filePath = RuoYiConfig.getDownloadPath() + fileName;
|
| | | String realFileName = fileName.substring(fileName.indexOf("_") + 1);
|
| | |
|
| | | 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)
|
| | | {
|
| | |
| | | */ |
| | | @GetMapping("/productRecordPage") |
| | | public AjaxResult productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto) { |
| | | |
| | | IPage<ProductRecordDto> list = productRecordService.productRecordPage(page,ticketRegistrationDto); |
| | | return AjaxResult.success(list); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.purchase.pojo.TicketRegistration; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | private String businessPerson; |
| | | |
| | | |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate enterDate; |
| | | |
| | | /** |
| | | * 业务员id |
| | | */ |
| | |
| | | private String issueDateStart; |
| | | @TableField(exist = false) |
| | | private String issueDateEnd; |
| | | |
| | | @ApiModelProperty(value = "录入时间") |
| | | private LocalDate enterDate; |
| | | } |
| | |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public IPage<ProductRecordDto> productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto) { |
| | | IPage<ProductRecordDto> productRecordDtoIPage1 = productRecordMapper.productRecordPage(page, ticketRegistrationDto); |
| | | page.setSize(productRecordDtoIPage1.getTotal()); |
| | | IPage<ProductRecordDto> productRecordDtoIPage = productRecordMapper.productRecordPage(page, ticketRegistrationDto); |
| | | productRecordDtoIPage.getRecords().forEach(productRecordDto -> { |
| | | productRecordDto.setCommonFiles(commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, productRecordDto.getTicketRegistrationId()) |
| | |
| | | ticketRegistration.setIssueDate(ticketRegistrationDto.getIssueDate()); |
| | | ticketRegistration.setContractAmount(purchaseLedger.getContractAmount()); |
| | | ticketRegistration.setSalesLedgerId(purchaseLedger.getSalesLedgerId()); |
| | | ticketRegistration.setEnterDate(ticketRegistrationDto.getEnterDate()); |
| | | |
| | | // 4. 处理子表数据 |
| | | List<SalesLedgerProduct> productData = ticketRegistrationDto.getProductData(); |
| | |
| | | // 构建正式文件名(包含业务ID和时间戳,避免冲突) |
| | | String originalFilename = tempFile.getOriginalName(); |
| | | String fileExtension = FilenameUtils.getExtension(originalFilename); |
| | | String baseName = FilenameUtils.getBaseName(originalFilename); |
| | | String formalFilename = businessId + "_" + |
| | | System.currentTimeMillis() + "_" + |
| | | UUID.randomUUID().toString().substring(0, 8) + |
| | | UUID.randomUUID().toString().substring(0, 8) +baseName+ |
| | | (com.ruoyi.common.utils.StringUtils.hasText(fileExtension) ? "." + fileExtension : ""); |
| | | |
| | | Path formalFilePath = formalDirPath.resolve(formalFilename); |
| | |
| | | fileRecord.setName(originalFilename); |
| | | fileRecord.setUrl(formalFilePath.toString()); |
| | | fileRecord.setCreateTime(LocalDateTime.now()); |
| | | fileRecord.setType(tempFile.getType()); |
| | | fileRecord.setType(4); |
| | | commonFileMapper.insert(fileRecord); |
| | | |
| | | log.info("文件迁移成功: {} -> {}", tempFile.getTempPath(), formalFilePath); |
| | |
| | | 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, |