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
@@ -23,9 +24,9 @@
     * @param invoiceLedgerDto
     * @return
     */
    @PostMapping("/add")
    public AjaxResult invoiceLedgerAdd(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
        invoiceLedgerService.invoiceLedgerAdd(invoiceLedgerDto);
    @PostMapping("/saveOrUpdate")
    public AjaxResult invoiceLedgerSaveOrUpdate(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
        invoiceLedgerService.invoiceLedgerSaveOrUpdate(invoiceLedgerDto);
        return AjaxResult.success();
    }
@@ -35,19 +36,8 @@
     * @return
     */
    @DeleteMapping("/del")
    public AjaxResult invoiceLedgerDel(@RequestParam List<Integer> ids) {
    public AjaxResult invoiceLedgerDel(@RequestBody List<Integer> ids) {
        invoiceLedgerService.invoiceLedgerDel(ids);
        return AjaxResult.success();
    }
    /**
     * 开票台账修改
     * @param invoiceLedgerDto
     * @return
     */
    @PostMapping("/update")
    public AjaxResult invoiceLedgerUpdate(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
        invoiceLedgerService.invoiceLedgerUpdate(invoiceLedgerDto);
        return AjaxResult.success();
    }
@@ -87,14 +77,73 @@
    }
    /**
     * 附件下载
     * 开票台账导出
     * @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);
    }
    /**
     * 开票台账详情
     * @param id
     * @return
     */
    @GetMapping("/info")
    public AjaxResult invoiceLedgerInfo(Integer id) {
        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());
        }
    }
}