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