dengjunjie
2024-12-24 18d1f45193e34e00fc1b6f65b8596ddb29c5267d
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs
@@ -24,21 +24,21 @@
        /// <summary>
        /// æµ‹è¯•架仓货位分配 <br/>
        /// æ‰˜ç›˜ç±»åž‹ï¼š <br/>
        /// 1:最长 <br/>
        /// 2:长 <br/>
        /// 3:中等 <br/>
        /// 4:短 <br/>
        /// 3和4都是3深,且可以混放。 <br/>
        /// 1和2都是2深,且可以混放。 <br/>
        /// 1:短 <br/>
        /// 2:中等 <br/>
        /// 3:长 <br/>
        /// 4:特长 <br/>
        /// 1和2都是3深,且可以混放。 <br/>
        /// 3和4都是2深,且可以混放。 <br/>
        /// ç§»åº“时只能是同侧货位。
        /// </summary>
        /// <param name="roadwayNo">巷道号</param>
        /// <param name="palletType">
        /// æ‰˜ç›˜ç±»åž‹ <br/>
        /// 1:最长 <br/>
        /// 2:长 <br/>
        /// 3:中等 <br/>
        /// 4:短
        /// 1:短 <br/>
        /// 2:中等 <br/>
        /// 3:长 <br/>
        /// 4:特长
        /// </param>
        /// <returns></returns>
        public Dt_LocationInfo? AssignLocation_CSJ(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "")
@@ -99,7 +99,6 @@
                        Dt_LocationInfo? locationInfo = GetUsableLocation_CSJ(locationInfos, undefinedTypeEmptyLocation, palletType);
                        if (locationInfo != null)
                        {
                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                            locationCaches_CSJ.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
@@ -113,7 +112,6 @@
                        Dt_LocationInfo? locationInfo = GetUsableLocation_CSJ(locationInfos, definedTypeEmptyLocation, palletType);
                        if (locationInfo != null)
                        {
                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                            locationCaches_CSJ.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
@@ -150,6 +148,28 @@
            return null;
        }
        private bool LittleDepthLocationIsEmpty_CSJ(Dt_LocationInfo locationInfo, PalletTypeEnum palletType)
        {
            List<Dt_LocationInfo> locations = GetGroupLocations(locationInfo);
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    {
                        List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= locationInfo.Depth).ToList();
                        return littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //查询小于当前货位深度的集合里是否有状态不为空,且禁用状态不为禁用以及只入的货位,如果是true,则表示浅货位被使用或者被禁用的情况
                    }
                case PalletTypeEnum.MediumPallet:
                case PalletTypeEnum.SmallPallet:
                    {
                        List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= locationInfo.Depth).ToList();
                        return littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //查询小于当前货位深度的集合里是否有状态不为空,且禁用状态不为禁用以及只入的货位,如果是true,则表示浅货位被使用或者被禁用的情况
                    }
            }
            return false;
        }
        /// <summary>
        /// åˆ¤æ–­ä¸åŒæ·±åº¦çš„同组货位状态是否为空闲空位(测试架仓)
        /// </summary>
@@ -184,7 +204,7 @@
                        List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList();
                        littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //查询小于当前货位深度的集合里是否有状态不为空,且禁用状态不为禁用以及只入的货位,如果是true,则表示浅货位被使用或者被禁用的情况
                    }
                    break;
            }