Exemplo n.º 1
0
        /// <summary>
        /// 周平均值
        /// </summary>
        /// <param name="pointId">测点号</param>
        /// <returns>周平均值</returns>
        public BasicResponse <FactorValueInfo> WeekAverageValue(FactorValueGetRequest factorValueGetRequest)
        {
            var hourResponse = hourService.GetWeekAverageValueByPointId(
                new Jc_HourGetRequest()
            {
                PointId = factorValueGetRequest.PointId
            }
                );

            var factorValueResponse = new BasicResponse <FactorValueInfo>();

            FactorValueInfo factorValueInfo = new FactorValueInfo();

            if (hourResponse.Code == 100)
            {
                if (hourResponse.Data != null)
                {
                    decimal tryParseValue = 0.00M;
                    decimal.TryParse(hourResponse.Data.CountDataValue, out tryParseValue);
                    if (tryParseValue > 0)
                    {
                        factorValueInfo.Value = hourResponse.Data.CountDataValue;
                    }
                }
            }
            factorValueResponse.Data    = factorValueInfo;
            factorValueResponse.Code    = hourResponse.Code;
            factorValueResponse.Message = hourResponse.Message;

            return(factorValueResponse);
        }
        /// <summary>
        /// 计算单个测点的分析基础值
        /// </summary>
        /// <param name="pointid"></param>
        /// <returns></returns>
        private Jc_HourInfo GetHourInfoByPointID(string pointid)
        {
            Jc_HourInfo hourInfo = null;

            try
            {
                IJc_HourService   jc_HourService    = ServiceFactory.Create <IJc_HourService>();
                Jc_HourGetRequest jc_HourGetRequest = new Jc_HourGetRequest();
                jc_HourGetRequest.PointId = pointid;
                var result = jc_HourService.GetWeekAverageValueByPointId(jc_HourGetRequest);
                if (result.Data != null && result.IsSuccess)
                {
                    hourInfo = result.Data;
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error("RatioAlarmProcHandle GetBasicValues Error" + ex.Message);
            }
            return(hourInfo);
        }
Exemplo n.º 3
0
 public BasicResponse <Jc_HourInfo> GetWeekAverageValueByPointId(Jc_HourGetRequest jc_Hourrequest)
 {
     return(hourService.GetWeekAverageValueByPointId(jc_Hourrequest));
 }