using Infrastructure.Attribute; using Infrastructure.Extensions; using DOAN.Model.PBL.Dto; using DOAN.Model.PBL; using DOAN.Repository; using DOAN.Service.PBL.IService; namespace DOAN.Service.PBL { /// /// 库存日志Service业务层处理 /// [AppService(ServiceType = typeof(IInventorylogService), ServiceLifetime = LifeTime.Transient)] public class InventorylogService : BaseService, IInventorylogService { /// /// 查询库存日志列表 /// /// /// public PagedInfo GetList(InventorylogQueryDto parm) { var predicate = QueryExp(parm); var response = Queryable() .Where(predicate.ToExpression()) .OrderByDescending(it => it.CreatedTime) .ToPage(parm); return response; } /// /// 获取详情 /// /// /// public Inventorylog GetInfo(string Id) { var response = Queryable() .Where(x => x.Id == Id) .First(); return response; } /// /// 添加库存日志 /// /// /// public Inventorylog AddInventorylog(Inventorylog model) { model.Id = XUEHUA; return Insertable(model).ExecuteReturnEntity(); } /// /// 修改库存日志 /// /// /// public int UpdateInventorylog(Inventorylog model) { return Update(model, true); } /// /// 查询导出表达式 /// /// /// private static Expressionable QueryExp(InventorylogQueryDto parm) { var predicate = Expressionable.Create() .AndIF(!string.IsNullOrEmpty(parm.RackCode), it => it.RackCode.Contains(parm.RackCode)) .AndIF(parm.Operation != null, it => it.Operation == parm.Operation) ; return predicate; } } }