diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs
index 8ba4e596e..235142697 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs
@@ -222,7 +222,15 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
{
return View();
}
-
+ ///
+ /// 分配专业和班级
+ ///
+ ///
+ [HttpGet]
+ public ActionResult FormMainClass()
+ {
+ return View();
+ }
#endregion
#region 获取数据
@@ -393,8 +401,18 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
var data = accommodationIBLL.GetClassifyTree();
return Success(data);
}
-
-
+ ///
+ ///
+ ///
+ ///
+ [HttpGet]
+ [AjaxOnly]
+ public ActionResult GetClassNo(string keyValue)
+ {
+ var data = accommodationIBLL.GetClassNo(keyValue);
+ return Success(data);
+ }
+
#endregion
#region 提交数据
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormMainClass.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormMainClass.cshtml
new file mode 100644
index 000000000..e15f346c3
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormMainClass.cshtml
@@ -0,0 +1,23 @@
+
+@{
+ ViewBag.Title = "FormClass";
+ Layout = "~/Views/Shared/_Form.cshtml";
+}
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Accommodation/FormMainClass.js")
+
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormMainClass.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormMainClass.js
new file mode 100644
index 000000000..511136081
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/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();
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.cshtml
index 2b92a19cb..3796acebc 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.cshtml
@@ -51,10 +51,14 @@
-
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js
index d656ca85b..e6389409d 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js
@@ -130,7 +130,11 @@ var bootstrap = function ($, learun) {
learun.alert.error('请先选择系和专业');
}
});
-
+ $('#MainClass').lrselect({
+ data: [{ text: "是", value: "0" }, { text: "否", value: "1" }],
+ text: "text",
+ value: "value"
+ })
// 刷新
$('#lr_refresh').on('click', function () {
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 () {
@@ -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) {
if (value && value.indexOf(',') != -1) {
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",
formatter: function (value, row) {
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 f839a48be..6ac68f63b 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
@@ -1470,6 +1470,7 @@
+
@@ -7859,6 +7860,7 @@
+
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 0c0866c1e..a98290d30 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
@@ -121,6 +121,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
[Column("CLASS")]
public string Class { get; set; }
///
+ /// 主班级
+ ///
+ [Column("MAINCLASS")]
+ public string MainClass { get; set; }
+ ///
/// 性别
///
[Column("SEX")]
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 12c98a70c..a78a58e04 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
@@ -3,6 +3,7 @@ using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
+using Learun.Application.TwoDevelopment.EducationalAdministration;
namespace Learun.Application.TwoDevelopment.LogisticsManagement
{
@@ -851,6 +852,26 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}
+
+
+ public List 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
}
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 9c3541bc6..88eab9997 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
@@ -1,6 +1,7 @@
using Learun.Util;
using System.Data;
using System.Collections.Generic;
+using Learun.Application.TwoDevelopment.EducationalAdministration;
namespace Learun.Application.TwoDevelopment.LogisticsManagement
{
@@ -108,6 +109,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
object GetBedList(string parentID);
(DataTable failDt, int snum,int fnum) ExecuteImportExcel(DataTable dt, string fileGuid);
+ List GetClassNo(string MainClass);
#endregion
}
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 f18f16354..7700554a1 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
@@ -47,6 +47,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
t.BuildType,
t.Major,
t.Class,
+ t.MainClass,
t.Sex,
t.Functionary,
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())
{
strSql.Append(queryParam["SqlParameter"].ToString());
@@ -1816,7 +1825,14 @@ where ID='{ParentID}'
}
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}')";
@@ -2200,6 +2216,36 @@ from Acc_DormitoryBuild a join (select parentid,count(1) as num from Acc_Dormito
}
}
}
+
+
+ public List 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(sb.ToString()).ToList();
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
#endregion 提交数据
}
}
\ No newline at end of file