sen
2025-12-22 84897f28662a94a6caec972c543538c2c9fdf0f5
Merge remote-tracking branch 'origin/cwxt_master' into cwxt_master
5个文件已修改
390 ■■■■ 已修改文件
common/src/main/java/com/ruoyi/common/enums/SystemDataNoEnum.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/ReceivableFeeDetail.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/ReceivableFeeManagement.java 336 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/ReceivableFeeManagementServiceImpl.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/ReceivableFeeManagementMapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/src/main/java/com/ruoyi/common/enums/SystemDataNoEnum.java
@@ -26,7 +26,7 @@
    OF("OF","OF","其他账单编号"),
    CUST("CUST","CUST","客户编号"),
    ZXH("ZXH","ZXH","装卸货点"),
    YY("YY","YY","运营编号")
    YY("YY","YY","运营编号"),
service/src/main/java/com/ruoyi/cwgl/domain/ReceivableFeeDetail.java
@@ -106,8 +106,8 @@
    /** 创建时间 */
        @JsonFormat(pattern = "yyyy-MM-dd")
        @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;
@@ -117,8 +117,8 @@
    /** 更新时间 */
        @JsonFormat(pattern = "yyyy-MM-dd")
        @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    private Date updateTime;
service/src/main/java/com/ruoyi/cwgl/domain/ReceivableFeeManagement.java
@@ -1,165 +1,171 @@
package com.ruoyi.cwgl.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.cwgl.domain.ReceivableFeeDetail;
import lombok.Data;
/**
 * 应收费用管理对象 receivable_fee_management
 *
 * @author ruoyi
 * @date 2025-12-17
 */
@Data
public class ReceivableFeeManagement{
    /** ID */
        @TableField("id")
    private Integer id;
    /** 系统编号 */
    @Excel(name = "系统编号")
        @TableField("system_no")
    private String systemNo;
    /** 关联账单编号 */
    @Excel(name = "关联账单编号")
        @TableField("related_bill_no")
    private String relatedBillNo;
    /** 来源系统 */
    @Excel(name = "来源系统")
        @TableField("source_system")
    private String sourceSystem;
    /** 业务板块 */
    @Excel(name = "业务板块")
        @TableField("business_sector")
    private String businessSector;
    /** 单据类型 */
    @Excel(name = "单据类型")
        @TableField("document_type")
    private String documentType;
    /** 单据编号 */
    @Excel(name = "单据编号")
        @TableField("document_no")
    private String documentNo;
    /** 是否内部结算 */
    @Excel(name = "是否内部结算")
        @TableField("is_internal_settlement")
    private String isInternalSettlement;
    /** 内部结算单位 */
    @Excel(name = "内部结算单位")
        @TableField("internal_settlement_unit")
    private String internalSettlementUnit;
    /** 客户名称 */
    @Excel(name = "客户名称")
        @TableField("customer_name")
    private String customerName;
    /** 项目名称 */
    @Excel(name = "项目名称")
        @TableField("project_name")
    private String projectName;
    /** 业务发生时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "业务发生时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("business_time")
    private Date businessTime;
    /** 应收确认时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "应收确认时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("receivable_confirm_time")
    private Date receivableConfirmTime;
    /** 应收金额 */
    @Excel(name = "应收金额")
        @TableField("receivable_amount")
    private BigDecimal receivableAmount;
    /** 状态 */
    @Excel(name = "状态")
        @TableField("status")
    private String status;
    /** 备注 */
    @Excel(name = "备注")
        @TableField("remark")
    private String remark;
    /** 创建人 */
        @TableField("create_by")
    private String createBy;
    /** 创建时间 */
        @JsonFormat(pattern = "yyyy-MM-dd")
        @TableField("create_time")
    private Date createTime;
    /** 更新人 */
        @TableField("update_by")
    private String updateBy;
    /** 更新时间 */
        @JsonFormat(pattern = "yyyy-MM-dd")
        @TableField("update_time")
    private Date updateTime;
    /** 删除标记(0:正常;1:删除) */
    @Excel(name = "删除标记(0:正常;1:删除)")
        @TableField("deleted")
    private Integer deleted;
    /** 应收费用明细列表 */
    @TableField(exist = false)
    private List<ReceivableFeeDetail> receivableFeeDetailList;
}
package com.ruoyi.cwgl.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.cwgl.domain.ReceivableFeeDetail;
import lombok.Data;
/**
 * 应收费用管理对象 receivable_fee_management
 *
 * @author ruoyi
 * @date 2025-12-17
 */
@Data
public class ReceivableFeeManagement{
    /** ID */
        @TableField("id")
    private Integer id;
    /** 系统编号 */
    @Excel(name = "系统编号")
        @TableField("system_no")
    private String systemNo;
    /** 关联账单编号 */
    @Excel(name = "关联账单编号")
        @TableField("related_bill_no")
    private String relatedBillNo;
    /** 来源系统 */
    @Excel(name = "来源系统")
        @TableField("source_system")
    private String sourceSystem;
    /** 业务板块 */
    @Excel(name = "业务板块")
        @TableField("business_sector")
    private String businessSector;
    /** 单据类型 */
    @Excel(name = "单据类型")
        @TableField("document_type")
    private String documentType;
    /** 单据编号 */
    @Excel(name = "单据编号")
        @TableField("document_no")
    private String documentNo;
    /** 是否内部结算 */
    @Excel(name = "是否内部结算")
        @TableField("is_internal_settlement")
    private String isInternalSettlement;
    /** 内部结算单位 */
    @Excel(name = "内部结算单位")
        @TableField("internal_settlement_unit")
    private String internalSettlementUnit;
    /** 客户名称 */
    @Excel(name = "客户名称")
        @TableField("customer_name")
    private String customerName;
    /** 客户ID */
    @Excel(name = "客户ID")
        @TableField("customer_id")
    private Integer customerId;
    /** 项目名称 */
    @Excel(name = "项目名称")
        @TableField("project_name")
    private String projectName;
    /** 业务发生时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "业务发生时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("business_time")
    private Date businessTime;
    /** 应收确认时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "应收确认时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("receivable_confirm_time")
    private Date receivableConfirmTime;
    /** 应收金额 */
    @Excel(name = "应收金额")
        @TableField("receivable_amount")
    private BigDecimal receivableAmount;
    /** 状态 */
    @Excel(name = "状态")
        @TableField("status")
    private String status;
    /** 备注 */
    @Excel(name = "备注")
        @TableField("remark")
    private String remark;
    /** 创建人 */
        @TableField("create_by")
    private String createBy;
    /** 创建时间 */
        @JsonFormat(pattern = "yyyy-MM-dd")
        @TableField("create_time")
    private Date createTime;
    /** 更新人 */
        @TableField("update_by")
    private String updateBy;
    /** 更新时间 */
        @JsonFormat(pattern = "yyyy-MM-dd")
        @TableField("update_time")
    private Date updateTime;
    /** 删除标记(0:正常;1:删除) */
    @Excel(name = "删除标记(0:正常;1:删除)")
        @TableField("deleted")
    private Integer deleted;
    /** 应收费用明细列表 */
    @TableField(exist = false)
    private List<ReceivableFeeDetail> receivableFeeDetailList;
}
service/src/main/java/com/ruoyi/cwgl/service/impl/ReceivableFeeManagementServiceImpl.java
@@ -4,7 +4,10 @@
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import com.ruoyi.common.enums.SystemDataNoEnum;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import javax.annotation.Resource;
@@ -12,6 +15,7 @@
import com.ruoyi.cwgl.domain.vo.ReceivableFeeStatisticsVo;
import com.ruoyi.system.domain.SysConfig;
import com.ruoyi.system.mapper.SysConfigMapper;
import com.ruoyi.system.service.ISystemDataNoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
@@ -61,6 +65,8 @@
    @Autowired
    private IReceivableBillSettlementDetailService receivableBillSettlementDetailService;
    @Autowired
    ISystemDataNoService systemDataNoService;
    /**
     * 查询应收费用管理
@@ -130,7 +136,9 @@
    public int insertReceivableFeeManagement(ReceivableFeeManagement receivableFeeManagement)
    {
        receivableFeeManagement.setCreateTime(DateUtils.getNowDate());
        String noByKey = systemDataNoService.getNoByKey(SystemDataNoEnum.YS);
        receivableFeeManagement.setSystemNo(noByKey);
        // 保存主表信息
        int result = receivableFeeManagementMapper.insertReceivableFeeManagement(receivableFeeManagement);
        
@@ -239,6 +247,17 @@
        // 查询应收费用主表记录
        List<ReceivableFeeManagement> receivableFeeList = receivableFeeManagementMapper.selectReceivableFeeManagementByIds(ids);
        
        // 检查所有记录是否属于同一个客户
        if (!receivableFeeList.isEmpty()) {
            Integer firstCustomerId = receivableFeeList.get(0).getCustomerId();
            boolean allSameCustomer = receivableFeeList.stream()
                    .allMatch(item -> Objects.equals(item.getCustomerId(), firstCustomerId));
            if (!allSameCustomer) {
                throw new ServiceException("所选记录包含不同客户的数据,无法进行统计");
            }
        }
        // 计算单据数量
        int documentCount = receivableFeeList.size();
        SysConfig sysConfig = sysConfigMapper.selectConfig(new SysConfig() {{
service/src/main/resources/mapper/cwgl/ReceivableFeeManagementMapper.xml
@@ -15,6 +15,7 @@
        <result property="isInternalSettlement"    column="is_internal_settlement"    />
        <result property="internalSettlementUnit"    column="internal_settlement_unit"    />
        <result property="customerName"    column="customer_name"    />
        <result property="customerId"    column="customer_id"    />
        <result property="projectName"    column="project_name"    />
        <result property="businessTime"    column="business_time"    />
        <result property="receivableConfirmTime"    column="receivable_confirm_time"    />
@@ -29,7 +30,7 @@
    </resultMap>
    <sql id="selectReceivableFeeManagementVo">
        select thisTab.id, thisTab.system_no, thisTab.related_bill_no, thisTab.source_system, thisTab.business_sector, thisTab.document_type, thisTab.document_no, thisTab.is_internal_settlement, thisTab.internal_settlement_unit, thisTab.customer_name, thisTab.project_name, thisTab.business_time, thisTab.receivable_confirm_time, thisTab.receivable_amount, thisTab.status, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from receivable_fee_management AS thisTab
        select thisTab.id, thisTab.system_no, thisTab.related_bill_no, thisTab.source_system, thisTab.business_sector, thisTab.document_type, thisTab.document_no, thisTab.is_internal_settlement, thisTab.internal_settlement_unit, thisTab.customer_name, thisTab.customer_id, thisTab.project_name, thisTab.business_time, thisTab.receivable_confirm_time, thisTab.receivable_amount, thisTab.status, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from receivable_fee_management AS thisTab
    </sql>
    <sql id="selectReceivableFeeManagementVoCount">
        select count(0) from receivable_fee_management as thisTab
@@ -45,6 +46,7 @@
        <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="customerName != null  and customerName != ''"> and  thisTab.customer_name like concat('%', #{customerName}, '%')</if>
        <if test="customerId != null  and customerId != ''"> and thisTab.customer_id = #{customerId}</if>
        <if test="projectName != null  and projectName != ''"> and  thisTab.project_name like concat('%', #{projectName}, '%')</if>
        <if test="businessTime != null "> and thisTab.business_time = #{businessTime}</if>
        <if test="receivableConfirmTime != null "> and thisTab.receivable_confirm_time = #{receivableConfirmTime}</if>
@@ -87,6 +89,7 @@
            <if test="isInternalSettlement != null and isInternalSettlement != ''">is_internal_settlement,</if>
            <if test="internalSettlementUnit != null">internal_settlement_unit,</if>
            <if test="customerName != null and customerName != ''">customer_name,</if>
            <if test="customerId != null">customer_id,</if>
            <if test="projectName != null">project_name,</if>
            <if test="businessTime != null">business_time,</if>
            <if test="receivableConfirmTime != null">receivable_confirm_time,</if>
@@ -109,6 +112,7 @@
            <if test="isInternalSettlement != null and isInternalSettlement != ''">#{isInternalSettlement},</if>
            <if test="internalSettlementUnit != null">#{internalSettlementUnit},</if>
            <if test="customerName != null and customerName != ''">#{customerName},</if>
            <if test="customerId != null">#{customerId},</if>
            <if test="projectName != null">#{projectName},</if>
            <if test="businessTime != null">#{businessTime},</if>
            <if test="receivableConfirmTime != null">#{receivableConfirmTime},</if>
@@ -123,15 +127,12 @@
         </trim>
    </insert>
    <insert id="insertReceivableFeeManagementBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into receivable_fee_management
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,system_no,related_bill_no,source_system,business_sector,document_type,document_no,is_internal_settlement,internal_settlement_unit,customer_name,project_name,business_time,receivable_confirm_time,receivable_amount,status,remark,create_by,create_time,update_by,update_time,deleted,
        </trim>
    <!-- 批量新增 -->
    <insert id="insertReceivableFeeManagementBatch" parameterType="com.ruoyi.cwgl.domain.ReceivableFeeManagement" useGeneratedKeys="true" keyProperty="id">
        insert into receivable_fee_management (system_no, related_bill_no, source_system, business_sector, document_type, document_no, is_internal_settlement, internal_settlement_unit, customer_name, customer_id, project_name, business_time, receivable_confirm_time, receivable_amount, status, remark, create_by, create_time, update_by, update_time, deleted)
        values
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.systemNo},#{item.relatedBillNo},#{item.sourceSystem},#{item.businessSector},#{item.documentType},#{item.documentNo},#{item.isInternalSettlement},#{item.internalSettlementUnit},#{item.customerName},#{item.projectName},#{item.businessTime},#{item.receivableConfirmTime},#{item.receivableAmount},#{item.status},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted},
            </trim>
            (#{item.systemNo}, #{item.relatedBillNo}, #{item.sourceSystem}, #{item.businessSector}, #{item.documentType}, #{item.documentNo}, #{item.isInternalSettlement}, #{item.internalSettlementUnit}, #{item.customerName}, #{item.customerId}, #{item.projectName}, #{item.businessTime}, #{item.receivableConfirmTime}, #{item.receivableAmount}, #{item.status}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.deleted})
        </foreach>
    </insert>
@@ -148,6 +149,7 @@
            <if test="isInternalSettlement != null and isInternalSettlement != ''">is_internal_settlement = #{isInternalSettlement},</if>
            <if test="internalSettlementUnit != null">internal_settlement_unit = #{internalSettlementUnit},</if>
            <if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
            <if test="customerId != null">customer_id = #{customerId},</if>
            <if test="projectName != null">project_name = #{projectName},</if>
            <if test="businessTime != null">business_time = #{businessTime},</if>
            <if test="receivableConfirmTime != null">receivable_confirm_time = #{receivableConfirmTime},</if>
@@ -164,7 +166,7 @@
    </update>
    <!-- 修改 -->
    <update id="updateReceivableFeeManagementBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
        <foreach collection="list" item="item" index="index" separator=",">
            update receivable_fee_management
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.systemNo != null and item.systemNo != ''">system_no = #{item.systemNo},</if>
@@ -176,6 +178,7 @@
                <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.customerName != null and item.customerName != ''">customer_name = #{item.customerName},</if>
                <if test="item.customerId != null">customer_id = #{item.customerId},</if>
                <if test="item.projectName != null">project_name = #{item.projectName},</if>
                <if test="item.businessTime != null">business_time = #{item.businessTime},</if>
                <if test="item.receivableConfirmTime != null">receivable_confirm_time = #{item.receivableConfirmTime},</if>