| | |
| | | VOLContext context = new VOLContext(); |
| | | Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(context); |
| | | IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(context); |
| | | string json = string.Empty; |
| | | foreach (var Key in saveModel.DelKeys) |
| | | { |
| | | try |
| | | { |
| | | var station = repository.Find(x => x.id.ToString() == Key.ToString()).FirstOrDefault(); |
| | | json = json + station.stationCode + ","; |
| | | if (!station.stationCode.Contains("X") && !station.stationCode.Contains("W01001004") && !station.stationCode.Contains("W01001005")) throw new Exception($"æ {station.stationCode}ä½¿ç¨æéï¼"); |
| | | if (!station.enable) throw new Exception($"{station.stationCode}æªå¯ç¨ï¼"); |
| | | if (station.location_state == LocationStateEnum.Abnormal.ToString()) throw new Exception($"{station.stationCode}ç¶æå¼å¸¸ï¼"); |
| | |
| | | Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(context); |
| | | IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(context); |
| | | string completor = UserContext.Current.UserName; |
| | | object json = null; |
| | | //List<object> jsons = null; |
| | | foreach (var Key in saveModel.DelKeys) |
| | | { |
| | | try |
| | |
| | | jobID = station.Number, |
| | | agv_TrayStatus = station.tray_status |
| | | }; |
| | | json = agvtask; |
| | | //jsons.Add(agvtask); |
| | | agvtaskRepository.Add(agvtask, true); |
| | | station.location_state = LocationStateEnum.InBusy.ToString(); |
| | | repository.Update(station, x => new { x.location_state }, true); |
| | |
| | | webResponse.Error(webResponse.Message += ex.Message); |
| | | } |
| | | } |
| | | WriteDBLog.Write($"æå¨ä¸æä»»å¡ ", new { ä¿¡æ¯ = webResponse.Message, æ°æ® = json }, LogState.Sucess, "WMS", completor); |
| | | WriteDBLog.Write($"æå¨ä¸æä»»å¡ ", new { ä¿¡æ¯ = webResponse.Message }, LogState.Sucess, "WMS", completor); |
| | | return webResponse; |
| | | } |
| | | |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | VOLContext volContext = new VOLContext(); |
| | | Idt_stationinfoRepository dsta = new dt_stationinfoRepository(volContext); |
| | | string[] stationCodes = { "A", "S", "X", "W", "DD", "B", "C", "D01" }; |
| | | string[] stationCodes = { "W", "A", "B", "C", "D01" }; |
| | | List<Tuple<List<dt_stationinfo>, int>> responseData = new List<Tuple<List<dt_stationinfo>, int>>(); |
| | | foreach (string code in stationCodes) |
| | | { |
| | |
| | | return content; |
| | | } |
| | | |
| | | public WebResponseContent pcs_dt_stationinfolist() |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | VOLContext volContext = new VOLContext(); |
| | | Idt_stationinfoRepository dsta = new dt_stationinfoRepository(volContext); |
| | | string[] stationCodes = { "X01", "X02", "X03", "S", "DD001" }; |
| | | List<Tuple<List<dt_stationinfo>>> responseData = new List<Tuple<List<dt_stationinfo>>>(); |
| | | foreach (string code in stationCodes) |
| | | { |
| | | var data = dsta.Find(_ => true).Where(a => a.stationCode.Contains(code)).OrderBy(a => a.stationCode).ToList(); |
| | | responseData.Add(Tuple.Create(data)); |
| | | } |
| | | content.Data = responseData; |
| | | return content; |
| | | } |
| | | |
| | | } |
| | | } |