wangxinhui
10 天以前 3452d373f030b114aa20957efeba41bc8091d6f6
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs
@@ -29,7 +29,7 @@
        /// æ‰˜ç›˜ç±»åž‹
        /// </param>
        /// <returns></returns>
        public Dt_LocationInfo? AssignLocation_ZH(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "")
        public Dt_LocationInfo? AssignLocation_ZH(string roadwayNo, int palletType, Dt_PalletTypeInfo palletTypeInfo, string beRelocationCode = "")
        {
            lock (_locker_ZH)
            {
@@ -77,7 +77,7 @@
                if ((locationInfos.Count * weightValue_ZH >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//如果已定义类型货位未超过比例,且有未定义类型的货位
                {
                    if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet)
                    if (palletTypeInfo.IsOdd)
                    {
                        undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 0).ToList();
                    }
@@ -116,12 +116,11 @@
        /// <param name="emptyLocation"></param>
        /// <param name="palletType"></param>
        /// <returns></returns>
        private Dt_LocationInfo? GetUsableLocation_ZH(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        private Dt_LocationInfo? GetUsableLocation_ZH(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, int palletType)
        {
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                case 2:
                    if (emptyLocation.Column % 2 != 0)
                    {
                        return null;
@@ -142,23 +141,28 @@
        /// <param name="locationInfos"></param>
        /// <param name="emptyLocation"></param>
        /// <returns></returns>
        private Dt_LocationInfo? DepthLocationIsEmpty_ZH(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        private Dt_LocationInfo? DepthLocationIsEmpty_ZH(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, int palletType)
        {
            List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, emptyLocation);
            bool moreDepthFlag = false;
            bool littleDepthFlag = false;
            switch (palletType)
            if (emptyLocation.LocationType == 0)
            {
                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> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList();
                moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == 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()) && x.LocationType != 0) == null; //查询小于当前货位深度的集合里是否有状态不为空,且禁用状态不为禁用以及只入的货位,如果是true,则表示浅货位被使用或者被禁用的情况
            }
            else
            {
                List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList();
                moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == 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()) && x.LocationType != emptyLocation.LocationType) == null; //查询小于当前货位深度的集合里是否有状态不为空,且禁用状态不为禁用以及只入的货位,如果是true,则表示浅货位被使用或者被禁用的情况
            }
            if (moreDepthFlag && littleDepthFlag)