Ejemplo n.º 1
0
 /// <summary>
 /// 处理测试截面查询条件
 /// </summary>
 /// <param name="req"></param>
 /// <param name="ps"></param>
 void DealWithEqualPointsPosition(GetThresholdValueByPointsPositionSearchRequest req, IList <Func <T, bool> > ps)
 {
     if (req.PointsPositionId > 0)
     {
         ps.Add(m => m.PointsNumber.PointsPositionId == req.PointsPositionId);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 处理测点编号查询条件
 /// </summary>
 /// <param name="req"></param>
 /// <param name="ps"></param>
 void DealWithEqualPointsNumber(GetThresholdValueByPointsPositionSearchRequest req, IList <Func <T, bool> > ps)
 {
     if (!string.IsNullOrEmpty(req.PointsNumber))
     {
         ps.Add(m => m.PointsNumber.Name == req.PointsNumber);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 通过测试截面查询阈值列表
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public IEnumerable <T> QueryThresholdValueListByPointsPosition(GetThresholdValueByPointsPositionSearchRequest req)
        {
            IList <Func <T, bool> > ps = new List <Func <T, bool> >();

            DealWithEqualPointsPosition(req, ps);
            return(_thresholdValueSettingDAL.FindBy(ps, PointsNumber_NavigationProperty));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 通过测点编号查询阈值列表
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public T QueryThresholdValueListByPointsNumber(GetThresholdValueByPointsPositionSearchRequest req)
        {
            IList <Func <T, bool> > ps = new List <Func <T, bool> >();

            DealWithEqualPointsNumber(req, ps);
            return(_thresholdValueSettingDAL.FindBy(ps, PointsNumber_NavigationProperty).SingleOrDefault());
        }
        /// <summary>
        /// 通过下拉菜单条件查询阈值列表
        /// </summary>
        /// <param name="conditions"></param>
        /// <returns></returns>
        public ActionResult GetThresholdValueSettingListByPullDownSearchBar(ThresholdValueSearchBarBaseView conditions)
        {
            var req = new GetThresholdValueByPointsPositionSearchRequest
            {
                PointsPositionId = conditions.MornitoringPointsPositionId
            };
            var thresholdValueSettingService = ThresholdValueSettingServiceFactory.GetThresholdValueServiceFrom(conditions.MornitoringTestTypeId);
            var resp       = thresholdValueSettingService.GetThresholdValueListByPointsPosition(req);
            var models     = new List <ThresholdValueView>();
            var resultView = new ThresholdValueSettingView();

            if (resp.Succeed)
            {
                if (resp.IsContainNegative)
                {
                    foreach (var item in resp.ThresholdValueContainNegative)
                    {
                        var resultItem = new ThresholdValueView();
                        resultItem.TestTypeId     = conditions.MornitoringTestTypeId;
                        resultItem.PointsNumber   = item.PointsNumberName;
                        resultItem.PointsNumberId = item.PointsNumberId;
                        resultItem.PositiveFirstLevelThresholdValue  = item.PositiveFirstLevelThresholdValue;
                        resultItem.PositiveSecondLevelThresholdValue = item.PositiveSecondLevelThresholdValue;
                        resultItem.NegativeFirstLevelThresholdValue  = item.NegativeFirstLevelThresholdValue;
                        resultItem.NegativeSecondLevelThresholdValue = item.NegativeSecondLevelThresholdValue;
                        resultItem.IsContainNegative = true;
                        models.Add(resultItem);
                    }
                    resultView.ThresholdValues = models;
                }
                else
                {
                    foreach (var item in resp.ThresholdValuesWithoutNegative)
                    {
                        var resultItem = new ThresholdValueView();
                        resultItem.TestTypeId     = conditions.MornitoringTestTypeId;
                        resultItem.PointsNumber   = item.PointsNumberName;
                        resultItem.PointsNumberId = item.PointsNumberId;
                        resultItem.PositiveFirstLevelThresholdValue  = item.PositiveFirstLevelThresholdValue;
                        resultItem.PositiveSecondLevelThresholdValue = item.PositiveSecondLevelThresholdValue;
                        resultItem.IsContainNegative = false;
                        models.Add(resultItem);
                    }
                    resultView.ThresholdValues = models;
                }
            }
            else
            {
                return(Json(new { color = StyleConstants.RedColor, message = resp.Message }, JsonRequestBehavior.AllowGet));
            }
            return(PartialView("ThresholdValueSettingListPartial", resultView));
        }
        /// <summary>
        /// 通过搜索栏查询阈值列表
        /// </summary>
        /// <param name="conditions"></param>
        /// <returns></returns>
        public ActionResult GetThresholdValueSettingList(QueryPointsNumberConditonView conditions)
        {
            var models          = new List <ThresholdValueView>();
            var resultView      = new ThresholdValueSettingView();
            var resultCondition = GetThresholdValueSearchConditionByConditonPointsNumber(conditions);

            foreach (var item in resultCondition)
            {
                var req = new GetThresholdValueByPointsPositionSearchRequest
                {
                    PointsPositionId = item.PointsPositionId,
                    PointsNumber     = item.PointsName
                };
                var thresholdValueSettingService = ThresholdValueSettingServiceFactory.GetThresholdValueServiceFrom(item.TestTypeId);

                var resultByPointNumber = thresholdValueSettingService.GetThresholdValueListByPointsNumber(req);

                if (resultByPointNumber.IsContainNegative)
                {
                    var resultItem = new ThresholdValueView();
                    resultItem.TestTypeId     = item.TestTypeId;
                    resultItem.PointsNumber   = resultByPointNumber.PointsNumberName;
                    resultItem.PointsNumberId = resultByPointNumber.PointsNumberId;
                    resultItem.PositiveFirstLevelThresholdValue  = resultByPointNumber.PositiveFirstLevelThresholdValue;
                    resultItem.PositiveSecondLevelThresholdValue = resultByPointNumber.PositiveSecondLevelThresholdValue;
                    resultItem.NegativeFirstLevelThresholdValue  = resultByPointNumber.NegativeFirstLevelThresholdValue;
                    resultItem.NegativeSecondLevelThresholdValue = resultByPointNumber.NegativeSecondLevelThresholdValue;
                    resultItem.IsContainNegative = true;
                    models.Add(resultItem);
                }
                else
                {
                    var resultItem = new ThresholdValueView();
                    resultItem.TestTypeId     = item.TestTypeId;
                    resultItem.PointsNumber   = resultByPointNumber.PointsNumberName;
                    resultItem.PointsNumberId = resultByPointNumber.PointsNumberId;
                    resultItem.PositiveFirstLevelThresholdValue  = resultByPointNumber.PositiveFirstLevelThresholdValue;
                    resultItem.PositiveSecondLevelThresholdValue = resultByPointNumber.PositiveSecondLevelThresholdValue;
                    resultItem.IsContainNegative = false;
                    models.Add(resultItem);
                }
                resultView.ThresholdValues = models;
            }

            return(PartialView("ThresholdValueSettingListPartial", resultView));
        }
        public override ThresholdValueResponse GetThresholdValueListByPointsPosition(GetThresholdValueByPointsPositionSearchRequest req)
        {
            var resp = new ThresholdValueResponse();

            try
            {
                var source = QueryThresholdValueListByPointsPosition(req);
                var result = new List <ThresholdValueIncludeNegativeModel>();
                foreach (var item in source)
                {
                    var resultItem = new ThresholdValueIncludeNegativeModel();
                    resultItem.PointsNumberId   = item.PointsNumberId;
                    resultItem.PointsNumberName = item.PointsNumber.Name;
                    resultItem.PositiveFirstLevelThresholdValue  = item.PositiveFirstLevelThresholdValue;
                    resultItem.PositiveSecondLevelThresholdValue = item.PositiveSecondLevelThresholdValue;
                    resultItem.NegativeFirstLevelThresholdValue  = item.NegativeFirstLevelThresholdValue;
                    resultItem.NegativeSecondLevelThresholdValue = item.NegativeSecondLevelThresholdValue;
                    result.Add(resultItem);
                }
                if (HasNoSearchResult(result))
                {
                    resp.Message = "无记录!";
                }
                else
                {
                    resp.ThresholdValuesIncludeNegative = result;
                    resp.Succeed = true;
                }
            }
            catch (Exception ex)
            {
                resp.Message = "搜索阈值列表信息发生错误!";
                Log(ex);
            }
            return(resp);
        }
Ejemplo n.º 8
0
        public ThresholdValueContainNegativeModel GetThresholdValueListByPointsNumber(GetThresholdValueByPointsPositionSearchRequest req)
        {
            var result = new ThresholdValueContainNegativeModel();

            try
            {
                var source = QueryThresholdValueListByPointsNumber(req);
                result.PointsNumberId   = source.PointsNumberId;
                result.PointsNumberName = source.PointsNumber.Name;
                result.PositiveFirstLevelThresholdValue  = source.PositiveFirstLevelThresholdValue;
                result.PositiveSecondLevelThresholdValue = source.PositiveSecondLevelThresholdValue;
                result.NegativeFirstLevelThresholdValue  = source.NegativeFirstLevelThresholdValue;
                result.NegativeSecondLevelThresholdValue = source.NegativeSecondLevelThresholdValue;
                result.IsContainNegative = true;
            }
            catch (Exception ex)
            {
                Log(ex);
            }
            return(result);
        }