11
schangxiang@126.com
2024-12-03 e8734db76fbbb3149ba663beff3b4f7451012b03
CC/iWareSql/DataAccess/StationHandlerV2.cs
@@ -131,7 +131,7 @@
                }
                if (lockPlaceDict.ContainsKey(validatePlace.Id))
                {
                    Log4NetHelper.WriteInfoLog(LogType.SrmTheadService, "lockPlaceDict已经有该锁了,validatePlace.Id:" + validatePlace.Id + ",字典中的原因是:" + lockPlaceDict[validatePlace.Id] + ",本次原因是:" + lockReason);
                    Log4NetHelper.WriteInfoLog(LogType.DataProcess_BZ39_IssueInboundTask, "lockPlaceDict已经有该锁了,validatePlace.Id:" + validatePlace.Id + ",字典中的原因是:" + lockPlaceDict[validatePlace.Id] + ",本次原因是:" + lockReason);
                    return true;
                }
                else
@@ -181,18 +181,18 @@
                    var emptyStationList = edm.V_EmptyStation.ToList();
                    //不随机排序
                    emptyStationList = emptyStationList.OrderByDescending(x => x.LaneNo).ThenByDescending(x => x.ColumnNo).ThenBy(x => x.LayerNo).ToList();
                    emptyStationList = emptyStationList.OrderBy(x => x.LaneNo).ThenBy(x => x.LayerNo).ThenBy(x => x.ColumnNo).ToList();
                    //增加该库位是否被任务占用的筛选 [EditBy shaocx,2022-06-02]
                    //emptyStationList = FilterStationForDoingTask(edm, emptyStationList);
                    List<int> usePlaceTypeList = new List<int>();
                    int placeType = TCSCommon.GetPlaceTypeByWidthLength(upiObj, upiObj.Length, upiObj.Width,ref usePlaceTypeList);
                    int placeType = TCSCommon.GetPlaceTypeByWidthLength(upiObj, upiObj.Length, upiObj.Width, ref usePlaceTypeList);
                    //优先查询
                    var my_emptyStationList = emptyStationList.Where(x => usePlaceTypeList.Contains( x.PlaceType)).OrderBy(x=>x.PlaceType).ToList();
                    var my_emptyStationList = emptyStationList.Where(x => usePlaceTypeList.Contains(x.PlaceType)).OrderBy(x => x.PlaceType).ToList();
                    if (my_emptyStationList?.Count() > 0)
                    {
                        wms_base_place toPlace = StationHandler.GetPlaceByPlaceId(emptyStationList.First().Id, edm);
                        wms_base_place toPlace = StationHandler.GetPlaceByPlaceId(my_emptyStationList.First().Id, edm);
                        return toPlace;
                    }
                    else