yanjinhui
2026-03-31 0128fce75a5e7cc9afc4bd89ce1966eb2231b69f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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<Dt_HKLocationInfo, IRepository<Dt_HKLocationInfo>>, IHKLocationInfoService
    {
        public HKLocationInfoService(IRepository<Dt_HKLocationInfo> BaseDal) : base(BaseDal)
        {
        }
        private Dictionary<string, OrderByType> _emptyAssignOrderBy = new Dictionary<string, OrderByType>()
        {
            { 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<Dt_HKLocationInfo> 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;
        }
    }
}