@@ -207,6 +207,8 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
{ | { | ||||
return View(); | return View(); | ||||
} | } | ||||
#endregion | #endregion | ||||
#region 获取数据 | #region 获取数据 | ||||
@@ -244,6 +246,26 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
var data = accommodationIBLL.GetBedListByRoomId(RoomId).OrderBy(x => x.DNo); | var data = accommodationIBLL.GetBedListByRoomId(RoomId).OrderBy(x => x.DNo); | ||||
return Success(data); | 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).OrderBy(x => x.DNo); | |||||
//var jsonData = new | |||||
//{ | |||||
// rows = data, | |||||
// total = paginationobj.total, | |||||
// page = paginationobj.page, | |||||
// records = paginationobj.records | |||||
//}; | |||||
return Success(data); | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 获取宿舍楼数据 | /// 获取宿舍楼数据 | ||||
@@ -357,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 | ||||
@@ -382,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("删除成功!"); | ||||
@@ -409,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> | ||||
@@ -424,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); | ||||
@@ -444,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', | ||||
@@ -247,7 +248,7 @@ var bootstrap = function ($, learun) { | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
if (keyValue.indexOf(',') != -1) { | if (keyValue.indexOf(',') != -1) { | ||||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||||
learun.alert.warning("只能选择一条记录!"); | |||||
return false; | return false; | ||||
} | } | ||||
learun.layerForm({ | learun.layerForm({ | ||||
@@ -264,7 +265,21 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
//分类管理 | |||||
$("#lr_Classify").on("click", function () { | |||||
learun.layerForm({ | |||||
id: 'indexClassify', | |||||
title: '分类管理', | |||||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/IndexClassify', | |||||
width: 1200, | |||||
height: 780, | |||||
//btn:null, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
}, | }, | ||||
//初始化左侧树 | //初始化左侧树 | ||||
initTree: function () { | initTree: function () { | ||||
@@ -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) | ||||
{ | { | ||||
@@ -1089,6 +1090,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); | ||||
//添加楼层 | //添加楼层 | ||||
@@ -1119,6 +1121,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); | ||||
//添加房间 | //添加房间 | ||||
@@ -1514,9 +1517,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) | ||||
@@ -1542,14 +1547,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; | ||||
} | } | ||||
@@ -1564,7 +1572,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; | ||||