@@ -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 | |||
{ | |||
@@ -47,11 +48,16 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
/// <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(); | |||
} | |||
@@ -233,27 +239,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
var data = accommodationIBLL.GetBedListByRoomId(RoomId).OrderBy(x => x.DNo); | |||
return Success(data); | |||
} | |||
/// <summary> | |||
/// 获取分类数据 | |||
/// <summary> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetClassifyList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = accommodationIBLL.GetClassifyList(paginationobj,queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取宿舍楼数据 | |||
/// </summary> | |||
@@ -444,6 +430,15 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
} | |||
/// <summary> | |||
/// 同步宿舍信息数据 | |||
/// </summary> | |||
/// <returns></returns> | |||
public ActionResult SyncData() | |||
{ | |||
accommodationIBLL.SyncData(); | |||
return Success("同步成功"); | |||
//public ActionResult DormitoryAdd(string a,string ) | |||
@@ -8,23 +8,23 @@ | |||
{ | |||
<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"/> | |||
<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"/> | |||
<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">编号<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 class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<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 class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">类别<font face="宋体">*</font></div> | |||
@@ -49,23 +49,23 @@ | |||
</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"/> | |||
<input id="Functionary" 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="Phone" type="text" class="form-control"/> | |||
<input id="Phone" 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="Price" type="text" class="form-control"/> | |||
<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>*@ | |||
<div class="lr-form-item-title">顺序</div> | |||
<input id="sort" type="number" class="form-control"/> | |||
</div>*@ | |||
@if (ViewBag.BuildType == "3") | |||
{ | |||
{ | |||
//寝室信息 | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">性别</div> | |||
@@ -73,11 +73,7 @@ | |||
</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"/> | |||
<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> | |||
@@ -85,14 +81,20 @@ | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<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 class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild"> | |||
<div class="lr-form-item-title">是否独卫</div> | |||
<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> | |||
@@ -28,41 +28,37 @@ | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">宿舍楼</div> | |||
<div id="Apartment"></div> | |||
<div id="ApartmentId"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">单元</div> | |||
<div id="Unit"></div> | |||
<div id="UnitId"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">楼层</div> | |||
<div id="Floor"></div> | |||
<div id="FloorId"></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> | |||
<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> | |||
<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> | |||
@@ -71,6 +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>*@ | |||
</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> | |||
@@ -20,11 +20,107 @@ var bootstrap = function ($, learun) { | |||
$('#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(); | |||
@@ -215,9 +311,8 @@ var bootstrap = function ($, learun) { | |||
initGird: function () { | |||
$("#gridtable").empty(); | |||
$("#gridtable")[0].dfop = undefined; | |||
// console.log('selectedParent.BuildType', selectedParent.BuildType); | |||
if (selectedParent.BuildType == undefined || selectedParent.BuildType === "3") { | |||
// console.log('查询寝室列表'); | |||
//宿舍数据 | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', | |||
headData: [ | |||
@@ -301,14 +396,13 @@ var bootstrap = function ($, learun) { | |||
}, | |||
{ | |||
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" }, | |||
@@ -320,6 +414,37 @@ var bootstrap = function ($, learun) { | |||
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 | |||
@@ -410,7 +535,7 @@ var bootstrap = function ($, learun) { | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
isMultiselect: true | |||
//isMultiselect: true | |||
//sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', | |||
//sord: 'ASC', | |||
}); | |||
@@ -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 | |||
@@ -198,6 +218,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> | |||
@@ -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(); | |||
IEnumerable<Acc_DormitoryBuildEntity> GetClassifyList(Pagination paginationobj,string queryJson); | |||
/// <summary> | |||
@@ -71,6 +72,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
/// <returns></returns> | |||
void DeleteEntity(string keyValue); | |||
string GetBuildType(string parentID); | |||
string GetParentBuildType(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
@@ -73,6 +73,22 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
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); | |||
@@ -86,17 +102,17 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
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()) | |||
{ | |||
@@ -174,6 +190,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() | |||
{ | |||
try | |||
@@ -303,6 +340,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) | |||
{ | |||
try | |||
@@ -1004,7 +1070,9 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
var elementEntity = new Acc_DormitoryBuildEntity | |||
{ | |||
ParentID = keyValue, | |||
ApartmentId = keyValue, | |||
Name = i.ToString() + "单元", | |||
DNo = i.ToString(), | |||
BuildType = "2",//单元类型 | |||
Sex = dormitory.Sex, | |||
Address = dormitory.Address, | |||
@@ -1031,7 +1099,10 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
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, | |||
@@ -1058,7 +1129,11 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
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, | |||
@@ -1088,6 +1163,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
{ | |||
ParentID = roomEntity.ID, | |||
Name = m.ToString() + "床", | |||
DNo = m.ToString(), | |||
BuildType = "5", | |||
Sex = dormitory.Sex, | |||
Address = dormitory.Address, | |||