| | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.purchase.dto.InvoicePurchaseDto; |
| | | import com.ruoyi.purchase.dto.InvoicePurchaseReportDto; |
| | | import com.ruoyi.purchase.dto.VatDto; |
| | | import com.ruoyi.purchase.mapper.InvoicePurchaseMapper; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerMapper; |
| | | import com.ruoyi.purchase.pojo.InvoicePurchase; |
| | |
| | | // 批量查询这些发票关联的文件信息 |
| | | LambdaQueryWrapper<CommonFile> fileQueryWrapper = new LambdaQueryWrapper<>(); |
| | | fileQueryWrapper.in(CommonFile::getCommonId, invoiceIds) |
| | | .eq(CommonFile::getType,"3"); |
| | | .eq(CommonFile::getType, FileNameType.INVOICE.getValue()); |
| | | List<CommonFile> fileList = commonFileMapper.selectList(fileQueryWrapper); |
| | | |
| | | // 将文件信息映射到对应的发票ID |
| | |
| | | // 查询上传文件 |
| | | LambdaQueryWrapper<CommonFile> commonFileLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | commonFileLambdaQueryWrapper.eq(CommonFile::getCommonId, invoicePurchaseDto.getId()) |
| | | .eq(CommonFile::getType, "3"); |
| | | .eq(CommonFile::getType, FileNameType.INVOICE.getValue()); |
| | | List<CommonFile> commonFiles = commonFileMapper.selectList(commonFileLambdaQueryWrapper); |
| | | resultDto.setCommonFiles(commonFiles); |
| | | return resultDto; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<InvoicePurchase> listVat(Page page, InvoicePurchase invoicePurchase) { |
| | | invoicePurchaseMapper.listVat(page, invoicePurchase); |
| | | return null; |
| | | public IPage<VatDto> listVat(Page page, String month) { |
| | | IPage<VatDto> vatDtos = invoicePurchaseMapper.listVat(page,month); |
| | | vatDtos.getRecords().forEach(vatDto -> { |
| | | vatDto.setTaxAmount(vatDto.getJTaxAmount().subtract(vatDto.getXTaxAmount())); |
| | | }); |
| | | return vatDtos; |
| | | } |
| | | } |