wangxinhui
2025-01-09 1c3c6a93bf2bb3af1aa13258640be333eef1e1c7
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs
@@ -29,7 +29,7 @@
        /// æ‰˜ç›˜ç±»åž‹ 
        /// </param>
        /// <returns></returns>
        public Dt_LocationInfo? AssignLocation_PP(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "")
        public Dt_LocationInfo? AssignLocation_PP(string roadwayNo, int palletType, Dt_PalletTypeInfo palletTypeInfo, string beRelocationCode = "")
        {
            lock (_locker_PP)
            {
@@ -77,10 +77,6 @@
                if ((locationInfos.Count * weightValue_PP >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//如果已定义类型货位未超过比例,且有未定义类型的货位
                {
                    if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet)
                    {
                        undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList();
                    }
                    for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++)
                    {
                        Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i];
@@ -116,18 +112,8 @@
        /// <param name="emptyLocation"></param>
        /// <param name="palletType"></param>
        /// <returns></returns>
        private Dt_LocationInfo? GetUsableLocation_PP(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        private Dt_LocationInfo? GetUsableLocation_PP(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, int palletType)
        {
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    if (emptyLocation.Column % 2 == 0)
                    {
                        return null;
                    }
                    break;
            }
            Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_PP(locationInfos, emptyLocation, palletType);
            if (locationInfo != null)
            {
@@ -142,25 +128,17 @@
        /// <param name="locationInfos"></param>
        /// <param name="emptyLocation"></param>
        /// <returns></returns>
        private Dt_LocationInfo? DepthLocationIsEmpty_PP(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        private Dt_LocationInfo? DepthLocationIsEmpty_PP(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, int palletType)
        {
            List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, emptyLocation);
            bool moreDepthFlag = false;
            bool littleDepthFlag = false;
            List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList();
            moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt()) == null;//查询大于当前货位深度的集合里是否有状态不为有货的货位,如果是true,则表示深货位有未被使用的情况
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList();
                    moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt()) == null;//查询大于当前货位深度的集合里是否有状态不为有货的货位,如果是true,则表示深货位有未被使用的情况
                    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;
            }
            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,则表示浅货位被使用或者被禁用的情况
            if (moreDepthFlag && littleDepthFlag)
            {
                return emptyLocation;