wangxinhui
昨天 9ce6731460179c71f0f2c636b2a1598324d5194e
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_BasicService/Service/LocationInfoService.cs
@@ -60,13 +60,13 @@
                List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList();
                //未定义类型的空货位
                List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
                List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Columns).ToList();
                if (locationInfos.Count * weightValue >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Count > 0)//如果已定义类型货位未超过比例,且有未定义类型的货位
                {
                    if (palletType == PalletTypeEnum.LargePallet)
                    {
                        undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList();
                        undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Columns % 2 == 1).ToList();
                    }
                    for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++)
                    {
@@ -82,7 +82,7 @@
                }
                else
                {
                    List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
                    List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Columns).ToList();
                    for (int i = 0; i < definedTypeEmptyLocations.Count; i++)
                    {
@@ -106,7 +106,7 @@
            {
                case PalletTypeEnum.LargePallet:
                    {
                        Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == undefinedTypeEmptyLocation.Row && x.Layer == undefinedTypeEmptyLocation.Layer && x.Depth == undefinedTypeEmptyLocation.Depth && x.Column == undefinedTypeEmptyLocation.Column + 1);
                        Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == undefinedTypeEmptyLocation.Row && x.Layer == undefinedTypeEmptyLocation.Layer && x.Depth == undefinedTypeEmptyLocation.Depth && x.Columns == undefinedTypeEmptyLocation.Columns + 1);
                        if (nearLocation != null && nearLocation.LocationStatus == LocationStatusEnum.Free.ObjToInt() && DepthLocationIsEmpty(locationInfos, undefinedTypeEmptyLocation) != null)
                        {
                            Dt_LocationInfo? locationInfo = DepthLocationIsEmpty(locationInfos, undefinedTypeEmptyLocation);
@@ -175,7 +175,7 @@
                    locations[i].LocationType = palletType.ObjToInt();
                }
                Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1);
                Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Columns == location.Columns + 1);
                if (nearLocation != null)
                {
                    List<Dt_LocationInfo> nearLocations = GetGroupLocations(locationInfos, nearLocation);
@@ -220,7 +220,7 @@
                    locations[i].LocationType = palletType.ObjToInt();
                }
                Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1);
                Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Columns == location.Columns + 1);
                if (nearLocation != null)
                {
                    List<Dt_LocationInfo> nearLocations = GetGroupLocations(locationInfos, nearLocation);
@@ -252,7 +252,7 @@
            int maxDepth = locationInfos.Max(x => x.Depth);
            for (int j = location.Depth + 1; j <= maxDepth; j++)
            {
                Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer);
                Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Columns == location.Columns && x.Layer == location.Layer);
                if (locationInfo != null)
                {
                    groupLocations.Add(locationInfo);
@@ -261,7 +261,7 @@
            for (int j = location.Depth - 1; j >= 1; j--)
            {
                Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer);
                Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Columns == location.Columns && x.Layer == location.Layer);
                if (locationInfo != null)
                {
                    groupLocations.Add(locationInfo);