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); + } + } + } } }