Browse Source

学生归宿管理

临城职教中职
zhangli 2 years ago
parent
commit
947ff20d6e
19 changed files with 1204 additions and 0 deletions
  1. +147
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/DormitoryReturnController.cs
  2. +23
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/Form.cshtml
  3. +59
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/Form.js
  4. +19
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/FormOut.cshtml
  5. +61
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/FormOut.js
  6. +19
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/FormReturn.cshtml
  7. +61
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/FormReturn.js
  8. +49
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/Index.cshtml
  9. +159
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/Index.js
  10. +9
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  11. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj
  12. +29
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Acc_DormitoryReturnMap.cs
  13. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj
  14. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs
  15. +38
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs
  16. +104
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/DormitoryReturn/Acc_DormitoryReturnEntity.cs
  17. +173
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/DormitoryReturn/DormitoryReturnBLL.cs
  18. +48
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/DormitoryReturn/DormitoryReturnIBLL.cs
  19. +196
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/DormitoryReturn/DormitoryReturnService.cs

+ 147
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/DormitoryReturnController.cs View File

@@ -0,0 +1,147 @@
using Learun.Util;
using System.Data;
using Learun.Application.TwoDevelopment.LogisticsManagement;
using System.Web.Mvc;
using System.Collections.Generic;

namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-03-10 10:06
/// 描 述:学生归宿管理
/// </summary>
public class DormitoryReturnController : MvcControllerBase
{
private DormitoryReturnIBLL dormitoryReturnIBLL = new DormitoryReturnBLL();

#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()
{
return View();
}

/// <summary>
/// 表单页
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult FormReturn()
{
return View();
}
#endregion

#region 获取数据
/// <summary>
/// 获取左侧树形数据
/// <summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetTree()
{
var data = dormitoryReturnIBLL.GetTree();
return Success(data);
}
/// <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 = dormitoryReturnIBLL.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 Acc_DormitoryReturnData = dormitoryReturnIBLL.GetAcc_DormitoryReturnEntity(keyValue);
var jsonData = new
{
Acc_DormitoryReturn = Acc_DormitoryReturnData,
};
return Success(jsonData);
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
dormitoryReturnIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="strEntity">实体</param>
/// <returns></returns>
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveForm(string type, string strEntity)
{
Acc_DormitoryReturnEntity entity = strEntity.ToObject<Acc_DormitoryReturnEntity>();
dormitoryReturnIBLL.SaveEntity(type, entity);

return Success("保存成功!");
}

#endregion

}
}

+ 23
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/Form.cshtml View File

@@ -0,0 +1,23 @@
@{
ViewBag.Title = "学生归宿管理";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryReturn">
<div class="lr-form-item-title">床位</div>
<div id="DormitoryBuildId"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryReturn">
<div class="lr-form-item-title">出宿时间</div>
<input id="OutTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#OutTime').trigger('change'); } })" />
</div>
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryReturn">
<div class="lr-form-item-title">归宿时间</div>
<input id="ReturnTime" type="text" class="form-control lr-input-wdatepicker" 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="Acc_DormitoryReturn">
<div class="lr-form-item-title">检查日期</div>
<input id="CheckDate" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#CheckDate').trigger('change'); } })" />
</div>*@
</div>
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/DormitoryReturn/Form.js")

+ 59
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/Form.js View File

@@ -0,0 +1,59 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2022-03-10 10:06
* 描 述:学生归宿管理
*/
var acceptClick;
var keyValue = request('keyValue');
var ParentId = request('ParentId');
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
$('#DormitoryBuildId').lrselect({
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
param: { code: 'DormitoryInfo', strWhere: "ParentID='" + ParentId + "' and BuildType='5' order by name" },
text: 'name',
value: 'id',
allowSearch: true
});
},
initData: function () {
if (!!keyValue) {
$.lrSetForm(top.$.rootUrl + '/LogisticsManagement/DormitoryReturn/GetFormData?keyValue=' + keyValue, function (data) {
console.log('data', 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 + '/LogisticsManagement/DormitoryReturn/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
};
page.init();
}

+ 19
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/FormOut.cshtml View File

@@ -0,0 +1,19 @@
@{
ViewBag.Title = "学生出宿";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryReturn">
<div class="lr-form-item-title">床位<font face="宋体">*</font></div>
<div id="DormitoryBuildId"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryReturn">
<div class="lr-form-item-title">出宿时间<font face="宋体">*</font></div>
<input id="OutTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#OutTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryReturn">
<div class="lr-form-item-title">备注</div>
<textarea id="Remark" class="form-control" style="height: 100px;"></textarea>
</div>
</div>
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/DormitoryReturn/FormOut.js")

+ 61
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/FormOut.js View File

@@ -0,0 +1,61 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2022-03-10 10:06
* 描 述:学生归宿管理
*/
var acceptClick;
var keyValue = request('keyValue');
var ParentId = request('ParentId');
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
$('#DormitoryBuildId').lrselect({
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
param: { code: 'DormitoryInfo', strWhere: "ParentID='" + ParentId + "' and BuildType='5' order by name" },
text: 'name',
value: 'id',
allowSearch: true
});

},
initData: function () {
if (!!keyValue) {
$.lrSetForm(top.$.rootUrl + '/LogisticsManagement/DormitoryReturn/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 strEntity = $('body').lrGetFormData();
strEntity.ParentId = ParentId;
var postData = {
strEntity: JSON.stringify(strEntity)
};
$.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/DormitoryReturn/SaveForm?type=1', postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
};
page.init();
}

+ 19
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/FormReturn.cshtml View File

@@ -0,0 +1,19 @@
@{
ViewBag.Title = "学生出宿";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryReturn">
<div class="lr-form-item-title">床位<font face="宋体">*</font></div>
<div id="DormitoryBuildId"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryReturn">
<div class="lr-form-item-title">归宿时间<font face="宋体">*</font></div>
<input id="ReturnTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#ReturnTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryReturn">
<div class="lr-form-item-title">备注</div>
<textarea id="Remark" class="form-control" style="height: 100px;"></textarea>
</div>
</div>
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/DormitoryReturn/FormReturn.js")

+ 61
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/FormReturn.js View File

@@ -0,0 +1,61 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2022-03-10 10:06
* 描 述:学生归宿管理
*/
var acceptClick;
var keyValue = request('keyValue');
var ParentId = request('ParentId');
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
$('#DormitoryBuildId').lrselect({
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
param: { code: 'DormitoryInfo', strWhere: "ParentID='" + ParentId + "' and BuildType='5' order by name" },
text: 'name',
value: 'id',
allowSearch: true
});

},
initData: function () {
if (!!keyValue) {
$.lrSetForm(top.$.rootUrl + '/LogisticsManagement/DormitoryReturn/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 strEntity = $('body').lrGetFormData();
strEntity.ParentId = ParentId;
var postData = {
strEntity: JSON.stringify(strEntity)
};
$.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/DormitoryReturn/SaveForm?type=2', postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
};
page.init();
}

+ 49
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/Index.cshtml View File

@@ -0,0 +1,49 @@
@{
ViewBag.Title = "学生归宿管理";
Layout = "~/Views/Shared/_Index.cshtml";
}
<div class="lr-layout lr-layout-left-center" id="lr_layout" >
<div class="lr-layout-left">
<div class="lr-layout-wrap">
<div class="lr-layout-title lrlg ">树形列表</div>
<div id="dataTree" class="lr-layout-body"></div>
</div>
</div>
<div class="lr-layout-center">
<div class="lr-layout-wrap ">
<div class="lr-layout-title">
<span id="titleinfo" class="lrlg">列表信息</span>
</div>
<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>
</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_out" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;学生出宿</a>
<a id="lr_return" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;学生归宿</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/DormitoryReturn/Index.js")

+ 159
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/DormitoryReturn/Index.js View File

@@ -0,0 +1,159 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2022-03-10 10:06
* 描 述:学生归宿管理
*/
var refreshGirdData;
var ParentId = '';
var bootstrap = function ($, learun) {
"use strict";
var startTime;
var endTime;
var page = {
init: function () {
page.initGird();
page.bind();
},
bind: function () {
// 初始化左侧树形数据
$('#dataTree').lrtree({
url: top.$.rootUrl + '/LogisticsManagement/DormitoryReturn/GetTree',
nodeClick: function (item) {
if (item.title == '4') {
ParentId = item.value;
page.search({ DormitoryBuildId: item.value });
}
}
});
// 时间搜索框
$('#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_out').on('click', function () {
if (!!ParentId) {
learun.layerForm({
id: 'formout',
title: '学生出宿',
url: top.$.rootUrl + '/LogisticsManagement/DormitoryReturn/FormOut?ParentId=' + ParentId,
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
} else {
return learun.alert.warning('请选择宿舍!');
}
});

// 学生出宿
$('#lr_return').on('click', function () {
if (!!ParentId) {
learun.layerForm({
id: 'formreturn',
title: '学生归宿',
url: top.$.rootUrl + '/LogisticsManagement/DormitoryReturn/FormReturn?ParentId=' + ParentId,
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
} else {
return learun.alert.warning('请选择宿舍!');
}
});
// 编辑
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'form',
title: '编辑',
url: top.$.rootUrl + '/LogisticsManagement/DormitoryReturn/Form?keyValue=' + keyValue + '&ParentId=' + ParentId,
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 + '/LogisticsManagement/DormitoryReturn/DeleteForm', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
});
}
});
// 打印
$('#lr_print').on('click', function () {
$('#gridtable').jqprintTable();
});
},
// 初始化列表
initGird: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/LogisticsManagement/DormitoryReturn/GetPageList',
headData: [
{ label: "床位", name: "Name", width: 100, align: "left" },
{ label: "出宿时间", name: "OutTime", width: 200, align: "left" },
{ label: "归宿时间", name: "ReturnTime", width: 200, align: "left" },
],
mainId: 'Id',
isPage: true,
sidx: 'OutTime desc',
});
},
search: function (param) {
param = param || {};
if (!!ParentId) {
param.StartTime = startTime;
param.EndTime = endTime;
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
};
page.init();
}

+ 9
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj View File

@@ -845,6 +845,7 @@
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookInController.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookOutController.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\StuCardInfoController.cs" />
<Compile Include="Areas\LogisticsManagement\Controllers\DormitoryReturnController.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" />
@@ -1338,6 +1339,8 @@
<Content Include="Areas\LogisticsManagement\Views\APAppointmentPsychologist\Index.js" />
<Content Include="Areas\LogisticsManagement\Views\CompanyNews\Form.js" />
<Content Include="Areas\LogisticsManagement\Views\CompanyNews\Index.js" />
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\FormReturn.js" />
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\FormOut.js" />
<Content Include="Areas\LogisticsManagement\Views\ProjectDataManage\FormView.js" />
<Content Include="Areas\LogisticsManagement\Views\ProjectDataManage\Form.js" />
<Content Include="Areas\LogisticsManagement\Views\ProjectDataManage\IndexView.js" />
@@ -6692,6 +6695,10 @@
<Content Include="Areas\EducationalAdministration\Views\StuCardInfo\Index.js" />
<Content Include="Areas\EducationalAdministration\Views\StuCardInfo\Form.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuCardInfo\Form.js" />
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\Index.cshtml" />
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\Index.js" />
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\Form.cshtml" />
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\Form.js" />
</ItemGroup>
<ItemGroup>
<Folder Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElectivePre\" />
@@ -7639,6 +7646,8 @@
<Content Include="Areas\LR_OAModule\Views\ResourceFile\FileStatistic.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\TextBookInOut\FormUse.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\TextBookInOut\IndexInOut.cshtml" />
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\FormOut.cshtml" />
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\FormReturn.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj View File

@@ -599,6 +599,7 @@
<Compile Include="EducationalAdministration\TextBookInMap.cs" />
<Compile Include="EducationalAdministration\TextBookOutMap.cs" />
<Compile Include="EducationalAdministration\StuCardInfoMap.cs" />
<Compile Include="LogisticsManagement\Acc_DormitoryReturnMap.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj">


+ 29
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Acc_DormitoryReturnMap.cs View File

@@ -0,0 +1,29 @@
using Learun.Application.TwoDevelopment.LogisticsManagement;
using System.Data.Entity.ModelConfiguration;

namespace Learun.Application.Mapping
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-03-10 10:06
/// 描 述:学生归宿管理
/// </summary>
public class Acc_DormitoryReturnMap : EntityTypeConfiguration<Acc_DormitoryReturnEntity>
{
public Acc_DormitoryReturnMap()
{
#region 表、主键
//表
this.ToTable("ACC_DORMITORYRETURN");
//主键
this.HasKey(t => t.Id);
#endregion

#region 配置关系
#endregion
}
}
}


+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj View File

@@ -1826,6 +1826,10 @@
<Compile Include="EducationalAdministration\StuCardInfo\StuCardInfoService.cs" />
<Compile Include="EducationalAdministration\StuCardInfo\StuCardInfoBLL.cs" />
<Compile Include="EducationalAdministration\StuCardInfo\StuCardInfoIBLL.cs" />
<Compile Include="LogisticsManagement\DormitoryReturn\Acc_DormitoryReturnEntity.cs" />
<Compile Include="LogisticsManagement\DormitoryReturn\DormitoryReturnService.cs" />
<Compile Include="LogisticsManagement\DormitoryReturn\DormitoryReturnBLL.cs" />
<Compile Include="LogisticsManagement\DormitoryReturn\DormitoryReturnIBLL.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj">


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs View File

@@ -177,6 +177,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
/// </summary>
[Column("CHECKINSTU")]
public int? CheckInStu { get; set; }
/// <summary>
/// 是否归宿
/// </summary>
[Column("ISRETURN")]
public int? IsReturn { get; set; }
#endregion

#region 扩展字段


+ 38
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs View File

@@ -823,6 +823,41 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
}
}

/// <summary>
/// 获取树形数据(学生归宿)
/// </summary>
/// <returns></returns>
public List<Acc_DormitoryBuildEntity> GetSqlTreeForReturn()
{
try
{
List<Acc_DormitoryBuildEntity> list = new List<Acc_DormitoryBuildEntity>();
var roomSql = @"select * from [dbo].[Acc_DormitoryBuild] where ID in (
select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (studentid is not null and len(studentid)>0)
)";
List<Acc_DormitoryBuildEntity> roomList = this.BaseRepository("CollegeMIS")
.FindList<Acc_DormitoryBuildEntity>(roomSql).ToList();
list = roomList.Union(list).ToList();
var apartIds = roomList.Select(x => x.ApartmentId).Distinct().ToList();
var unitIds = roomList.Select(x => x.UnitId).Distinct().ToList();
var floorIds = roomList.Select(x => x.FloorId).Distinct().ToList();
var otherList = this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(x =>
apartIds.Contains(x.ID) || unitIds.Contains(x.ID) || floorIds.Contains(x.ID)).ToList();
list = list.Union(otherList).ToList();
return list.OrderBy(x => x.DNo).OrderBy(x => x.Name).ToList();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
/// <summary>
/// 根据父id获取数据
/// </summary>
@@ -1187,6 +1222,9 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
var bedEntity = new Acc_DormitoryBuildEntity
{
ParentID = roomEntity.ID,
ApartmentId = keyValue,
UnitId = elementEntity.ID,
FloorId = floorEntity.ID,
Name = m.ToString() + "床",
DNo = m.ToString(),
BuildType = "5",


+ 104
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/DormitoryReturn/Acc_DormitoryReturnEntity.cs View File

@@ -0,0 +1,104 @@
using Learun.Util;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace Learun.Application.TwoDevelopment.LogisticsManagement
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-03-10 10:06
/// 描 述:学生归宿管理
/// </summary>
public class Acc_DormitoryReturnEntity
{
#region 实体成员
/// <summary>
/// Id
/// </summary>
[Column("ID")]
public string Id { get; set; }
/// <summary>
/// 宿舍id,关联Acc_DormitoryBuild表
/// </summary>
[Column("DORMITORYBUILDID")]
public string DormitoryBuildId { get; set; }
/// <summary>
/// 床位父级
/// </summary>
[Column("PARENTID")]
public string ParentId { get; set; }

/// <summary>
/// 检查日期
/// </summary>
[Column("CHECKDATE")]
public DateTime? CheckDate { get; set; }
/// <summary>
/// 出宿时间
/// </summary>
[Column("OUTTIME")]
public DateTime? OutTime { get; set; }
/// <summary>
/// 归宿时间
/// </summary>
[Column("RETURNTIME")]
public DateTime? ReturnTime { get; set; }

/// <summary>
/// 备注
/// </summary>
[Column("REMARK")]
public string Remark { get; set; }
/// <summary>
/// 创建人
/// </summary>
[Column("CREATEUSERID")]
public string CreateUserId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Column("CREATETIME")]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 修改时间
/// </summary>
[Column("UPDATETIME")]
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
[Column("UPDATEUSERID")]
public string UpdateUserId { get; set; }
#endregion

#region 扩展操作
/// <summary>
/// 新增调用
/// </summary>
public void Create()
{
this.Id = Guid.NewGuid().ToString();
this.CreateTime = DateTime.Now;
this.CreateUserId = LoginUserInfo.Get().userId;
}
/// <summary>
/// 编辑调用
/// </summary>
/// <param name="keyValue"></param>
public void Modify(string keyValue)
{
this.Id = keyValue;
this.UpdateTime = DateTime.Now;
this.UpdateUserId = LoginUserInfo.Get().userId;
}
#endregion
#region 扩展字段
[NotMapped]
public string Name { get; set; }

#endregion
}
}


+ 173
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/DormitoryReturn/DormitoryReturnBLL.cs View File

@@ -0,0 +1,173 @@
using Learun.Util;
using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;

namespace Learun.Application.TwoDevelopment.LogisticsManagement
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-03-10 10:06
/// 描 述:学生归宿管理
/// </summary>
public class DormitoryReturnBLL : DormitoryReturnIBLL
{
private DormitoryReturnService dormitoryReturnService = new DormitoryReturnService();
private AccommodationService accommodationService = new AccommodationService();

#region 获取数据

/// <summary>
/// 获取左侧树形数据
/// <summary>
/// <returns></returns>
public List<TreeModel> GetTree()
{
try
{
List<Acc_DormitoryBuildEntity> list = accommodationService.GetSqlTreeForReturn();
List<TreeModel> treeList = new List<TreeModel>();
foreach (Acc_DormitoryBuildEntity item in list)
{
TreeModel node = new TreeModel
{
id = item.ID.ToString(),
text = item.Name.ToString(),
value = item.ID.ToString(),
showcheck = false,
checkstate = 0,
isexpand = true,
parentId = item.ParentID == null ? "" : item.ParentID,
title = item.BuildType

};


treeList.Add(node);


}


return treeList.ToTree();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<Acc_DormitoryReturnEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
return dormitoryReturnService.GetPageList(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取Acc_DormitoryReturn表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public Acc_DormitoryReturnEntity GetAcc_DormitoryReturnEntity(string keyValue)
{
try
{
return dormitoryReturnService.GetAcc_DormitoryReturnEntity(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
{
dormitoryReturnService.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 type, Acc_DormitoryReturnEntity entity)
{
try
{
dormitoryReturnService.SaveEntity(type, entity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}
}

+ 48
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/DormitoryReturn/DormitoryReturnIBLL.cs View File

@@ -0,0 +1,48 @@
using Learun.Util;
using System.Data;
using System.Collections.Generic;

namespace Learun.Application.TwoDevelopment.LogisticsManagement
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-03-10 10:06
/// 描 述:学生归宿管理
/// </summary>
public interface DormitoryReturnIBLL
{
#region 获取数据
List<TreeModel> GetTree();
/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
IEnumerable<Acc_DormitoryReturnEntity> GetPageList(Pagination pagination, string queryJson);
/// <summary>
/// 获取Acc_DormitoryReturn表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
Acc_DormitoryReturnEntity GetAcc_DormitoryReturnEntity(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 type, Acc_DormitoryReturnEntity entity);
#endregion

}
}

+ 196
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/DormitoryReturn/DormitoryReturnService.cs View File

@@ -0,0 +1,196 @@
using Dapper;
using Learun.DataBase.Repository;
using Learun.Util;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Learun.Application.TwoDevelopment.LogisticsManagement
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-03-10 10:06
/// 描 述:学生归宿管理
/// </summary>
public class DormitoryReturnService : RepositoryFactory
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">查询参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<Acc_DormitoryReturnEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(@"
t.*,a.Name
");
strSql.Append(" FROM Acc_DormitoryReturn t ");
strSql.Append(" join Acc_DormitoryBuild a on t.DormitoryBuildId=a.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.CheckDate >= @startTime AND t.CheckDate <= @endTime ) ");
}
if (!queryParam["OutTime"].IsEmpty())
{
dp.Add("OutTime", queryParam["OutTime"].ToString(), DbType.String);
strSql.Append(" AND t.OutTime = @OutTime ");
}
if (!queryParam["ParentId"].IsEmpty())
{
dp.Add("ParentId", queryParam["ParentId"].ToString(), DbType.String);
strSql.Append(" AND t.ParentId = @ParentId ");
}
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryReturnEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取Acc_DormitoryReturn表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public Acc_DormitoryReturnEntity GetAcc_DormitoryReturnEntity(string keyValue)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<Acc_DormitoryReturnEntity>(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)
{
try
{
this.BaseRepository("CollegeMIS").Delete<Acc_DormitoryReturnEntity>(t => t.Id == keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
public void SaveEntity(string type, Acc_DormitoryReturnEntity entity)
{
var db = this.BaseRepository("CollegeMIS");
try
{
db.BeginTrans();
if (type == "1")
{
//学生出宿
entity.Create();
entity.CheckDate = Convert.ToDateTime(entity.OutTime.Value.Date);
db.Insert(entity);

//修改该床位为未归宿
var sql = $"update Acc_DormitoryBuild set IsReturn=0 where ID='{entity.DormitoryBuildId}'";
db.ExecuteBySql(sql);
}
else
{
//学生归宿
//获取今天最后一次出宿的记录
var outsql =
$"select top 1 * from Acc_DormitoryReturn where DormitoryBuildId='{entity.DormitoryBuildId}' and CheckDate='{DateTime.Now.Date}' order by OutTime desc";
var model = db.FindList<Acc_DormitoryReturnEntity>(outsql).FirstOrDefault();
if (model == null)
{
//新增
entity.Create();
entity.ReturnTime = entity.ReturnTime;
entity.CheckDate = Convert.ToDateTime(entity.ReturnTime.Value.Date);
db.Insert(entity);
}
else
{
//修改
model.ReturnTime = entity.ReturnTime;
model.Remark += " " + entity.Remark;
model.Modify(model.Id);
db.Update(model);
}

//修改该床位为未归宿
var sql = $"update Acc_DormitoryBuild set IsReturn=1 where ID='{entity.DormitoryBuildId}'";
db.ExecuteBySql(sql);
}

db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion

}
}

Loading…
Cancel
Save