| | |
| | | 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.Collections; |
| | | 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); |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 开票台账查询 |
| | | * @param invoiceLedgerDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<InvoiceLedgerDto> invoiceLedgerList(InvoiceLedgerDto invoiceLedgerDto) { |
| | | return invoiceLedgerMapper.invoiceLedgerList(invoiceLedgerDto); |
| | | } |
| | | |
| | | } |