dengjunjie
2024-10-24 48e865c8ed5902ae34f133a29dfade36d3f018d3
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs
@@ -1,4 +1,5 @@
using SqlSugar;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -111,5 +112,25 @@
        {
            return BaseDal.QueryFirst(x => x.RoadwayNo == locationInfo.RoadwayNo && x.Column == locationInfo.Column && x.Layer == locationInfo.Layer && x.Depth != locationInfo.Depth && x.Row != locationInfo.Row && (SqlFunc.Abs(x.Row - locationInfo.Row) == 1));
        }
        public WebResponseContent GetPosition(string position)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_LocationInfo locationInfo = BaseDal.QueryFirst(x => x.LocationCode == position);
                if (locationInfo == null) throw new Exception("未找到货位信息");
                //分配穿梭车移库地址
                var locationInfos = BaseDal.QueryData(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.Disable.ObjToInt() && x.LocationCode != locationInfo.LocationCode);//需根据入库逻辑改动
                var location = locationInfos.OrderBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).FirstOrDefault();
                //if (location != null) content.OK(message: location.LocationCode, data: location);
                if (location != null) content.OK(location.LocationCode);
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}