@@ -3,6 +3,7 @@ using System.Data; | |||||
using Learun.Application.TwoDevelopment.CustomFunction; | using Learun.Application.TwoDevelopment.CustomFunction; | ||||
using System.Web.Mvc; | using System.Web.Mvc; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | |||||
namespace Learun.Application.Web.Areas.CustomFunction.Controllers | namespace Learun.Application.Web.Areas.CustomFunction.Controllers | ||||
{ | { | ||||
@@ -16,6 +17,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||||
public class ArchiveUserController : MvcControllerBase | public class ArchiveUserController : MvcControllerBase | ||||
{ | { | ||||
private ArchiveUserIBLL archiveUserIBLL = new ArchiveUserBLL(); | private ArchiveUserIBLL archiveUserIBLL = new ArchiveUserBLL(); | ||||
private ArchiveInfoIBLL archiveInfoIBLL = new ArchiveInfoBLL(); | |||||
#region 视图功能 | #region 视图功能 | ||||
@@ -26,7 +28,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||||
[HttpGet] | [HttpGet] | ||||
public ActionResult Index() | public ActionResult Index() | ||||
{ | { | ||||
return View(); | |||||
return View(); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 表单页 | /// 表单页 | ||||
@@ -35,7 +37,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||||
[HttpGet] | [HttpGet] | ||||
public ActionResult Form() | public ActionResult Form() | ||||
{ | { | ||||
return View(); | |||||
return View(); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 表单页 | /// 表单页 | ||||
@@ -64,7 +66,16 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||||
{ | { | ||||
return View(); | return View(); | ||||
} | } | ||||
/// <summary> | |||||
/// 统计 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult IndexTJ() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | #endregion | ||||
@@ -91,18 +102,46 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||||
}; | }; | ||||
return Success(jsonData); | return Success(jsonData); | ||||
} | } | ||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
/// <summary> | |||||
/// 档案统计 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageListTJ(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
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); | |||||
} | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | [AjaxOnly] | ||||
public ActionResult GetList(string queryJson) | public ActionResult GetList(string queryJson) | ||||
{ | { | ||||
var data = archiveUserIBLL.GetList(queryJson); | var data = archiveUserIBLL.GetList(queryJson); | ||||
return Success(data); | return Success(data); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -114,8 +153,9 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||||
[AjaxOnly] | [AjaxOnly] | ||||
public ActionResult GetFormData(string keyValue) | public ActionResult GetFormData(string keyValue) | ||||
{ | { | ||||
var ArchiveUserData = archiveUserIBLL.GetArchiveUserEntity( keyValue ); | |||||
var jsonData = new { | |||||
var ArchiveUserData = archiveUserIBLL.GetArchiveUserEntity(keyValue); | |||||
var jsonData = new | |||||
{ | |||||
ArchiveUser = ArchiveUserData, | ArchiveUser = ArchiveUserData, | ||||
}; | }; | ||||
return Success(jsonData); | return Success(jsonData); | ||||
@@ -148,7 +188,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||||
public ActionResult SaveForm(string keyValue, string strEntity) | public ActionResult SaveForm(string keyValue, string strEntity) | ||||
{ | { | ||||
ArchiveUserEntity entity = strEntity.ToObject<ArchiveUserEntity>(); | ArchiveUserEntity entity = strEntity.ToObject<ArchiveUserEntity>(); | ||||
archiveUserIBLL.SaveEntity(keyValue,entity); | |||||
archiveUserIBLL.SaveEntity(keyValue, entity); | |||||
if (string.IsNullOrEmpty(keyValue)) | if (string.IsNullOrEmpty(keyValue)) | ||||
{ | { | ||||
} | } | ||||
@@ -0,0 +1,46 @@ | |||||
@{ | |||||
ViewBag.Title = "档案利用"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
<div class="lr-layout " > | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-left"> | |||||
<div class="lr-layout-tool-item"> | |||||
@*<div id="multiple_condition_query"> | |||||
<div class="lr-query-formcontent"> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">档案分类</div> | |||||
<div id="Type"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">文号</div> | |||||
<input id="DocumentNum" class="form-control"/> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">提名</div> | |||||
<input id="Nomination" class="form-control"/> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">件号</div> | |||||
<input id="PartNum" class="form-control"/> | |||||
</div> | |||||
</div> | |||||
</div>*@ | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/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(); | |||||
} |
@@ -938,6 +938,7 @@ | |||||
<Content Include="Areas\CustomFunction\Views\ArchiveInfo\FormRecord.js" /> | <Content Include="Areas\CustomFunction\Views\ArchiveInfo\FormRecord.js" /> | ||||
<Content Include="Areas\CustomFunction\Views\ArchiveInfo\IndexRecord.js" /> | <Content Include="Areas\CustomFunction\Views\ArchiveInfo\IndexRecord.js" /> | ||||
<Content Include="Areas\CustomFunction\Views\ArchiveUser\FormGH.js" /> | <Content Include="Areas\CustomFunction\Views\ArchiveUser\FormGH.js" /> | ||||
<Content Include="Areas\CustomFunction\Views\ArchiveUser\IndexTJ.js" /> | |||||
<Content Include="Areas\CustomFunction\Views\ArchiveUser\IndexYJ.js" /> | <Content Include="Areas\CustomFunction\Views\ArchiveUser\IndexYJ.js" /> | ||||
<Content Include="Areas\CustomFunction\Views\ArchiveUser\IndexData.js" /> | <Content Include="Areas\CustomFunction\Views\ArchiveUser\IndexData.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonSync\Form.js" /> | <Content Include="Areas\EducationalAdministration\Views\ArrangeLessonSync\Form.js" /> | ||||
@@ -7266,6 +7267,7 @@ | |||||
<Content Include="Areas\CustomFunction\Views\ArchiveUser\IndexData.cshtml" /> | <Content Include="Areas\CustomFunction\Views\ArchiveUser\IndexData.cshtml" /> | ||||
<Content Include="Areas\CustomFunction\Views\ArchiveUser\FormGH.cshtml" /> | <Content Include="Areas\CustomFunction\Views\ArchiveUser\FormGH.cshtml" /> | ||||
<Content Include="Areas\CustomFunction\Views\ArchiveUser\IndexYJ.cshtml" /> | <Content Include="Areas\CustomFunction\Views\ArchiveUser\IndexYJ.cshtml" /> | ||||
<Content Include="Areas\CustomFunction\Views\ArchiveUser\IndexTJ.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | <None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | ||||
<Content Include="Areas\PersonnelManagement\Views\MeetingManagement\IndexOfMyJoin.cshtml" /> | <Content Include="Areas\PersonnelManagement\Views\MeetingManagement\IndexOfMyJoin.cshtml" /> | ||||
<Content Include="Areas\PersonnelManagement\Views\MeetingSignInRecord\IndexAttendance.cshtml" /> | <Content Include="Areas\PersonnelManagement\Views\MeetingSignInRecord\IndexAttendance.cshtml" /> | ||||
@@ -136,6 +136,17 @@ namespace Learun.Application.TwoDevelopment.CustomFunction | |||||
} | } | ||||
#endregion | #endregion | ||||
#region 扩展字段 | #region 扩展字段 | ||||
/// <summary> | |||||
/// 借阅次数 | |||||
/// </summary> | |||||
[NotMapped] | |||||
public int jyNum { get; set; } | |||||
/// <summary> | |||||
/// 归还次数 | |||||
/// </summary> | |||||
[NotMapped] | |||||
public int ghNum { get; set; } | |||||
#endregion | #endregion | ||||
} | } | ||||
} | } | ||||
@@ -65,7 +65,30 @@ namespace Learun.Application.TwoDevelopment.CustomFunction | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public IEnumerable<ArchiveUserEntity> GetUseList() | |||||
{ | |||||
try | |||||
{ | |||||
return archiveUserService.GetUseList(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 获取ArchiveUser表实体数据 | /// 获取ArchiveUser表实体数据 | ||||
/// </summary> | /// </summary> | ||||
@@ -86,6 +86,12 @@ namespace Learun.Application.TwoDevelopment.CustomFunction | |||||
} | } | ||||
#endregion | #endregion | ||||
#region 扩展字段 | #region 扩展字段 | ||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
[NotMapped] | |||||
public int num { get; set; } | |||||
#endregion | #endregion | ||||
} | } | ||||
} | } | ||||
@@ -22,6 +22,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction | |||||
/// <returns></returns> | /// <returns></returns> | ||||
IEnumerable<ArchiveUserEntity> GetPageList(Pagination pagination, string queryJson); | IEnumerable<ArchiveUserEntity> GetPageList(Pagination pagination, string queryJson); | ||||
IEnumerable<ArchiveUserEntity> GetList(string queryJson); | IEnumerable<ArchiveUserEntity> GetList(string queryJson); | ||||
IEnumerable<ArchiveUserEntity> GetUseList(); | |||||
/// <summary> | /// <summary> | ||||
/// 获取ArchiveUser表实体数据 | /// 获取ArchiveUser表实体数据 | ||||
/// </summary> | /// </summary> | ||||
@@ -111,6 +111,26 @@ namespace Learun.Application.TwoDevelopment.CustomFunction | |||||
} | } | ||||
} | } | ||||
public IEnumerable<ArchiveUserEntity> GetUseList() | |||||
{ | |||||
try | |||||
{ | |||||
string sql = " select ArchiveId,[Type],count(1) num from [dbo].[ArchiveUser] group by ArchiveId,[Type]"; | |||||
return this.BaseRepository("CollegeMIS").FindList<ArchiveUserEntity>(sql); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 获取ArchiveUser表实体数据 | /// 获取ArchiveUser表实体数据 | ||||
/// </summary> | /// </summary> | ||||