liding
2025-05-20 acf6afe2eccd504572d02d011ac1659c8ea5e473
src/main/java/com/ruoyi/sales/controller/InvoiceLedgerController.java
@@ -9,6 +9,7 @@
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
@RestController
@@ -76,14 +77,14 @@
    }
    /**
     * 附件下载
     * 开票台账导出
     * @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);
    }
    /**
@@ -96,4 +97,53 @@
        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());
        }
    }
    /**
     * 开票台账查询
     * @param invoiceLedgerDto
     * @return
     */
    @GetMapping("/list")
    public AjaxResult invoiceLedgerList(InvoiceLedgerDto invoiceLedgerDto) {
        return AjaxResult.success(invoiceLedgerService.invoiceLedgerList(invoiceLedgerDto));
    }
    /**
     * 客户销售记录
     * @param page
     * @param invoiceLedgerDto
     * @return
     */
    @GetMapping("/salesAccount")
    public AjaxResult invoiceLedgerSalesAccount(Page page, InvoiceLedgerDto invoiceLedgerDto) {
        return AjaxResult.success(invoiceLedgerService.invoiceLedgerSalesAccount(page,invoiceLedgerDto));
    }
    /**
     * 本月开票金额
     */
    @GetMapping("/getInvoiceAmount")
    public AjaxResult getInvoiceAmount() {
        try {
            BigDecimal amount = invoiceLedgerService.getInvoiceAmount();
            return AjaxResult.success(amount != null ? amount : BigDecimal.ZERO);
        } catch (Exception e) {
            return AjaxResult.error("获取开票金额失败:" + e.getMessage());
        }
    }
}