@@ -0,0 +1,111 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-11-12 09:45 | |||
/// 描 述:图书入库管理 | |||
/// </summary> | |||
public class BookPutInController : MvcControllerBase | |||
{ | |||
private BookPutInIBLL bookPutInIBLL = new BookPutInBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = bookPutInIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var Book_putininfoData = bookPutInIBLL.GetBook_putininfoEntity( keyValue ); | |||
var jsonData = new { | |||
Book_putininfo = Book_putininfoData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
bookPutInIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
Book_putininfoEntity entity = strEntity.ToObject<Book_putininfoEntity>(); | |||
bookPutInIBLL.SaveEntity(keyValue,entity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -6,15 +6,19 @@ | |||
<div class="col-xs-12 lr-form-item" data-table="Book_borrowinfo"> | |||
<div class="lr-form-item-title">图书<font face="宋体">*</font></div> | |||
<div id="BookID" isvalid="yes" checkexpession="NotNull" ></div> | |||
<div id="BookID" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_borrowinfo"> | |||
<div class="lr-form-item-title">借阅时间<font face="宋体">*</font></div> | |||
<input id="BorrowTime" type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" data-dateFmt="yyyy-MM-dd HH:mm:ss" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#BorrowTime').trigger('change'); } })" /> | |||
<input id="BorrowTime" type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" data-dateFmt="yyyy-MM-dd HH:mm:ss" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#BorrowTime').trigger('change'); } })" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_borrowinfo"> | |||
<div class="lr-form-item-title">借阅人<font face="宋体">*</font></div> | |||
<div id="UserId" isvalid="yes" checkexpession="NotNull" ></div> | |||
<div id="UserId" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_borrowinfo"> | |||
<div class="lr-form-item-title">数量</div> | |||
<input id="Amount" type="number" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_borrowinfo"> | |||
<div class="lr-form-item-title">借书证</div> | |||
@@ -0,0 +1,28 @@ | |||
@{ | |||
ViewBag.Title = "图书入库管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_putininfo"> | |||
<div class="lr-form-item-title">图书<font face="宋体">*</font></div> | |||
<div id="BookID" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_putininfo"> | |||
<div class="lr-form-item-title">入库时间<font face="宋体">*</font></div> | |||
<input id="PutInTime" type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" data-dateFmt="yyyy-MM-dd HH:mm:ss" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#PutInTime').trigger('change'); } })" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_putininfo"> | |||
<div class="lr-form-item-title">入库人<font face="宋体">*</font></div> | |||
<div id="UserId" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_putininfo"> | |||
<div class="lr-form-item-title">数量</div> | |||
<input id="Amount" type="number" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_putininfo"> | |||
<div class="lr-form-item-title">审核</div> | |||
<input id="CheckMark" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/BookPutIn/Form.js") |
@@ -0,0 +1,53 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-11-12 09:45 | |||
* 描 述:图书入库管理 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$("#BookID").lrDataSourceSelect({ code: 'BookInfo', value: 'id', text: 'bookname' }); | |||
$("#UserId").lrDataSourceSelect({ code: 'BaseUser', value: 'f_userid', text: 'f_realname' }); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/BookPutIn/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/BookPutIn/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,40 @@ | |||
@{ | |||
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="datesearch"></div> | |||
</div> | |||
<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> | |||
<input id="BookName" type="text" 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_add" class="btn btn-default"><i class="fa fa-plus"></i> 录入</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 修改</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<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/EducationalAdministration/Views/BookPutIn/Index.js") |
@@ -0,0 +1,140 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-11-12 09:45 | |||
* 描 述:图书入库管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var startTime; | |||
var endTime; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 时间搜索框 | |||
$('#datesearch').lrdate({ | |||
dfdata: [ | |||
{ name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||
{ name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||
{ name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||
{ name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } | |||
], | |||
// 月 | |||
mShow: false, | |||
premShow: false, | |||
// 季度 | |||
jShow: false, | |||
prejShow: false, | |||
// 年 | |||
ysShow: false, | |||
yxShow: false, | |||
preyShow: false, | |||
yShow: false, | |||
// 默认 | |||
dfvalue: '1', | |||
selectfn: function (begin, end) { | |||
startTime = begin; | |||
endTime = end; | |||
page.search(); | |||
} | |||
}); | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/BookPutIn/Form', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/BookPutIn/Form?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/BookPutIn/DeleteForm', { keyValue: keyValue}, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/BookPutIn/GetPageList', | |||
headData: [ | |||
{ label: "图书名称", name: "BookName", width: 100, align: "left" }, | |||
{ label: "书籍出版号", name: "ISBN", width: 100, align: "left" }, | |||
{ label: "书籍作者", name: "Author", width: 100, align: "left" }, | |||
{ label: "书籍出版社", name: "Publisher", width: 100, align: "left" }, | |||
{ label: "数量", name: "Amount", width: 100, align: "left" }, | |||
{ label: "入库时间", name: "PutInTime", width: 130, align: "left" }, | |||
{ | |||
label: "入库人姓名", name: "UserId", width: 130, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser', | |||
key: value, | |||
keyId: 'f_userid', | |||
callback: function (_data) { | |||
callback(_data['f_realname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "审核", name: "CheckMark", width: 100, align: "left"}, | |||
], | |||
mainId:'ID', | |||
isPage: true | |||
}); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.StartTime = startTime; | |||
param.EndTime = endTime; | |||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -6,15 +6,19 @@ | |||
<div class="col-xs-12 lr-form-item" data-table="Book_returninfo"> | |||
<div class="lr-form-item-title">图书<font face="宋体">*</font></div> | |||
<div id="BookID" isvalid="yes" checkexpession="NotNull" ></div> | |||
<div id="BookID" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_returninfo"> | |||
<div class="lr-form-item-title">归还时间<font face="宋体">*</font></div> | |||
<input id="ReturnTime" type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" data-dateFmt="yyyy-MM-dd HH:mm:ss" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#ReturnTime').trigger('change'); } })" /> | |||
<input id="ReturnTime" type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" data-dateFmt="yyyy-MM-dd HH:mm:ss" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#ReturnTime').trigger('change'); } })" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_returninfo"> | |||
<div class="lr-form-item-title">归还人<font face="宋体">*</font></div> | |||
<div id="UserId" isvalid="yes" checkexpession="NotNull" ></div> | |||
<div id="UserId" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_returninfo"> | |||
<div class="lr-form-item-title">数量</div> | |||
<input id="Amount" type="number" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Book_returninfo"> | |||
<div class="lr-form-item-title">借书证</div> | |||
@@ -320,6 +320,7 @@ | |||
<Compile Include="Areas\EducationalAdministration\Controllers\ArrangeLessonTermAttemperController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\AwardAndPunishmentController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\AwardPunishInfoController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\BookPutInController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\BookReturnController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\CertificateManageController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\CertificateResultController.cs" /> | |||
@@ -1047,6 +1048,8 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\AwardPunishInfo\AwardIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\AwardPunishInfo\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\AwardPunishInfo\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\BookPutIn\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\BookPutIn\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\BookReturn\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\BookReturn\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\CertificateManage\Form.js" /> | |||
@@ -1312,6 +1315,8 @@ | |||
<Content Include="Areas\AssetManagementSystem\Views\FundsApply\FormView.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\BookReturn\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\BookReturn\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\BookPutIn\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\BookPutIn\Index.cshtml" /> | |||
<None Include="Areas\EducationalAdministration\Views\StuInfoBasic\Printxjk.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuInfoFresh\AllocationClassDC.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuInfoFresh\StatisticClassIndex.js" /> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-11-12 09:45 | |||
/// 描 述:图书入库管理 | |||
/// </summary> | |||
public class Book_putininfoMap : EntityTypeConfiguration<Book_putininfoEntity> | |||
{ | |||
public Book_putininfoMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("BOOK_PUTININFO"); | |||
//主键 | |||
this.HasKey(t => t.ID); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -75,6 +75,7 @@ | |||
<Compile Include="EducationalAdministration\ArrangeLessonTermAttemperMap.cs" /> | |||
<Compile Include="EducationalAdministration\AwardAndPunishmentMap.cs" /> | |||
<Compile Include="EducationalAdministration\AwardPunishInfoMap.cs" /> | |||
<Compile Include="EducationalAdministration\Book_putininfoMap.cs" /> | |||
<Compile Include="EducationalAdministration\Book_returninfoMap.cs" /> | |||
<Compile Include="EducationalAdministration\Book_borrowinfoMap.cs" /> | |||
<Compile Include="EducationalAdministration\Book_cardMap.cs" /> | |||
@@ -0,0 +1,124 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-11-12 09:45 | |||
/// 描 述:图书入库管理 | |||
/// </summary> | |||
public class BookPutInBLL : BookPutInIBLL | |||
{ | |||
private BookPutInService bookPutInService = new BookPutInService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Book_putininfoEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return bookPutInService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Book_putininfo表实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public Book_putininfoEntity GetBook_putininfoEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return bookPutInService.GetBook_putininfoEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
bookPutInService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, Book_putininfoEntity entity) | |||
{ | |||
try | |||
{ | |||
bookPutInService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,49 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-11-12 09:45 | |||
/// 描 述:图书入库管理 | |||
/// </summary> | |||
public interface BookPutInIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<Book_putininfoEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取Book_putininfo表实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
Book_putininfoEntity GetBook_putininfoEntity(string keyValue); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
void SaveEntity(string keyValue, Book_putininfoEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,153 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-11-12 09:45 | |||
/// 描 述:图书入库管理 | |||
/// </summary> | |||
public class BookPutInService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Book_putininfoEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT t.*,b.BookName,b.ISBN,b.Author,b.Publisher "); | |||
strSql.Append(" FROM Book_putininfo t "); | |||
strSql.Append(" left join Book_info b on t.BookID=b.ID "); | |||
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.PutInTime >= @startTime AND t.PutInTime <= @endTime ) "); | |||
} | |||
if (!queryParam["BookName"].IsEmpty()) | |||
{ | |||
dp.Add("BookName", "%" + queryParam["BookName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND b.BookName Like @BookName "); | |||
} | |||
return this.BaseRepository().FindList<Book_putininfoEntity>(strSql.ToString(),dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Book_putininfo表实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public Book_putininfoEntity GetBook_putininfoEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository().FindEntity<Book_putininfoEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository().Delete<Book_putininfoEntity>(t=>t.ID == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, Book_putininfoEntity entity) | |||
{ | |||
try | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository().Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
this.BaseRepository().Insert(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,91 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-11-12 09:45 | |||
/// 描 述:图书入库管理 | |||
/// </summary> | |||
public class Book_putininfoEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// ID | |||
/// </summary> | |||
[Column("ID")] | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// 书籍主键 | |||
/// </summary> | |||
[Column("BOOKID")] | |||
public string BookID { get; set; } | |||
/// <summary> | |||
/// 数量 | |||
/// </summary> | |||
[Column("AMOUNT")] | |||
public int? Amount { get; set; } | |||
/// <summary> | |||
/// 入库人 | |||
/// </summary> | |||
[Column("USERID")] | |||
public string UserId { get; set; } | |||
/// <summary> | |||
/// 入库时间 | |||
/// </summary> | |||
[Column("PUTINTIME")] | |||
public DateTime? PutInTime { get; set; } | |||
/// <summary> | |||
/// 审核 | |||
/// </summary> | |||
[Column("CHECKMARK")] | |||
public string CheckMark { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.ID = Guid.NewGuid().ToString(); | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.ID = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
/// <summary> | |||
/// 书籍名称 | |||
/// </summary> | |||
[NotMapped] | |||
public string BookName { get; set; } | |||
/// <summary> | |||
/// 书籍ISBN | |||
/// </summary> | |||
[NotMapped] | |||
public string ISBN { get; set; } | |||
/// <summary> | |||
/// 书籍作者 | |||
/// </summary> | |||
[NotMapped] | |||
public string Author { get; set; } | |||
/// <summary> | |||
/// 书籍出版社 | |||
/// </summary> | |||
[NotMapped] | |||
public string Publisher { get; set; } | |||
#endregion | |||
} | |||
} | |||
@@ -125,6 +125,10 @@ | |||
<Compile Include="EducationalAdministration\AwardPunishInfo\AwardPunishInfoIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\AwardPunishInfo\AwardPunishInfoService.cs" /> | |||
<Compile Include="EducationalAdministration\BCdCultureDegree\BCdCultureDegreeEntity.cs" /> | |||
<Compile Include="EducationalAdministration\BookPutIn\BookPutInBLL.cs" /> | |||
<Compile Include="EducationalAdministration\BookPutIn\BookPutInIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\BookPutIn\BookPutInService.cs" /> | |||
<Compile Include="EducationalAdministration\BookPutIn\Book_putininfoEntity.cs" /> | |||
<Compile Include="EducationalAdministration\BookReturn\BookReturnBLL.cs" /> | |||
<Compile Include="EducationalAdministration\BookReturn\BookReturnIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\BookReturn\BookReturnService.cs" /> | |||