wujianwei
2025-08-07 dbe34e6f7e928435d88f85dbe89e4c76d8e5b3e9
新增预估应收管理前后端
8个文件已添加
1088 ■■■■■ 已修改文件
service/src/main/java/com/ruoyi/cwgl/controller/EstimatedReceivableController.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/EstimatedReceivable.java 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/mapper/EstimatedReceivableMapper.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/IEstimatedReceivableService.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/EstimatedReceivableServiceImpl.java 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/EstimatedReceivableMapper.xml 200 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/api/cwgl/estimatedReceivable.ts 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/views/cwgl/estimatedReceivable/index.vue 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/controller/EstimatedReceivableController.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.EstimatedReceivable;
import com.ruoyi.cwgl.service.IEstimatedReceivableService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
 * 预估应收管理Controller
 *
 * @author ruoyi
 * @date 2025-08-07
 */
@RestController
@RequestMapping("/cwgl/estimatedReceivable")
public class EstimatedReceivableController extends BaseController
{
    @Autowired
    private IEstimatedReceivableService estimatedReceivableService;
    /**
     * 查询预估应收管理列表
     */
    @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivable:list')")
    @GetMapping("/list")
    public TableDataInfo list(EstimatedReceivable estimatedReceivable)
    {
        startPage();
        List<EstimatedReceivable> list = estimatedReceivableService.selectEstimatedReceivableList(estimatedReceivable);
        return getDataTable(list);
    }
    /**
     * 导出预估应收管理列表
     * @param estimatedReceivable 查询条件对象
     */
    @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivable:export')")
    @Log(title = "预估应收管理", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(EstimatedReceivable estimatedReceivable,String exportKey)
    {
        estimatedReceivableService.export(estimatedReceivable,exportKey);
        return AjaxResult.success("导出请求成功,请稍后点击下载...!");
    }
    /**
     * 获取预估应收管理详细信息
     */
    @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivable:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return AjaxResult.success(estimatedReceivableService.selectEstimatedReceivableById(id));
    }
    /**
     * 新增预估应收管理
     */
    @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivable:add')")
    @Log(title = "预估应收管理", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody EstimatedReceivable estimatedReceivable)
    {
        return toAjax(estimatedReceivableService.insertEstimatedReceivable(estimatedReceivable));
    }
    /**
     * 修改预估应收管理
     */
    @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivable:edit')")
    @Log(title = "预估应收管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody EstimatedReceivable estimatedReceivable)
    {
        return toAjax(estimatedReceivableService.updateEstimatedReceivable(estimatedReceivable));
    }
    /**
     * 删除预估应收管理
     */
    @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivable:remove')")
    @Log(title = "预估应收管理", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Integer[] ids)
    {
        return toAjax(estimatedReceivableService.deleteEstimatedReceivableByIds(ids));
    }
}
service/src/main/java/com/ruoyi/cwgl/domain/EstimatedReceivable.java
New file
@@ -0,0 +1,153 @@
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
 *
 * @author ruoyi
 * @date 2025-08-07
 */
@Data
public class EstimatedReceivable{
    /** ID */
        @TableField("id")
    private Integer id;
    /** 费用系统编号 */
    @Excel(name = "费用系统编号")
        @TableField("fee_system_no")
    private String feeSystemNo;
    /** 调度单号 */
    @Excel(name = "调度单号")
        @TableField("dispatch_no")
    private String dispatchNo;
    /** 客户名称 */
    @Excel(name = "客户名称")
        @TableField("customer_name")
    private String customerName;
    /** 项目名称 */
    @Excel(name = "项目名称")
        @TableField("project_name")
    private String projectName;
    /** 下单日期 */
    @Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @TableField("order_date")
    private Date orderDate;
    /** 费用名称 */
    @Excel(name = "费用名称")
        @TableField("fee_name")
    private String feeName;
    /** 预估费用金额 */
    @Excel(name = "预估费用金额")
        @TableField("estimated_amount")
    private BigDecimal estimatedAmount;
    /** 币制 */
    @Excel(name = "币制")
        @TableField("currency")
    private String currency;
    /** 关联账单名称 */
    @Excel(name = "关联账单名称")
        @TableField("related_bill_name")
    private String relatedBillName;
    /** 关联账单状态 */
    @Excel(name = "关联账单状态")
        @TableField("related_bill_status")
    private Integer relatedBillStatus;
    /** 是否确认(0:未确认;1:已确认) */
    @Excel(name = "是否确认(0:未确认;1:已确认)")
        @TableField("is_confirmed")
    private Integer isConfirmed;
    /** 确认人 */
    @Excel(name = "确认人")
        @TableField("confirm_by")
    private String confirmBy;
    /** 确认时间 */
    @Excel(name = "确认时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("confirm_time")
    private Date confirmTime;
    /** 备注 */
    @Excel(name = "备注")
        @TableField("remark")
    private String remark;
    /** 创建人 */
        @TableField("create_by")
    private String createBy;
    /** 更新人 */
        @TableField("update_by")
    private String updateBy;
    /** 创建时间 */
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @TableField("create_time")
    private Date createTime;
    /** 更新时间 */
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @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/EstimatedReceivableMapper.java
New file
@@ -0,0 +1,87 @@
package com.ruoyi.cwgl.mapper;
import java.util.List;
import com.ruoyi.cwgl.domain.EstimatedReceivable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
 * 预估应收管理Mapper接口
 *
 * @author ruoyi
 * @date 2025-08-07
 */
public interface EstimatedReceivableMapper  extends BaseMapper<EstimatedReceivable>
{
    /**
     * 查询预估应收管理
     *
     * @param id 预估应收管理ID
     * @return 预估应收管理
     */
    public EstimatedReceivable selectEstimatedReceivableById(Integer id);
    /**
     * 查询预估应收管理 记录数
     *
     * @param estimatedReceivable 预估应收管理
     * @return 预估应收管理集合
     */
    public int selectEstimatedReceivableCount(EstimatedReceivable estimatedReceivable);
    /**
     * 查询预估应收管理列表
     *
     * @param estimatedReceivable 预估应收管理
     * @return 预估应收管理集合
     */
    public List<EstimatedReceivable> selectEstimatedReceivableList(EstimatedReceivable estimatedReceivable);
    /**
     * 新增预估应收管理
     *
     * @param estimatedReceivable 预估应收管理
     * @return 结果
     */
    public int insertEstimatedReceivable(EstimatedReceivable estimatedReceivable);
    /**
     * 新增预估应收管理[批量]
     *
     * @param estimatedReceivables 预估应收管理
     * @return 结果
     */
    public int insertEstimatedReceivableBatch(List<EstimatedReceivable> estimatedReceivables);
    /**
     * 修改预估应收管理
     *
     * @param estimatedReceivable 预估应收管理
     * @return 结果
     */
    public int updateEstimatedReceivable(EstimatedReceivable estimatedReceivable);
    /**
     * 修改预估应收管理[批量]
     *
     * @param estimatedReceivables 预估应收管理
     * @return 结果
     */
    public int updateEstimatedReceivableBatch(List<EstimatedReceivable> estimatedReceivables);
    /**
     * 删除预估应收管理
     *
     * @param id 预估应收管理ID
     * @return 结果
     */
    public int deleteEstimatedReceivableById(Integer id);
    /**
     * 批量删除预估应收管理
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteEstimatedReceivableByIds(Integer[] ids);
}
service/src/main/java/com/ruoyi/cwgl/service/IEstimatedReceivableService.java
New file
@@ -0,0 +1,102 @@
package com.ruoyi.cwgl.service;
import java.util.List;
import com.ruoyi.cwgl.domain.EstimatedReceivable;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * 预估应收管理Service接口
 *
 * @author ruoyi
 * @date 2025-08-07
 */
public interface IEstimatedReceivableService extends IService<EstimatedReceivable>
{
    /**
     * 查询预估应收管理
     *
     * @param id 预估应收管理ID
     * @return 预估应收管理
     */
    public EstimatedReceivable selectEstimatedReceivableById(Integer id);
    /**
     * 查询预估应收管理 记录数
     *
     * @param estimatedReceivable 预估应收管理
     * @return 预估应收管理集合
     */
    public int selectEstimatedReceivableCount(EstimatedReceivable estimatedReceivable);
    /**
     * 查询预估应收管理列表
     *
     * @param estimatedReceivable 预估应收管理
     * @return 预估应收管理集合
     */
    public List<EstimatedReceivable> selectEstimatedReceivableList(EstimatedReceivable estimatedReceivable);
    /**
     * 查询预估应收管理列表 异步 导出
     *
     * @param estimatedReceivable 预估应收管理
     * @param exportKey 导出功能的唯一标识
     * @return 预估应收管理集合
     */
    public void export(EstimatedReceivable estimatedReceivable, String exportKey) ;
    /**
     * 新增预估应收管理
     *
     * @param estimatedReceivable 预估应收管理
     * @return 结果
     */
    public int insertEstimatedReceivable(EstimatedReceivable estimatedReceivable);
    /**
     * 新增预估应收管理[批量]
     *
     * @param estimatedReceivables 预估应收管理
     * @return 结果
     */
    public int insertEstimatedReceivableBatch(List<EstimatedReceivable> estimatedReceivables);
    /**
     * 修改预估应收管理
     *
     * @param estimatedReceivable 预估应收管理
     * @return 结果
     */
    public int updateEstimatedReceivable(EstimatedReceivable estimatedReceivable);
    /**
     * 修改预估应收管理[批量]
     *
     * @param estimatedReceivables 预估应收管理
     * @return 结果
     */
    public int updateEstimatedReceivableBatch(List<EstimatedReceivable> estimatedReceivables);
    /**
     * 批量删除预估应收管理
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteEstimatedReceivableByIds(String ids);
    /**
     * 批量删除预估应收管理
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteEstimatedReceivableByIds(Integer[] ids);
    /**
     * 删除预估应收管理信息
     *
     * @param id 预估应收管理ID
     * @return 结果
     */
    public int deleteEstimatedReceivableById(Integer id);
}
service/src/main/java/com/ruoyi/cwgl/service/impl/EstimatedReceivableServiceImpl.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.EstimatedReceivableMapper;
import com.ruoyi.cwgl.domain.EstimatedReceivable;
import com.ruoyi.cwgl.service.IEstimatedReceivableService;
import com.ruoyi.common.core.text.Convert;
/**
 * 预估应收管理Service业务层处理
 *
 * @author ruoyi
 * @date 2025-08-07
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class EstimatedReceivableServiceImpl  extends BaseService<EstimatedReceivableMapper, EstimatedReceivable> implements IEstimatedReceivableService
{
    protected final Logger logger = LoggerFactory.getLogger(getClass());
    @Resource
    private EstimatedReceivableMapper estimatedReceivableMapper;
    /**
     * 查询预估应收管理
     *
     * @param id 预估应收管理ID
     * @return 预估应收管理
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public EstimatedReceivable selectEstimatedReceivableById(Integer id)
    {
        return estimatedReceivableMapper.selectEstimatedReceivableById(id);
    }
    /**
     * 查询预估应收管理 记录数
     *
     * @param estimatedReceivable 预估应收管理
     * @return 预估应收管理集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public int selectEstimatedReceivableCount(EstimatedReceivable estimatedReceivable)
    {
        return estimatedReceivableMapper.selectEstimatedReceivableCount(estimatedReceivable);
    }
    /**
     * 查询预估应收管理列表
     *
     * @param estimatedReceivable 预估应收管理
     * @return 预估应收管理
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<EstimatedReceivable> selectEstimatedReceivableList(EstimatedReceivable estimatedReceivable)
    {
        return estimatedReceivableMapper.selectEstimatedReceivableList(estimatedReceivable);
    }
    /**
     * 查询预估应收管理列表 异步 导出
     *
     * @param estimatedReceivable 预估应收管理
     * @param exportKey 导出功能的唯一标识
     * @return 预估应收管理集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Async
    @Override
    public void export(EstimatedReceivable estimatedReceivable,String exportKey) {
        super.export(EstimatedReceivable.class,exportKey,"estimatedReceivableData",(pageNum)->{
            PageUtils.startPage(pageNum, Constants.EXPORT_PATE_SIZE);
            return selectEstimatedReceivableList(estimatedReceivable);
        });
    }
    /**
     * 新增预估应收管理
     *
     * @param estimatedReceivable 预估应收管理
     * @return 结果
     */
    @Override
    public int insertEstimatedReceivable(EstimatedReceivable estimatedReceivable)
    {
        estimatedReceivable.setCreateTime(DateUtils.getNowDate());
        return estimatedReceivableMapper.insertEstimatedReceivable(estimatedReceivable);
    }
    /**
     * 新增预估应收管理[批量]
     *
     * @param estimatedReceivables 预估应收管理
     * @return 结果
     */
    @Override
    public int insertEstimatedReceivableBatch(List<EstimatedReceivable> estimatedReceivables)
    {
        int rows = estimatedReceivableMapper.insertEstimatedReceivableBatch(estimatedReceivables);
        return rows;
    }
    /**
     * 修改预估应收管理
     *
     * @param estimatedReceivable 预估应收管理
     * @return 结果
     */
    @Override
    public int updateEstimatedReceivable(EstimatedReceivable estimatedReceivable)
    {
        estimatedReceivable.setUpdateTime(DateUtils.getNowDate());
        return estimatedReceivableMapper.updateEstimatedReceivable(estimatedReceivable);
    }
    /**
     * 修改预估应收管理[批量]
     *
     * @param estimatedReceivables 预估应收管理
     * @return 结果
     */
    @Override
    public int updateEstimatedReceivableBatch(List<EstimatedReceivable> estimatedReceivables){
        return estimatedReceivableMapper.updateEstimatedReceivableBatch(estimatedReceivables);
    }
    /**
     * 删除预估应收管理对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteEstimatedReceivableByIds(String ids)
    {
        return deleteEstimatedReceivableByIds(Convert.toIntArray(ids));
    }
    /**
     * 删除预估应收管理对象
     *
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteEstimatedReceivableByIds(Integer[] ids)
    {
        return estimatedReceivableMapper.deleteEstimatedReceivableByIds(ids);
    }
    /**
     * 删除预估应收管理信息
     *
     * @param id 预估应收管理ID
     * @return 结果
     */
    @Override
    public int deleteEstimatedReceivableById(Integer id)
    {
        return estimatedReceivableMapper.deleteEstimatedReceivableById(id);
    }
}
service/src/main/resources/mapper/cwgl/EstimatedReceivableMapper.xml
New file
@@ -0,0 +1,200 @@
<?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.EstimatedReceivableMapper">
    <resultMap type="com.ruoyi.cwgl.domain.EstimatedReceivable" id="EstimatedReceivableResult">
        <result property="id"    column="id"    />
        <result property="feeSystemNo"    column="fee_system_no"    />
        <result property="dispatchNo"    column="dispatch_no"    />
        <result property="customerName"    column="customer_name"    />
        <result property="projectName"    column="project_name"    />
        <result property="orderDate"    column="order_date"    />
        <result property="feeName"    column="fee_name"    />
        <result property="estimatedAmount"    column="estimated_amount"    />
        <result property="currency"    column="currency"    />
        <result property="relatedBillName"    column="related_bill_name"    />
        <result property="relatedBillStatus"    column="related_bill_status"    />
        <result property="isConfirmed"    column="is_confirmed"    />
        <result property="confirmBy"    column="confirm_by"    />
        <result property="confirmTime"    column="confirm_time"    />
        <result property="remark"    column="remark"    />
        <result property="createBy"    column="create_by"    />
        <result property="updateBy"    column="update_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="deleted"    column="deleted"    />
    </resultMap>
    <sql id="selectEstimatedReceivableVo">
        select thisTab.id, thisTab.fee_system_no, thisTab.dispatch_no, thisTab.customer_name, thisTab.project_name, thisTab.order_date, thisTab.fee_name, thisTab.estimated_amount, thisTab.currency, thisTab.related_bill_name, thisTab.related_bill_status, thisTab.is_confirmed, thisTab.confirm_by, thisTab.confirm_time, thisTab.remark, thisTab.create_by, thisTab.update_by, thisTab.create_time, thisTab.update_time, thisTab.deleted from estimated_receivable AS thisTab
    </sql>
    <sql id="selectEstimatedReceivableVoCount">
        select count(0) from estimated_receivable as thisTab
    </sql>
    <sql id="whereCondition">
        <if test="feeSystemNo != null  and feeSystemNo != ''"> and thisTab.fee_system_no = #{feeSystemNo}</if>
        <if test="dispatchNo != null  and dispatchNo != ''"> and thisTab.dispatch_no = #{dispatchNo}</if>
        <if test="customerName != null  and customerName != ''"> and  thisTab.customer_name like concat('%', #{customerName}, '%')</if>
        <if test="projectName != null  and projectName != ''"> and  thisTab.project_name like concat('%', #{projectName}, '%')</if>
        <if test="orderDate != null "> and thisTab.order_date = #{orderDate}</if>
        <if test="feeName != null  and feeName != ''"> and  thisTab.fee_name like concat('%', #{feeName}, '%')</if>
        <if test="estimatedAmount != null "> and thisTab.estimated_amount = #{estimatedAmount}</if>
        <if test="currency != null  and currency != ''"> and thisTab.currency = #{currency}</if>
        <if test="relatedBillName != null  and relatedBillName != ''"> and  thisTab.related_bill_name like concat('%', #{relatedBillName}, '%')</if>
        <if test="relatedBillStatus != null "> and thisTab.related_bill_status = #{relatedBillStatus}</if>
        <if test="isConfirmed != null "> and thisTab.is_confirmed = #{isConfirmed}</if>
        <if test="confirmBy != null  and confirmBy != ''"> and thisTab.confirm_by = #{confirmBy}</if>
        <if test="confirmTime != null "> and thisTab.confirm_time = #{confirmTime}</if>
        <if test="deleted != null "> and thisTab.deleted = #{deleted}</if>
    </sql>
    <!--查询-->
    <select id="selectEstimatedReceivableById" parameterType="Integer" resultMap="EstimatedReceivableResult">
        <include refid="selectEstimatedReceivableVo"/>
        where id = #{id}
    </select>
    <select id="selectEstimatedReceivableCount" parameterType="com.ruoyi.cwgl.domain.EstimatedReceivable" resultType="int">
        <include refid="selectEstimatedReceivableVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
    <select id="selectEstimatedReceivableList" parameterType="com.ruoyi.cwgl.domain.EstimatedReceivable" resultMap="EstimatedReceivableResult">
        <include refid="selectEstimatedReceivableVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
    <!-- 新增 -->
    <insert id="insertEstimatedReceivable" parameterType="com.ruoyi.cwgl.domain.EstimatedReceivable"  useGeneratedKeys="true" keyProperty="id">
        insert into estimated_receivable
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="feeSystemNo != null and feeSystemNo != ''">fee_system_no,</if>
            <if test="dispatchNo != null and dispatchNo != ''">dispatch_no,</if>
            <if test="customerName != null and customerName != ''">customer_name,</if>
            <if test="projectName != null">project_name,</if>
            <if test="orderDate != null">order_date,</if>
            <if test="feeName != null and feeName != ''">fee_name,</if>
            <if test="estimatedAmount != null">estimated_amount,</if>
            <if test="currency != null">currency,</if>
            <if test="relatedBillName != null">related_bill_name,</if>
            <if test="relatedBillStatus != null">related_bill_status,</if>
            <if test="isConfirmed != null">is_confirmed,</if>
            <if test="confirmBy != null">confirm_by,</if>
            <if test="confirmTime != null">confirm_time,</if>
            <if test="remark != null">remark,</if>
            <if test="createBy != null">create_by,</if>
            <if test="updateBy != null">update_by,</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="feeSystemNo != null and feeSystemNo != ''">#{feeSystemNo},</if>
            <if test="dispatchNo != null and dispatchNo != ''">#{dispatchNo},</if>
            <if test="customerName != null and customerName != ''">#{customerName},</if>
            <if test="projectName != null">#{projectName},</if>
            <if test="orderDate != null">#{orderDate},</if>
            <if test="feeName != null and feeName != ''">#{feeName},</if>
            <if test="estimatedAmount != null">#{estimatedAmount},</if>
            <if test="currency != null">#{currency},</if>
            <if test="relatedBillName != null">#{relatedBillName},</if>
            <if test="relatedBillStatus != null">#{relatedBillStatus},</if>
            <if test="isConfirmed != null">#{isConfirmed},</if>
            <if test="confirmBy != null">#{confirmBy},</if>
            <if test="confirmTime != null">#{confirmTime},</if>
            <if test="remark != null">#{remark},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="deleted != null">#{deleted},</if>
         </trim>
    </insert>
    <insert id="insertEstimatedReceivableBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into estimated_receivable
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,fee_system_no,dispatch_no,customer_name,project_name,order_date,fee_name,estimated_amount,currency,related_bill_name,related_bill_status,is_confirmed,confirm_by,confirm_time,remark,create_by,update_by,create_time,update_time,deleted,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.feeSystemNo},#{item.dispatchNo},#{item.customerName},#{item.projectName},#{item.orderDate},#{item.feeName},#{item.estimatedAmount},#{item.currency},#{item.relatedBillName},#{item.relatedBillStatus},#{item.isConfirmed},#{item.confirmBy},#{item.confirmTime},#{item.remark},#{item.createBy},#{item.updateBy},#{item.createTime},#{item.updateTime},#{item.deleted},
            </trim>
        </foreach>
    </insert>
    <!-- 修改 -->
    <update id="updateEstimatedReceivable" parameterType="com.ruoyi.cwgl.domain.EstimatedReceivable">
        update estimated_receivable
        <trim prefix="SET" suffixOverrides=",">
            <if test="feeSystemNo != null and feeSystemNo != ''">fee_system_no = #{feeSystemNo},</if>
            <if test="dispatchNo != null and dispatchNo != ''">dispatch_no = #{dispatchNo},</if>
            <if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
            <if test="projectName != null">project_name = #{projectName},</if>
            <if test="orderDate != null">order_date = #{orderDate},</if>
            <if test="feeName != null and feeName != ''">fee_name = #{feeName},</if>
            <if test="estimatedAmount != null">estimated_amount = #{estimatedAmount},</if>
            <if test="currency != null">currency = #{currency},</if>
            <if test="relatedBillName != null">related_bill_name = #{relatedBillName},</if>
            <if test="relatedBillStatus != null">related_bill_status = #{relatedBillStatus},</if>
            <if test="isConfirmed != null">is_confirmed = #{isConfirmed},</if>
            <if test="confirmBy != null">confirm_by = #{confirmBy},</if>
            <if test="confirmTime != null">confirm_time = #{confirmTime},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="updateBy != null">update_by = #{updateBy},</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="updateEstimatedReceivableBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update estimated_receivable
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.feeSystemNo != null and item.feeSystemNo != ''">fee_system_no = #{item.feeSystemNo},</if>
                <if test="item.dispatchNo != null and item.dispatchNo != ''">dispatch_no = #{item.dispatchNo},</if>
                <if test="item.customerName != null and item.customerName != ''">customer_name = #{item.customerName},</if>
                <if test="item.projectName != null">project_name = #{item.projectName},</if>
                <if test="item.orderDate != null">order_date = #{item.orderDate},</if>
                <if test="item.feeName != null and item.feeName != ''">fee_name = #{item.feeName},</if>
                <if test="item.estimatedAmount != null">estimated_amount = #{item.estimatedAmount},</if>
                <if test="item.currency != null">currency = #{item.currency},</if>
                <if test="item.relatedBillName != null">related_bill_name = #{item.relatedBillName},</if>
                <if test="item.relatedBillStatus != null">related_bill_status = #{item.relatedBillStatus},</if>
                <if test="item.isConfirmed != null">is_confirmed = #{item.isConfirmed},</if>
                <if test="item.confirmBy != null">confirm_by = #{item.confirmBy},</if>
                <if test="item.confirmTime != null">confirm_time = #{item.confirmTime},</if>
                <if test="item.remark != null">remark = #{item.remark},</if>
                <if test="item.createBy != null">create_by = #{item.createBy},</if>
                <if test="item.updateBy != null">update_by = #{item.updateBy},</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="deleteEstimatedReceivableById" parameterType="Integer">
        delete from estimated_receivable where id = #{id}
    </delete>
    <delete id="deleteEstimatedReceivableByIds" parameterType="Integer">
        delete from estimated_receivable where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
ui/admin-ui3/src/api/cwgl/estimatedReceivable.ts
New file
@@ -0,0 +1,67 @@
import request,{download,requestType} from "@/utils/request";
import {BaseEntityInterface} from "@/utils/globalInterface";
export interface EstimatedReceivableI extends BaseEntityInterface{
            id ?:  number   ,            feeSystemNo ?:  string   ,            dispatchNo ?:  string   ,            customerName ?:  string   ,            projectName ?:  string   ,            orderDate ?:  string   ,            feeName ?:  string   ,            estimatedAmount ?:  string   ,            currency ?:  string   ,            relatedBillName ?:  string   ,            relatedBillStatus ?:  number   ,            isConfirmed ?:  number   ,            confirmBy ?:  string   ,            confirmTime ?:  string   ,            remark ?:  string   ,            createBy ?:  string   ,            updateBy ?:  string   ,            createTime ?:  string   ,            updateTime ?:  string   ,            deleted ?:  number       }
/**
 * 查询预估应收管理列表
 */
export const listEstimatedReceivable:requestType = (query) => {
    return request({
        url: '/cwgl/estimatedReceivable/list',
        method:'get',
        params:query
    })
}
/**
 * 查询预估应收管理详细
 */
export const getEstimatedReceivable:requestType = (id) => {
    return request({
        url: '/cwgl/estimatedReceivable/' + id,
        method:'get'
    })
}
/**
 * 新增预估应收管理
 */
export const addEstimatedReceivable:requestType = (data) => {
    return request({
        url: '/cwgl/estimatedReceivable',
        method: 'post',
        data
    })
}
/**
 * 修改预估应收管理
 */
export const updateEstimatedReceivable:requestType = (data) => {
    return request({
        url: '/cwgl/estimatedReceivable',
        method: 'put',
        data
    })
}
/**
 * 删除预估应收管理
 */
export const delEstimatedReceivable:requestType = (id) => {
    return request({
        url: '/cwgl/estimatedReceivable/' + id,
        method: 'delete'
    })
}
/**
 * 导出预估应收管理
 */
export const exportEstimatedReceivable:requestType = (query) => {
    return new Promise<any>(()=>{
        download('/cwgl/estimatedReceivable/export',query);
    })
}
ui/admin-ui3/src/views/cwgl/estimatedReceivable/index.vue
New file
@@ -0,0 +1,189 @@
<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:estimatedReceivable:edit']"
            @click="handleUpdate">修改
        </el-button>
        <el-button
            type="danger"
            icon="Delete"
            :disabled="pageF.multiple"
            @click="handleDelete"
            v-hasPermi="['cwgl:estimatedReceivable:remove']"
        >删除
        </el-button>
        <el-button
            type="warning"
            plain
            icon="Download"
            @click="handleExport"
            v-hasPermi="['cwgl:estimatedReceivable:export']"
        >导出
        </el-button>
      </template>
    </avue-crud>
  </basicContainer>
</template>
<script setup name="estimatedReceivable" lang="ts">
  import {EstimatedReceivableI,addEstimatedReceivable, delEstimatedReceivable, exportEstimatedReceivable, getEstimatedReceivable, listEstimatedReceivable, updateEstimatedReceivable} from "@/api/cwgl/estimatedReceivable";
  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:estimatedReceivable:add"]),
      delBtn: hasPermission(["cwgl:estimatedReceivable:remove"]),
      editBtn: hasPermission(["cwgl:estimatedReceivable:edit"]),
      viewBtn: hasPermission(["cwgl:estimatedReceivable:query"]),
    }
  })
  const data = reactive({
    form:<EstimatedReceivableI>{},
    queryParams:<EstimatedReceivableI&PageQueryInterface>{},
    page: <PagesInterface>{
      pageSize: 10,
      total: 0,
      currentPage: 1,
    },
    selectionList:[],
  })
  const {queryParams,form,page,selectionList} = toRefs(data);
  const option = ref({
    pageKey: 'EstimatedReceivable',
    rowKey: 'id',
    column: {
                                id: {
          label: 'ID',
                            },
                                feeSystemNo: {
          label: '费用系统编号',
                                rules: [
              {
                required: true,
                message: "费用系统编号不能为空", trigger: "blur" }
            ],                  },
                                dispatchNo: {
          label: '调度单号',
                                rules: [
              {
                required: true,
                message: "调度单号不能为空", trigger: "blur" }
            ],                  },
                                customerName: {
          label: '客户名称',
                                rules: [
              {
                required: true,
                message: "客户名称不能为空", trigger: "blur" }
            ],                  },
                                projectName: {
          label: '项目名称',
                            },
                                orderDate: {
          label: '下单日期',
                            },
                                feeName: {
          label: '费用名称',
                                rules: [
              {
                required: true,
                message: "费用名称不能为空", trigger: "blur" }
            ],                  },
                                estimatedAmount: {
          label: '预估费用金额',
                            },
                                currency: {
          label: '币制',
                            },
                                relatedBillName: {
          label: '关联账单名称',
                            },
                                relatedBillStatus: {
          label: '关联账单状态',
                            },
                                isConfirmed: {
          label: '是否确认(0:未确认;1:已确认)',
                            },
                                confirmBy: {
          label: '确认人',
                            },
                                confirmTime: {
          label: '确认时间',
                            },
                                remark: {
          label: '备注',
                      type: 'textarea', minRows: 3, maxRows: 5,
                            },
                                createBy: {
          label: '创建人',
                            },
                                updateBy: {
          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:listEstimatedReceivable,
    getDetailApi:getEstimatedReceivable,
    exportApi:exportEstimatedReceivable,
    deleteApi:delEstimatedReceivable,
    addApi:addEstimatedReceivable,
    updateApi:updateEstimatedReceivable,
    handleUpdateFunc:()=>{
      crudRef.value.rowEdit(selectionList.value[0]);
    },
    handleSelectionChangeFunc:(selection:any)=>{
      selectionList.value = selection;
    }
  })
</script>