Parcourir la source

宿舍管理: 添加混合宿舍 设置主宿舍 分配多个班级

临城职教中职
ndbs il y a 2 ans
Parent
révision
5514bf6fbf
10 fichiers modifiés avec 281 ajouts et 8 suppressions
  1. +21
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs
  2. +23
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormMainClass.cshtml
  3. +91
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormMainClass.js
  4. +7
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.cshtml
  5. +62
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js
  6. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  7. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs
  8. +21
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs
  9. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs
  10. +47
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs

+ 21
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs Voir le fichier

@@ -222,7 +222,15 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
{
return View();
}

/// <summary>
/// 分配专业和班级
/// </summary>
/// <returns></returns>
[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);
}


/// <summary>
///
/// </summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetClassNo(string keyValue)
{
var data = accommodationIBLL.GetClassNo(keyValue);
return Success(data);
}
#endregion

#region 提交数据


+ 23
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormMainClass.cshtml Voir le fichier

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



+ 91
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormMainClass.js Voir le fichier

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

+ 7
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.cshtml Voir le fichier

@@ -51,10 +51,14 @@
<div id="Major"></div>
</div>
<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>
<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 id="Sex"></div>
</div>
@@ -80,6 +84,7 @@
<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_MainC" 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>


+ 62
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js Voir le fichier

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


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Voir le fichier

@@ -1470,6 +1470,7 @@
<Content Include="Areas\LogisticsManagement\Views\Accommodation\DormitoryAdd.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\Form.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\FormClassify.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\ClassIndex.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\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/Acc_DormitoryBuildEntity.cs Voir le fichier

@@ -121,6 +121,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
[Column("CLASS")]
public string Class { get; set; }
/// <summary>
/// 主班级
/// </summary>
[Column("MAINCLASS")]
public string MainClass { get; set; }
/// <summary>
/// 性别
/// </summary>
[Column("SEX")]


+ 21
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs Voir le fichier

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

}


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs Voir le fichier

@@ -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<ClassInfoEntity> GetClassNo(string MainClass);
#endregion

}


+ 47
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs Voir le fichier

@@ -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<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 提交数据
}
}

Chargement…
Annuler
Enregistrer