diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/ArchiveUserController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/ArchiveUserController.cs index d6069027f..31f2f31db 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/ArchiveUserController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/ArchiveUserController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.CustomFunction; using System.Web.Mvc; using System.Collections.Generic; +using System.Linq; namespace Learun.Application.Web.Areas.CustomFunction.Controllers { @@ -16,6 +17,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers public class ArchiveUserController : MvcControllerBase { private ArchiveUserIBLL archiveUserIBLL = new ArchiveUserBLL(); + private ArchiveInfoIBLL archiveInfoIBLL = new ArchiveInfoBLL(); #region 视图功能 @@ -26,7 +28,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +37,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } /// /// 表单页 @@ -64,7 +66,16 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers { return View(); } - + /// + /// 统计 + /// + /// + [HttpGet] + public ActionResult IndexTJ() + { + return View(); + } + #endregion @@ -91,18 +102,46 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers }; return Success(jsonData); } - - /// - /// 获取页面显示列表数据 - /// - /// 查询参数 - /// - [HttpGet] + + /// + /// 档案统计 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListTJ(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = archiveInfoIBLL.GetPageList(paginationobj, queryJson); + var useData = archiveUserIBLL.GetUseList(); + foreach (var item in data) + { + var list = useData.Where(x => x.ArchiveId == item.Id); + item.jyNum = list.Where(x => x.Type == "借阅").Count(); + item.ghNum = list.Where(x => x.Type == "归还").Count(); + } + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + [HttpGet] [AjaxOnly] public ActionResult GetList(string queryJson) { var data = archiveUserIBLL.GetList(queryJson); - + return Success(data); } /// @@ -114,8 +153,9 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var ArchiveUserData = archiveUserIBLL.GetArchiveUserEntity( keyValue ); - var jsonData = new { + var ArchiveUserData = archiveUserIBLL.GetArchiveUserEntity(keyValue); + var jsonData = new + { ArchiveUser = ArchiveUserData, }; return Success(jsonData); @@ -148,7 +188,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { ArchiveUserEntity entity = strEntity.ToObject(); - archiveUserIBLL.SaveEntity(keyValue,entity); + archiveUserIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ArchiveUser/IndexTJ.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ArchiveUser/IndexTJ.cshtml new file mode 100644 index 000000000..f0a2755d3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ArchiveUser/IndexTJ.cshtml @@ -0,0 +1,46 @@ +@{ + ViewBag.Title = "档案利用"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+ @*
+
+
+
档案分类
+
+
+
+
文号
+ +
+
+
提名
+ +
+
+
件号
+ +
+
+
*@ +
+
+
+
+ +
+
+  打印 +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/CustomFunction/Views/ArchiveUser/IndexTJ.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ArchiveUser/IndexTJ.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ArchiveUser/IndexTJ.js new file mode 100644 index 000000000..0729e243c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ArchiveUser/IndexTJ.js @@ -0,0 +1,158 @@ +/* + * 描 述:档案统计 + */ +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); + $('#ArchiveId').lrDataSourceSelect({ code: 'ArchiveInfo', value: 'id', text: 'name' }); + $('#Type').lrDataItemSelect({ code: 'ArchiveType' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 借阅 + $('#lr_jy').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status != '1' && Status != '0') { + return learun.alert.warning("当前状态无法借阅!"); + } + learun.layerForm({ + id: 'form', + title: '借阅', + url: top.$.rootUrl + '/CustomFunction/ArchiveUser/Form?ArchiveId=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + //销毁 + $('#lr_xh').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认销毁该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/ArchiveUser/XHForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //移交 + $('#lr_yj').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认移交该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/ArchiveUser/YJForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + + // 归还 + $('#lr_gh').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status != '2') { + return learun.alert.warning("选中项未借阅,无需归还!"); + } + learun.layerForm({ + id: 'form', + title: '归还', + url: top.$.rootUrl + '/CustomFunction/ArchiveUser/FormGH?ArchiveId=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 利用记录 + $('#lr_data').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + var Name = $('#gridtable').jfGridValue('Name'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: Name + '--利用记录', + url: top.$.rootUrl + '/CustomFunction/ArchiveUser/IndexData?ArchiveId=' + keyValue, + width: 1000, + height: 600, + btn: null + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/CustomFunction/ArchiveUser/GetPageListTJ', + headData: [ + { label: "档案名称", name: "Name", width: 100, align: "left" }, + { + label: "档案分类", name: "Type", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'ArchiveType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "所属案卷", name: "RecordId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ArchiveRecordInfo', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { label: "借阅次数", name: "jyNum", width: 100, align: "left" }, + { label: "归还次数", name: "ghNum", 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 8f6f7e07b..7e55944db 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 @@ + @@ -7266,6 +7267,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveInfo/ArchiveInfoEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveInfo/ArchiveInfoEntity.cs index d5a5875ea..912ec3924 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveInfo/ArchiveInfoEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveInfo/ArchiveInfoEntity.cs @@ -136,6 +136,17 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } #endregion #region 扩展字段 + /// + /// 借阅次数 + /// + [NotMapped] + public int jyNum { get; set; } + /// + /// 归还次数 + /// + [NotMapped] + public int ghNum { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserBLL.cs index 9e90b4b02..648a3c772 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserBLL.cs @@ -65,7 +65,30 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } } - + + /// + /// 获取页面显示列表数据 + /// + /// + public IEnumerable GetUseList() + { + try + { + return archiveUserService.GetUseList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 获取ArchiveUser表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserEntity.cs index 6dc85addc..b79fbb1ad 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserEntity.cs @@ -86,6 +86,12 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } #endregion #region 扩展字段 + /// + /// + /// + [NotMapped] + public int num { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserIBLL.cs index f3b13252a..d082c4c5f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserIBLL.cs @@ -22,6 +22,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction /// IEnumerable GetPageList(Pagination pagination, string queryJson); IEnumerable GetList(string queryJson); + IEnumerable GetUseList(); /// /// 获取ArchiveUser表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserService.cs index 4396652e1..93ed0bd3c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ArchiveUser/ArchiveUserService.cs @@ -111,6 +111,26 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } + public IEnumerable GetUseList() + { + try + { + string sql = " select ArchiveId,[Type],count(1) num from [dbo].[ArchiveUser] group by ArchiveId,[Type]"; + return this.BaseRepository("CollegeMIS").FindList(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 获取ArchiveUser表实体数据 ///