private static void CreateChargeTasks(MachinesDTO communicationMachine, Shuttle shuttle) { var asrs = asrsData.GetAllAsrs().First(x => x.Location == Location.WH_OUT); var taskBatch = machineTasksData.GetNewTaskBatch(); var chrgAddress = addressData.GetAvailableChargeAddress(); MachineTask opt1 = new MachineTask //asrs shuttle taşıma { OrderDetailPalletId = 0, ProductNotificationId = 0, TaskType = (int)TaskType.ShCHRG, TaskBatch = taskBatch, Sequence = 1, MachineCode = asrs.Code, SourceType = AddressType.ADDRESS, SourceAddress = shuttle.LastAddress, LoadInfo = shuttle.Code, TargetType = AddressType.ADDRESS, TargetAddress = chrgAddress, AssignUser = "******", AssignReason = "Charge", AssignTime = DateTime.Now, StartTime = null, EndTime = null, SentFlag = false, IsCompleted = false, ErrorCode = null }; machineTasksData.InsertMachineTaskBatch(new List <MachineTask> { opt1 }); }
private static void CreateOptimizationTasks(MachinesDTO communicationMachine, Shuttle shuttle) { var asrs = asrsData.GetAllAsrs().First(x => x.Location == Location.WH_OUT); var taskBatch = machineTasksData.GetNewTaskBatch(); string nextOptAddress = palletsAtAddressesData.GetNextOptimizationNeededAddresses()[0]; //TODO: seç MachineTask opt1 = new MachineTask //asrs shuttle taşıma { OrderDetailPalletId = 0, ProductNotificationId = 0, TaskType = (int)TaskType.ShOPT, TaskBatch = taskBatch, Sequence = 1, MachineCode = asrs.Code, SourceType = AddressType.ADDRESS, SourceAddress = shuttle.LastAddress, LoadInfo = shuttle.Code, TargetType = AddressType.ADDRESS, TargetAddress = nextOptAddress, AssignUser = "******", AssignReason = "Optimization", AssignTime = DateTime.Now, StartTime = null, EndTime = null, SentFlag = false, IsCompleted = false, ErrorCode = null }; MachineTask opt2 = new MachineTask //shuttle opt başla { OrderDetailPalletId = 0, ProductNotificationId = 0, TaskType = (int)TaskType.ShOPT, TaskBatch = taskBatch, Sequence = 2, MachineCode = communicationMachine.Code, SourceType = AddressType.ADDRESS, SourceAddress = nextOptAddress, LoadInfo = "", TargetType = AddressType.ADDRESS, TargetAddress = nextOptAddress, AssignUser = "******", AssignReason = "Optimization", AssignTime = DateTime.Now, StartTime = null, EndTime = null, SentFlag = false, IsCompleted = false, ErrorCode = null }; machineTasksData.InsertMachineTaskBatch(new List <MachineTask> { opt1, opt2 }); }