using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEAWCS_Common.LocationEnum; using WIDESEAWCS_Core.BaseRepository; using WIDESEAWCS_Core.BaseServices; using WIDESEAWCS_Core.Helper; using WIDESEAWCS_IBasicInfoService; using WIDESEAWCS_Model.Models; namespace WIDESEAWCS_BasicInfoService { public class HKLocationInfoService : ServiceBase>, IHKLocationInfoService { public HKLocationInfoService(IRepository BaseDal) : base(BaseDal) { } private Dictionary _emptyAssignOrderBy = new Dictionary() { { nameof(Dt_HKLocationInfo.Depth), OrderByType.Desc }, { nameof(Dt_HKLocationInfo.Layer), OrderByType.Asc }, { nameof(Dt_HKLocationInfo.Column), OrderByType.Asc }, { nameof(Dt_HKLocationInfo.Row), OrderByType.Asc }, }; public IRepository Repository => BaseDal; public Dt_HKLocationInfo? GetFreeLocationInfo(string toAreaCode) { Dt_HKLocationInfo hKLocationInfo = BaseDal.QueryFirst(x => x.WarehouseId.ToString() == toAreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt(), _emptyAssignOrderBy); return hKLocationInfo; } } }