| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net.NetworkInformation; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Information; |
| | |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using static OfficeOpenXml.ExcelErrorValue; |
| | | |
| | | namespace WIDESEAWCS_TaskInfoService |
| | | { |
| | |
| | | { |
| | | OrderByParameters = new Dictionary<string, SqlSugar.OrderByType> |
| | | { |
| | | { nameof(Dt_Putake.Pustatus),SqlSugar.OrderByType.Asc }, |
| | | // { nameof(Dt_Putake.CreateDate),SqlSugar.OrderByType.Asc }//æç¶æåå建æ¶é´ååºæåº |
| | | //{ nameof(Dt_Putake.Pustatus),SqlSugar.OrderByType.Asc }, |
| | | { nameof(Dt_Putake.CreateDate),SqlSugar.OrderByType.Desc }//æç¶æåå建æ¶é´éåºæåº |
| | | }; |
| | | return base.GetPageData(options); |
| | | } |
| | |
| | | return new WebResponseContent { Status=false, Message="é误信æ¯ï¼"+ex.Message}; |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent Getstatus() |
| | | { |
| | | try |
| | | { |
| | | //// è·å Pustatus == 0 çä»»å¡ä¸ï¼Dispatchtime ææ©ç䏿¡ |
| | | var result = BaseDal.QueryData(x => x.Pustatus == 0); |
| | | if (result == null) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "没æ¾å°è¯¥ä»»å¡" }; |
| | | } |
| | | return new WebResponseContent { Status = true, Data=new { result } }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "é误信æ¯ï¼" + ex.Message }; |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent OpenDoor(string group) |
| | | { |
| | | try |
| | | { |
| | | OtherDevice otherDevice = (OtherDevice)Storage.Devices.Find(x => x.DeviceName == "PLC"); |
| | | if (otherDevice == null) return new WebResponseContent { Status = false, Message = "æªè¿æ¥" }; |
| | | if (group=="çµæ°") |
| | | { |
| | | var values = otherDevice.Communicator.Read<bool>("M27"); |
| | | } |
| | | if(group=="æºæ¢°") |
| | | { |
| | | var values = otherDevice.Communicator.Read<bool>("M29"); |
| | | } |
| | | if (group == "å°æ²") |
| | | { |
| | | var values = otherDevice.Communicator.Read<bool>("M31"); |
| | | var values2 = otherDevice.Communicator.Read<bool>("M33"); |
| | | } |
| | | return new WebResponseContent { Status = true,Message=$"{group}ç»å¼é¨æå" }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = ex.Message }; |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent ClosedDoor(string group) |
| | | { |
| | | try |
| | | { |
| | | OtherDevice otherDevice = (OtherDevice)Storage.Devices.Find(x => x.DeviceName == "PLC"); |
| | | if (otherDevice == null) return new WebResponseContent { Status = false, Message = "æªè¿æ¥" }; |
| | | if (group == "çµæ°") |
| | | { |
| | | var values = otherDevice.Communicator.Read<bool>("M28"); |
| | | } |
| | | if (group == "æºæ¢°") |
| | | { |
| | | var values = otherDevice.Communicator.Read<bool>("M30"); |
| | | } |
| | | if (group == "å°æ²") |
| | | { |
| | | var values = otherDevice.Communicator.Read<bool>("M32"); |
| | | var values2 = otherDevice.Communicator.Read<bool>("M34"); |
| | | } |
| | | return new WebResponseContent { Status = true, Message = $"{group}ç»å
³é¨æå" }; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = ex.Message }; |
| | | } |
| | | } |
| | | } |
| | | } |