From fb3e659cecef1f2c24ee37533498ea018f985ca6 Mon Sep 17 00:00:00 2001
From: dyy <807692433@qq.com>
Date: Mon, 1 Aug 2022 15:02:48 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E7=8F=AD?=
=?UTF-8?q?=E7=BA=A7=E4=BF=A1=E6=81=AF=E7=AE=A1=E7=90=86=EF=BC=9A=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E7=8F=AD=E4=B8=BB=E4=BB=BB/=E8=BE=85=E5=AF=BC?=
=?UTF-8?q?=E5=91=98=E5=AE=89=E6=8E=92=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/ClassInfoController.cs | 9 ++++
.../Views/ClassInfo/FormArrange.cshtml | 15 ++++++
.../Views/ClassInfo/FormArrange.js | 52 ++++++++++++++++++
.../Views/ClassInfo/Index.cshtml | 5 ++
.../Views/ClassInfo/Index.js | 54 +++++++++++--------
.../Learun.Application.Web.csproj | 2 +
.../ClassInfo/ClassInfoEntity.cs | 13 ++++-
.../ClassInfo/ClassInfoService.cs | 23 +++-----
8 files changed, 134 insertions(+), 39 deletions(-)
create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/FormArrange.cshtml
create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/FormArrange.js
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassInfoController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassInfoController.cs
index 71f3324fe..864318879 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassInfoController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassInfoController.cs
@@ -50,6 +50,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}
+ ///
+ /// 班主任/辅导员安排表单页
+ ///
+ ///
+ [HttpGet]
+ public ActionResult FormArrange()
+ {
+ return View();
+ }
#endregion
#region 获取数据
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/FormArrange.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/FormArrange.cshtml
new file mode 100644
index 000000000..2981bc9ef
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/FormArrange.cshtml
@@ -0,0 +1,15 @@
+@{
+ ViewBag.Title = "班级信息管理";
+ Layout = "~/Views/Shared/_Form.cshtml";
+}
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ClassInfo/FormArrange.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/FormArrange.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/FormArrange.js
new file mode 100644
index 000000000..b7143d7d5
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/FormArrange.js
@@ -0,0 +1,52 @@
+/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
+ * Copyright (c) 2013-2018 北京泉江科技有限公司
+ * 创建人:超级管理员
+ * 日 期:2019-01-29 11:08
+ * 描 述:班级信息管理
+ */
+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 () {
+ $('#ClassDiredctorNo').lrDataSourceSelect({ code: 'teacheruserdata',value: 'f_encode',text: 'f_realname' });
+ $('#ClassTutorNo').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'f_realname' });
+ },
+ initData: function () {
+ if (!!keyValue) {
+ $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ClassInfo/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 + '/EducationalAdministration/ClassInfo/SaveForm?keyValue=' + keyValue, postData, function (res) {
+ // 保存成功后才回调
+ if (!!callBack) {
+ callBack();
+ }
+ });
+ };
+ page.init();
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Index.cshtml
index c0dbc3fdb..8e87fe741 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Index.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Index.cshtml
@@ -26,6 +26,10 @@
专业
+
@@ -44,6 +48,7 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Index.js
index 3bac36860..f4fdbf7c6 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassInfo/Index.js
@@ -174,6 +174,28 @@ var bootstrap = function ($, learun) {
});
}
});
+
+ // 班主任/辅导员安排
+ $('#lr_arrange').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('ClassId');
+ if (learun.checkrow(keyValue)) {
+ if (keyValue.indexOf(',') != -1) {
+ learun.alert.warning("只能选择一条记录进行编辑!");
+ return;
+ }
+ learun.layerForm({
+ id: 'formArrange',
+ title: '分配班主任/辅导员',
+ url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/FormArrange?keyValue=' + keyValue,
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ }
+ });
+
},
// 初始化列表
initGird: function () {
@@ -222,33 +244,19 @@ var bootstrap = function ($, learun) {
}
},
- { label: "年级", name: "Grade", width: 80, align: "center" },
+ { label: "年级", name: "Grade", width: 60, align: "center" },
{ label: "学生人数", name: "StuNum", width: 80, align: "left" },
{
- label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
- key: value,
- keyId: 'f_encode',
- callback: function (_data) {
- callback(_data['f_realname']);
- }
- });
- }
+ label: "班主任号", name: "ClassDiredctorNo", width: 100, align: "left"
},
{
- label: "辅导员", name: "ClassTutorNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
- key: value,
- keyId: 'f_encode',
- callback: function (_data) {
- callback(_data['f_realname']);
- }
- });
- }
+ label: "班主任", name: "ClassDiredctorName", width: 100, align: "left"
+ },
+ {
+ label: "辅导员号", name: "ClassTutorNo", width: 100, align: "left"
+ },
+ {
+ label: "辅导员", name: "ClassTutorName", width: 100, align: "left"
},
{
label: "是否启用", name: "CheckMark", width: 80, align: "center",
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 66e8ba38a..964daad61 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
@@ -1011,6 +1011,7 @@
+
@@ -1119,6 +1120,7 @@
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoEntity.cs
index 167e68b0d..939f8b7b5 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoEntity.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoEntity.cs
@@ -71,7 +71,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
public string ClassDiredctorNo { get; set; }
///
/// 辅导员职工号
-
///
[Column("CLASSTUTORNO")]
public string ClassTutorNo { get; set; }
@@ -122,6 +121,18 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
#endregion
#region 扩展字段
+
+ ///
+ /// 班主任
+ ///
+ [NotMapped]
+ public string ClassDiredctorName { get; set; }
+ ///
+ /// 辅导员
+ ///
+ [NotMapped]
+ public string ClassTutorName { get; set; }
+
#endregion
}
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs
index 0e7308ed8..49bcf2f9d 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs
@@ -30,22 +30,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
try
{
var strSql = new StringBuilder();
- strSql.Append("SELECT ");
- strSql.Append(@"
- t.ClassId,
- t.ClassName,
- t.ClassNo,
- t.DeptNo,
- t.MajorNo,
- t.SerialNum,
- t.Grade,
- t.StuNum,
- t.ClassDiredctorNo,
- t.ClassTutorNo,
- t.ClassType,
- t.CheckMark,t.IsSeparate
- ");
+ strSql.Append("SELECT t.*,e.EmpName as ClassDiredctorName,e2.EmpName as ClassTutorName ");
strSql.Append(" FROM ClassInfo t ");
+ strSql.Append(" left join EmpInfo e on t.ClassDiredctorNo=e.EmpNo ");
+ strSql.Append(" left join EmpInfo e2 on t.ClassTutorNo=e2.EmpNo ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
@@ -70,6 +58,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String);
strSql.Append(" AND t.MajorNo = @MajorNo ");
}
+ if (!queryParam["Grade"].IsEmpty())
+ {
+ dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String);
+ strSql.Append(" AND t.Grade = @Grade ");
+ }
return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination);
}
catch (Exception ex)