664d3b82b4025b9f374e703675b1af8729467adc..d931bdf332de59341c86ac24d89de2c1edaf2bab
2026-03-19 wujianwei
新增字段
d931bd 对比 | 目录
2026-03-19 wujianwei
新增应收账款分析管理查询
7e37cb 对比 | 目录
2026-03-19 wujianwei
新增应收账款分析管理查询
8998a0 对比 | 目录
2026-03-19 wujianwei
新增修改日志
e82545 对比 | 目录
1个文件已添加
7个文件已修改
180 ■■■■■ 已修改文件
service/src/main/java/com/ruoyi/cwgl/controller/ReceivableBillManagementController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/ReceivableBillCustomerSummary.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/ReceivableBillManagement.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/mapper/ReceivableBillManagementMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/IReceivableBillManagementService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/PayableBillManagementServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/ReceivableBillManagementServiceImpl.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/ReceivableBillManagementMapper.xml 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/controller/ReceivableBillManagementController.java
@@ -1,6 +1,8 @@
package com.ruoyi.cwgl.controller;
import java.util.List;
import com.ruoyi.cwgl.domain.ReceivableBillCustomerSummary;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -167,4 +169,16 @@
        
        return AjaxResult.success(invoicedAmount);
    }
    /**
     * 查询应收账单客户汇总列表
     */
    @PreAuthorize("@ss.hasPermi('cwgl:receivableBillManagement:list')")
    @GetMapping("/customerSummary")
    public TableDataInfo customerSummary(ReceivableBillManagement receivableBillManagement)
    {
        List<ReceivableBillCustomerSummary> list = receivableBillManagementService.selectReceivableBillCustomerSummaryList(receivableBillManagement);
        return getDataTable(list);
    }
}
service/src/main/java/com/ruoyi/cwgl/domain/ReceivableBillCustomerSummary.java
New file
@@ -0,0 +1,27 @@
package com.ruoyi.cwgl.domain;
import java.math.BigDecimal;
import lombok.Data;
/**
 * 应收账单客户汇总对象
 *
 * @author ruoyi
 * @date 2026-03-19
 */
@Data
public class ReceivableBillCustomerSummary {
    /** 客户名称 */
    private String customerName;
    /** 合计含暂估应收账款余额 */
    private BigDecimal totalEstimatedAmount;
    /** 合计已确认应收账款金额 */
    private BigDecimal totalConfirmedAmount;
    /** 合计应收账款余额 */
    private BigDecimal totalPendingAmount;
}
service/src/main/java/com/ruoyi/cwgl/domain/ReceivableBillManagement.java
@@ -51,6 +51,34 @@
    private String payee;
    /** 责任人 */
    @Excel(name = "责任人")
        @TableField("responsible_person")
    private String responsiblePerson;
    /** 责任领导 */
    @Excel(name = "责任领导")
        @TableField("responsible_leader")
    private String responsibleLeader;
    /** 结算方式 */
    @Excel(name = "结算方式")
        @TableField("settlement_method")
    private String settlementMethod;
    /** 业务类型 */
    @Excel(name = "业务类型")
        @TableField("business_type")
    private String businessType;
    /** 是否内部结算 */
    @Excel(name = "是否内部结算")
service/src/main/java/com/ruoyi/cwgl/mapper/ReceivableBillManagementMapper.java
@@ -1,6 +1,8 @@
package com.ruoyi.cwgl.mapper;
import java.util.List;
import com.ruoyi.cwgl.domain.ReceivableBillCustomerSummary;
import com.ruoyi.cwgl.domain.ReceivableBillManagement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -92,4 +94,12 @@
     * @return 应收账单管理
     */
    public ReceivableBillManagement selectReceivableBillManagementBySystemNo(String systemNo);
    /**
     * 查询应收账单客户汇总列表
     *
     * @param receivableBillManagement 查询条件
     * @return 应收账单客户汇总列表
     */
    public List<ReceivableBillCustomerSummary> selectReceivableBillCustomerSummaryList(ReceivableBillManagement receivableBillManagement);
}
service/src/main/java/com/ruoyi/cwgl/service/IReceivableBillManagementService.java
@@ -1,8 +1,12 @@
package com.ruoyi.cwgl.service;
import java.util.List;
import com.ruoyi.cwgl.domain.ReceivableBillCustomerSummary;
import com.ruoyi.cwgl.domain.ReceivableBillManagement;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
/**
 * 应收账单管理Service接口
 * 
@@ -115,4 +119,12 @@
     * @return 应收账单管理
     */
    public ReceivableBillManagement selectReceivableBillManagementBySystemNo(String systemNo);
    /**
     * 查询应收账单客户汇总列表
     *
     * @param receivableBillManagement 查询条件
     * @return 应收账单客户汇总列表
     */
    public List<ReceivableBillCustomerSummary> selectReceivableBillCustomerSummaryList(@Param("receivableBillManagement") ReceivableBillManagement receivableBillManagement);
}
service/src/main/java/com/ruoyi/cwgl/service/impl/PayableBillManagementServiceImpl.java
@@ -22,8 +22,10 @@
import com.ruoyi.cwgl.mapper.PayableBillManagementMapper;
import com.ruoyi.cwgl.domain.PayableBillManagement;
import com.ruoyi.cwgl.domain.PayableBillManagementLog;
import com.ruoyi.cwgl.service.IPayableBillManagementService;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.SecurityUtils;
/**
 * 应付账单管理Service业务层处理
@@ -137,7 +139,19 @@
    public int updatePayableBillManagement(PayableBillManagement payableBillManagement)
    {
        payableBillManagement.setUpdateTime(DateUtils.getNowDate());
        return payableBillManagementMapper.updatePayableBillManagement(payableBillManagement);
        int result = payableBillManagementMapper.updatePayableBillManagement(payableBillManagement);
        // 记录操作日志
        if (result > 0) {
            PayableBillManagementLog log = new PayableBillManagementLog();
            log.setBillId(payableBillManagement.getId());
            log.setCreateBy(SecurityUtils.getUsername());
            log.setCreateTime(DateUtils.getNowDate());
            log.setOperation("修改应付账单,账单编号:" + payableBillManagement.getSystemNo());
            logService.insertPayableBillManagementLog(log);
        }
        return result;
    }
    /**
service/src/main/java/com/ruoyi/cwgl/service/impl/ReceivableBillManagementServiceImpl.java
@@ -5,6 +5,7 @@
import com.ruoyi.common.utils.DateUtils;
import javax.annotation.Resource;
import com.ruoyi.cwgl.domain.ReceivableBillCustomerSummary;
import com.ruoyi.cwgl.mapper.ReceivableFeeManagementMapper;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
@@ -143,7 +144,19 @@
    public int updateReceivableBillManagement(ReceivableBillManagement receivableBillManagement)
    {
        receivableBillManagement.setUpdateTime(DateUtils.getNowDate());
        return receivableBillManagementMapper.updateReceivableBillManagement(receivableBillManagement);
        int result = receivableBillManagementMapper.updateReceivableBillManagement(receivableBillManagement);
        // 记录操作日志
        if (result > 0) {
            ReceivableBillManagementLog log = new ReceivableBillManagementLog();
            log.setBillId(receivableBillManagement.getId());
            log.setCreateBy(SecurityUtils.getUsername());
            log.setCreateTime(DateUtils.getNowDate());
            log.setOperation("修改应收账单,账单编号:" + receivableBillManagement.getSystemNo());
            receivableBillManagementLogService.insertReceivableBillManagementLog(log);
        }
        return result;
    }
    /**
@@ -258,4 +271,17 @@
    {
        return receivableBillManagementMapper.selectReceivableBillManagementBySystemNo(systemNo);
    }
    /**
     * 查询应收账单客户汇总列表
     *
     * @param receivableBillManagement 查询条件
     * @return 应收账单客户汇总列表
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<ReceivableBillCustomerSummary> selectReceivableBillCustomerSummaryList(ReceivableBillManagement receivableBillManagement)
    {
        return receivableBillManagementMapper.selectReceivableBillCustomerSummaryList(receivableBillManagement);
    }
}
service/src/main/resources/mapper/cwgl/ReceivableBillManagementMapper.xml
@@ -10,6 +10,10 @@
        <result property="billName"    column="bill_name"    />
        <result property="customerName"    column="customer_name"    />
        <result property="payee"    column="payee"    />
        <result property="responsiblePerson"    column="responsible_person"    />
        <result property="responsibleLeader"    column="responsible_leader"    />
        <result property="settlementMethod"    column="settlement_method"    />
        <result property="businessType"    column="business_type"    />
        <result property="isInternalSettlement"    column="is_internal_settlement"    />
        <result property="internalSettlementUnit"    column="internal_settlement_unit"    />
        <result property="documentCount"    column="document_count"    />
@@ -38,7 +42,7 @@
    </resultMap>
    <sql id="selectReceivableBillManagementVo">
        select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.customer_name, thisTab.payee, thisTab.is_internal_settlement, thisTab.internal_settlement_unit, thisTab.document_count, thisTab.total_amount, thisTab.currency, thisTab.discount_amount, thisTab.received_amount, thisTab.pending_amount, thisTab.exchange_rate, thisTab.cny_amount, thisTab.period_type, thisTab.business_start_date, thisTab.business_end_date, thisTab.billing_start_date, thisTab.billing_end_date, thisTab.bill_generate_date, thisTab.bill_send_date, thisTab.bill_due_date, thisTab.status, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from receivable_bill_management AS thisTab
        select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.customer_name, thisTab.payee, thisTab.responsible_person, thisTab.responsible_leader, thisTab.settlement_method, thisTab.business_type, thisTab.is_internal_settlement, thisTab.internal_settlement_unit, thisTab.document_count, thisTab.total_amount, thisTab.currency, thisTab.discount_amount, thisTab.received_amount, thisTab.pending_amount, thisTab.exchange_rate, thisTab.cny_amount, thisTab.period_type, thisTab.business_start_date, thisTab.business_end_date, thisTab.billing_start_date, thisTab.billing_end_date, thisTab.bill_generate_date, thisTab.bill_send_date, thisTab.bill_due_date, thisTab.status, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from receivable_bill_management AS thisTab
    </sql>
    <sql id="selectReceivableBillManagementVoCount">
        select count(0) from receivable_bill_management as thisTab
@@ -49,6 +53,10 @@
        <if test="billName != null  and billName != ''"> and  thisTab.bill_name like concat('%', #{billName}, '%')</if>
        <if test="customerName != null  and customerName != ''"> and  thisTab.customer_name like concat('%', #{customerName}, '%')</if>
        <if test="payee != null  and payee != ''"> and  thisTab.payee like concat('%', #{payee}, '%')</if>
        <if test="responsiblePerson != null  and responsiblePerson != ''"> and  thisTab.responsible_person like concat('%', #{responsiblePerson}, '%')</if>
        <if test="responsibleLeader != null  and responsibleLeader != ''"> and  thisTab.responsible_leader like concat('%', #{responsibleLeader}, '%')</if>
        <if test="settlementMethod != null  and settlementMethod != ''"> and thisTab.settlement_method = #{settlementMethod}</if>
        <if test="businessType != null  and businessType != ''"> and thisTab.business_type = #{businessType}</if>
        <if test="isInternalSettlement != null  and isInternalSettlement != ''"> and thisTab.is_internal_settlement = #{isInternalSettlement}</if>
        <if test="internalSettlementUnit != null  and internalSettlementUnit != ''"> and thisTab.internal_settlement_unit = #{internalSettlementUnit}</if>
        <if test="documentCount != null "> and thisTab.document_count = #{documentCount}</if>
@@ -114,6 +122,10 @@
            <if test="billName != null and billName != ''">bill_name,</if>
            <if test="customerName != null and customerName != ''">customer_name,</if>
            <if test="payee != null and payee != ''">payee,</if>
            <if test="responsiblePerson != null and responsiblePerson != ''">responsible_person,</if>
            <if test="responsibleLeader != null and responsibleLeader != ''">responsible_leader,</if>
            <if test="settlementMethod != null and settlementMethod != ''">settlement_method,</if>
            <if test="businessType != null and businessType != ''">business_type,</if>
            <if test="isInternalSettlement != null and isInternalSettlement != ''">is_internal_settlement,</if>
            <if test="internalSettlementUnit != null">internal_settlement_unit,</if>
            <if test="documentCount != null">document_count,</if>
@@ -145,6 +157,10 @@
            <if test="billName != null and billName != ''">#{billName},</if>
            <if test="customerName != null and customerName != ''">#{customerName},</if>
            <if test="payee != null and payee != ''">#{payee},</if>
            <if test="responsiblePerson != null and responsiblePerson != ''">#{responsiblePerson},</if>
            <if test="responsibleLeader != null and responsibleLeader != ''">#{responsibleLeader},</if>
            <if test="settlementMethod != null and settlementMethod != ''">#{settlementMethod},</if>
            <if test="businessType != null and businessType != ''">#{businessType},</if>
            <if test="isInternalSettlement != null and isInternalSettlement != ''">#{isInternalSettlement},</if>
            <if test="internalSettlementUnit != null">#{internalSettlementUnit},</if>
            <if test="documentCount != null">#{documentCount},</if>
@@ -176,11 +192,11 @@
    <insert id="insertReceivableBillManagementBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into receivable_bill_management
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            system_no,bill_name,customer_name,payee,is_internal_settlement,internal_settlement_unit,document_count,total_amount,currency,discount_amount,received_amount,pending_amount,exchange_rate,cny_amount,period_type,business_start_date,business_end_date,billing_start_date,billing_end_date,bill_generate_date,bill_send_date,bill_due_date,status,remark,create_by,create_time,update_by,update_time,deleted,
            system_no,bill_name,customer_name,payee,responsible_person,responsible_leader,settlement_method,business_type,is_internal_settlement,internal_settlement_unit,document_count,total_amount,currency,discount_amount,received_amount,pending_amount,exchange_rate,cny_amount,period_type,business_start_date,business_end_date,billing_start_date,billing_end_date,bill_generate_date,bill_send_date,bill_due_date,status,remark,create_by,create_time,update_by,update_time,deleted,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.systemNo},#{item.billName},#{item.customerName},#{item.payee},#{item.isInternalSettlement},#{item.internalSettlementUnit},#{item.documentCount},#{item.totalAmount},#{item.currency},#{item.discountAmount},#{item.receivedAmount},#{item.pendingAmount},#{item.exchangeRate},#{item.cnyAmount},#{item.periodType},#{item.businessStartDate},#{item.businessEndDate},#{item.billingStartDate},#{item.billingEndDate},#{item.billGenerateDate},#{item.billSendDate},#{item.billDueDate},#{item.status},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted},
                #{item.systemNo},#{item.billName},#{item.customerName},#{item.payee},#{item.responsiblePerson},#{item.responsibleLeader},#{item.settlementMethod},#{item.businessType},#{item.isInternalSettlement},#{item.internalSettlementUnit},#{item.documentCount},#{item.totalAmount},#{item.currency},#{item.discountAmount},#{item.receivedAmount},#{item.pendingAmount},#{item.exchangeRate},#{item.cnyAmount},#{item.periodType},#{item.businessStartDate},#{item.businessEndDate},#{item.billingStartDate},#{item.billingEndDate},#{item.billGenerateDate},#{item.billSendDate},#{item.billDueDate},#{item.status},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted},
            </trim>
        </foreach>
    </insert>
@@ -193,6 +209,10 @@
            <if test="billName != null and billName != ''">bill_name = #{billName},</if>
            <if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
            <if test="payee != null and payee != ''">payee = #{payee},</if>
            <if test="responsiblePerson != null and responsiblePerson != ''">responsible_person = #{responsiblePerson},</if>
            <if test="responsibleLeader != null and responsibleLeader != ''">responsible_leader = #{responsibleLeader},</if>
            <if test="settlementMethod != null and settlementMethod != ''">settlement_method = #{settlementMethod},</if>
            <if test="businessType != null and businessType != ''">business_type = #{businessType},</if>
            <if test="isInternalSettlement != null and isInternalSettlement != ''">is_internal_settlement = #{isInternalSettlement},</if>
            <if test="internalSettlementUnit != null">internal_settlement_unit = #{internalSettlementUnit},</if>
            <if test="documentCount != null">document_count = #{documentCount},</if>
@@ -230,6 +250,10 @@
                <if test="item.billName != null and item.billName != ''">bill_name = #{item.billName},</if>
                <if test="item.customerName != null and item.customerName != ''">customer_name = #{item.customerName},</if>
                <if test="item.payee != null and item.payee != ''">payee = #{item.payee},</if>
                <if test="item.responsiblePerson != null and item.responsiblePerson != ''">responsible_person = #{item.responsiblePerson},</if>
                <if test="item.responsibleLeader != null and item.responsibleLeader != ''">responsible_leader = #{item.responsibleLeader},</if>
                <if test="item.settlementMethod != null and item.settlementMethod != ''">settlement_method = #{item.settlementMethod},</if>
                <if test="item.businessType != null and item.businessType != ''">business_type = #{item.businessType},</if>
                <if test="item.isInternalSettlement != null and item.isInternalSettlement != ''">is_internal_settlement = #{item.isInternalSettlement},</if>
                <if test="item.internalSettlementUnit != null">internal_settlement_unit = #{item.internalSettlementUnit},</if>
                <if test="item.documentCount != null">document_count = #{item.documentCount},</if>
@@ -271,4 +295,19 @@
        </foreach>
    </delete>
    <!-- 查询应收账单客户汇总列表 -->
    <select id="selectReceivableBillCustomerSummaryList" parameterType="com.ruoyi.cwgl.domain.ReceivableBillManagement" resultType="com.ruoyi.cwgl.domain.ReceivableBillCustomerSummary">
        SELECT
            customer_name as customerName,
            SUM(total_amount) as totalEstimatedAmount,
            SUM(total_amount) as totalConfirmedAmount,
            SUM(pending_amount) as totalPendingAmount
        FROM receivable_bill_management
        <where>
            <include refid="whereCondition"/>
        </where>
        GROUP BY customer_name
        ORDER BY customer_name
    </select>
</mapper>