录入
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 8df0af2cb..10aa87770 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
@@ -238,6 +238,30 @@ var bootstrap = function ($, learun) {
}
});
+
+ //床位管理
+ $("#lr_bedManage").on("click", function () {
+ var keyValue = $('#gridtable').jfGridValue('ID');
+ if (learun.checkrow(keyValue)) {
+ if (keyValue.indexOf(',') != -1) {
+ learun.alert.warning("只能选择一条记录进行编辑!");
+ return false;
+ }
+ learun.layerForm({
+ id: 'indexBed',
+ title: '床位管理',
+ url: top.$.rootUrl + '/LogisticsManagement/Accommodation/IndexBed?ParentID=' + keyValue,
+ width: 700,
+ height: 500,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ }
+
+
+ });
+
},
//初始化左侧树
initTree: function () {
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexBed.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexBed.cshtml
new file mode 100644
index 000000000..a04a0afeb
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexBed.cshtml
@@ -0,0 +1,61 @@
+@{
+ ViewBag.Title = "学生宿舍管理";
+ Layout = "~/Views/Shared/_Index.cshtml";
+}
+
+
+
+
+@*
*@
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/IndexBed.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexBed.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexBed.js
new file mode 100644
index 000000000..04b75f750
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexBed.js
@@ -0,0 +1,110 @@
+/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
+ * Copyright (c) 2013-2018 北京泉江科技有限公司
+ * 创建人:超级管理员
+ * 日 期:2019-04-26 15:02
+ * 描 述:学生宿舍管理
+ */
+var refreshGirdData;
+var acceptClick;
+var selectedParent = {};
+var ParentID = request('ParentID');
+var bootstrap = function ($, learun) {
+ "use strict";
+ var page = {
+ init: function () {
+ page.initGird();
+ page.bind();
+
+ },
+ bind: function () {
+ // 刷新
+ $('#lr_refresh').on('click', function () {
+ location.reload();
+ });
+ // 新增
+ $('#lr_add').on('click', function () {
+ learun.layerForm({
+ id: 'form',
+ title: '新增',
+ url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormBed?ParentID=' + ParentID,
+ width: 400,
+ height: 300,
+ 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/FormBed?keyValue=' + keyValue + '&ParentID=' + ParentID,
+ width: 400,
+ height: 300,
+ 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/DeleteBed', { keyValue: keyValue, ParentID: ParentID }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+
+ // 打印
+ $('#lr_print').on('click', function () {
+ $('#gridtable').jqprintTable();
+ });
+
+
+ },
+ // 初始化列表
+ initGird: function () {
+ $('#gridtable').jfGrid({
+ url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + ParentID,
+ headData: [
+ { label: "名称", name: "Name", width: 100, align: "left" },
+
+ ],
+ mainId: 'ID',
+ isPage: false,
+ //isMultiselect: true,
+ //sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ',
+ //sord: 'ASC',
+
+ });
+ page.search();
+ },
+ search: function (param) {
+ param = param || {};
+ $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
+ }
+ };
+ refreshGirdData = function () {
+ page.search();
+ };
+ // 保存数据
+ acceptClick = function (callBack) {
+ if (!!callBack) {
+ callBack();
+ }
+ };
+ 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 baa54306f..99a8f794f 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,11 +1220,13 @@
+
+
@@ -7506,6 +7508,8 @@
+
+
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 6157526a8..ea1fc0a50 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
@@ -523,6 +523,31 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}
+
+ ///
+ /// 删除实体数据
+ /// 主键
+ ///
+ ///
+ public void DeleteBed(string keyValue, string ParentID)
+ {
+ try
+ {
+ accommodationService.DeleteBed(keyValue, ParentID);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
///
/// 保存实体数据(新增、修改)
/// 主键
@@ -547,6 +572,32 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}
+ ///
+ /// 保存实体数据(新增、修改)
+ /// 主键
+ ///
+ ///
+ public void SaveBedEntity(string keyValue,string ParentID, Acc_DormitoryBuildEntity entity)
+ {
+ try
+ {
+ accommodationService.SaveBedEntity(keyValue, ParentID, entity);
+ }
+ 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 b09bf2076..47a64bac8 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
@@ -69,6 +69,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
///
///
void DeleteEntity(string keyValue);
+ void DeleteBed(string keyValue, string ParentID);
string GetBuildType(string parentID);
string GetParentBuildType(string keyValue);
@@ -78,6 +79,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
///
///
void SaveEntity(string keyValue, Acc_DormitoryBuildEntity entity);
+ void SaveBedEntity(string keyValue,string ParentID, Acc_DormitoryBuildEntity entity);
void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type);
void SaveRoom(string RoomId, List list);
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 88e58316d..e0d72f00c 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
@@ -915,6 +915,27 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
}
}
+
+ public void DeleteBed(string keyValue, string ParentID)
+ {
+ try
+ {
+ this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyValue);
+ UpdateCheckInNum(ParentID);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
public void DeleteAll(string parentid)
{
var list = this.BaseRepository("CollegeMIS").FindList(a => a.ParentID == parentid).ToList();
@@ -1472,6 +1493,74 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
}
}
+
+ ///
+ /// 保存实体数据(新增、修改)
+ /// 主键
+ ///
+ ///
+ public void SaveBedEntity(string keyValue, string ParentID, Acc_DormitoryBuildEntity entity)
+ {
+ var db = this.BaseRepository("CollegeMIS");
+ try
+ {
+ db.BeginTrans();
+ if (!string.IsNullOrEmpty(keyValue))
+ {
+ entity.Modify(keyValue);
+ db.Update(entity);
+ }
+ else
+ {
+ var parentEntity = db.FindEntity(ParentID);
+ entity.Create();
+ entity.ApartmentId = parentEntity.ApartmentId;
+ entity.UnitId = parentEntity.UnitId;
+ entity.FloorId = parentEntity.FloorId;
+ entity.ParentID = ParentID;
+ entity.BuildType = "5";
+ db.Insert(entity);
+ }
+ db.Commit();
+ UpdateCheckInNum(ParentID);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ private void UpdateCheckInNum(string ParentID)
+ {
+ try
+ {
+ string sql = $@"update [dbo].[Acc_DormitoryBuild] set RoomType=(
+select count(1) from [dbo].[Acc_DormitoryBuild] where ParentId='{ParentID}' and BuildType='5'
+)
+where ID='{ParentID}'
+";
+ this.BaseRepository("CollegeMIS").ExecuteBySql(sql);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity, int type)
{
try