private void Ex() { string lightIsAlwaysOnString = string.Empty; var terminalInfo = this.Argu as Wlst.Sr.EquipmentInfoHolding.Model.WjParaBase; if (terminalInfo == null) { LogInfo.Log("无法执行关灯命令,参数错误...."); return; } //西安 特殊功能 城市代号为5 lvf 2018年4月12日13:07:15 if (Wlst.Sr.EquipmentInfoHolding.Services.Others.CityNum == 5) { var areaId = Sr.EquipmentInfoHolding.Services.AreaInfoHold.MySlef.GetRtuBelongArea(terminalInfo.RtuId); if (LoopId == 0) { for (int i = 1; i < 9; i++) { var tmp = Wlst.Sr.TimeTableSystem.Services.WeekTimeTableInfoService. GetTmlLoopBandTimeTableTodayOpenCloseTimex (areaId, terminalInfo.RtuId, i); if (tmp != null) { if (tmp.TimeOnOff[0].Item2 == 1500) { lightIsAlwaysOnString = terminalInfo.RtuName + " 有长明灯K" + i + "回路 " + terminalInfo.GetLoopName(i); break; } } } } else { var tmp = Wlst.Sr.TimeTableSystem.Services.WeekTimeTableInfoService. GetTmlLoopBandTimeTableTodayOpenCloseTimex (areaId, terminalInfo.RtuId, LoopId); if (tmp != null) { if (tmp.TimeOnOff[0].Item2 == 1500) { lightIsAlwaysOnString = terminalInfo.RtuName + " 有长明灯K" + LoopId + "回路 " + terminalInfo.GetLoopName(LoopId); } } } } if (Wlst.Sr.EquipmentInfoHolding.Services.Others.CloseLightSecondConfirm == 0) { if (lightIsAlwaysOnString != string.Empty) { if ( Cr.MessageBoxOverride.MessageBoxOverride.WlstMessageBox.View.WlstMessageBox.Show( "您将要对 (" + terminalInfo.RtuPhyId + " - " + terminalInfo.RtuName + ") 进行关灯操作,是否继续?\n" + lightIsAlwaysOnString, WlstMessageBoxType.YesNo) == WlstMessageBoxResults.No) { return; } } } else if (Wlst.Sr.EquipmentInfoHolding.Services.Others.CloseLightSecondConfirm == 1) { if ( Cr.MessageBoxOverride.MessageBoxOverride.WlstMessageBox.View.WlstMessageBox.Show( "您将要对 (" + terminalInfo.RtuPhyId + " - " + terminalInfo.RtuName + ") 进行关灯操作,是否继续?\n" + lightIsAlwaysOnString, WlstMessageBoxType.YesNo) == WlstMessageBoxResults.No) { return; } } else if (Wlst.Sr.EquipmentInfoHolding.Services.Others.CloseLightSecondConfirm == 2) { var sss = UMessageBoxWantPassWord.Show("密码验证", "请输入您的用户密码\n" + lightIsAlwaysOnString, ""); if (sss == UMessageBoxWantPassWord.CancelReturn) { return; } if (sss != UserInfo.UserLoginInfo.UserPassword) { UMessageBox.Show("验证失败", "您输入的密码与本用户密码不匹配,请检查......", UMessageBoxButton.Yes); return; } } var rtuId = terminalInfo.RtuId; if (rtuId < 1) { return; } OrderServer.CloseLight(terminalInfo.RtuId, LoopId, lightIsAlwaysOnString != string.Empty ? true : false); //var args = new PublishEventArgs //{ // EventType = PublishEventType.Core, // EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.UserOperateRtu, //}; //args.AddParams(rtuId); //args.AddParams(OpType.RtuClose); //args.AddParams(LoopId); //args.AddParams(terminalInfo.RtuModel); //args.AddParams(null); //EventPublish.PublishEvent(args); //var arg = new List<int>(); //arg.Add(rtuId); //var data = new OpenCloseLightData(); //data.Open = 0; //# 开关灯指令 0 关 1 开 //data.Loops.Add(LoopId); //int gid = Infrastructure.UtilityFunction.TickCount.EnvironmentTickCount; //SndOrderServer .OrderSnd(PPProtocol.EventIdAssign.CloseLight, arg, data, gid); //Wlst.Cr.Core.UtilityFunction.LogInfo.Log(terminalInfo .RtuName + " 关K" + LoopId + ",关灯命令已经发送"); // Wlst.Cr.CoreMims.ShowMsgInfo.ShowNewMsg.AddNewShowMsg(rtuId, terminalInfo.RtuName, LoopId, // PPProtocol.EventIdAssign.CloseLight , "关灯", // "等待", 1, null); }