| | |
| | | private IInvoicePurchaseService invoicePurchaseService; |
| | | |
| | | @GetMapping("/list") |
| | | @Log(title = "éè´æ¥è¡¨", businessType = BusinessType.OTHER) |
| | | @Log(title = "éè´æ¥è¡¨-项ç®å©æ¶¦", businessType = BusinessType.OTHER) |
| | | public AjaxResult list(Page page, InvoicePurchaseReportDto invoicePurchaseReportDto) { |
| | | IPage<InvoicePurchaseReportDto> result =invoicePurchaseService.listPurchaseReport(page, invoicePurchaseReportDto); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @Log(title = "éè´æ¥è¡¨-å¢å¼ç¨æ¯å¯¹", businessType = BusinessType.OTHER) |
| | | @GetMapping("/listVat") |
| | | public AjaxResult listVat(Page page, InvoicePurchase invoicePurchase) { |
| | | IPage<InvoicePurchase> result = invoicePurchaseService.listVat(page, invoicePurchase); |
| | | return AjaxResult.success(result); |
| | | } |
| | | } |
| | |
| | | @ApiOperation("çæéè´åºåå·") |
| | | @GetMapping("/createPurchaseNo") |
| | | @Log(title = "çæéè´åºåå·", businessType = BusinessType.OTHER) |
| | | public String createPurchaseNo() { |
| | | return purchaseLedgerService.getPurchaseNo(); |
| | | public AjaxResult createPurchaseNo() { |
| | | return AjaxResult.success("çææå",purchaseLedgerService.getPurchaseNo()); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.purchase.dto.ProductRecordDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import com.ruoyi.purchase.pojo.TicketRegistration; |
| | | import com.ruoyi.purchase.service.IProductRecordService; |
| | | import com.ruoyi.purchase.service.ITicketRegistrationService; |
| | | import com.ruoyi.sales.service.ICommonFileService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | */ |
| | | @GetMapping("/productRecordPage") |
| | | public AjaxResult productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto) { |
| | | IPage<ProductRecord> list = productRecordService.productRecordPage(page,ticketRegistrationDto); |
| | | IPage<ProductRecordDto> list = productRecordService.productRecordPage(page,ticketRegistrationDto); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ProductRecordDto extends ProductRecord { |
| | | |
| | | //éå®ååå· |
| | | private String salesContractNo; |
| | | //客æ·ååå· |
| | | private String customerContarctNo; |
| | | |
| | | //客æ·åç§° |
| | | private String customerName; |
| | | //产ååç§° |
| | | private String productModel; |
| | | //éè´ååå· |
| | | private String purchaseContractNumber; |
| | | //ä¾åºååç§° |
| | | private String supplierName; |
| | | //å¢å¼ç¨ |
| | | private String invoiceAmount; |
| | | |
| | | private String invoiceNumber; |
| | | |
| | | private String unTicketsPrice; |
| | | } |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.purchase.pojo.TicketRegistration; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | |
| | | private List<CommonFile> CommonFiles; |
| | | |
| | | private String fileName; |
| | | |
| | | @TableField(exist = false) |
| | | private String createdAtStart; |
| | | @TableField(exist = false) |
| | | |
| | | private String createdAtEnd; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class VatDto { |
| | | |
| | | //æä»½ |
| | | private LocalDate month ; |
| | | |
| | | //è¿é¡¹ç¨ |
| | | private String jTaxAmount; |
| | | |
| | | //éé¡¹ç¨ |
| | | private String xTaxAmount; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.purchase.dto.InvoicePurchaseReportDto; |
| | | import com.ruoyi.purchase.dto.VatDto; |
| | | import com.ruoyi.purchase.pojo.InvoicePurchase; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å票信æ¯Mapperæ¥å£ |
| | |
| | | |
| | | IPage<InvoicePurchaseReportDto> selectPurchaseReport(IPage page, @Param("c") InvoicePurchaseReportDto invoicePurchaseReportDto); |
| | | |
| | | List<VatDto> listVat(Page page, InvoicePurchase invoicePurchase); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.purchase.dto.ProductRecordDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * éè´å°è´¦äº§åå¼ç¥¨è®°å½Mapperæ¥å£ |
| | |
| | | */ |
| | | public interface ProductRecordMapper extends BaseMapper<ProductRecord> { |
| | | |
| | | IPage<ProductRecord> productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto); |
| | | IPage<ProductRecordDto> productRecordPage(Page page, @Param("c") TicketRegistrationDto ticketRegistrationDto); |
| | | } |
| | |
| | | List<InvoicePurchase> selectInvoicePurchaseLists(InvoicePurchase invoicePurchase); |
| | | |
| | | IPage<InvoicePurchaseReportDto> listPurchaseReport(Page page, InvoicePurchaseReportDto invoicePurchaseReportDto); |
| | | |
| | | IPage<InvoicePurchase> listVat(Page page, InvoicePurchase invoicePurchase); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.purchase.dto.ProductRecordDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | |
| | |
| | | |
| | | List<ProductRecord> selectProductRecordList(TicketRegistrationDto ticketRegistrationDto); |
| | | |
| | | IPage<ProductRecord> productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto); |
| | | IPage<ProductRecordDto> productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto); |
| | | } |
| | |
| | | |
| | | return invoicePurchaseMapper.selectPurchaseReport(page, invoicePurchaseReportDto); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<InvoicePurchase> listVat(Page page, InvoicePurchase invoicePurchase) { |
| | | invoicePurchaseMapper.listVat(page, invoicePurchase); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.purchase.dto.ProductRecordDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.mapper.ProductRecordMapper; |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<ProductRecord> productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto) { |
| | | public IPage<ProductRecordDto> productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto) { |
| | | |
| | | return productRecordMapper.productRecordPage(page, ticketRegistrationDto); |
| | | } |
| | |
| | | } |
| | | |
| | | // è®¡ç® futureTicketsï¼ç´æ¥ä½¿ç¨ BigDecimal 计ç®ï¼é¿å
ç²¾åº¦ä¸¢å¤±ï¼ |
| | | product.setFutureTickets( |
| | | product.getQuantity() |
| | | .subtract(product.getTicketsNum()) |
| | | ); |
| | | // product.setFutureTickets( |
| | | // product.getQuantity() |
| | | // .subtract(product.getTicketsNum()) |
| | | // ); |
| | | |
| | | |
| | | // è®¡ç® futureTicketsAmount |
| | | product.setFutureTicketsAmount( |
| | | product.getTaxInclusiveTotalPrice() |
| | | .subtract(product.getTicketsAmount()) |
| | | ); |
| | | // product.setFutureTicketsAmount( |
| | | // product.getTaxInclusiveTotalPrice() |
| | | // .subtract(product.getTicketsAmount()) |
| | | // ); |
| | | product.setType(type); |
| | | salesLedgerProductMapper.updateById(product); |
| | | }); |
| | |
| | | salesLedger.setInvoiceTotal(invoiceTotal); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(salesLedgerDto.getStatus())) { |
| | | if (salesLedgerDto.getStatus()==1) { |
| | | iPage.getRecords().removeIf(salesLedger -> !Objects.equals(salesLedger.getNoInvoiceAmountTotal(), new BigDecimal("0.00"))); |
| | | if (salesLedgerDto.getStatus()) { |
| | | iPage.getRecords().removeIf(salesLedger -> Objects.equals(salesLedger.getNoInvoiceAmountTotal(), new BigDecimal("0.00"))); |
| | | } |
| | | } |
| | | return iPage; |
| | |
| | | |
| | | private String searchText; |
| | | |
| | | private Boolean status; |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String receiptPaymentDateEnd; |
| | | |
| | | private String projectName; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "ç¾è®¢æ¥æ") |
| | | private LocalDate executionDate; |
| | | |
| | | private Integer status; |
| | | private Boolean status; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.vo.FileVo; |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | |
| | | */ |
| | | @Override |
| | | public IPage<InvoiceRegistrationProductDto> registrationProductPage(Page page, InvoiceRegistrationProductDto registrationProductDto) { |
| | | return invoiceRegistrationProductMapper.invoiceRegistrationProductPage(page,registrationProductDto); |
| | | IPage<InvoiceRegistrationProductDto> invoiceRegistrationProductDtoIPage = invoiceRegistrationProductMapper.invoiceRegistrationProductPage(page, registrationProductDto); |
| | | if (registrationProductDto.getStatus()) { |
| | | invoiceRegistrationProductDtoIPage.getRecords().removeIf(invoiceRegistrationProduct -> StringUtils.isEmpty(invoiceRegistrationProduct.getInvoiceNo())); |
| | | } |
| | | return invoiceRegistrationProductDtoIPage; |
| | | } |
| | | |
| | | /** |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="listVat" resultType="com.ruoyi.purchase.dto.VatDto"> |
| | | SELECT |
| | | DATE_FORMAT(il.invoice_date, '%Y-%m') AS month, |
| | | ROUND(SUM(pr.invoice_amount - pr.invoice_amount / (1 + pr.tax_rate / 100)), 2) AS tax_amount |
| | | FROM invoice_ledger il |
| | | LEFT JOIN invoice_registration_product pr ON pr.id = il.invoice_registration_product_id |
| | | WHERE il.invoice_no IS NOT NULL |
| | | AND invoice_type = 'å¢ä¸ç¥¨' |
| | | GROUP BY DATE_FORMAT(il.invoice_date, '%Y-%m') |
| | | ORDER BY month; |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | AND T2.supplier_name LIKE CONCAT('%',#{params.searchText},'%') |
| | | </if> |
| | | <if test="params.paymentDateStart != null and params.paymentDateStart !='' "> |
| | | AND T1.payment_date >= STR_TO_DATE(#{params.paymentDateStart},'yyyy-MM-dd') |
| | | AND T1.payment_date >= date_format(#{params.paymentDateStart},'%Y-%m-%d') |
| | | </if> |
| | | <if test="params.paymentDateEnd != null and params.paymentDateEnd !='' "> |
| | | AND T1.payment_date >= STR_TO_DATE(#{params.paymentDateEnd},'yyyy-MM-dd') |
| | | AND T1.payment_date < date_format(#{params.paymentDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.payment_date,T1.create_time DESC |
| | |
| | | <mapper namespace="com.ruoyi.purchase.mapper.ProductRecordMapper"> |
| | | |
| | | |
| | | <select id="productRecordPage" resultType="com.ruoyi.purchase.pojo.ProductRecord"> |
| | | <select id="productRecordPage" resultType="com.ruoyi.purchase.dto.ProductRecordDto"> |
| | | SELECT |
| | | distinct |
| | | sl.sales_contract_no, |
| | | sl.customer_contract_no, |
| | | sl.customer_name, |
| | | pm.model AS product_model, |
| | | pl.purchase_contract_number, |
| | | pl.supplier_name, |
| | | pr.*, |
| | | tr.invoice_number, |
| | | ROUND(pr.tickets_amount/(1+pr.tax_rate/100),2 ) as un_tickets_price, |
| | | ROUND(pr.tickets_amount-pr.tickets_amount/(1+pr.tax_rate/100),2 )as invoice_amount |
| | | |
| | | FROM product_record pr |
| | | left join purchase_ledger pl on pl.id = pr.purchase_ledger_id |
| | | left join sales_ledger sl on sl.id = pl.sales_ledger_id |
| | | left join ticket_registration tr on tr.purchase_ledger_id = pl.id |
| | | left join product_model pm on pm.id = pr.product_model_id |
| | | WHERE type = 2 |
| | | <if test="c.salesContractNo != null and c.salesContractNo != ''"> |
| | | and sl.sales_contract_no = #{c.salesContractNo} |
| | | </if> |
| | | <if test="c.supplierName != null and c.supplierName != ''"> |
| | | and sl.supplier_name = #{c.supplierName} |
| | | </if> |
| | | <if test="c.createdAtStart != null and c.createdAtStart != ''"> |
| | | and pr.created_at >= date_format(#{c.createdAtStart},'%Y-%m-%d') |
| | | </if> |
| | | <if test="c.createdAtEnd != null and c.createdAtEnd != ''"> |
| | | and pr.created_at < date_format(#{c.createdAtEnd},'%Y-%m-%d') |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | ) |
| | | </if> |
| | | <if test="invoiceRegistrationProductDto.invoiceDateStart != null and invoiceRegistrationProductDto.invoiceDateStart != ''"> |
| | | AND T3.invoice_date >= STR_TO_DATE(#{invoiceRegistrationProductDto.invoiceDateStart}, '%Y-%m-%d') |
| | | AND T3.invoice_date >= date_format(#{invoiceRegistrationProductDto.invoiceDateStart}, '%Y-%m-%d') |
| | | </if> |
| | | <if test="invoiceRegistrationProductDto.invoiceDateEnd != null and invoiceRegistrationProductDto.invoiceDateEnd != ''"> |
| | | AND T3.invoice_date < STR_TO_DATE(#{invoiceRegistrationProductDto.invoiceDateEnd}, '%Y-%m-%d') |
| | | AND T3.invoice_date < date_format(#{invoiceRegistrationProductDto.invoiceDateEnd}, '%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.create_time DESC |
| | |
| | | T1.id , |
| | | T1.invoice_no , |
| | | T1.invoice_total , |
| | | T3.project_name, |
| | | T1.invoice_person , |
| | | T1.invoice_date , |
| | | T1.create_time , |
| | |
| | | T1.receipt_payment_amount, |
| | | T1.receipt_payment_type, |
| | | T1.registrant, |
| | | T1.create_time |
| | | T1.create_time, |
| | | T4.project_name |
| | | FROM |
| | | receipt_payment T1 |
| | | LEFT JOIN |
| | |
| | | T5.customer_name LIKE CONCAT('%',#{params.searchText},'%') |
| | | </if> |
| | | <if test="params.receiptPaymentDateStart != null and params.receiptPaymentDateStart != '' "> |
| | | AND T1.receipt_payment_date >= STR_TO_DATE(#{params.receiptPaymentDateStart},'yyyy-mm-dd') |
| | | AND T1.receipt_payment_date >= date_format(#{params.receiptPaymentDateStart},'%Y-%m-%d') |
| | | </if> |
| | | <if test="params.receiptPaymentDateEnd != null and params.receiptPaymentDateEnd != '' "> |
| | | AND T1.receipt_payment_date < STR_TO_DATE(#{params.receiptPaymentDateEnd}, '%Y-%m-%d') |
| | | AND T1.receipt_payment_date < date_format(#{params.receiptPaymentDateEnd}, '%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.receipt_payment_date DESC |