| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.InvoicePurchaseDto; |
| | | import com.ruoyi.sales.dto.ReceiptPaymentDto; |
| | | import com.ruoyi.sales.pojo.ReceiptPayment; |
| | | import com.ruoyi.sales.service.ReceiptPaymentService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/receiptPayment") |
| | | public class ReceiptPaymentController { |
| | | public class ReceiptPaymentController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ReceiptPaymentService receiptPaymentService; |
| | |
| | | return AjaxResult.success(receiptPaymentService.receiptPaymentInfo(id)); |
| | | } |
| | | |
| | | /** |
| | | * 本月回款金额 |
| | | */ |
| | | @GetMapping("/getReceiptAmount") |
| | | public AjaxResult getReceiptAmount() { |
| | | try { |
| | | BigDecimal receiptAmount = receiptPaymentService.getReceiptAmount(); |
| | | return AjaxResult.success(receiptAmount != null ? receiptAmount : BigDecimal.ZERO); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error("获取回款金额失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询已经绑定发票的开票台账 |
| | | * @param page |
| | | * @param receiptPaymentDto |
| | | * @return |
| | | */ |
| | | @GetMapping("/bindInvoiceNoRegPage") |
| | | public AjaxResult bindInvoiceNoRegPage(Page page, ReceiptPaymentDto receiptPaymentDto) { |
| | | return AjaxResult.success(receiptPaymentService.bindInvoiceNoRegPage(page,receiptPaymentDto)); |
| | | } |
| | | |
| | | /** |
| | | * 开票台账详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/invoiceInfo") |
| | | public AjaxResult invoiceInfo (Integer id) { |
| | | return AjaxResult.success(receiptPaymentService.invoiceInfo(id)); |
| | | } |
| | | |
| | | /** |
| | | * 本月应收,回款金额 |
| | | */ |
| | | @GetMapping("/getAmountMouth") |
| | | public AjaxResult getAmountMouth() { |
| | | return AjaxResult.success(receiptPaymentService.getAmountMouth()); |
| | | } |
| | | |
| | | /** |
| | | * 查询回款记录 |
| | | */ |
| | | @GetMapping("/receiptPaymentHistoryList") |
| | | public TableDataInfo receiptPaymentHistoryList(ReceiptPaymentDto receiptPaymentDto) { |
| | | startPage(); |
| | | List<ReceiptPaymentDto> list = receiptPaymentService.receiptPaymentHistoryList(receiptPaymentDto); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 查询回款记录 |
| | | */ |
| | | @GetMapping("/receiptPaymentHistoryListPage") |
| | | public IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page, ReceiptPaymentDto receiptPaymentDto) { |
| | | return receiptPaymentService.receiptPaymentHistoryListPage(page,receiptPaymentDto); |
| | | } |
| | | } |