@@ -0,0 +1,168 @@ | |||||
using Learun.Util; | |||||
using System.Data; | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||||
using System.Web.Mvc; | |||||
using System.Collections.Generic; | |||||
using System; | |||||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2022-03-05 11:17 | |||||
/// 描 述:TextBookOut | |||||
/// </summary> | |||||
public class TextBookOutController : MvcControllerBase | |||||
{ | |||||
private TextBookOutIBLL textBookOutIBLL = new TextBookOutBLL(); | |||||
private TextBookInOutIBLL textBookInOutIBLL = new TextbookInOutBLL(); | |||||
#region 视图功能 | |||||
/// <summary> | |||||
/// 主页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Index() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 表单页 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Form() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 入库表单页 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult FormOut() | |||||
{ | |||||
ViewBag.BookCode = "RK" + DateTime.Now.ToString("yyyyMMddHHmmss"); | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 明细查看 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult FormView() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 明细删除 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult FormDelete() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageList(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = textBookOutIBLL.GetPageList(paginationobj, queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetFormData(string keyValue) | |||||
{ | |||||
var TextBookInOutData = textBookInOutIBLL.GetKCEntity(keyValue); | |||||
var TextBookOutData = textBookOutIBLL.GetTextBookOutEntity(TextBookInOutData.BookCode); | |||||
var jsonData = new | |||||
{ | |||||
TextBookInOut = TextBookInOutData, | |||||
TextBookOut = TextBookOutData, | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetFormDataEdit(string keyValue) | |||||
{ | |||||
var TextBookInOutData = textBookInOutIBLL.GetKCEntity(keyValue); | |||||
var jsonData = new | |||||
{ | |||||
TextBookInOut = TextBookInOutData, | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteForm(string keyValue) | |||||
{ | |||||
textBookOutIBLL.DeleteEntity(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="strEntity">实体</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
[AjaxOnly] | |||||
public ActionResult SaveForm(string keyValue, string strEntity, string strTextBookOutList) | |||||
{ | |||||
TextbookInOutEntity entity = strEntity.ToObject<TextbookInOutEntity>(); | |||||
List<TextBookOutEntity> textBookOutList = strTextBookOutList.ToObject<List<TextBookOutEntity>>(); | |||||
textBookOutIBLL.SaveEntity(keyValue, entity, textBookOutList); | |||||
if (keyValue != null) | |||||
{ | |||||
} | |||||
return Success("保存成功!"); | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,55 @@ | |||||
@{ | |||||
ViewBag.Title = "教材库存表"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap"> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">库存单</div> | |||||
<input id="BookCode" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">课程</div> | |||||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">所选书籍</div> | |||||
<input id="TextBookName" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">出版号</div> | |||||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">作者</div> | |||||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">其他作者</div> | |||||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">出版社</div> | |||||
<input id="Publisher" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">版次</div> | |||||
<input id="Edition" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">当前库存</div> | |||||
<input id="FinallyNum" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">备注</div> | |||||
<textarea id="Remark" class="form-control" style="height: 100px;" readonly></textarea> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">明细操作</div> | |||||
<input id="detailadd" type="button" class="btn btn-success" value="添加出库单" /> | |||||
<input id="detaildel" type="button" class="btn btn-danger" value="移除出库单" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||||
<div id="TextBookOut"></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookOut/Form.js") |
@@ -0,0 +1,201 @@ | |||||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2022-03-02 10:37 | |||||
* 描 述:教材库存表 | |||||
*/ | |||||
var acceptClick; | |||||
var keyValue = request('keyValue'); | |||||
// 设置权限 | |||||
var setAuthorize; | |||||
// 设置表单数据 | |||||
var setFormData; | |||||
// 验证数据是否填写完整 | |||||
var validForm; | |||||
// 保存数据 | |||||
var save; | |||||
var selectedRow; | |||||
var refreshGirdData; | |||||
var tempdatra = new Array(); | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
// 设置权限 | |||||
setAuthorize = function (data) { | |||||
}; | |||||
var page = { | |||||
init: function () { | |||||
$('.lr-form-wrap').lrscroll(); | |||||
$("#detailadd").on('click', function () { | |||||
selectedRow = null; | |||||
learun.layerForm({ | |||||
id: 'formTextBookIn', | |||||
title: '申请出库', | |||||
url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormOut', | |||||
width: 700, | |||||
height: 380, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
$("#detaildel").on('click', function () { | |||||
var keyValue = $('#TextBookOut').jfGridValue('ID'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||||
if (res) { | |||||
$.each(tempdatra, function (key, val) { | |||||
if (tempdatra[key].ID === keyValue) { | |||||
tempdatra.splice(key, 1); | |||||
} | |||||
}); | |||||
$('#TextBookOu').jfGridSet('refreshdata', tempdatra); | |||||
top.layer.close(index); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||||
$('#TextBookOut').jfGrid({ | |||||
headData: [ | |||||
{ label: '出库单', name: 'BookCode', width: 180, 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: "MajorNo", width: 120, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||||
key: value, | |||||
keyId: 'majorno', | |||||
callback: function (_data) { | |||||
callback(_data['majorname']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ | |||||
label: "课程", name: "LessonNo", width: 150, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||||
key: value, | |||||
keyId: 'lessonno', | |||||
callback: function (_data) { | |||||
callback(_data['lessonname']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ | |||||
label: "班级", name: "ClassNo", width: 100, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||||
key: value, | |||||
keyId: 'classno', | |||||
callback: function (_data) { | |||||
callback(_data['classname']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ label: '学年', name: 'AcademicYearNo', width: 80, align: 'left' }, | |||||
{ label: '学期', name: 'Semester', width: 80, align: 'left' }, | |||||
{ label: '领用人', name: 'Recipient', width: 100, align: 'left' }, | |||||
{ label: '出库数量', name: 'Variate', width: 100, align: 'left' }, | |||||
{ label: '出库时间', name: 'CreateTime', width: 200, align: 'left' }, | |||||
{ label: '出库用户', name: 'CrateUserID', width: 100, align: 'left' }, | |||||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||||
], | |||||
height: 400, | |||||
mainId: 'CreateTime desc', | |||||
reloadSelected: false, | |||||
}); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormDataEdit?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]); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
} | |||||
}; | |||||
refreshGirdData = function (temprow) { | |||||
var ifnewrow = true; | |||||
$.each(tempdatra, function (key, val) { | |||||
if (tempdatra[key].BookCode === temprow.InOutBook) { | |||||
tempdatra[key] = temprow; | |||||
ifnewrow = false; | |||||
} | |||||
}); | |||||
if (ifnewrow) { | |||||
tempdatra.push(temprow); | |||||
} | |||||
$('#TextBookOut').jfGridSet('refreshdata', tempdatra); | |||||
}; | |||||
// 设置表单数据 | |||||
setFormData = function (processId, param, callback) { | |||||
if (!!processId) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormDataByProcessId?processId=' + processId, function (data) { | |||||
for (var id in data) { | |||||
if (!!data[id] && data[id].length > 0) { | |||||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||||
} | |||||
else { | |||||
if (id == 'TextBookOut' && data[id]) { | |||||
keyValue = data[id].ID; | |||||
} | |||||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
} | |||||
// 验证数据是否填写完整 | |||||
validForm = function () { | |||||
var datas = $('#TextBookOut').jfGridGet('rowdatas'); | |||||
if (datas == null || datas.length == 0) { | |||||
learun.alert.warning("申请未包含出库申请!请先添加入库申请!"); | |||||
return false; | |||||
} | |||||
return true; | |||||
}; | |||||
// 保存数据 | |||||
save = function (callBack) { | |||||
var postData = {}; | |||||
var formData = $('[data-table="TextBookInOut"]').lrGetFormData(); | |||||
postData.strEntity = JSON.stringify(formData); | |||||
postData.strTextBookOutList = JSON.stringify($('#TextBookOut').jfGridGet('rowdatas')); | |||||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -0,0 +1,54 @@ | |||||
@{ | |||||
ViewBag.Title = "教材库存表"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap"> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">库存单</div> | |||||
<input id="BookCode" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">课程</div> | |||||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">所选书籍</div> | |||||
<input id="TextBookName" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">出版号</div> | |||||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">作者</div> | |||||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">其他作者</div> | |||||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">出版社</div> | |||||
<input id="Publisher" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">版次</div> | |||||
<input id="Edition" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">当前库存</div> | |||||
<input id="FinallyNum" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">备注</div> | |||||
<textarea id="Remark" class="form-control" style="height: 100px;" readonly></textarea> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">明细操作</div> | |||||
<input id="detaildel" type="button" class="btn btn-danger" value="删除入库单" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||||
<div id="TextBookOut"></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookOut/FormDelete.js") |
@@ -0,0 +1,161 @@ | |||||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2022-03-02 10:37 | |||||
* 描 述:教材库存表 | |||||
*/ | |||||
var acceptClick; | |||||
var keyValue = request('keyValue'); | |||||
// 设置权限 | |||||
var setAuthorize; | |||||
// 设置表单数据 | |||||
var setFormData; | |||||
// 验证数据是否填写完整 | |||||
var selectedRow; | |||||
var refreshGirdData; | |||||
var tempdatra = new Array(); | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
// 设置权限 | |||||
setAuthorize = function (data) { | |||||
}; | |||||
var page = { | |||||
init: function () { | |||||
//$('.lr-form-wrap').lrscroll(); | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||||
$('#TextBookOut').jfGrid({ | |||||
headData: [ | |||||
{ label: '出库单', name: 'BookCode', width: 180, 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: "MajorNo", width: 120, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||||
key: value, | |||||
keyId: 'majorno', | |||||
callback: function (_data) { | |||||
callback(_data['majorname']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ | |||||
label: "课程", name: "LessonNo", width: 150, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||||
key: value, | |||||
keyId: 'lessonno', | |||||
callback: function (_data) { | |||||
callback(_data['lessonname']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ | |||||
label: "班级", name: "ClassNo", width: 100, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||||
key: value, | |||||
keyId: 'classno', | |||||
callback: function (_data) { | |||||
callback(_data['classname']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ label: '学年', name: 'AcademicYearNo', width: 80, align: 'left' }, | |||||
{ label: '学期', name: 'Semester', width: 80, align: 'left' }, | |||||
{ label: '领用人', name: 'Recipient', width: 100, align: 'left' }, | |||||
{ label: '出库数量', name: 'Variate', width: 100, align: 'left' }, | |||||
{ label: '出库时间', name: 'CreateTime', width: 200, align: 'left' }, | |||||
{ label: '出库用户', name: 'CrateUserID', width: 100, align: 'left' }, | |||||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||||
], | |||||
height: 400, | |||||
mainId: 'CreateTime desc', | |||||
reloadSelected: false, | |||||
}); | |||||
$("#detaildel").on('click', function () { | |||||
var NewkeyValue = $('#TextBookOut').jfGridValue('ID'); | |||||
if (learun.checkrow(NewkeyValue)) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/DeleteForm', { keyValue: NewkeyValue }, function () { | |||||
refreshGirdData(); | |||||
learun.layerClose(window.name); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/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]); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
} | |||||
}; | |||||
refreshGirdData = function (temprow) { | |||||
var ifnewrow = true; | |||||
$.each(tempdatra, function (key, val) { | |||||
if (tempdatra[key].BookCode === temprow.InOutBook) { | |||||
tempdatra[key] = temprow; | |||||
ifnewrow = false; | |||||
} | |||||
}); | |||||
if (ifnewrow) { | |||||
tempdatra.push(temprow); | |||||
} | |||||
$('#TextBookOut').jfGridSet('refreshdata', tempdatra); | |||||
}; | |||||
// 设置表单数据 | |||||
setFormData = function (processId, param, callback) { | |||||
if (!!processId) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormDataByProcessId?processId=' + processId, function (data) { | |||||
for (var id in data) { | |||||
if (!!data[id] && data[id].length > 0) { | |||||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||||
} | |||||
else { | |||||
if (id == 'TextBookOut' && data[id]) { | |||||
keyValue = data[id].ID; | |||||
} | |||||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
callback && callback(); | |||||
} | |||||
page.init(); | |||||
} |
@@ -0,0 +1,50 @@ | |||||
@{ | |||||
ViewBag.Title = "TextBookOut"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<script> | |||||
var OutBookCode = "@ViewBag.BookCode"; | |||||
</script> | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item" data-table="TextBookIn"> | |||||
<div class="lr-form-item-title">出库单<font face="宋体">*</font></div> | |||||
<input id="BookCode" type="text" class="form-control" readonly="readonly" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | |||||
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||||
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||||
<div class="lr-form-item-title">专业部<font face="宋体">*</font></div> | |||||
<div id="DeptNo" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||||
<div class="lr-form-item-title">专业<font face="宋体">*</font></div> | |||||
<div id="MajorNo" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||||
<div class="lr-form-item-title">班级<font face="宋体">*</font></div> | |||||
<div id="ClassNo" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||||
<div class="lr-form-item-title">课程<font face="宋体">*</font></div> | |||||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||||
<div class="lr-form-item-title">数量<font face="宋体">*</font></div> | |||||
<input id="Variate" type="number" class="form-control" isvalid="yes" checkexpession="PositiveInteger"/> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||||
<div class="lr-form-item-title">领用人<font face="宋体">*</font></div> | |||||
<input id="Recipient" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="TextBookOut"> | |||||
<div class="lr-form-item-title">备注</div> | |||||
<textarea id="Remark" class="form-control" style="height: 100px;" readonly></textarea> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookOut/FormOut.js") |
@@ -0,0 +1,122 @@ | |||||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2022-03-05 11:17 | |||||
* 描 述:TextBookOut | |||||
*/ | |||||
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 () { | |||||
$('#AcademicYearNo').lrselect({ | |||||
placeholder: "请选择学年", | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear', | |||||
value: 'value', | |||||
text: 'text' | |||||
}); | |||||
//学期 | |||||
$('#Semester').lrselect({ | |||||
placeholder: "请选择学期", | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||||
value: 'value', | |||||
text: 'text' | |||||
}); | |||||
$('#DeptNo').lrselect({ | |||||
allowSearch: true, | |||||
value: "deptno", | |||||
text: "deptname", | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', | |||||
select: function (item) { | |||||
if (item) { | |||||
$('#MajorNo').lrselectRefresh({ | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||||
param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" } | |||||
}); | |||||
} else { | |||||
$('#MajorNo').lrselectRefresh({ | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||||
param: { strWhere: "1=1 AND CheckMark=1" } | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
$('#MajorNo').lrselect({ | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||||
value: "majorno", | |||||
text: "majorname", | |||||
param: { strWhere: "1=1 AND CheckMark=1" }, | |||||
select: function (item) { | |||||
if (item) { | |||||
$('#ClassNo').lrselectRefresh({ | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', | |||||
param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" } | |||||
}); | |||||
} else { | |||||
$('#ClassNo').lrselectRefresh({ | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', | |||||
param: { strWhere: "1=1 AND CheckMark=1" } | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
$('#ClassNo').lrselect({ | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', | |||||
param: { strWhere: "1=1 AND CheckMark=1" }, | |||||
value: "classno", | |||||
text: "classname" | |||||
}); | |||||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/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]); | |||||
} | |||||
} | |||||
}); | |||||
} else { | |||||
$("#BookCode").val(OutBookCode); | |||||
} | |||||
} | |||||
}; | |||||
// 保存数据 | |||||
acceptClick = function (callBack) { | |||||
if (!$('body').lrValidform()) { | |||||
return false; | |||||
} | |||||
var postData = $('body').lrGetFormData(); | |||||
if (!!keyValue) { | |||||
if (!!selectedRow) { | |||||
postData.ID = selectedRow.ID; | |||||
} | |||||
} else { | |||||
postData.ID = learun.newGuid(); | |||||
} | |||||
if (!!callBack) { | |||||
callBack(postData); | |||||
return true; | |||||
} | |||||
}; | |||||
page.init(); | |||||
} |
@@ -0,0 +1,50 @@ | |||||
@{ | |||||
ViewBag.Title = "教材库存表"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap"> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">库存单</div> | |||||
<input id="BookCode" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">课程</div> | |||||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">所选书籍</div> | |||||
<input id="TextBookName" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">出版号</div> | |||||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">作者</div> | |||||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">其他作者</div> | |||||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">出版社</div> | |||||
<input id="Publisher" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">版次</div> | |||||
<input id="Edition" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">当前库存</div> | |||||
<input id="FinallyNum" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">备注</div> | |||||
<textarea id="Remark" class="form-control" style="height: 100px;" readonly></textarea> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||||
<div id="TextBookOut"></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookOut/FormView.js") |
@@ -0,0 +1,174 @@ | |||||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2022-03-02 10:37 | |||||
* 描 述:教材库存表 | |||||
*/ | |||||
var acceptClick; | |||||
var keyValue = request('keyValue'); | |||||
// 设置权限 | |||||
var setAuthorize; | |||||
// 设置表单数据 | |||||
var setFormData; | |||||
// 验证数据是否填写完整 | |||||
var validForm; | |||||
// 保存数据 | |||||
var save; | |||||
var selectedRow; | |||||
var refreshGirdData; | |||||
var tempdatra = new Array(); | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
// 设置权限 | |||||
setAuthorize = function (data) { | |||||
}; | |||||
var page = { | |||||
init: function () { | |||||
$('.lr-form-wrap').lrscroll(); | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||||
$('#TextBookOut').jfGrid({ | |||||
headData: [ | |||||
{ label: '出库单', name: 'BookCode', width: 180, 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: "MajorNo", width: 120, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||||
key: value, | |||||
keyId: 'majorno', | |||||
callback: function (_data) { | |||||
callback(_data['majorname']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ | |||||
label: "课程", name: "LessonNo", width: 150, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||||
key: value, | |||||
keyId: 'lessonno', | |||||
callback: function (_data) { | |||||
callback(_data['lessonname']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ | |||||
label: "班级", name: "ClassNo", width: 100, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||||
key: value, | |||||
keyId: 'classno', | |||||
callback: function (_data) { | |||||
callback(_data['classname']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ label: '学年', name: 'AcademicYearNo', width: 80, align: 'left' }, | |||||
{ label: '学期', name: 'Semester', width: 80, align: 'left' }, | |||||
{ label: '领用人', name: 'Recipient', width: 100, align: 'left' }, | |||||
{ label: '出库数量', name: 'Variate', width: 100, align: 'left' }, | |||||
{ label: '出库时间', name: 'CreateTime', width: 200, align: 'left' }, | |||||
{ label: '出库用户', name: 'CrateUserID', width: 100, align: 'left' }, | |||||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||||
], | |||||
height: 400, | |||||
mainId: 'CreateTime desc', | |||||
reloadSelected: false, | |||||
}); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?keyValue=' + keyValue, function (data) { | |||||
for (var id in data) { | |||||
if (!!data[id].length && data[id].length > 0) { | |||||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||||
tempdatra = data[id]; | |||||
} | |||||
else { | |||||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
} | |||||
}; | |||||
refreshGirdData = function (temprow) { | |||||
var ifnewrow = true; | |||||
$.each(tempdatra, function (key, val) { | |||||
if (tempdatra[key].ID === temprow.ID) { | |||||
tempdatra[key] = temprow; | |||||
ifnewrow = false; | |||||
} | |||||
}); | |||||
if (ifnewrow) { | |||||
tempdatra.push(temprow); | |||||
} | |||||
$('#TextBookOut').jfGridSet('refreshdata', tempdatra); | |||||
}; | |||||
// 设置表单数据 | |||||
setFormData = function (processId, param, callback) { | |||||
if (!!processId) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?processId=' + processId, function (data) { | |||||
for (var id in data) { | |||||
if (!!data[id] && data[id].length > 0) { | |||||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||||
} | |||||
else { | |||||
if (id == 'TextBookOut' && data[id]) { | |||||
keyValue = data[id].ID; | |||||
} | |||||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
callback && callback(); | |||||
} | |||||
// 验证数据是否填写完整 | |||||
validForm = function () { | |||||
var datas = $('#TextBookOut').jfGridGet('rowdatas'); | |||||
if (datas == null || datas.length == 0) { | |||||
learun.alert.warning("申请未包含出库申请!请先添加入库申请!"); | |||||
return false; | |||||
} | |||||
return true; | |||||
}; | |||||
// 保存数据 | |||||
save = function (callBack) { | |||||
var postData = {}; | |||||
var formData = $('[data-table="TextBookInOut"]').lrGetFormData(); | |||||
postData.strEntity = JSON.stringify(formData); | |||||
postData.strTextBookOutList = JSON.stringify($('#TextBookOut').jfGridGet('rowdatas')); | |||||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -1,17 +1,24 @@ | |||||
@{ | @{ | ||||
ViewBag.Title = "教材库存表"; | |||||
ViewBag.Title = "TextBookOut"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | Layout = "~/Views/Shared/_Index.cshtml"; | ||||
} | } | ||||
<div class="lr-layout"> | |||||
<div class="lr-layout-center "> | |||||
<div class="lr-layout "> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | <div class="lr-layout-wrap lr-layout-wrap-notitle "> | ||||
<div class="lr-layout-tool"> | <div class="lr-layout-tool"> | ||||
<div class="lr-layout-tool-left"> | <div class="lr-layout-tool-left"> | ||||
<div class="lr-layout-tool-item"> | <div class="lr-layout-tool-item"> | ||||
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字" /> | |||||
<div id="datesearch"></div> | |||||
</div> | </div> | ||||
<div class="lr-layout-tool-item"> | <div class="lr-layout-tool-item"> | ||||
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i> 查询</a> | |||||
<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="keyword" type="text" class="form-control" placeholder="请输入要查询关键字" /> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="lr-layout-tool-right"> | <div class="lr-layout-tool-right"> | ||||
@@ -19,9 +26,9 @@ | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | <a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | ||||
</div> | </div> | ||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | <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_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 教材出库</a> | |||||
<a id="lr_view" 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> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -29,4 +36,4 @@ | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookInOut/IndexIn.js") | |||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookOut/Index.js") |
@@ -1,70 +1,114 @@ | |||||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | ||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | ||||
* 创建人:超级管理员 | * 创建人:超级管理员 | ||||
* 日 期:2022-03-02 10:37 | |||||
* 描 述:教材库存表 | |||||
* 日 期:2022-03-05 11:17 | |||||
* 描 述:TextBookOut | |||||
*/ | */ | ||||
var refreshGirdData; | var refreshGirdData; | ||||
var bootstrap = function ($, learun) { | var bootstrap = function ($, learun) { | ||||
"use strict"; | "use strict"; | ||||
var startTime; | |||||
var endTime; | |||||
var page = { | var page = { | ||||
init: function () { | init: function () { | ||||
page.initGird(); | page.initGird(); | ||||
page.bind(); | page.bind(); | ||||
}, | }, | ||||
bind: function () { | bind: function () { | ||||
// 查询 | |||||
$('#btn_Search').on('click', function () { | |||||
var keyword = $('#txt_Keyword').val(); | |||||
page.search({ keyword: keyword }); | |||||
// 时间搜索框 | |||||
$('#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(); | |||||
} | |||||
}); | }); | ||||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||||
page.search(queryJson); | |||||
}, 100, 400); | |||||
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo',value: 'deptno',text: 'deptname' }); | |||||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo',value: 'majorno',text: 'majorname' }); | |||||
$('#ClassNo').lrDataSourceSelect({ code: 'bjsj',value: 'classno',text: 'classname' }); | |||||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo',value: 'lessonno',text: 'lessonname' }); | |||||
// 刷新 | // 刷新 | ||||
$('#lr_refresh').on('click', function () { | $('#lr_refresh').on('click', function () { | ||||
location.reload(); | location.reload(); | ||||
}); | }); | ||||
// 新增 | |||||
$('#lr_add').on('click', function () { | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '新增', | |||||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/Form', | |||||
width: 700, | |||||
height: 500, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
// 出库 | |||||
$('#lr_edit').on('click', function () { | $('#lr_edit').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
learun.layerForm({ | learun.layerForm({ | ||||
id: 'form', | id: 'form', | ||||
title: '编辑', | |||||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/Form?keyValue=' + keyValue, | |||||
width: 700, | |||||
height: 500, | |||||
title: '出库', | |||||
url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/Form?keyValue=' + keyValue, | |||||
width: 1000, | |||||
height: 800, | |||||
callBack: function (id) { | callBack: function (id) { | ||||
return top[id].acceptClick(refreshGirdData); | |||||
var res = false; | |||||
// 验证数据 | |||||
res = top[id].validForm(); | |||||
// 保存数据 | |||||
if (res) { | |||||
res = top[id].save('', function () { | |||||
page.search(); | |||||
}); | |||||
} | |||||
return res; | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
// 查看 | |||||
$('#lr_view').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerForm({ | |||||
id: 'formview', | |||||
title: '查看', | |||||
url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormView?keyValue=' + keyValue, | |||||
width: 1000, | |||||
height: 700, | |||||
btn: null, | |||||
}); | |||||
} | |||||
}); | |||||
// 删除 | // 删除 | ||||
$('#lr_delete').on('click', function () { | $('#lr_delete').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/DeleteForm', { keyValue: keyValue }, function () { | |||||
}); | |||||
} | |||||
learun.layerForm({ | |||||
id: 'formdelete', | |||||
title: '删除明细', | |||||
url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormDelete?keyValue=' + keyValue, | |||||
width: 1000, | |||||
height: 700, | |||||
btn: null, | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
}, | }, | ||||
// 初始化列表 | |||||
initGird: function () { | initGird: function () { | ||||
$('#gridtable').lrAuthorizeJfGrid({ | $('#gridtable').lrAuthorizeJfGrid({ | ||||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList', | url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList', | ||||
@@ -88,7 +132,6 @@ var bootstrap = function ($, learun) { | |||||
{ label: '出版号', name: 'PublishNo', width: 200, align: "left" }, | { label: '出版号', name: 'PublishNo', width: 200, align: "left" }, | ||||
{ label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" }, | { label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" }, | ||||
{ label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" }, | { label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" }, | ||||
//{ label: '出版日期', name: 'Pubdate', width: 200, align: "left" }, | |||||
{ label: '出版社', name: 'Publisher', width: 200, align: "left" }, | { label: '出版社', name: 'Publisher', width: 200, align: "left" }, | ||||
{ label: '版次', name: 'Edition', width: 200, align: "left" }, | { label: '版次', name: 'Edition', width: 200, align: "left" }, | ||||
{ label: '印次', name: 'Impression', width: 200, align: "left" }, | { label: '印次', name: 'Impression', width: 200, align: "left" }, | ||||
@@ -98,7 +141,6 @@ var bootstrap = function ($, learun) { | |||||
{ label: '修改用户', name: 'UpUserID', width: 200, align: "left" }, | { label: '修改用户', name: 'UpUserID', width: 200, align: "left" }, | ||||
{ label: '当前数量', name: 'FinallyNum', width: 200, align: "left" }, | { label: '当前数量', name: 'FinallyNum', width: 200, align: "left" }, | ||||
{ label: '备注', name: 'Remark', width: 200, align: "left" }, | { label: '备注', name: 'Remark', width: 200, align: "left" }, | ||||
], | ], | ||||
mainId: 'ID', | mainId: 'ID', | ||||
isPage: true, | isPage: true, | ||||
@@ -108,6 +150,7 @@ var bootstrap = function ($, learun) { | |||||
}, | }, | ||||
search: function (param) { | search: function (param) { | ||||
param = param || {}; | param = param || {}; | ||||
param.SqlParameter = ' and IsSubmit =1 '; | |||||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | ||||
} | } | ||||
}; | }; |
@@ -843,6 +843,7 @@ | |||||
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookSolSubDetailController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\TextBookSolSubDetailController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookInOutController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\TextBookInOutController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookInController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\TextBookInController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookOutController.cs" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | <Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | ||||
@@ -1183,6 +1184,9 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\Form.js" /> | <Content Include="Areas\EducationalAdministration\Views\TextBookIn\Form.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\FormIn.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\TextBookIn\FormIn.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\FormIn.js" /> | <Content Include="Areas\EducationalAdministration\Views\TextBookIn\FormIn.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\FormDelete.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\FormView.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\Form.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\Thermography\IndexResult.js" /> | <Content Include="Areas\EducationalAdministration\Views\Thermography\IndexResult.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\Thermography\StatisticIndex.js" /> | <Content Include="Areas\EducationalAdministration\Views\Thermography\StatisticIndex.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\Thermography\SubmitIndex.js" /> | <Content Include="Areas\EducationalAdministration\Views\Thermography\SubmitIndex.js" /> | ||||
@@ -6676,6 +6680,10 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\TextBookInOut\Form.js" /> | <Content Include="Areas\EducationalAdministration\Views\TextBookInOut\Form.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\Index.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\TextBookIn\Index.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\Index.js" /> | <Content Include="Areas\EducationalAdministration\Views\TextBookIn\Index.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\Index.cshtml" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\Index.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\FormOut.cshtml" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\FormOut.js" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<Folder Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElectivePre\" /> | <Folder Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElectivePre\" /> | ||||
@@ -7617,6 +7625,9 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\Form.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\TextBookIn\Form.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\FormView.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\TextBookIn\FormView.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\FormDelete.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\TextBookIn\FormDelete.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\Form.cshtml" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\FormView.cshtml" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\FormDelete.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | <None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | ||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | ||||
<Content Include="Views\Login\Default-beifen.cshtml" /> | <Content Include="Views\Login\Default-beifen.cshtml" /> | ||||
@@ -0,0 +1,29 @@ | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||||
using System.Data.Entity.ModelConfiguration; | |||||
namespace Learun.Application.Mapping | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2022-03-05 11:17 | |||||
/// 描 述:TextBookOut | |||||
/// </summary> | |||||
public class TextBookOutMap : EntityTypeConfiguration<TextBookOutEntity> | |||||
{ | |||||
public TextBookOutMap() | |||||
{ | |||||
#region 表、主键 | |||||
//表 | |||||
this.ToTable("TEXTBOOKOUT"); | |||||
//主键 | |||||
this.HasKey(t => t.ID); | |||||
#endregion | |||||
#region 配置关系 | |||||
#endregion | |||||
} | |||||
} | |||||
} | |||||
@@ -597,6 +597,7 @@ | |||||
<Compile Include="EducationalAdministration\TextBookSolSubDetailMap.cs" /> | <Compile Include="EducationalAdministration\TextBookSolSubDetailMap.cs" /> | ||||
<Compile Include="EducationalAdministration\TextbookInOutMap.cs" /> | <Compile Include="EducationalAdministration\TextbookInOutMap.cs" /> | ||||
<Compile Include="EducationalAdministration\TextBookInMap.cs" /> | <Compile Include="EducationalAdministration\TextBookInMap.cs" /> | ||||
<Compile Include="EducationalAdministration\TextBookOutMap.cs" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | <ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | ||||
@@ -54,8 +54,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
/// <param name="keyValue"></param> | /// <param name="keyValue"></param> | ||||
/// <param name="entity"></param> | /// <param name="entity"></param> | ||||
/// <param name="textBookIndentDatail"></param> | |||||
void SaveEntity(string keyValue, TextbookInOutEntity entity, List<TextBookInEntity> textBookIndentDatail); | |||||
/// <param name="textBookIn"></param> | |||||
void SaveEntity(string keyValue, TextbookInOutEntity entity, List<TextBookInEntity> textBookIn); | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -225,7 +225,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
textbookInList[i].Impression = entity.Impression; | textbookInList[i].Impression = entity.Impression; | ||||
variate += textbookInList[i].variate; | variate += textbookInList[i].variate; | ||||
} | } | ||||
entity.Create(); | |||||
this.BaseRepository("CollegeMIS").Insert(textbookInList); | this.BaseRepository("CollegeMIS").Insert(textbookInList); | ||||
if (variate != 0 && variate > 0) | if (variate != 0 && variate > 0) | ||||
@@ -0,0 +1,150 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2022-03-05 11:17 | |||||
/// 描 述:TextBookOut | |||||
/// </summary> | |||||
public class TextBookOutBLL : TextBookOutIBLL | |||||
{ | |||||
private TextBookOutService textBookOutService = new TextBookOutService(); | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<TextBookOutEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return textBookOutService.GetPageList(pagination, queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取TextBookOut表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public TextBookOutEntity GetTextBookOutEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return textBookOutService.GetTextBookOutEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DeleteEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
textBookOutService.DeleteEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
/// <returns></returns> | |||||
public void SaveEntity(string keyValue, TextBookOutEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
textBookOutService.SaveEntity(keyValue, entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
/// <returns></returns> | |||||
public void SaveEntity(string keyValue, TextbookInOutEntity entity, List<TextBookOutEntity> textBookOutList) | |||||
{ | |||||
try | |||||
{ | |||||
textBookOutService.SaveEntity(keyValue, entity, textBookOutList); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,160 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.ComponentModel.DataAnnotations.Schema; | |||||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2022-03-05 11:17 | |||||
/// 描 述:TextBookOut | |||||
/// </summary> | |||||
public class TextBookOutEntity | |||||
{ | |||||
#region 实体成员 | |||||
/// <summary> | |||||
/// ID | |||||
/// </summary> | |||||
[Column("ID")] | |||||
public string ID { get; set; } | |||||
/// <summary> | |||||
/// InOutCode | |||||
/// </summary> | |||||
[Column("INOUTCODE")] | |||||
public string InOutCode { get; set; } | |||||
/// <summary> | |||||
/// BookCode | |||||
/// </summary> | |||||
[Column("BOOKCODE")] | |||||
public string BookCode { get; set; } | |||||
/// <summary> | |||||
/// AcademicYearNo | |||||
/// </summary> | |||||
[Column("ACADEMICYEARNO")] | |||||
public string AcademicYearNo { get; set; } | |||||
/// <summary> | |||||
/// Semester | |||||
/// </summary> | |||||
[Column("SEMESTER")] | |||||
public string Semester { get; set; } | |||||
/// <summary> | |||||
/// DeptNo | |||||
/// </summary> | |||||
[Column("DEPTNO")] | |||||
public string DeptNo { get; set; } | |||||
/// <summary> | |||||
/// MajorNo | |||||
/// </summary> | |||||
[Column("MAJORNO")] | |||||
public string MajorNo { get; set; } | |||||
/// <summary> | |||||
/// ClassNo | |||||
/// </summary> | |||||
[Column("CLASSNO")] | |||||
public string ClassNo { get; set; } | |||||
/// <summary> | |||||
/// 课程 | |||||
/// </summary> | |||||
[Column("LESSONNO")] | |||||
public string LessonNo { get; set; } | |||||
/// <summary> | |||||
/// PublishNo | |||||
/// </summary> | |||||
[Column("PUBLISHNO")] | |||||
public string PublishNo { get; set; } | |||||
/// <summary> | |||||
/// 教材号 | |||||
/// </summary> | |||||
[Column("TEXTBOOKNO")] | |||||
public string TextBookNo { get; set; } | |||||
/// <summary> | |||||
/// 教材名称 | |||||
/// </summary> | |||||
[Column("TEXTBOOKNAME")] | |||||
public string TextBookName { get; set; } | |||||
/// <summary> | |||||
/// 第一作者 | |||||
/// </summary> | |||||
[Column("FIRSTAUTHOR")] | |||||
public string FirstAuthor { get; set; } | |||||
/// <summary> | |||||
/// 其他作者 | |||||
/// </summary> | |||||
[Column("OTHERAUTHOR")] | |||||
public string OtherAuthor { get; set; } | |||||
/// <summary> | |||||
/// 出版社 | |||||
/// </summary> | |||||
[Column("PUBLISHER")] | |||||
public string Publisher { get; set; } | |||||
/// <summary> | |||||
/// 版次 | |||||
/// </summary> | |||||
[Column("EDITION")] | |||||
public string Edition { get; set; } | |||||
/// <summary> | |||||
/// 印次 | |||||
/// </summary> | |||||
[Column("IMPRESSION")] | |||||
public string Impression { get; set; } | |||||
/// <summary> | |||||
/// 创建人 | |||||
/// </summary> | |||||
[Column("CREATETIME")] | |||||
public DateTime? CreateTime { get; set; } | |||||
/// <summary> | |||||
/// 创建版次 | |||||
/// </summary> | |||||
[Column("CRATEUSERID")] | |||||
public string CrateUserID { get; set; } | |||||
/// <summary> | |||||
/// UpTime | |||||
/// </summary> | |||||
[Column("UPTIME")] | |||||
public DateTime? UpTime { get; set; } | |||||
/// <summary> | |||||
/// UpUserID | |||||
/// </summary> | |||||
[Column("UPUSERID")] | |||||
public string UpUserID { get; set; } | |||||
/// <summary> | |||||
/// Variate | |||||
/// </summary> | |||||
[Column("VARIATE")] | |||||
public decimal? Variate { get; set; } | |||||
/// <summary> | |||||
/// Recipient | |||||
/// </summary> | |||||
[Column("RECIPIENT")] | |||||
public string Recipient { get; set; } | |||||
/// <summary> | |||||
/// 备注 | |||||
/// </summary> | |||||
[Column("REMARK")] | |||||
public string Remark { get; set; } | |||||
#endregion | |||||
#region 扩展操作 | |||||
/// <summary> | |||||
/// 新增调用 | |||||
/// </summary> | |||||
public void Create() | |||||
{ | |||||
} | |||||
/// <summary> | |||||
/// 编辑调用 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
public void Modify(string keyValue) | |||||
{ | |||||
this.ID = keyValue; | |||||
} | |||||
#endregion | |||||
#region 扩展字段 | |||||
#endregion | |||||
} | |||||
} | |||||
@@ -0,0 +1,56 @@ | |||||
using Learun.Util; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2022-03-05 11:17 | |||||
/// 描 述:TextBookOut | |||||
/// </summary> | |||||
public interface TextBookOutIBLL | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
IEnumerable<TextBookOutEntity> GetPageList(Pagination pagination, string queryJson); | |||||
/// <summary> | |||||
/// 获取TextBookOut表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
TextBookOutEntity GetTextBookOutEntity(string keyValue); | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
void DeleteEntity(string keyValue); | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
void SaveEntity(string keyValue, TextBookOutEntity entity); | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
/// <param name="entity"></param> | |||||
/// <param name="textBookOut"></param> | |||||
void SaveEntity(string keyValue, TextbookInOutEntity entity, List<TextBookOutEntity> textBookOut); | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,285 @@ | |||||
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 V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2022-03-05 11:17 | |||||
/// 描 述:TextBookOut | |||||
/// </summary> | |||||
public class TextBookOutService : RepositoryFactory | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">查询参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<TextBookOutEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("SELECT "); | |||||
strSql.Append(@" | |||||
t.Id, | |||||
t.AcademicYearNo, | |||||
t.Semester, | |||||
t.DeptNo, | |||||
t.MajorNo, | |||||
t.ClassNo, | |||||
t.LessonNo, | |||||
t.Variate, | |||||
t.Recipient, | |||||
t.CreateTime, | |||||
t.CrateUserID | |||||
"); | |||||
strSql.Append(" FROM TextBookOut 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["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["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["ClassNo"].IsEmpty()) | |||||
{ | |||||
dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.ClassNo = @ClassNo "); | |||||
} | |||||
if (!queryParam["LessonNo"].IsEmpty()) | |||||
{ | |||||
dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.LessonNo = @LessonNo "); | |||||
} | |||||
if (!queryParam["Recipient"].IsEmpty()) | |||||
{ | |||||
dp.Add("Recipient", "%" + queryParam["Recipient"].ToString() + "%", DbType.String); | |||||
strSql.Append(" AND t.Recipient Like @Recipient "); | |||||
} | |||||
return this.BaseRepository("CollegeMIS").FindList<TextBookOutEntity>(strSql.ToString(), dp, pagination); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取TextBookOut表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public TextBookOutEntity GetTextBookOutEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository("CollegeMIS").FindEntity<TextBookOutEntity>(x => x.InOutCode == keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DeleteEntity(string keyValue) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
decimal? Num = 0; | |||||
var keyValueArr = keyValue.Split(','); | |||||
foreach (var item in keyValueArr) | |||||
{ | |||||
var entity = BaseRepository("CollegeMIS").FindEntity<TextBookOutEntity>(x => x.ID == item); | |||||
if (entity != null) | |||||
{ | |||||
Num += entity.Variate; | |||||
var InOutEntity = db.FindEntity<TextbookInOutEntity>(x => x.BookCode == entity.InOutCode); | |||||
if (InOutEntity != null) | |||||
{ | |||||
InOutEntity.FinallyNum += Num; | |||||
db.Delete(entity); | |||||
db.Update(InOutEntity); | |||||
} | |||||
else | |||||
{ | |||||
db.Rollback(); | |||||
} | |||||
} | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
public void SaveEntity(string keyValue, TextBookOutEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
if (keyValue != null) | |||||
{ | |||||
entity.Modify(keyValue); | |||||
this.BaseRepository("CollegeMIS").Update(entity); | |||||
} | |||||
else | |||||
{ | |||||
entity.Create(); | |||||
this.BaseRepository("CollegeMIS").Insert(entity); | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
/// <param name="entity">库存</param> | |||||
/// <param name="textbookIndentDateil"></param> | |||||
public void SaveEntity(string keyValue, TextbookInOutEntity entity, List<TextBookOutEntity> textbookOutList) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
decimal? variate = 0; | |||||
if (textbookOutList.Count > 0) | |||||
{ | |||||
for (int i = 0; i < textbookOutList.Count; i++) | |||||
{ | |||||
textbookOutList[i].InOutCode = entity.BookCode; | |||||
textbookOutList[i].LessonNo = entity.LessonNo; | |||||
textbookOutList[i].PublishNo = entity.PublishNo; | |||||
textbookOutList[i].TextBookNo = entity.TextBookNo; | |||||
textbookOutList[i].TextBookName = entity.TextBookName; | |||||
textbookOutList[i].FirstAuthor = entity.FirstAuthor; | |||||
textbookOutList[i].OtherAuthor = entity.OtherAuthor; | |||||
textbookOutList[i].Publisher = entity.Publisher; | |||||
textbookOutList[i].Edition = entity.Edition; | |||||
textbookOutList[i].Impression = entity.Impression; | |||||
textbookOutList[i].Impression = entity.Impression; | |||||
variate += textbookOutList[i].Variate; | |||||
} | |||||
this.BaseRepository("CollegeMIS").Insert(textbookOutList); | |||||
if (variate != 0 && variate > 0) | |||||
{ | |||||
var newtextInOutEntity = db.FindEntity<TextbookInOutEntity>(x => x.BookCode == entity.BookCode); | |||||
if (newtextInOutEntity != null) | |||||
{ | |||||
newtextInOutEntity.FinallyNum -= variate; | |||||
if (newtextInOutEntity.FinallyNum > 0 || newtextInOutEntity.FinallyNum == 0) | |||||
{ | |||||
db.Update(newtextInOutEntity); | |||||
} | |||||
else | |||||
{ | |||||
db.Rollback(); | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
db.Rollback(); | |||||
} | |||||
} | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -66,6 +66,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
strSql.Append(" FROM TextbookInOut t where 1=1 "); | strSql.Append(" FROM TextbookInOut t where 1=1 "); | ||||
var queryParam = queryJson.ToJObject(); | var queryParam = queryJson.ToJObject(); | ||||
var dp = new DynamicParameters(new { }); | 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["SqlParameter"].IsEmpty()) | if (!queryParam["SqlParameter"].IsEmpty()) | ||||
{ | { | ||||
string SqlParameter = queryParam["SqlParameter"].ToString(); | string SqlParameter = queryParam["SqlParameter"].ToString(); | ||||
@@ -78,7 +84,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
if (!queryParam["TextBookName"].IsEmpty()) | if (!queryParam["TextBookName"].IsEmpty()) | ||||
{ | { | ||||
strSql.Append(" and TextBookName like @TextBookName )"); | |||||
strSql.Append(" and TextBookName like @TextBookName "); | |||||
dp.Add("TextBookName", "%" + queryParam["TextBookName"].ToString() + "%", DbType.String); | dp.Add("TextBookName", "%" + queryParam["TextBookName"].ToString() + "%", DbType.String); | ||||
} | } | ||||
return this.BaseRepository("CollegeMIS").FindList<TextbookInOutEntity>(strSql.ToString(), dp, pagination); | return this.BaseRepository("CollegeMIS").FindList<TextbookInOutEntity>(strSql.ToString(), dp, pagination); | ||||
@@ -1818,6 +1818,10 @@ | |||||
<Compile Include="EducationalAdministration\TextBookIn\TextBookInService.cs" /> | <Compile Include="EducationalAdministration\TextBookIn\TextBookInService.cs" /> | ||||
<Compile Include="EducationalAdministration\TextBookIn\TextBookInBLL.cs" /> | <Compile Include="EducationalAdministration\TextBookIn\TextBookInBLL.cs" /> | ||||
<Compile Include="EducationalAdministration\TextBookIn\TextBookInIBLL.cs" /> | <Compile Include="EducationalAdministration\TextBookIn\TextBookInIBLL.cs" /> | ||||
<Compile Include="EducationalAdministration\TextBookOut\TextBookOutEntity.cs" /> | |||||
<Compile Include="EducationalAdministration\TextBookOut\TextBookOutService.cs" /> | |||||
<Compile Include="EducationalAdministration\TextBookOut\TextBookOutBLL.cs" /> | |||||
<Compile Include="EducationalAdministration\TextBookOut\TextBookOutIBLL.cs" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | <ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | ||||