wankeda
2025-03-13 a6a33f6916afbf1fc629baecb772939cda2ee981
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/CachePointService.cs
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
@@ -45,6 +46,13 @@
            return BaseDal.QueryFirst(x => x.PointStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.AreaId == areaId), _emptyAssignOrderBy);
        }
        public Dt_CachePoint? EmptyCachePoint(string toaddress)
        {
            List<Dt_CachePoint> cachePoints = BaseDal.QueryData(x => x.PointName.Contains(toaddress) && x.EnableStatus == 0 && x.PointStatus == LocationStatusEnum.Free.ObjToInt()).ToList();
            var point = cachePoints.FirstOrDefault();
            return point;
        }
        public Dt_CachePoint? GetIbStockCachePoint(int areaId)
        {
            List<CachePointGroupDTO> cachePointGroups = Repository.GetCachePointGroups(areaId, LocationStatusEnum.InStock, LocationStatusEnum.Free);
@@ -64,5 +72,48 @@
            return BaseDal.QueryFirst(x => x.PointStatus == LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.AreaId == areaId), _emptyAssignOrderBy);
        }
        public WebResponseContent GetEndPoints()
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                List<Dt_CachePoint> cachePoints = BaseDal.QueryData(x => x.PointName.Contains("区"));
                List<object> list = new List<object>();
                for (int i = 0; i < cachePoints.Count; i++)
                {
                    object option = new { value = cachePoints[i].PointName, text = cachePoints[i].PointName };
                    list.Add(option);
                }
                content = WebResponseContent.Instance.OK(data: list);
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
        }
        //查询缓存架状态
        public WebResponseContent GetHCJStaue(string stationcode)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                List<Dt_CachePoint> cachePoints = BaseDal.QueryData(x => x.PointName.Contains("区"));
                List<object> list = new List<object>();
                for (int i = 0; i < cachePoints.Count; i++)
                {
                    object option = new { value = cachePoints[i].PointName, text = cachePoints[i].PointName };
                    list.Add(option);
                }
                content = WebResponseContent.Instance.OK(data: list);
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
        }
    }
}