From 71a032d16ffd61fd362b1c8be487a495300c19f6 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Wed, 2 Mar 2022 15:11:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=BF=E8=88=8D=E7=AE=A1=E7=90=86=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=88=86=E7=B1=BB=E7=AE=A1=E7=90=86=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=92=8C=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AccommodationController.cs | 34 +++++++++++++++---- .../Views/Accommodation/Index.js | 21 ++++++++++-- .../Accommodation/AccommodationService.cs | 15 +++++--- 3 files changed, 57 insertions(+), 13 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs index 7dc28ac73..5dd7d85e7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs @@ -207,6 +207,8 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers { return View(); } + + #endregion #region 获取数据 @@ -244,6 +246,26 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers var data = accommodationIBLL.GetBedListByRoomId(RoomId).OrderBy(x => x.DNo); return Success(data); } + /// + /// 获取分类数据 + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetClassifyList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + 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); + } /// /// 获取宿舍楼数据 @@ -357,7 +379,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers var data = accommodationIBLL.GetClassifyTree(); return Success(data); } - + #endregion @@ -382,7 +404,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers /// [HttpPost] [AjaxOnly] - public ActionResult DeleteBed(string keyValue,string ParentID) + public ActionResult DeleteBed(string keyValue, string ParentID) { accommodationIBLL.DeleteBed(keyValue, ParentID); return Success("删除成功!"); @@ -409,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(); accommodationIBLL.SaveBedEntity(keyValue, ParentID, entity); return Success("保存成功!"); } - + /// /// 寝室分配系 /// 主键 @@ -424,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(); accommodationIBLL.SaveDeptClass(keyValue, entity, type); @@ -444,7 +466,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers accommodationIBLL.SaveRoom(RoomId, list); return Success("保存成功!"); } - + /// /// 学生宿舍的单元、楼层、房间、床位添加 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js index 0837a154c..ba8722658 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js @@ -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', @@ -247,7 +248,7 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { if (keyValue.indexOf(',') != -1) { - learun.alert.warning("只能选择一条记录进行编辑!"); + learun.alert.warning("只能选择一条记录!"); return false; } 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 () { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs index 5aebff156..9c422806f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs @@ -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(strSql.ToString(), dp, pagination).ToList(); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp).ToList(); + //return this.BaseRepository("CollegeMIS").FindList(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(x => ( x.BuildType == "2" || x.BuildType == "1")).ToList(); + return this.BaseRepository("CollegeMIS").FindList(x => (x.BuildType == "2" || x.BuildType == "1")).ToList(); } catch (Exception ex) { @@ -1089,6 +1090,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); //添加楼层 @@ -1119,6 +1121,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); //添加房间 @@ -1514,9 +1517,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().FirstOrDefault(a => a.ParentID == null); if (rootNode == null) @@ -1542,14 +1547,17 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName } else { + //上一级 var parentity = this.BaseRepository("CollegeMIS").FindList().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; } @@ -1564,7 +1572,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;