From 9a30a3a8d3862a9b2ce898535b7cb51c3ddac816 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期三, 20 五月 2026 16:01:11 +0800
Subject: [PATCH] refactor(controller): 将控制器响应结果统一为R类型并继承BaseController
---
src/main/java/com/ruoyi/account/service/impl/AccountingServiceImpl.java | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/ruoyi/account/service/impl/AccountingServiceImpl.java b/src/main/java/com/ruoyi/account/service/impl/AccountingServiceImpl.java
index ab38285..7df89e6 100644
--- a/src/main/java/com/ruoyi/account/service/impl/AccountingServiceImpl.java
+++ b/src/main/java/com/ruoyi/account/service/impl/AccountingServiceImpl.java
@@ -10,7 +10,7 @@
import com.ruoyi.account.pojo.BorrowInfo;
import com.ruoyi.device.mapper.DeviceLedgerMapper;
import com.ruoyi.device.pojo.DeviceLedger;
-import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.framework.web.domain.R;
import com.ruoyi.procurementrecord.mapper.CustomStorageMapper;
import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper;
import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper;
@@ -43,7 +43,7 @@
private final ProcurementRecordMapper procurementRecordMapper;
private final ProcurementRecordOutMapper procurementRecordOutMapper;
- public AjaxResult total(Integer year) {
+ public R<?> total(Integer year) {
Map<String,Object> map = new HashMap<>();
map.put("deprAmount",0); // 鎶樻棫閲戦
map.put("deviceTotal",0); // 璁惧鎬绘暟
@@ -150,7 +150,7 @@
});
}
map.put("inventoryValue",procurementRecordTotal.add(customStorageTotal));
- return AjaxResult.success( map);
+ return R.ok(map);
}
/**
@@ -245,7 +245,7 @@
return totalDepreciation.setScale(2, BigDecimal.ROUND_HALF_UP);
}
- public AjaxResult deviceTypeDistribution(Integer year) {
+ public R<?> deviceTypeDistribution(Integer year) {
// 2. 缁勮杩斿洖VO
DeviceTypeDistributionVO vo = new DeviceTypeDistributionVO();
List<DeviceTypeDetail> details = deviceLedgerMapper.getDeviceTypeDistributionByYear( year);
@@ -265,10 +265,10 @@
.collect(Collectors.toList()));
vo.setTotalCount(vo.getCategories().size());
}
- return AjaxResult.success(vo);
+ return R.ok(vo);
}
- public AjaxResult calculateDepreciation(Page page, Integer year) {
+ public R<?> calculateDepreciation(Page page, Integer year) {
LambdaQueryWrapper<DeviceLedger> deviceLedgerLambdaQueryWrapper = new LambdaQueryWrapper<>();
deviceLedgerLambdaQueryWrapper.like(DeviceLedger::getCreateTime,year)
.eq(DeviceLedger::getIsDepr,1);
@@ -277,6 +277,6 @@
record.setDeprAmount(calculatePreciseDepreciation(record));
record.setNetValue(record.getTaxIncludingPriceTotal().subtract(record.getDeprAmount()));
}
- return AjaxResult.success(deviceLedgerIPage);
+ return R.ok(deviceLedgerIPage);
}
}
--
Gitblit v1.9.3