/// <summary>
        /// 主页获取最新人工巡检评估结果
        /// </summary>
        /// <returns></returns>
        public SafetyAssessmentResultSearchResponse GetManualInspectionSafetyAssessmentReportResult()
        {
            var result      = new SafetyAssessmentResultSearchResponse();
            var ReportCount = _getManualInspectionSafetyAssessmentReportDAL.FindBy(ServiceConstant.AssessmentResultStateNavigationProperty).Count();

            if (ReportCount > 0)
            {
                var source = _getManualInspectionSafetyAssessmentReportDAL.FindBy(ServiceConstant.AssessmentResultStateNavigationProperty).OrderBy(m => m.ReportTime).Last();
                result.ManualInspectionSafetyAssessmentResult     = source.AssessmentResultState.AssessmentGrade;
                result.ManualInspectionSafetyAssessmentReportTime = DateTimeHelper.FormatDateTime(source.ReportTime);
            }
            else
            {
                result.ManualInspectionSafetyAssessmentResult     = ServiceConstant.NotEvaluated;
                result.ManualInspectionSafetyAssessmentReportTime = ServiceConstant.NotEvaluated;
            }
            return(result);
        }
Esempio n. 2
0
        /// <summary>
        /// 获得最近一次一级安全评估结果的结论
        /// </summary>
        /// <returns></returns>
        public SafetyAssessmentResultSearchResponse GetFirstSafetyAssessmentResult()
        {
            var result      = new SafetyAssessmentResultSearchResponse();
            var ReportCount = _getFirstLevelSafetyAssessmentReportDAL.FindBy().Count();

            if (ReportCount > 0)
            {
                var source = _getFirstLevelSafetyAssessmentReportResultDAL.FindBy(ServiceConstant.ResultsAssessmentReport).OrderBy(m => m.AssessmentReportId).Last();
                result.FirstSafetyAssessmentResult_Displacement = source.DisplacementAssessmentResult.Substring(0, 2);
                result.FirstSafetyAssessmentResult_CableForce   = source.CableForceAssessmentResult.Substring(0, 2);
                result.FirstSafetyAssessmentResult_Stress       = source.StrainAssessmentResult.Substring(0, 2);
                result.FirstSafetyAssessmentReportTime          = DateTimeHelper.FormatDateTime(source.AssessmentReport.ReportTime);
                result.FirstSafetyAssessmentReportTime_DateTime = source.AssessmentReport.ReportTime;
            }
            else
            {
                result.FirstSafetyAssessmentResult_Displacement = ServiceConstant.NotEvaluated;
                result.FirstSafetyAssessmentResult_CableForce   = ServiceConstant.NotEvaluated;
                result.FirstSafetyAssessmentResult_Stress       = ServiceConstant.NotEvaluated;
                result.FirstSafetyAssessmentReportTime          = ServiceConstant.NotEvaluated;
            }
            return(result);
        }