添加项目文件。
This commit is contained in:
55
Service/Interface/IBaseService.cs
Normal file
55
Service/Interface/IBaseService.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using Model;
|
||||
using SqlSugar;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Service.Interface
|
||||
{
|
||||
/// <summary>
|
||||
/// 泛型基础服务接口(返回 Result 封装)
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
public interface IBaseService<TEntity> where TEntity : class, new()
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询全部
|
||||
/// </summary>
|
||||
/// <returns>返回包含数据的 Result</returns>
|
||||
Task<Result<List<TEntity>>> GetAllAsync();
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期查询全部
|
||||
/// </summary>
|
||||
/// <param name="startDate">开始日期</param>
|
||||
/// <param name="endDate">结束日期</param>
|
||||
/// <returns>返回包含日期范内的数据的 Result</returns>
|
||||
Task<Result<List<TEntity>>> GetAllAsyncByDate(DateTime? startDate, DateTime? endDate);
|
||||
|
||||
/// <summary>
|
||||
/// 插入单条数据
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns>返回操作是否成功的 Result</returns>
|
||||
Task<Result<bool>> InsertAsync(TEntity entity);
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询
|
||||
/// </summary>
|
||||
/// <param name="pageIndex">页码(从1开始)</param>
|
||||
/// <param name="pageSize">每页数量</param>
|
||||
/// <param name="total">总条数(输出参数)</param>
|
||||
/// <returns>返回包含分页数据的 Result</returns>
|
||||
Task<Result<List<TEntity>>> GetPagedAsync(int pageIndex, int pageSize, RefAsync<int> total);
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询,并根据日期范围进行过滤
|
||||
/// </summary>
|
||||
/// <param name="pageIndex">页码(从1开始)</param>
|
||||
/// <param name="pageSize">每页数量</param>
|
||||
/// <param name="total">总条数(输出参数)</param>
|
||||
/// <param name="startDate">开始日期</param>
|
||||
/// <param name="endDate">结束日期</param>
|
||||
/// <returns>返回包含分页数据的 Result</returns>
|
||||
Task<Result<List<TEntity>>> GetPagedAsync(int pageIndex, int pageSize, RefAsync<int> total, DateTime? startDate, DateTime? endDate);
|
||||
}
|
||||
}
|
||||
32
Service/Interface/IMonitorValueService.cs
Normal file
32
Service/Interface/IMonitorValueService.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Model;
|
||||
using Model.Entity;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Service.Interface
|
||||
{
|
||||
/// <summary>
|
||||
/// 监测数值记录服务接口
|
||||
/// </summary>
|
||||
public interface IMonitorValueService : IBaseService<MonitorValueEntity>
|
||||
{
|
||||
/// <summary>
|
||||
/// 批量插入监测数据(工控高频采样推荐使用,性能远高于单条循环插入)
|
||||
/// </summary>
|
||||
/// <param name="entities">实体集合</param>
|
||||
/// <returns>返回操作是否成功的 Result</returns>
|
||||
Task<Result<bool>> InsertRangeAsync(List<MonitorValueEntity> entities);
|
||||
|
||||
/// <summary>
|
||||
/// 根据监测通道名称,分页查询历史记录
|
||||
/// </summary>
|
||||
/// <param name="monitorName">通道名称(例如:台架1.读取主轴温度)</param>
|
||||
/// <param name="pageIndex">页码</param>
|
||||
/// <param name="pageSize">每页大小</param>
|
||||
/// <param name="total">总条数输出</param>
|
||||
/// <returns>分页数据结果</returns>
|
||||
Task<Result<List<MonitorValueEntity>>> GetPagedByNameAsync(string monitorName, int pageIndex, int pageSize, RefAsync<int> total);
|
||||
}
|
||||
}
|
||||
37
Service/Interface/ITestReportService.cs
Normal file
37
Service/Interface/ITestReportService.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Model;
|
||||
using Model.Entity;
|
||||
using Model.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Service.Interface
|
||||
{
|
||||
public interface ITestReportService:IBaseService<TestReportEntity>
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据TestRoundId获符合的测试步骤
|
||||
/// </summary>
|
||||
/// <param name="TestRoundId">TestRoundId</param>
|
||||
/// <returns>返回符合的TestReportEntity列表</returns>
|
||||
Task<Result<List<TestReportEntity>>> GetByTestRoundIdAsync(Guid TestRoundId);
|
||||
|
||||
/// <summary>
|
||||
/// 根据 TestRoundId 分组,获取唯一记录并按分组统计最大与最小时间
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始日期筛选(可选)</param>
|
||||
/// <param name="endTime">结束日期筛选(可选)</param>
|
||||
/// <param name="scope">台架名称筛选(可选)</param>
|
||||
Task<Result<IList<TestReportModel>>> GetFilterList(DateTime? startTime = null, DateTime? endTime = null, string? scope = null);
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期和台架名称筛选获取完整的测试步骤实体列表(无分组,用于导出)
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始日期筛选(可选)</param>
|
||||
/// <param name="endTime">结束日期筛选(可选)</param>
|
||||
/// <param name="scope">台架名称筛选(可选)</param>
|
||||
Task<Result<List<TestReportEntity>>> GetEntitiesByFilter(DateTime? startTime = null, DateTime? endTime = null, string? scope = null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user