From 8dce4b82eeece943b56182eeebc1c9332625924c Mon Sep 17 00:00:00 2001
From: chenrui <1187576398@qq.com>
Date: 星期三, 04 六月 2025 14:25:16 +0800
Subject: [PATCH] 付款流水功能开发

---
 src/main/java/com/ruoyi/purchase/mapper/PaymentRegistrationMapper.java            |    8 ++++
 src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java |   13 +++++-
 src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java         |    8 ++++
 src/main/java/com/ruoyi/purchase/dto/PaymentRegistrationDto.java                  |    2 +
 src/main/resources/mapper/system/SysUserMapper.xml                                |    4 -
 src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java                    |   24 ++++++------
 src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java    |   13 ++++++
 src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml                  |   22 +++++++++++
 8 files changed, 77 insertions(+), 17 deletions(-)

diff --git a/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java b/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
index a15b110..2cf52c3 100644
--- a/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
+++ b/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
@@ -117,18 +117,18 @@
                 conditions.add(dataScope);
                 break;
             }
-            else if (DATA_SCOPE_CUSTOM.equals(dataScope))
-            {
-                if (scopeCustomIds.size() > 1)
-                {
-                    // 澶氫釜鑷畾鏁版嵁鏉冮檺浣跨敤in鏌ヨ锛岄伩鍏嶅娆℃嫾鎺ャ��
-                    sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id in ({}) ) ", deptAlias, String.join(",", scopeCustomIds)));
-                }
-                else
-                {
-                    sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, role.getRoleId()));
-                }
-            }
+//            else if (DATA_SCOPE_CUSTOM.equals(dataScope))
+//            {
+//                if (scopeCustomIds.size() > 1)
+//                {
+//                    // 澶氫釜鑷畾鏁版嵁鏉冮檺浣跨敤in鏌ヨ锛岄伩鍏嶅娆℃嫾鎺ャ��
+//                    sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id in ({}) ) ", deptAlias, String.join(",", scopeCustomIds)));
+//                }
+//                else
+//                {
+//                    sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, role.getRoleId()));
+//                }
+//            }
 //            else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope))
 //            {
 //                sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", deptAlias, user.getDeptId(), user.getDeptId()));
diff --git a/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java b/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
index 6ba3a59..d2c5522 100644
--- a/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
+++ b/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
@@ -113,4 +113,17 @@
     public AjaxResult paymentMonthList() {
         return success(paymentRegistrationService.paymentMonthList());
     }
+
+    /**
+     * 鏌ヨ浠樻鐧昏鍒楄〃
+     *
+     * @param paymentRegistrationDto 浠樻鐧昏
+     * @return 浠樻鐧昏闆嗗悎
+     */
+    @GetMapping("/paymentHistoryList")
+    public TableDataInfo paymentHistoryList(PaymentRegistrationDto paymentRegistrationDto) {
+        startPage();
+        List<PaymentRegistrationDto> list = paymentRegistrationService.paymentHistoryList(paymentRegistrationDto);
+        return getDataTable(list);
+    }
 }
diff --git a/src/main/java/com/ruoyi/purchase/dto/PaymentRegistrationDto.java b/src/main/java/com/ruoyi/purchase/dto/PaymentRegistrationDto.java
index e7acb12..a036f29 100644
--- a/src/main/java/com/ruoyi/purchase/dto/PaymentRegistrationDto.java
+++ b/src/main/java/com/ruoyi/purchase/dto/PaymentRegistrationDto.java
@@ -34,4 +34,6 @@
 
     // 鐧昏浜�
     private String registrant;
+
+    private String searchText;
 }
diff --git a/src/main/java/com/ruoyi/purchase/mapper/PaymentRegistrationMapper.java b/src/main/java/com/ruoyi/purchase/mapper/PaymentRegistrationMapper.java
index 52024bc..4127059 100644
--- a/src/main/java/com/ruoyi/purchase/mapper/PaymentRegistrationMapper.java
+++ b/src/main/java/com/ruoyi/purchase/mapper/PaymentRegistrationMapper.java
@@ -29,4 +29,12 @@
      * @return 浠樻鐧昏闆嗗悎
      */
     public List<PaymentRegistrationDto> selectPaymentRegistrationList(PaymentRegistrationDto paymentRegistrationDto);
+
+    /**
+     * 鏌ヨ浠樻鐧昏鍒楄〃
+     *
+     * @param paymentRegistrationDto 浠樻鐧昏
+     * @return 浠樻鐧昏闆嗗悎
+     */
+    public List<PaymentRegistrationDto> paymentHistoryList(@Param("params") PaymentRegistrationDto paymentRegistrationDto);
 }
diff --git a/src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java b/src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java
index ec1244b..2cf9e9d 100644
--- a/src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java
+++ b/src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java
@@ -71,4 +71,12 @@
                                                        Integer detailPageSize);
 
     Map<String, BigDecimal> paymentMonthList();
+
+    /**
+     * 鏌ヨ浠樻鐧昏鍒楄〃
+     *
+     * @param paymentRegistrationDto 浠樻鐧昏
+     * @return 浠樻鐧昏闆嗗悎
+     */
+    public List<PaymentRegistrationDto> paymentHistoryList(PaymentRegistrationDto paymentRegistrationDto);
 }
diff --git a/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java b/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
index ec355bd..624bc1a 100644
--- a/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
+++ b/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
@@ -47,8 +47,6 @@
 
     private PurchaseLedgerMapper purchaseLedgerMapper;
 
-    private InvoicePurchaseMapper invoicePurchaseMapper;
-
     private SalesLedgerMapper salesLedgerMapper;
 
     private SupplierManageMapper supplierManageMapper;
@@ -345,6 +343,17 @@
         return result;
     }
 
+    /**
+     * 鏌ヨ浠樻鐧昏鍒楄〃
+     *
+     * @param paymentRegistrationDto 浠樻鐧昏
+     * @return 浠樻鐧昏闆嗗悎
+     */
+    @Override
+    public List<PaymentRegistrationDto> paymentHistoryList(PaymentRegistrationDto paymentRegistrationDto) {
+        return paymentRegistrationMapper.paymentHistoryList(paymentRegistrationDto);
+    }
+
     // 鎵归噺鏌ヨ閲囪喘鍙拌处锛堝綋鏈堬級
     private Map<Long, List<PurchaseLedger>> batchQueryPurchaseLedgers(List<Long> supplierIds, LocalDate startDate, LocalDate endDate) {
         LambdaQueryWrapper<PurchaseLedger> query = new LambdaQueryWrapper<>();
diff --git a/src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml b/src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml
index c4636e5..aad93c5 100644
--- a/src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml
+++ b/src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml
@@ -88,4 +88,26 @@
         where pr.id = #{id}
     </select>
 
+    <select id="paymentHistoryList" resultType="com.ruoyi.purchase.dto.PaymentRegistrationDto">
+        SELECT
+            T1.payment_date,
+            T2.supplier_name,
+            T1.current_payment_amount,
+            T1.payment_method,
+            T3.nick_name AS registrant,
+            T1.registrationt_date
+        FROM
+            payment_registration T1
+                LEFT JOIN
+            supplier_manage T2 ON T1.supplier_id = T2.id
+                LEFT JOIN
+            sys_user T3 ON T3.user_id = T1.registrant_id
+        <where>
+            <if test="params.searchText != null and params.searchText != '' ">
+                AND T2.supplier_name LIKE CONCAT('%',#{params.searchText},'%')
+            </if>
+        </where>
+        ORDER BY T1.payment_date,T1.create_time DESC
+    </select>
+
 </mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/system/SysUserMapper.xml b/src/main/resources/mapper/system/SysUserMapper.xml
index b62aefc..8824e35 100644
--- a/src/main/resources/mapper/system/SysUserMapper.xml
+++ b/src/main/resources/mapper/system/SysUserMapper.xml
@@ -83,7 +83,7 @@
 		<if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
 			AND date_format(u.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
 		</if>
-		<if test="deptId != null">
+		<if test="params.deptId != null">
 			AND u.user_id IN
 			(
 			SELECT user_id FROM sys_user_dept WHERE dept_id = #{deptId}
@@ -96,7 +96,6 @@
 	<select id="selectAllocatedList" parameterType="com.ruoyi.project.system.domain.SysUser" resultMap="SysUserResult">
 	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
 	    from sys_user u
-			 left join sys_dept d on u.dept_id = d.dept_id
 			 left join sys_user_role ur on u.user_id = ur.user_id
 			 left join sys_role r on r.role_id = ur.role_id
 	    where u.del_flag = '0' and r.role_id = #{roleId}
@@ -113,7 +112,6 @@
 	<select id="selectUnallocatedList" parameterType="com.ruoyi.project.system.domain.SysUser" resultMap="SysUserResult">
 	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
 	    from sys_user u
-			 left join sys_dept d on u.dept_id = d.dept_id
 			 left join sys_user_role ur on u.user_id = ur.user_id
 			 left join sys_role r on r.role_id = ur.role_id
 	    where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)

--
Gitblit v1.9.3