WMS/HHWMS.Web/Resposity/IUnitWork.cs
zhougf 42c26b2800 feat(入库流程): 实现完整的入库流程逻辑
1. 在IUnitWork接口和实现中添加Save方法用于保存更改
2. 完善WCS任务状态处理逻辑,区分线边库和成品库的不同处理流程
3. 实现入库控制器SubmitReceipt方法,包含库位分配、任务创建、库存记录等完整流程
4. 修改LocationTypeEnum枚举值定义,将L改为C表示成品库位
5. 优化库位查询逻辑,增加高度和类型过滤条件
6. 修改容器类型从枚举改为静态类定义
7. 修复LocationController中库位编码生成格式
8. 在WcsRequest中添加LocationType字段用于库位类型区分
2025-06-20 22:20:35 +08:00

67 lines
2.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
namespace HHWMS.Web
{
public interface IUnitWork
{
T FindSingle<T>(Expression<Func<T, bool>> where) where T : class;
T FindById<T>(Guid id) where T : class;
T FindById<T>(int id) where T : class;
IQueryable<T> Find<T>(Expression<Func<T, bool>> where) where T : class;
bool IsExit<T>(Expression<Func<T, bool>> where) where T : class;
int GetCount<T>(Expression<Func<T, bool>> where) where T : class;
int Add<T>(T entity) where T : class;
int BatchAdd<T>(IEnumerable<T> entities) where T : class;
/// <summary>
/// 添加到历史表,并将原数据删除
/// </summary>
/// <param name="name">历史表 表名</param>
/// <param name="where">条件</param>
/// <param name="entity">实体类</param>
/// <returns></returns>
int AddToHistory<T>(string name, Expression<Func<T, bool>> where, Expression<Func<T, object>> entity) where T : class;
int Update<T>(T entity) where T : class;
int BatchUpdate<T>(IEnumerable<T> entities) where T : class;
/// <summary>
/// 根据条件更新
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="where"></param>
/// <param name="entity"></param>
/// <returns></returns>
int BatchUpdate<T>(Expression<Func<T, bool>> where, Expression<Func<T, T>> entity) where T : class;
int Delete<T>(T entity) where T : class;
/// <summary>
/// 根据条件 批量删除
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="where">条件</param>
/// <returns></returns>
int BatchDelete<T>(Expression<Func<T, bool>> where) where T : class;
int DeleteById<T>(T entity) where T : class;
int DeleteById<T>(int id) where T : class;
int BatchDelete<T>(IEnumerable<T> entities) where T : class;
int Save();
string GetSerialNumber(string prefix, int length = 4);
}
}