From 8168aef3c7557c9e1361892270a1ebe35dbddba5 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 10 十一月 2026 11:42:19 +0800
Subject: [PATCH] refactor(erp): 采购申请与询价比价流程重构
---
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/finance/ErpFinancePaymentMapper.java | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/finance/ErpFinancePaymentMapper.java b/yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/finance/ErpFinancePaymentMapper.java
index 5e46259..a8781d5 100644
--- a/yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/finance/ErpFinancePaymentMapper.java
+++ b/yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/finance/ErpFinancePaymentMapper.java
@@ -73,14 +73,20 @@
* @return key 涓烘潵绁ㄧ紪鍙凤紝value 涓哄凡浠樻閲戦
*/
default Map<Long, BigDecimal> selectPaymentPriceMapByInvoiceId(Collection<Long> invoiceIds) {
+ return selectPaymentPriceMapByInvoiceIdAndStatus(invoiceIds, List.of(
+ ErpAuditStatus.PROCESS.getStatus(), ErpAuditStatus.APPROVING.getStatus(),
+ ErpAuditStatus.APPROVE.getStatus()));
+ }
+
+ default Map<Long, BigDecimal> selectPaymentPriceMapByInvoiceIdAndStatus(
+ Collection<Long> invoiceIds, Collection<Integer> statuses) {
if (CollUtil.isEmpty(invoiceIds)) {
return Collections.emptyMap();
}
// SQL sum 鏌ヨ
List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpFinancePaymentDO>()
.select("invoice_id, SUM(payment_price) AS total_payment_price")
- .in("status", ErpAuditStatus.PROCESS.getStatus(), // 鏈鏍� + 瀹℃壒涓� + 宸插鏍�
- ErpAuditStatus.APPROVING.getStatus(), ErpAuditStatus.APPROVE.getStatus())
+ .in("status", statuses)
.groupBy("invoice_id")
.in("invoice_id", invoiceIds));
// 鑾峰緱閲戦
@@ -103,4 +109,16 @@
.orderByAsc(ErpFinancePaymentDO::getId));
}
-}
\ No newline at end of file
+ /**
+ * 鎸変粯娆炬椂闂磋寖鍥存煡璇㈠叏閮ㄤ緵搴斿晢鐨勪粯娆惧崟锛堜緵搴斿晢寰�鏉ユ眹鎬伙級
+ */
+ default List<ErpFinancePaymentDO> selectListByPaymentTimeBetween(LocalDateTime beginTime,
+ LocalDateTime endTime,
+ Collection<Integer> statuses) {
+ return selectList(new LambdaQueryWrapperX<ErpFinancePaymentDO>()
+ .geIfPresent(ErpFinancePaymentDO::getPaymentTime, beginTime)
+ .leIfPresent(ErpFinancePaymentDO::getPaymentTime, endTime)
+ .inIfPresent(ErpFinancePaymentDO::getStatus, statuses));
+ }
+
+}
--
Gitblit v1.9.3