From 53bdb26a0ae994418e92d93aab23d6f5e7225f37 Mon Sep 17 00:00:00 2001 From: liding <756868258@qq.com> Date: 星期一, 19 五月 2025 16:20:56 +0800 Subject: [PATCH] 产品 --- src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java | 68 +++++++++++++++++++++++++++++---- 1 files changed, 59 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java b/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java index 7f4f39a..d21a2dd 100644 --- a/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java +++ b/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java @@ -1,19 +1,21 @@ package com.ruoyi.sales.controller; -import java.util.*; -import javax.servlet.http.HttpServletResponse; - import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.sales.dto.SalesLedgerDto; -import com.ruoyi.sales.pojo.SalesLedger; -import com.ruoyi.sales.service.ISalesLedgerService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; 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; +import com.ruoyi.sales.dto.SalesLedgerDto; +import com.ruoyi.sales.pojo.SalesLedger; +import com.ruoyi.sales.service.ICommonFileService; +import com.ruoyi.sales.service.ISalesLedgerService; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.math.BigDecimal; +import java.util.List; /** * 閿�鍞彴璐ontroller @@ -23,9 +25,12 @@ */ @RestController @RequestMapping("/sales/ledger") +@AllArgsConstructor public class SalesLedgerController extends BaseController { - @Autowired + private ISalesLedgerService salesLedgerService; + + private ICommonFileService commonFileService; /** * 鏌ヨ閿�鍞彴璐﹀垪琛� @@ -76,4 +81,49 @@ } return toAjax(salesLedgerService.deleteSalesLedgerByIds(ids)); } + + /** + * 鏌ヨ閿�鍞彴璐︿笉鍒嗛〉 + * + * @param salesLedgerDto + * @return + */ + @GetMapping("/listNoPage") + public AjaxResult listNoPage(SalesLedgerDto salesLedgerDto) { + List<SalesLedger> list = salesLedgerService.selectSalesLedgerList(salesLedgerDto); + return AjaxResult.success(list); + } + + /** + * 閿�鍞彴璐﹂檮浠跺垹闄� + */ + @Log(title = "閿�鍞彴璐﹂檮浠跺垹闄�", businessType = BusinessType.DELETE) + @DeleteMapping("/delLedgerFile") + public AjaxResult delLedgerFile(@RequestBody Long[] ids) { + if (ids == null || ids.length == 0) { + return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D"); + } + return toAjax(commonFileService.deleteSalesLedgerByIds(ids)); + } + + /** + * 鏈湀閿�鍞悎鍚岄噾棰� + */ + @GetMapping("/getContractAmount") + public AjaxResult getContractAmount() { + try { + BigDecimal amount = salesLedgerService.getContractAmount(); + return AjaxResult.success(amount != null ? amount : BigDecimal.ZERO); + } catch (Exception e) { + return AjaxResult.error("鑾峰彇鍚堝悓閲戦澶辫触锛�" + e.getMessage()); + } + } + + /** + * 瀹㈡埛鍚堝悓閲戦TOP5缁熻 + */ + @GetMapping("/getTopFiveList") + public AjaxResult getTopFiveList() { + return AjaxResult.success(salesLedgerService.getTopFiveList()); + } } -- Gitblit v1.9.3