238 lines
7.2 KiB
C#
238 lines
7.2 KiB
C#
/***********************************************************************
|
||
* Project: CoreCms
|
||
* ProjectName: 核心内容管理系统
|
||
* Web: https://www.corecms.net
|
||
* Author: 大灰灰
|
||
* Email: jianweie@163.com
|
||
* CreateTime: 2025/12/7
|
||
* Description: 收益服务接口
|
||
***********************************************************************/
|
||
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq.Expressions;
|
||
using System.Threading.Tasks;
|
||
using CoreCms.Net.Model.Entities;
|
||
using CoreCms.Net.Model.ViewModels.Basics;
|
||
using CoreCms.Net.Model.ViewModels.UI;
|
||
using SqlSugar;
|
||
|
||
namespace CoreCms.Net.IServices
|
||
{
|
||
/// <summary>
|
||
/// 收益服务接口
|
||
/// </summary>
|
||
public interface ISQEarningsServices : IBaseServices<SQEarningsRecord>
|
||
{
|
||
#region 前端API方法
|
||
|
||
/// <summary>
|
||
/// 获取收益统计信息
|
||
/// </summary>
|
||
/// <param name="userId">用户ID</param>
|
||
/// <returns>待提现收益和已提现收益</returns>
|
||
Task<EarningsSummaryDto> GetEarningsSummaryAsync(int userId);
|
||
|
||
/// <summary>
|
||
/// 获取收益记录列表
|
||
/// </summary>
|
||
/// <param name="userId">用户ID</param>
|
||
/// <param name="pageIndex">页码</param>
|
||
/// <param name="pageSize">每页数量</param>
|
||
/// <returns>收益记录列表</returns>
|
||
Task<List<EarningsRecordDto>> GetEarningsRecordListAsync(int userId, int pageIndex = 1, int pageSize = 20);
|
||
|
||
/// <summary>
|
||
/// 获取提现记录列表
|
||
/// </summary>
|
||
/// <param name="userId">用户ID</param>
|
||
/// <param name="pageIndex">页码</param>
|
||
/// <param name="pageSize">每页数量</param>
|
||
/// <returns>提现记录列表</returns>
|
||
Task<List<WithdrawRecordDto>> GetWithdrawRecordListAsync(int userId, int pageIndex = 1, int pageSize = 20);
|
||
|
||
/// <summary>
|
||
/// 申请提现
|
||
/// </summary>
|
||
/// <param name="userId">用户ID</param>
|
||
/// <param name="amount">提现金额</param>
|
||
/// <returns>操作结果</returns>
|
||
Task<WebApiCallBack> ApplyWithdrawAsync(int userId, decimal amount);
|
||
|
||
#endregion
|
||
|
||
#region 后台管理方法
|
||
|
||
/// <summary>
|
||
/// 添加收益(后台手动添加)
|
||
/// </summary>
|
||
/// <param name="userId">用户ID</param>
|
||
/// <param name="reservationId">预约ID(可为空)</param>
|
||
/// <param name="roomId">房间ID(可为空)</param>
|
||
/// <param name="roomNumber">房号</param>
|
||
/// <param name="roomName">房名</param>
|
||
/// <param name="roomFee">房费</param>
|
||
/// <param name="earnings">收益金额</param>
|
||
/// <param name="type">类型:1=佣金,2=鸽子费</param>
|
||
/// <param name="remark">备注</param>
|
||
/// <param name="operatorId">操作员ID</param>
|
||
/// <returns>操作结果</returns>
|
||
Task<WebApiCallBack> AddEarningsAsync(int userId, int? reservationId, int? roomId, string roomNumber, string roomName, decimal roomFee, decimal earnings, int type, string remark, int operatorId);
|
||
|
||
/// <summary>
|
||
/// 处理提现申请(同意/拒绝/已打款)
|
||
/// </summary>
|
||
/// <param name="withdrawId">提现记录ID</param>
|
||
/// <param name="status">状态:1=已到账,2=已拒绝</param>
|
||
/// <param name="operatorId">操作员ID</param>
|
||
/// <param name="remark">备注</param>
|
||
/// <returns>操作结果</returns>
|
||
Task<WebApiCallBack> ProcessWithdrawAsync(int withdrawId, int status, int operatorId, string remark = null);
|
||
|
||
#endregion
|
||
|
||
#region 重写增删改查操作
|
||
|
||
/// <summary>
|
||
/// 重写异步插入方法
|
||
/// </summary>
|
||
new Task<AdminUiCallBack> InsertAsync(SQEarningsRecord entity);
|
||
|
||
/// <summary>
|
||
/// 重写异步更新方法
|
||
/// </summary>
|
||
new Task<AdminUiCallBack> UpdateAsync(SQEarningsRecord entity);
|
||
|
||
/// <summary>
|
||
/// 重写删除指定ID的数据
|
||
/// </summary>
|
||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||
|
||
/// <summary>
|
||
/// 重写删除指定ID集合的数据(批量删除)
|
||
/// </summary>
|
||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||
|
||
#endregion
|
||
|
||
#region 重写根据条件查询分页数据
|
||
|
||
/// <summary>
|
||
/// 重写根据条件查询分页数据
|
||
/// </summary>
|
||
new Task<IPageList<SQEarningsRecord>> QueryPageAsync(
|
||
Expression<Func<SQEarningsRecord, bool>> predicate,
|
||
Expression<Func<SQEarningsRecord, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||
int pageSize = 20, bool blUseNoLock = false);
|
||
|
||
#endregion
|
||
}
|
||
|
||
#region DTO定义
|
||
|
||
/// <summary>
|
||
/// 收益统计DTO
|
||
/// </summary>
|
||
public class EarningsSummaryDto
|
||
{
|
||
/// <summary>
|
||
/// 待提现收益
|
||
/// </summary>
|
||
public decimal pendingAmount { get; set; }
|
||
|
||
/// <summary>
|
||
/// 已提现收益
|
||
/// </summary>
|
||
public decimal extractedAmount { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 收益记录DTO
|
||
/// </summary>
|
||
public class EarningsRecordDto
|
||
{
|
||
/// <summary>
|
||
/// 记录ID
|
||
/// </summary>
|
||
public int id { get; set; }
|
||
|
||
/// <summary>
|
||
/// 时间
|
||
/// </summary>
|
||
public string date { get; set; }
|
||
|
||
/// <summary>
|
||
/// 房号
|
||
/// </summary>
|
||
public string roomNumber { get; set; }
|
||
|
||
/// <summary>
|
||
/// 房名
|
||
/// </summary>
|
||
public string roomName { get; set; }
|
||
|
||
/// <summary>
|
||
/// 房费
|
||
/// </summary>
|
||
public decimal roomFee { get; set; }
|
||
|
||
/// <summary>
|
||
/// 收益
|
||
/// </summary>
|
||
public decimal earnings { get; set; }
|
||
|
||
/// <summary>
|
||
/// 预约ID
|
||
/// </summary>
|
||
public int? reservationId { get; set; }
|
||
|
||
/// <summary>
|
||
/// 类型:1=佣金,2=鸽子费
|
||
/// </summary>
|
||
public int type { get; set; }
|
||
|
||
/// <summary>
|
||
/// 类型名称
|
||
/// </summary>
|
||
public string typeName { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 提现记录DTO
|
||
/// </summary>
|
||
public class WithdrawRecordDto
|
||
{
|
||
/// <summary>
|
||
/// 记录ID
|
||
/// </summary>
|
||
public int id { get; set; }
|
||
|
||
/// <summary>
|
||
/// 时间
|
||
/// </summary>
|
||
public string date { get; set; }
|
||
|
||
/// <summary>
|
||
/// 提现金额
|
||
/// </summary>
|
||
public decimal amount { get; set; }
|
||
|
||
/// <summary>
|
||
/// 状态:提现中/已到账/已拒绝
|
||
/// </summary>
|
||
public string status { get; set; }
|
||
|
||
/// <summary>
|
||
/// 状态码:0=提现中,1=已到账,2=已拒绝
|
||
/// </summary>
|
||
public int statusCode { get; set; }
|
||
|
||
/// <summary>
|
||
/// 备注
|
||
/// </summary>
|
||
public string remark { get; set; }
|
||
}
|
||
|
||
#endregion
|
||
}
|