From 74d567368b882a9430ab24aadd095f8d42f777ec Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 26 Apr 2022 17:51:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E6=9D=90=E5=BE=81=E8=AE=A2=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E7=AE=A1=E7=90=86=20=E6=9C=AA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/TextBookSolSubController.cs | 32 +++++ .../TextBookSolSub/StatisticsIndex.cshtml | 38 ++++++ .../Views/TextBookSolSub/StatisticsIndex.js | 126 ++++++++++++++++++ .../Learun.Application.Web.csproj | 2 + .../TextBookSolSub/TextBookSolSubBLL.cs | 25 ++++ .../TextBookSolSub/TextBookSolSubIBLL.cs | 7 + .../TextBookSolSub/TextBookSolSubService.cs | 72 +++++++++- 7 files changed, 300 insertions(+), 2 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/StatisticsIndex.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/StatisticsIndex.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookSolSubController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookSolSubController.cs index afb09a1f3..b451ecda3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookSolSubController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookSolSubController.cs @@ -38,6 +38,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult StatisticsIndex() + { + return View(); + } #endregion #region 获取数据 @@ -81,6 +90,29 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetStatistics(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = textBookSolSubIBLL.GetStatistics(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/StatisticsIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/StatisticsIndex.cshtml new file mode 100644 index 000000000..78e7028cd --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/StatisticsIndex.cshtml @@ -0,0 +1,38 @@ +@{ + ViewBag.Title = "专业统计"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
专业部
+
+
+
+
学年
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookSolSub/StatisticsIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/StatisticsIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/StatisticsIndex.js new file mode 100644 index 000000000..d3d909bd4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/StatisticsIndex.js @@ -0,0 +1,126 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-12-16 10:14 + * 描 述:长阳迎新 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#DeptNo').lrselect({ + allowSearch: true, + value: "deptno", + text: "deptname", + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', + }); + $('#Grade').lrselect({ + url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetYearListByClass', + value: "year", + text: "year", + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/GetStatistics', + headData: [ + { + { label: "教材号", name: "TextBookNo", width: 150, align: "left" }, + { label: "教材名称", name: "TextBookName", width: 150, align: "left" }, + { label: "出版号", name: "PublishNo", width: 100, align: "left" }, + { + label: "专业部", name: "DeptNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { label: "第一作者", name: "FirstAuthor", width: 100, align: "left" }, + { label: "其他作者", name: "OtherAuthor", width: 100, align: "left" }, + { + label: "出版日期", name: "Pubdate", width: 80, align: "left", + formatter: function (value) { + return learun.formatDate(value, 'yyyy-MM-dd'); + } + }, + { label: "出版社", name: "Publisher", width: 100, align: "left" }, + { + label: "教材类型", name: "TextBookType", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'TextBookType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "教材性质", name: "TextBookNature", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'TextBookNature', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "价格", name: "Price", width: 60, align: "left" }, + { label: "版次", name: "Edition", width: 100, align: "left" }, + { label: "印次", name: "Impression", width: 100, align: "left" }, + { + label: "是否有练习册", name: "IsWorkBook", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "" : + ""; + } + }, + { + label: "是否有教参教辅", name: "IsTeachConsult", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "" : + ""; + } + }, + { label: "内容简介", name: "Description", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 200, align: "left" }, + + ], + mainId: 'DeptNo', + sidx: 'DeptNo asc,MajorNo desc,Grade desc', + isPage: false, + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + 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 fd49c99eb..dc60c3402 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 @@ -1204,6 +1204,7 @@ + @@ -7680,6 +7681,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubBLL.cs index 81242fb4b..6359286f7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubBLL.cs @@ -67,6 +67,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetStatistics(Pagination pagination, string queryJson) + { + try + { + return textBookSolSubService.GetStatistics(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubIBLL.cs index c2ee566e1..e34a3f4ab 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubIBLL.cs @@ -27,6 +27,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// TextBookSolSubEntity GetTextBookSolSubEntity(string keyValue); + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetStatistics(Pagination pagination, string queryJson); + #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubService.cs index 74ddcc0e5..86db55286 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubService.cs @@ -75,7 +75,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("PublishNo", "%" + queryParam["PublishNo"].ToString() + "%", DbType.String); strSql.Append(" AND t.PublishNo Like @PublishNo "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -114,6 +114,74 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetStatistics(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" t.* "); + strSql.Append(" FROM TextBookSolSub t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( t.CreateTime >= @startTime AND t.CreateTime <= @endTime ) "); + } + if (!queryParam["DeptNo"].IsEmpty()) + { + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.DeptNo = @DeptNo "); + } + if (!queryParam["MajorNo"].IsEmpty()) + { + dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); + strSql.Append(" AND t.MajorNo = @MajorNo "); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); + strSql.Append(" AND t.LessonNo = @LessonNo "); + } + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + strSql.Append(" AND t.AcademicYearNo = @AcademicYearNo "); + } + if (!queryParam["Semester"].IsEmpty()) + { + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + strSql.Append(" AND t.Semester = @Semester "); + } + if (!queryParam["PublishNo"].IsEmpty()) + { + dp.Add("PublishNo", "%" + queryParam["PublishNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.PublishNo Like @PublishNo "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 提交数据 @@ -126,7 +194,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.ID == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyValue); } catch (Exception ex) {