chenrui
2 天以前 8dce4b82eeece943b56182eeebc1c9332625924c
付款流水功能开发
已修改8个文件
94 ■■■■ 文件已修改
src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/dto/PaymentRegistrationDto.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/mapper/PaymentRegistrationMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/system/SysUserMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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()));
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);
    }
}
src/main/java/com/ruoyi/purchase/dto/PaymentRegistrationDto.java
@@ -34,4 +34,6 @@
    // 登记人
    private String registrant;
    private String searchText;
}
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);
}
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);
}
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<>();
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>
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)