21个文件已添加
6个文件已修改
2925 ■■■■■ 已修改文件
quartz/src/main/java/com/ruoyi/quartz/task/ReceivableBillAgingTask.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/controller/AccountLogController.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/controller/AgingLogController.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/controller/PaymentFeedbackController.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/controller/ReceivableBillManagementController.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/AccountLog.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/AgingLog.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/PaymentFeedback.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/ReceivableBillManagement.java 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/vo/ReceivableBillAccountAnalysisVo.java 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/vo/ReceivableBillAgingAnalysisVo.java 227 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/mapper/AccountLogMapper.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/mapper/AgingLogMapper.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/mapper/PaymentFeedbackMapper.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/mapper/ReceivableBillManagementMapper.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/IAccountLogService.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/IAgingLogService.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/IPaymentFeedbackService.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/IReceivableBillManagementService.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/AccountLogServiceImpl.java 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/AgingLogServiceImpl.java 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/PaymentFeedbackServiceImpl.java 197 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/ReceivableBillManagementServiceImpl.java 105 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/AccountLogMapper.xml 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/AgingLogMapper.xml 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/PaymentFeedbackMapper.xml 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/ReceivableBillManagementMapper.xml 240 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
quartz/src/main/java/com/ruoyi/quartz/task/ReceivableBillAgingTask.java
New file
@@ -0,0 +1,46 @@
package com.ruoyi.quartz.task;
import com.ruoyi.cwgl.domain.ReceivableBillManagement;
import com.ruoyi.cwgl.service.IReceivableBillManagementService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
 * 应收账单账龄分析定时任务
 * 每天更新应收账单的账龄分析数据
 *
 * @author ruoyi
 */
@Component("receivableBillAgingTask")
public class ReceivableBillAgingTask
{
    private static Logger logger = LoggerFactory.getLogger(ReceivableBillAgingTask.class);
    @Autowired
    private IReceivableBillManagementService receivableBillManagementService;
    /**
     * 更新应收账单账龄分析数据
     * 每天凌晨执行,使用数据库层面批量更新,性能最优
     */
    public void updateAgingAnalysisData()
    {
        try {
            logger.info("开始执行应收账单账龄分析数据更新任务");
            // 使用数据库层面批量更新,避免查询数据到应用层
            int updatedCount = receivableBillManagementService.batchUpdateAgingAnalysisData();
            logger.info("应收账单账龄分析数据更新任务完成,共更新 {} 条记录", updatedCount);
        } catch (Exception e) {
            logger.error("应收账单账龄分析数据更新任务执行失败", e);
        }
    }
}
service/src/main/java/com/ruoyi/cwgl/controller/AccountLogController.java
New file
@@ -0,0 +1,108 @@
package com.ruoyi.cwgl.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.utils.file.DownloadExportUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.cwgl.domain.AccountLog;
import com.ruoyi.cwgl.service.IAccountLogService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
 * 账款分析日志Controller
 *
 * @author ruoyi
 * @date 2026-03-20
 */
@RestController
@RequestMapping("/cwgl/accountLog")
public class AccountLogController extends BaseController
{
    @Autowired
    private IAccountLogService accountLogService;
    /**
     * 查询账款分析日志列表
     */
    @PreAuthorize("@ss.hasPermi('cwgl:accountLog:list')")
    @GetMapping("/list")
    public TableDataInfo list(AccountLog accountLog)
    {
        startPage();
        List<AccountLog> list = accountLogService.selectAccountLogList(accountLog);
        return getDataTable(list);
    }
    /**
     * 导出账款分析日志列表
     * @param accountLog 查询条件对象
     */
    @PreAuthorize("@ss.hasPermi('cwgl:accountLog:export')")
    @Log(title = "账款分析日志", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(AccountLog accountLog,String exportKey)
    {
        accountLogService.export(accountLog,exportKey);
        return AjaxResult.success("导出请求成功,请稍后点击下载...!");
    }
    /**
     * 获取账款分析日志详细信息
     */
    @PreAuthorize("@ss.hasPermi('cwgl:accountLog:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return AjaxResult.success(accountLogService.selectAccountLogById(id));
    }
    /**
     * 新增账款分析日志
     */
    @PreAuthorize("@ss.hasPermi('cwgl:accountLog:add')")
    @Log(title = "账款分析日志", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody AccountLog accountLog)
    {
        return toAjax(accountLogService.insertAccountLog(accountLog));
    }
    /**
     * 修改账款分析日志
     */
    @PreAuthorize("@ss.hasPermi('cwgl:accountLog:edit')")
    @Log(title = "账款分析日志", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody AccountLog accountLog)
    {
        return toAjax(accountLogService.updateAccountLog(accountLog));
    }
    /**
     * 删除账款分析日志
     */
    @PreAuthorize("@ss.hasPermi('cwgl:accountLog:remove')")
    @Log(title = "账款分析日志", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Integer[] ids)
    {
        return toAjax(accountLogService.deleteAccountLogByIds(ids));
    }
}
service/src/main/java/com/ruoyi/cwgl/controller/AgingLogController.java
New file
@@ -0,0 +1,108 @@
package com.ruoyi.cwgl.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.utils.file.DownloadExportUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.cwgl.domain.AgingLog;
import com.ruoyi.cwgl.service.IAgingLogService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
 * 账龄分析日志Controller
 *
 * @author ruoyi
 * @date 2026-03-20
 */
@RestController
@RequestMapping("/cwgl/agingLog")
public class AgingLogController extends BaseController
{
    @Autowired
    private IAgingLogService agingLogService;
    /**
     * 查询账龄分析日志列表
     */
    @PreAuthorize("@ss.hasPermi('cwgl:agingLog:list')")
    @GetMapping("/list")
    public TableDataInfo list(AgingLog agingLog)
    {
        startPage();
        List<AgingLog> list = agingLogService.selectAgingLogList(agingLog);
        return getDataTable(list);
    }
    /**
     * 导出账龄分析日志列表
     * @param agingLog 查询条件对象
     */
    @PreAuthorize("@ss.hasPermi('cwgl:agingLog:export')")
    @Log(title = "账龄分析日志", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(AgingLog agingLog,String exportKey)
    {
        agingLogService.export(agingLog,exportKey);
        return AjaxResult.success("导出请求成功,请稍后点击下载...!");
    }
    /**
     * 获取账龄分析日志详细信息
     */
    @PreAuthorize("@ss.hasPermi('cwgl:agingLog:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return AjaxResult.success(agingLogService.selectAgingLogById(id));
    }
    /**
     * 新增账龄分析日志
     */
    @PreAuthorize("@ss.hasPermi('cwgl:agingLog:add')")
    @Log(title = "账龄分析日志", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody AgingLog agingLog)
    {
        return toAjax(agingLogService.insertAgingLog(agingLog));
    }
    /**
     * 修改账龄分析日志
     */
    @PreAuthorize("@ss.hasPermi('cwgl:agingLog:edit')")
    @Log(title = "账龄分析日志", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody AgingLog agingLog)
    {
        return toAjax(agingLogService.updateAgingLog(agingLog));
    }
    /**
     * 删除账龄分析日志
     */
    @PreAuthorize("@ss.hasPermi('cwgl:agingLog:remove')")
    @Log(title = "账龄分析日志", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Integer[] ids)
    {
        return toAjax(agingLogService.deleteAgingLogByIds(ids));
    }
}
service/src/main/java/com/ruoyi/cwgl/controller/PaymentFeedbackController.java
New file
@@ -0,0 +1,108 @@
package com.ruoyi.cwgl.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.utils.file.DownloadExportUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.cwgl.domain.PaymentFeedback;
import com.ruoyi.cwgl.service.IPaymentFeedbackService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
 * 回款进度反馈Controller
 *
 * @author ruoyi
 * @date 2026-03-20
 */
@RestController
@RequestMapping("/cwgl/paymentFeedback")
public class PaymentFeedbackController extends BaseController
{
    @Autowired
    private IPaymentFeedbackService paymentFeedbackService;
    /**
     * 查询回款进度反馈列表
     */
    @PreAuthorize("@ss.hasPermi('cwgl:paymentFeedback:list')")
    @GetMapping("/list")
    public TableDataInfo list(PaymentFeedback paymentFeedback)
    {
        startPage();
        List<PaymentFeedback> list = paymentFeedbackService.selectPaymentFeedbackList(paymentFeedback);
        return getDataTable(list);
    }
    /**
     * 导出回款进度反馈列表
     * @param paymentFeedback 查询条件对象
     */
    @PreAuthorize("@ss.hasPermi('cwgl:paymentFeedback:export')")
    @Log(title = "回款进度反馈", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(PaymentFeedback paymentFeedback,String exportKey)
    {
        paymentFeedbackService.export(paymentFeedback,exportKey);
        return AjaxResult.success("导出请求成功,请稍后点击下载...!");
    }
    /**
     * 获取回款进度反馈详细信息
     */
    @PreAuthorize("@ss.hasPermi('cwgl:paymentFeedback:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return AjaxResult.success(paymentFeedbackService.selectPaymentFeedbackById(id));
    }
    /**
     * 新增回款进度反馈
     */
    @PreAuthorize("@ss.hasPermi('cwgl:paymentFeedback:add')")
    @Log(title = "回款进度反馈", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody PaymentFeedback paymentFeedback)
    {
        return toAjax(paymentFeedbackService.insertPaymentFeedback(paymentFeedback));
    }
    /**
     * 修改回款进度反馈
     */
    @PreAuthorize("@ss.hasPermi('cwgl:paymentFeedback:edit')")
    @Log(title = "回款进度反馈", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody PaymentFeedback paymentFeedback)
    {
        return toAjax(paymentFeedbackService.updatePaymentFeedback(paymentFeedback));
    }
    /**
     * 删除回款进度反馈
     */
    @PreAuthorize("@ss.hasPermi('cwgl:paymentFeedback:remove')")
    @Log(title = "回款进度反馈", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Integer[] ids)
    {
        return toAjax(paymentFeedbackService.deletePaymentFeedbackByIds(ids));
    }
}
service/src/main/java/com/ruoyi/cwgl/controller/ReceivableBillManagementController.java
@@ -3,6 +3,8 @@
import java.util.List;
import com.ruoyi.cwgl.domain.ReceivableBillCustomerSummary;
import com.ruoyi.cwgl.domain.vo.ReceivableBillAccountAnalysisVo;
import com.ruoyi.cwgl.domain.vo.ReceivableBillAgingAnalysisVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -108,6 +110,20 @@
    public AjaxResult edit(@RequestBody ReceivableBillManagement receivableBillManagement)
    {
        return toAjax(receivableBillManagementService.updateReceivableBillManagement(receivableBillManagement));
    }  /**
     * 修改应收账单管理
     */
    @PreAuthorize("@ss.hasPermi('cwgl:receivableBillManagement:edit')")
    @PutMapping("aging")
    public AjaxResult aging(@RequestBody ReceivableBillManagement receivableBillManagement)
    {
        return toAjax(receivableBillManagementService.aging(receivableBillManagement));
    }
@PreAuthorize("@ss.hasPermi('cwgl:receivableBillManagement:edit')")
    @PutMapping("account")
    public AjaxResult account(@RequestBody ReceivableBillManagement receivableBillManagement)
    {
        return toAjax(receivableBillManagementService.account(receivableBillManagement));
    }
    /**
@@ -180,5 +196,29 @@
        List<ReceivableBillCustomerSummary> list = receivableBillManagementService.selectReceivableBillCustomerSummaryList(receivableBillManagement);
        return getDataTable(list);
    }
    /**
     * 查询应收账单账龄分析列表
     */
    @PreAuthorize("@ss.hasPermi('cwgl:receivableBillManagement:list')")
    @GetMapping("/agingAnalysis")
    public TableDataInfo agingAnalysis(ReceivableBillManagement receivableBillManagement)
    {
        startPage();
        List<ReceivableBillAgingAnalysisVo> list = receivableBillManagementService.selectReceivableBillAgingAnalysisList(receivableBillManagement);
        return getDataTable(list);
    }
    /**
     * 查询应收账单账款分析列表
     */
    @PreAuthorize("@ss.hasPermi('cwgl:receivableBillManagement:list')")
    @GetMapping("/accountAnalysis")
    public TableDataInfo accountAnalysis(ReceivableBillManagement receivableBillManagement)
    {
        startPage();
        List<ReceivableBillAccountAnalysisVo> list = receivableBillManagementService.selectReceivableBillAccountAnalysisList(receivableBillManagement);
        return getDataTable(list);
    }
    
}
service/src/main/java/com/ruoyi/cwgl/domain/AccountLog.java
New file
@@ -0,0 +1,48 @@
package com.ruoyi.cwgl.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.Date;
import lombok.Data;
/**
 * 账款分析日志对象 account_log
 *
 * @author ruoyi
 * @date 2026-03-20
 */
@Data
public class AccountLog{
    /** 主键 */
        @TableField("id")
    private Integer id;
    /** 头id */
    @Excel(name = "头id")
        @TableField("head_id")
    private Integer headId;
    /** 创建者 */
        @TableField("create_by")
    private String createBy;
    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @TableField("create_time")
    private Date createTime;
    /** 操作说明 */
    @Excel(name = "操作说明")
        @TableField("operation")
    private String operation;
}
service/src/main/java/com/ruoyi/cwgl/domain/AgingLog.java
New file
@@ -0,0 +1,48 @@
package com.ruoyi.cwgl.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.Date;
import lombok.Data;
/**
 * 账龄分析日志对象 aging_log
 *
 * @author ruoyi
 * @date 2026-03-20
 */
@Data
public class AgingLog{
    /** 主键 */
        @TableField("id")
    private Integer id;
    /** 头id */
    @Excel(name = "头id")
        @TableField("head_id")
    private Integer headId;
    /** 创建者 */
        @TableField("create_by")
    private String createBy;
    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;
    /** 操作说明 */
    @Excel(name = "操作说明")
        @TableField("operation")
    private String operation;
}
service/src/main/java/com/ruoyi/cwgl/domain/PaymentFeedback.java
New file
@@ -0,0 +1,48 @@
package com.ruoyi.cwgl.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.Date;
import lombok.Data;
/**
 * 回款进度反馈对象 payment_feedback
 *
 * @author ruoyi
 * @date 2026-03-20
 */
@Data
public class PaymentFeedback{
    /** ID */
        @TableField("id")
    private Integer id;
    /** 关联ID */
    @Excel(name = "关联ID")
        @TableField("head_id")
    private Integer headId;
    /** 反馈内容 */
    @Excel(name = "反馈内容")
        @TableField("feedback_content")
    private String feedbackContent;
    /** 创建人 */
        @TableField("create_by")
    private String createBy;
    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;
}
service/src/main/java/com/ruoyi/cwgl/domain/ReceivableBillManagement.java
@@ -79,6 +79,13 @@
    private String businessType;
    /** 推进要求 */
    @Excel(name = "推进要求")
        @TableField("promotion_requirement")
    private String promotionRequirement;
    /** 是否内部结算 */
    @Excel(name = "是否内部结算")
@@ -204,15 +211,134 @@
    private Date billSendDate;
    /** 账单到期日期 */
    /**
     * 账单到期日期
     */
    @Excel(name = "账单到期日期", width = 30, dateFormat = "yyyy-MM-dd")
        @JsonFormat(pattern = "yyyy-MM-dd")
        @TableField("bill_due_date")
    private Date billDueDate;
    /**
     * 30天内到期金额
     */
    @Excel(name = "30天内到期金额")
    /** 状态(draft:草稿;generated:已生成;sent:已发送;partial_paid:部分收款;paid:已收款;cancelled:已取消) */
        @TableField("due_in_30_days")
    private BigDecimal dueIn30Days;
    /**
     * 逾期金额
     */
    @Excel(name = "逾期金额")
        @TableField("overdue_amount")
    private BigDecimal overdueAmount;
    /**
     * 逾期1~30天金额
     */
    @Excel(name = "逾期1~30天金额")
        @TableField("overdue_1_to_30_days")
    private BigDecimal overdue1To30Days;
    /**
     * 逾期31~60天金额
     */
    @Excel(name = "逾期31~60天金额")
        @TableField("overdue_31_to_60_days")
    private BigDecimal overdue31To60Days;
    /**
     * 逾期61~90天金额
     */
    @Excel(name = "逾期61~90天金额")
        @TableField("overdue_61_to_90_days")
    private BigDecimal overdue61To90Days;
    /**
     * 逾期91~180天金额
     */
    @Excel(name = "逾期91~180天金额")
        @TableField("overdue_91_to_180_days")
    private BigDecimal overdue91To180Days;
    /**
     * 逾期181~365天金额
     */
    @Excel(name = "逾期181~365天金额")
        @TableField("overdue_181_to_365_days")
    private BigDecimal overdue181To365Days;
    /**
     * 逾期1年以上金额
     */
    @Excel(name = "逾期1年以上金额")
        @TableField("overdue_over_1_year")
    private BigDecimal overdueOver1Year;
    /**
     * 逾期天数
     */
    @Excel(name = "逾期天数")
        @TableField("overdue_days")
    private Integer overdueDays;
    /** 结算种类 */
    @Excel(name = "结算种类")
        @TableField("settlement_category")
    private String settlementCategory;
    /** 结算期 */
    @Excel(name = "结算期")
        @TableField("settlement_period")
    private String settlementPeriod;
    /** NC账面结算日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "NC账面结算日期", width = 30, dateFormat = "yyyy-MM-dd")
        @TableField("nc_settlement_date")
    private Date ncSettlementDate;
    /** NC账面结算金额 */
    @Excel(name = "NC账面结算金额")
        @TableField("nc_settlement_amount")
    private BigDecimal ncSettlementAmount;
    /** 账款备注 */
    @Excel(name = "账款备注")
        @TableField("account_remark")
    private String accountRemark;
    /** 逾期利息 */
    @Excel(name = "逾期利息")
        @TableField("overdue_interest")
    private BigDecimal overdueInterest;
    /**
     * 状态(draft:草稿;generated:已生成;sent:已发送;partial_paid:部分收款;paid:已收款;cancelled:已取消)
     */
    @Excel(name = "状态")
        @TableField("status")
service/src/main/java/com/ruoyi/cwgl/domain/vo/ReceivableBillAccountAnalysisVo.java
New file
@@ -0,0 +1,150 @@
package com.ruoyi.cwgl.domain.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
 * 应收账单账款分析VO
 */
@Data
public class ReceivableBillAccountAnalysisVo {
    /**
     * ID
     */
    private Integer id;
    /**
     * 系统编号
     */
    private String systemNo;
    /**
     * 账单名称
     */
    private String billName;
    /**
     * 客户名称
     */
    private String customerName;
    /**
     * 收款人
     */
    private String payee;
    /**
     * 责任人
     */
    private String responsiblePerson;
    /**
     * 责任领导
     */
    private String responsibleLeader;
    /**
     * 结算方式
     */
    private String settlementMethod;
    /**
     * 业务类型
     */
    private String businessType;
    /**
     * 推进要求
     */
    private String promotionRequirement;
    /**
     * 结算种类
     */
    private String settlementCategory;
    /**
     * 结算期
     */
    private String settlementPeriod;
    /**
     * 应结算金额
     */
    private BigDecimal totalAmount;
    /**
     * 已收金额
     */
    private BigDecimal receivedAmount;
    /**
     * 待收金额
     */
    private BigDecimal pendingAmount;
    /**
     * NC账面结算日期
     */
    private Date ncSettlementDate;
    /**
     * NC账面结算金额
     */
    private BigDecimal ncSettlementAmount;
    /**
     * 账款备注
     */
    private String accountRemark;
    /**
     * 逾期利息
     */
    private BigDecimal overdueInterest;
    /**
     * 账单到期日期
     */
    private Date billDueDate;
    /**
     * 逾期天数
     */
    private Integer overdueDays;
    /**
     * 状态
     */
    private String status;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 最新开票日期
     */
    private Date latestInvoiceTime;
    /**
     * 开票总金额
     */
    private BigDecimal totalInvoiceAmount;
    /**
     * 未开票金额
     */
    private BigDecimal unInvoicedAmount;
}
service/src/main/java/com/ruoyi/cwgl/domain/vo/ReceivableBillAgingAnalysisVo.java
New file
@@ -0,0 +1,227 @@
package com.ruoyi.cwgl.domain.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
 * 应收账单账龄分析VO
 */
@Data
public class ReceivableBillAgingAnalysisVo {
    /**
     * ID
     */
    private Integer id;
    /**
     * 系统编号
     */
    private String systemNo;
    /**
     * 账单名称
     */
    private String billName;
    /**
     * 客户名称
     */
    private String customerName;
    /**
     * 收款人
     */
    private String payee;
    /**
     * 责任人
     */
    private String responsiblePerson;
    /**
     * 责任领导
     */
    private String responsibleLeader;
    /**
     * 结算方式
     */
    private String settlementMethod;
    /**
     * 业务类型
     */
    private String businessType;
    /**
     * 推进要求
     */
    private String promotionRequirement;
    /**
     * 是否内部结算
     */
    private String isInternalSettlement;
    /**
     * 内部结算单位
     */
    private String internalSettlementUnit;
    /**
     * 单据数量
     */
    private Integer documentCount;
    /**
     * 应结算金额
     */
    private BigDecimal totalAmount;
    /**
     * 币制
     */
    private String currency;
    /**
     * 减免金额
     */
    private BigDecimal discountAmount;
    /**
     * 已收金额
     */
    private BigDecimal receivedAmount;
    /**
     * 待收金额
     */
    private BigDecimal pendingAmount;
    /**
     * 汇率(港币兑人民币)
     */
    private BigDecimal exchangeRate;
    /**
     * 人民币金额
     */
    private BigDecimal cnyAmount;
    /**
     * 周期类型
     */
    private String periodType;
    /**
     * 业务期间开始日期
     */
    private Date businessStartDate;
    /**
     * 业务期间结束日期
     */
    private Date businessEndDate;
    /**
     * 账期开始日期
     */
    private Date billingStartDate;
    /**
     * 账期结束日期
     */
    private Date billingEndDate;
    /**
     * 账单生成日期
     */
    private Date billGenerateDate;
    /**
     * 账单发送日期
     */
    private Date billSendDate;
    /**
     * 账单到期日期
     */
    private Date billDueDate;
    /**
     * 状态
     */
    private String status;
    /**
     * 备注
     */
    private String remark;
    /**
     * 创建人
     */
    private String createBy;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新人
     */
    private String updateBy;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 30天内到期金额
     */
    private BigDecimal dueIn30Days;
    /**
     * 逾期金额
     */
    private BigDecimal overdueAmount;
    /**
     * 逾期1~30天金额
     */
    private BigDecimal overdue1To30Days;
    /**
     * 逾期31~60天金额
     */
    private BigDecimal overdue31To60Days;
    /**
     * 逾期61~90天金额
     */
    private BigDecimal overdue61To90Days;
    /**
     * 逾期91~180天金额
     */
    private BigDecimal overdue91To180Days;
    /**
     * 逾期181~365天金额
     */
    private BigDecimal overdue181To365Days;
    /**
     * 逾期1年以上金额
     */
    private BigDecimal overdueOver1Year;
    /**
     * 逾期天数
     */
    private Integer overdueDays;
}
service/src/main/java/com/ruoyi/cwgl/mapper/AccountLogMapper.java
New file
@@ -0,0 +1,87 @@
package com.ruoyi.cwgl.mapper;
import java.util.List;
import com.ruoyi.cwgl.domain.AccountLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
 * 账款分析日志Mapper接口
 *
 * @author ruoyi
 * @date 2026-03-20
 */
public interface AccountLogMapper  extends BaseMapper<AccountLog>
{
    /**
     * 查询账款分析日志
     *
     * @param id 账款分析日志ID
     * @return 账款分析日志
     */
    public AccountLog selectAccountLogById(Integer id);
    /**
     * 查询账款分析日志 记录数
     *
     * @param accountLog 账款分析日志
     * @return 账款分析日志集合
     */
    public int selectAccountLogCount(AccountLog accountLog);
    /**
     * 查询账款分析日志列表
     *
     * @param accountLog 账款分析日志
     * @return 账款分析日志集合
     */
    public List<AccountLog> selectAccountLogList(AccountLog accountLog);
    /**
     * 新增账款分析日志
     *
     * @param accountLog 账款分析日志
     * @return 结果
     */
    public int insertAccountLog(AccountLog accountLog);
    /**
     * 新增账款分析日志[批量]
     *
     * @param accountLogs 账款分析日志
     * @return 结果
     */
    public int insertAccountLogBatch(List<AccountLog> accountLogs);
    /**
     * 修改账款分析日志
     *
     * @param accountLog 账款分析日志
     * @return 结果
     */
    public int updateAccountLog(AccountLog accountLog);
    /**
     * 修改账款分析日志[批量]
     *
     * @param accountLogs 账款分析日志
     * @return 结果
     */
    public int updateAccountLogBatch(List<AccountLog> accountLogs);
    /**
     * 删除账款分析日志
     *
     * @param id 账款分析日志ID
     * @return 结果
     */
    public int deleteAccountLogById(Integer id);
    /**
     * 批量删除账款分析日志
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteAccountLogByIds(Integer[] ids);
}
service/src/main/java/com/ruoyi/cwgl/mapper/AgingLogMapper.java
New file
@@ -0,0 +1,87 @@
package com.ruoyi.cwgl.mapper;
import java.util.List;
import com.ruoyi.cwgl.domain.AgingLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
 * 账龄分析日志Mapper接口
 *
 * @author ruoyi
 * @date 2026-03-20
 */
public interface AgingLogMapper  extends BaseMapper<AgingLog>
{
    /**
     * 查询账龄分析日志
     *
     * @param id 账龄分析日志ID
     * @return 账龄分析日志
     */
    public AgingLog selectAgingLogById(Integer id);
    /**
     * 查询账龄分析日志 记录数
     *
     * @param agingLog 账龄分析日志
     * @return 账龄分析日志集合
     */
    public int selectAgingLogCount(AgingLog agingLog);
    /**
     * 查询账龄分析日志列表
     *
     * @param agingLog 账龄分析日志
     * @return 账龄分析日志集合
     */
    public List<AgingLog> selectAgingLogList(AgingLog agingLog);
    /**
     * 新增账龄分析日志
     *
     * @param agingLog 账龄分析日志
     * @return 结果
     */
    public int insertAgingLog(AgingLog agingLog);
    /**
     * 新增账龄分析日志[批量]
     *
     * @param agingLogs 账龄分析日志
     * @return 结果
     */
    public int insertAgingLogBatch(List<AgingLog> agingLogs);
    /**
     * 修改账龄分析日志
     *
     * @param agingLog 账龄分析日志
     * @return 结果
     */
    public int updateAgingLog(AgingLog agingLog);
    /**
     * 修改账龄分析日志[批量]
     *
     * @param agingLogs 账龄分析日志
     * @return 结果
     */
    public int updateAgingLogBatch(List<AgingLog> agingLogs);
    /**
     * 删除账龄分析日志
     *
     * @param id 账龄分析日志ID
     * @return 结果
     */
    public int deleteAgingLogById(Integer id);
    /**
     * 批量删除账龄分析日志
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteAgingLogByIds(Integer[] ids);
}
service/src/main/java/com/ruoyi/cwgl/mapper/PaymentFeedbackMapper.java
New file
@@ -0,0 +1,87 @@
package com.ruoyi.cwgl.mapper;
import java.util.List;
import com.ruoyi.cwgl.domain.PaymentFeedback;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
 * 回款进度反馈Mapper接口
 *
 * @author ruoyi
 * @date 2026-03-20
 */
public interface PaymentFeedbackMapper  extends BaseMapper<PaymentFeedback>
{
    /**
     * 查询回款进度反馈
     *
     * @param id 回款进度反馈ID
     * @return 回款进度反馈
     */
    public PaymentFeedback selectPaymentFeedbackById(Integer id);
    /**
     * 查询回款进度反馈 记录数
     *
     * @param paymentFeedback 回款进度反馈
     * @return 回款进度反馈集合
     */
    public int selectPaymentFeedbackCount(PaymentFeedback paymentFeedback);
    /**
     * 查询回款进度反馈列表
     *
     * @param paymentFeedback 回款进度反馈
     * @return 回款进度反馈集合
     */
    public List<PaymentFeedback> selectPaymentFeedbackList(PaymentFeedback paymentFeedback);
    /**
     * 新增回款进度反馈
     *
     * @param paymentFeedback 回款进度反馈
     * @return 结果
     */
    public int insertPaymentFeedback(PaymentFeedback paymentFeedback);
    /**
     * 新增回款进度反馈[批量]
     *
     * @param paymentFeedbacks 回款进度反馈
     * @return 结果
     */
    public int insertPaymentFeedbackBatch(List<PaymentFeedback> paymentFeedbacks);
    /**
     * 修改回款进度反馈
     *
     * @param paymentFeedback 回款进度反馈
     * @return 结果
     */
    public int updatePaymentFeedback(PaymentFeedback paymentFeedback);
    /**
     * 修改回款进度反馈[批量]
     *
     * @param paymentFeedbacks 回款进度反馈
     * @return 结果
     */
    public int updatePaymentFeedbackBatch(List<PaymentFeedback> paymentFeedbacks);
    /**
     * 删除回款进度反馈
     *
     * @param id 回款进度反馈ID
     * @return 结果
     */
    public int deletePaymentFeedbackById(Integer id);
    /**
     * 批量删除回款进度反馈
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deletePaymentFeedbackByIds(Integer[] ids);
}
service/src/main/java/com/ruoyi/cwgl/mapper/ReceivableBillManagementMapper.java
@@ -4,6 +4,8 @@
import com.ruoyi.cwgl.domain.ReceivableBillCustomerSummary;
import com.ruoyi.cwgl.domain.ReceivableBillManagement;
import com.ruoyi.cwgl.domain.vo.ReceivableBillAgingAnalysisVo;
import com.ruoyi.cwgl.domain.vo.ReceivableBillAccountAnalysisVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -102,4 +104,28 @@
     * @return 应收账单客户汇总列表
     */
    public List<ReceivableBillCustomerSummary> selectReceivableBillCustomerSummaryList(ReceivableBillManagement receivableBillManagement);
    /**
     * 查询应收账单账龄分析列表
     *
     * @param receivableBillManagement 查询条件
     * @return 应收账单账龄分析列表
     */
    public List<ReceivableBillAgingAnalysisVo> selectReceivableBillAgingAnalysisList(ReceivableBillManagement receivableBillManagement);
    /**
     * 批量更新应收账单账龄分析数据
     * 直接在数据库层面计算账龄分段
     *
     * @return 更新的记录数
     */
    public int batchUpdateAgingAnalysisData();
    /**
     * 查询应收账单账款分析列表
     *
     * @param receivableBillManagement 查询条件
     * @return 应收账单账款分析列表
     */
    public List<ReceivableBillAccountAnalysisVo> selectReceivableBillAccountAnalysisList(ReceivableBillManagement receivableBillManagement);
}
service/src/main/java/com/ruoyi/cwgl/service/IAccountLogService.java
New file
@@ -0,0 +1,102 @@
package com.ruoyi.cwgl.service;
import java.util.List;
import com.ruoyi.cwgl.domain.AccountLog;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * 账款分析日志Service接口
 *
 * @author ruoyi
 * @date 2026-03-20
 */
public interface IAccountLogService extends IService<AccountLog>
{
    /**
     * 查询账款分析日志
     *
     * @param id 账款分析日志ID
     * @return 账款分析日志
     */
    public AccountLog selectAccountLogById(Integer id);
    /**
     * 查询账款分析日志 记录数
     *
     * @param accountLog 账款分析日志
     * @return 账款分析日志集合
     */
    public int selectAccountLogCount(AccountLog accountLog);
    /**
     * 查询账款分析日志列表
     *
     * @param accountLog 账款分析日志
     * @return 账款分析日志集合
     */
    public List<AccountLog> selectAccountLogList(AccountLog accountLog);
    /**
     * 查询账款分析日志列表 异步 导出
     *
     * @param accountLog 账款分析日志
     * @param exportKey 导出功能的唯一标识
     * @return 账款分析日志集合
     */
    public void export(AccountLog accountLog, String exportKey) ;
    /**
     * 新增账款分析日志
     *
     * @param accountLog 账款分析日志
     * @return 结果
     */
    public int insertAccountLog(AccountLog accountLog);
    /**
     * 新增账款分析日志[批量]
     *
     * @param accountLogs 账款分析日志
     * @return 结果
     */
    public int insertAccountLogBatch(List<AccountLog> accountLogs);
    /**
     * 修改账款分析日志
     *
     * @param accountLog 账款分析日志
     * @return 结果
     */
    public int updateAccountLog(AccountLog accountLog);
    /**
     * 修改账款分析日志[批量]
     *
     * @param accountLogs 账款分析日志
     * @return 结果
     */
    public int updateAccountLogBatch(List<AccountLog> accountLogs);
    /**
     * 批量删除账款分析日志
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteAccountLogByIds(String ids);
    /**
     * 批量删除账款分析日志
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteAccountLogByIds(Integer[] ids);
    /**
     * 删除账款分析日志信息
     *
     * @param id 账款分析日志ID
     * @return 结果
     */
    public int deleteAccountLogById(Integer id);
}
service/src/main/java/com/ruoyi/cwgl/service/IAgingLogService.java
New file
@@ -0,0 +1,102 @@
package com.ruoyi.cwgl.service;
import java.util.List;
import com.ruoyi.cwgl.domain.AgingLog;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * 账龄分析日志Service接口
 *
 * @author ruoyi
 * @date 2026-03-20
 */
public interface IAgingLogService extends IService<AgingLog>
{
    /**
     * 查询账龄分析日志
     *
     * @param id 账龄分析日志ID
     * @return 账龄分析日志
     */
    public AgingLog selectAgingLogById(Integer id);
    /**
     * 查询账龄分析日志 记录数
     *
     * @param agingLog 账龄分析日志
     * @return 账龄分析日志集合
     */
    public int selectAgingLogCount(AgingLog agingLog);
    /**
     * 查询账龄分析日志列表
     *
     * @param agingLog 账龄分析日志
     * @return 账龄分析日志集合
     */
    public List<AgingLog> selectAgingLogList(AgingLog agingLog);
    /**
     * 查询账龄分析日志列表 异步 导出
     *
     * @param agingLog 账龄分析日志
     * @param exportKey 导出功能的唯一标识
     * @return 账龄分析日志集合
     */
    public void export(AgingLog agingLog, String exportKey) ;
    /**
     * 新增账龄分析日志
     *
     * @param agingLog 账龄分析日志
     * @return 结果
     */
    public int insertAgingLog(AgingLog agingLog);
    /**
     * 新增账龄分析日志[批量]
     *
     * @param agingLogs 账龄分析日志
     * @return 结果
     */
    public int insertAgingLogBatch(List<AgingLog> agingLogs);
    /**
     * 修改账龄分析日志
     *
     * @param agingLog 账龄分析日志
     * @return 结果
     */
    public int updateAgingLog(AgingLog agingLog);
    /**
     * 修改账龄分析日志[批量]
     *
     * @param agingLogs 账龄分析日志
     * @return 结果
     */
    public int updateAgingLogBatch(List<AgingLog> agingLogs);
    /**
     * 批量删除账龄分析日志
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteAgingLogByIds(String ids);
    /**
     * 批量删除账龄分析日志
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteAgingLogByIds(Integer[] ids);
    /**
     * 删除账龄分析日志信息
     *
     * @param id 账龄分析日志ID
     * @return 结果
     */
    public int deleteAgingLogById(Integer id);
}
service/src/main/java/com/ruoyi/cwgl/service/IPaymentFeedbackService.java
New file
@@ -0,0 +1,102 @@
package com.ruoyi.cwgl.service;
import java.util.List;
import com.ruoyi.cwgl.domain.PaymentFeedback;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * 回款进度反馈Service接口
 *
 * @author ruoyi
 * @date 2026-03-20
 */
public interface IPaymentFeedbackService extends IService<PaymentFeedback>
{
    /**
     * 查询回款进度反馈
     *
     * @param id 回款进度反馈ID
     * @return 回款进度反馈
     */
    public PaymentFeedback selectPaymentFeedbackById(Integer id);
    /**
     * 查询回款进度反馈 记录数
     *
     * @param paymentFeedback 回款进度反馈
     * @return 回款进度反馈集合
     */
    public int selectPaymentFeedbackCount(PaymentFeedback paymentFeedback);
    /**
     * 查询回款进度反馈列表
     *
     * @param paymentFeedback 回款进度反馈
     * @return 回款进度反馈集合
     */
    public List<PaymentFeedback> selectPaymentFeedbackList(PaymentFeedback paymentFeedback);
    /**
     * 查询回款进度反馈列表 异步 导出
     *
     * @param paymentFeedback 回款进度反馈
     * @param exportKey 导出功能的唯一标识
     * @return 回款进度反馈集合
     */
    public void export(PaymentFeedback paymentFeedback, String exportKey) ;
    /**
     * 新增回款进度反馈
     *
     * @param paymentFeedback 回款进度反馈
     * @return 结果
     */
    public int insertPaymentFeedback(PaymentFeedback paymentFeedback);
    /**
     * 新增回款进度反馈[批量]
     *
     * @param paymentFeedbacks 回款进度反馈
     * @return 结果
     */
    public int insertPaymentFeedbackBatch(List<PaymentFeedback> paymentFeedbacks);
    /**
     * 修改回款进度反馈
     *
     * @param paymentFeedback 回款进度反馈
     * @return 结果
     */
    public int updatePaymentFeedback(PaymentFeedback paymentFeedback);
    /**
     * 修改回款进度反馈[批量]
     *
     * @param paymentFeedbacks 回款进度反馈
     * @return 结果
     */
    public int updatePaymentFeedbackBatch(List<PaymentFeedback> paymentFeedbacks);
    /**
     * 批量删除回款进度反馈
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deletePaymentFeedbackByIds(String ids);
    /**
     * 批量删除回款进度反馈
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deletePaymentFeedbackByIds(Integer[] ids);
    /**
     * 删除回款进度反馈信息
     *
     * @param id 回款进度反馈ID
     * @return 结果
     */
    public int deletePaymentFeedbackById(Integer id);
}
service/src/main/java/com/ruoyi/cwgl/service/IReceivableBillManagementService.java
@@ -4,6 +4,8 @@
import com.ruoyi.cwgl.domain.ReceivableBillCustomerSummary;
import com.ruoyi.cwgl.domain.ReceivableBillManagement;
import com.ruoyi.cwgl.domain.vo.ReceivableBillAgingAnalysisVo;
import com.ruoyi.cwgl.domain.vo.ReceivableBillAccountAnalysisVo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
@@ -72,6 +74,8 @@
     * @return 结果
     */
    public int updateReceivableBillManagement(ReceivableBillManagement receivableBillManagement);
    public int aging(ReceivableBillManagement receivableBillManagement);
    public int account(ReceivableBillManagement receivableBillManagement);
    /**
     * 修改应收账单管理[批量]
@@ -127,4 +131,28 @@
     * @return 应收账单客户汇总列表
     */
    public List<ReceivableBillCustomerSummary> selectReceivableBillCustomerSummaryList(@Param("receivableBillManagement") ReceivableBillManagement receivableBillManagement);
    /**
     * 查询应收账单账龄分析列表
     *
     * @param receivableBillManagement 查询条件
     * @return 应收账单账龄分析列表
     */
    public List<ReceivableBillAgingAnalysisVo> selectReceivableBillAgingAnalysisList(@Param("receivableBillManagement") ReceivableBillManagement receivableBillManagement);
    /**
     * 批量更新应收账单账龄分析数据
     * 直接在数据库层面计算账龄分段,避免查询大量数据到应用层
     *
     * @return 更新的记录数
     */
    public int batchUpdateAgingAnalysisData();
    /**
     * 查询应收账单账款分析列表
     *
     * @param receivableBillManagement 查询条件
     * @return 应收账单账款分析列表
     */
    public List<ReceivableBillAccountAnalysisVo> selectReceivableBillAccountAnalysisList(@Param("receivableBillManagement") ReceivableBillManagement receivableBillManagement);
}
service/src/main/java/com/ruoyi/cwgl/service/impl/AccountLogServiceImpl.java
New file
@@ -0,0 +1,181 @@
package com.ruoyi.cwgl.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import org.springframework.scheduling.annotation.Async;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.core.service.BaseService;
import com.ruoyi.cwgl.mapper.AccountLogMapper;
import com.ruoyi.cwgl.domain.AccountLog;
import com.ruoyi.cwgl.service.IAccountLogService;
import com.ruoyi.common.core.text.Convert;
/**
 * 账款分析日志Service业务层处理
 *
 * @author ruoyi
 * @date 2026-03-20
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class AccountLogServiceImpl  extends BaseService<AccountLogMapper, AccountLog> implements IAccountLogService
{
    protected final Logger logger = LoggerFactory.getLogger(getClass());
    @Resource
    private AccountLogMapper accountLogMapper;
    /**
     * 查询账款分析日志
     *
     * @param id 账款分析日志ID
     * @return 账款分析日志
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public AccountLog selectAccountLogById(Integer id)
    {
        return accountLogMapper.selectAccountLogById(id);
    }
    /**
     * 查询账款分析日志 记录数
     *
     * @param accountLog 账款分析日志
     * @return 账款分析日志集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public int selectAccountLogCount(AccountLog accountLog)
    {
        return accountLogMapper.selectAccountLogCount(accountLog);
    }
    /**
     * 查询账款分析日志列表
     *
     * @param accountLog 账款分析日志
     * @return 账款分析日志
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<AccountLog> selectAccountLogList(AccountLog accountLog)
    {
        return accountLogMapper.selectAccountLogList(accountLog);
    }
    /**
     * 查询账款分析日志列表 异步 导出
     *
     * @param accountLog 账款分析日志
     * @param exportKey 导出功能的唯一标识
     * @return 账款分析日志集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Async
    @Override
    public void export(AccountLog accountLog,String exportKey) {
        super.export(AccountLog.class,exportKey,"accountLogData",(pageNum)->{
            PageUtils.startPage(pageNum, Constants.EXPORT_PATE_SIZE);
            return selectAccountLogList(accountLog);
        });
    }
    /**
     * 新增账款分析日志
     *
     * @param accountLog 账款分析日志
     * @return 结果
     */
    @Override
    public int insertAccountLog(AccountLog accountLog)
    {
        accountLog.setCreateTime(DateUtils.getNowDate());
        return accountLogMapper.insertAccountLog(accountLog);
    }
    /**
     * 新增账款分析日志[批量]
     *
     * @param accountLogs 账款分析日志
     * @return 结果
     */
    @Override
    public int insertAccountLogBatch(List<AccountLog> accountLogs)
    {
        int rows = accountLogMapper.insertAccountLogBatch(accountLogs);
        return rows;
    }
    /**
     * 修改账款分析日志
     *
     * @param accountLog 账款分析日志
     * @return 结果
     */
    @Override
    public int updateAccountLog(AccountLog accountLog)
    {
        return accountLogMapper.updateAccountLog(accountLog);
    }
    /**
     * 修改账款分析日志[批量]
     *
     * @param accountLogs 账款分析日志
     * @return 结果
     */
    @Override
    public int updateAccountLogBatch(List<AccountLog> accountLogs){
        return accountLogMapper.updateAccountLogBatch(accountLogs);
    }
    /**
     * 删除账款分析日志对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAccountLogByIds(String ids)
    {
        return deleteAccountLogByIds(Convert.toIntArray(ids));
    }
    /**
     * 删除账款分析日志对象
     *
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAccountLogByIds(Integer[] ids)
    {
        return accountLogMapper.deleteAccountLogByIds(ids);
    }
    /**
     * 删除账款分析日志信息
     *
     * @param id 账款分析日志ID
     * @return 结果
     */
    @Override
    public int deleteAccountLogById(Integer id)
    {
        return accountLogMapper.deleteAccountLogById(id);
    }
}
service/src/main/java/com/ruoyi/cwgl/service/impl/AgingLogServiceImpl.java
New file
@@ -0,0 +1,181 @@
package com.ruoyi.cwgl.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import org.springframework.scheduling.annotation.Async;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.core.service.BaseService;
import com.ruoyi.cwgl.mapper.AgingLogMapper;
import com.ruoyi.cwgl.domain.AgingLog;
import com.ruoyi.cwgl.service.IAgingLogService;
import com.ruoyi.common.core.text.Convert;
/**
 * 账龄分析日志Service业务层处理
 *
 * @author ruoyi
 * @date 2026-03-20
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class AgingLogServiceImpl  extends BaseService<AgingLogMapper, AgingLog> implements IAgingLogService
{
    protected final Logger logger = LoggerFactory.getLogger(getClass());
    @Resource
    private AgingLogMapper agingLogMapper;
    /**
     * 查询账龄分析日志
     *
     * @param id 账龄分析日志ID
     * @return 账龄分析日志
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public AgingLog selectAgingLogById(Integer id)
    {
        return agingLogMapper.selectAgingLogById(id);
    }
    /**
     * 查询账龄分析日志 记录数
     *
     * @param agingLog 账龄分析日志
     * @return 账龄分析日志集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public int selectAgingLogCount(AgingLog agingLog)
    {
        return agingLogMapper.selectAgingLogCount(agingLog);
    }
    /**
     * 查询账龄分析日志列表
     *
     * @param agingLog 账龄分析日志
     * @return 账龄分析日志
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<AgingLog> selectAgingLogList(AgingLog agingLog)
    {
        return agingLogMapper.selectAgingLogList(agingLog);
    }
    /**
     * 查询账龄分析日志列表 异步 导出
     *
     * @param agingLog 账龄分析日志
     * @param exportKey 导出功能的唯一标识
     * @return 账龄分析日志集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Async
    @Override
    public void export(AgingLog agingLog,String exportKey) {
        super.export(AgingLog.class,exportKey,"agingLogData",(pageNum)->{
            PageUtils.startPage(pageNum, Constants.EXPORT_PATE_SIZE);
            return selectAgingLogList(agingLog);
        });
    }
    /**
     * 新增账龄分析日志
     *
     * @param agingLog 账龄分析日志
     * @return 结果
     */
    @Override
    public int insertAgingLog(AgingLog agingLog)
    {
        agingLog.setCreateTime(DateUtils.getNowDate());
        return agingLogMapper.insertAgingLog(agingLog);
    }
    /**
     * 新增账龄分析日志[批量]
     *
     * @param agingLogs 账龄分析日志
     * @return 结果
     */
    @Override
    public int insertAgingLogBatch(List<AgingLog> agingLogs)
    {
        int rows = agingLogMapper.insertAgingLogBatch(agingLogs);
        return rows;
    }
    /**
     * 修改账龄分析日志
     *
     * @param agingLog 账龄分析日志
     * @return 结果
     */
    @Override
    public int updateAgingLog(AgingLog agingLog)
    {
        return agingLogMapper.updateAgingLog(agingLog);
    }
    /**
     * 修改账龄分析日志[批量]
     *
     * @param agingLogs 账龄分析日志
     * @return 结果
     */
    @Override
    public int updateAgingLogBatch(List<AgingLog> agingLogs){
        return agingLogMapper.updateAgingLogBatch(agingLogs);
    }
    /**
     * 删除账龄分析日志对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAgingLogByIds(String ids)
    {
        return deleteAgingLogByIds(Convert.toIntArray(ids));
    }
    /**
     * 删除账龄分析日志对象
     *
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAgingLogByIds(Integer[] ids)
    {
        return agingLogMapper.deleteAgingLogByIds(ids);
    }
    /**
     * 删除账龄分析日志信息
     *
     * @param id 账龄分析日志ID
     * @return 结果
     */
    @Override
    public int deleteAgingLogById(Integer id)
    {
        return agingLogMapper.deleteAgingLogById(id);
    }
}
service/src/main/java/com/ruoyi/cwgl/service/impl/PaymentFeedbackServiceImpl.java
New file
@@ -0,0 +1,197 @@
package com.ruoyi.cwgl.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import javax.annotation.Resource;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.cwgl.domain.AgingLog;
import com.ruoyi.cwgl.mapper.AgingLogMapper;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import org.springframework.scheduling.annotation.Async;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.core.service.BaseService;
import com.ruoyi.cwgl.mapper.PaymentFeedbackMapper;
import com.ruoyi.cwgl.domain.PaymentFeedback;
import com.ruoyi.cwgl.service.IPaymentFeedbackService;
import com.ruoyi.common.core.text.Convert;
/**
 * 回款进度反馈Service业务层处理
 *
 * @author ruoyi
 * @date 2026-03-20
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class PaymentFeedbackServiceImpl  extends BaseService<PaymentFeedbackMapper, PaymentFeedback> implements IPaymentFeedbackService
{
    protected final Logger logger = LoggerFactory.getLogger(getClass());
    @Resource
    private PaymentFeedbackMapper paymentFeedbackMapper;
    @Resource
    private AgingLogMapper agingLogMapper;
    /**
     * 查询回款进度反馈
     *
     * @param id 回款进度反馈ID
     * @return 回款进度反馈
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public PaymentFeedback selectPaymentFeedbackById(Integer id)
    {
        return paymentFeedbackMapper.selectPaymentFeedbackById(id);
    }
    /**
     * 查询回款进度反馈 记录数
     *
     * @param paymentFeedback 回款进度反馈
     * @return 回款进度反馈集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public int selectPaymentFeedbackCount(PaymentFeedback paymentFeedback)
    {
        return paymentFeedbackMapper.selectPaymentFeedbackCount(paymentFeedback);
    }
    /**
     * 查询回款进度反馈列表
     *
     * @param paymentFeedback 回款进度反馈
     * @return 回款进度反馈
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<PaymentFeedback> selectPaymentFeedbackList(PaymentFeedback paymentFeedback)
    {
        return paymentFeedbackMapper.selectPaymentFeedbackList(paymentFeedback);
    }
    /**
     * 查询回款进度反馈列表 异步 导出
     *
     * @param paymentFeedback 回款进度反馈
     * @param exportKey 导出功能的唯一标识
     * @return 回款进度反馈集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Async
    @Override
    public void export(PaymentFeedback paymentFeedback,String exportKey) {
        super.export(PaymentFeedback.class,exportKey,"paymentFeedbackData",(pageNum)->{
            PageUtils.startPage(pageNum, Constants.EXPORT_PATE_SIZE);
            return selectPaymentFeedbackList(paymentFeedback);
        });
    }
    /**
     * 新增回款进度反馈
     *
     * @param paymentFeedback 回款进度反馈
     * @return 结果
     */
    @Override
    public int insertPaymentFeedback(PaymentFeedback paymentFeedback)
    {
        paymentFeedback.setCreateTime(DateUtils.getNowDate());
        int i = paymentFeedbackMapper.insertPaymentFeedback(paymentFeedback);
        // 记录操作日志
        if (i > 0) {
            AgingLog log = new AgingLog();
            log.setHeadId(paymentFeedback.getHeadId());
            log.setCreateBy(SecurityUtils.getUsername());
            log.setCreateTime(DateUtils.getNowDate());
            log.setOperation("提交回款进度反馈");
            agingLogMapper.insertAgingLog(log);
        }
        return i;
    }
    /**
     * 新增回款进度反馈[批量]
     *
     * @param paymentFeedbacks 回款进度反馈
     * @return 结果
     */
    @Override
    public int insertPaymentFeedbackBatch(List<PaymentFeedback> paymentFeedbacks)
    {
        int rows = paymentFeedbackMapper.insertPaymentFeedbackBatch(paymentFeedbacks);
        return rows;
    }
    /**
     * 修改回款进度反馈
     *
     * @param paymentFeedback 回款进度反馈
     * @return 结果
     */
    @Override
    public int updatePaymentFeedback(PaymentFeedback paymentFeedback)
    {
        return paymentFeedbackMapper.updatePaymentFeedback(paymentFeedback);
    }
    /**
     * 修改回款进度反馈[批量]
     *
     * @param paymentFeedbacks 回款进度反馈
     * @return 结果
     */
    @Override
    public int updatePaymentFeedbackBatch(List<PaymentFeedback> paymentFeedbacks){
        return paymentFeedbackMapper.updatePaymentFeedbackBatch(paymentFeedbacks);
    }
    /**
     * 删除回款进度反馈对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deletePaymentFeedbackByIds(String ids)
    {
        return deletePaymentFeedbackByIds(Convert.toIntArray(ids));
    }
    /**
     * 删除回款进度反馈对象
     *
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deletePaymentFeedbackByIds(Integer[] ids)
    {
        return paymentFeedbackMapper.deletePaymentFeedbackByIds(ids);
    }
    /**
     * 删除回款进度反馈信息
     *
     * @param id 回款进度反馈ID
     * @return 结果
     */
    @Override
    public int deletePaymentFeedbackById(Integer id)
    {
        return paymentFeedbackMapper.deletePaymentFeedbackById(id);
    }
}
service/src/main/java/com/ruoyi/cwgl/service/impl/ReceivableBillManagementServiceImpl.java
@@ -5,11 +5,13 @@
import com.ruoyi.common.utils.DateUtils;
import javax.annotation.Resource;
import com.ruoyi.cwgl.domain.ReceivableBillCustomerSummary;
import com.ruoyi.cwgl.mapper.ReceivableFeeManagementMapper;
import com.ruoyi.cwgl.domain.*;
import com.ruoyi.cwgl.domain.vo.ReceivableBillAgingAnalysisVo;
import com.ruoyi.cwgl.domain.vo.ReceivableBillAccountAnalysisVo;
import com.ruoyi.cwgl.mapper.*;
import com.ruoyi.cwgl.service.IAgingLogService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -19,13 +21,7 @@
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.core.service.BaseService;
import com.ruoyi.cwgl.mapper.ReceivableBillManagementMapper;
import com.ruoyi.cwgl.domain.ReceivableBillManagement;
import com.ruoyi.cwgl.domain.ReceivableFeeManagement;
import com.ruoyi.cwgl.domain.ReceivableBillManagementLog;
import com.ruoyi.cwgl.service.IReceivableBillManagementLogService;
import com.ruoyi.cwgl.service.IReceivableBillManagementService;
import com.ruoyi.cwgl.service.IReceivableFeeManagementService;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
@@ -47,7 +43,11 @@
    private ReceivableFeeManagementMapper receivableFeeManagementMapper;
    
    @Resource
    private IReceivableBillManagementLogService receivableBillManagementLogService;
    private ReceivableBillManagementLogMapper receivableBillManagementLogMapper;
    @Resource
    private AgingLogMapper agingLogMapper;
    @Resource
    private AccountLogMapper accountLogMapper;
    /**
@@ -153,9 +153,44 @@
            log.setCreateBy(SecurityUtils.getUsername());
            log.setCreateTime(DateUtils.getNowDate());
            log.setOperation("修改应收账单,账单编号:" + receivableBillManagement.getSystemNo());
            receivableBillManagementLogService.insertReceivableBillManagementLog(log);
            receivableBillManagementLogMapper.insertReceivableBillManagementLog(log);
        }
        
        return result;
    } @Override
    public int aging(ReceivableBillManagement receivableBillManagement)
    {
        receivableBillManagement.setUpdateTime(DateUtils.getNowDate());
        int result = receivableBillManagementMapper.updateReceivableBillManagement(receivableBillManagement);
        // 记录操作日志
        if (result > 0) {
            AgingLog log = new AgingLog();
            log.setHeadId(receivableBillManagement.getId());
            log.setCreateBy(SecurityUtils.getUsername());
            log.setCreateTime(DateUtils.getNowDate());
            log.setOperation("编辑账龄分析信息");
            agingLogMapper.insertAgingLog(log);
        }
        return result;
    }
    @Override
    public int account(ReceivableBillManagement receivableBillManagement)
    {
        receivableBillManagement.setUpdateTime(DateUtils.getNowDate());
        int result = receivableBillManagementMapper.updateReceivableBillManagement(receivableBillManagement);
        // 记录操作日志
        if (result > 0) {
            AccountLog log = new AccountLog();
            log.setHeadId(receivableBillManagement.getId());
            log.setCreateBy(SecurityUtils.getUsername());
            log.setCreateTime(DateUtils.getNowDate());
            log.setOperation("编辑账款分析信息");
            accountLogMapper.insertAccountLog(log);
        }
        return result;
    }
@@ -253,7 +288,7 @@
            log.setCreateBy(SecurityUtils.getUsername());
            log.setCreateTime(DateUtils.getNowDate());
            log.setOperation("作废应收账单,账单编号:" + billManagement.getSystemNo());
            receivableBillManagementLogService.insertReceivableBillManagementLog(log);
            receivableBillManagementLogMapper.insertReceivableBillManagementLog(log);
        }
        
        return result;
@@ -274,7 +309,7 @@
    
    /**
     * 查询应收账单客户汇总列表
     *
     *
     * @param receivableBillManagement 查询条件
     * @return 应收账单客户汇总列表
     */
@@ -284,4 +319,48 @@
    {
        return receivableBillManagementMapper.selectReceivableBillCustomerSummaryList(receivableBillManagement);
    }
    /**
     * 查询应收账单账龄分析列表
     *
     * @param receivableBillManagement 查询条件
     * @return 应收账单账龄分析列表
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<ReceivableBillAgingAnalysisVo> selectReceivableBillAgingAnalysisList(ReceivableBillManagement receivableBillManagement)
    {
        // 直接查询数据库中的预计算账龄数据
        List<ReceivableBillAgingAnalysisVo> result = receivableBillManagementMapper.selectReceivableBillAgingAnalysisList(receivableBillManagement);
        return result;
    }
    /**
     * 批量更新应收账单账龄分析数据
     * 直接在数据库层面计算账龄分段,避免查询大量数据到应用层
     *
     * @return 更新的记录数
     */
    @Override
    public int batchUpdateAgingAnalysisData()
    {
        return receivableBillManagementMapper.batchUpdateAgingAnalysisData();
    }
    /**
     * 查询应收账单账款分析列表
     *
     * @param receivableBillManagement 查询条件
     * @return 应收账单账款分析列表
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<ReceivableBillAccountAnalysisVo> selectReceivableBillAccountAnalysisList(ReceivableBillManagement receivableBillManagement)
    {
        // 直接查询数据库中的账款分析数据
        List<ReceivableBillAccountAnalysisVo> result = receivableBillManagementMapper.selectReceivableBillAccountAnalysisList(receivableBillManagement);
        return result;
    }
}
service/src/main/resources/mapper/cwgl/AccountLogMapper.xml
New file
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.cwgl.mapper.AccountLogMapper">
    <resultMap type="com.ruoyi.cwgl.domain.AccountLog" id="AccountLogResult">
        <result property="id"    column="id"    />
        <result property="headId"    column="head_id"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="operation"    column="operation"    />
    </resultMap>
    <sql id="selectAccountLogVo">
        select thisTab.id, thisTab.head_id, thisTab.create_by, thisTab.create_time, thisTab.operation from account_log AS thisTab
    </sql>
    <sql id="selectAccountLogVoCount">
        select count(0) from account_log as thisTab
    </sql>
    <sql id="whereCondition">
        <if test="headId != null "> and thisTab.head_id = #{headId}</if>
        <if test="operation != null  and operation != ''"> and thisTab.operation = #{operation}</if>
    </sql>
    <!--查询-->
    <select id="selectAccountLogById" parameterType="Integer" resultMap="AccountLogResult">
        <include refid="selectAccountLogVo"/>
        where id = #{id}
    </select>
    <select id="selectAccountLogCount" parameterType="com.ruoyi.cwgl.domain.AccountLog" resultType="int">
        <include refid="selectAccountLogVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
    <select id="selectAccountLogList" parameterType="com.ruoyi.cwgl.domain.AccountLog" resultMap="AccountLogResult">
        <include refid="selectAccountLogVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
    <!-- 新增 -->
    <insert id="insertAccountLog" parameterType="com.ruoyi.cwgl.domain.AccountLog"  useGeneratedKeys="true" keyProperty="id">
        insert into account_log
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="headId != null">head_id,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="operation != null">operation,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="headId != null">#{headId},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="operation != null">#{operation},</if>
         </trim>
    </insert>
    <insert id="insertAccountLogBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into account_log
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,head_id,create_by,create_time,operation,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.headId},#{item.createBy},#{item.createTime},#{item.operation},
            </trim>
        </foreach>
    </insert>
    <!-- 修改 -->
    <update id="updateAccountLog" parameterType="com.ruoyi.cwgl.domain.AccountLog">
        update account_log
        <trim prefix="SET" suffixOverrides=",">
            <if test="headId != null">head_id = #{headId},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="operation != null">operation = #{operation},</if>
        </trim>
        where id = #{id}
    </update>
    <!-- 修改 -->
    <update id="updateAccountLogBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update account_log
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.headId != null">head_id = #{item.headId},</if>
                <if test="item.createBy != null">create_by = #{item.createBy},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
                <if test="item.operation != null">operation = #{item.operation},</if>
            </trim>
        where id = #{item.id}
        </foreach>
    </update>
    <!--删除-->
    <delete id="deleteAccountLogById" parameterType="Integer">
        delete from account_log where id = #{id}
    </delete>
    <delete id="deleteAccountLogByIds" parameterType="Integer">
        delete from account_log where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
service/src/main/resources/mapper/cwgl/AgingLogMapper.xml
New file
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.cwgl.mapper.AgingLogMapper">
    <resultMap type="com.ruoyi.cwgl.domain.AgingLog" id="AgingLogResult">
        <result property="id"    column="id"    />
        <result property="headId"    column="head_id"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="operation"    column="operation"    />
    </resultMap>
    <sql id="selectAgingLogVo">
        select thisTab.id, thisTab.head_id, thisTab.create_by, thisTab.create_time, thisTab.operation from aging_log AS thisTab
    </sql>
    <sql id="selectAgingLogVoCount">
        select count(0) from aging_log as thisTab
    </sql>
    <sql id="whereCondition">
        <if test="headId != null "> and thisTab.head_id = #{headId}</if>
        <if test="operation != null  and operation != ''"> and thisTab.operation = #{operation}</if>
    </sql>
    <!--查询-->
    <select id="selectAgingLogById" parameterType="Integer" resultMap="AgingLogResult">
        <include refid="selectAgingLogVo"/>
        where id = #{id}
    </select>
    <select id="selectAgingLogCount" parameterType="com.ruoyi.cwgl.domain.AgingLog" resultType="int">
        <include refid="selectAgingLogVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
    <select id="selectAgingLogList" parameterType="com.ruoyi.cwgl.domain.AgingLog" resultMap="AgingLogResult">
        <include refid="selectAgingLogVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
    <!-- 新增 -->
    <insert id="insertAgingLog" parameterType="com.ruoyi.cwgl.domain.AgingLog"  useGeneratedKeys="true" keyProperty="id">
        insert into aging_log
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="headId != null">head_id,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="operation != null">operation,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="headId != null">#{headId},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="operation != null">#{operation},</if>
         </trim>
    </insert>
    <insert id="insertAgingLogBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into aging_log
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,head_id,create_by,create_time,operation,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.headId},#{item.createBy},#{item.createTime},#{item.operation},
            </trim>
        </foreach>
    </insert>
    <!-- 修改 -->
    <update id="updateAgingLog" parameterType="com.ruoyi.cwgl.domain.AgingLog">
        update aging_log
        <trim prefix="SET" suffixOverrides=",">
            <if test="headId != null">head_id = #{headId},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="operation != null">operation = #{operation},</if>
        </trim>
        where id = #{id}
    </update>
    <!-- 修改 -->
    <update id="updateAgingLogBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update aging_log
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.headId != null">head_id = #{item.headId},</if>
                <if test="item.createBy != null">create_by = #{item.createBy},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
                <if test="item.operation != null">operation = #{item.operation},</if>
            </trim>
        where id = #{item.id}
        </foreach>
    </update>
    <!--删除-->
    <delete id="deleteAgingLogById" parameterType="Integer">
        delete from aging_log where id = #{id}
    </delete>
    <delete id="deleteAgingLogByIds" parameterType="Integer">
        delete from aging_log where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
service/src/main/resources/mapper/cwgl/PaymentFeedbackMapper.xml
New file
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.cwgl.mapper.PaymentFeedbackMapper">
    <resultMap type="com.ruoyi.cwgl.domain.PaymentFeedback" id="PaymentFeedbackResult">
        <result property="id"    column="id"    />
        <result property="headId"    column="head_id"    />
        <result property="feedbackContent"    column="feedback_content"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>
    <sql id="selectPaymentFeedbackVo">
        select thisTab.id, thisTab.head_id, thisTab.feedback_content, thisTab.create_by, thisTab.create_time from payment_feedback AS thisTab
    </sql>
    <sql id="selectPaymentFeedbackVoCount">
        select count(0) from payment_feedback as thisTab
    </sql>
    <sql id="whereCondition">
        <if test="headId != null "> and thisTab.head_id = #{headId}</if>
        <if test="feedbackContent != null  and feedbackContent != ''"> and thisTab.feedback_content = #{feedbackContent}</if>
    </sql>
    <!--查询-->
    <select id="selectPaymentFeedbackById" parameterType="Integer" resultMap="PaymentFeedbackResult">
        <include refid="selectPaymentFeedbackVo"/>
        where id = #{id}
    </select>
    <select id="selectPaymentFeedbackCount" parameterType="com.ruoyi.cwgl.domain.PaymentFeedback" resultType="int">
        <include refid="selectPaymentFeedbackVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
    <select id="selectPaymentFeedbackList" parameterType="com.ruoyi.cwgl.domain.PaymentFeedback" resultMap="PaymentFeedbackResult">
        <include refid="selectPaymentFeedbackVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
    <!-- 新增 -->
    <insert id="insertPaymentFeedback" parameterType="com.ruoyi.cwgl.domain.PaymentFeedback"  useGeneratedKeys="true" keyProperty="id">
        insert into payment_feedback
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="headId != null">head_id,</if>
            <if test="feedbackContent != null and feedbackContent != ''">feedback_content,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="headId != null">#{headId},</if>
            <if test="feedbackContent != null and feedbackContent != ''">#{feedbackContent},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
         </trim>
    </insert>
    <insert id="insertPaymentFeedbackBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into payment_feedback
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,head_id,feedback_content,create_by,create_time,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.headId},#{item.feedbackContent},#{item.createBy},#{item.createTime},
            </trim>
        </foreach>
    </insert>
    <!-- 修改 -->
    <update id="updatePaymentFeedback" parameterType="com.ruoyi.cwgl.domain.PaymentFeedback">
        update payment_feedback
        <trim prefix="SET" suffixOverrides=",">
            <if test="headId != null">head_id = #{headId},</if>
            <if test="feedbackContent != null and feedbackContent != ''">feedback_content = #{feedbackContent},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
        </trim>
        where id = #{id}
    </update>
    <!-- 修改 -->
    <update id="updatePaymentFeedbackBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update payment_feedback
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.headId != null">head_id = #{item.headId},</if>
                <if test="item.feedbackContent != null and item.feedbackContent != ''">feedback_content = #{item.feedbackContent},</if>
                <if test="item.createBy != null">create_by = #{item.createBy},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
            </trim>
        where id = #{item.id}
        </foreach>
    </update>
    <!--删除-->
    <delete id="deletePaymentFeedbackById" parameterType="Integer">
        delete from payment_feedback where id = #{id}
    </delete>
    <delete id="deletePaymentFeedbackByIds" parameterType="Integer">
        delete from payment_feedback where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
service/src/main/resources/mapper/cwgl/ReceivableBillManagementMapper.xml
@@ -14,6 +14,51 @@
        <result property="responsibleLeader"    column="responsible_leader"    />
        <result property="settlementMethod"    column="settlement_method"    />
        <result property="businessType"    column="business_type"    />
        <result property="promotionRequirement"    column="promotion_requirement"    />
        <result property="isInternalSettlement"    column="is_internal_settlement"    />
        <result property="internalSettlementUnit"    column="internal_settlement_unit"    />
        <result property="documentCount"    column="document_count"    />
        <result property="totalAmount"    column="total_amount"    />
        <result property="currency"    column="currency"    />
        <result property="discountAmount"    column="discount_amount"    />
        <result property="receivedAmount"    column="received_amount"    />
        <result property="pendingAmount"    column="pending_amount"    />
        <result property="exchangeRate"    column="exchange_rate"    />
        <result property="cnyAmount"    column="cny_amount"    />
        <result property="periodType"    column="period_type"    />
        <result property="businessStartDate"    column="business_start_date"    />
        <result property="businessEndDate"    column="business_end_date"    />
        <result property="billingStartDate"    column="billing_start_date"    />
        <result property="billingEndDate"    column="billing_end_date"    />
        <result property="billGenerateDate"    column="bill_generate_date"    />
        <result property="billSendDate"    column="bill_send_date"    />
        <result property="billDueDate"    column="bill_due_date"    />
        <result property="settlementCategory"    column="settlement_category"    />
        <result property="settlementPeriod"    column="settlement_period"    />
        <result property="ncSettlementDate"    column="nc_settlement_date"    />
        <result property="ncSettlementAmount"    column="nc_settlement_amount"    />
        <result property="accountRemark"    column="account_remark"    />
        <result property="overdueInterest"    column="overdue_interest"    />
        <result property="status"    column="status"    />
        <result property="remark"    column="remark"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="deleted"    column="deleted"    />
    </resultMap>
    <resultMap type="com.ruoyi.cwgl.domain.vo.ReceivableBillAgingAnalysisVo" id="ReceivableBillAgingAnalysisVoResult">
        <result property="id"    column="id"    />
        <result property="systemNo"    column="system_no"    />
        <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="promotionRequirement"    column="promotion_requirement"    />
        <result property="isInternalSettlement"    column="is_internal_settlement"    />
        <result property="internalSettlementUnit"    column="internal_settlement_unit"    />
        <result property="documentCount"    column="document_count"    />
@@ -38,11 +83,19 @@
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="deleted"    column="deleted"    />
        <result property="dueIn30Days"    column="due_in_30_days"    />
        <result property="overdueAmount"    column="overdue_amount"    />
        <result property="overdue1To30Days"    column="overdue_1_to_30_days"    />
        <result property="overdue31To60Days"    column="overdue_31_to_60_days"    />
        <result property="overdue61To90Days"    column="overdue_61_to_90_days"    />
        <result property="overdue91To180Days"    column="overdue_91_to_180_days"    />
        <result property="overdue181To365Days"    column="overdue_181_to_365_days"    />
        <result property="overdueOver1Year"    column="overdue_over_1_year"    />
        <result property="overdueDays"    column="overdue_days"    />
    </resultMap>
    <sql id="selectReceivableBillManagementVo">
        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
        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.promotion_requirement, 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.due_in_30_days, thisTab.overdue_amount, thisTab.overdue_1_to_30_days, thisTab.overdue_31_to_60_days, thisTab.overdue_61_to_90_days, thisTab.overdue_91_to_180_days, thisTab.overdue_181_to_365_days, thisTab.overdue_over_1_year, thisTab.overdue_days, thisTab.settlement_category, thisTab.settlement_period, thisTab.nc_settlement_date, thisTab.nc_settlement_amount, thisTab.account_remark, thisTab.overdue_interest, 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
@@ -57,6 +110,7 @@
        <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="promotionRequirement != null  and promotionRequirement != ''"> and thisTab.promotion_requirement like concat('%', #{promotionRequirement}, '%')</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>
@@ -75,6 +129,12 @@
        <if test="billGenerateDate != null "> and thisTab.bill_generate_date = #{billGenerateDate}</if>
        <if test="billSendDate != null "> and thisTab.bill_send_date = #{billSendDate}</if>
        <if test="billDueDate != null "> and thisTab.bill_due_date = #{billDueDate}</if>
        <if test="settlementCategory != null  and settlementCategory != ''"> and thisTab.settlement_category = #{settlementCategory}</if>
        <if test="settlementPeriod != null  and settlementPeriod != ''"> and thisTab.settlement_period = #{settlementPeriod}</if>
        <if test="ncSettlementDate != null "> and thisTab.nc_settlement_date = #{ncSettlementDate}</if>
        <if test="ncSettlementAmount != null "> and thisTab.nc_settlement_amount = #{ncSettlementAmount}</if>
        <if test="accountRemark != null  and accountRemark != ''"> and thisTab.account_remark like concat('%', #{accountRemark}, '%')</if>
        <if test="overdueInterest != null "> and thisTab.overdue_interest = #{overdueInterest}</if>
        <if test="status != null and status != ''">
            <choose>
                <when test="status == -1">
@@ -126,6 +186,7 @@
            <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="promotionRequirement != null and promotionRequirement != ''">promotion_requirement,</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>
@@ -144,6 +205,12 @@
            <if test="billGenerateDate != null">bill_generate_date,</if>
            <if test="billSendDate != null">bill_send_date,</if>
            <if test="billDueDate != null">bill_due_date,</if>
            <if test="settlementCategory != null and settlementCategory != ''">settlement_category,</if>
            <if test="settlementPeriod != null and settlementPeriod != ''">settlement_period,</if>
            <if test="ncSettlementDate != null">nc_settlement_date,</if>
            <if test="ncSettlementAmount != null">nc_settlement_amount,</if>
            <if test="accountRemark != null and accountRemark != ''">account_remark,</if>
            <if test="overdueInterest != null">overdue_interest,</if>
            <if test="status != null">status,</if>
            <if test="remark != null">remark,</if>
            <if test="createBy != null">create_by,</if>
@@ -161,6 +228,7 @@
            <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="promotionRequirement != null and promotionRequirement != ''">#{promotionRequirement},</if>
            <if test="isInternalSettlement != null and isInternalSettlement != ''">#{isInternalSettlement},</if>
            <if test="internalSettlementUnit != null">#{internalSettlementUnit},</if>
            <if test="documentCount != null">#{documentCount},</if>
@@ -179,6 +247,12 @@
            <if test="billGenerateDate != null">#{billGenerateDate},</if>
            <if test="billSendDate != null">#{billSendDate},</if>
            <if test="billDueDate != null">#{billDueDate},</if>
            <if test="settlementCategory != null and settlementCategory != ''">#{settlementCategory},</if>
            <if test="settlementPeriod != null and settlementPeriod != ''">#{settlementPeriod},</if>
            <if test="ncSettlementDate != null">#{ncSettlementDate},</if>
            <if test="ncSettlementAmount != null">#{ncSettlementAmount},</if>
            <if test="accountRemark != null and accountRemark != ''">#{accountRemark},</if>
            <if test="overdueInterest != null">#{overdueInterest},</if>
            <if test="status != null">#{status},</if>
            <if test="remark != null">#{remark},</if>
            <if test="createBy != null">#{createBy},</if>
@@ -192,11 +266,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,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,
            system_no,bill_name,customer_name,payee,responsible_person,responsible_leader,settlement_method,business_type,promotion_requirement,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,settlement_category,settlement_period,nc_settlement_date,nc_settlement_amount,account_remark,overdue_interest,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.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},
                #{item.systemNo},#{item.billName},#{item.customerName},#{item.payee},#{item.responsiblePerson},#{item.responsibleLeader},#{item.settlementMethod},#{item.businessType},#{item.promotionRequirement},#{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.settlementCategory},#{item.settlementPeriod},#{item.ncSettlementDate},#{item.ncSettlementAmount},#{item.accountRemark},#{item.overdueInterest},#{item.status},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted},
            </trim>
        </foreach>
    </insert>
@@ -213,6 +287,7 @@
            <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="promotionRequirement != null and promotionRequirement != ''">promotion_requirement = #{promotionRequirement},</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>
@@ -231,6 +306,12 @@
            <if test="billGenerateDate != null">bill_generate_date = #{billGenerateDate},</if>
            <if test="billSendDate != null">bill_send_date = #{billSendDate},</if>
            <if test="billDueDate != null">bill_due_date = #{billDueDate},</if>
            <if test="settlementCategory != null and settlementCategory != ''">settlement_category = #{settlementCategory},</if>
            <if test="settlementPeriod != null and settlementPeriod != ''">settlement_period = #{settlementPeriod},</if>
            <if test="ncSettlementDate != null">nc_settlement_date = #{ncSettlementDate},</if>
            <if test="ncSettlementAmount != null">nc_settlement_amount = #{ncSettlementAmount},</if>
            <if test="accountRemark != null and accountRemark != ''">account_remark = #{accountRemark},</if>
            <if test="overdueInterest != null">overdue_interest = #{overdueInterest},</if>
            <if test="status != null">status = #{status},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
@@ -254,6 +335,7 @@
                <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.promotionRequirement != null and item.promotionRequirement != ''">promotion_requirement = #{item.promotionRequirement},</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>
@@ -272,6 +354,12 @@
                <if test="item.billGenerateDate != null">bill_generate_date = #{item.billGenerateDate},</if>
                <if test="item.billSendDate != null">bill_send_date = #{item.billSendDate},</if>
                <if test="item.billDueDate != null">bill_due_date = #{item.billDueDate},</if>
                <if test="item.settlementCategory != null and item.settlementCategory != ''">settlement_category = #{item.settlementCategory},</if>
                <if test="item.settlementPeriod != null and item.settlementPeriod != ''">settlement_period = #{item.settlementPeriod},</if>
                <if test="item.ncSettlementDate != null">nc_settlement_date = #{item.ncSettlementDate},</if>
                <if test="item.ncSettlementAmount != null">nc_settlement_amount = #{item.ncSettlementAmount},</if>
                <if test="item.accountRemark != null and item.accountRemark != ''">account_remark = #{item.accountRemark},</if>
                <if test="item.overdueInterest != null">overdue_interest = #{item.overdueInterest},</if>
                <if test="item.status != null">status = #{item.status},</if>
                <if test="item.remark != null">remark = #{item.remark},</if>
                <if test="item.createBy != null">create_by = #{item.createBy},</if>
@@ -304,10 +392,152 @@
            SUM(pending_amount) as totalPendingAmount
        FROM receivable_bill_management
        <where>
            <include refid="whereCondition"/>
            <if test="customerName != null  and customerName != ''"> and  customer_name like concat('%', #{customerName}, '%')</if>
        </where>
        GROUP BY customer_name
        ORDER BY customer_name
    </select>
    <!-- 查询应收账单账龄分析列表 -->
    <select id="selectReceivableBillAgingAnalysisList" parameterType="com.ruoyi.cwgl.domain.ReceivableBillManagement" resultMap="ReceivableBillAgingAnalysisVoResult">
        <include refid="selectReceivableBillManagementVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        ORDER BY customer_name, bill_due_date
    </select>
    <!-- 批量更新应收账单账龄分析数据 -->
    <update id="batchUpdateAgingAnalysisData">
        UPDATE receivable_bill_management
        SET
            due_in_30_days = CASE
                WHEN pending_amount > 0 AND bill_due_date IS NOT NULL
                     AND bill_due_date > CURDATE()
                     AND DATEDIFF(bill_due_date, CURDATE()) &lt;= 30
                THEN pending_amount
                ELSE due_in_30_days
            END,
            overdue_amount = CASE
                WHEN pending_amount > 0 AND bill_due_date IS NOT NULL
                     AND bill_due_date &lt;= CURDATE()
                THEN pending_amount
                ELSE overdue_amount
            END,
            overdue_1_to_30_days = CASE
                WHEN pending_amount > 0 AND bill_due_date IS NOT NULL
                     AND bill_due_date &lt;= CURDATE()
                     AND DATEDIFF(CURDATE(), bill_due_date) BETWEEN 1 AND 30
                THEN pending_amount
                ELSE overdue_1_to_30_days
            END,
            overdue_31_to_60_days = CASE
                WHEN pending_amount > 0 AND bill_due_date IS NOT NULL
                     AND bill_due_date &lt;= CURDATE()
                     AND DATEDIFF(CURDATE(), bill_due_date) BETWEEN 31 AND 60
                THEN pending_amount
                ELSE overdue_31_to_60_days
            END,
            overdue_61_to_90_days = CASE
                WHEN pending_amount > 0 AND bill_due_date IS NOT NULL
                     AND bill_due_date &lt;= CURDATE()
                     AND DATEDIFF(CURDATE(), bill_due_date) BETWEEN 61 AND 90
                THEN pending_amount
                ELSE overdue_61_to_90_days
            END,
            overdue_91_to_180_days = CASE
                WHEN pending_amount > 0 AND bill_due_date IS NOT NULL
                     AND bill_due_date &lt;= CURDATE()
                     AND DATEDIFF(CURDATE(), bill_due_date) BETWEEN 91 AND 180
                THEN pending_amount
                ELSE overdue_91_to_180_days
            END,
            overdue_181_to_365_days = CASE
                WHEN pending_amount > 0 AND bill_due_date IS NOT NULL
                     AND bill_due_date &lt;= CURDATE()
                     AND DATEDIFF(CURDATE(), bill_due_date) BETWEEN 181 AND 365
                THEN pending_amount
                ELSE overdue_181_to_365_days
            END,
            overdue_over_1_year = CASE
                WHEN pending_amount > 0 AND bill_due_date IS NOT NULL
                     AND bill_due_date &lt;= CURDATE()
                     AND DATEDIFF(CURDATE(), bill_due_date) &gt; 365
                THEN pending_amount
                ELSE overdue_over_1_year
            END,
            overdue_days = CASE
                WHEN pending_amount > 0 AND bill_due_date IS NOT NULL
                     AND bill_due_date &lt;= CURDATE()
                THEN DATEDIFF(CURDATE(), bill_due_date)
                ELSE overdue_days
            END,
            update_time = NOW()
        WHERE pending_amount > 0
    </update>
    <!-- 查询应收账单账款分析列表 -->
    <select id="selectReceivableBillAccountAnalysisList" parameterType="com.ruoyi.cwgl.domain.ReceivableBillManagement" resultType="com.ruoyi.cwgl.domain.vo.ReceivableBillAccountAnalysisVo">
        SELECT
            rbm.id,
            rbm.system_no as systemNo,
            rbm.bill_name as billName,
            rbm.customer_name as customerName,
            rbm.payee,
            rbm.responsible_person as responsiblePerson,
            rbm.responsible_leader as responsibleLeader,
            rbm.settlement_method as settlementMethod,
            rbm.business_type as businessType,
            rbm.promotion_requirement as promotionRequirement,
            rbm.settlement_category as settlementCategory,
            rbm.settlement_period as settlementPeriod,
            rbm.total_amount as totalAmount,
            rbm.received_amount as receivedAmount,
            rbm.pending_amount as pendingAmount,
            rbm.nc_settlement_date as ncSettlementDate,
            rbm.nc_settlement_amount as ncSettlementAmount,
            rbm.account_remark as accountRemark,
            rbm.overdue_interest as overdueInterest,
            rbm.bill_due_date as billDueDate,
            rbm.overdue_days as overdueDays,
            rbm.status,
            rbm.create_time as createTime,
            rbm.update_time as updateTime,
            -- 开票相关字段
            rib_latest.invoice_time as latestInvoiceTime,
            COALESCE(rib_total.total_invoice_amount, 0) as totalInvoiceAmount,
            CASE
                WHEN rbm.total_amount > COALESCE(rib_total.total_invoice_amount, 0)
                THEN rbm.total_amount - COALESCE(rib_total.total_invoice_amount, 0)
                ELSE 0
            END as unInvoicedAmount
        FROM receivable_bill_management rbm
        -- 获取最新开票日期
        LEFT JOIN (
            SELECT head_id, MAX(invoice_time) as invoice_time
            FROM receivable_invoice_business
            WHERE status = 1
            GROUP BY head_id
        ) rib_latest ON rbm.id = rib_latest.head_id
        -- 获取开票总金额
        LEFT JOIN (
            SELECT head_id, SUM(invoicing_amount) as total_invoice_amount
            FROM receivable_invoice_business
            WHERE status = 1
            GROUP BY head_id
        ) rib_total ON rbm.id = rib_total.head_id
        <where>
            <include refid="whereCondition"/>
        </where>
        ORDER BY rbm.customer_name, rbm.bill_due_date
    </select>
</mapper>