Pārlūkot izejas kodu

宿舍分配系 专业 班级

临城职教中职
zhangli pirms 2 gadiem
committed by ndbs
vecāks
revīzija
6fa85478ca
16 mainītis faili ar 976 papildinājumiem un 36 dzēšanām
  1. +41
    -10
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs
  2. +4
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/DormitoryAdd.cshtml
  3. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml
  4. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.js
  5. +19
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormClass.cshtml
  6. +82
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormClass.js
  7. +15
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormDept.cshtml
  8. +56
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormDept.js
  9. +8
    -9
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js
  10. +92
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.cshtml
  11. +580
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js
  12. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  13. +7
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs
  14. +23
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs
  15. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs
  16. +38
    -8
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs

+ 41
- 10
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs Parādīt failu

@@ -33,15 +33,15 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
{
return View();
}
///// <summary>
///// 表单页
///// <summary>
///// <returns></returns>
//[HttpGet]
//public ActionResult Form()
//{
// return View();
//}
/// <summary>
/// 分配宿舍
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult IndexDistribution()
{
return View();
}

/// <summary>
/// 带参数的表单页
@@ -143,7 +143,15 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
return View();
}


/// <summary>
/// 分配系
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult FormDept()
{
return View();
}

/// <summary>
/// 分配专业和班级
@@ -200,6 +208,15 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
return View();
}

/// <summary>
/// 分配专业和班级
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult FormClass()
{
return View();
}


#endregion
@@ -385,6 +402,20 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
return Success("保存成功!");
}

/// <summary>
/// 寝室分配系
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveDeptClass(string keyValue, string strEntity,int type)
{
Acc_DormitoryBuildEntity entity = strEntity.ToObject<Acc_DormitoryBuildEntity>();
accommodationIBLL.SaveDeptClass(keyValue, entity, type);
return Success("保存成功!");
}

/// <summary>
/// 学生宿舍的单元、楼层、房间、床位添加


+ 4
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/DormitoryAdd.cshtml Parādīt failu

@@ -8,19 +8,19 @@
<div class="lr-form-wrap">
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">每栋楼单元数量</div>
<input id="ElementNum" type="text" class="form-control" />
<input id="ElementNum" type="number" class="form-control" />
</div>
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">每单元楼层数量</div>
<input id="FloorNum" type="text" class="form-control" />
<input id="FloorNum" type="number" class="form-control" />
</div>
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">每楼层房间数量</div>
<input id="RoomNum" type="text" class="form-control" />
<input id="RoomNum" type="number" class="form-control" />
</div>
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">每房间床位数量</div>
<input id="BedNum" type="text" class="form-control" />
<input id="BedNum" type="number" class="form-control" />
</div>
</div>
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/DormitoryAdd.js")


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.cshtml Parādīt failu

@@ -76,8 +76,8 @@
<input id="Leader" 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="RoomType"></div>
<div class="lr-form-item-title">几人寝<font face="宋体">*</font></div>
<input id="RoomType" type="number" class="form-control" isvalid="yes" checkexpession="NotNull"/>
</div>
<div class="col-xs-6 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">星级</div>


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Form.js Parādīt failu

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


+ 19
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormClass.cshtml Parādīt failu

@@ -0,0 +1,19 @@

@{
ViewBag.Title = "FormClass";
Layout = "~/Views/Shared/_Form.cshtml";
}

<div class="lr-form-wrap">
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">专业<font face="宋体">*</font></div>
<div id="Major" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">班级<font face="宋体">*</font></div>
<div id="Class" isvalid="yes" checkexpession="NotNull"></div>
</div>
</div>
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/FormClass.js")



+ 82
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormClass.js Parādīt failu

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

+ 15
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormDept.cshtml Parādīt failu

@@ -0,0 +1,15 @@

@{
ViewBag.Title = "Allocation";
Layout = "~/Views/Shared/_Form.cshtml";
}

<div class="lr-form-wrap">
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryBuild">
<div class="lr-form-item-title">系部<font face="宋体">*</font></div>
<div id="Dept" isvalid="yes" checkexpession="NotNull"></div>
</div>
</div>
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/FormDept.js")



+ 56
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormDept.js Parādīt failu

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

+ 8
- 9
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js Parādīt failu

@@ -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',
@@ -384,16 +384,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) {


+ 92
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.cshtml Parādīt failu

@@ -0,0 +1,92 @@
@{
ViewBag.Title = "学生宿舍管理";
Layout = "~/Views/Shared/_Index.cshtml";
}
<div class="lr-layout lr-layout-left-center" id="lr_layout">
<div class="lr-layout-left">
<div class="lr-layout-wrap">
<div class="lr-layout-title lrlt ">
树形列表
<a id="tree_refresh" onmouseover="this.style.cursor='hand'">刷新</a>
</div>
<div id="dataTree" class="lr-layout-body"></div>
</div>
</div>
<div class="lr-layout-center">
<div class="lr-layout-wrap ">
<div class="lr-layout-title">
<span id="titleinfo" class="lrlt">列表信息</span>
</div>
<div class="lr-layout-tool">
<div class="lr-layout-tool-left">
<div class="lr-layout-tool-item">
<div id="multiple_condition_query">
<div class="lr-query-formcontent">
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">名称</div>
<input id="Name" type="text" class="form-control" />
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">宿舍楼</div>
<div id="ApartmentId"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">单元</div>
<div id="UnitId"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">楼层</div>
<div id="FloorId"></div>
</div>
@*<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">类别</div>
<input id="BuildType" type="text" class="form-control" />
</div>*@
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">系</div>
<div id="Dept"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">专业</div>
<div id="Major"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">班级</div>
<div id="Class"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">性别</div>
<div id="Sex"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">未分配</div>
<div id="NoDistribution"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">已分配</div>
<div id="Distribution"></div>
</div>
</div>
</div>
</div>
</div>
<div class="lr-layout-tool-right">
<div class=" btn-group btn-group-sm">
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
@*<a id="lr_dormitoryAdd" class="btn btn-default"><i class="fa fa-pencil-square"></i>&nbsp;批量添加宿舍</a>
<a id="lr_allocation" class="btn btn-default"><i class="fa fa-pencil-square"></i>&nbsp;自动分配宿舍</a>*@
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_Dept" class="btn btn-default"><i class="fa fa-pencil-square"></i>&nbsp;分配系</a>
<a id="lr_Class" class="btn btn-default"><i class="fa fa-pencil-square"></i>&nbsp;分配专业班级</a>
<a id="lr_Bed" class="btn btn-default"><i class="fa fa-pencil-square"></i>&nbsp;分配宿舍</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>

@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js")

+ 580
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js Parādīt failu

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

+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Parādīt failu

@@ -1300,6 +1300,8 @@
<Content Include="Areas\EducationalAdministration\Views\TeachPlan\Index.js" />
<Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Form.js" />
<Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Index.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClassify.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormBed.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormRoom.js" />
@@ -1307,6 +1309,7 @@
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\Allocation.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\DormitoryAdd.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexDistribution.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexClassify.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexBed.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexDistribution.js" />
@@ -7575,6 +7578,10 @@
<Content Include="Areas\EducationalAdministration\Views\StuInfoBasic\FormTran.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuVolunteer\MajorIndex.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\TextBookIndent\FormView.cshtml" />
<Content Include="Areas\LR_SystemModule\Views\Log\ApiIndex.cshtml" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexDistribution.cshtml" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.cshtml" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


+ 7
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs Parādīt failu

@@ -168,10 +168,15 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
public int? PlanBedNum { get; set; }
/// <summary>
/// 寝室类型
/// 寝室类型(几人寝)
/// </summary>
[Column("ROOMTYPE")]
public string RoomType { get; set; }
public int? RoomType { get; set; }
/// <summary>
/// 入住人数
/// </summary>
[Column("CHECKINSTU")]
public int? CheckInStu { get; set; }
#endregion

#region 扩展字段


+ 23
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs Parādīt failu

@@ -608,6 +608,29 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}

/// <summary>
/// 分配系
/// </summary>
/// <param name="keyValue"></param>
/// <param name="entity"></param>
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);
}
}
}

/// <summary>
/// 批量添加单元、楼层、宿舍、床位


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs Parādīt failu

@@ -80,6 +80,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
/// <summary>
/// <returns></returns>
void SaveEntity(string keyValue, Acc_DormitoryBuildEntity entity);
void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type);


/// <summary>


+ 38
- 8
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs Parādīt failu

@@ -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 ");
@@ -170,12 +170,6 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
strSql.Append(" AND t.CheckInStu>0 ");
}
}

if (!queryParam["SqlParameter"].IsEmpty())
{
strSql.Append(queryParam["SqlParameter"].ToString());
}

return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(strSql.ToString(), dp, pagination).OrderBy(a => a.Name).ThenBy(a => a.Name).ToList();
}
catch (Exception ex)
@@ -1146,6 +1140,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",
@@ -1584,6 +1579,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);
}
}
}


#endregion 提交数据
}

Notiek ielāde…
Atcelt
Saglabāt