@@ -7,6 +7,7 @@ using System.Web.Helpers; | |||
using Newtonsoft.Json; | |||
using Newtonsoft.Json.Linq; | |||
using System; | |||
using System.Linq; | |||
namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
{ | |||
@@ -32,26 +33,31 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
{ | |||
return View(); | |||
} | |||
///// <summary> | |||
///// 表单页 | |||
///// <summary> | |||
///// <returns></returns> | |||
//[HttpGet] | |||
//public ActionResult Form() | |||
//{ | |||
// return View(); | |||
//} | |||
/// <summary> | |||
/// 分配宿舍 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult IndexDistribution() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 带参数的表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form(string ParentID = null, string ParentName = null) | |||
public ActionResult Form(string ParentID = null, string ParentName = null, string keyValue = null) | |||
{ | |||
ViewBag.ParentID = ParentID; | |||
ViewBag.ParentName = ParentName; | |||
ViewBag.BuildType = accommodationIBLL.GetBuildType(ParentID); | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
ViewBag.BuildType = accommodationIBLL.GetParentBuildType(keyValue); | |||
} | |||
return View(); | |||
} | |||
@@ -137,9 +143,26 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 分配系 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult FormDept() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 分配专业和班级 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult FormClass() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
@@ -167,6 +190,18 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取床位数据 | |||
/// <summary> | |||
/// <param name="RoomId">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetBedListByRoomId(string RoomId) | |||
{ | |||
var data = accommodationIBLL.GetBedListByRoomId(RoomId).OrderBy(x => x.DNo); | |||
return Success(data); | |||
} | |||
/// <summary> | |||
/// 获取宿舍楼数据 | |||
@@ -300,6 +335,20 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 寝室分配系 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveDeptClass(string keyValue, string strEntity,int type) | |||
{ | |||
Acc_DormitoryBuildEntity entity = strEntity.ToObject<Acc_DormitoryBuildEntity>(); | |||
accommodationIBLL.SaveDeptClass(keyValue, entity, type); | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 学生宿舍的单元、楼层、房间、床位添加 | |||
@@ -344,7 +393,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
} | |||
/// <summary> | |||
/// 同步宿舍信息数据 | |||
/// </summary> | |||
@@ -8,19 +8,19 @@ | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">每栋楼单元数量</div> | |||
<input id="ElementNum" type="text" class="form-control" /> | |||
<input id="ElementNum" type="number" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">每单元楼层数量</div> | |||
<input id="FloorNum" type="text" class="form-control" /> | |||
<input id="FloorNum" type="number" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">每楼层房间数量</div> | |||
<input id="RoomNum" type="text" class="form-control" /> | |||
<input id="RoomNum" type="number" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">每房间床位数量</div> | |||
<input id="BedNum" type="text" class="form-control" /> | |||
<input id="BedNum" type="number" class="form-control" /> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/DormitoryAdd.js") | |||
@@ -3,13 +3,23 @@ | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
@*<input value="@ViewBag.BuildType"/>*@ | |||
@if (ViewBag.ParentID != null) | |||
{ | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">上级</div> | |||
<input id="ParentID" type="hidden" value="@ViewBag.ParentID" /> | |||
<input type="text" class="form-control" value="@ViewBag.ParentName" readonly="readonly" /> | |||
</div> | |||
} | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">名称</div> | |||
<input id="Name" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">学生</div> | |||
<div id="StudentID"></div> | |||
<div class="lr-form-item-title">编号<font face="宋体">*</font></div> | |||
<input id="DNo" type="number" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
@@ -20,36 +30,23 @@ | |||
<div class="lr-form-item-title">类别<font face="宋体">*</font></div> | |||
<div id="BuildType" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
@if (ViewBag.ParentID != null) | |||
{ | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">父单位</div> | |||
<input id="ParentID" type="hidden" value="@ViewBag.ParentID" /> | |||
<label class="form-control">@ViewBag.ParentName</label> | |||
</div> | |||
} | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">校区</div> | |||
<div id="Campus"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">系</div> | |||
<div id="Dept"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="Major"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">班级</div> | |||
<div id="Class"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">性别</div> | |||
<div id="Sex"></div> | |||
</div> | |||
@*<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">系</div> | |||
<div id="Dept"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="Major"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">班级</div> | |||
<div id="Class"></div> | |||
</div>*@ | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">负责人</div> | |||
<input id="Functionary" type="text" class="form-control" /> | |||
@@ -62,16 +59,25 @@ | |||
<div class="lr-form-item-title">价格</div> | |||
<input id="Price" type="text" class="form-control" /> | |||
</div> | |||
@*<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">顺序</div> | |||
<input id="sort" type="number" class="form-control"/> | |||
</div>*@ | |||
@if (ViewBag.BuildType == "4") | |||
@if (ViewBag.BuildType == "3") | |||
{ | |||
//寝室信息 | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">性别</div> | |||
<div id="Sex"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">舍长</div> | |||
<input id="Leader" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">学生名字</div> | |||
<input id="StudentID" type="text" class="form-control" /> | |||
<div class="lr-form-item-title">几人寝<font face="宋体">*</font></div> | |||
<input id="RoomType" type="number" class="form-control" isvalid="yes" checkexpession="NotNull"/> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">星级</div> | |||
@@ -82,10 +88,16 @@ | |||
<div id="HasToilet"></div> | |||
</div> | |||
} | |||
@if (ViewBag.BuildType == "4") | |||
{ | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">学生名字</div> | |||
<input id="StudentID" type="text" class="form-control" /> | |||
</div> | |||
} | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;"></textarea> | |||
<textarea id="Remark" class="form-control" style="height: 100px;"></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/Form.js") |
@@ -25,6 +25,7 @@ var bootstrap = function ($, learun) { | |||
code: 'HasToilet', | |||
}) | |||
$('#BuildType').lrDataItemSelect({ code: 'BuildType' }); | |||
//$('#StudentID').lrDataSourceSelect({ code: 'StuInfoBasic', value: 'stuid', text: 'stuname' }); | |||
//$('#StudentID').lrDataSourceSelect({ code: 'StuInfoTwo', value: 'stuid', text: 'stuname' }); | |||
$('#StudentID').lrselect({ | |||
@@ -0,0 +1,19 @@ | |||
| |||
@{ | |||
ViewBag.Title = "FormClass"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">专业<font face="宋体">*</font></div> | |||
<div id="Major" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">班级<font face="宋体">*</font></div> | |||
<div id="Class" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/FormClass.js") | |||
@@ -0,0 +1,82 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2019-04-26 15:02 | |||
* 描 述:学生宿舍管理 | |||
*/ | |||
var acceptClick; | |||
var Dept = request('Dept'); | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#Class').lrselect({ | |||
value: "classno", | |||
text: "classname" | |||
}); | |||
$('#Major').lrselect({ | |||
value: "majorno", | |||
text: "majorname", | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', | |||
param: { code: "CdMajorInfo", strWhere: "DeptNo='" + Dept + "'" }, | |||
select: function (item) { | |||
if (item) { | |||
$('#Class').lrselectRefresh({ | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', | |||
param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" } | |||
}); | |||
} | |||
} | |||
}); | |||
$('#Class').on("click", | |||
function () { | |||
//var data1 = $('#Dept').lrselectGet(); | |||
var data2 = $('#Major').lrselectGet(); | |||
if (!data2) { | |||
learun.alert.error('请先选择专业'); | |||
} | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
}, | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/SaveDeptClass?type=2&keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,15 @@ | |||
| |||
@{ | |||
ViewBag.Title = "Allocation"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">系部<font face="宋体">*</font></div> | |||
<div id="Dept" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/FormDept.js") | |||
@@ -0,0 +1,56 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2019-04-26 15:02 | |||
* 描 述:学生宿舍管理 | |||
*/ | |||
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 () { | |||
$('#Dept').lrselect({ | |||
value: "deptno", | |||
text: "deptname", | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', | |||
allowSearch:true | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
}, | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/SaveDeptClass?type=1&keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -21,44 +21,44 @@ | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
@*<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">名称</div> | |||
<input id="Name" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">名称</div> | |||
<input id="Name" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">宿舍楼</div> | |||
<div id="ApartmentId"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">单元</div> | |||
<div id="UnitId"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">楼层</div> | |||
<div id="FloorId"></div> | |||
</div> | |||
@*<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">类别</div> | |||
<input id="BuildType" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">学校</div> | |||
<input id="School" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">系</div> | |||
<input id="DeptName" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">班级</div> | |||
<input id="Class" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">专业</div> | |||
<input id="MajorName" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">性别</div> | |||
<div id="Sex"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">负责人</div> | |||
<input id="Functionary" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">舍长</div> | |||
<input id="Leader" type="text" class="form-control" /> | |||
</div> | |||
</div>*@ | |||
</div>*@ | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">系</div> | |||
<div id="Dept"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="Major"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">班级</div> | |||
<div id="Class"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">性别</div> | |||
<div id="Sex"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -67,7 +67,7 @@ | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
<a id="lr_dormitoryAdd" class="btn btn-default"><i class="fa fa-pencil-square"></i> 批量添加宿舍</a> | |||
<a id="lr_allocation" class="btn btn-default"><i class="fa fa-pencil-square"></i> 自动分配宿舍</a> | |||
<a id="lr_syncdata" class="btn btn-default"><i class="fa fa-pencil-square"></i> 同步宿舍信息</a> | |||
@*<a id="lr_syncdata" class="btn btn-default"><i class="fa fa-pencil-square"></i> 同步宿舍信息</a>*@ | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 录入</a> | |||
@@ -11,18 +11,116 @@ var bootstrap = function ($, learun) { | |||
var page = { | |||
init: function () { | |||
page.initTree(); | |||
//page.initGird(); | |||
page.initGird(); | |||
page.search({ ParentID: '' }); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#Sex').lrRadioCheckbox({ | |||
type: 'radio', | |||
code: 'usersex', | |||
}, 420, 400); | |||
//宿舍楼 | |||
$('#ApartmentId').lrselect({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DormitoryInfo', | |||
param: { strWhere: " BuildType='1' " }, | |||
value: "id", | |||
text: "name", | |||
select: function (item) { | |||
if (!!item) { | |||
//单元 | |||
$('#UnitId').lrselectRefresh({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DormitoryInfo', | |||
param: { strWhere: " BuildType='2' and ApartmentId='" + item.id + "'" }, | |||
value: "id", | |||
text: "name", | |||
select: function (item) { | |||
if (!!item) { | |||
//楼层 | |||
$('#FloorId').lrselectRefresh({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DormitoryInfo', | |||
param: { strWhere: " BuildType='3' and UnitId='" + item.id + "'" }, | |||
value: "id", | |||
text: "name" | |||
}); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}); | |||
$('#UnitId').lrselect({ allowSearch: true }); | |||
$('#FloorId').lrselect({ allowSearch: true }); | |||
$('#Sex').lrDataItemSelect({ code: 'usersex' }); | |||
//.lrRadioCheckbox({ | |||
// type: 'radio', | |||
// code: 'usersex', | |||
//}); | |||
$('#Class').lrselect({ | |||
value: "classno", | |||
text: "classname" | |||
}); | |||
$('#Dept').lrselect({ | |||
value: "deptno", | |||
text: "deptname", | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', | |||
select: function (item) { | |||
if (item) { | |||
$('#Major').lrselectRefresh({ | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', | |||
param: { code: "CdMajorInfo", strWhere: "DeptNo='" + item.deptno + "'" } | |||
}); | |||
} | |||
else { | |||
$('#Major').lrselectRefresh({ | |||
url: "", | |||
data: [] | |||
}); | |||
} | |||
$('#Class').lrselectRefresh({ | |||
url: "", | |||
data: [] | |||
}); | |||
} | |||
}); | |||
$('#Major').lrselect({ | |||
value: "majorno", | |||
text: "majorname", | |||
select: function (item) { | |||
if (item) { | |||
$('#Class').lrselectRefresh({ | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', | |||
param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" } | |||
}); | |||
} | |||
} | |||
}); | |||
$('#Major').on("click", | |||
function () { | |||
var data = $('#Dept').lrselectGet(); | |||
if (!data) { | |||
learun.alert.error('请先选择系'); | |||
} | |||
}); | |||
$('#Class').on("click", | |||
function () { | |||
var data1 = $('#Dept').lrselectGet(); | |||
var data2 = $('#Major').lrselectGet(); | |||
if (!data1 || !data2) { | |||
learun.alert.error('请先选择系和专业'); | |||
} | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
@@ -33,14 +131,15 @@ var bootstrap = function ($, learun) { | |||
if (selectedParent.ID != null) { | |||
url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form?ParentID=' + selectedParent.ID + '&ParentName=' + selectedParent.Name; | |||
} else { | |||
url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form'; | |||
return learun.alert.warning("请选择上级!"); | |||
//url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form'; | |||
} | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: url, | |||
width: 600, | |||
height: 400, | |||
width: 900, | |||
height: 550, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
@@ -58,8 +157,8 @@ var bootstrap = function ($, learun) { | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/Form?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
width: 900, | |||
height: 550, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
@@ -138,7 +237,7 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}); | |||
}, | |||
//初始化左侧树 | |||
initTree: function () { | |||
@@ -148,7 +247,7 @@ var bootstrap = function ($, learun) { | |||
nodeClick: function (item) { | |||
selectedParent.ID = item.value; | |||
selectedParent.Name = item.text; | |||
selectedParent.BuildType = item.title; | |||
if (item.parent) { | |||
if (!item.parent.parentId) { | |||
selectedParent.ChildType = "2"; | |||
@@ -169,71 +268,37 @@ var bootstrap = function ($, learun) { | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
//$("#gridtable").removeClass("jfgrid-layout"); | |||
//$("#gridtable").removeAttr("style"); | |||
//$("#gridtable").empty(); | |||
//$("#gridtable")[0].dfop = undefined; | |||
if (selectedParent.ChildType == "5") { | |||
$('#gridtable').lrAuthorizeJfGridLei({ | |||
$("#gridtable").empty(); | |||
$("#gridtable")[0].dfop = undefined; | |||
if (selectedParent.BuildType == undefined || selectedParent.BuildType === "3") { | |||
//宿舍数据 | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', | |||
headData: [ | |||
{ label: "名称", name: "Name", width: 100, align: "left" }, | |||
{ label: "学生名字", name: "StuName", width: 100, align: "left" }, | |||
{ label: "班级", name: "Class", width: 100, align: "left" }, | |||
{ | |||
label: "性别", name: "Sex", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'usersex', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" | |||
}, | |||
{ label: "负责人", name: "Functionary", width: 100, align: "left" }, | |||
{ label: "负责人电话", name: "Phone", width: 100, align: "left" }, | |||
{ label: "价格", name: "Price", width: 100, align: "left" }, | |||
{ label: "星级", name: "Starred", width: 100, align: "left" }, | |||
{ | |||
label: "是否独卫", name: "HasToilet", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'HasToilet', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
label: "单元", name: "UnitName", width: 100, align: "left" | |||
}, | |||
{ label: "舍长", name: "Leader", width: 100, align: "left" }, | |||
{ label: "备注", name: "Remark", width: 100, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
isMultiselect:true | |||
}); | |||
} else { | |||
$('#gridtable').lrAuthorizeJfGridLei({ | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', | |||
headData: [ | |||
{ label: "名称", name: "Name", width: 100, align: "left" }, | |||
{ label: "学生", name: "StudentID", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
{ | |||
label: "楼层", name: "FloorName", width: 100, align: "left" | |||
}, | |||
//{ | |||
// label: "学生", name: "StudentID", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', | |||
key: value, | |||
keyId: 'stuid', | |||
callback: function (_data) { | |||
callback(_data['stuname']); | |||
} | |||
}); | |||
} }, | |||
// learun.clientdata.getAsync('custmerData', { | |||
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', | |||
// key: value, | |||
// keyId: 'stuid', | |||
// callback: function (_data) { | |||
// callback(_data['stuname']); | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
{ label: "位置", name: "Address", width: 100, align: "left" }, | |||
{ | |||
label: "校区", name: "Campus", width: 100, align: "left", | |||
@@ -276,25 +341,161 @@ var bootstrap = function ($, learun) { | |||
} | |||
}, | |||
{ label: "班级", name: "Class", width: 100, align: "left" }, | |||
{ | |||
label: "寝室类型", name: "RoomType", width: 100, align: "left", | |||
formatter: function (value, row) { | |||
if (value) { | |||
return value + '人寝'; | |||
} else { | |||
return ''; | |||
} | |||
} | |||
}, | |||
{ label: "入住人数", name: "CheckInStu", width: 100, align: "left" }, | |||
{ | |||
label: "性别", name: "Sex", width: 100, align: "left", | |||
formatter: function (callback, value, row, op, $cell) { | |||
if (value == '0') | |||
return '女'; | |||
else if (value == '1') | |||
return '男'; | |||
else | |||
return ''; | |||
} | |||
}, | |||
{ label: "负责人", name: "Functionary", width: 100, align: "left" }, | |||
{ label: "负责人电话", name: "Phone", width: 100, align: "left" }, | |||
{ label: "备注", name: "Remark", width: 100, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
isMultiselect: true, | |||
sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', | |||
//sord: 'ASC', | |||
isSubGrid: true, // 是否有子表 | |||
subGridExpanded: function (subContentId, rowItem) { | |||
$('#' + subContentId).jfGrid({ | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + rowItem.ID, | |||
headData: [ | |||
{ label: "名称", name: "Name", width: 100, align: "left" }, | |||
{ | |||
label: "学生", name: "StudentID", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', | |||
key: value, | |||
keyId: 'stuid', | |||
callback: function (_data) { | |||
callback(_data['stuname']); | |||
} | |||
}); | |||
} | |||
}, | |||
], | |||
mainId: 'ID', | |||
isPage: false, | |||
//sidx: 'DNo', | |||
//sord: 'ASC', | |||
}); | |||
//var param; | |||
//param = param || {}; | |||
//param.ParentID = rowItem.Id; | |||
$('#' + subContentId).jfGridSet('reload'); | |||
}, | |||
subGridHeight: 250, | |||
}); | |||
} else { | |||
//lrAuthorizeJfGridLei | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', | |||
headData: [ | |||
{ label: "名称", name: "Name", width: 100, align: "left" }, | |||
{ | |||
label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" | |||
}, | |||
{ | |||
label: "单元", name: "UnitName", width: 100, align: "left" | |||
}, | |||
{ | |||
label: "楼层", name: "FloorName", width: 100, align: "left" | |||
}, | |||
//{ | |||
// label: "学生", name: "StudentID", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getAsync('custmerData', { | |||
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', | |||
// key: value, | |||
// keyId: 'stuid', | |||
// callback: function (_data) { | |||
// callback(_data['stuname']); | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
{ label: "位置", name: "Address", width: 100, align: "left" }, | |||
{ | |||
label: "校区", name: "Campus", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', | |||
key: value, | |||
code: 'usersex', | |||
keyId: 'f_companyid', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
callback(_data['f_fullname']); | |||
} | |||
}); | |||
} | |||
}, | |||
//{ | |||
// label: "系", name: "Dept", 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: "Major", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getAsync('custmerData', { | |||
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
// key: value, | |||
// keyId: 'id', | |||
// callback: function (_data) { | |||
// callback(_data['majorname']); | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
//{ label: "班级", name: "Class", width: 100, align: "left" }, | |||
//{ | |||
// label: "性别", name: "Sex", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getAsync('dataItem', { | |||
// key: value, | |||
// code: 'usersex', | |||
// callback: function (_data) { | |||
// callback(_data.text); | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
{ label: "负责人", name: "Functionary", width: 100, align: "left" }, | |||
{ label: "负责人电话", name: "Phone", width: 100, align: "left" }, | |||
{ label: "备注", name: "Remark", width: 100, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
isMultiselect:true | |||
//isMultiselect: true | |||
//sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', | |||
//sord: 'ASC', | |||
}); | |||
} | |||
@@ -308,9 +509,12 @@ var bootstrap = function ($, learun) { | |||
refreshGirdData = function () { | |||
//page.initTree(); | |||
if (!!selectedParent.ID) { | |||
//var param = { ParentID: selectedParent.ID }; | |||
//$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
page.initTree(); | |||
page.search({ ParentID: selectedParent.ID }); | |||
} else { | |||
page.initTree(); | |||
page.search(); | |||
} | |||
}; | |||
@@ -0,0 +1,92 @@ | |||
@{ | |||
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 lrlt "> | |||
树形列表 | |||
<a id="tree_refresh" onmouseover="this.style.cursor='hand'">刷新</a> | |||
</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="lrlt">列表信息</span> | |||
</div> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">名称</div> | |||
<input id="Name" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">宿舍楼</div> | |||
<div id="ApartmentId"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">单元</div> | |||
<div id="UnitId"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">楼层</div> | |||
<div id="FloorId"></div> | |||
</div> | |||
@*<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">类别</div> | |||
<input id="BuildType" type="text" class="form-control" /> | |||
</div>*@ | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">系</div> | |||
<div id="Dept"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="Major"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">班级</div> | |||
<div id="Class"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">性别</div> | |||
<div id="Sex"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">未分配</div> | |||
<div id="NoDistribution"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">已分配</div> | |||
<div id="Distribution"></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> | |||
@*<a id="lr_dormitoryAdd" class="btn btn-default"><i class="fa fa-pencil-square"></i> 批量添加宿舍</a> | |||
<a id="lr_allocation" class="btn btn-default"><i class="fa fa-pencil-square"></i> 自动分配宿舍</a>*@ | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_Dept" class="btn btn-default"><i class="fa fa-pencil-square"></i> 分配系</a> | |||
<a id="lr_Class" class="btn btn-default"><i class="fa fa-pencil-square"></i> 分配专业班级</a> | |||
<a id="lr_Bed" class="btn btn-default"><i class="fa fa-pencil-square"></i> 分配宿舍</a> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js") |
@@ -0,0 +1,580 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2019-04-26 15:02 | |||
* 描 述:学生宿舍管理 | |||
*/ | |||
var refreshGirdData; | |||
var selectedParent = {}; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initTree(); | |||
page.initGird(); | |||
page.search({ ParentID: '' }); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 420, 400); | |||
//宿舍楼 | |||
$('#ApartmentId').lrselect({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DormitoryInfo', | |||
param: { strWhere: " BuildType='1' " }, | |||
value: "id", | |||
text: "name", | |||
select: function (item) { | |||
if (!!item) { | |||
//单元 | |||
$('#UnitId').lrselectRefresh({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DormitoryInfo', | |||
param: { strWhere: " BuildType='2' and ApartmentId='" + item.id + "'" }, | |||
value: "id", | |||
text: "name", | |||
select: function (item) { | |||
if (!!item) { | |||
//楼层 | |||
$('#FloorId').lrselectRefresh({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DormitoryInfo', | |||
param: { strWhere: " BuildType='3' and UnitId='" + item.id + "'" }, | |||
value: "id", | |||
text: "name" | |||
}); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}); | |||
$('#UnitId').lrselect({ allowSearch: true }); | |||
$('#FloorId').lrselect({ allowSearch: true }); | |||
$('#Sex').lrDataItemSelect({ code: 'usersex' }); | |||
//.lrRadioCheckbox({ | |||
// type: 'radio', | |||
// code: 'usersex', | |||
//}); | |||
$('#NoDistribution').lrRadioCheckbox({ | |||
type: 'checkbox', | |||
code: 'NoDistribution' | |||
}); | |||
$('#Distribution').lrRadioCheckbox({ | |||
type: 'checkbox', | |||
code: 'NoDistribution' | |||
}); | |||
$('#Class').lrselect({ | |||
value: "classno", | |||
text: "classname" | |||
}); | |||
$('#Dept').lrselect({ | |||
value: "deptno", | |||
text: "deptname", | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', | |||
select: function (item) { | |||
if (item) { | |||
$('#Major').lrselectRefresh({ | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', | |||
param: { code: "CdMajorInfo", strWhere: "DeptNo='" + item.deptno + "'" } | |||
}); | |||
} | |||
else { | |||
$('#Major').lrselectRefresh({ | |||
url: "", | |||
data: [] | |||
}); | |||
} | |||
$('#Class').lrselectRefresh({ | |||
url: "", | |||
data: [] | |||
}); | |||
} | |||
}); | |||
$('#Major').lrselect({ | |||
value: "majorno", | |||
text: "majorname", | |||
select: function (item) { | |||
if (item) { | |||
$('#Class').lrselectRefresh({ | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', | |||
param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" } | |||
}); | |||
} | |||
} | |||
}); | |||
$('#Major').on("click", | |||
function () { | |||
var data = $('#Dept').lrselectGet(); | |||
if (!data) { | |||
learun.alert.error('请先选择系'); | |||
} | |||
}); | |||
$('#Class').on("click", | |||
function () { | |||
var data1 = $('#Dept').lrselectGet(); | |||
var data2 = $('#Major').lrselectGet(); | |||
if (!data1 || !data2) { | |||
learun.alert.error('请先选择系和专业'); | |||
} | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
var url = ""; | |||
if (selectedParent.ID != null) { | |||
url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form?ParentID=' + selectedParent.ID + '&ParentName=' + selectedParent.Name; | |||
} else { | |||
return learun.alert.warning("请选择上级!"); | |||
//url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form'; | |||
} | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: url, | |||
width: 900, | |||
height: 550, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
if (keyValue.indexOf(',') != -1) { | |||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||
return false; | |||
} | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/Form?keyValue=' + keyValue, | |||
width: 900, | |||
height: 550, | |||
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/Accommodation/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
//批量添加宿舍 | |||
$("#lr_dormitoryAdd").on("click", function () { | |||
var keyvalue1 = $("#gridtable").jfGridValue("ID"); | |||
if (selectedParent.ChildType == "2") { | |||
var keyValue = selectedParent.ID; | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '批量添加宿舍', | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/DormitoryAdd?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
else { | |||
learun.alert.warning("请选择楼"); | |||
} | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
//刷新左侧的树 | |||
$("#tree_refresh").on("click", function () { | |||
page.initTree(); | |||
}); | |||
//分配系 | |||
$("#lr_Dept").on("click", function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
var BuildType = $('#gridtable').jfGridValue('BuildType'); | |||
var Dept = $('#gridtable').jfGridValue('Dept'); | |||
var arr = BuildType.split(','); | |||
if (arr.some(x => x != '4')) { | |||
return learun.alert.warning("只能选择宿舍进行分配!"); | |||
} | |||
if (keyValue.indexOf(',') > 0) { | |||
var arrDept = Dept.split(','); | |||
for (var i = 0; i < arrDept.length; i++) { | |||
if (arrDept[i].length >= 1) { | |||
learun.alert.warning("选中记录包含已分配的数据!"); | |||
return false; | |||
} | |||
} | |||
} | |||
learun.layerForm({ | |||
id: 'formDept', | |||
title: '分配系部', | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormDept?keyValue=' + keyValue, | |||
width: 400, | |||
height: 300, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
//分配专业和班级 | |||
$("#lr_Class").on("click", function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
var BuildType = $('#gridtable').jfGridValue('BuildType'); | |||
var Dept = $('#gridtable').jfGridValue('Dept'); | |||
var arr = BuildType.split(','); | |||
if (arr.some(x => x != '4')) { | |||
return learun.alert.warning("只能选择宿舍进行分配!"); | |||
} | |||
var arrDept = Dept.split(','); | |||
if (keyValue.indexOf(',') > 0) { | |||
if (arrDept.some(function(value, index) { | |||
return value.length == 0; | |||
})) { | |||
return learun.alert.warning("选中记录包含未分配专业的数据!"); | |||
} | |||
if (arrDept.some(function (value, index) { | |||
return value != arrDept[0]; | |||
})) { | |||
return learun.alert.warning("选中记录包含多种专业的数据,不可批量分配班级!"); | |||
} | |||
} | |||
learun.layerForm({ | |||
id: 'formDept', | |||
title: '分配专业班级', | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormClass?keyValue=' + keyValue + '&Dept=' + arrDept[0], | |||
width: 400, | |||
height: 300, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
}, | |||
//初始化左侧树 | |||
initTree: function () { | |||
// 初始化左侧树形数据 | |||
$('#dataTree').lrtree({ | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetTree', | |||
nodeClick: function (item) { | |||
selectedParent.ID = item.value; | |||
selectedParent.Name = item.text; | |||
selectedParent.BuildType = item.title; | |||
if (item.parent) { | |||
if (!item.parent.parentId) { | |||
selectedParent.ChildType = "2"; | |||
} else { | |||
selectedParent.ChildType = "0"; | |||
} | |||
} | |||
else { | |||
selectedParent.ChildType = "1"; | |||
} | |||
if (item.text.indexOf("室") > -1) { | |||
selectedParent.ChildType = "5"; | |||
} | |||
page.initGird(); | |||
page.search({ ParentID: item.value }); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$("#gridtable").empty(); | |||
$("#gridtable")[0].dfop = undefined; | |||
if (selectedParent.BuildType == undefined || selectedParent.BuildType === "3") { | |||
//宿舍数据 | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', | |||
headData: [ | |||
{ label: "名称", name: "Name", width: 100, align: "left" }, | |||
{ | |||
label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" | |||
}, | |||
{ | |||
label: "单元", name: "UnitName", width: 100, align: "left" | |||
}, | |||
{ | |||
label: "楼层", name: "FloorName", width: 100, align: "left" | |||
}, | |||
//{ | |||
// label: "学生", name: "StudentID", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getAsync('custmerData', { | |||
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', | |||
// key: value, | |||
// keyId: 'stuid', | |||
// callback: function (_data) { | |||
// callback(_data['stuname']); | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
{ label: "位置", name: "Address", width: 100, align: "left" }, | |||
{ | |||
label: "校区", name: "Campus", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', | |||
key: value, | |||
keyId: 'f_companyid', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "系", name: "Dept", 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: "Major", width: 100, 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: "Class", 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: "RoomType", width: 100, align: "left", | |||
formatter: function (value, row) { | |||
if (value) { | |||
return value + '人寝'; | |||
} else { | |||
return ''; | |||
} | |||
} | |||
}, | |||
{ label: "入住人数", name: "CheckInStu", width: 100, align: "left" }, | |||
{ | |||
label: "性别", name: "Sex", width: 100, align: "left", | |||
formatter: function (callback, value, row, op, $cell) { | |||
if (value == '0') | |||
return '女'; | |||
else if (value == '1') | |||
return '男'; | |||
else | |||
return ''; | |||
} | |||
}, | |||
{ label: "负责人", name: "Functionary", width: 100, align: "left" }, | |||
{ label: "负责人电话", name: "Phone", width: 100, align: "left" }, | |||
{ label: "备注", name: "Remark", width: 100, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
isMultiselect: true, | |||
sidx: 'CheckInStu desc,ApartmentId asc,UnitId asc ,FloorId asc ', | |||
//sord: 'ASC', | |||
isSubGrid: true, // 是否有子表 | |||
subGridExpanded: function (subContentId, rowItem) { | |||
$('#' + subContentId).jfGrid({ | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + rowItem.ID, | |||
headData: [ | |||
{ label: "名称", name: "Name", width: 100, align: "left" }, | |||
{ | |||
label: "学生", name: "StudentID", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', | |||
key: value, | |||
keyId: 'stuid', | |||
callback: function (_data) { | |||
callback(_data['stuname']); | |||
} | |||
}); | |||
} | |||
}, | |||
], | |||
mainId: 'ID', | |||
isPage: false, | |||
//sidx: 'DNo', | |||
//sord: 'ASC', | |||
}); | |||
//var param; | |||
//param = param || {}; | |||
//param.ParentID = rowItem.Id; | |||
$('#' + subContentId).jfGridSet('reload'); | |||
}, | |||
subGridHeight: 250, | |||
}); | |||
} else { | |||
//lrAuthorizeJfGridLei | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', | |||
headData: [ | |||
{ label: "名称", name: "Name", width: 100, align: "left" }, | |||
{ | |||
label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" | |||
}, | |||
{ | |||
label: "单元", name: "UnitName", width: 100, align: "left" | |||
}, | |||
{ | |||
label: "楼层", name: "FloorName", width: 100, align: "left" | |||
}, | |||
//{ | |||
// label: "学生", name: "StudentID", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getAsync('custmerData', { | |||
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', | |||
// key: value, | |||
// keyId: 'stuid', | |||
// callback: function (_data) { | |||
// callback(_data['stuname']); | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
{ label: "位置", name: "Address", width: 100, align: "left" }, | |||
{ | |||
label: "校区", name: "Campus", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', | |||
key: value, | |||
keyId: 'f_companyid', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
} | |||
}); | |||
} | |||
}, | |||
//{ | |||
// label: "系", name: "Dept", 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: "Major", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getAsync('custmerData', { | |||
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
// key: value, | |||
// keyId: 'id', | |||
// callback: function (_data) { | |||
// callback(_data['majorname']); | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
//{ label: "班级", name: "Class", width: 100, align: "left" }, | |||
//{ | |||
// label: "性别", name: "Sex", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getAsync('dataItem', { | |||
// key: value, | |||
// code: 'usersex', | |||
// callback: function (_data) { | |||
// callback(_data.text); | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
{ label: "负责人", name: "Functionary", width: 100, align: "left" }, | |||
{ label: "负责人电话", name: "Phone", width: 100, align: "left" }, | |||
{ label: "备注", name: "Remark", width: 100, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
//isMultiselect: true | |||
//sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', | |||
//sord: 'ASC', | |||
}); | |||
} | |||
//page.search(); | |||
}, | |||
search: function (param) { | |||
//console.log(param); | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
//page.initTree(); | |||
if (!!selectedParent.ID) { | |||
//var param = { ParentID: selectedParent.ID }; | |||
//$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
page.initTree(); | |||
page.search({ ParentID: selectedParent.ID }); | |||
} else { | |||
page.initTree(); | |||
page.search(); | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -1220,8 +1220,11 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\TeachPlan\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Index.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\Allocation.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\DormitoryAdd.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexDistribution.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ADR_Record\AttendanceReportByWeek.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ADR_Record\StatisticDetailIndex.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ADR_Record\StatisticIndex.js" /> | |||
@@ -7498,6 +7501,9 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\StuVolunteer\FormSchool.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuVolunteer\IndexAccount.cshtml" /> | |||
<Content Include="Areas\LR_SystemModule\Views\Log\ApiIndex.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexDistribution.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -7622,10 +7628,10 @@ | |||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | |||
<WebProjectProperties> | |||
<UseIIS>False</UseIIS> | |||
<AutoAssignPort>True</AutoAssignPort> | |||
<DevelopmentServerPort>20472</DevelopmentServerPort> | |||
<DevelopmentServerVPath>/</DevelopmentServerVPath> | |||
<IISUrl>http://localhost:20873/</IISUrl> | |||
<AutoAssignPort>True</AutoAssignPort> | |||
<DevelopmentServerPort>20472</DevelopmentServerPort> | |||
<DevelopmentServerVPath>/</DevelopmentServerVPath> | |||
<IISUrl>http://localhost:20873/</IISUrl> | |||
<NTLMAuthentication>False</NTLMAuthentication> | |||
<UseCustomServer>False</UseCustomServer> | |||
<CustomServerUrl> | |||
@@ -19,12 +19,33 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
/// </summary> | |||
[Column("ID")] | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// 编号 | |||
/// </summary> | |||
[Column("DNO")] | |||
public string DNo { get; set; } | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
[Column("NAME")] | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 宿舍楼 | |||
/// </summary> | |||
[Column("APARTMENTID")] | |||
public string ApartmentId { get; set; } | |||
/// <summary> | |||
/// 单元 | |||
/// </summary> | |||
[Column("UNITID")] | |||
public string UnitId { get; set; } | |||
/// <summary> | |||
/// 楼层 | |||
/// </summary> | |||
[Column("FLOORID")] | |||
public string FloorId { get; set; } | |||
/// <summary> | |||
/// 负责人 | |||
/// </summary> | |||
[Column("FUNCTIONARY")] | |||
@@ -145,9 +166,27 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
/// </summary> | |||
[Column("PLANBEDNUM")] | |||
public int? PlanBedNum { get; set; } | |||
/// <summary> | |||
/// 寝室类型(几人寝) | |||
/// </summary> | |||
[Column("ROOMTYPE")] | |||
public int? RoomType { get; set; } | |||
/// <summary> | |||
/// 入住人数 | |||
/// </summary> | |||
[Column("CHECKINSTU")] | |||
public int? CheckInStu { get; set; } | |||
#endregion | |||
#region 扩展字段 | |||
[NotMapped] | |||
public string ApartmentName { get; set; } | |||
[NotMapped] | |||
public string UnitName { get; set; } | |||
[NotMapped] | |||
public string FloorName { get; set; } | |||
/// <summary> | |||
/// 学生名字 | |||
/// </summary> | |||
@@ -42,6 +42,26 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
} | |||
} | |||
} | |||
public IEnumerable<Acc_DormitoryBuildEntity> GetBedListByRoomId(string RoomId) | |||
{ | |||
try | |||
{ | |||
return accommodationService.GetBedListByRoomId(RoomId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<Acc_DormitoryBuildEntity> GetAllList() | |||
{ | |||
try | |||
@@ -179,6 +199,27 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
} | |||
public string GetParentBuildType(string keyValue) | |||
{ | |||
try | |||
{ | |||
return accommodationService.GetParentBuildType(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Acc_DormitoryBuild表实体数据 | |||
/// <param name="keyValue">主键</param> | |||
@@ -270,8 +311,9 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
value = item.ID.ToString(), | |||
showcheck = false, | |||
checkstate = 0, | |||
isexpand = false, | |||
parentId = item.ParentID == null ? "" : item.ParentID | |||
isexpand = true, | |||
parentId = item.ParentID == null ? "" : item.ParentID, | |||
title = item.BuildType | |||
}; | |||
@@ -505,6 +547,29 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
} | |||
} | |||
/// <summary> | |||
/// 分配系 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <param name="entity"></param> | |||
public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type) | |||
{ | |||
try | |||
{ | |||
accommodationService.SaveDeptClass(keyValue, entity, type); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 批量添加单元、楼层、宿舍、床位 | |||
@@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<Acc_DormitoryBuildEntity> GetPageList(Pagination pagination, string queryJson); | |||
IEnumerable<Acc_DormitoryBuildEntity> GetBedListByRoomId(string RoomId); | |||
IEnumerable<Acc_DormitoryBuildEntity> GetAllList(); | |||
/// <summary> | |||
/// 获取Acc_DormitoryBuild表实体数据 | |||
@@ -69,6 +70,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
/// <returns></returns> | |||
void DeleteEntity(string keyValue); | |||
string GetBuildType(string parentID); | |||
string GetParentBuildType(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
@@ -76,6 +78,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
/// <summary> | |||
/// <returns></returns> | |||
void SaveEntity(string keyValue, Acc_DormitoryBuildEntity entity); | |||
void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type); | |||
/// <summary> | |||
@@ -51,10 +51,14 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
t.ParentID, | |||
t.Remark, | |||
t.Starred, | |||
t.HasToilet, | |||
stb.StuName | |||
t.HasToilet,t.RoomType, | |||
t.ApartmentId,t.UnitId,t.FloorId,t.CheckInStu, | |||
a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
"); | |||
strSql.Append(" FROM Acc_DormitoryBuild t LEFT JOIN dbo.StuInfoBasic stb ON t.StudentID=stb.StuId"); | |||
strSql.Append(" FROM Acc_DormitoryBuild t "); | |||
strSql.Append(@" left join (select * FROM Acc_DormitoryBuild where BuildType='1') a on t.ApartmentId=a.ID | |||
left join(select * FROM Acc_DormitoryBuild where BuildType = '2') b on t.UnitId = b.ID | |||
left join(select * FROM Acc_DormitoryBuild where BuildType = '3') c on t.FloorId = c.ID "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
@@ -64,6 +68,27 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
dp.Add("ParentID", queryParam["ParentID"].ToString(), DbType.String); | |||
strSql.Append(" AND t.ParentID =@ParentID "); | |||
} | |||
else | |||
{ | |||
strSql.Append(" AND t.BuildType ='4' "); | |||
} | |||
if (!queryParam["ApartmentId"].IsEmpty()) | |||
{ | |||
dp.Add("ApartmentId", queryParam["ApartmentId"].ToString(), DbType.String); | |||
strSql.Append(" AND t.ApartmentId =@ApartmentId "); | |||
} | |||
if (!queryParam["UnitId"].IsEmpty()) | |||
{ | |||
dp.Add("UnitId", queryParam["UnitId"].ToString(), DbType.String); | |||
strSql.Append(" AND t.UnitId =@UnitId "); | |||
} | |||
if (!queryParam["FloorId"].IsEmpty()) | |||
{ | |||
dp.Add("FloorId", queryParam["FloorId"].ToString(), DbType.String); | |||
strSql.Append(" AND t.FloorId =@FloorId "); | |||
} | |||
if (!queryParam["Name"].IsEmpty()) | |||
{ | |||
dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); | |||
@@ -77,17 +102,17 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
if (!queryParam["Dept"].IsEmpty()) | |||
{ | |||
dp.Add("Dept", "%" + queryParam["Dept"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Dept Like @Dept "); | |||
strSql.Append(" AND t.Dept=@Dept "); | |||
} | |||
if (!queryParam["Class"].IsEmpty()) | |||
{ | |||
dp.Add("Class", "%" + queryParam["Class"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Class Like @Class "); | |||
strSql.Append(" AND t.Class=@Class "); | |||
} | |||
if (!queryParam["Major"].IsEmpty()) | |||
{ | |||
dp.Add("Major", "%" + queryParam["Major"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Major Like @Major "); | |||
strSql.Append(" AND t.Major=@Major "); | |||
} | |||
if (!queryParam["Sex"].IsEmpty()) | |||
{ | |||
@@ -104,6 +129,47 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
dp.Add("Leader", "%" + queryParam["Leader"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Leader Like @Leader "); | |||
} | |||
if (!queryParam["NoDistribution"].IsEmpty()) | |||
{ | |||
var noDistribution = queryParam["NoDistribution"].ToString(); | |||
if (noDistribution.Contains("dept")) | |||
{ | |||
strSql.Append(" AND (t.Dept is null or len(t.Dept)=0) "); | |||
} | |||
if (noDistribution.Contains("major")) | |||
{ | |||
strSql.Append(" AND (t.Major is null or len(t.Major)=0) "); | |||
} | |||
if (noDistribution.Contains("class")) | |||
{ | |||
strSql.Append(" AND (t.Class is null or len(t.Class)=0) "); | |||
} | |||
if (noDistribution.Contains("room")) | |||
{ | |||
strSql.Append(" AND (t.CheckInStu is null or len(t.CheckInStu)=0 or t.CheckInStu=0) "); | |||
} | |||
} | |||
if (!queryParam["Distribution"].IsEmpty()) | |||
{ | |||
var distribution = queryParam["Distribution"].ToString(); | |||
if (distribution.Contains("dept")) | |||
{ | |||
strSql.Append(" AND len(t.Dept)>0 "); | |||
} | |||
if (distribution.Contains("major")) | |||
{ | |||
strSql.Append(" AND len(t.Major)>0 "); | |||
} | |||
if (distribution.Contains("class")) | |||
{ | |||
strSql.Append(" AND len(t.Class)>0 "); | |||
} | |||
if (distribution.Contains("room")) | |||
{ | |||
strSql.Append(" AND t.CheckInStu>0 "); | |||
} | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(strSql.ToString(), dp, pagination).OrderBy(a => a.Name).ThenBy(a => a.Name).ToList(); | |||
} | |||
catch (Exception ex) | |||
@@ -118,6 +184,27 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
} | |||
} | |||
} | |||
public IEnumerable<Acc_DormitoryBuildEntity> GetBedListByRoomId(string RoomId) | |||
{ | |||
try | |||
{ | |||
string sql = $"select ID,Name,DNo,StudentID from Acc_DormitoryBuild where BuildType='5' and ParentID='{RoomId}'"; | |||
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(sql); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<Acc_DormitoryBuildEntity> GetAllList() | |||
{ | |||
try | |||
@@ -141,7 +228,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
{ | |||
try | |||
{ | |||
var entity = this.BaseRepository("CollegeMIS").FindEntity<Acc_DormitoryBuildEntity>(a => a.ParentID == parentID); | |||
var entity = this.BaseRepository("CollegeMIS").FindEntity<Acc_DormitoryBuildEntity>(a => a.ID == parentID); | |||
if (null != entity) | |||
{ | |||
return entity.BuildType; | |||
@@ -164,6 +251,35 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
} | |||
} | |||
public string GetParentBuildType(string keyValue) | |||
{ | |||
try | |||
{ | |||
string sql = $@" select BuildType from [dbo].[Acc_DormitoryBuild] where Id=( | |||
select parentid from [dbo].[Acc_DormitoryBuild] where id='{keyValue}')"; | |||
var data = this.BaseRepository("CollegeMIS").FindObject(sql); | |||
if (data == null) | |||
{ | |||
return ""; | |||
} | |||
else | |||
{ | |||
return data.ToString(); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
internal object GetRoomList(string parentID) | |||
{ | |||
try | |||
@@ -582,7 +698,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(a => a.BuildType != "5").OrderBy(a => a.sort).ThenBy(a => a.Name).ToList(); | |||
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(a => a.BuildType != "5" && a.BuildType != "4").OrderBy(a => a.sort).ThenBy(a => a.Name).ToList(); | |||
} | |||
catch (Exception ex) | |||
@@ -842,7 +958,9 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
var elementEntity = new Acc_DormitoryBuildEntity | |||
{ | |||
ParentID = keyValue, | |||
ApartmentId = keyValue, | |||
Name = i.ToString() + "单元", | |||
DNo = i.ToString(), | |||
BuildType = "2",//单元类型 | |||
Sex = dormitory.Sex, | |||
Address = dormitory.Address, | |||
@@ -869,7 +987,10 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
var floorEntity = new Acc_DormitoryBuildEntity | |||
{ | |||
ParentID = elementEntity.ID, | |||
ApartmentId = keyValue, | |||
UnitId = elementEntity.ID, | |||
Name = j.ToString() + "层", | |||
DNo = j.ToString(), | |||
BuildType = "3",//楼层类型, | |||
Sex = dormitory.Sex, | |||
Address = dormitory.Address, | |||
@@ -896,7 +1017,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
var roomEntity = new Acc_DormitoryBuildEntity | |||
{ | |||
ParentID = floorEntity.ID, | |||
ApartmentId = keyValue, | |||
UnitId = elementEntity.ID, | |||
FloorId = floorEntity.ID, | |||
Name = j.ToString() + (n < 10 ? "0" + n.ToString() : n.ToString()) + "室", | |||
DNo = j.ToString() + (n < 10 ? "0" + n.ToString() : n.ToString()), | |||
BuildType = "4",//房间类型 | |||
Sex = dormitory.Sex, | |||
Address = dormitory.Address, | |||
@@ -909,6 +1034,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
Major = dormitory.Major, | |||
Phone = dormitory.Phone, | |||
Price = dormitory.Price, | |||
RoomType = bedNum, | |||
UpdateBy = currentUser.realName, | |||
UpdateTime = DateTime.Now, | |||
Starred = "3", | |||
@@ -926,6 +1052,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
{ | |||
ParentID = roomEntity.ID, | |||
Name = m.ToString() + "床", | |||
DNo = m.ToString(), | |||
BuildType = "5", | |||
Sex = dormitory.Sex, | |||
Address = dormitory.Address, | |||
@@ -1300,6 +1427,30 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
} | |||
} | |||
} | |||
else | |||
{ | |||
var parentity = this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>().FirstOrDefault(a => a.ID == entity.ParentID); | |||
switch (parentity.BuildType) | |||
{ | |||
case "1": | |||
entity.ApartmentId = parentity.ID; | |||
break; | |||
case "2": | |||
{ | |||
entity.UnitId = parentity.ID; | |||
entity.ApartmentId = parentity.ApartmentId; | |||
} | |||
break; | |||
case "3": | |||
{ | |||
entity.FloorId = parentity.ID; | |||
entity.UnitId = parentity.UnitId; | |||
entity.ApartmentId = parentity.ApartmentId; | |||
} | |||
break; | |||
} | |||
} | |||
entity.Create(); | |||
entity.CreateBy = currentUser.realName; | |||
entity.CreateTime = DateTime.Now; | |||
@@ -1321,6 +1472,41 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
} | |||
} | |||
public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity, int type) | |||
{ | |||
try | |||
{ | |||
if (keyValue.Contains(",")) | |||
{ | |||
keyValue = string.Join("','", keyValue.Split(',')); | |||
} | |||
string sql = $"update Acc_DormitoryBuild set "; | |||
if (type == 1) | |||
{ | |||
sql += $" Dept='{entity.Dept}' "; | |||
} | |||
else | |||
{ | |||
sql += $"Major='{entity.Major}',Class='{entity.Class}'"; | |||
} | |||
sql += $" where ID in ('{keyValue}')"; | |||
this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 同步宿舍信息 | |||
/// </summary> | |||