From 11502c7f9f26edda0733c43a17b5b773ee8447e4 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 20 五月 2026 16:47:47 +0800
Subject: [PATCH] refactor(account): 财务模块更新
---
src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java | 40 +++++++++++++++++++---------------------
1 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java b/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
index dfca752..ceb3702 100644
--- a/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
+++ b/src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
@@ -10,6 +10,7 @@
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.domain.R;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.sales.dto.InvoiceLedgerDto;
@@ -66,7 +67,7 @@
@Log(title = "瀵煎叆閿�鍞彴璐�", businessType = BusinessType.INSERT)
@PostMapping("/import")
@Operation(summary = "瀵煎叆閿�鍞彴璐�")
- public R<?> importData(@RequestParam("file")
+ public AjaxResult importData(@RequestParam("file")
@ApiParam(value = "Excel鏂囦欢", required = true)
MultipartFile file) {
return salesLedgerService.importData(file);
@@ -182,9 +183,8 @@
*/
@Log(title = "閿�鍞彴璐�", businessType = BusinessType.INSERT)
@PostMapping("/addOrUpdateSalesLedger")
- public R<?> add(@RequestBody SalesLedgerDto salesLedgerDto) {
- salesLedgerService.addOrUpdateSalesLedger(salesLedgerDto);
- return R.ok();
+ public AjaxResult add(@RequestBody SalesLedgerDto salesLedgerDto) {
+ return toAjax(salesLedgerService.addOrUpdateSalesLedger(salesLedgerDto));
}
/**
@@ -192,12 +192,11 @@
*/
@Log(title = "閿�鍞彴璐�", businessType = BusinessType.DELETE)
@DeleteMapping("/delLedger")
- public R<?> remove(@RequestBody Long[] ids) {
+ public AjaxResult remove(@RequestBody Long[] ids) {
if (ids == null || ids.length == 0) {
- return R.fail("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
+ return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
}
- salesLedgerService.deleteSalesLedgerByIds(ids);
- return R.ok();
+ return toAjax(salesLedgerService.deleteSalesLedgerByIds(ids));
}
/**
@@ -207,9 +206,9 @@
* @return
*/
@GetMapping("/listNoPage")
- public R<?> listNoPage(SalesLedgerDto salesLedgerDto) {
+ public AjaxResult listNoPage(SalesLedgerDto salesLedgerDto) {
List<SalesLedger> list = salesLedgerService.selectSalesLedgerList(salesLedgerDto);
- return R.ok(list);
+ return AjaxResult.success(list);
}
/**
@@ -217,24 +216,23 @@
*/
@Log(title = "閿�鍞彴璐﹂檮浠跺垹闄�", businessType = BusinessType.DELETE)
@DeleteMapping("/delLedgerFile")
- public R<?> delLedgerFile(@RequestBody Long[] ids) {
+ public AjaxResult delLedgerFile(@RequestBody Long[] ids) {
if (ids == null || ids.length == 0) {
- return R.fail("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
+ return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
}
- commonFileService.deleteSalesLedgerByIds(ids);
- return R.ok();
+ return toAjax(commonFileService.deleteSalesLedgerByIds(ids));
}
/**
* 鏈湀閿�鍞悎鍚岄噾棰�
*/
@GetMapping("/getContractAmount")
- public R<?> getContractAmount() {
+ public AjaxResult getContractAmount() {
try {
BigDecimal contractAmount = salesLedgerService.getContractAmount();
- return R.ok(contractAmount != null ? contractAmount : BigDecimal.ZERO);
+ return AjaxResult.success(contractAmount != null ? contractAmount : BigDecimal.ZERO);
} catch (Exception e) {
- return R.fail("鑾峰彇鍚堝悓閲戦澶辫触锛�" + e.getMessage());
+ return AjaxResult.error("鑾峰彇鍚堝悓閲戦澶辫触锛�" + e.getMessage());
}
}
@@ -242,16 +240,16 @@
* 瀹㈡埛鍚堝悓閲戦TOP5缁熻
*/
@GetMapping("/getTopFiveList")
- public R<?> getTopFiveList() {
- return R.ok(salesLedgerService.getTopFiveList());
+ public AjaxResult getTopFiveList() {
+ return AjaxResult.success(salesLedgerService.getTopFiveList());
}
/**
* 杩戝崐骞村紑绁�,鍥炴閲戦
*/
@GetMapping("/getAmountHalfYear")
- public R<?> getAmountHalfYear(@RequestParam(value = "type",defaultValue = "1") Integer type) {
- return R.ok(salesLedgerService.getAmountHalfYear(type));
+ public AjaxResult getAmountHalfYear(@RequestParam(value = "type",defaultValue = "1") Integer type) {
+ return AjaxResult.success(salesLedgerService.getAmountHalfYear(type));
}
/**
--
Gitblit v1.9.3