1
yangpeixing
3 天以前 aa4aa67abfdf69e30d5076451716e5aba11d5ec0
WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CP.cs
@@ -63,25 +63,20 @@
                //未定义类型的空货位 
                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.Column).ThenBy(x => x.Row).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).ThenByDescending(x => x.Column).ThenBy(x => x.Row).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.Column).ThenBy(x => x.Row).ToList();
                if (heightType == 1)
                if (heightType == 2)
                {
                    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer >= 14).ToList();
                    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer >= 14).ToList();
                    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer <= 10).ToList();
                    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer <= 10).ToList();
                }
                else if (heightType == 2)
                {
                    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer <= 13).ToList();
                    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer <= 13).ToList();
                }
                else if (heightType == 3)
                {
                    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer <= 4).ToList();
                    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer <= 4).ToList();
                }
                //else if (heightType == 3)
                //{
                //    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer <= 4).ToList();
                //    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer <= 4).ToList();
                //}
                //else
                //{
                //    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => false).ToList();
@@ -90,7 +85,7 @@
                if (palletTypeInfo.LocaitonCount == 2)
                {
                    if (roadwayNo != "TestJCLK")
                    if (roadwayNo != "SC01_CP")
                        definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList();
                    else
                        definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Column % 2 == 0).ToList();
@@ -122,7 +117,7 @@
                {
                    if (palletTypeInfo.LocaitonCount == 2)
                    {
                        if (roadwayNo != "TestJCLK")
                        if (roadwayNo != "SC01_CP")
                            undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList();
                        else
                            undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 0).ToList();
@@ -176,9 +171,9 @@
            if (palletTypeInfo.LocaitonCount == 2)
            {
                Dt_LocationInfo? nearLocation = null;
                if (emptyLocation.RoadwayNo != "TestJCLK" && emptyLocation.Column % 2 == 1)
                if (emptyLocation.RoadwayNo != "SC01_CP" && emptyLocation.Column % 2 == 1)
                    nearLocation = locationInfos.FirstOrDefault(x => x.Row == emptyLocation.Row && x.Layer == emptyLocation.Layer && x.Depth == emptyLocation.Depth && x.Column == emptyLocation.Column - 1);
                else if (emptyLocation.RoadwayNo == "TestJCLK" && emptyLocation.Column % 2 == 0)
                else if (emptyLocation.RoadwayNo == "SC01_CP" && emptyLocation.Column % 2 == 0)
                    nearLocation = locationInfos.FirstOrDefault(x => x.Row == emptyLocation.Row && x.Layer == emptyLocation.Layer && x.Depth == emptyLocation.Depth && x.Column == emptyLocation.Column + 1);
                if (nearLocation != null && DepthLocationIsEmpty_CP(locationInfos, nearLocation) != null)
                {