Explorar el Código

学生宿舍管理调整列表

临城职教中职
zhangli hace 2 años
committed by ndbs
padre
commit
3f02e119ce
Se han modificado 5 ficheros con 230 adiciones y 176 borrados
  1. +21
    -17
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml
  2. +145
    -155
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js
  3. +27
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs
  4. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs
  5. +36
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs

+ 21
- 17
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml Ver fichero

@@ -3,13 +3,22 @@
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap">
@if (ViewBag.ParentID != null)
{
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">上级</div>
<input id="ParentID" type="hidden" value="@ViewBag.ParentID" />
<input type="text" class="form-control" value="@ViewBag.ParentName" readonly="readonly" />
</div>

}
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">名称</div>
<input id="Name" type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">学生</div>
<div id="StudentID"></div>
<div class="lr-form-item-title">编号<font face="宋体">*</font></div>
<input id="DNo" type="number" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>

<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
@@ -20,21 +29,12 @@
<div class="lr-form-item-title">类别<font face="宋体">*</font></div>
<div id="BuildType" isvalid="yes" checkexpession="NotNull"></div>
</div>
@if (ViewBag.ParentID != null)
{
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">父单位</div>
<input id="ParentID" type="hidden" value="@ViewBag.ParentID" />
<label class="form-control">@ViewBag.ParentName</label>
</div>

}

<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">校区</div>
<div id="Campus"></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
@*<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">系</div>
<div id="Dept"></div>
</div>
@@ -45,11 +45,7 @@
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">班级</div>
<div id="Class"></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">性别</div>
<div id="Sex"></div>
</div>
</div>*@
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">负责人</div>
<input id="Functionary" type="text" class="form-control" />
@@ -62,9 +58,17 @@
<div class="lr-form-item-title">价格</div>
<input id="Price" type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">顺序</div>
<input id="sort" type="number" class="form-control"/>
</div>

@if (ViewBag.BuildType == "4")
{
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">性别</div>
<div id="Sex"></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">舍长</div>
<input id="Leader" type="text" class="form-control" />


+ 145
- 155
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js Ver fichero

@@ -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();
}
};


+ 27
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs Ver fichero

@@ -19,12 +19,33 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
/// </summary>
[Column("ID")]
public string ID { get; set; }
/// <summary>
/// 编号
/// </summary>
[Column("DNO")]
public string DNo { get; set; }
/// <summary>
/// 名称
/// </summary>
[Column("NAME")]
public string Name { get; set; }
/// <summary>
/// 宿舍楼
/// </summary>
[Column("APARTMENTID")]
public string ApartmentId { get; set; }
/// <summary>
/// 单元
/// </summary>
[Column("UNITID")]
public string UnitId { get; set; }
/// <summary>
/// 楼层
/// </summary>
[Column("FLOORID")]
public string FloorId { get; set; }
/// <summary>
/// 负责人
/// </summary>
[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; }
/// <summary>
/// 学生名字
/// </summary>


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs Ver fichero

@@ -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

};


+ 36
- 3
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs Ver fichero

@@ -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<Acc_DormitoryBuildEntity>(a => a.BuildType != "5").OrderBy(a => a.sort).ThenBy(a => a.Name).ToList();
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(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<Acc_DormitoryBuildEntity>().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;


Cargando…
Cancelar
Guardar