From d3b5fe3ea8c054055c9cc5ef450a180584968aea Mon Sep 17 00:00:00 2001 From: chenrui <1187576398@qq.com> Date: 星期四, 08 五月 2025 17:33:13 +0800 Subject: [PATCH] 开票登记功能开发 --- src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 99 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java b/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java new file mode 100644 index 0000000..1f871d6 --- /dev/null +++ b/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java @@ -0,0 +1,99 @@ +package com.ruoyi.sales.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.sales.pojo.SalesLedger; +import com.ruoyi.sales.service.ISalesLedgerService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 閿�鍞彴璐ontroller + * + * @author ruoyi + * @date 2025-05-08 + */ +@RestController +@RequestMapping("/sales/ledger") +public class SalesLedgerController extends BaseController +{ + @Autowired + private ISalesLedgerService salesLedgerService; + + /** + * 鏌ヨ閿�鍞彴璐﹀垪琛� + */ + @GetMapping("/list") + public TableDataInfo list(SalesLedger salesLedger) + { + startPage(); + List<SalesLedger> list = salesLedgerService.selectSalesLedgerList(salesLedger); + return getDataTable(list); + } + + /** + * 瀵煎嚭閿�鍞彴璐﹀垪琛� + */ + @Log(title = "閿�鍞彴璐�", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SalesLedger salesLedger) + { + List<SalesLedger> list = salesLedgerService.selectSalesLedgerList(salesLedger); + ExcelUtil<SalesLedger> util = new ExcelUtil<SalesLedger>(SalesLedger.class); + util.exportExcel(response, list, "閿�鍞彴璐︽暟鎹�"); + } + + /** + * 鑾峰彇閿�鍞彴璐﹁缁嗕俊鎭� + */ + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(salesLedgerService.selectSalesLedgerById(id)); + } + + /** + * 鏂板閿�鍞彴璐� + */ + @Log(title = "閿�鍞彴璐�", businessType = BusinessType.INSERT) + @PostMapping ("/insertSalesLedger") + public AjaxResult add(@RequestBody SalesLedger salesLedger) + { + return toAjax(salesLedgerService.insertSalesLedger(salesLedger)); + } + + /** + * 淇敼閿�鍞彴璐� + */ + @Log(title = "閿�鍞彴璐�", businessType = BusinessType.UPDATE) + @PostMapping ("/updateSalesLedger") + public AjaxResult edit(@RequestBody SalesLedger salesLedger) + { + return toAjax(salesLedgerService.updateSalesLedger(salesLedger)); + } + + /** + * 鍒犻櫎閿�鍞彴璐� + */ + @Log(title = "閿�鍞彴璐�", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(salesLedgerService.deleteSalesLedgerByIds(ids)); + } +} -- Gitblit v1.9.3