@@ -256,17 +256,17 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
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); | |||
var data = accommodationIBLL.GetClassifyList(paginationobj, queryJson).OrderBy(x => x.DNo); | |||
//var jsonData = new | |||
//{ | |||
// rows = data, | |||
// total = paginationobj.total, | |||
// page = paginationobj.page, | |||
// records = paginationobj.records | |||
//}; | |||
return Success(data); | |||
} | |||
/// <summary> | |||
/// 获取宿舍楼数据 | |||
/// </summary> | |||
@@ -379,7 +379,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
var data = accommodationIBLL.GetClassifyTree(); | |||
return Success(data); | |||
} | |||
#endregion | |||
@@ -404,7 +404,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteBed(string keyValue,string ParentID) | |||
public ActionResult DeleteBed(string keyValue, string ParentID) | |||
{ | |||
accommodationIBLL.DeleteBed(keyValue, ParentID); | |||
return Success("删除成功!"); | |||
@@ -431,13 +431,13 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveBedForm(string keyValue,string ParentID, string strEntity) | |||
public ActionResult SaveBedForm(string keyValue, string ParentID, string strEntity) | |||
{ | |||
Acc_DormitoryBuildEntity entity = strEntity.ToObject<Acc_DormitoryBuildEntity>(); | |||
accommodationIBLL.SaveBedEntity(keyValue, ParentID, entity); | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 寝室分配系 | |||
/// <param name="keyValue">主键</param> | |||
@@ -446,7 +446,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveDeptClass(string keyValue, string strEntity,int type) | |||
public ActionResult SaveDeptClass(string keyValue, string strEntity, int type) | |||
{ | |||
Acc_DormitoryBuildEntity entity = strEntity.ToObject<Acc_DormitoryBuildEntity>(); | |||
accommodationIBLL.SaveDeptClass(keyValue, entity, type); | |||
@@ -466,7 +466,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
accommodationIBLL.SaveRoom(RoomId, list); | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 学生宿舍的单元、楼层、房间、床位添加 | |||
/// </summary> | |||
@@ -184,7 +184,8 @@ var bootstrap = function ($, learun) { | |||
//批量添加宿舍 | |||
$("#lr_dormitoryAdd").on("click", function () { | |||
var keyvalue1 = $("#gridtable").jfGridValue("ID"); | |||
if (selectedParent.ChildType == "2") { | |||
//console.log(selectedParent.ChildType); | |||
if (selectedParent.BuildType == "1") { | |||
var keyValue = selectedParent.ID; | |||
learun.layerForm({ | |||
id: 'form', | |||
@@ -268,12 +269,12 @@ var bootstrap = function ($, learun) { | |||
//分类管理 | |||
$("#lr_Classify").on("click", function () { | |||
learun.layerForm({ | |||
id: 'indexBed', | |||
id: 'indexClassify', | |||
title: '分类管理', | |||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/IndexClassify', | |||
width: 1200, | |||
height: 780, | |||
btn:null, | |||
//btn:null, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
@@ -158,9 +158,11 @@ var bootstrap = function ($, learun) { | |||
{ label: "备注", name: "Remark", width: 100, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
isMultiselect: true, | |||
sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', | |||
isPage: false, | |||
//isMultiselect: true, | |||
//sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', | |||
isTree: true, | |||
parentId: 'ParentID', | |||
}); | |||
page.search(); | |||
}, | |||
@@ -176,9 +178,10 @@ var bootstrap = function ($, learun) { | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
learun.layerClose('indexClassify', ''); | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -298,7 +298,8 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Name Like @Name "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(strSql.ToString(), dp, pagination).ToList(); | |||
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(strSql.ToString(), dp).ToList(); | |||
//return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(strSql.ToString(), dp, pagination).ToList(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -719,7 +720,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(x => ( x.BuildType == "2" || x.BuildType == "1")).ToList(); | |||
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(x => (x.BuildType == "2" || x.BuildType == "1")).ToList(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -1110,6 +1111,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
UpdateTime = DateTime.Now | |||
}; | |||
elementEntity.Create(); | |||
elementEntity.UnitId = elementEntity.ID; | |||
list.Add(elementEntity); | |||
//添加楼层 | |||
@@ -1140,6 +1142,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
UpdateTime = DateTime.Now | |||
}; | |||
floorEntity.Create(); | |||
floorEntity.FloorId = floorEntity.ID; | |||
list.Add(floorEntity); | |||
//添加房间 | |||
@@ -1535,9 +1538,11 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
if (entity.BuildType == "1") | |||
{ | |||
if (string.IsNullOrEmpty(entity.ParentID)) | |||
entity.ApartmentId = entity.ID; | |||
if (string.IsNullOrEmpty(entity.ParentID) || entity.ParentID == "-1") | |||
{ | |||
var rootNode = this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>().FirstOrDefault(a => a.ParentID == null); | |||
if (rootNode == null) | |||
@@ -1563,14 +1568,17 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
} | |||
else | |||
{ | |||
//上一级 | |||
var parentity = this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>().FirstOrDefault(a => a.ID == entity.ParentID); | |||
switch (parentity.BuildType) | |||
{ | |||
case "1": | |||
entity.ApartmentId = parentity.ID; | |||
entity.UnitId = entity.ID; | |||
break; | |||
case "2": | |||
{ | |||
entity.FloorId = entity.ID; | |||
entity.UnitId = parentity.ID; | |||
entity.ApartmentId = parentity.ApartmentId; | |||
} | |||
@@ -1585,7 +1593,6 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||
} | |||
} | |||
entity.Create(); | |||
entity.CreateBy = currentUser.realName; | |||
entity.CreateTime = DateTime.Now; | |||
entity.UpdateBy = currentUser.realName; | |||