123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- 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<AlertInfo> GetAlertInfosPage(string filter, int pageIndex, int pageSize, ref int total)
- {
- return AlertSnapRepository.GetAlertInfosPage(filter, pageIndex, pageSize, ref total);
- }
- public IList<IFixBJTestingPointDI> GetIFixBjPage(string filter, int pageIndex, int pageSize, ref int total)
- {
- return AlertSnapRepository.GetIFixBjPage(filter, pageIndex, pageSize, ref total);
- }
- public IList<AlertInfo> GetAlertInfos()
- {
- return AlertSnapRepository.GetRealTimeAlertInfos();
- }
- public IList<AlertSnap> GetAlertSnaps()
- {
- return AlertSnapRepository.GetRealTimeAlertSnaps();//.GetTop1000Snaps();
- }
- public IList<AlertSnap> GetLatestAlertSnaps(int count)
- {
- return AlertSnapRepository.GetLatestAlertSnaps(count);
- }
- public IList<ShutdownEvent> GetLatestShutdownEvents()
- {
- return AlertSnapRepository.GetLatestShutdownEvents();
- }
- public IList<AlertSnap> GetClosedAlertSnaps()
- {
- return AlertSnapRepository.GetTop1000ClosedSnaps();
- }
- public IList<AlertSnap> 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<DictItem> GetDataDictionary()
- {
- return WindPowerStationRepository.GetDataDictionary();
- }
- public IList<RankingModel> GetStationPieChartData()
- {
- return CustomRepository.GetStationPieChartData();
- }
- public IList<RankingModel> GetRankListData()
- {
- return CustomRepository.GetRankListData();
- }
- public IList<AlertInfo> GetWindturbineAlertInfoByPage(string filter, int pageIndex, int pageSize, ref int total)
- {
- return AlertSnapRepository.GetWindturbineAlertInfoByPage(filter, pageIndex, pageSize, ref total);
- }
- #endregion
- #region 故障fault
- public IList<FaultInfo> GetRealTimeFaultInfos()
- {
- return FaultSnapRepository.GetRealTimeFaultInfos();
- }
- public IList<FaultInfo> GetLatestFaultInfos(int count)
- {
- return FaultSnapRepository.GetLatestFaultInfos(count);
- }
- public IList<FaultInfo> GetFaultInfosByIdList(IList<long> idList)
- {
- return FaultSnapRepository.GetFaultInfoByIdList(idList);
- }
- public IList<FaultSnap> GetFaultSnapByIdList(IList<long> snapIdList) {
- return FaultSnapRepository.GetFaultSnapByIdList(snapIdList);
- }
- public IList<FaultSnap> GetRealTimeFaultSnaps()
- {
- return FaultSnapRepository.GetRealTimeFaultSnaps();
- }
- public IList<FaultInfo> 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<Warning> getUnabledResetWarning()
- {
- return FaultSnapRepository.getUnabledResetWarning();
- }
- #endregion
- #region 通用
- public IList<WindTurbine> GetFDCWindturbinies()
- {
- return WindTurbineRepository.GetFDCWindTurbinies();
- }
- public IList<WindPowerStation> GetWindPowerStations()
- {
- return WindPowerStationRepository.GetWindPowerStations();
- }
- public IList<Project> GetProjects()
- {
- return WindPowerStationRepository.GetProjects();
- }
- public IList<Line> GetLines()
- {
- return WindPowerStationRepository.GetLines();
- }
- public IList<PointMapModel> GetTestingPoints(PointType ptype, string[] uniformcodes)
- {
- IList<PointMapModel> ret = new List<PointMapModel>();
- 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
- }
- }
|