| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.SupplierManageDto; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.service.InvoiceLedgerService; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 附件下载 |
| | | * 开票台账导出 |
| | | * @param response |
| | | * @param invoiceLedgerDto |
| | | * @return |
| | | */ |
| | | @GetMapping("/downloadFile") |
| | | public void invoiceLedgerDownloadFile(HttpServletResponse response, InvoiceLedgerDto invoiceLedgerDto) { |
| | | invoiceLedgerService.invoiceLedgerDownload(response, invoiceLedgerDto); |
| | | @PostMapping("/export") |
| | | public void invoiceLedgerExport(HttpServletResponse response, InvoiceLedgerDto invoiceLedgerDto) { |
| | | invoiceLedgerService.invoiceLedgerExport(response, invoiceLedgerDto); |
| | | } |
| | | |
| | | /** |
| | |
| | | return AjaxResult.success(invoiceLedgerService.invoiceLedgerDetail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 文件提交 |
| | | * @param invoiceLedgerDto |
| | | * @return |
| | | */ |
| | | @PostMapping("/commitFile") |
| | | public AjaxResult invoiceLedgerCommitFile(@RequestBody InvoiceLedgerDto invoiceLedgerDto) { |
| | | try { |
| | | invoiceLedgerService.invoiceLedgerCommitFile(invoiceLedgerDto); |
| | | return AjaxResult.success(); |
| | | }catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "业务员") |
| | | private String salesman; |
| | | |
| | | @ApiModelProperty(value = "发票文件名") |
| | | private String invoiceFileName; |
| | | } |
| | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Excel(name = "销售合同号") |
| | | private String salesContractNo; |
| | | |
| | | @Excel(name = "") |
| | | private String customerContractNo; |
| | | |
| | | @Excel(name = "客户名称") |
| | | private String customerName; |
| | |
| | | private String invoicePerson; |
| | | |
| | | @Excel(name = "开票时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime invoiceDate; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate invoiceDate; |
| | | |
| | | @Excel(name = "发票") |
| | | private String invoiceFileName; |
| | | } |
| | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.Format; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.SupplierManageDto; |
| | | import com.ruoyi.common.vo.FileVo; |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.pojo.InvoiceLedgerFile; |
| | |
| | | * @param invoiceLedgerDto |
| | | * @return |
| | | */ |
| | | void invoiceLedgerDownload(HttpServletResponse response ,InvoiceLedgerDto invoiceLedgerDto); |
| | | void invoiceLedgerExport(HttpServletResponse response ,InvoiceLedgerDto invoiceLedgerDto); |
| | | |
| | | /** |
| | | * 开票台账详情 |
| | |
| | | * @return |
| | | */ |
| | | InvoiceLedgerDto invoiceLedgerDetail(Integer id); |
| | | |
| | | /** |
| | | * 附件提交 |
| | | * @param invoiceLedgerDto |
| | | * @return |
| | | */ |
| | | void invoiceLedgerCommitFile(InvoiceLedgerDto invoiceLedgerDto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.dto.SupplierManageDto; |
| | | import com.ruoyi.basic.excel.SupplierManageExcelDto; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.vo.FileVo; |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | import java.util.stream.Collectors; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void invoiceLedgerDownload(HttpServletResponse response, InvoiceLedgerDto invoiceLedgerDto) { |
| | | public void invoiceLedgerExport(HttpServletResponse response, InvoiceLedgerDto invoiceLedgerDto) { |
| | | List<InvoiceLedgerDto> invoiceLedgerDtoList = invoiceLedgerMapper.invoiceLedgerList(invoiceLedgerDto); |
| | | List<InvoiceLedgerExcelDto> invoiceLedgerExcelDtoList = invoiceLedgerDtoList.stream().map(item -> { |
| | | InvoiceLedgerExcelDto invoiceLedgerExcelDto = new InvoiceLedgerExcelDto(); |
| | |
| | | return invoiceLedgerDto; |
| | | } |
| | | |
| | | /** |
| | | * 附件提交 |
| | | * @param invoiceLedgerDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void invoiceLedgerCommitFile(InvoiceLedgerDto invoiceLedgerDto) { |
| | | if(null == invoiceLedgerDto.getId()){ |
| | | throw new RuntimeException("缺少发票台账主键"); |
| | | } |
| | | if(CollectionUtils.isEmpty(invoiceLedgerDto.getFileList())){ |
| | | throw new RuntimeException("缺少文件信息"); |
| | | } |
| | | List<FileVo> fileList = invoiceLedgerDto.getFileList(); |
| | | fileList.forEach(fileVo -> { |
| | | InvoiceLedgerFile invoiceLedgerFile = new InvoiceLedgerFile(); |
| | | BeanUtils.copyProperties(fileVo, invoiceLedgerFile); |
| | | invoiceLedgerFile.setInvoiceLedgerId(invoiceLedgerDto.getId()); |
| | | invoiceLedgerFileMapper.insert(invoiceLedgerFile); |
| | | }); |
| | | } |
| | | |
| | | } |
| | |
| | | T1.tenant_id , |
| | | T2.customer_name, |
| | | T3.customer_contract_no, |
| | | T3.salesman |
| | | T3.salesman, |
| | | T4.invoiceFileName |
| | | FROM invoice_ledger T1 |
| | | LEFT JOIN customer T2 ON T1.customer_id = T2.id |
| | | LEFT JOIN sales_ledger T3 ON T1.sales_ledger_id = T3.id |
| | | LEFT JOIN ( |
| | | SELECT |
| | | invoice_ledger_id, |
| | | GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName |
| | | FROM invoice_ledger_file GROUP BY invoice_ledger_id |
| | | ) T4 ON T4.invoice_ledger_id = T1.id |
| | | <where> |
| | | <if test="invoiceLedgerDto.searchText != null and invoiceLedgerDto.searchText != ''"> |
| | | AND ( |
| | |
| | | |
| | | <select id="invoiceLedgerList" resultType="com.ruoyi.sales.dto.InvoiceLedgerDto"> |
| | | SELECT |
| | | T1.id , |
| | | T1.sales_ledger_id , |
| | | T1.sales_contract_no , |
| | | T1.customer_id , |
| | | T1.invoice_no , |
| | | T1.invoice_amount , |
| | | T1.tax_rate , |
| | | T1.invoice_person , |
| | | T1.invoice_date , |
| | | T1.create_time , |
| | | T1.create_user , |
| | | T1.update_time , |
| | | T1.update_user , |
| | | T1.tenant_id , |
| | | T2.customer_name |
| | | T1.id , |
| | | T1.sales_ledger_id , |
| | | T1.sales_contract_no , |
| | | T1.customer_id , |
| | | T1.invoice_no , |
| | | T1.invoice_amount , |
| | | T1.tax_rate , |
| | | T1.invoice_person , |
| | | T1.invoice_date , |
| | | T1.create_time , |
| | | T1.create_user , |
| | | T1.update_time , |
| | | T1.update_user , |
| | | T1.tenant_id , |
| | | T2.customer_name, |
| | | T3.salesman, |
| | | T3.customer_contract_no, |
| | | T4.invoiceFileName |
| | | FROM invoice_ledger T1 |
| | | LEFT JOIN customer T2 ON T1.customer_id = T2.id |
| | | LEFT JOIN sales_ledger T3 ON T1.sales_ledger_id = T3.id |
| | | LEFT JOIN ( |
| | | SELECT |
| | | invoice_ledger_id, |
| | | GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName |
| | | FROM invoice_ledger_file GROUP BY invoice_ledger_id |
| | | ) T4 ON T4.invoice_ledger_id = T1.id |
| | | <where> |
| | | <if test="invoiceLedgerDto.searchText != null and invoiceLedgerDto.searchText != ''"> |
| | | AND ( |