/// <summary> /// 获取报表数据 /// </summary> private void GetClassListOfStudentFromDataMart() { try { new Thread(new ThreadStart(() => { classList = RenewService.GetClassListOfStudent(CurrUserInfo.SchoolId, studentCode, classStatus); CurrActivity.RunOnUiThread(() => { LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; if (classList != null && classList.Count > 0) { mAdapter.SetData(classList); mAdapter.NotifyDataSetChanged(); } else { mSwipeRefreshLayout.Visibility = ViewStates.Gone; ll_none.Visibility = ViewStates.Visible; } }); })).Start(); } catch (Exception ex) { var msg = ex.Message.ToString(); LoadingDialogUtil.DismissLoadingDialog(); } }
public void BindData() { LoadingDialogUtil.ShowLoadingDialog(CurrActivity, "获取数据中..."); try { var schoolId = CurrUserInfo.SchoolId; var year = searchQuarter.Year; var quarter = searchQuarter.Quarter; var district = searchDistrict; var course = searchCourse; var grade = ""; if (searchGradeList.Any()) { grade = string.Join(",", searchGradeList.ToArray()); } var areaCodes = ""; //店长登录用 if (CurrUserInfo.Type == (int)UserType.ShopManager) { areaCodes = CurrUserInfo.AreaCodes; } new System.Threading.Thread(new ThreadStart(() => { var list = SumService.GetSumPaymentListByArea(schoolId, year, quarter, dataType, sortType, district, grade, course, out totalCount, 1, 1, 500, areaCodes); CurrActivity.RunOnUiThread(() => { LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; if (list != null) { var totalData = list.TotalData; this.avgGrowthRate = totalData.GrowthRate; this.sumList = list.List; var totalEntity = new PaymentSumAreaEntity() { Name = "总计", CurrentSum = totalData.CurrentSum, LastYearSum = totalData.LastYearSum, GrowthRate = totalData.GrowthRate }; this.sumList.Add(totalEntity); var gradeListParam = ""; if (searchGradeList.Count != gradeList.Count) { gradeListParam = string.Join(",", searchGradeList.ToArray()); } mAdapter.SetData(this.sumList, this.avgGrowthRate, this.searchQuarter, this.dataType, this.searchCourse); mAdapter.NotifyDataSetChanged(); } }); })).Start(); } catch (Exception ex) { var msg = ex.Message.ToString(); LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; } }
public void BindData() { LoadingDialogUtil.ShowLoadingDialog(CurrActivity, "获取数据中..."); try { var schoolId = CurrUserInfo.SchoolId; var year = searchQuarter.Year; var quarter = searchQuarter.Quarter; var district = searchDistrict; var categoryEntity = categoryEntityList.FirstOrDefault(p => p.CategoryName == searchCagetory); var category = categoryEntity == null?"":categoryEntity.CategoryValue; //负责校区 var areaCodes = ""; //店长登录用 if (CurrUserInfo.Type == (int)UserType.ShopManager) { areaCodes = CurrUserInfo.AreaCodes; } //年级 var gradeList = RenewService.GetGradeList(CurrUserInfo.SchoolId); var grade = string.Join(",", gradeList.Select(p => p.GradeName)); new System.Threading.Thread(new ThreadStart(() => { var list = NewService.GetSumNewStudentList(schoolId, year, quarter, dataType, sortType, district, category, grade, out totalCount, 1, 1, 500, areaCodes); CurrActivity.RunOnUiThread(() => { LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; if (list != null) { var totalData = list.TotalData; this.avgGrowthRate = totalData.Rate; this.sumList = list.List; var totalEntity = new NewStudentSumAreaEntity() { Name = totalData.Name, StudentCount = totalData.StudentCount, Total = totalData.Total, Rate = totalData.Rate }; this.sumList.Add(totalEntity); mAdapter.SetData(this.sumList, this.avgGrowthRate); mAdapter.NotifyDataSetChanged(); } }); })).Start(); } catch (Exception ex) { var msg = ex.Message.ToString(); LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; } }
public void BindData() { try { if (!NetUtil.CheckNetWork(CurrActivity)) { ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!"); return; } LoadingDialogUtil.ShowLoadingDialog(CurrActivity, "获取数据中..."); var schoolId = CurrUserInfo.SchoolId; var grade = ""; if (searchGradeList.Any()) { grade = string.Join(",", searchGradeList.ToArray()); } //加校区查询权限判断--店长登录 var areaCodes = ""; if (CurrUserInfo.Type == (int)UserType.ShopManager) { areaCodes = CurrUserInfo.AreaCodes; } new Thread(new ThreadStart(() => { var list = SumService.GetSumPaymentListByTeacher(schoolId, year, quarter, dataType, sortType, areaCode, grade, searchCourse); CurrActivity.RunOnUiThread(() => { LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; if (list != null) { sumTeacherList = list.List; //添加合计行 sumTeacherList.Add(list.TotalData); mAdapter.SetData(sumTeacherList); mAdapter.NotifyDataSetChanged(); } }); })).Start(); } catch (Exception ex) { //var msg = ex.Message.ToString(); LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; } }
/// <summary> /// 获取报表数据 /// </summary> public void BindData() { try { if (!NetUtil.CheckNetWork(CurrActivity)) { ToastUtil.ShowWarningToast(CurrActivity, "网络未连接!"); return; } LoadingDialogUtil.ShowLoadingDialog(CurrActivity, "获取数据中..."); var schoolId = CurrUserInfo.SchoolId; var year = searchQuarter.Year; var quarter = searchQuarter.Quarter; var district = searchDistrict; //加校区查询权限判断--店长登录 var areaCodes = ""; if (CurrUserInfo.Type == (int)UserType.ShopManager) { areaCodes = CurrUserInfo.AreaCodes; } new Thread(new ThreadStart(() => { var list = BudgetService.GetAreaPaymentList(schoolId, year, quarter, district, sortType, dataType, areaCodes); CurrActivity.RunOnUiThread(() => { LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; if (list != null) { paymentList = list; mAdapter.SetData(paymentList); mAdapter.NotifyDataSetChanged(); } }); })).Start(); } catch (Exception ex) { var msg = ex.Message.ToString(); LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; } }
/// <summary> /// 获取报表数据 /// </summary> private void GetRenewInfoInGroup() { try { new Thread(new ThreadStart(() => { var gradeStr = ""; if (searchGradeList.Any()) { gradeStr = string.Join(",", searchGradeList.ToArray()); } var districtStr = ""; if (!string.IsNullOrEmpty(searchDistrict) && !searchDistrict.Equals("全部区域")) { districtStr = searchDistrict; } var result = RenewService.GetRenewInfoInGroup(CurrUserInfo.SchoolId, searchQuarter.Year, searchQuarter.Quarter, gradeStr, districtStr, 1, 6, 1, 30, classStatus); CurrActivity.RunOnUiThread(() => { LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; if (result != null) { teachReportList = result.RenewInfo; mAdapter.SetData(teachReportList); mAdapter.NotifyDataSetChanged(); } }); })).Start(); } catch (Exception ex) { var msg = ex.Message.ToString(); LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; } }
/// <summary> /// 获取续班率,返回如:{"State":1,"Data":[{"SchoolId":1,"Year":2017,"Season":2,"Type":1,"RenewRate":0.3209},{"SchoolId":1,"Year":2017,"Season":2,"Type":2,"RenewRate":0.2541},{"SchoolId":1,"Year":2017,"Season":2,"Type":3,"RenewRate":0.2920}],"Error":null,"DataCount":0} /// </summary> private void GetRenewData() { var schoolId = CurrUserInfo.SchoolId; try { var currQuarter = BaseApplication.GetInstance().quarterList.FirstOrDefault(p => p.IsCurrent); if (currQuarter != null) { year = currQuarter.Year; quarter = currQuarter.Quarter; } tvTitle1.Text = string.Format("{0}财年Q{1}续班率", year, quarter); tvTitle2.Text = string.Format("{0}财年Q{1}续班率排名", year, quarter); tvBudgetTitle.Text = string.Format("{0}财年{1}预算完成率", year, quarter); try { #region 教学模块 new Thread(new ThreadStart(() => { var renewList = RenewService.GetIndexRenewInfoByDepartment(schoolId, year, quarter); CurrActivity.RunOnUiThread(() => { //初中续班率 var middleInfo = renewList.FirstOrDefault(p => p.Type == 1); if (middleInfo != null) { tvRate1.Text = (middleInfo.RenewRate * 100).ToString("f1") + "%"; } else { tvRate1.Text = "0.0%"; } //高中续班率 var hightInfo = renewList.FirstOrDefault(p => p.Type == 2); if (hightInfo != null) { tvRate2.Text = (hightInfo.RenewRate * 100).ToString("f1") + "%"; } else { tvRate2.Text = "0.0%"; } }); })).Start(); var grade = ""; if (BaseApplication.GetInstance().gradeList != null) { grade = string.Join(",", BaseApplication.GetInstance().gradeList.Select(t => t.GradeName).ToArray()); } // 前三名 new Thread(new ThreadStart(() => { var beforeList = RenewService.GetIndexRenewInfoInGroup(schoolId, year, quarter, grade, "", 0, 6, 1, 3); CurrActivity.RunOnUiThread(() => { InitRenewViews(beforeList, 6); }); })).Start(); // 后三名 new Thread(new ThreadStart(() => { var lastList = RenewService.GetIndexRenewInfoInGroup(schoolId, year, quarter, grade, "", 0, 5, 1, 3); CurrActivity.RunOnUiThread(() => { InitRenewViews(lastList, 5); }); })).Start(); #endregion #region 区域模块 new Thread(new ThreadStart(() => { //query //6-按预算完成率倒序排 int sortType = 6; //1-预收款 int dataType = 1; var allBudgetlist = BudgetService.GetAreaPaymentList(schoolId, year, quarter, "", sortType, dataType); //预收款与完成率 取总计行 var budget = "0"; var completionRate = "0.0%"; var totalModel = allBudgetlist.FirstOrDefault(p => p.AreaName == "总计"); if (totalModel != null) { budget = (totalModel.Budget / 10000).ToString("f1"); completionRate = (totalModel.CompletionRate * 100).ToString("f1") + "%"; } PaymentEntity[] budgetBefore = new PaymentEntity[3]; PaymentEntity[] budgetAfter = new PaymentEntity[3]; if (allBudgetlist.Count > 0) { //移除总计行后,取前三名&后三名 allBudgetlist.RemoveAt(allBudgetlist.Count - 1); //移除营收目标=0的行 allBudgetlist.RemoveAll(p => p.Budget == 0); } var budgetCount = allBudgetlist.Count; if (allBudgetlist.Count > 3) { budgetCount = 3; } if (budgetCount > 0) { allBudgetlist.CopyTo(0, budgetBefore, 0, budgetCount); allBudgetlist.CopyTo(allBudgetlist.Count - budgetCount, budgetAfter, 0, budgetCount); budgetBefore = budgetBefore.Where(t => t != null).ToArray(); budgetAfter = budgetAfter.Where(t => t != null).ToArray(); } CurrActivity.RunOnUiThread(() => { //预收款 tvBudget.Text = budget; //预收款完成率 tvBudgetRate.Text = ((totalModel != null && totalModel.Budget == 0) ? "--" : completionRate); //前三名 InitBudgetViews(budgetBefore.ToList(), true); //后三名 InitBudgetViews(budgetAfter.Reverse().ToList(), false); mSwipeRefreshLayout.Refreshing = false; }); })).Start(); #endregion } catch (Exception ex) { var msg = ex.Message.ToString(); } } catch (Exception ex) { var msg = ex.Message.ToString(); } }