From 9ff7e9a2c0e6fc338d8a239566ef9346081fa672 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期四, 21 五月 2026 09:47:41 +0800
Subject: [PATCH] refactor(account): 删除BorrowInfo借款信息相关代码及接口
---
src/main/java/com/ruoyi/account/service/impl/AccountingServiceImpl.java | 30 +++++++++---------------------
1 files changed, 9 insertions(+), 21 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 7df89e6..01f5687 100644
--- a/src/main/java/com/ruoyi/account/service/impl/AccountingServiceImpl.java
+++ b/src/main/java/com/ruoyi/account/service/impl/AccountingServiceImpl.java
@@ -6,11 +6,9 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.account.bean.dto.DeviceTypeDetail;
import com.ruoyi.account.bean.dto.DeviceTypeDistributionVO;
-import com.ruoyi.account.mapper.BorrowInfoMapper;
-import com.ruoyi.account.pojo.BorrowInfo;
import com.ruoyi.device.mapper.DeviceLedgerMapper;
import com.ruoyi.device.pojo.DeviceLedger;
-import com.ruoyi.framework.web.domain.R;
+import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.procurementrecord.mapper.CustomStorageMapper;
import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper;
import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper;
@@ -38,12 +36,11 @@
public class AccountingServiceImpl {
private final DeviceLedgerMapper deviceLedgerMapper;
- private final BorrowInfoMapper borrowInfoMapper;
private final CustomStorageMapper customStorageMapper;
private final ProcurementRecordMapper procurementRecordMapper;
private final ProcurementRecordOutMapper procurementRecordOutMapper;
- public R<?> total(Integer year) {
+ public AjaxResult total(Integer year) {
Map<String,Object> map = new HashMap<>();
map.put("deprAmount",0); // 鎶樻棫閲戦
map.put("deviceTotal",0); // 璁惧鎬绘暟
@@ -75,17 +72,8 @@
map.put("netValue",reduce.subtract(total));
}
// 璐熷��
- LambdaQueryWrapper<BorrowInfo> borrowInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
- borrowInfoLambdaQueryWrapper.like(BorrowInfo::getCreateTime,year)
- .eq(BorrowInfo::getStatus,1);
- List<BorrowInfo> borrowInfos = borrowInfoMapper.selectList(borrowInfoLambdaQueryWrapper);
- if(CollectionUtils.isNotEmpty(borrowInfos)){
- BigDecimal reduce = borrowInfos.stream()
- .map(BorrowInfo::getBorrowAmount)
- .filter(Objects::nonNull)
- .reduce(BigDecimal.ZERO, BigDecimal::add);
- map.put("debt",reduce);
- }
+ map.put("debt",BigDecimal.ZERO);
+
// 搴撳瓨璧勪骇
LambdaQueryWrapper<ProcurementRecordStorage> procurementRecordStorageLambdaQueryWrapper = new LambdaQueryWrapper<>();
procurementRecordStorageLambdaQueryWrapper.like(ProcurementRecordStorage::getCreateTime,year);
@@ -150,7 +138,7 @@
});
}
map.put("inventoryValue",procurementRecordTotal.add(customStorageTotal));
- return R.ok(map);
+ return AjaxResult.success( map);
}
/**
@@ -245,7 +233,7 @@
return totalDepreciation.setScale(2, BigDecimal.ROUND_HALF_UP);
}
- public R<?> deviceTypeDistribution(Integer year) {
+ public AjaxResult deviceTypeDistribution(Integer year) {
// 2. 缁勮杩斿洖VO
DeviceTypeDistributionVO vo = new DeviceTypeDistributionVO();
List<DeviceTypeDetail> details = deviceLedgerMapper.getDeviceTypeDistributionByYear( year);
@@ -265,10 +253,10 @@
.collect(Collectors.toList()));
vo.setTotalCount(vo.getCategories().size());
}
- return R.ok(vo);
+ return AjaxResult.success(vo);
}
- public R<?> calculateDepreciation(Page page, Integer year) {
+ public AjaxResult calculateDepreciation(Page page, Integer year) {
LambdaQueryWrapper<DeviceLedger> deviceLedgerLambdaQueryWrapper = new LambdaQueryWrapper<>();
deviceLedgerLambdaQueryWrapper.like(DeviceLedger::getCreateTime,year)
.eq(DeviceLedger::getIsDepr,1);
@@ -277,6 +265,6 @@
record.setDeprAmount(calculatePreciseDepreciation(record));
record.setNetValue(record.getTaxIncludingPriceTotal().subtract(record.getDeprAmount()));
}
- return R.ok(deviceLedgerIPage);
+ return AjaxResult.success(deviceLedgerIPage);
}
}
--
Gitblit v1.9.3