From 95d3fce1423113a71214b28b30f938a6dd0f2d4a Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Thu, 23 Sep 2021 15:19:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BA=BA=E5=91=98=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SRProjectAchievementController.cs | 32 ++++++++++ .../Views/SRProjectAchievement/IndexYJ.cshtml | 34 ++++++++++ .../Views/SRProjectAchievement/IndexYJ.js | 63 +++++++++++++++++++ .../Learun.Application.Web.csproj | 2 + .../SRProjectAchievementBLL.cs | 25 ++++++++ .../SRProjectAchievementEntity.cs | 5 +- .../SRProjectAchievementIBLL.cs | 1 + .../SRProjectAchievementService.cs | 31 +++++++++ 8 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectAchievement/IndexYJ.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectAchievement/IndexYJ.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectAchievementController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectAchievementController.cs index 05b863816..99ca812ed 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectAchievementController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/SRProjectAchievementController.cs @@ -37,6 +37,16 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers { return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult IndexYJ() + { + return View(); + } + #endregion #region 获取数据 @@ -62,6 +72,28 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers }; return Success(jsonData); } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListTJ(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = sRProjectAchievementIBLL.GetPageListTJ(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } /// /// 获取表单数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectAchievement/IndexYJ.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectAchievement/IndexYJ.cshtml new file mode 100644 index 000000000..3d6d22e33 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectAchievement/IndexYJ.cshtml @@ -0,0 +1,34 @@ +@{ + ViewBag.Title = "项目成果管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+ @*
+
成果名称
+ +
*@ +
+
+
+
+
+
+ +
+
+  打印 +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/CustomFunction/Views/SRProjectAchievement/IndexYJ.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectAchievement/IndexYJ.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectAchievement/IndexYJ.js new file mode 100644 index 000000000..af41cd98e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/SRProjectAchievement/IndexYJ.js @@ -0,0 +1,63 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-09-18 14:58 + * 描 述:项目成果管理 + */ +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); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/CustomFunction/SRProjectAchievement/GetPageListTJ', + headData: [ + { + label: "姓名", name: "ManageName", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', + key: value, + keyId: 'f_userid', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + { label: "参与项目个数", name: "pcount", width: 100, align: "left" }, + { label: "项目成果个数", name: "acount", width: 100, align: "left" }, + ], + mainId: 'ID', + isPage: true + }); + 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 4857d99d2..618231299 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 @@ -938,6 +938,7 @@ + @@ -7346,6 +7347,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementBLL.cs index d2ae432c2..2bc69e6cd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementBLL.cs @@ -43,6 +43,31 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageListTJ(Pagination pagination, string queryJson) + { + try + { + return sRProjectAchievementService.GetPageListTJ(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取SRProjectAchievement表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementEntity.cs index fa163f648..30f7f0f80 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementEntity.cs @@ -76,7 +76,10 @@ namespace Learun.Application.TwoDevelopment.CustomFunction #region 扩展字段 [NotMapped] public string EnCode { get; set; } - + [NotMapped] + public int? acount { get; set; } + [NotMapped] + public int? pcount { get; set; } #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementIBLL.cs index 2a0ef42b2..e3a0341a1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementIBLL.cs @@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetPageListTJ(Pagination pagination, string queryJson); /// /// 获取SRProjectAchievement表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementService.cs index adfaccef4..055db3497 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/SRProjectAchievement/SRProjectAchievementService.cs @@ -64,6 +64,37 @@ s.EnCode } } + public IEnumerable GetPageListTJ(Pagination pagination, string queryJson) + { + try + { + var strSql = @" select t.ManageName,isnull(a.acount,0) as acount,isnull(pcount,0) as pcount from ( + select ManageName from SRProjectAchievement + union + select ManageName from SRProjectPeople + ) t + left join (select ManageName,count(1) as acount from SRProjectAchievement group by ManageName) a on t.ManageName=a.ManageName + left join (select ManageName,count(1) as pcount from SRProjectPeople group by ManageName) b on t.ManageName=b.ManageName + "; + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + + return this.BaseRepository("CollegeMIS").FindList(strSql, dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 获取SRProjectAchievement表实体数据 ///