上传源代码版本
This commit is contained in:
38
Bak/DAL/interfaces/IArrivalHandoverFormRepository.cs
Normal file
38
Bak/DAL/interfaces/IArrivalHandoverFormRepository.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
public interface IArrivalHandoverFormRepository
|
||||
{
|
||||
Task<int> InsertAsync(ArrivalHandoverFormEntity form);
|
||||
Task<ArrivalHandoverFormEntity> GetByIdAsync(int id);
|
||||
Task<ArrivalHandoverFormEntity> GetByHandoverNumberAsync(string handoverNumber);
|
||||
Task<List<ArrivalHandoverFormEntity>> GetAllAsync();
|
||||
Task<int> UpdateAsync(ArrivalHandoverFormEntity form);
|
||||
Task<int> DeleteAsync(int id);
|
||||
Task<bool> ExistsByHandoverNumberAsync(string handoverNumber);
|
||||
/// <summary>
|
||||
/// 批量获取到货交接单(分页)
|
||||
/// </summary>
|
||||
/// <param name="page">页码</param>
|
||||
/// <param name="pageSize">每页数量</param>
|
||||
/// <param name="sortBy">排序字段</param>
|
||||
/// <param name="sortOrder">排序方向</param>
|
||||
/// <param name="handoverNumber">交接单号</param>
|
||||
/// <param name="creator">创建人</param>
|
||||
/// <param name="startDate">开始日期</param>
|
||||
/// <param name="endDate">结束日期</param>
|
||||
/// <returns>到货交接单列表和总记录数</returns>
|
||||
Task<(List<ArrivalHandoverFormEntity> Forms, int TotalCount)> GetArrivalHandoverFormsBatchAsync(
|
||||
int page,
|
||||
int pageSize,
|
||||
string sortBy,
|
||||
string sortOrder,
|
||||
string handoverNumber,
|
||||
string creator,
|
||||
DateTime? startDate = null,
|
||||
DateTime? endDate = null);
|
||||
}
|
||||
}
|
||||
47
Bak/DAL/interfaces/IBagTagRepository.cs
Normal file
47
Bak/DAL/interfaces/IBagTagRepository.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
using SqlSugar;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
public interface IBagTagRepository
|
||||
{
|
||||
Task<int> InsertAsync(BagTagEntity tag);
|
||||
Task<BagTagEntity> GetByIdAsync(int id);
|
||||
Task<BagTagEntity> GetByTagNumberAsync(string tagNumber);
|
||||
Task<List<BagTagEntity>> GetAllAsync();
|
||||
Task<int> UpdateAsync(BagTagEntity tag);
|
||||
Task<int> InsertWaybillAsync(BagTagWaybillEntity waybill);
|
||||
Task<List<MDL.DTOs.BagTagWaybillWithDetailsDto>> GetWaybillsByTagNumberAsync(string tagNumber);
|
||||
|
||||
Task<bool> ExistsByTagNumberAsync(string tagNumber);
|
||||
|
||||
Task<bool> IsWaybillAssociatedAsync(string tagNumber, string finalMileTrackingNumber);
|
||||
|
||||
Task<(List<BagTagEntity> BagTags, int TotalCount)> GetBagTagsBatchAsync(
|
||||
int page,
|
||||
int pageSize,
|
||||
string sortBy,
|
||||
string sortOrder,
|
||||
string tagNumber,
|
||||
string channel,
|
||||
string status,
|
||||
string creator);
|
||||
|
||||
Task<int> RemoveWaybillAssociationAsync(string tagNumber, string finalMileTrackingNumber);
|
||||
Task<BagTagWaybillEntity> GetWaybillAssociationAsync(string finalMileTrackingNumber);
|
||||
Task<bool> IsWaybillAssociatedAnywhereAsync(string finalMileTrackingNumber);
|
||||
Task<List<BagTagEntity>> GetAvailableBagTagsByChannelAsync(string channel);
|
||||
|
||||
/// <summary>
|
||||
/// 查询符合条件的 USPS 包裹
|
||||
/// </summary>
|
||||
Task<List<string>> GetEligibleUspsWaybillsAsync(DateTime cutoffTime);
|
||||
|
||||
/// <summary>
|
||||
/// 获取符合条件的包裹数量
|
||||
/// </summary>
|
||||
Task<int> GetEligibleUspsWaybillCountAsync(DateTime cutoffTime);
|
||||
}
|
||||
}
|
||||
50
Bak/DAL/interfaces/ICargoDataRepository.cs
Normal file
50
Bak/DAL/interfaces/ICargoDataRepository.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// 货物数据仓库接口
|
||||
/// </summary>
|
||||
public interface ICargoDataRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 批量插入货物数据
|
||||
/// </summary>
|
||||
/// <param name="cargoDataList">货物数据列表</param>
|
||||
/// <returns>插入成功的记录数</returns>
|
||||
Task<int> BatchInsertAsync(List<CargoDataEntity> cargoDataList);
|
||||
|
||||
/// <summary>
|
||||
/// 根据中性面单单号查询货物数据
|
||||
/// </summary>
|
||||
/// <param name="neutralWaybillNumber">中性面单单号</param>
|
||||
/// <returns>货物数据实体</returns>
|
||||
Task<CargoDataEntity?> GetByWaybillNumberAsync(string neutralWaybillNumber);
|
||||
|
||||
/// <summary>
|
||||
/// 查询货物数据
|
||||
/// </summary>
|
||||
/// <param name="searchKey">搜索关键字(中性面单/提单号/大包号)</param>
|
||||
/// <param name="customerId">客户ID(可选)</param>
|
||||
/// <param name="pageIndex">页码(默认1)</param>
|
||||
/// <param name="pageSize">每页记录数(默认100)</param>
|
||||
/// <returns>货物数据列表</returns>
|
||||
Task<IEnumerable<CargoDataEntity>> QueryAsync(string? searchKey = null, int? customerId = null, int pageIndex = 1, int pageSize = 100);
|
||||
|
||||
/// <summary>
|
||||
/// 按中性面单单号批量更新货物数据
|
||||
/// </summary>
|
||||
/// <param name="cargoDataList">货物数据列表</param>
|
||||
/// <returns>更新成功的记录数</returns>
|
||||
Task<int> BatchUpdateByWaybillNumberAsync(List<CargoDataEntity> cargoDataList);
|
||||
|
||||
/// <summary>
|
||||
/// 按中性面单单号批量删除货物数据
|
||||
/// </summary>
|
||||
/// <param name="neutralWaybillNumbers">中性面单单号列表</param>
|
||||
/// <returns>删除成功的记录数</returns>
|
||||
Task<int> BatchDeleteByWaybillNumbersAsync(List<string> neutralWaybillNumbers);
|
||||
}
|
||||
}
|
||||
83
Bak/DAL/interfaces/ICustomerApiRepository.cs
Normal file
83
Bak/DAL/interfaces/ICustomerApiRepository.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户API信息的数据访问接口
|
||||
/// </summary>
|
||||
public interface ICustomerApiRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建客户API记录
|
||||
/// </summary>
|
||||
/// <param name="entity">客户API实体</param>
|
||||
/// <returns>创建的记录ID</returns>
|
||||
Task<int> CreateAsync(CustomerApiEntity entity);
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID获取客户API记录
|
||||
/// </summary>
|
||||
/// <param name="id">记录ID</param>
|
||||
/// <returns>客户API实体</returns>
|
||||
Task<CustomerApiEntity?> GetByIdAsync(int id);
|
||||
|
||||
/// <summary>
|
||||
/// 根据客户ID获取客户API记录
|
||||
/// </summary>
|
||||
/// <param name="customerId">客户ID</param>
|
||||
/// <returns>客户API实体列表</returns>
|
||||
Task<List<CustomerApiEntity>> GetByCustomerIdAsync(int customerId);
|
||||
|
||||
/// <summary>
|
||||
/// 根据客户代码获取客户API记录
|
||||
/// </summary>
|
||||
/// <param name="customerCode">客户代码</param>
|
||||
/// <returns>客户API实体列表</returns>
|
||||
Task<List<CustomerApiEntity>> GetByCustomerCodeAsync(string customerCode);
|
||||
|
||||
/// <summary>
|
||||
/// 根据API密钥获取客户API记录
|
||||
/// </summary>
|
||||
/// <param name="apiKey">API密钥</param>
|
||||
/// <returns>客户API实体</returns>
|
||||
Task<CustomerApiEntity?> GetByApiKeyAsync(string apiKey);
|
||||
|
||||
/// <summary>
|
||||
/// 验证客户API凭证并返回客户API信息
|
||||
/// </summary>
|
||||
/// <param name="customerCode">客户代码</param>
|
||||
/// <param name="apiKey">API密钥</param>
|
||||
/// <returns>客户API实体,如果验证失败则返回null</returns>
|
||||
Task<CustomerApiEntity?> ValidateAndGetApiCredentialsAsync(string customerCode, string apiKey);
|
||||
|
||||
/// <summary>
|
||||
/// 验证客户API凭证
|
||||
/// </summary>
|
||||
/// <param name="customerCode">客户代码</param>
|
||||
/// <param name="apiKey">API密钥</param>
|
||||
/// <returns>是否验证通过</returns>
|
||||
Task<bool> ValidateApiCredentialsAsync(string customerCode, string apiKey);
|
||||
|
||||
/// <summary>
|
||||
/// 更新客户API记录
|
||||
/// </summary>
|
||||
/// <param name="entity">客户API实体</param>
|
||||
/// <returns>更新是否成功</returns>
|
||||
Task<bool> UpdateAsync(CustomerApiEntity entity);
|
||||
|
||||
/// <summary>
|
||||
/// 删除客户API记录
|
||||
/// </summary>
|
||||
/// <param name="id">记录ID</param>
|
||||
/// <returns>删除是否成功</returns>
|
||||
Task<bool> DeleteAsync(int id);
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有客户API记录
|
||||
/// </summary>
|
||||
/// <returns>客户API实体列表</returns>
|
||||
Task<List<CustomerApiEntity>> GetAllAsync();
|
||||
}
|
||||
}
|
||||
67
Bak/DAL/interfaces/ICustomerRepository.cs
Normal file
67
Bak/DAL/interfaces/ICustomerRepository.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户资料的数据访问接口
|
||||
/// </summary>
|
||||
public interface ICustomerRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建客户记录
|
||||
/// </summary>
|
||||
/// <param name="entity">客户实体</param>
|
||||
/// <returns>创建的记录ID</returns>
|
||||
Task<int> CreateAsync(CustomerEntity entity);
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID获取客户记录
|
||||
/// </summary>
|
||||
/// <param name="id">记录ID</param>
|
||||
/// <returns>客户实体</returns>
|
||||
Task<CustomerEntity?> GetByIdAsync(int id);
|
||||
|
||||
/// <summary>
|
||||
/// 根据客户代码获取客户记录
|
||||
/// </summary>
|
||||
/// <param name="customerCode">客户代码</param>
|
||||
/// <returns>客户实体</returns>
|
||||
Task<CustomerEntity?> GetByCustomerCodeAsync(string customerCode);
|
||||
|
||||
/// <summary>
|
||||
/// 更新客户记录
|
||||
/// </summary>
|
||||
/// <param name="entity">客户实体</param>
|
||||
/// <returns>更新是否成功</returns>
|
||||
Task<bool> UpdateAsync(CustomerEntity entity);
|
||||
|
||||
/// <summary>
|
||||
/// 删除客户记录
|
||||
/// </summary>
|
||||
/// <param name="id">记录ID</param>
|
||||
/// <returns>删除是否成功</returns>
|
||||
Task<bool> DeleteAsync(int id);
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有客户记录
|
||||
/// </summary>
|
||||
/// <returns>客户实体列表</returns>
|
||||
Task<List<CustomerEntity>> GetAllAsync();
|
||||
|
||||
/// <summary>
|
||||
/// 检查客户是否存在
|
||||
/// </summary>
|
||||
/// <param name="customerCode">客户代码</param>
|
||||
/// <returns>是否存在</returns>
|
||||
Task<bool> ExistsAsync(string customerCode);
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID列表批量获取客户记录
|
||||
/// </summary>
|
||||
/// <param name="ids">ID列表</param>
|
||||
/// <returns>客户实体列表</returns>
|
||||
Task<List<CustomerEntity>> GetByIdsAsync(List<int> ids);
|
||||
}
|
||||
}
|
||||
72
Bak/DAL/interfaces/ILabelPdfCacheRepository.cs
Normal file
72
Bak/DAL/interfaces/ILabelPdfCacheRepository.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// 面单PDF缓存的数据访问接口
|
||||
/// </summary>
|
||||
public interface ILabelPdfCacheRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据中性面单单号获取缓存记录
|
||||
/// </summary>
|
||||
/// <param name="waybillNumber">中性面单单号</param>
|
||||
/// <returns>缓存记录实体</returns>
|
||||
Task<LabelPdfCache?> GetByWaybillNumberAsync(string waybillNumber);
|
||||
|
||||
/// <summary>
|
||||
/// 创建缓存记录
|
||||
/// </summary>
|
||||
/// <param name="entity">缓存实体</param>
|
||||
/// <returns>创建的记录ID</returns>
|
||||
Task<long> CreateAsync(LabelPdfCache entity);
|
||||
|
||||
/// <summary>
|
||||
/// 更新缓存记录
|
||||
/// </summary>
|
||||
/// <param name="entity">缓存实体</param>
|
||||
/// <returns>更新是否成功</returns>
|
||||
Task<bool> UpdateAsync(LabelPdfCache entity);
|
||||
|
||||
/// <summary>
|
||||
/// 标记缓存为失效状态
|
||||
/// </summary>
|
||||
/// <param name="waybillNumber">中性面单单号</param>
|
||||
/// <returns>操作是否成功</returns>
|
||||
Task<bool> InvalidateCacheAsync(string waybillNumber);
|
||||
|
||||
/// <summary>
|
||||
/// 获取待处理的缓存任务列表
|
||||
/// </summary>
|
||||
/// <param name="maxRetryCount">最大重试次数</param>
|
||||
/// <param name="limit">最大返回数量</param>
|
||||
/// <returns>待处理的缓存任务列表</returns>
|
||||
Task<List<LabelPdfCache>> GetPendingTasksAsync(int maxRetryCount, int limit);
|
||||
|
||||
/// <summary>
|
||||
/// 获取订单表中新的有标签订单(缓存表中不存在的)
|
||||
/// </summary>
|
||||
/// <param name="limit">最大返回数量</param>
|
||||
/// <returns>新订单的面单号列表</returns>
|
||||
Task<List<string>> GetNewOrdersWithLabelsAsync(int limit);
|
||||
|
||||
/// <summary>
|
||||
/// 获取需要重新处理的失效缓存列表
|
||||
/// </summary>
|
||||
/// <param name="limit">最大返回数量</param>
|
||||
/// <returns>失效的缓存记录列表</returns>
|
||||
Task<List<LabelPdfCache>> GetInvalidCachesAsync(int limit);
|
||||
|
||||
/// <summary>
|
||||
/// 异步更新条码信息
|
||||
/// </summary>
|
||||
/// <param name="waybillNumber">中性面单单号</param>
|
||||
/// <param name="barcodeNumber">条码号</param>
|
||||
/// <param name="barcodeType">条码类型</param>
|
||||
/// <param name="confidence">识别置信度</param>
|
||||
/// <returns>更新是否成功</returns>
|
||||
Task<bool> UpdateBarcodeInfoAsync(string waybillNumber, string barcodeNumber, byte barcodeType, int confidence);
|
||||
}
|
||||
}
|
||||
126
Bak/DAL/interfaces/ILabelReplaceRepository.cs
Normal file
126
Bak/DAL/interfaces/ILabelReplaceRepository.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
using MDL.DTOs;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// 标签替换请求的数据访问接口
|
||||
/// </summary>
|
||||
public interface ILabelReplaceRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建标签替换请求记录
|
||||
/// </summary>
|
||||
/// <param name="entity">标签替换请求实体</param>
|
||||
/// <returns>创建的记录ID</returns>
|
||||
Task<int> CreateAsync(LabelReplaceEntity entity);
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID获取标签替换请求记录
|
||||
/// </summary>
|
||||
/// <param name="id">记录ID</param>
|
||||
/// <returns>标签替换请求实体</returns>
|
||||
Task<LabelReplaceEntity?> GetByIdAsync(int id);
|
||||
|
||||
/// <summary>
|
||||
/// 根据中性面单单号获取标签替换请求记录
|
||||
/// </summary>
|
||||
/// <param name="waybillNumber">中性面单单号</param>
|
||||
/// <returns>标签替换请求实体</returns>
|
||||
Task<LabelReplaceEntity?> GetByWaybillNumberAsync(string waybillNumber);
|
||||
|
||||
/// <summary>
|
||||
/// 根据跟踪单号获取标签替换请求记录
|
||||
/// </summary>
|
||||
/// <param name="trackingNumber">跟踪单号</param>
|
||||
/// <returns>标签替换请求实体列表</returns>
|
||||
Task<List<LabelReplaceEntity>> GetByTrackingNumberAsync(string trackingNumber);
|
||||
|
||||
/// <summary>
|
||||
/// 更新标签替换请求记录
|
||||
/// </summary>
|
||||
/// <param name="entity">标签替换请求实体</param>
|
||||
/// <returns>更新是否成功</returns>
|
||||
Task<bool> UpdateAsync(LabelReplaceEntity entity);
|
||||
|
||||
/// <summary>
|
||||
/// 删除标签替换请求记录
|
||||
/// </summary>
|
||||
/// <param name="id">记录ID</param>
|
||||
/// <returns>删除是否成功</returns>
|
||||
Task<bool> DeleteAsync(int id);
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有标签替换请求记录
|
||||
/// </summary>
|
||||
/// <returns>标签替换请求实体列表</returns>
|
||||
Task<List<LabelReplaceEntity>> GetAllAsync();
|
||||
|
||||
/// <summary>
|
||||
/// 分页获取标签替换请求记录
|
||||
/// </summary>
|
||||
/// <param name="page">页码</param>
|
||||
/// <param name="pageSize">每页大小</param>
|
||||
/// <param name="sortBy">排序字段</param>
|
||||
/// <param name="sortOrder">排序顺序</param>
|
||||
/// <param name="billOfLadingNumber">提单号</param>
|
||||
/// <param name="masterPackageNumber">大包号</param>
|
||||
/// <param name="referenceNumber">参考号</param>
|
||||
/// <param name="neutralWaybillNumber">中性面单单号</param>
|
||||
/// <param name="finalMileTrackingNumber">尾程跟踪单号</param>
|
||||
/// <param name="replaceStatus">换单状态</param>
|
||||
/// <param name="customerId">客户ID</param>
|
||||
/// <returns>标签替换请求实体列表和总记录数</returns>
|
||||
Task<(List<LabelReplaceWithCustomerDto>, int)> GetByPageAsync(int page, int pageSize, string sortBy, string sortOrder, string billOfLadingNumber, string masterPackageNumber, string referenceNumber, string neutralWaybillNumber, string finalMileTrackingNumber, string replaceStatus, int? customerId, string startCreatedAt, string endCreatedAt, string startReplacedAt, string endReplacedAt);
|
||||
|
||||
/// <summary>
|
||||
/// 批量查询换单状态
|
||||
/// </summary>
|
||||
/// <param name="customerId">客户ID</param>
|
||||
/// <param name="waybillNumbers">中性面单单号列表</param>
|
||||
/// <param name="trackingNumbers">尾程跟踪单号列表</param>
|
||||
/// <returns>标签替换请求实体列表和最新扫描时间映射</returns>
|
||||
Task<(List<LabelReplaceEntity>, Dictionary<string, DateTime>)> GetLabelReplaceStatusAsync(int customerId, List<string> waybillNumbers, List<string> trackingNumbers);
|
||||
|
||||
/// <summary>
|
||||
/// 根据交接单号列表批量获取标签替换请求记录
|
||||
/// </summary>
|
||||
/// <param name="handoverNumbers">交接单号列表</param>
|
||||
/// <param name="customerId">客户ID</param>
|
||||
/// <returns>标签替换请求实体列表</returns>
|
||||
Task<List<LabelReplaceEntity>> GetByHandoverNumbersAsync(List<string> handoverNumbers, int? customerId);
|
||||
|
||||
/// <summary>
|
||||
/// 将base64编码转换为PDF文件并保存
|
||||
/// </summary>
|
||||
/// <param name="base64Content">base64编码的PDF内容</param>
|
||||
/// <param name="fileName">文件名</param>
|
||||
/// <returns>保存的文件路径</returns>
|
||||
Task<string> ConvertBase64ToPdfAsync(string base64Content, string fileName);
|
||||
|
||||
/// <summary>
|
||||
/// 更新Label字段但保持LabelRetrievedAt不变
|
||||
/// </summary>
|
||||
/// <param name="id">记录ID</param>
|
||||
/// <param name="newLabel">新的Label值</param>
|
||||
/// <returns>更新是否成功</returns>
|
||||
Task<bool> UpdateLabelWithoutChangingRetrievedAtAsync(int id, string newLabel);
|
||||
|
||||
/// <summary>
|
||||
/// 获取每日标签统计数据
|
||||
/// </summary>
|
||||
/// <param name="startDate">开始日期</param>
|
||||
/// <param name="endDate">结束日期</param>
|
||||
/// <param name="customerId">客户ID</param>
|
||||
/// <returns>每日标签统计数据列表</returns>
|
||||
Task<List<DailyLabelStatsDto>> GetDailyLabelStatsAsync(string startDate, string endDate, int? customerId);
|
||||
|
||||
/// <summary>
|
||||
/// 获取每日标签统计数据(中文版本,使用自定义SQL)
|
||||
/// </summary>
|
||||
/// <returns>每日标签统计数据列表</returns>
|
||||
Task<List<DailyLabelStatsChineseDto>> GetDailyLabelStatsChineseAsync();
|
||||
}
|
||||
}
|
||||
114
Bak/DAL/interfaces/ILabelScanRepository.cs
Normal file
114
Bak/DAL/interfaces/ILabelScanRepository.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// 标签历史扫描记录仓储接口
|
||||
/// </summary>
|
||||
public interface ILabelScanRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建标签扫描记录
|
||||
/// </summary>
|
||||
/// <param name="entity">标签扫描记录实体</param>
|
||||
/// <returns>创建的记录ID</returns>
|
||||
Task<int> CreateAsync(LabelScanEntity entity);
|
||||
|
||||
/// <summary>
|
||||
/// 根据中性面单单号获取标签扫描记录列表
|
||||
/// </summary>
|
||||
/// <param name="neutralWaybillNumber">中性面单单号</param>
|
||||
/// <returns>标签扫描记录列表</returns>
|
||||
Task<List<LabelScanEntity>> GetByNeutralWaybillNumberAsync(string neutralWaybillNumber);
|
||||
Task<List<LabelScanEntity>> GetByNeutralWaybillNumbersAsync(List<string> neutralWaybillNumbers);
|
||||
|
||||
/// <summary>
|
||||
/// 根据参考号获取标签扫描记录列表
|
||||
/// </summary>
|
||||
/// <param name="referenceNumber">参考号</param>
|
||||
/// <returns>标签扫描记录列表</returns>
|
||||
Task<List<LabelScanEntity>> GetByReferenceNumberAsync(string referenceNumber);
|
||||
|
||||
/// <summary>
|
||||
/// 根据尾程跟踪单号获取标签扫描记录列表
|
||||
/// </summary>
|
||||
/// <param name="finalMileTrackingNumber">尾程跟踪单号</param>
|
||||
/// <returns>标签扫描记录列表</returns>
|
||||
Task<List<LabelScanEntity>> GetByFinalMileTrackingNumberAsync(string finalMileTrackingNumber);
|
||||
|
||||
/// <summary>
|
||||
/// 根据客户ID获取标签扫描记录列表
|
||||
/// </summary>
|
||||
/// <param name="customerId">客户ID</param>
|
||||
/// <returns>标签扫描记录列表</returns>
|
||||
Task<List<LabelScanEntity>> GetByCustomerIdAsync(int customerId);
|
||||
|
||||
/// <summary>
|
||||
/// 根据客户ID和中性面单单号获取标签扫描记录列表
|
||||
/// </summary>
|
||||
/// <param name="customerId">客户ID</param>
|
||||
/// <param name="neutralWaybillNumber">中性面单单号</param>
|
||||
/// <returns>标签扫描记录列表</returns>
|
||||
Task<List<LabelScanEntity>> GetByCustomerIdAndWaybillNumberAsync(int customerId, string neutralWaybillNumber);
|
||||
|
||||
/// <summary>
|
||||
/// 统计客户的订单扫描次数
|
||||
/// </summary>
|
||||
/// <param name="customerId">客户ID</param>
|
||||
/// <param name="neutralWaybillNumber">中性面单单号(可选,不提供则统计所有订单)</param>
|
||||
/// <returns>扫描次数</returns>
|
||||
Task<int> CountScansByCustomerAndWaybillAsync(int customerId, string neutralWaybillNumber = null);
|
||||
|
||||
/// <summary>
|
||||
/// 获取客户的扫描记录分组统计
|
||||
/// </summary>
|
||||
/// <param name="customerId">客户ID</param>
|
||||
/// <returns>按订单分组的扫描统计信息</returns>
|
||||
Task<Dictionary<string, int>> GetScanStatsByCustomerAsync(int customerId);
|
||||
|
||||
/// <summary>
|
||||
/// 更新标签扫描记录
|
||||
/// </summary>
|
||||
/// <param name="entity">标签扫描记录实体</param>
|
||||
/// <returns>是否更新成功</returns>
|
||||
Task<bool> UpdateAsync(LabelScanEntity entity);
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有标签扫描记录
|
||||
/// </summary>
|
||||
/// <returns>标签扫描记录实体列表</returns>
|
||||
Task<List<LabelScanEntity>> GetAllAsync();
|
||||
|
||||
/// <summary>
|
||||
/// 分页获取标签扫描记录
|
||||
/// </summary>
|
||||
/// <param name="page">页码</param>
|
||||
/// <param name="pageSize">每页大小</param>
|
||||
/// <param name="sortBy">排序字段</param>
|
||||
/// <param name="sortOrder">排序顺序</param>
|
||||
/// <param name="customerId">客户ID</param>
|
||||
/// <param name="referenceNumber">参考号</param>
|
||||
/// <param name="neutralWaybillNumber">中性面单单号</param>
|
||||
/// <param name="finalMileTrackingNumber">尾程跟踪单号</param>
|
||||
/// <param name="result">扫描结果</param>
|
||||
/// <returns>标签扫描记录DTO列表和总记录数</returns>
|
||||
Task<(List<MDL.DTOs.LabelScanWithCustomerDto>, int)> GetByPageAsync(int page, int pageSize, string sortBy, string sortOrder, int? customerId, string referenceNumber, string neutralWaybillNumber, string finalMileTrackingNumber, int? result, string startCreatedAt, string endCreatedAt);
|
||||
|
||||
/// <summary>
|
||||
/// 根据中性面单单号获取最新的扫描记录
|
||||
/// </summary>
|
||||
/// <param name="neutralWaybillNumber">中性面单单号</param>
|
||||
/// <returns>最新的标签扫描记录</returns>
|
||||
Task<LabelScanEntity> GetLatestScanByWaybillAsync(string neutralWaybillNumber);
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期范围获取扫描记录
|
||||
/// </summary>
|
||||
/// <param name="startDate">开始日期</param>
|
||||
/// <param name="endDate">结束日期</param>
|
||||
/// <returns>标签扫描记录列表</returns>
|
||||
Task<List<LabelScanEntity>> GetByDateRangeAsync(System.DateTime startDate, System.DateTime endDate);
|
||||
}
|
||||
}
|
||||
51
Bak/DAL/interfaces/IOrderLogRepository.cs
Normal file
51
Bak/DAL/interfaces/IOrderLogRepository.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单日志仓储接口
|
||||
/// </summary>
|
||||
public interface IOrderLogRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 插入订单日志
|
||||
/// </summary>
|
||||
/// <param name="log">订单日志实体</param>
|
||||
/// <returns>插入是否成功</returns>
|
||||
Task<bool> InsertOrderLogAsync(OrderLogEntity log);
|
||||
|
||||
/// <summary>
|
||||
/// 根据中性面单单号获取订单日志列表
|
||||
/// </summary>
|
||||
/// <param name="neutralWaybillNumber">中性面单单号</param>
|
||||
/// <returns>订单日志实体列表</returns>
|
||||
Task<List<OrderLogEntity>> GetOrderLogsByWaybillNumberAsync(string neutralWaybillNumber);
|
||||
|
||||
/// <summary>
|
||||
/// 根据尾程跟踪单号获取订单日志列表
|
||||
/// </summary>
|
||||
/// <param name="finalMileTrackingNumber">尾程跟踪单号</param>
|
||||
/// <returns>订单日志实体列表</returns>
|
||||
Task<List<OrderLogEntity>> GetOrderLogsByTrackingNumberAsync(string finalMileTrackingNumber);
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有订单日志列表(分页)
|
||||
/// </summary>
|
||||
/// <param name="pageIndex">页码</param>
|
||||
/// <param name="pageSize">每页大小</param>
|
||||
/// <returns>订单日志实体列表</returns>
|
||||
Task<List<OrderLogEntity>> GetAllOrderLogsAsync(int pageIndex, int pageSize);
|
||||
|
||||
/// <summary>
|
||||
/// 根据操作类型和操作结果获取订单日志列表
|
||||
/// </summary>
|
||||
/// <param name="operationType">操作类型</param>
|
||||
/// <param name="operationResult">操作结果</param>
|
||||
/// <param name="pageIndex">页码</param>
|
||||
/// <param name="pageSize">每页大小</param>
|
||||
/// <returns>订单日志实体列表</returns>
|
||||
Task<List<OrderLogEntity>> GetOrderLogsByOperationAsync(string operationType, string operationResult, int pageIndex, int pageSize);
|
||||
}
|
||||
}
|
||||
61
Bak/DAL/interfaces/IShippingHandoverFormBagTagRepository.cs
Normal file
61
Bak/DAL/interfaces/IShippingHandoverFormBagTagRepository.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// 出货交接单与袋牌关联仓库接口
|
||||
/// </summary>
|
||||
public interface IShippingHandoverFormBagTagRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 插入关联记录
|
||||
/// </summary>
|
||||
/// <param name="relation">关联实体</param>
|
||||
/// <returns>影响行数</returns>
|
||||
Task<int> InsertAsync(ShippingHandoverFormBagTagEntity relation);
|
||||
|
||||
/// <summary>
|
||||
/// 批量插入关联记录
|
||||
/// </summary>
|
||||
/// <param name="relations">关联实体列表</param>
|
||||
/// <returns>影响行数</returns>
|
||||
Task<int> InsertBatchAsync(List<ShippingHandoverFormBagTagEntity> relations);
|
||||
|
||||
/// <summary>
|
||||
/// 根据出货交接单ID获取关联的袋牌列表
|
||||
/// </summary>
|
||||
/// <param name="shippingHandoverFormId">出货交接单ID</param>
|
||||
/// <returns>袋牌列表</returns>
|
||||
Task<List<ShippingHandoverFormBagTagEntity>> GetByShippingHandoverFormIdAsync(int shippingHandoverFormId);
|
||||
|
||||
/// <summary>
|
||||
/// 根据袋牌ID获取关联的出货交接单
|
||||
/// </summary>
|
||||
/// <param name="bagTagId">袋牌ID</param>
|
||||
/// <returns>关联实体</returns>
|
||||
Task<ShippingHandoverFormBagTagEntity> GetByBagTagIdAsync(int bagTagId);
|
||||
|
||||
/// <summary>
|
||||
/// 删除关联记录
|
||||
/// </summary>
|
||||
/// <param name="id">关联ID</param>
|
||||
/// <returns>影响行数</returns>
|
||||
Task<int> DeleteAsync(int id);
|
||||
|
||||
/// <summary>
|
||||
/// 根据出货交接单ID删除所有关联记录
|
||||
/// </summary>
|
||||
/// <param name="shippingHandoverFormId">出货交接单ID</param>
|
||||
/// <returns>影响行数</returns>
|
||||
Task<int> DeleteByShippingHandoverFormIdAsync(int shippingHandoverFormId);
|
||||
|
||||
/// <summary>
|
||||
/// 检查袋牌是否已关联到出货交接单
|
||||
/// </summary>
|
||||
/// <param name="bagTagId">袋牌ID</param>
|
||||
/// <returns>是否已关联</returns>
|
||||
Task<bool> ExistsByBagTagIdAsync(int bagTagId);
|
||||
}
|
||||
}
|
||||
27
Bak/DAL/interfaces/IShippingHandoverFormRepository.cs
Normal file
27
Bak/DAL/interfaces/IShippingHandoverFormRepository.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
public interface IShippingHandoverFormRepository
|
||||
{
|
||||
Task<int> InsertAsync(ShippingHandoverFormEntity form);
|
||||
Task<ShippingHandoverFormEntity> GetByIdAsync(int id);
|
||||
Task<ShippingHandoverFormEntity> GetByHandoverNumberAsync(string handoverNumber);
|
||||
Task<List<ShippingHandoverFormEntity>> GetAllAsync();
|
||||
Task<int> UpdateAsync(ShippingHandoverFormEntity form);
|
||||
Task<int> DeleteAsync(int id);
|
||||
Task<bool> ExistsByHandoverNumberAsync(string handoverNumber);
|
||||
Task<(List<ShippingHandoverFormEntity> Forms, int TotalCount)> GetShippingHandoverFormsBatchAsync(
|
||||
int page,
|
||||
int pageSize,
|
||||
string sortBy,
|
||||
string sortOrder,
|
||||
string handoverNumber,
|
||||
string channel,
|
||||
string creator,
|
||||
System.DateTime? startDeliveryTime = null,
|
||||
System.DateTime? endDeliveryTime = null);
|
||||
}
|
||||
}
|
||||
15
Bak/DAL/interfaces/ITagInstanceRepository.cs
Normal file
15
Bak/DAL/interfaces/ITagInstanceRepository.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
public interface ITagInstanceRepository
|
||||
{
|
||||
Task<TagInstanceEntity> CreateAsync(TagInstanceEntity entity);
|
||||
Task<TagInstanceEntity> UpdateAsync(TagInstanceEntity entity);
|
||||
Task<TagInstanceEntity> GetByIdAsync(long id);
|
||||
Task<List<TagInstanceEntity>> GetByWaybillAsync(string neutralWaybillNumber);
|
||||
Task<List<TagInstanceEntity>> GetByTagTypeAsync(string tagType);
|
||||
}
|
||||
}
|
||||
9
Bak/DAL/interfaces/ITagRepository.cs
Normal file
9
Bak/DAL/interfaces/ITagRepository.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
public interface ITagRepository
|
||||
{
|
||||
Task SaveResultAsync(string id, string result);
|
||||
}
|
||||
}
|
||||
16
Bak/DAL/interfaces/ITagTemplateRepository.cs
Normal file
16
Bak/DAL/interfaces/ITagTemplateRepository.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MDL.Models;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
public interface ITagTemplateRepository
|
||||
{
|
||||
Task<TagTemplateEntity> CreateAsync(TagTemplateEntity entity);
|
||||
Task<TagTemplateEntity> UpdateAsync(TagTemplateEntity entity);
|
||||
Task<bool> DeleteAsync(int id);
|
||||
Task<TagTemplateEntity> GetByIdAsync(int id);
|
||||
Task<TagTemplateEntity> GetByTagTypeAsync(string tagType);
|
||||
Task<List<TagTemplateEntity>> GetAllAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user