From 82d9a62c8bede5ce2dcfec79ad1d7b2e973ff411 Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 20 May 2022 14:42:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9E=E4=BA=8B=E5=A4=A7=E5=8E=85=20?= =?UTF-8?q?=E4=B8=80=E5=8D=A1=E9=80=9A=E4=BF=A1=E6=81=AF=20=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=BD=99=E9=A2=9D=E5=92=8C=E6=B6=88=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/SSOSystemController.cs | 51 ++++++++++++++----- .../MealCardRunTab/MealCardRunTabBLL.cs | 25 +++++++++ .../MealCardRunTab/MealCardRunTabIBLL.cs | 6 +++ .../MealCardRunTab/MealCardRunTabService.cs | 26 +++++++++- 4 files changed, 93 insertions(+), 15 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs index 0685d5bdc..0f9963165 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs @@ -56,6 +56,7 @@ namespace Learun.Application.Web.Controllers private TeachSwitchIBLL teachSwitchIBLL = new TeachSwitchBLL(); private StuSaverecordIBLL stuSaverecordIBLL = new StuSaverecordBLL(); private StuConsumptionIBLL stuConsumptionIBLL = new StuConsumptionBLL(); + private MealCardRunTabIBLL mealCardRunTabIBLL = new MealCardRunTabBLL(); #region 统一身份认证2.0 /// @@ -1202,19 +1203,32 @@ namespace Learun.Application.Web.Controllers ViewBag.AllCount = allCount; ViewBag.FlowType = flowType; ViewBag.FlowList = JsonConvert.SerializeObject(flowList); - //校园一卡通余额 - ViewBag.StuSaveRecordTotalNum = 0; - var stuSaveRecordList = stuSaverecordIBLL.GetListByAccount(userInfo.account).OrderByDescending(x => x.UPLOADDATE); - if (stuSaveRecordList.Any()) + var card = ""; + if (userInfo.Description == "学生") + { + card = stuInfoData.Where(x => x.StuNo == userInfo.account).Select(x => x.IdentityCardNo).FirstOrDefault(); + } + else if (userInfo.Description == "教师") { - ViewBag.StuSaveRecordTotalNum = stuSaveRecordList.FirstOrDefault().ODDFARE; + card = teacherData.Where(x => x.EmpNo == userInfo.account).Select(x => x.IdentityCardNo).FirstOrDefault(); } + //校园一卡通余额 + ViewBag.StuSaveRecordTotalNum = 0; //红湖付款码余额 ViewBag.StuConsumptionTotalNum = 0; - var stuConsumptionList = stuConsumptionIBLL.GetListByAccount(userInfo.account); - if (stuConsumptionList.Any()) + if (!string.IsNullOrEmpty(card)) { - ViewBag.StuConsumptionTotalNum = stuConsumptionList.Select(x => x.OPFARE.ToDecimal()).Sum(); + var mealCardRunTabList = mealCardRunTabIBLL.GetListByAccount(card).OrderByDescending(x => x.centralTm); + if (mealCardRunTabList.Any()) + { + ViewBag.StuSaveRecordTotalNum = mealCardRunTabList.FirstOrDefault().balance / 10000; + } + + var mealCardRunTabListJY = mealCardRunTabIBLL.GetListByAccount(card); + if (mealCardRunTabListJY.Any()) + { + ViewBag.StuConsumptionTotalNum = Math.Abs(mealCardRunTabListJY.Select(x => x.flowamount.ToDecimal() / 10000).Sum()); + } } //常用链接 var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userInfo.userId); @@ -1532,19 +1546,28 @@ namespace Learun.Application.Web.Controllers ViewBag.AllCount = allCount; ViewBag.FlowType = flowType; ViewBag.FlowList = JsonConvert.SerializeObject(flowList); + var card = ""; + if (userInfo.Description == "学生") + { + card = stuInfoData.Where(x => x.StuNo == userInfo.account).Select(x => x.IdentityCardNo).FirstOrDefault(); + } + else if (userInfo.Description == "教师") + { + card = teacherData.Where(x => x.EmpNo == userInfo.account).Select(x => x.IdentityCardNo).FirstOrDefault(); + } //校园一卡通余额 ViewBag.StuSaveRecordTotalNum = 0; - var stuSaveRecordList = stuSaverecordIBLL.GetListByAccount(userInfo.account).OrderByDescending(x => x.UPLOADDATE); - if (stuSaveRecordList.Any()) + var mealCardRunTabList = mealCardRunTabIBLL.GetListByAccount(card).OrderByDescending(x => x.centralTm); + if (mealCardRunTabList.Any()) { - ViewBag.StuSaveRecordTotalNum = stuSaveRecordList.FirstOrDefault().ODDFARE; + ViewBag.StuSaveRecordTotalNum = mealCardRunTabList.FirstOrDefault().balance / 10000; } //红湖付款码余额 ViewBag.StuConsumptionTotalNum = 0; - var stuConsumptionList = stuConsumptionIBLL.GetListByAccount(userInfo.account); - if (stuConsumptionList.Any()) + var mealCardRunTabListJY = mealCardRunTabIBLL.GetListByAccount(userInfo.IdentityCardNo); + if (mealCardRunTabListJY.Any()) { - ViewBag.StuConsumptionTotalNum = stuConsumptionList.Select(x => x.OPFARE.ToDecimal()).Sum(); + ViewBag.StuConsumptionTotalNum = Math.Abs(mealCardRunTabListJY.Select(x => x.flowamount.ToDecimal() / 10000).Sum()); } //常用链接 var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userInfo.userId); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabBLL.cs index 8edd28800..53e9e38b2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabBLL.cs @@ -216,5 +216,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetListByAccount(string account) + { + try + { + return mealCardRunTabService.GetListByAccount(account); ; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabIBLL.cs index 4ef4c7b0a..63031883d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabIBLL.cs @@ -55,5 +55,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration void SaveEntity(string keyValue, MealCardRunTabEntity entity); #endregion + /// + /// + /// + /// + /// + IEnumerable GetListByAccount(string account); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs index 345b7ecf8..80808978d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MealCardRunTab/MealCardRunTabService.cs @@ -156,7 +156,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); - + if (!queryParam["accountNo"].IsEmpty()) { dp.Add("accountNo", "%" + queryParam["accountNo"].ToString() + "%", DbType.String); @@ -304,5 +304,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetListByAccount(string account) + { + try + { + var user = LoginUserInfo.Get(); + return this.BaseRepository("CollegeMIS").FindList(x => x.personId == account && x.accountName == user.realName); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } } }