wujianwei
2025-08-07 5b9dcdbdfd7c65c642a124ebbae4ddc4795cac84
新增预估应收账单前后端
8个文件已添加
1024 ■■■■■ 已修改文件
service/src/main/java/com/ruoyi/cwgl/controller/EstimatedReceivableBillController.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/EstimatedReceivableBill.java 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/mapper/EstimatedReceivableBillMapper.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/IEstimatedReceivableBillService.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/EstimatedReceivableBillServiceImpl.java 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/EstimatedReceivableBillMapper.xml 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/api/cwgl/estimatedReceivableBill.ts 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/views/cwgl/estimatedReceivableBill/index.vue 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/controller/EstimatedReceivableBillController.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.EstimatedReceivableBill;
import com.ruoyi.cwgl.service.IEstimatedReceivableBillService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
 * 预估应收账单Controller
 *
 * @author ruoyi
 * @date 2025-08-07
 */
@RestController
@RequestMapping("/cwgl/estimatedReceivableBill")
public class EstimatedReceivableBillController extends BaseController
{
    @Autowired
    private IEstimatedReceivableBillService estimatedReceivableBillService;
    /**
     * 查询预估应收账单列表
     */
    @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivableBill:list')")
    @GetMapping("/list")
    public TableDataInfo list(EstimatedReceivableBill estimatedReceivableBill)
    {
        startPage();
        List<EstimatedReceivableBill> list = estimatedReceivableBillService.selectEstimatedReceivableBillList(estimatedReceivableBill);
        return getDataTable(list);
    }
    /**
     * 导出预估应收账单列表
     * @param estimatedReceivableBill 查询条件对象
     */
    @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivableBill:export')")
    @Log(title = "预估应收账单", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(EstimatedReceivableBill estimatedReceivableBill,String exportKey)
    {
        estimatedReceivableBillService.export(estimatedReceivableBill,exportKey);
        return AjaxResult.success("导出请求成功,请稍后点击下载...!");
    }
    /**
     * 获取预估应收账单详细信息
     */
    @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivableBill:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return AjaxResult.success(estimatedReceivableBillService.selectEstimatedReceivableBillById(id));
    }
    /**
     * 新增预估应收账单
     */
    @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivableBill:add')")
    @Log(title = "预估应收账单", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody EstimatedReceivableBill estimatedReceivableBill)
    {
        return toAjax(estimatedReceivableBillService.insertEstimatedReceivableBill(estimatedReceivableBill));
    }
    /**
     * 修改预估应收账单
     */
    @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivableBill:edit')")
    @Log(title = "预估应收账单", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody EstimatedReceivableBill estimatedReceivableBill)
    {
        return toAjax(estimatedReceivableBillService.updateEstimatedReceivableBill(estimatedReceivableBill));
    }
    /**
     * 删除预估应收账单
     */
    @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivableBill:remove')")
    @Log(title = "预估应收账单", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Integer[] ids)
    {
        return toAjax(estimatedReceivableBillService.deleteEstimatedReceivableBillByIds(ids));
    }
}
service/src/main/java/com/ruoyi/cwgl/domain/EstimatedReceivableBill.java
New file
@@ -0,0 +1,127 @@
package com.ruoyi.cwgl.domain;
import java.math.BigDecimal;
import java.util.Date;
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;
/**
 * 预估应收账单对象 estimated_receivable_bill
 *
 * @author ruoyi
 * @date 2025-08-07
 */
@Data
public class EstimatedReceivableBill{
    /** ID */
        @TableField("id")
    private Integer id;
    /** 账单系统编号 */
    @Excel(name = "账单系统编号")
        @TableField("bill_system_no")
    private String billSystemNo;
    /** 账单名称 */
    @Excel(name = "账单名称")
        @TableField("bill_name")
    private String billName;
    /** 客户名称 */
    @Excel(name = "客户名称")
        @TableField("customer_name")
    private String customerName;
    /** 调度单数量 */
    @Excel(name = "调度单数量")
        @TableField("dispatch_count")
    private Integer dispatchCount;
    /** 应结算金额 */
    @Excel(name = "应结算金额")
        @TableField("total_amount")
    private BigDecimal totalAmount;
    /** 已结算金额 */
    @Excel(name = "已结算金额")
        @TableField("settled_amount")
    private BigDecimal settledAmount;
    /** 开票状态 */
    @Excel(name = "开票状态")
        @TableField("invoice_status")
    private Integer invoiceStatus;
    /** 附件地址 */
    @Excel(name = "附件地址")
        @TableField("attachment")
    private String attachment;
    /** 状态 */
    @Excel(name = "状态")
        @TableField("status")
    private Integer status;
    /** 备注 */
    @Excel(name = "备注")
        @TableField("remark")
    private String remark;
    /** 创建人 */
        @TableField("create_by")
    private String createBy;
    /** 确认时间 */
    @Excel(name = "确认时间", width = 30, dateFormat = "yyyy-MM-dd")
        @JsonFormat(pattern = "yyyy-MM-dd")
        @TableField("confirm_time")
    private Date confirmTime;
    /** 创建时间 */
        @JsonFormat(pattern = "yyyy-MM-dd")
        @TableField("create_time")
    private Date createTime;
    /** 更新时间 */
        @JsonFormat(pattern = "yyyy-MM-dd")
        @TableField("update_time")
    private Date updateTime;
    /** 删除标记(0:正常;1:删除) */
    @Excel(name = "删除标记(0:正常;1:删除)")
        @TableField("deleted")
    private Integer deleted;
}
service/src/main/java/com/ruoyi/cwgl/mapper/EstimatedReceivableBillMapper.java
New file
@@ -0,0 +1,87 @@
package com.ruoyi.cwgl.mapper;
import java.util.List;
import com.ruoyi.cwgl.domain.EstimatedReceivableBill;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
 * 预估应收账单Mapper接口
 *
 * @author ruoyi
 * @date 2025-08-07
 */
public interface EstimatedReceivableBillMapper  extends BaseMapper<EstimatedReceivableBill>
{
    /**
     * 查询预估应收账单
     *
     * @param id 预估应收账单ID
     * @return 预估应收账单
     */
    public EstimatedReceivableBill selectEstimatedReceivableBillById(Integer id);
    /**
     * 查询预估应收账单 记录数
     *
     * @param estimatedReceivableBill 预估应收账单
     * @return 预估应收账单集合
     */
    public int selectEstimatedReceivableBillCount(EstimatedReceivableBill estimatedReceivableBill);
    /**
     * 查询预估应收账单列表
     *
     * @param estimatedReceivableBill 预估应收账单
     * @return 预估应收账单集合
     */
    public List<EstimatedReceivableBill> selectEstimatedReceivableBillList(EstimatedReceivableBill estimatedReceivableBill);
    /**
     * 新增预估应收账单
     *
     * @param estimatedReceivableBill 预估应收账单
     * @return 结果
     */
    public int insertEstimatedReceivableBill(EstimatedReceivableBill estimatedReceivableBill);
    /**
     * 新增预估应收账单[批量]
     *
     * @param estimatedReceivableBills 预估应收账单
     * @return 结果
     */
    public int insertEstimatedReceivableBillBatch(List<EstimatedReceivableBill> estimatedReceivableBills);
    /**
     * 修改预估应收账单
     *
     * @param estimatedReceivableBill 预估应收账单
     * @return 结果
     */
    public int updateEstimatedReceivableBill(EstimatedReceivableBill estimatedReceivableBill);
    /**
     * 修改预估应收账单[批量]
     *
     * @param estimatedReceivableBills 预估应收账单
     * @return 结果
     */
    public int updateEstimatedReceivableBillBatch(List<EstimatedReceivableBill> estimatedReceivableBills);
    /**
     * 删除预估应收账单
     *
     * @param id 预估应收账单ID
     * @return 结果
     */
    public int deleteEstimatedReceivableBillById(Integer id);
    /**
     * 批量删除预估应收账单
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteEstimatedReceivableBillByIds(Integer[] ids);
}
service/src/main/java/com/ruoyi/cwgl/service/IEstimatedReceivableBillService.java
New file
@@ -0,0 +1,102 @@
package com.ruoyi.cwgl.service;
import java.util.List;
import com.ruoyi.cwgl.domain.EstimatedReceivableBill;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * 预估应收账单Service接口
 *
 * @author ruoyi
 * @date 2025-08-07
 */
public interface IEstimatedReceivableBillService extends IService<EstimatedReceivableBill>
{
    /**
     * 查询预估应收账单
     *
     * @param id 预估应收账单ID
     * @return 预估应收账单
     */
    public EstimatedReceivableBill selectEstimatedReceivableBillById(Integer id);
    /**
     * 查询预估应收账单 记录数
     *
     * @param estimatedReceivableBill 预估应收账单
     * @return 预估应收账单集合
     */
    public int selectEstimatedReceivableBillCount(EstimatedReceivableBill estimatedReceivableBill);
    /**
     * 查询预估应收账单列表
     *
     * @param estimatedReceivableBill 预估应收账单
     * @return 预估应收账单集合
     */
    public List<EstimatedReceivableBill> selectEstimatedReceivableBillList(EstimatedReceivableBill estimatedReceivableBill);
    /**
     * 查询预估应收账单列表 异步 导出
     *
     * @param estimatedReceivableBill 预估应收账单
     * @param exportKey 导出功能的唯一标识
     * @return 预估应收账单集合
     */
    public void export(EstimatedReceivableBill estimatedReceivableBill, String exportKey) ;
    /**
     * 新增预估应收账单
     *
     * @param estimatedReceivableBill 预估应收账单
     * @return 结果
     */
    public int insertEstimatedReceivableBill(EstimatedReceivableBill estimatedReceivableBill);
    /**
     * 新增预估应收账单[批量]
     *
     * @param estimatedReceivableBills 预估应收账单
     * @return 结果
     */
    public int insertEstimatedReceivableBillBatch(List<EstimatedReceivableBill> estimatedReceivableBills);
    /**
     * 修改预估应收账单
     *
     * @param estimatedReceivableBill 预估应收账单
     * @return 结果
     */
    public int updateEstimatedReceivableBill(EstimatedReceivableBill estimatedReceivableBill);
    /**
     * 修改预估应收账单[批量]
     *
     * @param estimatedReceivableBills 预估应收账单
     * @return 结果
     */
    public int updateEstimatedReceivableBillBatch(List<EstimatedReceivableBill> estimatedReceivableBills);
    /**
     * 批量删除预估应收账单
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteEstimatedReceivableBillByIds(String ids);
    /**
     * 批量删除预估应收账单
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteEstimatedReceivableBillByIds(Integer[] ids);
    /**
     * 删除预估应收账单信息
     *
     * @param id 预估应收账单ID
     * @return 结果
     */
    public int deleteEstimatedReceivableBillById(Integer id);
}
service/src/main/java/com/ruoyi/cwgl/service/impl/EstimatedReceivableBillServiceImpl.java
New file
@@ -0,0 +1,182 @@
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.EstimatedReceivableBillMapper;
import com.ruoyi.cwgl.domain.EstimatedReceivableBill;
import com.ruoyi.cwgl.service.IEstimatedReceivableBillService;
import com.ruoyi.common.core.text.Convert;
/**
 * 预估应收账单Service业务层处理
 *
 * @author ruoyi
 * @date 2025-08-07
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class EstimatedReceivableBillServiceImpl  extends BaseService<EstimatedReceivableBillMapper, EstimatedReceivableBill> implements IEstimatedReceivableBillService
{
    protected final Logger logger = LoggerFactory.getLogger(getClass());
    @Resource
    private EstimatedReceivableBillMapper estimatedReceivableBillMapper;
    /**
     * 查询预估应收账单
     *
     * @param id 预估应收账单ID
     * @return 预估应收账单
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public EstimatedReceivableBill selectEstimatedReceivableBillById(Integer id)
    {
        return estimatedReceivableBillMapper.selectEstimatedReceivableBillById(id);
    }
    /**
     * 查询预估应收账单 记录数
     *
     * @param estimatedReceivableBill 预估应收账单
     * @return 预估应收账单集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public int selectEstimatedReceivableBillCount(EstimatedReceivableBill estimatedReceivableBill)
    {
        return estimatedReceivableBillMapper.selectEstimatedReceivableBillCount(estimatedReceivableBill);
    }
    /**
     * 查询预估应收账单列表
     *
     * @param estimatedReceivableBill 预估应收账单
     * @return 预估应收账单
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<EstimatedReceivableBill> selectEstimatedReceivableBillList(EstimatedReceivableBill estimatedReceivableBill)
    {
        return estimatedReceivableBillMapper.selectEstimatedReceivableBillList(estimatedReceivableBill);
    }
    /**
     * 查询预估应收账单列表 异步 导出
     *
     * @param estimatedReceivableBill 预估应收账单
     * @param exportKey 导出功能的唯一标识
     * @return 预估应收账单集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Async
    @Override
    public void export(EstimatedReceivableBill estimatedReceivableBill,String exportKey) {
        super.export(EstimatedReceivableBill.class,exportKey,"estimatedReceivableBillData",(pageNum)->{
            PageUtils.startPage(pageNum, Constants.EXPORT_PATE_SIZE);
            return selectEstimatedReceivableBillList(estimatedReceivableBill);
        });
    }
    /**
     * 新增预估应收账单
     *
     * @param estimatedReceivableBill 预估应收账单
     * @return 结果
     */
    @Override
    public int insertEstimatedReceivableBill(EstimatedReceivableBill estimatedReceivableBill)
    {
        estimatedReceivableBill.setCreateTime(DateUtils.getNowDate());
        return estimatedReceivableBillMapper.insertEstimatedReceivableBill(estimatedReceivableBill);
    }
    /**
     * 新增预估应收账单[批量]
     *
     * @param estimatedReceivableBills 预估应收账单
     * @return 结果
     */
    @Override
    public int insertEstimatedReceivableBillBatch(List<EstimatedReceivableBill> estimatedReceivableBills)
    {
        int rows = estimatedReceivableBillMapper.insertEstimatedReceivableBillBatch(estimatedReceivableBills);
        return rows;
    }
    /**
     * 修改预估应收账单
     *
     * @param estimatedReceivableBill 预估应收账单
     * @return 结果
     */
    @Override
    public int updateEstimatedReceivableBill(EstimatedReceivableBill estimatedReceivableBill)
    {
        estimatedReceivableBill.setUpdateTime(DateUtils.getNowDate());
        return estimatedReceivableBillMapper.updateEstimatedReceivableBill(estimatedReceivableBill);
    }
    /**
     * 修改预估应收账单[批量]
     *
     * @param estimatedReceivableBills 预估应收账单
     * @return 结果
     */
    @Override
    public int updateEstimatedReceivableBillBatch(List<EstimatedReceivableBill> estimatedReceivableBills){
        return estimatedReceivableBillMapper.updateEstimatedReceivableBillBatch(estimatedReceivableBills);
    }
    /**
     * 删除预估应收账单对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteEstimatedReceivableBillByIds(String ids)
    {
        return deleteEstimatedReceivableBillByIds(Convert.toIntArray(ids));
    }
    /**
     * 删除预估应收账单对象
     *
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteEstimatedReceivableBillByIds(Integer[] ids)
    {
        return estimatedReceivableBillMapper.deleteEstimatedReceivableBillByIds(ids);
    }
    /**
     * 删除预估应收账单信息
     *
     * @param id 预估应收账单ID
     * @return 结果
     */
    @Override
    public int deleteEstimatedReceivableBillById(Integer id)
    {
        return estimatedReceivableBillMapper.deleteEstimatedReceivableBillById(id);
    }
}
service/src/main/resources/mapper/cwgl/EstimatedReceivableBillMapper.xml
New file
@@ -0,0 +1,177 @@
<?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.EstimatedReceivableBillMapper">
    <resultMap type="com.ruoyi.cwgl.domain.EstimatedReceivableBill" id="EstimatedReceivableBillResult">
        <result property="id"    column="id"    />
        <result property="billSystemNo"    column="bill_system_no"    />
        <result property="billName"    column="bill_name"    />
        <result property="customerName"    column="customer_name"    />
        <result property="dispatchCount"    column="dispatch_count"    />
        <result property="totalAmount"    column="total_amount"    />
        <result property="settledAmount"    column="settled_amount"    />
        <result property="invoiceStatus"    column="invoice_status"    />
        <result property="attachment"    column="attachment"    />
        <result property="status"    column="status"    />
        <result property="remark"    column="remark"    />
        <result property="createBy"    column="create_by"    />
        <result property="confirmTime"    column="confirm_time"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="deleted"    column="deleted"    />
    </resultMap>
    <sql id="selectEstimatedReceivableBillVo">
        select thisTab.id, thisTab.bill_system_no, thisTab.bill_name, thisTab.customer_name, thisTab.dispatch_count, thisTab.total_amount, thisTab.settled_amount, thisTab.invoice_status, thisTab.attachment, thisTab.status, thisTab.remark, thisTab.create_by, thisTab.confirm_time, thisTab.create_time, thisTab.update_time, thisTab.deleted from estimated_receivable_bill AS thisTab
    </sql>
    <sql id="selectEstimatedReceivableBillVoCount">
        select count(0) from estimated_receivable_bill as thisTab
    </sql>
    <sql id="whereCondition">
        <if test="billSystemNo != null  and billSystemNo != ''"> and thisTab.bill_system_no = #{billSystemNo}</if>
        <if test="billName != null  and billName != ''"> and  thisTab.bill_name like concat('%', #{billName}, '%')</if>
        <if test="customerName != null  and customerName != ''"> and  thisTab.customer_name like concat('%', #{customerName}, '%')</if>
        <if test="dispatchCount != null "> and thisTab.dispatch_count = #{dispatchCount}</if>
        <if test="totalAmount != null "> and thisTab.total_amount = #{totalAmount}</if>
        <if test="settledAmount != null "> and thisTab.settled_amount = #{settledAmount}</if>
        <if test="invoiceStatus != null "> and thisTab.invoice_status = #{invoiceStatus}</if>
        <if test="attachment != null  and attachment != ''"> and thisTab.attachment = #{attachment}</if>
        <if test="status != null "> and thisTab.status = #{status}</if>
        <if test="confirmTime != null "> and thisTab.confirm_time = #{confirmTime}</if>
        <if test="deleted != null "> and thisTab.deleted = #{deleted}</if>
    </sql>
    <!--查询-->
    <select id="selectEstimatedReceivableBillById" parameterType="Integer" resultMap="EstimatedReceivableBillResult">
        <include refid="selectEstimatedReceivableBillVo"/>
        where id = #{id}
    </select>
    <select id="selectEstimatedReceivableBillCount" parameterType="com.ruoyi.cwgl.domain.EstimatedReceivableBill" resultType="int">
        <include refid="selectEstimatedReceivableBillVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
    <select id="selectEstimatedReceivableBillList" parameterType="com.ruoyi.cwgl.domain.EstimatedReceivableBill" resultMap="EstimatedReceivableBillResult">
        <include refid="selectEstimatedReceivableBillVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
    <!-- 新增 -->
    <insert id="insertEstimatedReceivableBill" parameterType="com.ruoyi.cwgl.domain.EstimatedReceivableBill"  useGeneratedKeys="true" keyProperty="id">
        insert into estimated_receivable_bill
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="billSystemNo != null and billSystemNo != ''">bill_system_no,</if>
            <if test="billName != null and billName != ''">bill_name,</if>
            <if test="customerName != null and customerName != ''">customer_name,</if>
            <if test="dispatchCount != null">dispatch_count,</if>
            <if test="totalAmount != null">total_amount,</if>
            <if test="settledAmount != null">settled_amount,</if>
            <if test="invoiceStatus != null">invoice_status,</if>
            <if test="attachment != null">attachment,</if>
            <if test="status != null">status,</if>
            <if test="remark != null">remark,</if>
            <if test="createBy != null">create_by,</if>
            <if test="confirmTime != null">confirm_time,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="deleted != null">deleted,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="billSystemNo != null and billSystemNo != ''">#{billSystemNo},</if>
            <if test="billName != null and billName != ''">#{billName},</if>
            <if test="customerName != null and customerName != ''">#{customerName},</if>
            <if test="dispatchCount != null">#{dispatchCount},</if>
            <if test="totalAmount != null">#{totalAmount},</if>
            <if test="settledAmount != null">#{settledAmount},</if>
            <if test="invoiceStatus != null">#{invoiceStatus},</if>
            <if test="attachment != null">#{attachment},</if>
            <if test="status != null">#{status},</if>
            <if test="remark != null">#{remark},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="confirmTime != null">#{confirmTime},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="deleted != null">#{deleted},</if>
         </trim>
    </insert>
    <insert id="insertEstimatedReceivableBillBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into estimated_receivable_bill
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,bill_system_no,bill_name,customer_name,dispatch_count,total_amount,settled_amount,invoice_status,attachment,status,remark,create_by,confirm_time,create_time,update_time,deleted,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.billSystemNo},#{item.billName},#{item.customerName},#{item.dispatchCount},#{item.totalAmount},#{item.settledAmount},#{item.invoiceStatus},#{item.attachment},#{item.status},#{item.remark},#{item.createBy},#{item.confirmTime},#{item.createTime},#{item.updateTime},#{item.deleted},
            </trim>
        </foreach>
    </insert>
    <!-- 修改 -->
    <update id="updateEstimatedReceivableBill" parameterType="com.ruoyi.cwgl.domain.EstimatedReceivableBill">
        update estimated_receivable_bill
        <trim prefix="SET" suffixOverrides=",">
            <if test="billSystemNo != null and billSystemNo != ''">bill_system_no = #{billSystemNo},</if>
            <if test="billName != null and billName != ''">bill_name = #{billName},</if>
            <if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
            <if test="dispatchCount != null">dispatch_count = #{dispatchCount},</if>
            <if test="totalAmount != null">total_amount = #{totalAmount},</if>
            <if test="settledAmount != null">settled_amount = #{settledAmount},</if>
            <if test="invoiceStatus != null">invoice_status = #{invoiceStatus},</if>
            <if test="attachment != null">attachment = #{attachment},</if>
            <if test="status != null">status = #{status},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="confirmTime != null">confirm_time = #{confirmTime},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="deleted != null">deleted = #{deleted},</if>
        </trim>
        where id = #{id}
    </update>
    <!-- 修改 -->
    <update id="updateEstimatedReceivableBillBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update estimated_receivable_bill
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.billSystemNo != null and item.billSystemNo != ''">bill_system_no = #{item.billSystemNo},</if>
                <if test="item.billName != null and item.billName != ''">bill_name = #{item.billName},</if>
                <if test="item.customerName != null and item.customerName != ''">customer_name = #{item.customerName},</if>
                <if test="item.dispatchCount != null">dispatch_count = #{item.dispatchCount},</if>
                <if test="item.totalAmount != null">total_amount = #{item.totalAmount},</if>
                <if test="item.settledAmount != null">settled_amount = #{item.settledAmount},</if>
                <if test="item.invoiceStatus != null">invoice_status = #{item.invoiceStatus},</if>
                <if test="item.attachment != null">attachment = #{item.attachment},</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>
                <if test="item.confirmTime != null">confirm_time = #{item.confirmTime},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
                <if test="item.deleted != null">deleted = #{item.deleted},</if>
            </trim>
        where id = #{item.id}
        </foreach>
    </update>
    <!--删除-->
    <delete id="deleteEstimatedReceivableBillById" parameterType="Integer">
        delete from estimated_receivable_bill where id = #{id}
    </delete>
    <delete id="deleteEstimatedReceivableBillByIds" parameterType="Integer">
        delete from estimated_receivable_bill where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
ui/admin-ui3/src/api/cwgl/estimatedReceivableBill.ts
New file
@@ -0,0 +1,67 @@
import request,{download,requestType} from "@/utils/request";
import {BaseEntityInterface} from "@/utils/globalInterface";
export interface EstimatedReceivableBillI extends BaseEntityInterface{
            id ?:  number   ,            billSystemNo ?:  string   ,            billName ?:  string   ,            customerName ?:  string   ,            dispatchCount ?:  number   ,            totalAmount ?:  string   ,            settledAmount ?:  string   ,            invoiceStatus ?:  number   ,            attachment ?:  string   ,            status ?:  number   ,            remark ?:  string   ,            createBy ?:  string   ,            confirmTime ?:  string   ,            createTime ?:  string   ,            updateTime ?:  string   ,            deleted ?:  number       }
/**
 * 查询预估应收账单列表
 */
export const listEstimatedReceivableBill:requestType = (query) => {
    return request({
        url: '/cwgl/estimatedReceivableBill/list',
        method:'get',
        params:query
    })
}
/**
 * 查询预估应收账单详细
 */
export const getEstimatedReceivableBill:requestType = (id) => {
    return request({
        url: '/cwgl/estimatedReceivableBill/' + id,
        method:'get'
    })
}
/**
 * 新增预估应收账单
 */
export const addEstimatedReceivableBill:requestType = (data) => {
    return request({
        url: '/cwgl/estimatedReceivableBill',
        method: 'post',
        data
    })
}
/**
 * 修改预估应收账单
 */
export const updateEstimatedReceivableBill:requestType = (data) => {
    return request({
        url: '/cwgl/estimatedReceivableBill',
        method: 'put',
        data
    })
}
/**
 * 删除预估应收账单
 */
export const delEstimatedReceivableBill:requestType = (id) => {
    return request({
        url: '/cwgl/estimatedReceivableBill/' + id,
        method: 'delete'
    })
}
/**
 * 导出预估应收账单
 */
export const exportEstimatedReceivableBill:requestType = (query) => {
    return new Promise<any>(()=>{
        download('/cwgl/estimatedReceivableBill/export',query);
    })
}
ui/admin-ui3/src/views/cwgl/estimatedReceivableBill/index.vue
New file
@@ -0,0 +1,174 @@
<template>
  <basicContainer >
    <avue-crud
        :option="option"
        :table-loading="pageF.loading"
        :data="tableData"
        :page="page"
        :permission="permissionList"
        :before-open="beforeOpen"
        v-model="form"
        ref="crudRef"
        @row-update="rowUpdate"
        @row-save="rowSave"
        @refresh-change="refreshChange"
        @row-del="rowDel"
        @search-change="searchChange"
        @search-reset="searchReset"
        @selection-change="selectionChange"
        @current-change="currentChange"
        @size-change="sizeChange"
        @on-load="onLoad"
    >
      <template #menu-left>
        <el-button
            type="success"
            icon="Edit"
            :disabled="pageF.single"
            v-hasPermi="['cwgl:estimatedReceivableBill:edit']"
            @click="handleUpdate">修改
        </el-button>
        <el-button
            type="danger"
            icon="Delete"
            :disabled="pageF.multiple"
            @click="handleDelete"
            v-hasPermi="['cwgl:estimatedReceivableBill:remove']"
        >删除
        </el-button>
        <el-button
            type="warning"
            plain
            icon="Download"
            @click="handleExport"
            v-hasPermi="['cwgl:estimatedReceivableBill:export']"
        >导出
        </el-button>
      </template>
    </avue-crud>
  </basicContainer>
</template>
<script setup name="estimatedReceivableBill" lang="ts">
  import {EstimatedReceivableBillI,addEstimatedReceivableBill, delEstimatedReceivableBill, exportEstimatedReceivableBill, getEstimatedReceivableBill, listEstimatedReceivableBill, updateEstimatedReceivableBill} from "@/api/cwgl/estimatedReceivableBill";
  import useCurrentInstance from "@/utils/useCurrentInstance";
  import {computed,reactive, ref, toRefs} from "vue";
  import {PagesInterface, PageQueryInterface} from "@/utils/globalInterface";
  import {usePagePlus} from "@/hooks/usePagePlus";
  import {hasPermission} from "@/utils/permissionUtils";
  const { proxy } = useCurrentInstance();
  const crudRef = ref();
  const permissionList = computed(()=>{
    return {
      addBtn: hasPermission(["cwgl:estimatedReceivableBill:add"]),
      delBtn: hasPermission(["cwgl:estimatedReceivableBill:remove"]),
      editBtn: hasPermission(["cwgl:estimatedReceivableBill:edit"]),
      viewBtn: hasPermission(["cwgl:estimatedReceivableBill:query"]),
    }
  })
  const data = reactive({
    form:<EstimatedReceivableBillI>{},
    queryParams:<EstimatedReceivableBillI&PageQueryInterface>{},
    page: <PagesInterface>{
      pageSize: 10,
      total: 0,
      currentPage: 1,
    },
    selectionList:[],
  })
  const {queryParams,form,page,selectionList} = toRefs(data);
  const option = ref({
    pageKey: 'EstimatedReceivableBill',
    rowKey: 'id',
    column: {
                                id: {
          label: 'ID',
                            },
                                billSystemNo: {
          label: '账单系统编号',
                                rules: [
              {
                required: true,
                message: "账单系统编号不能为空", trigger: "blur" }
            ],                  },
                                billName: {
          label: '账单名称',
                                rules: [
              {
                required: true,
                message: "账单名称不能为空", trigger: "blur" }
            ],                  },
                                customerName: {
          label: '客户名称',
                                rules: [
              {
                required: true,
                message: "客户名称不能为空", trigger: "blur" }
            ],                  },
                                dispatchCount: {
          label: '调度单数量',
                            },
                                totalAmount: {
          label: '应结算金额',
                            },
                                settledAmount: {
          label: '已结算金额',
                            },
                                invoiceStatus: {
          label: '开票状态',
                            },
                                attachment: {
          label: '附件地址',
                      type: 'textarea', minRows: 3, maxRows: 5,
                            },
                                status: {
          label: '状态',
                            },
                                remark: {
          label: '备注',
                      type: 'textarea', minRows: 3, maxRows: 5,
                            },
                                createBy: {
          label: '创建人',
                            },
                                confirmTime: {
          label: '确认时间',
                            },
                                createTime: {
          label: '创建时间',
                            },
                                updateTime: {
          label: '更新时间',
                            },
                                deleted: {
          label: '删除标记(0:正常;1:删除)',
                            },
          }
  })
  const { tableData,pageF,rowSave,rowUpdate,rowDel,beforeOpen,searchChange,
    searchReset,selectionChange,onLoad,currentChange,sizeChange,handleDelete,handleExport,handleUpdate,refreshChange} = usePagePlus({
    form:form,
    option:option,
    queryParams:queryParams,
    idKey:'id',
    page:page.value,
    getListApi:listEstimatedReceivableBill,
    getDetailApi:getEstimatedReceivableBill,
    exportApi:exportEstimatedReceivableBill,
    deleteApi:delEstimatedReceivableBill,
    addApi:addEstimatedReceivableBill,
    updateApi:updateEstimatedReceivableBill,
    handleUpdateFunc:()=>{
      crudRef.value.rowEdit(selectionList.value[0]);
    },
    handleSelectionChangeFunc:(selection:any)=>{
      selectionList.value = selection;
    }
  })
</script>