| | |
| | | { |
| | | var agvtask = agvtasks.Where(x => x.agv_tasktype == AGVTaskType).OrderByDescending(x => x.agv_grade).ThenBy(x => x.agv_createtime).FirstOrDefault(); |
| | | if (agvtask != null) UpdateQueue(agvtaskService, agvtask); |
| | | //var tasks = agvtasks.Where(x => x.agv_tasktype == AGVTaskType).OrderByDescending(x => x.agv_grade).ThenBy(x => x.agv_createtime).ToList(); |
| | | //foreach (var task in tasks) |
| | | //{ |
| | | // UpdateQueue(agvtaskService, task); |
| | | //} |
| | | } |
| | | #endregion |
| | | |
| | |
| | | if (string.IsNullOrEmpty(agvtask.agv_toaddress)) |
| | | { |
| | | var stationinfo = stationinfoRepository.Find(x => x.stationCode == agvtask.agv_fromaddress).FirstOrDefault(); |
| | | var work = workinfoRepository.Find(x => x.workOrder == stationinfo.Number && x.drawingNo == stationinfo.stationType && x.heatID == stationinfo.heatNumber && x.processCode == "17").FirstOrDefault(); |
| | | var work = workinfoRepository.Find(x => x.workOrder == stationinfo.Number && x.drawingNo == stationinfo.stationType && x.heatID == stationinfo.heatNumber && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault(); |
| | | var TargetLocation = agvtask.agv_tasktype == AGVTaskTypeEnum.TaskType_Inbound.ToString() ? GetLocation.GetEmptyLocation(stationinfoRepository, work, agvtask) : StationTask.GetEmptyLocation(stationinfoRepository); |
| | | if (TargetLocation != null) |
| | | { |
| | |
| | | TargetLocation.stationType = agvtask.agv_materielid; |
| | | TargetLocation.heatNumber = stationinfo.heatNumber; |
| | | TargetLocation.Number = agvtask.jobID; |
| | | stationinfoRepository.Update(TargetLocation, true); |
| | | agvtaskService.Update(agvtask, true); |
| | | stationinfoRepository.Update(TargetLocation, x => new { x.location_state, x.billetID, x.stationType, x.heatNumber, x.Number }, true); |
| | | agvtaskService.Update(agvtask, x => new { x.agv_taskstate, x.agv_toaddress }, true); |
| | | WriteDBLog.Success("鏇存柊鍏ュ簱闃熷垪浠诲姟", $"浠诲姟缂栧彿锛歿agvtask.agv_tasknum}", "PCS"); |
| | | } |
| | | } |