From 989946843e5c896524b406d3708d23f333b1f96c Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Fri, 11 Feb 2022 18:27:19 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=AE=BF=E8=88=8D?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E8=B0=83=E6=95=B4=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Accommodation/Form.cshtml | 38 +-- .../Views/Accommodation/Index.js | 277 +++++++++--------- .../Accommodation/Acc_DormitoryBuildEntity.cs | 27 ++ .../Accommodation/AccommodationBLL.cs | 2 +- .../Accommodation/AccommodationService.cs | 39 ++- 5 files changed, 230 insertions(+), 153 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml index c96287895..d6bdc03d2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml @@ -3,13 +3,22 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
+ @if (ViewBag.ParentID != null) + { +
+
上级
+ + +
+ + }
名称
-
学生
-
+
编号*
+
@@ -20,21 +29,12 @@
类别*
- @if (ViewBag.ParentID != null) - { -
-
父单位
- - -
- - }
校区
-
+ @*
@@ -45,11 +45,7 @@
班级
-
-
-
性别
-
-
+
*@
负责人
@@ -62,9 +58,17 @@
价格
+
+
顺序
+ +
@if (ViewBag.BuildType == "4") { +
+
性别
+
+
舍长
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 70795f2ab..8d4071954 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 @@ -11,8 +11,10 @@ var bootstrap = function ($, learun) { var page = { init: function () { page.initTree(); - //page.initGird(); + page.initGird(); + page.search({ ParentID: '' }); page.bind(); + }, bind: function () { @@ -33,14 +35,15 @@ var bootstrap = function ($, learun) { if (selectedParent.ID != null) { url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form?ParentID=' + selectedParent.ID + '&ParentName=' + selectedParent.Name; } else { - url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form'; + return learun.alert.warning("请选择上级!"); + //url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form'; } learun.layerForm({ id: 'form', title: '新增', url: url, - width: 600, - height: 400, + width: 900, + height: 550, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -58,8 +61,8 @@ var bootstrap = function ($, learun) { id: 'form', title: '编辑', url: top.$.rootUrl + '/LogisticsManagement/Accommodation/Form?keyValue=' + keyValue, - width: 600, - height: 400, + width: 900, + height: 550, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -169,135 +172,142 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - //$("#gridtable").removeClass("jfgrid-layout"); - //$("#gridtable").removeAttr("style"); - //$("#gridtable").empty(); + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', + headData: [ + { label: "名称", name: "Name", width: 100, align: "left" }, + { + label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" + }, + { + label: "单元", name: "UnitName", width: 100, align: "left" }, + { + label: "楼层", name: "FloorName", width: 100, align: "left" }, + //{ + // label: "学生", name: "StudentID", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { - //$("#gridtable")[0].dfop = undefined; - if (selectedParent.ChildType == "5") { - $('#gridtable').lrAuthorizeJfGridLei({ - url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', - headData: [ - { label: "名称", name: "Name", width: 100, align: "left" }, - { label: "学生名字", name: "StuName", width: 100, align: "left" }, - - { label: "班级", name: "Class", width: 100, align: "left" }, - { - 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); - } - }); - } - }, - { label: "负责人", name: "Functionary", width: 100, align: "left" }, - { label: "负责人电话", name: "Phone", width: 100, align: "left" }, - { label: "价格", name: "Price", width: 100, align: "left" }, - { label: "星级", name: "Starred", width: 100, align: "left" }, - { - label: "是否独卫", name: "HasToilet", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'HasToilet', - callback: function (_data) { - callback(_data.text); - } - }); - } - }, - { label: "舍长", name: "Leader", width: 100, align: "left" }, - { label: "备注", name: "Remark", width: 100, align: "left" }, - ], - mainId: 'ID', - isPage: true, - isMultiselect:true - }); - } else { - $('#gridtable').lrAuthorizeJfGridLei({ - url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', - 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']); + // } + // }); + // } + //}, + { label: "位置", name: "Address", width: 100, align: "left" }, + { + label: "校区", name: "Campus", 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']); - } - }); - } }, - { label: "位置", name: "Address", width: 100, align: "left" }, - { - label: "校区", name: "Campus", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', + key: value, + keyId: 'f_companyid', + callback: function (_data) { + callback(_data['f_fullname']); + } + }); + } + }, + { + label: "系", name: "Dept", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "Major", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { label: "班级", name: "Class", width: 100, align: "left" }, + { + 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); + } + }); + } + }, + { label: "负责人", name: "Functionary", width: 100, align: "left" }, + { label: "负责人电话", name: "Phone", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'ID', + isPage: true, + isMultiselect: true, + sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', + //sord: 'ASC', + }); + //if (selectedParent.ChildType == "5") { + // $('#gridtable').lrAuthorizeJfGridLei({ + // url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', + // headData: [ + // { label: "名称", name: "Name", width: 100, align: "left" }, + // { label: "学生名字", name: "StuName", width: 100, align: "left" }, - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', - key: value, - keyId: 'f_companyid', - callback: function (_data) { - callback(_data['f_fullname']); - } - }); - } - }, - { - label: "系", name: "Dept", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', - key: value, - keyId: 'deptno', - callback: function (_data) { - callback(_data['deptname']); - } - }); - } - }, - { - label: "专业", name: "Major", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', - key: value, - keyId: 'id', - callback: function (_data) { - callback(_data['majorname']); - } - }); - } - }, - { label: "班级", name: "Class", width: 100, align: "left" }, - { - 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); - } - }); - } - }, - { label: "负责人", name: "Functionary", width: 100, align: "left" }, - { label: "负责人电话", name: "Phone", width: 100, align: "left" }, - { label: "备注", name: "Remark", width: 100, align: "left" }, - ], - mainId: 'ID', - isPage: true, - isMultiselect:true - }); - } + // { label: "班级", name: "Class", width: 100, align: "left" }, + // { + // 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); + // } + // }); + // } + // }, + // { label: "负责人", name: "Functionary", width: 100, align: "left" }, + // { label: "负责人电话", name: "Phone", width: 100, align: "left" }, + // { label: "价格", name: "Price", width: 100, align: "left" }, + // { label: "星级", name: "Starred", width: 100, align: "left" }, + // { + // label: "是否独卫", name: "HasToilet", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('dataItem', { + // key: value, + // code: 'HasToilet', + // callback: function (_data) { + // callback(_data.text); + // } + // }); + // } + // }, + // { label: "舍长", name: "Leader", width: 100, align: "left" }, + // { label: "备注", name: "Remark", width: 100, align: "left" }, + // ], + // mainId: 'ID', + // isPage: true, + // isMultiselect:true + // }); + //} else { + //} + //page.search(); }, search: function (param) { @@ -308,9 +318,12 @@ var bootstrap = function ($, learun) { refreshGirdData = function () { //page.initTree(); if (!!selectedParent.ID) { - + //var param = { ParentID: selectedParent.ID }; + //$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + page.initTree(); page.search({ ParentID: selectedParent.ID }); } else { + page.initTree(); page.search(); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs index 8dfc1bb3a..928e0866e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs @@ -19,12 +19,33 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// [Column("ID")] public string ID { get; set; } + /// + /// 编号 + /// + [Column("DNO")] + public string DNo { get; set; } + /// /// 名称 /// [Column("NAME")] public string Name { get; set; } /// + /// 宿舍楼 + /// + [Column("APARTMENTID")] + public string ApartmentId { get; set; } + /// + /// 单元 + /// + [Column("UNITID")] + public string UnitId { get; set; } + /// + /// 楼层 + /// + [Column("FLOORID")] + public string FloorId { get; set; } + /// /// 负责人 /// [Column("FUNCTIONARY")] @@ -148,6 +169,12 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement #endregion #region 扩展字段 + [NotMapped] + public string ApartmentName { get; set; } + [NotMapped] + public string UnitName { get; set; } + [NotMapped] + public string FloorName { get; set; } /// /// 学生名字 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs index efb5fe22b..2f69fb4bd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs @@ -270,7 +270,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement value = item.ID.ToString(), showcheck = false, checkstate = 0, - isexpand = false, + isexpand = true, parentId = item.ParentID == null ? "" : item.ParentID }; 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 21b627eb3..e0faac187 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 @@ -52,9 +52,13 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement t.Remark, t.Starred, t.HasToilet, - stb.StuName +t.ApartmentId,t.UnitId,t.FloorId, +a.name as ApartmentName,b.name as UnitName,c.Name as FloorName "); - strSql.Append(" FROM Acc_DormitoryBuild t LEFT JOIN dbo.StuInfoBasic stb ON t.StudentID=stb.StuId"); + strSql.Append(" FROM Acc_DormitoryBuild t "); + strSql.Append(@" left join (select * FROM Acc_DormitoryBuild where BuildType='1') a on t.ApartmentId=a.ID + left join(select * FROM Acc_DormitoryBuild where BuildType = '2') b on t.UnitId = b.ID + left join(select * FROM Acc_DormitoryBuild where BuildType = '3') c on t.FloorId = c.ID "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 @@ -64,6 +68,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement dp.Add("ParentID", queryParam["ParentID"].ToString(), DbType.String); strSql.Append(" AND t.ParentID =@ParentID "); } + else + { + strSql.Append(" AND t.BuildType ='4' "); + } + if (!queryParam["Name"].IsEmpty()) { dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); @@ -582,7 +591,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement { try { - return this.BaseRepository("CollegeMIS").FindList(a => a.BuildType != "5").OrderBy(a => a.sort).ThenBy(a => a.Name).ToList(); + return this.BaseRepository("CollegeMIS").FindList(a => a.BuildType != "5" && a.BuildType != "4").OrderBy(a => a.sort).ThenBy(a => a.Name).ToList(); } catch (Exception ex) @@ -1300,6 +1309,30 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } } + else + { + var parentity = this.BaseRepository("CollegeMIS").FindList().FirstOrDefault(a => a.ID == entity.ParentID); + switch (parentity.BuildType) + { + case "1": + entity.ApartmentId = parentity.ID; + break; + case "2": + { + entity.UnitId = parentity.ID; + entity.ApartmentId = parentity.ApartmentId; + } + break; + case "3": + { + entity.FloorId = parentity.ID; + entity.UnitId = parentity.UnitId; + entity.ApartmentId = parentity.ApartmentId; + } + break; + } + } + entity.Create(); entity.CreateBy = currentUser.realName; entity.CreateTime = DateTime.Now; From eb9fa7e03704e818f18e140955a31b09ba1d04d5 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Mon, 14 Feb 2022 14:56:04 +0800 Subject: [PATCH 2/5] --- .../Views/Accommodation/Index.js | 320 ++++++++++-------- 1 file changed, 186 insertions(+), 134 deletions(-) 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 8d4071954..754c24081 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 @@ -14,7 +14,7 @@ var bootstrap = function ($, learun) { page.initGird(); page.search({ ParentID: '' }); page.bind(); - + }, bind: function () { @@ -141,7 +141,7 @@ var bootstrap = function ($, learun) { }); } }); - + }, //初始化左侧树 initTree: function () { @@ -172,142 +172,194 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').jfGrid({ - url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', - headData: [ - { label: "名称", name: "Name", width: 100, align: "left" }, - { - label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" - }, - { - label: "单元", name: "UnitName", width: 100, align: "left" }, - { - label: "楼层", name: "FloorName", width: 100, align: "left" }, - //{ - // label: "学生", name: "StudentID", width: 100, align: "left", - // formatterAsync: function (callback, value, row, op, $cell) { + console.log('selectedParent.ChildType', selectedParent.ChildType); + if (selectedParent.ChildType == undefined || selectedParent.ChildType === "5") { + $('#gridtable').lrAuthorizeJfGridLei({ + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', + headData: [ + { label: "名称", name: "Name", width: 100, align: "left" }, + { + label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" + }, + { + label: "单元", name: "UnitName", width: 100, align: "left" + }, + { + label: "楼层", name: "FloorName", 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']); - // } - // }); - // } - //}, - { label: "位置", name: "Address", width: 100, align: "left" }, - { - label: "校区", name: "Campus", 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']); + // } + // }); + // } + //}, + { label: "位置", name: "Address", width: 100, align: "left" }, + { + label: "校区", name: "Campus", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', - key: value, - keyId: 'f_companyid', - callback: function (_data) { - callback(_data['f_fullname']); - } - }); - } - }, - { - label: "系", name: "Dept", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', - key: value, - keyId: 'deptno', - callback: function (_data) { - callback(_data['deptname']); - } - }); - } - }, - { - label: "专业", name: "Major", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', - key: value, - keyId: 'id', - callback: function (_data) { - callback(_data['majorname']); - } - }); - } - }, - { label: "班级", name: "Class", width: 100, align: "left" }, - { - 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); - } - }); - } - }, - { label: "负责人", name: "Functionary", width: 100, align: "left" }, - { label: "负责人电话", name: "Phone", width: 100, align: "left" }, - { label: "备注", name: "Remark", width: 100, align: "left" }, - ], - mainId: 'ID', - isPage: true, - isMultiselect: true, - sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', - //sord: 'ASC', - }); - //if (selectedParent.ChildType == "5") { - // $('#gridtable').lrAuthorizeJfGridLei({ - // url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', - // headData: [ - // { label: "名称", name: "Name", width: 100, align: "left" }, - // { label: "学生名字", name: "StuName", width: 100, align: "left" }, + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', + key: value, + keyId: 'f_companyid', + callback: function (_data) { + callback(_data['f_fullname']); + } + }); + } + }, + { + label: "系", name: "Dept", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "Major", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { label: "班级", name: "Class", width: 100, align: "left" }, + { + 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); + } + }); + } + }, + { label: "负责人", name: "Functionary", width: 100, align: "left" }, + { label: "负责人电话", name: "Phone", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'ID', + isPage: true, + isMultiselect: true, + sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', + //sord: 'ASC', + }); + } else { + console.log('其余'); + $('#gridtable').lrAuthorizeJfGridLei({ + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', + headData: [ + { label: "名称", name: "Name", width: 100, align: "left" }, + { + label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" + }, + { + label: "单元", name: "UnitName", width: 100, align: "left" + }, + { + label: "楼层", name: "FloorName", 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']); + // } + // }); + // } + //}, + { label: "位置", name: "Address", width: 100, align: "left" }, + { + label: "校区", name: "Campus", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { - // { label: "班级", name: "Class", width: 100, align: "left" }, - // { - // 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); - // } - // }); - // } - // }, - // { label: "负责人", name: "Functionary", width: 100, align: "left" }, - // { label: "负责人电话", name: "Phone", width: 100, align: "left" }, - // { label: "价格", name: "Price", width: 100, align: "left" }, - // { label: "星级", name: "Starred", width: 100, align: "left" }, - // { - // label: "是否独卫", name: "HasToilet", width: 100, align: "left", - // formatterAsync: function (callback, value, row, op, $cell) { - // learun.clientdata.getAsync('dataItem', { - // key: value, - // code: 'HasToilet', - // callback: function (_data) { - // callback(_data.text); - // } - // }); - // } - // }, - // { label: "舍长", name: "Leader", width: 100, align: "left" }, - // { label: "备注", name: "Remark", width: 100, align: "left" }, - // ], - // mainId: 'ID', - // isPage: true, - // isMultiselect:true - // }); - //} else { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', + key: value, + keyId: 'f_companyid', + callback: function (_data) { + callback(_data['f_fullname']); + } + }); + } + }, + //{ + // label: "系", name: "Dept", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + // key: value, + // keyId: 'deptno', + // callback: function (_data) { + // callback(_data['deptname']); + // } + // }); + // } + //}, + //{ + // label: "专业", name: "Major", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + // key: value, + // keyId: 'id', + // callback: function (_data) { + // callback(_data['majorname']); + // } + // }); + // } + //}, + //{ label: "班级", name: "Class", width: 100, align: "left" }, + //{ + // 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); + // } + // }); + // } + //}, + { label: "负责人", name: "Functionary", width: 100, align: "left" }, + { label: "负责人电话", name: "Phone", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'ID', + isPage: true, + isMultiselect: true, + //sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', + //sord: 'ASC', + }); + } - //} - //page.search(); }, search: function (param) { From 5153232fe1462e989f19e56620238915ff73387e Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 15 Feb 2022 10:00:40 +0800 Subject: [PATCH 3/5] --- .../Views/Accommodation/Form.cshtml | 60 ++++++++++--------- .../Views/Accommodation/Form.js | 1 + .../Views/Accommodation/Index.cshtml | 36 ++++++----- .../Views/Accommodation/Index.js | 29 ++++++--- .../Accommodation/Acc_DormitoryBuildEntity.cs | 9 ++- .../Accommodation/AccommodationBLL.cs | 3 +- .../Accommodation/AccommodationService.cs | 2 +- 7 files changed, 87 insertions(+), 53 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml index d6bdc03d2..630cbbefa 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml @@ -3,27 +3,28 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
+ @**@ @if (ViewBag.ParentID != null) {
上级
- - + +
}
名称
- +
编号*
- +
位置
- +
类别*
@@ -35,51 +36,56 @@
@*
-
-
-
-
-
专业
-
-
-
-
班级
-
-
*@ +
+
+
+
+
专业
+
+
+
+
班级
+
+
*@
负责人
- +
负责人电话
- +
价格
- +
-
+ @*
顺序
-
+
*@ - @if (ViewBag.BuildType == "4") - { + @if (ViewBag.BuildType == "3") + { + //寝室信息
性别
舍长
- +
学生名字
- + +
+
+
类型
+
星级
- +
是否独卫
@@ -89,7 +95,7 @@
备注
- +
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.js index d6e1497cc..1ce9bef9a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.js @@ -25,6 +25,7 @@ var bootstrap = function ($, learun) { code: 'HasToilet', }) $('#BuildType').lrDataItemSelect({ code: 'BuildType' }); + $('#RoomType').lrDataItemSelect({ code: 'RoomType' }); //$('#StudentID').lrDataSourceSelect({ code: 'StuInfoBasic', value: 'stuid', text: 'stuname' }); //$('#StudentID').lrDataSourceSelect({ code: 'StuInfoTwo', value: 'stuid', text: 'stuname' }); $('#StudentID').lrselect({ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.cshtml index e3951c2cc..0acbec261 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.cshtml @@ -21,15 +21,27 @@
- @*
-
-
名称
- -
-
+
+
+
名称
+ +
+
+
宿舍楼
+
+
+
+
单元
+
+
+
+
楼层
+
+
+ @*
类别
-
+
*@
学校
@@ -50,15 +62,7 @@
性别
-
-
负责人
- -
-
-
舍长
- -
-
*@ +
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 754c24081..037388587 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 @@ -151,7 +151,7 @@ var bootstrap = function ($, learun) { nodeClick: function (item) { selectedParent.ID = item.value; selectedParent.Name = item.text; - + selectedParent.BuildType = item.title; if (item.parent) { if (!item.parent.parentId) { selectedParent.ChildType = "2"; @@ -172,9 +172,12 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - console.log('selectedParent.ChildType', selectedParent.ChildType); - if (selectedParent.ChildType == undefined || selectedParent.ChildType === "5") { - $('#gridtable').lrAuthorizeJfGridLei({ + $("#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: [ { label: "名称", name: "Name", width: 100, align: "left" }, @@ -243,6 +246,18 @@ var bootstrap = function ($, learun) { } }, { label: "班级", name: "Class", width: 100, align: "left" }, + { + label: "寝室类型", name: "RoomType", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'RoomType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, { label: "性别", name: "Sex", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { @@ -266,8 +281,8 @@ var bootstrap = function ($, learun) { //sord: 'ASC', }); } else { - console.log('其余'); - $('#gridtable').lrAuthorizeJfGridLei({ + //lrAuthorizeJfGridLei + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', headData: [ { label: "名称", name: "Name", width: 100, align: "left" }, @@ -354,7 +369,7 @@ var bootstrap = function ($, learun) { ], mainId: 'ID', isPage: true, - isMultiselect: true, + isMultiselect: true //sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', //sord: 'ASC', }); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs index 928e0866e..f47e4e929 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs @@ -24,7 +24,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// [Column("DNO")] public string DNo { get; set; } - + /// /// 名称 /// @@ -166,9 +166,16 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// [Column("PLANBEDNUM")] public int? PlanBedNum { get; set; } + + /// + /// 寝室类型 + /// + [Column("ROOMTYPE")] + public string RoomType { get; set; } #endregion #region 扩展字段 + [NotMapped] public string ApartmentName { get; set; } [NotMapped] diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs index 2f69fb4bd..4ecc2ed02 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs @@ -271,7 +271,8 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement showcheck = false, checkstate = 0, isexpand = true, - parentId = item.ParentID == null ? "" : item.ParentID + parentId = item.ParentID == null ? "" : item.ParentID, + title = item.BuildType }; 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 e0faac187..9425d8e76 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 @@ -150,7 +150,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName { try { - var entity = this.BaseRepository("CollegeMIS").FindEntity(a => a.ParentID == parentID); + var entity = this.BaseRepository("CollegeMIS").FindEntity(a => a.ID == parentID); if (null != entity) { return entity.BuildType; From 5138ac9a9232ed1c93f85b67a25b38020f6d5580 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Wed, 16 Feb 2022 16:39:43 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=AE=BF=E8=88=8D=E7=AE=A1=E7=90=86=20=20?= =?UTF-8?q?=20=20=E6=9F=A5=E8=AF=A2=E6=88=BF=E9=97=B4=E7=9A=84=E5=BA=8A?= =?UTF-8?q?=E4=BD=8D=EF=BC=8C=E8=B0=83=E6=95=B4=E4=BF=AE=E6=94=B9=E6=88=BF?= =?UTF-8?q?=E9=97=B4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AccommodationController.cs | 22 ++- .../Views/Accommodation/Form.cshtml | 40 ++--- .../Views/Accommodation/Index.cshtml | 46 +++--- .../Views/Accommodation/Index.js | 155 ++++++++++++++++-- .../Learun.Application.Web.csproj | 8 +- .../Accommodation/AccommodationBLL.cs | 41 +++++ .../Accommodation/AccommodationIBLL.cs | 2 + .../Accommodation/AccommodationService.cs | 82 ++++++++- 8 files changed, 328 insertions(+), 68 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 94c336d32..c3da65418 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 @@ -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 /// /// [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(); } @@ -167,6 +173,18 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers return Success(jsonData); } + /// + /// 获取床位数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetBedListByRoomId(string RoomId) + { + var data = accommodationIBLL.GetBedListByRoomId(RoomId).OrderBy(x => x.DNo); + return Success(data); + } /// /// 获取宿舍楼数据 @@ -344,7 +362,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers } - + /// /// 同步宿舍信息数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml index 630cbbefa..bf8ed99d3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml @@ -8,23 +8,23 @@ {
上级
- - + +
}
名称
- +
编号*
- +
位置
- +
类别*
@@ -49,23 +49,23 @@
*@
负责人
- +
负责人电话
- +
价格
- +
@*
-
顺序
- -
*@ +
顺序
+ +
*@ @if (ViewBag.BuildType == "3") - { + { //寝室信息
性别
@@ -73,11 +73,7 @@
舍长
- -
-
-
学生名字
- +
类型
@@ -85,14 +81,20 @@
星级
- +
是否独卫
} - + @if (ViewBag.BuildType == "4") + { +
+
学生名字
+ +
+ }
备注
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.cshtml index 0acbec261..ff9a66fe1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.cshtml @@ -28,41 +28,37 @@
宿舍楼
-
+
单元
-
+
楼层
-
+
- @*
+ @*
类别
*@ -
-
学校
- -
-
-
- -
-
-
班级
- -
-
-
专业
- -
-
-
性别
-
-
+
+
+
+
+
+
专业
+
+
+
+
班级
+
+
+
+
性别
+
+
@@ -71,7 +67,7 @@  批量添加宿舍  自动分配宿舍 -  同步宿舍信息 + @* 同步宿舍信息*@
 录入 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 037388587..7dd788336 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 @@ -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(); @@ -174,9 +270,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: [ @@ -260,14 +355,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" }, @@ -279,6 +373,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 @@ -369,7 +494,7 @@ var bootstrap = function ($, learun) { ], mainId: 'ID', isPage: true, - isMultiselect: true + //isMultiselect: true //sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', //sord: 'ASC', }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 01e805fd1..ccd1e759e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -7622,10 +7622,10 @@ False - True - 20472 - / - http://localhost:20873/ + True + 20472 + / + http://localhost:20873/ False False diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs index 4ecc2ed02..4c6ea8547 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs @@ -42,6 +42,26 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } } + + public IEnumerable GetBedListByRoomId(string RoomId) + { + try + { + return accommodationService.GetBedListByRoomId(RoomId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public IEnumerable GetAllList() { try @@ -179,6 +199,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); + } + } + + } + /// /// 获取Acc_DormitoryBuild表实体数据 /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs index 41cd164b0..c56223a77 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs @@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetBedListByRoomId(string RoomId); IEnumerable GetAllList(); /// /// 获取Acc_DormitoryBuild表实体数据 @@ -69,6 +70,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// void DeleteEntity(string keyValue); string GetBuildType(string parentID); + string GetParentBuildType(string keyValue); /// /// 保存实体数据(新增、修改) 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 9425d8e76..ec9cc087c 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 @@ -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()) { @@ -127,6 +143,27 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName } } } + + public IEnumerable 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(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public IEnumerable GetAllList() { try @@ -173,6 +210,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 @@ -851,7 +917,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, @@ -878,7 +946,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, @@ -905,7 +976,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, @@ -935,6 +1010,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, From 03a1a1c1961fc8131edde5bd5e074281a0247e9c Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Fri, 18 Feb 2022 10:43:18 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=AE=BF=E8=88=8D=E5=88=86=E9=85=8D?= =?UTF-8?q?=E7=B3=BB=20=20=E4=B8=93=E4=B8=9A=20=E7=8F=AD=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AccommodationController.cs | 51 +- .../Views/Accommodation/DormitoryAdd.cshtml | 8 +- .../Views/Accommodation/Form.cshtml | 4 +- .../Views/Accommodation/Form.js | 2 +- .../Views/Accommodation/FormClass.cshtml | 19 + .../Views/Accommodation/FormClass.js | 82 +++ .../Views/Accommodation/FormDept.cshtml | 15 + .../Views/Accommodation/FormDept.js | 56 ++ .../Views/Accommodation/Index.js | 17 +- .../Accommodation/IndexDistribution.cshtml | 92 +++ .../Views/Accommodation/IndexDistribution.js | 580 ++++++++++++++++++ .../Learun.Application.Web.csproj | 6 + .../Accommodation/Acc_DormitoryBuildEntity.cs | 9 +- .../Accommodation/AccommodationBLL.cs | 23 + .../Accommodation/AccommodationIBLL.cs | 1 + .../Accommodation/AccommodationService.cs | 81 ++- 16 files changed, 1016 insertions(+), 30 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormClass.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormClass.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormDept.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormDept.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js 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 c3da65418..0ac3d218d 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 @@ -33,15 +33,15 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers { return View(); } - ///// - ///// 表单页 - ///// - ///// - //[HttpGet] - //public ActionResult Form() - //{ - // return View(); - //} + /// + /// 分配宿舍 + /// + /// + [HttpGet] + public ActionResult IndexDistribution() + { + return View(); + } /// /// 带参数的表单页 @@ -143,9 +143,26 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers return View(); } + /// + /// 分配系 + /// + /// + [HttpGet] + public ActionResult FormDept() + { + return View(); + } - + /// + /// 分配专业和班级 + /// + /// + [HttpGet] + public ActionResult FormClass() + { + return View(); + } #endregion @@ -318,6 +335,20 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers return Success("保存成功!"); } + /// + /// 寝室分配系 + /// 主键 + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveDeptClass(string keyValue, string strEntity,int type) + { + Acc_DormitoryBuildEntity entity = strEntity.ToObject(); + accommodationIBLL.SaveDeptClass(keyValue, entity, type); + return Success("保存成功!"); + } /// /// 学生宿舍的单元、楼层、房间、床位添加 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/DormitoryAdd.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/DormitoryAdd.cshtml index c4a23803c..a1028a631 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/DormitoryAdd.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/DormitoryAdd.cshtml @@ -8,19 +8,19 @@
每栋楼单元数量
- +
每单元楼层数量
- +
每楼层房间数量
- +
每房间床位数量
- +
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/DormitoryAdd.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml index bf8ed99d3..970177fa4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml @@ -76,8 +76,8 @@
-
类型
-
+
几人寝*
+
星级
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.js index 1ce9bef9a..38b25fdd2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.js @@ -25,7 +25,7 @@ var bootstrap = function ($, learun) { code: 'HasToilet', }) $('#BuildType').lrDataItemSelect({ code: 'BuildType' }); - $('#RoomType').lrDataItemSelect({ code: 'RoomType' }); + //$('#StudentID').lrDataSourceSelect({ code: 'StuInfoBasic', value: 'stuid', text: 'stuname' }); //$('#StudentID').lrDataSourceSelect({ code: 'StuInfoTwo', value: 'stuid', text: 'stuname' }); $('#StudentID').lrselect({ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormClass.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormClass.cshtml new file mode 100644 index 000000000..ce82c9480 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormClass.cshtml @@ -0,0 +1,19 @@ + +@{ + ViewBag.Title = "FormClass"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+
+
专业*
+
+
+
+
班级*
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/FormClass.js") + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormClass.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormClass.js new file mode 100644 index 000000000..4a3fd0578 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormClass.js @@ -0,0 +1,82 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-04-26 15:02 + * 描 述:学生宿舍管理 + */ +var acceptClick; +var Dept = request('Dept'); +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + + $('#Class').lrselect({ + value: "classno", + text: "classname" + }); + + $('#Major').lrselect({ + value: "majorno", + text: "majorname", + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', + param: { code: "CdMajorInfo", strWhere: "DeptNo='" + Dept + "'" }, + 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 + "'" } + }); + } + + } + }); + + + $('#Class').on("click", + function () { + //var data1 = $('#Dept').lrselectGet(); + var data2 = $('#Major').lrselectGet(); + if (!data2) { + learun.alert.error('请先选择专业'); + } + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + }, + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/SaveDeptClass?type=2&keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormDept.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormDept.cshtml new file mode 100644 index 000000000..702e24d59 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormDept.cshtml @@ -0,0 +1,15 @@ + +@{ + ViewBag.Title = "Allocation"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+
+
系部*
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/FormDept.js") + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormDept.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormDept.js new file mode 100644 index 000000000..f945452d6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormDept.js @@ -0,0 +1,56 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-04-26 15:02 + * 描 述:学生宿舍管理 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#Dept').lrselect({ + value: "deptno", + text: "deptname", + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', + allowSearch:true + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + }, + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/SaveDeptClass?type=1&keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} 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 7dd788336..8df0af2cb 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 @@ -56,7 +56,7 @@ var bootstrap = function ($, learun) { $('#UnitId').lrselect({ allowSearch: true }); $('#FloorId').lrselect({ allowSearch: true }); - $('#Sex').lrDataItemSelect({code: 'usersex'}); + $('#Sex').lrDataItemSelect({ code: 'usersex' }); //.lrRadioCheckbox({ // type: 'radio', // code: 'usersex', @@ -343,16 +343,15 @@ var bootstrap = function ($, learun) { { label: "班级", name: "Class", width: 100, align: "left" }, { label: "寝室类型", name: "RoomType", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'RoomType', - callback: function (_data) { - callback(_data.text); - } - }); + formatter: function (value, row) { + if (value) { + return value + '人寝'; + } else { + return ''; + } } }, + { label: "入住人数", name: "CheckInStu", width: 100, align: "left" }, { label: "性别", name: "Sex", width: 100, align: "left", formatter: function (callback, value, row, op, $cell) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.cshtml new file mode 100644 index 000000000..2b92a19cb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.cshtml @@ -0,0 +1,92 @@ +@{ + ViewBag.Title = "学生宿舍管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+ 树形列表 + 刷新 +
+
+
+
+
+
+
+ 列表信息 +
+
+
+
+
+
+
+
名称
+ +
+
+
宿舍楼
+
+
+
+
单元
+
+
+
+
楼层
+
+
+ @*
+
类别
+ +
*@ +
+
+
+
+
+
专业
+
+
+
+
班级
+
+
+
+
性别
+
+
+
+
未分配
+
+
+
+
已分配
+
+
+
+
+
+
+ +
+
+
+
+
+ +@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js new file mode 100644 index 000000000..86bfb5bce --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js @@ -0,0 +1,580 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-04-26 15:02 + * 描 述:学生宿舍管理 + */ +var refreshGirdData; +var selectedParent = {}; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initTree(); + page.initGird(); + page.search({ ParentID: '' }); + page.bind(); + + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 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', + //}); + + $('#NoDistribution').lrRadioCheckbox({ + type: 'checkbox', + code: 'NoDistribution' + }); + + $('#Distribution').lrRadioCheckbox({ + type: 'checkbox', + code: 'NoDistribution' + }); + + + $('#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(); + }); + // 新增 + $('#lr_add').on('click', function () { + var url = ""; + if (selectedParent.ID != null) { + url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form?ParentID=' + selectedParent.ID + '&ParentName=' + selectedParent.Name; + } else { + return learun.alert.warning("请选择上级!"); + //url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form'; + } + learun.layerForm({ + id: 'form', + title: '新增', + url: url, + width: 900, + height: 550, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录进行编辑!"); + return false; + } + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/Form?keyValue=' + keyValue, + width: 900, + height: 550, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //批量添加宿舍 + $("#lr_dormitoryAdd").on("click", function () { + var keyvalue1 = $("#gridtable").jfGridValue("ID"); + if (selectedParent.ChildType == "2") { + var keyValue = selectedParent.ID; + learun.layerForm({ + id: 'form', + title: '批量添加宿舍', + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/DormitoryAdd?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + + + } + else { + learun.alert.warning("请选择楼"); + + } + + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + //刷新左侧的树 + $("#tree_refresh").on("click", function () { + page.initTree(); + + }); + //分配系 + $("#lr_Dept").on("click", function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + var BuildType = $('#gridtable').jfGridValue('BuildType'); + var Dept = $('#gridtable').jfGridValue('Dept'); + var arr = BuildType.split(','); + if (arr.some(x => x != '4')) { + return learun.alert.warning("只能选择宿舍进行分配!"); + } + if (keyValue.indexOf(',') > 0) { + var arrDept = Dept.split(','); + for (var i = 0; i < arrDept.length; i++) { + if (arrDept[i].length >= 1) { + learun.alert.warning("选中记录包含已分配的数据!"); + return false; + } + } + } + learun.layerForm({ + id: 'formDept', + title: '分配系部', + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormDept?keyValue=' + keyValue, + width: 400, + height: 300, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + + //分配专业和班级 + $("#lr_Class").on("click", function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + var BuildType = $('#gridtable').jfGridValue('BuildType'); + var Dept = $('#gridtable').jfGridValue('Dept'); + var arr = BuildType.split(','); + if (arr.some(x => x != '4')) { + return learun.alert.warning("只能选择宿舍进行分配!"); + } + var arrDept = Dept.split(','); + if (keyValue.indexOf(',') > 0) { + if (arrDept.some(function(value, index) { + return value.length == 0; + })) { + return learun.alert.warning("选中记录包含未分配专业的数据!"); + } + if (arrDept.some(function (value, index) { + return value != arrDept[0]; + })) { + return learun.alert.warning("选中记录包含多种专业的数据,不可批量分配班级!"); + } + } + learun.layerForm({ + id: 'formDept', + title: '分配专业班级', + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormClass?keyValue=' + keyValue + '&Dept=' + arrDept[0], + width: 400, + height: 300, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + }, + //初始化左侧树 + initTree: function () { + // 初始化左侧树形数据 + $('#dataTree').lrtree({ + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetTree', + nodeClick: function (item) { + selectedParent.ID = item.value; + selectedParent.Name = item.text; + selectedParent.BuildType = item.title; + if (item.parent) { + if (!item.parent.parentId) { + selectedParent.ChildType = "2"; + } else { + selectedParent.ChildType = "0"; + } + } + else { + selectedParent.ChildType = "1"; + } + if (item.text.indexOf("室") > -1) { + selectedParent.ChildType = "5"; + } + page.initGird(); + page.search({ ParentID: item.value }); + } + }); + }, + // 初始化列表 + initGird: function () { + $("#gridtable").empty(); + $("#gridtable")[0].dfop = undefined; + if (selectedParent.BuildType == undefined || selectedParent.BuildType === "3") { + //宿舍数据 + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', + headData: [ + { label: "名称", name: "Name", width: 100, align: "left" }, + { + label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" + }, + { + label: "单元", name: "UnitName", width: 100, align: "left" + }, + { + label: "楼层", name: "FloorName", 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']); + // } + // }); + // } + //}, + { label: "位置", name: "Address", width: 100, align: "left" }, + { + label: "校区", name: "Campus", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', + key: value, + keyId: 'f_companyid', + callback: function (_data) { + callback(_data['f_fullname']); + } + }); + } + }, + { + label: "系", name: "Dept", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "Major", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "班级", name: "Class", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } }, + { + label: "寝室类型", name: "RoomType", width: 100, align: "left", + formatter: function (value, row) { + if (value) { + return value + '人寝'; + } else { + return ''; + } + } + }, + { label: "入住人数", name: "CheckInStu", width: 100, align: "left" }, + { + label: "性别", name: "Sex", width: 100, align: "left", + 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" }, + { label: "负责人电话", name: "Phone", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'ID', + isPage: true, + isMultiselect: true, + sidx: 'CheckInStu desc,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 + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', + headData: [ + { label: "名称", name: "Name", width: 100, align: "left" }, + { + label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" + }, + { + label: "单元", name: "UnitName", width: 100, align: "left" + }, + { + label: "楼层", name: "FloorName", 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']); + // } + // }); + // } + //}, + { label: "位置", name: "Address", width: 100, align: "left" }, + { + label: "校区", name: "Campus", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', + key: value, + keyId: 'f_companyid', + callback: function (_data) { + callback(_data['f_fullname']); + } + }); + } + }, + //{ + // label: "系", name: "Dept", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + // key: value, + // keyId: 'deptno', + // callback: function (_data) { + // callback(_data['deptname']); + // } + // }); + // } + //}, + //{ + // label: "专业", name: "Major", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + // key: value, + // keyId: 'id', + // callback: function (_data) { + // callback(_data['majorname']); + // } + // }); + // } + //}, + //{ label: "班级", name: "Class", width: 100, align: "left" }, + //{ + // 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); + // } + // }); + // } + //}, + { label: "负责人", name: "Functionary", width: 100, align: "left" }, + { label: "负责人电话", name: "Phone", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'ID', + isPage: true, + //isMultiselect: true + //sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', + //sord: 'ASC', + }); + } + + //page.search(); + }, + search: function (param) { + //console.log(param); + + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + //page.initTree(); + if (!!selectedParent.ID) { + //var param = { ParentID: selectedParent.ID }; + //$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + page.initTree(); + page.search({ ParentID: selectedParent.ID }); + } else { + page.initTree(); + page.search(); + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index ccd1e759e..402f8c780 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -1220,8 +1220,11 @@ + + + @@ -7498,6 +7501,9 @@ + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs index f47e4e929..3ea342fb6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs @@ -168,10 +168,15 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement public int? PlanBedNum { get; set; } /// - /// 寝室类型 + /// 寝室类型(几人寝) /// [Column("ROOMTYPE")] - public string RoomType { get; set; } + public int? RoomType { get; set; } + /// + /// 入住人数 + /// + [Column("CHECKINSTU")] + public int? CheckInStu { get; set; } #endregion #region 扩展字段 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs index 4c6ea8547..3e04337de 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs @@ -547,6 +547,29 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } + /// + /// 分配系 + /// + /// + /// + public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type) + { + try + { + accommodationService.SaveDeptClass(keyValue, entity, type); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 批量添加单元、楼层、宿舍、床位 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs index c56223a77..362d566ca 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs @@ -78,6 +78,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// /// void SaveEntity(string keyValue, Acc_DormitoryBuildEntity entity); + void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type); /// 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 ec9cc087c..54e1ccd8c 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 @@ -51,8 +51,8 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement t.ParentID, t.Remark, t.Starred, - t.HasToilet, -t.ApartmentId,t.UnitId,t.FloorId, + t.HasToilet,t.RoomType, +t.ApartmentId,t.UnitId,t.FloorId,t.CheckInStu, a.name as ApartmentName,b.name as UnitName,c.Name as FloorName "); strSql.Append(" FROM Acc_DormitoryBuild t "); @@ -129,6 +129,47 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName dp.Add("Leader", "%" + queryParam["Leader"].ToString() + "%", DbType.String); strSql.Append(" AND t.Leader Like @Leader "); } + + if (!queryParam["NoDistribution"].IsEmpty()) + { + var noDistribution = queryParam["NoDistribution"].ToString(); + if (noDistribution.Contains("dept")) + { + strSql.Append(" AND (t.Dept is null or len(t.Dept)=0) "); + } + if (noDistribution.Contains("major")) + { + strSql.Append(" AND (t.Major is null or len(t.Major)=0) "); + } + if (noDistribution.Contains("class")) + { + strSql.Append(" AND (t.Class is null or len(t.Class)=0) "); + } + if (noDistribution.Contains("room")) + { + strSql.Append(" AND (t.CheckInStu is null or len(t.CheckInStu)=0 or t.CheckInStu=0) "); + } + } + if (!queryParam["Distribution"].IsEmpty()) + { + var distribution = queryParam["Distribution"].ToString(); + if (distribution.Contains("dept")) + { + strSql.Append(" AND len(t.Dept)>0 "); + } + if (distribution.Contains("major")) + { + strSql.Append(" AND len(t.Major)>0 "); + } + if (distribution.Contains("class")) + { + strSql.Append(" AND len(t.Class)>0 "); + } + if (distribution.Contains("room")) + { + strSql.Append(" AND t.CheckInStu>0 "); + } + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination).OrderBy(a => a.Name).ThenBy(a => a.Name).ToList(); } catch (Exception ex) @@ -993,6 +1034,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName Major = dormitory.Major, Phone = dormitory.Phone, Price = dormitory.Price, + RoomType = bedNum, UpdateBy = currentUser.realName, UpdateTime = DateTime.Now, Starred = "3", @@ -1430,6 +1472,41 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName } } + public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity, int type) + { + try + { + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + string sql = $"update Acc_DormitoryBuild set "; + if (type == 1) + { + sql += $" Dept='{entity.Dept}' "; + } + else + { + sql += $"Major='{entity.Major}',Class='{entity.Class}'"; + } + + sql += $" where ID in ('{keyValue}')"; + + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 同步宿舍信息 ///