@@ -222,7 +222,15 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
{ | { | ||||
return View(); | return View(); | ||||
} | } | ||||
/// <summary> | |||||
/// 分配专业和班级 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult FormMainClass() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | #endregion | ||||
#region 获取数据 | #region 获取数据 | ||||
@@ -393,8 +401,18 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
var data = accommodationIBLL.GetClassifyTree(); | var data = accommodationIBLL.GetClassifyTree(); | ||||
return Success(data); | return Success(data); | ||||
} | } | ||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetClassNo(string keyValue) | |||||
{ | |||||
var data = accommodationIBLL.GetClassNo(keyValue); | |||||
return Success(data); | |||||
} | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
@@ -0,0 +1,23 @@ | |||||
| |||||
@{ | |||||
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" readonly="readonly" ></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" readonly="readonly"></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="MainClass" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/FormMainClass.js") | |||||
@@ -0,0 +1,91 @@ | |||||
/* * 版 本 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 Class = request('Class'); | |||||
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({ | |||||
type: 'multiple',// default,tree,treemultiple,gird,multiple | |||||
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 + "' order by classno desc" } | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
$('#MainClass').lrselect({ | |||||
width: '150px', | |||||
placeholder: "请选择主班级", | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetClassNo?keyvalue=' + Class, | |||||
value: 'ClassNo', | |||||
text: 'ClassName' | |||||
}); | |||||
$('#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(); | |||||
} |
@@ -51,10 +51,14 @@ | |||||
<div id="Major"></div> | <div id="Major"></div> | ||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item"> | <div class="col-xs-12 lr-form-item"> | ||||
<div class="lr-form-item-title">班级</div> | |||||
<div class="lr-form-item-title">分配班级</div> | |||||
<div id="Class"></div> | <div id="Class"></div> | ||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">混合宿舍</div> | |||||
<div id="MainClass"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">性别</div> | <div class="lr-form-item-title">性别</div> | ||||
<div id="Sex"></div> | <div id="Sex"></div> | ||||
</div> | </div> | ||||
@@ -80,6 +84,7 @@ | |||||
<a id="lr_Dept" class="btn btn-default"><i class="fa fa-pencil-square"></i> 分配系</a> | <a id="lr_Dept" class="btn btn-default"><i class="fa fa-pencil-square"></i> 分配系</a> | ||||
<a id="lr_Class" class="btn btn-default"><i class="fa fa-pencil-square"></i> 分配专业班级</a> | <a id="lr_Class" class="btn btn-default"><i class="fa fa-pencil-square"></i> 分配专业班级</a> | ||||
<a id="lr_Bed" class="btn btn-default"><i class="fa fa-pencil-square"></i> 分配宿舍</a> | <a id="lr_Bed" class="btn btn-default"><i class="fa fa-pencil-square"></i> 分配宿舍</a> | ||||
<a id="lr_MainC" class="btn btn-default"><i class="fa fa-pencil-square"></i> 分配主班级</a> | |||||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | <a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -130,7 +130,11 @@ var bootstrap = function ($, learun) { | |||||
learun.alert.error('请先选择系和专业'); | learun.alert.error('请先选择系和专业'); | ||||
} | } | ||||
}); | }); | ||||
$('#MainClass').lrselect({ | |||||
data: [{ text: "是", value: "0" }, { text: "否", value: "1" }], | |||||
text: "text", | |||||
value: "value" | |||||
}) | |||||
// 刷新 | // 刷新 | ||||
$('#lr_refresh').on('click', function () { | $('#lr_refresh').on('click', function () { | ||||
location.reload(); | location.reload(); | ||||
@@ -316,6 +320,49 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
}); | }); | ||||
//分配主宿舍 | |||||
$("#lr_MainC").on("click", function () { | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||||
var BuildType = $('#gridtable').jfGridValue('BuildType'); | |||||
var Dept = $('#gridtable').jfGridValue('Dept'); | |||||
var arr = BuildType.split(','); | |||||
var Class = $('#gridtable').jfGridValue('Class'); | |||||
var arrClass = Class.split(','); | |||||
if (keyValue.indexOf(',') != -1) { | |||||
return learun.alert.warning("只能选择一条记录进行分配!"); | |||||
} | |||||
if (arrClass.length <= 1) { | |||||
return learun.alert.warning("只能设置分配多个班级的宿舍!"); | |||||
} | |||||
if (arr.some(x => x != '4')) { | |||||
return learun.alert.warning("只能选择宿舍进行分配!"); | |||||
} | |||||
var arrDept = Dept.split(','); | |||||
if (arrDept.some(function (value, index) { | |||||
return value.length === 0; | |||||
})) { | |||||
return learun.alert.warning("选中记录包含未分配系的数据!"); | |||||
} | |||||
if (keyValue.indexOf(',') > 0) { | |||||
if (arrDept.some(function (value, index) { | |||||
return value != arrDept[0]; | |||||
})) { | |||||
return learun.alert.warning("选中记录包含多种专业的数据,不可批量分配班级!"); | |||||
} | |||||
} | |||||
learun.layerForm({ | |||||
id: 'formDept', | |||||
title: '分配主班级', | |||||
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormMainClass?keyValue=' + keyValue + '&Dept=' + arrDept[0] + '&Class=' + Class, | |||||
width: 400, | |||||
height: 300, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
}, | }, | ||||
//初始化左侧树 | //初始化左侧树 | ||||
initTree: function () { | initTree: function () { | ||||
@@ -426,7 +473,7 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
label: "班级", name: "Class", width: 100, align: "left", | |||||
label: "分配班级", name: "Class", width: 120, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | formatterAsync: function (callback, value, row, op, $cell) { | ||||
if (value && value.indexOf(',') != -1) { | if (value && value.indexOf(',') != -1) { | ||||
var content = ''; | var content = ''; | ||||
@@ -457,6 +504,19 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
} | } | ||||
}, | }, | ||||
{ | |||||
label: "主班级", name: "MainClass", 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", | label: "寝室类型", name: "RoomType", width: 100, align: "left", | ||||
formatter: function (value, row) { | formatter: function (value, row) { | ||||
@@ -1470,6 +1470,7 @@ | |||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\DormitoryAdd.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\DormitoryAdd.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\Form.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\Form.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormBed.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormBed.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormMainClass.js" /> | |||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClassify.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClassify.js" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" /> | <Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" /> | ||||
@@ -7859,6 +7860,7 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\StuPunishment\MajorIndex.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\StuPunishment\MajorIndex.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\StuPunishment\ClassIndex.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\StuPunishment\ClassIndex.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\StuPunishment\DeptIndex.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\StuPunishment\DeptIndex.cshtml" /> | ||||
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormMainClass.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | <None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | ||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | ||||
<Content Include="Views\Login\Default-beifen.cshtml" /> | <Content Include="Views\Login\Default-beifen.cshtml" /> | ||||
@@ -121,6 +121,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
[Column("CLASS")] | [Column("CLASS")] | ||||
public string Class { get; set; } | public string Class { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 主班级 | |||||
/// </summary> | |||||
[Column("MAINCLASS")] | |||||
public string MainClass { get; set; } | |||||
/// <summary> | |||||
/// 性别 | /// 性别 | ||||
/// </summary> | /// </summary> | ||||
[Column("SEX")] | [Column("SEX")] | ||||
@@ -3,6 +3,7 @@ using System; | |||||
using System.Data; | using System.Data; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||||
namespace Learun.Application.TwoDevelopment.LogisticsManagement | namespace Learun.Application.TwoDevelopment.LogisticsManagement | ||||
{ | { | ||||
@@ -851,6 +852,26 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
} | } | ||||
} | } | ||||
public List<ClassInfoEntity> GetClassNo(string MainClass) | |||||
{ | |||||
try | |||||
{ | |||||
return accommodationService.GetClassNo(MainClass).Select(x => new ClassInfoEntity { ClassNo = x.ClassNo, ClassName = x.ClassName }).ToList(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -1,6 +1,7 @@ | |||||
using Learun.Util; | using Learun.Util; | ||||
using System.Data; | using System.Data; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||||
namespace Learun.Application.TwoDevelopment.LogisticsManagement | namespace Learun.Application.TwoDevelopment.LogisticsManagement | ||||
{ | { | ||||
@@ -108,6 +109,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
object GetBedList(string parentID); | object GetBedList(string parentID); | ||||
(DataTable failDt, int snum,int fnum) ExecuteImportExcel(DataTable dt, string fileGuid); | (DataTable failDt, int snum,int fnum) ExecuteImportExcel(DataTable dt, string fileGuid); | ||||
List<ClassInfoEntity> GetClassNo(string MainClass); | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -47,6 +47,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
t.BuildType, | t.BuildType, | ||||
t.Major, | t.Major, | ||||
t.Class, | t.Class, | ||||
t.MainClass, | |||||
t.Sex, | t.Sex, | ||||
t.Functionary, | t.Functionary, | ||||
t.Phone, | t.Phone, | ||||
@@ -177,6 +178,14 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName | |||||
} | } | ||||
} | } | ||||
if (!queryParam["MainClass"].IsEmpty()) | |||||
{ | |||||
var MainClass = queryParam["MainClass"].ToString(); | |||||
if (MainClass == "0") | |||||
{ | |||||
strSql.Append(" and t.class like '%,%'"); | |||||
} | |||||
} | |||||
if (!queryParam["SqlParameter"].IsEmpty()) | if (!queryParam["SqlParameter"].IsEmpty()) | ||||
{ | { | ||||
strSql.Append(queryParam["SqlParameter"].ToString()); | strSql.Append(queryParam["SqlParameter"].ToString()); | ||||
@@ -1816,7 +1825,14 @@ where ID='{ParentID}' | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
sql += $"Major='{entity.Major}',Class='{entity.Class}'"; | |||||
if (entity.Class.Contains(',')) | |||||
{ | |||||
sql += $"Major='{entity.Major}',Class='{entity.Class}', MainClass='{entity.MainClass}'"; | |||||
} | |||||
else | |||||
{ | |||||
sql += $"Major='{entity.Major}',Class='{entity.Class}',MainClass ='{entity.Class}'"; | |||||
} | |||||
} | } | ||||
sql += $" where ID in ('{keyValue}')"; | sql += $" where ID in ('{keyValue}')"; | ||||
@@ -2200,6 +2216,36 @@ from Acc_DormitoryBuild a join (select parentid,count(1) as num from Acc_Dormito | |||||
} | } | ||||
} | } | ||||
} | } | ||||
public List<ClassInfoEntity> GetClassNo(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
var array = keyValue.Split(','); | |||||
var newarry = ""; | |||||
for (int i = 0; i < array.Length; i++) | |||||
{ | |||||
newarry += "'" + array[i] + "',"; | |||||
} | |||||
newarry = newarry.TrimEnd(','); | |||||
StringBuilder sb = new StringBuilder(); | |||||
sb.Append(@" select * from ClassInfo where classno in(" + newarry + ")"); | |||||
return this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>(sb.ToString()).ToList(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion 提交数据 | #endregion 提交数据 | ||||
} | } | ||||
} | } |