舍长
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 ee18771ce..e2aa18e97 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 () {
@@ -36,14 +38,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);
}
@@ -61,8 +64,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);
}
@@ -210,158 +213,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;
- console.log('selectedParent.ChildType=', selectedParent.ChildType);
- 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",
- 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: "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: '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: "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) {
@@ -372,9 +359,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 0fd4e3ddd..f257777a2 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
@@ -289,7 +289,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 89ca0eea5..49237f24e 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);
@@ -731,7 +740,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
{
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)
@@ -1454,6 +1463,30 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
}
}
}
+ else
+ {
+ var parentity = this.BaseRepository("CollegeMIS").FindList().FirstOrDefault(a => a.ID == entity.ParentID);
+ switch (parentity.BuildType)
+ {
+ case "1":
+ entity.ApartmentId = parentity.ID;
+ 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;