Пример #1
0
        private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            try
            {
                int     rowhandle = gridView1.FocusedRowHandle;
                DataRow dr        = gridView1.GetDataRow(rowhandle);
                PointDefineGetByPointRequest PointDefineRequest = new PointDefineGetByPointRequest();
                PointDefineRequest.Point = dr["Point"].ToString();
                Jc_DefInfo def = pointDefineService.GetPointDefineCacheByPoint(PointDefineRequest).Data;
                def.Z2  = def.DeviceInfoItem.UpAarmValue;
                def.Z3  = def.DeviceInfoItem.UpDdValue;
                def.Z4  = def.DeviceInfoItem.UpHfValue;
                def.Z6  = def.DeviceInfoItem.DownAarmValue;
                def.Z7  = def.DeviceInfoItem.DownDdValue;
                def.Z8  = def.DeviceInfoItem.DownHfValue;
                def.Bz8 = def.DeviceInfoItem.SeniorGradeAlarmValue1 + "," + def.DeviceInfoItem.SeniorGradeAlarmValue2
                          + "," + def.DeviceInfoItem.SeniorGradeAlarmValue3 + "," + def.DeviceInfoItem.SeniorGradeAlarmValue4;
                def.Bz9 = def.DeviceInfoItem.SeniorGradeTimeValue1 + "," + def.DeviceInfoItem.SeniorGradeTimeValue2
                          + "," + def.DeviceInfoItem.SeniorGradeTimeValue3 + "," + def.DeviceInfoItem.SeniorGradeTimeValue4;
                PointDefineUpdateRequest PointDefineUpdateRequest = new PointDefineUpdateRequest();
                PointDefineUpdateRequest.PointDefineInfo = def;
                pointDefineService.UpdatePointDefine(PointDefineUpdateRequest); //修改测点的基础属性

                _ConfigService.SaveInspection();                                //保存巡检
            }
            catch (Exception ex)
            {
                Basic.Framework.Logging.LogHelper.Error(ex);
            }
        }
Пример #2
0
        /// <summary>
        /// 判断测点是否绑定控制
        /// </summary>
        /// <param name="Point"></param>
        /// <returns></returns>
        public bool GetPointIsBindControl(string point)
        {
            bool rvalue = false;
            PointDefineGetByPointRequest PointDefineRequest = new PointDefineGetByPointRequest();

            PointDefineRequest.Point = point;
            Jc_DefInfo def = pointDefineService.GetPointDefineCacheByPoint(PointDefineRequest).Data;

            if (def != null && def.DevPropertyID == 1 &&
                (def.K1 > 0 ||
                 def.K2 > 0 ||
                 def.K3 > 0 ||
                 def.K4 > 0 ||
                 def.K5 > 0 ||
                 def.K6 > 0 ||
                 def.K7 > 0))
            {//模拟量控制口判断
                rvalue = true;
            }
            if (def != null && def.DevPropertyID == 2 &&
                (def.K1 > 0 ||
                 def.K2 > 0 ||
                 def.K3 > 0))
            {//模拟量控制口判断
                rvalue = true;
            }
            return(rvalue);
        }
Пример #3
0
        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            try
            {
                int     rowhandle = gridView1.FocusedRowHandle;
                DataRow dr        = gridView1.GetDataRow(rowhandle);
                PointDefineGetByPointRequest PointDefineRequest = new PointDefineGetByPointRequest();
                PointDefineRequest.Point = dr["Point"].ToString().Substring(0, 3) + "0000";
                Jc_DefInfo def = pointDefineService.GetPointDefineCacheByPoint(PointDefineRequest).Data;
                Dictionary <string, Dictionary <string, object> > PointItemsList = new Dictionary <string, Dictionary <string, object> >();
                Dictionary <string, object> PointItems = new Dictionary <string, object>();
                PointItems.Add("DefIsInit", true);
                PointItemsList.Add(def.PointID, PointItems);

                //调用服务端批量更新缓存业务来更新,修改为更新定义保存之后的是否发初始化标记,并保存巡检调用驱动预处理发初始化  20170720
                DefineCacheBatchUpdatePropertiesRequest PointDefineUpdateRequest = new DefineCacheBatchUpdatePropertiesRequest();
                PointDefineUpdateRequest.PointItems = PointItemsList;
                pointDefineService.BatchUpdatePointDefineInfo(PointDefineUpdateRequest);

                _ConfigService.SaveInspection();//保存巡检
            }
            catch (Exception ex)
            {
                Basic.Framework.Logging.LogHelper.Error(ex);
            }
        }
Пример #4
0
        /// <summary>根据测点编号查询测点
        /// </summary>
        /// <param name="pointCode"></param>
        /// <returns></returns>
        public static Jc_DefInfo QueryPointByCodeCache(string PointCode)
        {
            //return DEFService.QueryPointByCodeCache(PointCode);
            var req = new PointDefineGetByPointRequest
            {
                Point = PointCode
            };
            var res = PointDefineService.GetPointDefineCacheByPoint(req);

            if (!res.IsSuccess)
            {
                throw new Exception(res.Message);
            }
            return(res.Data);
        }
 private void SensorTypeErrorDisplay_Load(object sender, EventArgs e)
 {
     try
     {
         PointDefineGetByPointRequest PointDefineRequest = new PointDefineGetByPointRequest();
         PointDefineRequest.Point = _point;
         Jc_DefInfo jc_defInfo = pointDefineService.GetPointDefineCacheByPoint(PointDefineRequest).Data;
         if (jc_defInfo != null)
         {
             labelControl1.Text = "实际挂接类型:" + jc_defInfo.RealTypeInfo;
             labelControl2.Text = "当前定义类型:" + jc_defInfo.DevName;
         }
     }
     catch (Exception ex)
     {
         Basic.Framework.Logging.LogHelper.Error(ex);
     }
 }
 public BasicResponse <Jc_DefInfo> GetPointDefineCacheByPoint(PointDefineGetByPointRequest PointDefineRequest)
 {
     return(_PointDefineService.GetPointDefineCacheByPoint(PointDefineRequest));
 }
        /// <summary>
        /// 将R_Call转换成呼叫历史记录,并写入到R_PHJ表中
        /// </summary>
        /// <param name="tempCallInfo"></param>
        public void AddR_PHJInfo(R_CallInfo tempCallInfo)
        {
            //写呼叫历史记录
            R_PhjInfo r_phj = new R_PhjInfo();

            r_phj.Id       = Basic.Framework.Common.IdHelper.CreateLongId().ToString();
            r_phj.Hjlx     = 1;
            r_phj.Bh       = "0";
            r_phj.Yid      = "0";
            r_phj.PointId  = "0";
            r_phj.CallTime = DateTime.Now;
            r_phj.Tsycs    = 0;
            r_phj.State    = tempCallInfo.Type;
            r_phj.Type     = tempCallInfo.CallType;
            //修改,将呼叫卡号及设备写入明细表中
            //if (tempCallInfo.Type == 0)
            //{
            //    r_phj.Card = tempCallInfo.BhContent;
            //}
            //else
            //{
            //    r_phj.Card = tempCallInfo.PointList;
            //}
            r_phj.Username = tempCallInfo.CreateUserName;
            r_phj.IP       = tempCallInfo.CreateClientIP;
            r_phj.Timer    = DateTime.Now;
            r_phj.Flag     = 0;
            r_phj.SysFlag  = 0;
            r_phj.upflag   = "0";
            r_phj.By2      = tempCallInfo.Type.ToString();
            PhjAddRequest phjRequest = new PhjAddRequest();

            phjRequest.PhjInfo = r_phj;
            _R_PhjService.AddPhjToDB(phjRequest);
            //添加呼叫明细表  20180312
            if (tempCallInfo.BhContent != null && tempCallInfo.BhContent.Length > 0)
            {
                string[] bhList;
                if (tempCallInfo.BhContent.Contains("-"))
                {
                    int sBh = int.Parse(tempCallInfo.BhContent.Split('-')[0]);
                    int eBh = int.Parse(tempCallInfo.BhContent.Split('-')[1]);
                    bhList = new string[12];
                    int bhIndex = sBh;
                    for (int i = 0; i < 12; i++)
                    {
                        bhList[i] = bhIndex.ToString();
                        bhIndex++;
                    }
                }
                bhList = tempCallInfo.BhContent.Split(',');
                foreach (string bh in bhList)
                {
                    List <R_PersoninfInfo> tempPerson = _R_PersoninfService.GetPersoninfCacheByBh(new Sys.Safety.Request.R_Personinf.R_PersoninfGetByBhRequest()
                    {
                        Bh = bh
                    }).Data;
                    if (tempPerson.Count > 0)
                    {
                        //写入呼叫人员历史记录明细表中  20180312
                        _Repository.ExecuteNonQuery("global_R_PhjService_AddPhjPersonDetailToDB",
                                                    r_phj.Timer.ToString("yyyyMM"),
                                                    Basic.Framework.Common.IdHelper.CreateLongId().ToString(),
                                                    r_phj.Id,
                                                    tempPerson[0].Yid);
                    }
                }
            }
            if (tempCallInfo.PointList != null && tempCallInfo.PointList.Length > 0)
            {
                string[] pointList = tempCallInfo.PointList.Split(',');
                foreach (string point in pointList)
                {
                    PointDefineGetByPointRequest PointDefineRequest = new PointDefineGetByPointRequest();
                    PointDefineRequest.Point = point;
                    Jc_DefInfo tempPoint = _PersonPointDefineService.GetPointDefineCacheByPoint(PointDefineRequest).Data;
                    if (tempPoint != null)
                    {
                        //写入呼叫人员历史记录明细表中  20180312
                        _Repository.ExecuteNonQuery("global_R_PhjService_AddPhjPointDetailToDB",
                                                    r_phj.Timer.ToString("yyyyMM"),
                                                    Basic.Framework.Common.IdHelper.CreateLongId().ToString(),
                                                    r_phj.Id,
                                                    tempPoint.PointID);
                    }
                }
            }
        }
Пример #8
0
        public BasicResponse <Jc_DefInfo> GetPointDefineCacheByPoint(PointDefineGetByPointRequest PointDefineRequest)
        {
            var responseStr = HttpClientHelper.Post(Webapi + "/v1/PersonPointDefine/GetPointDefineCacheByPoint?token=" + Token, JSONHelper.ToJSONString(PointDefineRequest));

            return(JSONHelper.ParseJSONString <BasicResponse <Jc_DefInfo> >(responseStr));
        }