예제 #1
0
        /// <summary>
        /// 作者:Kylin
        /// 时间:2014.07.28
        /// 描述:区域学员学习进度累积报表
        /// </summary>
        /// <returns></returns>
        //[Authorization(true, true)]
        public ActionResult BranchStudentContractDetail(SearchStudyProgressModel searchModel)
        {
            searchModel.BranchId = LoginUserManager.CurrLoginUser.AreaId;
            searchModel.SearchDate = DateTime.Now;
            searchModel.ProductSCode = searchModel.ProductSCode ?? BaseEnum.EmeEnum<ProductSCode>.GetScodeByValue(ConvertEnum.ProductSCodeForFourD);
            searchModel.RateCourses = CommonHelper.To<decimal>(Global.SyncRateCourseTypes.Split('|')[0].Split(':')[1].Split(',')[1]);

            return View("BranchStudentContractDetail", searchModel);
        }
예제 #2
0
        /// <summary>
        /// 作者:Kylin
        /// 时间:2014.07.28
        /// 描述:Study Progress Total For Area 
        /// </summary>
        /// <param name="searchModel"></param>
        /// <returns></returns>
        public ActionResult SearchProductStudyProgressTotal(SearchStudyProgressModel searchModel)
        {
            ViewBag.SearchStudyProgressModel = searchModel;
            ViewBag.SearchProductStudyProgressTotal = "Y";

            if (searchModel.SearchDate.Date < DateTime.Now.Date) //统计日期小于今天
            {
                var reportModel = new List<StudyProgressTotal>();
                reportModel.AddRange(ServiceReportBLL.GetStudyProgressTotal(searchModel.BranchId, searchModel.SearchDate, BaseEnum.EmeEnum<ProductSCode>.GetScodeByValue(ConvertEnum.ProductSCodeForFourD), decimal.Parse("4.2")));
                reportModel.AddRange(ServiceReportBLL.GetStudyProgressTotal(searchModel.BranchId, searchModel.SearchDate, BaseEnum.EmeEnum<ProductSCode>.GetScodeByValue(ConvertEnum.ProductSCodeForMTeens), decimal.Parse("8.6")));

                if (reportModel.Any())
                {
                    var result = reportModel.GroupBy(g => new
                    {
                        AreaId = searchModel.BranchId,
                        BranchId = g.BranchId,
                        BranchName = g.BranchName,
                    }).Select(p => new StudyProgressTotal()
                    {
                        AreaId = searchModel.BranchId,
                        BranchId = p.Key.BranchId,
                        BranchName = p.Key.BranchName,
                        HighStandard = p.Sum(s => s.HighStandard),
                        BelowStandard = p.Sum(s => s.BelowStandard),
                        HighUsual = p.Sum(s => s.HighUsual),
                        BelowUsual = p.Sum(s => s.BelowUsual),
                        OprDate = searchModel.SearchDate,
                        ProductSCode = searchModel.ProductSCode,
                        RateCourses = searchModel.RateCourses
                    }).ToList();

                    return PartialView("_StudyProgress", reportModel);
                }
                else
                {
                    return PartialView("_ExportStudyProgress", new List<StudyProgressTotal>());
                }
            }
            else
            {
                //直接从业务库统计
                var studyProgressTotal = new List<GetStudyProgressTotal_Result>();
                studyProgressTotal.AddRange(ReportBLL.GetStudyProgressTotal(searchModel.BranchId, searchModel.SearchDate, BaseEnum.EmeEnum<ProductSCode>.GetScodeByValue(ConvertEnum.ProductSCodeForFourD), decimal.Parse("4.2")));
                studyProgressTotal.AddRange(ReportBLL.GetStudyProgressTotal(searchModel.BranchId, searchModel.SearchDate, BaseEnum.EmeEnum<ProductSCode>.GetScodeByValue(ConvertEnum.ProductSCodeForMTeens), decimal.Parse("8.6")));

                var result = studyProgressTotal.GroupBy(g => new
                {
                    AreaId = searchModel.BranchId,
                    BranchId = g.BranchId,
                    BranchName = g.BranchName,
                }).Select(p => new StudyProgressTotal()
                        {
                            AreaId = searchModel.BranchId,
                            BranchId = p.Key.BranchId,
                            BranchName = p.Key.BranchName,
                            HighStandard = p.Sum(s => s.HighStandard),
                            BelowStandard = p.Sum(s => s.BelowStandard),
                            HighUsual = p.Sum(s => s.HighUsual),
                            BelowUsual = p.Sum(s => s.BelowUsual),
                            OprDate = searchModel.SearchDate,
                            ProductSCode = searchModel.ProductSCode,
                            RateCourses = searchModel.RateCourses
                        }).ToList();

                return PartialView("_StudyProgress", result);
            }
        }
예제 #3
0
        public ActionResult SearchStudyProgressTotal(SearchStudyProgressModel searchModel)
        {
            ViewBag.SearchStudyProgressModel = searchModel;
            if (searchModel.SearchDate.Date < DateTime.Now.Date) //统计日期小于今天
            {
                var reportModel = ServiceReportBLL.GetStudyProgressTotal(searchModel.BranchId, searchModel.SearchDate, searchModel.ProductSCode, searchModel.RateCourses);
                return reportModel.Any() ? PartialView("_StudyProgress", reportModel) : PartialView("_ExportStudyProgress", new List<StudyProgressTotal>());
            }
            //直接从业务库统计
            var studyProgressTotal =
                ReportBLL.GetStudyProgressTotal(searchModel.BranchId, searchModel.SearchDate, searchModel.ProductSCode, searchModel.RateCourses)
                    .Select(p => new StudyProgressTotal()
                    {
                        AreaId = searchModel.BranchId,
                        BranchId = p.BranchId,
                        BranchName = p.BranchName,
                        HighStandard = p.HighStandard,
                        BelowStandard = p.BelowStandard,
                        HighUsual = p.HighUsual,
                        BelowUsual = p.BelowUsual,
                        OprDate = searchModel.SearchDate,
                        ProductSCode = searchModel.ProductSCode,
                        RateCourses = searchModel.RateCourses

                    }).ToList();

            return PartialView("_StudyProgress", studyProgressTotal);
        }
예제 #4
0
        /// <summary>
        /// 作者:Kylin 
        /// 时间:2014.07.28
        /// 描述:Study Progress Total For Area 
        /// </summary>
        /// <param name="searchModel"></param>
        /// <returns></returns>
        public ActionResult SearchBranchStudentContractDetail(SearchStudyProgressModel searchModel)
        {
            ViewBag.SearchStudyProgressModel = searchModel;
            var reportModel = ReportBLL.GetBranchStudentStudyDetail(searchModel.BranchId, searchModel.SearchDate, searchModel.ProductSCode, searchModel.RateCourses, searchModel.LastStudyDate);

            var userJobs = UserBLL.GetUserJobListByUserId(LoginUserManager.CurrLoginUser.UserId);
            if (userJobs.Any(p => p.Job.SCode == "CC"))
            {
                reportModel = reportModel.Where(p => p.CCUserId == LoginUserManager.CurrLoginUser.UserId).ToList();
            }

            if (userJobs.Any(p => p.Job.SCode == "SA"))
            {
                reportModel = reportModel.Where(p => p.SAUserId == LoginUserManager.CurrLoginUser.UserId).ToList();
            }
            return PartialView("_BranchStudentContractDetailList", reportModel);
        }