diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/YKTStateMentController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/YKTStateMentController.cs index 490abd3a2..68bbfb88f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/YKTStateMentController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/YKTStateMentController.cs @@ -51,6 +51,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return View(); } + [HttpGet] + public ActionResult AnalysisByMonthForStudent() + { + return View(); + } + #endregion #region 获取数据 @@ -77,6 +83,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success(jsonData); } + [HttpGet] + [AjaxOnly] + public ActionResult GetAnalysisByMonthForStudentPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = yktStateMentIbll.GetAnalysisByMonthForStudentPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + [HttpGet] [AjaxOnly] public ActionResult GetTeacherPageList(string pagination, string queryJson) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.cshtml new file mode 100644 index 000000000..a2dd45d77 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.cshtml @@ -0,0 +1,46 @@ +@{ + ViewBag.Title = "宿舍调换申请"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
+
+
+
系部
+
+
+
+
专业
+
+
+
+
班级
+
+
+
+
月份
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.js new file mode 100644 index 000000000..b31281e78 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/YKTStateMent/AnalysisByMonthForStudent.js @@ -0,0 +1,115 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-07-11 14:34 + * 描 述:宿舍调换申请 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var startTime; + var endTime; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 250, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + $('#DeptNo').lrselect({ + value: "deptno", + text: "deptname", + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', + select: function (item) { + if (item) { + $('#MajorNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', + param: { code: "CdMajorInfo", strWhere: "DeptNo='" + item.deptno + "'" } + }); + } + else { + $('#MajorNo').lrselectRefresh({ + url: "", + data: [] + }); + } + $('#ClassNo').lrselectRefresh({ + url: "", + data: [] + }); + } + }); + $('#MajorNo').lrselect({ + value: "majorno", + text: "majorname", + select: function (item) { + if (item) { + $('#ClassNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', + param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" } + }); + } + + } + }); + + + $('#MajorNo').on("click", + function () { + var data = $('#DeptNo').lrselectGet(); + if (!data) { + learun.alert.error('请先选择系'); + } + }); + $('#ClassNo').on("click", + function () { + var data1 = $('#DeptNo').lrselectGet(); + var data2 = $('#MajorNo').lrselectGet(); + if (!data1 || !data2) { + learun.alert.error('请先选择系和专业'); + } + }); + + $('#ClassNo').lrselect({ + value: "classno", + text: "classname" + }); + $('#Months').lrDataItemSelect({ code: "MonthInt", type:"multiple"}); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/YKTStateMent/GetAnalysisByMonthForStudentPageList', + headData: [ + { label: "学号", name: "StuNo", width: 100, align: "left" }, + { label: "姓名", name: "StuName", width: 100, align: "left" }, + { label: "系部", name: "DeptName", width: 100, align: "left" }, + { label: "专业", name: "MajorName", width: 100, align: "left" }, + { label: "班级", name: "ClassName", width: 100, align: "left" }, + { label: "身份证号", name: "IdentityCardNo", width: 150, align: "left" }, + { label: "消费金额", name: "MONEY", width: 100, align: "left", statistics: true }, + { label: "消费次数", name: "PayTimes", width: 100, align: "left", statistics: true }, + { label: "平均消费金额", name: "PerMoney", width: 100, align: "left", statistics: true } + ], + isPage: true + }); + //page.search(); + }, + search: function (param) { + param = param || {}; + param.StartDate = startTime; + param.EndDate = endTime; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 4e60fe634..96feb9310 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -990,6 +990,7 @@ + @@ -8058,6 +8059,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentBLL.cs index 2c8562094..3589281cc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentBLL.cs @@ -62,6 +62,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public IEnumerable GetAnalysisByMonthForStudentPageList(Pagination paginationobj, string queryJson) + { + try + { + return yKTStateMentService.GetAnalysisByMonthForStudentPageList(paginationobj, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentEntity.cs index 7975449fc..d1420bcf5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentEntity.cs @@ -56,6 +56,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration public string EmpName { get; set; } public string DepartmentName { get; set; } + public string PayTimes { get; set; } + public string PerMoney { get; set; } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentIBLL.cs index 234331c75..74e1df773 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentIBLL.cs @@ -26,7 +26,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration IEnumerable GetTeacherPageList(Pagination pagination, string queryJson); #endregion - - + + IEnumerable GetAnalysisByMonthForStudentPageList(Pagination paginationobj, string queryJson); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentService.cs index a7403e2cd..fd7ebebc0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/YKTStateMent/YKTStateMentService.cs @@ -78,6 +78,57 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + /// + /// 一卡通学生月统计 + /// + /// + /// + /// + public IEnumerable GetAnalysisByMonthForStudentPageList(Pagination pagination, string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + var strSql = new StringBuilder(); + strSql.Append( + @"SELECT C.StuNo,C.StuName,d.DeptName,f.MajorName,e.ClassName,c.identityno as IdentityCardNo, sum(round(A.OPFARE/100,2)) AS MONEY,count(stuno) as PayTimes,round(sum(round(A.OPFARE/100,2))/count(stuno),2) as PerMoney + FROM M_REC_CONSUME@ykt A LEFT JOIN M_BASE_TERM@ykt B ON A.TERMID = B.TERMID + left join ds_stuinfo C on A.OUTID = C.mobile + left join ds_dept d on c.deptno = d.deptno + left join ds_classinfo e on c.classno = e.classno + left join ds_major f on c.majorno=f.majorno + where 1=1 and stuno is not null "); + if (!queryParam["DeptNo"].IsEmpty()) + { + strSql.Append($" AND C.DeptNo='{queryParam["DeptNo"].ToString()}' "); + } + if (!queryParam["MajorNo"].IsEmpty()) + { + strSql.Append($" AND C.MajorNo='{queryParam["MajorNo"].ToString()}' "); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + strSql.Append($" AND C.ClassNo ='{queryParam["ClassNo"].ToString()}' "); + } + if (!queryParam["Months"].IsEmpty()) + { + strSql.Append(" and extract(month from A.OPDT) in("+ queryParam["Months"].ToString() + ")"); + } + strSql.Append("group by C.StuNo, C.StuName,d.DeptNo, d.DeptName, f.MajorName,f.MajorNo, e.ClassNo,e.ClassName, c.identityno"); + return BaseRepository("TLMZYMIDDLEString").FindList(strSql.ToString(), pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } public IEnumerable GetTeacherPageList(Pagination pagination, string queryJson) { @@ -127,6 +178,56 @@ B.TERMNAME,c.EmpNo,c.EmpName,d.Name as DepartmentName,c.identityno as IdentityCa } } + /// + /// 一卡通教师月统计 + /// + /// + /// + /// + public IEnumerable GetAnalysisByMonthForTeacherPageList(Pagination pagination, string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + var strSql = new StringBuilder(); + strSql.Append( + @"SELECT c.EmpNo,c.EmpName,d.Name as DepartmentName,c.identityno as IdentityCardNo, sum(round(A.OPFARE/100,2)) AS MONEY,count(EmpNo) as PayTimes,round(sum(round(A.OPFARE/100,2))/count(EmpNo),2) as PerMoney + FROM M_REC_CONSUME@ykt A LEFT JOIN M_BASE_TERM@ykt B ON A.TERMID = B.TERMID + left join ds_empinfo C on A.OUTID = C.mobile + left join ds_department d on c.departmentid=d.id + where 1=1 and EmpNo is not null "); + if (!queryParam["EmpNo"].IsEmpty()) + { + strSql.Append($" AND C.EmpNo like '%{queryParam["EmpNo"].ToString()}%' "); + } + if (!queryParam["EmpName"].IsEmpty()) + { + strSql.Append($" AND C.EmpName like '%{queryParam["EmpName"].ToString()}%' "); + } + if (!queryParam["DepartmentId"].IsEmpty()) + { + strSql.Append($" AND C.DepartmentId='{queryParam["DepartmentId"].ToString()}' "); + } + if (!queryParam["Months"].IsEmpty()) + { + strSql.Append(" and extract(month from A.OPDT) in(" + queryParam["Months"].ToString() + ")"); + } + strSql.Append("group by c.EmpNo,c.EmpName,d.DepartmentId,d.Name,c.identityno"); + return BaseRepository("TLMZYMIDDLEString").FindList(strSql.ToString(), pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion