@@ -7,6 +7,7 @@ using System.Web.Helpers; | |||||
using Newtonsoft.Json; | using Newtonsoft.Json; | ||||
using Newtonsoft.Json.Linq; | using Newtonsoft.Json.Linq; | ||||
using System; | using System; | ||||
using System.Linq; | |||||
namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | ||||
{ | { | ||||
@@ -47,11 +48,16 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
/// <summary> | /// <summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
[HttpGet] | [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.ParentID = ParentID; | ||||
ViewBag.ParentName = ParentName; | ViewBag.ParentName = ParentName; | ||||
ViewBag.BuildType = accommodationIBLL.GetBuildType(ParentID); | ViewBag.BuildType = accommodationIBLL.GetBuildType(ParentID); | ||||
if (!string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
ViewBag.BuildType = accommodationIBLL.GetParentBuildType(keyValue); | |||||
} | |||||
return View(); | return View(); | ||||
} | } | ||||
@@ -167,6 +173,18 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
return Success(jsonData); | 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> | /// <summary> | ||||
/// 获取宿舍楼数据 | /// 获取宿舍楼数据 | ||||
@@ -344,7 +362,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 同步宿舍信息数据 | /// 同步宿舍信息数据 | ||||
/// </summary> | /// </summary> | ||||
@@ -8,23 +8,23 @@ | |||||
{ | { | ||||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">上级</div> | <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"/> | |||||
<input id="ParentID" type="hidden" value="@ViewBag.ParentID" /> | |||||
<input type="text" class="form-control" value="@ViewBag.ParentName" readonly="readonly" /> | |||||
</div> | </div> | ||||
} | } | ||||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">名称</div> | <div class="lr-form-item-title">名称</div> | ||||
<input id="Name" type="text" class="form-control"/> | |||||
<input id="Name" type="text" class="form-control" /> | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">编号<font face="宋体">*</font></div> | <div class="lr-form-item-title">编号<font face="宋体">*</font></div> | ||||
<input id="DNo" type="number" class="form-control" isvalid="yes" checkexpession="NotNull"/> | |||||
<input id="DNo" type="number" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">位置</div> | <div class="lr-form-item-title">位置</div> | ||||
<input id="Address" type="text" class="form-control"/> | |||||
<input id="Address" type="text" class="form-control" /> | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">类别<font face="宋体">*</font></div> | <div class="lr-form-item-title">类别<font face="宋体">*</font></div> | ||||
@@ -49,23 +49,23 @@ | |||||
</div>*@ | </div>*@ | ||||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">负责人</div> | <div class="lr-form-item-title">负责人</div> | ||||
<input id="Functionary" type="text" class="form-control"/> | |||||
<input id="Functionary" type="text" class="form-control" /> | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">负责人电话</div> | <div class="lr-form-item-title">负责人电话</div> | ||||
<input id="Phone" type="text" class="form-control"/> | |||||
<input id="Phone" type="text" class="form-control" /> | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">价格</div> | <div class="lr-form-item-title">价格</div> | ||||
<input id="Price" type="text" class="form-control"/> | |||||
<input id="Price" type="text" class="form-control" /> | |||||
</div> | </div> | ||||
@*<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | @*<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>*@ | |||||
<div class="lr-form-item-title">顺序</div> | |||||
<input id="sort" type="number" class="form-control"/> | |||||
</div>*@ | |||||
@if (ViewBag.BuildType == "3") | @if (ViewBag.BuildType == "3") | ||||
{ | |||||
{ | |||||
//寝室信息 | //寝室信息 | ||||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">性别</div> | <div class="lr-form-item-title">性别</div> | ||||
@@ -73,11 +73,7 @@ | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">舍长</div> | <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"/> | |||||
<input id="Leader" type="text" class="form-control" /> | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">类型</div> | <div class="lr-form-item-title">类型</div> | ||||
@@ -85,14 +81,20 @@ | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">星级</div> | <div class="lr-form-item-title">星级</div> | ||||
<input id="Starred" type="text" class="form-control"/> | |||||
<input id="Starred" type="text" class="form-control" /> | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | <div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">是否独卫</div> | <div class="lr-form-item-title">是否独卫</div> | ||||
<div id="HasToilet"></div> | <div id="HasToilet"></div> | ||||
</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="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild"> | ||||
<div class="lr-form-item-title">备注</div> | <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> | ||||
@@ -28,41 +28,37 @@ | |||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item"> | <div class="col-xs-12 lr-form-item"> | ||||
<div class="lr-form-item-title">宿舍楼</div> | <div class="lr-form-item-title">宿舍楼</div> | ||||
<div id="Apartment"></div> | |||||
<div id="ApartmentId"></div> | |||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item"> | <div class="col-xs-12 lr-form-item"> | ||||
<div class="lr-form-item-title">单元</div> | <div class="lr-form-item-title">单元</div> | ||||
<div id="Unit"></div> | |||||
<div id="UnitId"></div> | |||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item"> | <div class="col-xs-12 lr-form-item"> | ||||
<div class="lr-form-item-title">楼层</div> | <div class="lr-form-item-title">楼层</div> | ||||
<div id="Floor"></div> | |||||
<div id="FloorId"></div> | |||||
</div> | </div> | ||||
@*<div class="col-xs-12 lr-form-item"> | |||||
@*<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">类别</div> | <div class="lr-form-item-title">类别</div> | ||||
<input id="BuildType" type="text" class="form-control" /> | <input id="BuildType" type="text" class="form-control" /> | ||||
</div>*@ | </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> | |||||
<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> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -71,7 +67,7 @@ | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | <a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | ||||
<a id="lr_dormitoryAdd" class="btn btn-default"><i class="fa fa-pencil-square"></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_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> | ||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | <div class=" btn-group btn-group-sm" learun-authorize="yes"> | ||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 录入</a> | <a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 录入</a> | ||||
@@ -20,11 +20,107 @@ var bootstrap = function ($, learun) { | |||||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | ||||
page.search(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 () { | $('#lr_refresh').on('click', function () { | ||||
location.reload(); | location.reload(); | ||||
@@ -174,9 +270,8 @@ var bootstrap = function ($, learun) { | |||||
initGird: function () { | initGird: function () { | ||||
$("#gridtable").empty(); | $("#gridtable").empty(); | ||||
$("#gridtable")[0].dfop = undefined; | $("#gridtable")[0].dfop = undefined; | ||||
// console.log('selectedParent.BuildType', selectedParent.BuildType); | |||||
if (selectedParent.BuildType == undefined || selectedParent.BuildType === "3") { | if (selectedParent.BuildType == undefined || selectedParent.BuildType === "3") { | ||||
// console.log('查询寝室列表'); | |||||
//宿舍数据 | |||||
$('#gridtable').jfGrid({ | $('#gridtable').jfGrid({ | ||||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', | url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', | ||||
headData: [ | headData: [ | ||||
@@ -260,14 +355,13 @@ var bootstrap = function ($, learun) { | |||||
}, | }, | ||||
{ | { | ||||
label: "性别", name: "Sex", 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); | |||||
} | |||||
}); | |||||
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: "Functionary", width: 100, align: "left" }, | ||||
@@ -279,6 +373,37 @@ var bootstrap = function ($, learun) { | |||||
isMultiselect: true, | isMultiselect: true, | ||||
sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', | sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', | ||||
//sord: '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 { | } else { | ||||
//lrAuthorizeJfGridLei | //lrAuthorizeJfGridLei | ||||
@@ -369,7 +494,7 @@ var bootstrap = function ($, learun) { | |||||
], | ], | ||||
mainId: 'ID', | mainId: 'ID', | ||||
isPage: true, | isPage: true, | ||||
isMultiselect: true | |||||
//isMultiselect: true | |||||
//sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', | //sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', | ||||
//sord: 'ASC', | //sord: 'ASC', | ||||
}); | }); | ||||
@@ -7622,10 +7622,10 @@ | |||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | ||||
<WebProjectProperties> | <WebProjectProperties> | ||||
<UseIIS>False</UseIIS> | <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> | <NTLMAuthentication>False</NTLMAuthentication> | ||||
<UseCustomServer>False</UseCustomServer> | <UseCustomServer>False</UseCustomServer> | ||||
<CustomServerUrl> | <CustomServerUrl> | ||||
@@ -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() | public IEnumerable<Acc_DormitoryBuildEntity> GetAllList() | ||||
{ | { | ||||
try | 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> | /// <summary> | ||||
/// 获取Acc_DormitoryBuild表实体数据 | /// 获取Acc_DormitoryBuild表实体数据 | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
@@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
/// <param name="queryJson">查询参数</param> | /// <param name="queryJson">查询参数</param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
IEnumerable<Acc_DormitoryBuildEntity> GetPageList(Pagination pagination, string queryJson); | IEnumerable<Acc_DormitoryBuildEntity> GetPageList(Pagination pagination, string queryJson); | ||||
IEnumerable<Acc_DormitoryBuildEntity> GetBedListByRoomId(string RoomId); | |||||
IEnumerable<Acc_DormitoryBuildEntity> GetAllList(); | IEnumerable<Acc_DormitoryBuildEntity> GetAllList(); | ||||
/// <summary> | /// <summary> | ||||
/// 获取Acc_DormitoryBuild表实体数据 | /// 获取Acc_DormitoryBuild表实体数据 | ||||
@@ -69,6 +70,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
/// <returns></returns> | /// <returns></returns> | ||||
void DeleteEntity(string keyValue); | void DeleteEntity(string keyValue); | ||||
string GetBuildType(string parentID); | string GetBuildType(string parentID); | ||||
string GetParentBuildType(string keyValue); | |||||
/// <summary> | /// <summary> | ||||
/// 保存实体数据(新增、修改) | /// 保存实体数据(新增、修改) | ||||
@@ -73,6 +73,22 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||||
strSql.Append(" AND t.BuildType ='4' "); | 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()) | if (!queryParam["Name"].IsEmpty()) | ||||
{ | { | ||||
dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); | dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); | ||||
@@ -86,17 +102,17 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||||
if (!queryParam["Dept"].IsEmpty()) | if (!queryParam["Dept"].IsEmpty()) | ||||
{ | { | ||||
dp.Add("Dept", "%" + queryParam["Dept"].ToString() + "%", DbType.String); | 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()) | if (!queryParam["Class"].IsEmpty()) | ||||
{ | { | ||||
dp.Add("Class", "%" + queryParam["Class"].ToString() + "%", DbType.String); | 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()) | if (!queryParam["Major"].IsEmpty()) | ||||
{ | { | ||||
dp.Add("Major", "%" + queryParam["Major"].ToString() + "%", DbType.String); | 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()) | if (!queryParam["Sex"].IsEmpty()) | ||||
{ | { | ||||
@@ -127,6 +143,27 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||||
} | } | ||||
} | } | ||||
} | } | ||||
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() | public IEnumerable<Acc_DormitoryBuildEntity> GetAllList() | ||||
{ | { | ||||
try | try | ||||
@@ -173,6 +210,35 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||||
} | } | ||||
} | } | ||||
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) | internal object GetRoomList(string parentID) | ||||
{ | { | ||||
try | try | ||||
@@ -851,7 +917,9 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||||
var elementEntity = new Acc_DormitoryBuildEntity | var elementEntity = new Acc_DormitoryBuildEntity | ||||
{ | { | ||||
ParentID = keyValue, | ParentID = keyValue, | ||||
ApartmentId = keyValue, | |||||
Name = i.ToString() + "单元", | Name = i.ToString() + "单元", | ||||
DNo = i.ToString(), | |||||
BuildType = "2",//单元类型 | BuildType = "2",//单元类型 | ||||
Sex = dormitory.Sex, | Sex = dormitory.Sex, | ||||
Address = dormitory.Address, | Address = dormitory.Address, | ||||
@@ -878,7 +946,10 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||||
var floorEntity = new Acc_DormitoryBuildEntity | var floorEntity = new Acc_DormitoryBuildEntity | ||||
{ | { | ||||
ParentID = elementEntity.ID, | ParentID = elementEntity.ID, | ||||
ApartmentId = keyValue, | |||||
UnitId = elementEntity.ID, | |||||
Name = j.ToString() + "层", | Name = j.ToString() + "层", | ||||
DNo = j.ToString(), | |||||
BuildType = "3",//楼层类型, | BuildType = "3",//楼层类型, | ||||
Sex = dormitory.Sex, | Sex = dormitory.Sex, | ||||
Address = dormitory.Address, | Address = dormitory.Address, | ||||
@@ -905,7 +976,11 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||||
var roomEntity = new Acc_DormitoryBuildEntity | var roomEntity = new Acc_DormitoryBuildEntity | ||||
{ | { | ||||
ParentID = floorEntity.ID, | ParentID = floorEntity.ID, | ||||
ApartmentId = keyValue, | |||||
UnitId = elementEntity.ID, | |||||
FloorId = floorEntity.ID, | |||||
Name = j.ToString() + (n < 10 ? "0" + n.ToString() : n.ToString()) + "室", | Name = j.ToString() + (n < 10 ? "0" + n.ToString() : n.ToString()) + "室", | ||||
DNo = j.ToString() + (n < 10 ? "0" + n.ToString() : n.ToString()), | |||||
BuildType = "4",//房间类型 | BuildType = "4",//房间类型 | ||||
Sex = dormitory.Sex, | Sex = dormitory.Sex, | ||||
Address = dormitory.Address, | Address = dormitory.Address, | ||||
@@ -935,6 +1010,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||||
{ | { | ||||
ParentID = roomEntity.ID, | ParentID = roomEntity.ID, | ||||
Name = m.ToString() + "床", | Name = m.ToString() + "床", | ||||
DNo = m.ToString(), | |||||
BuildType = "5", | BuildType = "5", | ||||
Sex = dormitory.Sex, | Sex = dormitory.Sex, | ||||
Address = dormitory.Address, | Address = dormitory.Address, | ||||