| | |
| | | WebResponseContent response = new WebResponseContent(); |
| | | try |
| | | { |
| | | //å¦ä»»å¡å·²åå¨å è¿åæ¤ä»»å¡ |
| | | var checkTask = _taskRepository.QueryFirst(x => x.PalletCode == json.PalletCode && x.PVI == json.PVI); |
| | | if (checkTask != null) |
| | | { |
| | | return response.OK("ç³è¯·å
¥åºæå", data: checkTask); |
| | | } |
| | | |
| | | //å±è½MES |
| | | TZPassZZ(json); |
| | | if (json.Position == "EL01RB") |
| | | { |
| | | //çè£
æåæº |
| | | HZPassTZ(json); |
| | | } |
| | | else |
| | | { |
| | | ///æ¶è£
æåæº |
| | | TZPassZZ(json); |
| | | } |
| | | |
| | | var carInfo = _carBodyInfoRepository.QueryFirst(x => x.RFID == json.PVI && x.PalletCode == json.PalletCode); |
| | | |
| | |
| | | // }; |
| | | //} |
| | | |
| | | |
| | | List<Dt_RoadWay> roadWays = new List<Dt_RoadWay>(); |
| | | if (carInfo.CarType == 1) |
| | | { |
| | |
| | | roadWays = _roadWayRepository.QueryData(x => x.WirteCar == 2); |
| | | } |
| | | |
| | | //var locations = _locationRepository.QueryData(x => (x.LocationType == carInfo.CarType || x.LocationType == 3) && x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == (int)EnableEnum.Enable); |
| | | |
| | | var maxGroup = _locationRepository.QueryData(x => (x.LocationType == carInfo.CarType || x.LocationType == 3) && x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == (int)EnableEnum.Enable) |
| | | .GroupBy(x => x.RoadwayNo) |
| | | .OrderByDescending(g => g.Count()) // æ ¹æ®æ¯ä¸ªç»çå
ç´ æ°éæåº |
| | | .ToList(); // ååºæ°éæå¤çç» |
| | | |
| | | if (maxGroup.Count == 0) return response.Error(12, "æ å¯ç¨åºä½"); |
| | | |
| | | Dictionary<string, int> result = new Dictionary<string, int>(); |
| | | foreach (var item in maxGroup) |
| | | { |
| | | var number = _taskRepository.QueryData(x => x.TargetAddress == item.Key).Count(); |
| | | var number = _taskRepository.QueryData(x => x.RoadwayNo == item.Key && x.CarType == carInfo.CarType && (x.TaskType == (int)TaskInboundTypeEnum.Inbound || x.TaskType == (int)TaskInboundTypeEnum.InTray)).Count(); |
| | | if (item.Count() - number <= 0) |
| | | { |
| | | continue; |
| | | } |
| | | result.Add(item.Key, item.Count() - number); |
| | | } |
| | | |
| | |
| | | |
| | | if (stationList.Count > 1) |
| | | { |
| | | var task = _taskRepository.QueryData(x => x.Roadway == stationList.FirstOrDefault().Roadway).OrderByDescending(x => x.CreateDate).FirstOrDefault(); |
| | | var task = _taskRepository.QueryData(x => x.Roadway == stationList.FirstOrDefault().Roadway && x.TaskType == (int)TaskInboundTypeEnum.Inbound).OrderByDescending(x => x.CreateDate).FirstOrDefault(); |
| | | if (task != null) station = stationList.Where(x => x.stationChildCode != task.NextAddress && x.stationChildCode != task.CurrentAddress).FirstOrDefault(); |
| | | else station = stationList.FirstOrDefault(); |
| | | } |
| | |
| | | TaskNum = _taskRepository.GetTaskNo().Result, |
| | | Creater = "Systeam", |
| | | PVI = json.PVI, |
| | | |
| | | CarType = carInfo.CarType, |
| | | RoadwayNo = station.RoadwayNo |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | |