using System.Collections.Generic; using GDNXFD.Data; using GDNXFD.Data.Repositories; using System.Linq; using System; using System.Text; namespace GDNXFD.WcfService { public class AlertService : IAlertService { public string GetData(int value) { return string.Format("You entered: {0}", value); } #region 报警模块 public IList GetAlertInfosPage(string filter, int pageIndex, int pageSize, ref int total) { return AlertSnapRepository.GetAlertInfosPage(filter, pageIndex, pageSize, ref total); } public IList GetIFixBjPage(string filter, int pageIndex, int pageSize, ref int total) { return AlertSnapRepository.GetIFixBjPage(filter, pageIndex, pageSize, ref total); } public IList GetAlertInfos() { return AlertSnapRepository.GetRealTimeAlertInfos(); } public IList GetAlertSnaps() { return AlertSnapRepository.GetRealTimeAlertSnaps();//.GetTop1000Snaps(); } public IList GetLatestAlertSnaps(int count) { return AlertSnapRepository.GetLatestAlertSnaps(count); } public IList GetLatestShutdownEvents() { return AlertSnapRepository.GetLatestShutdownEvents(); } public IList GetClosedAlertSnaps() { return AlertSnapRepository.GetTop1000ClosedSnaps(); } public IList GetAlertSnaps2(string stationId, string rank, string category, string category2, string filter, string status) { return AlertSnapRepository.GetAlertSnaps(stationId, rank, category, category2, filter, status); } public void ConfirmAlert(long alertResultId) { AlertSnapRepository.ConfirmAlert(alertResultId); } public void ConfirmAlertPage(string[] ids) { AlertSnapRepository.ConfirmAlertPage(ids); } public void ConfirmAllAlert() { AlertSnapRepository.ConfirmAll(); } public IList GetDataDictionary() { return WindPowerStationRepository.GetDataDictionary(); } public IList GetStationPieChartData() { return CustomRepository.GetStationPieChartData(); } public IList GetRankListData() { return CustomRepository.GetRankListData(); } public IList GetWindturbineAlertInfoByPage(string filter, int pageIndex, int pageSize, ref int total) { return AlertSnapRepository.GetWindturbineAlertInfoByPage(filter, pageIndex, pageSize, ref total); } #endregion #region 故障fault public IList GetRealTimeFaultInfos() { return FaultSnapRepository.GetRealTimeFaultInfos(); } public IList GetLatestFaultInfos(int count) { return FaultSnapRepository.GetLatestFaultInfos(count); } public IList GetFaultInfosByIdList(IList idList) { return FaultSnapRepository.GetFaultInfoByIdList(idList); } public IList GetFaultSnapByIdList(IList snapIdList) { return FaultSnapRepository.GetFaultSnapByIdList(snapIdList); } public IList GetRealTimeFaultSnaps() { return FaultSnapRepository.GetRealTimeFaultSnaps(); } public IList GetFaultInfosPage(string filter, int pageIndex, int pageSize, ref int total) { return FaultSnapRepository.GetFaultInfosPage(filter, pageIndex, pageSize, ref total); } //1-确认 2-复位 3-生成缺陷单 public void ConfirmFault(long snapId, int confirmType, string confirmPerson, long alertSnapId) { FaultSnapRepository.ConfirmFault(snapId, confirmType, confirmPerson,alertSnapId); } public IList getUnabledResetWarning() { return FaultSnapRepository.getUnabledResetWarning(); } #endregion #region 通用 public IList GetFDCWindturbinies() { return WindTurbineRepository.GetFDCWindTurbinies(); } public IList GetWindPowerStations() { return WindPowerStationRepository.GetWindPowerStations(); } public IList GetProjects() { return WindPowerStationRepository.GetProjects(); } public IList GetLines() { return WindPowerStationRepository.GetLines(); } public IList GetTestingPoints(PointType ptype, string[] uniformcodes) { IList ret = new List(); if (ptype == PointType.Windturbine) { var lstAI = WindTurbineRepository.GetWindTurbineAIPoints(uniformcodes); if (lstAI != null && lstAI.Count > 0) { foreach (var obj in lstAI) { PointMapModel pmm = new PointMapModel(); pmm.ObjectId = obj.WindturbineId; pmm.ObjectType = PointType.Windturbine; pmm.DataType = PointDataType.AI; pmm.UniformCode = obj.UniformCode; pmm.PointId = CommonMethod.BuildPointId(obj.Id); if (!ret.Contains(pmm)) ret.Add(pmm); } } var lstDI = WindTurbineRepository.GetWindTurbineDIPoints(uniformcodes); if (lstDI != null && lstDI.Count > 0) { foreach (var obj in lstDI) { PointMapModel pmm = new PointMapModel(); pmm.ObjectId = obj.WindturbineId; pmm.ObjectType = PointType.Windturbine; pmm.DataType = PointDataType.DI; pmm.UniformCode = obj.UniformCode; pmm.PointId = CommonMethod.BuildPointId(obj.Id); if (!ret.Contains(pmm)) ret.Add(pmm); } } } else if (ptype == PointType.Station) { var lstP = WindPowerStationRepository.GetStationTestingPoints(uniformcodes); if (lstP != null && lstP.Count > 0) { foreach (var obj in lstP) { PointMapModel pmm = new PointMapModel(); pmm.ObjectId = obj.StationId; pmm.ObjectType = PointType.Station; pmm.DataType = PointDataType.AI; pmm.UniformCode = obj.UniformCode; pmm.PointId = CommonMethod.BuildPointId(obj.Id); if (!ret.Contains(pmm)) ret.Add(pmm); } } } else { } return ret; } #endregion } }