| | |
| | | using WIDESEA_WCS.IRepositories; |
| | | using Microsoft.AspNetCore.Mvc.RazorPages; |
| | | using Newtonsoft.Json; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_WCS.Repositories; |
| | | using WIDESEA_Comm; |
| | | |
| | | namespace WIDESEA_WCS.Services |
| | | { |
| | |
| | | //å¤ç§æ·ä¼ç¨å°è¿init代ç ï¼å
¶ä»æ
åµå¯ä»¥ä¸ç¨ |
| | | //base.Init(dbRepository); |
| | | } |
| | | /// <summary> |
| | | /// 模å¼1 |
| | | /// </summary> |
| | | /// <param name="v"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent UpdateAuto(string v) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | VOLContext context = new VOLContext(); |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context); |
| | | var stations = stationinfoRepository.Find(x => x.stationCode == "X01001001" || x.stationCode == "X01001002" || x.stationCode == "X02001001" || x.stationCode == "X02001002").ToList(); |
| | | if (stations.Where(x => x.tray_status == TrayStateEnum.StrogeTray.ToString()).Any()) |
| | | return content.Error("设置为模å¼1失败ï¼ä¸æä½åå¨è½¦è½®ï¼"); |
| | | |
| | | var model = JsonConvert.DeserializeObject<dt_pattern>(v); |
| | | model.pattern_state = 1; |
| | | var cont = _repository.Update(model, true); |
| | | if (cont > 0) |
| | | content.OK(model.pattern_name + "设置为èªå¨å
¥åºæåï¼"); |
| | | content.OK(model.pattern_name + "设置为模å¼1æåï¼"); |
| | | else |
| | | content.Error(model.pattern_name + "设置为èªå¨å
¥åºå¤±è´¥ï¼"); |
| | | content.Error(model.pattern_name + "设置为模å¼1失败ï¼"); |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// 模å¼2 |
| | | /// </summary> |
| | | /// <param name="v"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent UpdateManual(string v) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | VOLContext context = new VOLContext(); |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context); |
| | | var stations = stationinfoRepository.Find(x => x.stationCode == "X01001001" || x.stationCode == "X01001002" || x.stationCode == "X02001001" || x.stationCode == "X02001002").ToList(); |
| | | if (stations.Where(x => x.tray_status == TrayStateEnum.StrogeTray.ToString()).Any()) |
| | | return content.Error("设置为模å¼2失败ï¼ä¸æä½åå¨è½¦è½®ï¼"); |
| | | var model = JsonConvert.DeserializeObject<dt_pattern>(v); |
| | | model.pattern_state = 0; |
| | | var cont = _repository.Update(model, true); |
| | | if (cont > 0) |
| | | content.OK(model.pattern_name + "设置为æå¨å
¥åºæåï¼"); |
| | | content.OK(model.pattern_name + "设置为模å¼2æåï¼"); |
| | | else |
| | | content.Error(model.pattern_name + "设置为æå¨å
¥åºå¤±è´¥ï¼"); |
| | | content.Error(model.pattern_name + "设置为模å¼2失败ï¼"); |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | | } |