| | |
| | | { |
| | | return (true, taskPosition, ""); |
| | | } |
| | | int maxValue = Math.Max(length, width); |
| | | int minValue = Math.Min(length, width); |
| | | |
| | | int count = Db.Queryable<Dt_Container>().Where(x => x.ContainerType == ContainerTypeEnum.PutContainer.ObjToInt() && x.ContainerStatus == ContainerStatusEnum.Empty.ObjToInt() && x.ContainerEnable && x.ContainerMaxWidth >= minValue).Count(); |
| | | if (count == 0) |
| | | { |
| | | return (false, null, "10000"); |
| | | } |
| | | |
| | | taskPosition = GetPosition(length, width, height); |
| | | if (taskPosition != null) |
| | | { |
| | |
| | | /// </remarks> |
| | | public TaskPosition? GetPosition(int length, int width, int height) |
| | | { |
| | | List<Dt_Container> containers = Db.Queryable<Dt_Container>().Where(x => x.ContainerType == ContainerTypeEnum.PutContainer.ObjToInt()).Includes(x => x.Items).ToList(); |
| | | int maxValue = Math.Max(length, width); |
| | | int minValue = Math.Min(length, width); |
| | | |
| | | Dt_Container? container = containers.OrderBy(x => x.ContainerSort).FirstOrDefault(x => x.ContainerStatus == ContainerStatusEnum.Empty.ObjToInt() && x.ContainerEnable); |
| | | List<Dt_Container> containers = Db.Queryable<Dt_Container>().Where(x => x.ContainerType == ContainerTypeEnum.PutContainer.ObjToInt()).ToList(); |
| | | |
| | | Dt_Container? container = containers.OrderBy(x => x.ContainerSort).FirstOrDefault(x => x.ContainerStatus == ContainerStatusEnum.Empty.ObjToInt() && x.ContainerEnable && x.ContainerMaxWidth >= minValue); |
| | | List<PlacedBlock> placedBlocks = new List<PlacedBlock>(); |
| | | if (container != null) |
| | | { |
| | |
| | | { |
| | | edge = 1; |
| | | } |
| | | else if (container.ContainerNo == containers.Where(x => x.DeviceCode == container.DeviceCode && x.ContainerType == ContainerTypeEnum.PutContainer.ObjToInt()).Max(x => x.ContainerNo)) |
| | | { |
| | | edge = 2; |
| | | } |
| | | int containerLength = container.ContainerLength; |
| | | int containerWidth = container.ContainerWidth; |
| | | int maxValue = Math.Max(length, width); |
| | | int minValue = Math.Min(length, width); |
| | | |
| | | if (minValue > container.ContainerWidth) |
| | | { |
| | | containerLength = maxValue; |
| | | //containerLength = maxValue; |
| | | containerWidth = minValue; |
| | | } |
| | | ContainerSize containerSize = new ContainerSize(containerLength, containerWidth, container.ContainerHeight); |
| | |
| | | { |
| | | edge = 1; |
| | | } |
| | | else if (container.ContainerNo == dt_Containers.Where(x => x.DeviceCode == container.DeviceCode && x.ContainerType == ContainerTypeEnum.PutContainer.ObjToInt()).Max(x => x.ContainerNo)) |
| | | { |
| | | edge = 2; |
| | | } |
| | | |
| | | ContainerSize containerSize = new ContainerSize(orderContainer.MaxLength, orderContainer.MaxWidth, container.ContainerHeight); |
| | | TaskPosition? taskPosition = GetTaskPosition(length, width, height, containerSize, placedBlocks, edge); |
| | |
| | | return WebResponseContent.Instance.Error("容å¨ä¸åå¨"); |
| | | } |
| | | |
| | | if (container.ContainerStatus == ContainerStatusEnum.Empty.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error("容å¨å·²å¤äºç©ºé²ç¶æ"); |
| | | } |
| | | |
| | | if (container.ContainerType == ContainerTypeEnum.ExceptionContainer.ObjToInt()) |
| | | { |
| | | container.Items = _containerItemRepository.QueryData(x => x.ContainerId == container.Id); |
| | | |
| | | if (container.Items != null && container.Items.Count > 0) |
| | | { |
| | | _containerItemRepository.DeleteAndMoveIntoHty(container.Items, App.User?.UserId > 0 ? WIDESEAWCS_Core.Enums.OperateTypeEnum.人工å é¤ : WIDESEAWCS_Core.Enums.OperateTypeEnum.èªå¨å é¤); |
| | | } |
| | | return WebResponseContent.Instance.OK("å¼å¸¸å·¥ä½å·²éæ¾"); |
| | | } |
| | | |
| | | if (container.ContainerStatus == ContainerStatusEnum.Empty.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error("容å¨å·²å¤äºç©ºé²ç¶æ"); |
| | | } |
| | | |
| | | List<Dt_Task> tasks = _taskRepository.QueryData(x => x.NextAddress.Contains(container.ContainerCode)); |
| | | |
| | | Dt_OrderContainer orderContainer = _orderContainerRepository.QueryFirst(x => x.ContainerCode == container.ContainerCode && x.ContainerId == container.Id); |
| | |
| | | |
| | | container.Items = _containerItemRepository.QueryData(x => x.ContainerId == container.Id && !codes.Contains(x.ItemCode)); |
| | | |
| | | if (container.ContainerType == ContainerTypeEnum.ExceptionContainer.ObjToInt()) |
| | | { |
| | | tasks.ForEach(x => |
| | | { |
| | | if (x.TaskState == TaskStatusEnum.Gantry_BeRelease.ObjToInt()) |
| | | { |
| | | x.TaskState = TaskStatusEnum.Gantry_New.ObjToInt(); |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | tasks.ForEach(x => |
| | | { |
| | | if (x.TaskState == TaskStatusEnum.Gantry_Wait.ObjToInt()) |
| | |
| | | x.TaskState = TaskStatusEnum.Gantry_BeReassign.ObjToInt(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |