From 0e15d94edbaf0459e377df4326c7acb1b6f11c16 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Wed, 31 May 2023 14:53:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91?= =?UTF-8?q?=E7=BA=BF=E4=B8=8A=E8=AF=BE=E7=A8=8B=EF=BC=9A=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=80=89=E8=AF=BE=E4=B8=93=E4=B8=9A=E3=80=81=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BA=BA=E6=95=B0=E3=80=81=E8=AE=BE=E7=BD=AE=E5=8F=AF=E9=80=89?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/CdMajorController.cs | 16 + .../ElectiveMajorOnlineController.cs | 129 ++++++ .../LessonInfoOfElectiveOnlineController.cs | 42 ++ .../CdMajor/IndexOfElectiveOnline.cshtml | 49 ++ .../Views/CdMajor/IndexOfElectiveOnline.js | 128 ++++++ .../Views/ElectiveMajorOnline/Form.cshtml | 31 ++ .../Views/ElectiveMajorOnline/Form.js | 50 +++ .../Views/ElectiveMajorOnline/Index.cshtml | 51 +++ .../Views/ElectiveMajorOnline/Index.js | 146 ++++++ .../LessonInfoOfElectiveOnline/FormNum.cshtml | 11 + .../LessonInfoOfElectiveOnline/FormNum.js | 38 ++ .../Views/LessonInfoOfElectiveOnline/Index.js | 54 ++- .../SetIndex.cshtml | 53 +++ .../LessonInfoOfElectiveOnline/SetIndex.js | 272 ++++++++++++ .../Learun.Application.Web.csproj | 11 + .../ElectiveMajorOnlineMap.cs | 29 ++ .../Learun.Application.Mapping.csproj | 1 + .../CdMajor/CdMajorBLL.cs | 19 + .../CdMajor/CdMajorEntity.cs | 8 +- .../CdMajor/CdMajorIBLL.cs | 1 + .../CdMajor/CdMajorService.cs | 57 +++ .../ElectiveMajorOnlineBLL.cs | 216 +++++++++ .../ElectiveMajorOnlineEntity.cs | 80 ++++ .../ElectiveMajorOnlineIBLL.cs | 71 +++ .../ElectiveMajorOnlineService.cs | 420 ++++++++++++++++++ .../LessonInfoOfElectiveOnlineBLL.cs | 48 ++ .../LessonInfoOfElectiveOnlineEntity.cs | 12 + .../LessonInfoOfElectiveOnlineIBLL.cs | 13 + .../LessonInfoOfElectiveOnlineService.cs | 104 ++++- .../Learun.Application.TwoDevelopment.csproj | 4 + 30 files changed, 2140 insertions(+), 24 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ElectiveMajorOnlineController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/IndexOfElectiveOnline.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/IndexOfElectiveOnline.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/FormNum.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/FormNum.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ElectiveMajorOnlineMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdMajorController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdMajorController.cs index 7a213294a..a85ac1629 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdMajorController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdMajorController.cs @@ -71,6 +71,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 主页面【线上选修课程-设置选课专业】 + /// + /// + [HttpGet] + public ActionResult IndexOfElectiveOnline() + { + return View(); + } #endregion #region 获取数据 @@ -124,6 +133,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } [HttpGet] [AjaxOnly] + public ActionResult GetElectiveOnlinePageList(string queryJson) + { + var data = cdMajorIBLL.GetElectiveOnlinePageList(queryJson).OrderBy(x => x.MajorNo).ThenBy(x => x.Grade); + return Success(data); + } + [HttpGet] + [AjaxOnly] public ActionResult GetListByDeptNo(string DeptNo) { var data = cdMajorIBLL.GetListByDeptNo(DeptNo); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ElectiveMajorOnlineController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ElectiveMajorOnlineController.cs new file mode 100644 index 000000000..c69044f5b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ElectiveMajorOnlineController.cs @@ -0,0 +1,129 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; +using Newtonsoft.Json; +using System.Linq; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-08-29 16:50 + /// 描 述:选课专业 + /// + public class ElectiveMajorOnlineController : MvcControllerBase + { + private ElectiveMajorOnlineIBLL electiveMajorOnlineIBLL = new ElectiveMajorOnlineBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = electiveMajorOnlineIBLL.GetPageList(paginationobj, queryJson).OrderBy(x => x.MajorNo).ThenBy(x => x.Grade); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var ElectiveMajorOnlineData = electiveMajorOnlineIBLL.GetElectiveMajorOnlineEntity(keyValue); + var jsonData = new + { + ElectiveMajorOnline = ElectiveMajorOnlineData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue, string LIOEOId) + { + electiveMajorOnlineIBLL.BatchDeleteEntity(keyValue, LIOEOId); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + ElectiveMajorOnlineEntity entity = strEntity.ToObject(); + electiveMajorOnlineIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + + /// + /// 设置选课专业 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult SetElectiveMajorOnline(string keyValue, string olpoeId) + { + //electiveMajorOnlineIBLL.SetElectiveMajorOnline(keyValue, olpoeId); + var dataList = JsonConvert.DeserializeObject>(keyValue); + electiveMajorOnlineIBLL.SetElectiveMajorOnline(dataList, olpoeId); + return Success("设置成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/LessonInfoOfElectiveOnlineController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/LessonInfoOfElectiveOnlineController.cs index 1e9208d94..ae0d004dd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/LessonInfoOfElectiveOnlineController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/LessonInfoOfElectiveOnlineController.cs @@ -37,6 +37,25 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + + /// + /// 主页面-设置 + /// + /// + [HttpGet] + public ActionResult SetIndex() + { + return View(); + } + /// + /// 表单页-人数 + /// + /// + [HttpGet] + public ActionResult FormNum() + { + return View(); + } #endregion #region 获取数据 @@ -129,6 +148,29 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("操作成功!"); } + /// + /// 设置可选/取消可选 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult SetUpIsAllowSelect(string keyValue, int IsAllowSelect) + { + lessonInfoOfElectiveOnlineIBLL.SetUpIsAllowSelect(keyValue, IsAllowSelect); + return Success("操作成功!"); + } + + /// + /// 批量设置管理专业 + /// + /// + [HttpPost] + public ActionResult SaveStuNumMax(string keyValue, int StuNumMax) + { + lessonInfoOfElectiveOnlineIBLL.SaveStuNumMax(keyValue, StuNumMax); + return Success("保存成功!"); + } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/IndexOfElectiveOnline.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/IndexOfElectiveOnline.cshtml new file mode 100644 index 000000000..14611f1b0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/IndexOfElectiveOnline.cshtml @@ -0,0 +1,49 @@ +@{ + ViewBag.Title = "专业信息管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
专业编号
+ +
+
+
专业名称
+ +
+
+
校区
+
+
+
+
系别
+
+
+
+
年级
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/CdMajor/IndexOfElectiveOnline.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/IndexOfElectiveOnline.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/IndexOfElectiveOnline.js new file mode 100644 index 000000000..bd1814fcf --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/IndexOfElectiveOnline.js @@ -0,0 +1,128 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-01-22 16:32 + * 描 述:专业信息管理 + */ +var refreshGirdData; +var acceptClick; +var LIOEOId = request('LIOEOId'); //选修课主键 +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); + $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); + $('#Grade').lrselect({ + url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear', + value: 'value', + text: 'text', + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtableaddmajor').lrAuthorizeJfGridLei({ + url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GetElectiveOnlinePageList', + headData: [ + { label: "专业名称", name: "MajorName", width: 150, align: "left" }, + { label: "专业编号", name: "MajorNo", width: 80, align: "left" }, + { label: "年级", name: "Grade", width: 80, align: "left" }, + { label: "学制", name: "LengthOfSchooling", width: 60, align: "left" }, + { + label: "学科门类", name: "SubjectSpeciesNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'SubjectSpecies', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "校区", name: "F_SchoolId", width: 200, 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: "DeptNo", 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: "GraduateNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'CollegeType', + callback: function (_data) { + callback(_data.text); + } + }); + } + } + ], + mainId: 'ID', + isMultiselect: true, + sidx: 'MajorNo', + sord: 'ASC' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.LIOEOId = LIOEOId; + $('#gridtableaddmajor').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + // 保存数据 + acceptClick = function (callBack) { + var keyValue = $('#gridtableaddmajor').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + var dataList = $('#gridtableaddmajor').jfGridGet('rowdata'); + learun.layerConfirm('是否确认添加?', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/ElectiveMajorOnline/SetElectiveMajorOnline', { keyValue: JSON.stringify(dataList), olpoeId: LIOEOId }, function () { + // 保存成功后才回调 + if (!!callBack) { + learun.layerClose(window.name); + callBack(); + } + }); + } + }); + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Form.cshtml new file mode 100644 index 000000000..1f09fbd05 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Form.cshtml @@ -0,0 +1,31 @@ +@{ + ViewBag.Title = "选课专业"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
学年*
+ +
+
+
学期*
+ +
+
+
专业编号*
+ +
+
+
创建用户编号*
+ +
+
+
创建用户名称*
+ +
+
+
创建时间*
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Form.js new file mode 100644 index 000000000..e683b5c5d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Form.js @@ -0,0 +1,50 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-08-29 16:50 + * 描 述:选课专业 + */ +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 () { + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ElectiveMajorOnline/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/ElectiveMajorOnline/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Index.cshtml new file mode 100644 index 000000000..ca29c6627 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Index.cshtml @@ -0,0 +1,51 @@ +@{ + ViewBag.Title = "选课专业"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
专业编号
+ +
+
+
专业名称
+ +
+
+
校区
+
+
+
+
系别
+
+
+
+
年级
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Index.js new file mode 100644 index 000000000..c40c35213 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ElectiveMajorOnline/Index.js @@ -0,0 +1,146 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-08-29 16:50 + * 描 述:选课专业 + */ +var refreshGirdData; +var acceptClick; +var LIOEOId = request("LIOEOId"); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); + $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); + $('#Grade').lrselect({ + url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear', + value: 'value', + text: 'text', + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 添加专业 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'formadd', + title: '添加专业', + url: top.$.rootUrl + '/EducationalAdministration/CdMajor/IndexOfElectiveOnline?LIOEOId=' + LIOEOId, + width: 1000, + height: 700, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtablemanagemajor').jfGridValue('ElectiveMajorOnlineId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/ElectiveMajorOnline/DeleteForm', { keyValue: keyValue, LIOEOId: LIOEOId }, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtablemanagemajor').lrAuthorizeJfGridLei({ + url: top.$.rootUrl + '/EducationalAdministration/ElectiveMajorOnline/GetPageList', + headData: [ + { label: "专业名称", name: "MajorName", width: 150, align: "left" }, + { label: "专业编号", name: "MajorNo", width: 80, align: "left" }, + { label: "年级", name: "Grade", width: 80, align: "left" }, + { label: "学制", name: "LengthOfSchooling", width: 60, align: "left" }, + { + label: "学科门类", name: "SubjectSpeciesNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'SubjectSpecies', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "校区", name: "F_SchoolId", width: 200, 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: "DeptNo", 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: "GraduateNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'CollegeType', + callback: function (_data) { + callback(_data.text); + } + }); + } + } + ], + mainId: 'ElectiveMajorOnlineId', + isMultiselect: true, + isPage: true, + sidx: 'MajorNo', + sord: 'ASC' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.LIOEOId = LIOEOId; + $('#gridtablemanagemajor').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + + refreshGirdData = function () { + page.search(); + }; + + // 保存数据 + acceptClick = function (callBack) { + if (!!callBack) { + learun.layerClose(window.name); + callBack(); + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/FormNum.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/FormNum.cshtml new file mode 100644 index 000000000..ce4cc5db5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/FormNum.cshtml @@ -0,0 +1,11 @@ +@{ + ViewBag.Title = "线上选修课程设置"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
报名人数上限 *
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/FormNum.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/FormNum.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/FormNum.js new file mode 100644 index 000000000..fac9d963c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/FormNum.js @@ -0,0 +1,38 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2023-05-30 10: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 () { + + }, + initData: function () { + + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/SaveStuNumMax?keyValue=' + keyValue, { StuNumMax: $('#StuNumMax').val() }, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/Index.js index fa643b217..9a7a9fd9f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/Index.js @@ -54,6 +54,10 @@ var bootstrap = function ($, learun) { $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录进行编辑!"); + return; + } var CheckMark = $('#gridtable').jfGridValue('CheckMark'); if (CheckMark === "1") { learun.alert.warning("当前课程已启用不能编辑!"); @@ -76,17 +80,32 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var CheckMark = $('#gridtable').jfGridValue('CheckMark'); - if (CheckMark === "1") { - learun.alert.warning("当前课程已启用不能删除!"); + if (CheckMark.indexOf('1') != -1) { + learun.alert.warning("选中记录中包含已启用项目,已启用不能删除!"); return; } - learun.layerConfirm('是否确认删除该项!', function (res) { - if (res) { - learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/DeleteForm', { keyValue: keyValue }, function () { - refreshGirdData(); - }); - } - }); + var rowdata = $('#gridtable').jfGridGet('rowdata'); + //有报名数据、有选择专业不让删除 + try { + rowdata.forEach(function (item, index, row) { + if (!!item.StuNumOfApply || !!item.StuNum) { + throw learun.alert.warning("已报人数、通过人数大于0的不能删除!"); + } + if (!!item.ElectiveMajorOnlineList && item.ElectiveMajorOnlineList.length > 0) { + throw learun.alert.warning("已管理选课专业的数据不允许删除!"); + } + }); + + learun.layerConfirm('是否确认删除选中项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } catch (e) { + + } } }); //启用 @@ -94,13 +113,13 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var CheckMark = $('#gridtable').jfGridValue('CheckMark'); - if (CheckMark == "1") { - learun.alert.warning("当前课程已启用!"); + if (CheckMark.indexOf('1') != -1) { + learun.alert.warning("选中记录中包含已启用项目!"); return; } - learun.layerConfirm('是否确认启用该项!', function (res) { + learun.layerConfirm('是否确认启用选中项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/DoLock', { keyValue: keyValue, status: "1" }, function () { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/DoLock', { keyValue: keyValue, status: "1" }, function () { refreshGirdData(); }); } @@ -112,13 +131,13 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var CheckMark = $('#gridtable').jfGridValue('CheckMark'); - if (CheckMark != "1") { - learun.alert.warning("当前课程未启用无法停用!"); + if (CheckMark.indexOf('0') != -1) { + learun.alert.warning("选中记录中包含未启用项目!"); return; } - learun.layerConfirm('是否确认停用该项!', function (res) { + learun.layerConfirm('是否确认停用选中项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/DoLock', { keyValue: keyValue, status: "0" }, function () { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/DoLock', { keyValue: keyValue, status: "0" }, function () { refreshGirdData(); }); } @@ -170,6 +189,7 @@ var bootstrap = function ($, learun) { ], mainId: 'Id', isPage: true, + isMultiselect: true, sidx: 'MakeDate desc' }); page.search(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.cshtml new file mode 100644 index 000000000..9b52acf43 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.cshtml @@ -0,0 +1,53 @@ +@{ + ViewBag.Title = "线上选修课程设置"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
学年
+
+
+
+
学期
+
+
+
+
课程名称
+
+
+
+
课程号
+ +
+
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js new file mode 100644 index 000000000..4b597e0a3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js @@ -0,0 +1,272 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2023-05-30 10:02 + * 描 述:线上选修课程设置 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + page.bindSemesterAndYear(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + $('#LessonName').lrDataSourceSelect({ code: 'LessonInfoOfElectiveOnline', value: 'lessonno', text: 'lessonname' }); + + //设置选课专业 + $('#lr_editMajor').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var rowdata = $('#gridtable').jfGridGet('rowdata'); + //判断选中记录是否可以批量管理专业 + $.ajax({ + url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsBatchEditMajor', + data: { data: JSON.stringify(rowdata) }, + type: "post", + dataType: "json", + async: false, + cache: false, + success: function (data) { + if (data.data == true) { + learun.layerForm({ + id: 'formMajor', + title: '管理选课专业', + url: top.$.rootUrl + '/EducationalAdministration/ElectiveMajorOnline/Index?LIOEOId=' + keyValue, + width: 1000, + height: 700, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } else { + return learun.alert.warning('只有同学期同课程支持批量管理专业!'); + } + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + learun.httpErrorLog(textStatus); + }, + beforeSend: function () { + }, + complete: function () { + } + }); + + } + }); + + //设置人数 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formNum', + title: '设置人数', + url: top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/FormNum?keyValue=' + keyValue, + width: 400, + height: 300, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + + //查看已审学生-----todo:待看 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '查看学生', + url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElective/FinishIndex?OLPEId=' + keyValue, + width: 1000, + height: 700, + btn: null, + end: function () { + refreshGirdData(); + } + }); + } + }); + //审核学生------todo:待看 + $('#lr_audit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '审核学生', + url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElective/AuditIndex?OLPEId=' + keyValue, + width: 1000, + height: 700, + btn: null, + end: function () { + refreshGirdData(); + } + }); + } + }); + + //设置可选 + $('#lr_AllowSelect').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/SetUpIsAllowSelect', { keyValue: keyValue, IsAllowSelect: 1 }, + function () { + refreshGirdData(); + }); + } + }); + //取消可选 + $('#lr_CancelSelect').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/SetUpIsAllowSelect', { keyValue: keyValue, IsAllowSelect: 0 }, + function () { + refreshGirdData(); + }); + } + }); + }, + bindSemesterAndYear: function () { + $.ajax({ + url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetSemesterAndYear', + type: "GET", + dataType: "json", + async: false, + cache: false, + success: function (res) { + var data = res.data; + if (!!data) { + $('#AcademicYearNo').lrselectSet(data.AcademicYearShort); + var Semester = data.Semester; + $('#Semester').lrselectSet(Semester); + + var param = { "AcademicYearNo": data.AcademicYearShort, "Semester": data.Semester }; + //todo:等待最后解除注释 + //page.search(param); + } + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + learun.httpErrorLog(textStatus); + }, + beforeSend: function () { + }, + complete: function () { + } + }); + + + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/GetPageList', + headData: [ + { label: "课程编号", name: "LessonNo", width: 150, align: "left" }, + { label: "课程名称", name: "LessonName", width: 150, align: "left" }, + { label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, + { label: "学期", name: "Semester", width: 100, align: "left" }, + { + label: "建课教师", name: "EmpNo", width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + key: value, + keyId: 'empno', + callback: function (_data) { + callback(_data['empname']); + } + }); + } + }, + { + label: "建课学校", name: "F_SchoolId", width: 150, 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: "StuNumMax", width: 60, align: "left" }, + { label: "已报人数", name: "StuNumOfApply", width: 60, align: "left" }, + { label: "通过人数", name: "StuNum", width: 60, align: "left" }, + { + label: "是否可选", name: "IsAllowSelect", width: 80, align: "left", + formatter: function (cellvalue, rowObject) { + return cellvalue == 1 ? "" : ""; + } + + }, + { + label: "是否已选专业", name: "IsElectiveMajor", width: 100, align: "left", formatter: function (cellvalue, row) { + if (!!row.ElectiveMajorOnlineList && row.ElectiveMajorOnlineList.length > 0) { + return ""; + } else { + return ""; + } + } + }, + { + label: "选课专业", name: "ElectiveMajorOnlineList", width: 150, align: "left", formatter: function (cellvalue, row) { + var str = ""; + if (!!cellvalue && cellvalue.length > 0) { + for (var i = 0; i < cellvalue.length; i++) { + str += cellvalue[i].Grade + "级" + cellvalue[i].MajorName; + if (i != cellvalue.length - 1) { + str += ","; + } + } + } + return str; + } + } + ], + mainId: 'Id', + isPage: true, + isMultiselect: true, + sidx: 'AcademicYearNo DESC, Semester DESC, LessonName ASC', + sord: 'desc' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.CheckMark = "1";//已启用 + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} 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 924eee613..39d789100 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 @@ -339,6 +339,7 @@ + @@ -1003,8 +1004,13 @@ + + + + + @@ -8186,6 +8192,11 @@ + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ElectiveMajorOnlineMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ElectiveMajorOnlineMap.cs new file mode 100644 index 000000000..324dc9850 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ElectiveMajorOnlineMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-08-29 16:50 + /// 描 述:选课专业 + /// + public class ElectiveMajorOnlineMap : EntityTypeConfiguration + { + public ElectiveMajorOnlineMap() + { + #region 表、主键 + //表 + this.ToTable("ELECTIVEMAJORONLINE"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index 55da82aa7..e5d6c0d64 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -83,6 +83,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorBLL.cs index 35bd88e80..6ba0b9ff7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorBLL.cs @@ -60,6 +60,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public IEnumerable GetElectiveOnlinePageList(string queryJson) + { + try + { + return cdMajorService.GetElectiveOnlinePageList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public IEnumerable GetListForProvince(string queryJson) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorEntity.cs index c4b52735a..a151339d8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorEntity.cs @@ -163,20 +163,20 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion #region 扩展字段 /// - /// OpenLessonPlanOfElective主键 + /// LessonInfoOfElectiveOnline主键 /// [NotMapped] - public string OLPOEId { get; set; } + public string LIOEOId { get; set; } /// /// 年级 /// [NotMapped] public string Grade { get; set; } /// - /// ElectiveMajor主键 + /// ElectiveMajorOnline主键 /// [NotMapped] - public string ElectiveMajorId { get; set; } + public string ElectiveMajorOnlineId { get; set; } /// /// 招生对象名称 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorIBLL.cs index 29920db52..6a3557242 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorIBLL.cs @@ -22,6 +22,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// IEnumerable GetPageList(Pagination pagination, string queryJson); IEnumerable GetElectivePageList(string queryJson); + IEnumerable GetElectiveOnlinePageList(string queryJson); IEnumerable GetListForProvince(string queryJson); IEnumerable GetListByProvince(string province); IEnumerable GetListByDeptNo(string DeptNo); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorService.cs index bff80c93b..e8e9241b4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorService.cs @@ -151,6 +151,63 @@ t.Province } } + public IEnumerable GetElectiveOnlinePageList(string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + var strSql = new StringBuilder(); + + strSql.Append("select bb.* from ( "); + strSql.Append(" select b.Grade,m.* from CdMajor m "); + strSql.Append(" inner join (select t.Grade from ClassInfo t where t.CheckMark=1 group by t.Grade) b on 1=1"); + strSql.Append(" where 1=1 and m.CheckMark=1"); + strSql.Append(" except"); + strSql.Append(" select em.Grade,cm.* from ElectiveMajorOnline em left join CdMajor cm on em.MajorId=cm.ID where em.LIOEOId in ('" + string.Join("','", queryParam["LIOEOId"].ToString().Split(',')) + "') "); + strSql.Append(" ) bb where 1=1 "); + + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["MajorNo"].IsEmpty()) + { + dp.Add("MajorNo", "%" + queryParam["MajorNo"].ToString() + "%", DbType.String); + strSql.Append(" AND bb.MajorNo Like @MajorNo "); + } + if (!queryParam["MajorName"].IsEmpty()) + { + dp.Add("MajorName", "%" + queryParam["MajorName"].ToString() + "%", DbType.String); + strSql.Append(" AND bb.MajorName Like @MajorName "); + } + if (!queryParam["DeptNo"].IsEmpty()) + { + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); + strSql.Append(" AND bb.DeptNo = @DeptNo "); + } + if (!queryParam["F_SchoolId"].IsEmpty()) + { + dp.Add("F_SchoolId", queryParam["F_SchoolId"].ToString(), DbType.String); + strSql.Append(" AND bb.F_SchoolId = @F_SchoolId "); + } + if (!queryParam["Grade"].IsEmpty()) + { + dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String); + strSql.Append(" AND bb.Grade = @Grade "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public IEnumerable GetListForProvince(string queryJson) { try diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineBLL.cs new file mode 100644 index 000000000..03c0cbd5b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineBLL.cs @@ -0,0 +1,216 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-08-29 16:50 + /// 描 述:选课专业 + /// + public class ElectiveMajorOnlineBLL : ElectiveMajorOnlineIBLL + { + private ElectiveMajorOnlineService electiveMajorOnlineService = new ElectiveMajorOnlineService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return electiveMajorOnlineService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取ElectiveMajorOnline表实体数据 + /// 主键 + /// + /// + public ElectiveMajorOnlineEntity GetElectiveMajorOnlineEntity(string keyValue) + { + try + { + return electiveMajorOnlineService.GetElectiveMajorOnlineEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList(string academicYearNo, string semester) + { + try + { + return electiveMajorOnlineService.GetList(academicYearNo, semester); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + electiveMajorOnlineService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void BatchDeleteEntity(string keyValue, string LIOEOId) + { + try + { + electiveMajorOnlineService.BatchDeleteEntity(keyValue, LIOEOId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, ElectiveMajorOnlineEntity entity) + { + try + { + electiveMajorOnlineService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 扩展数据 + + /// + /// 设置选课专业 + /// + /// + public void SetElectiveMajorOnline(string keyValue, string olpoeId) + { + try + { + electiveMajorOnlineService.SetElectiveMajorOnline(keyValue,olpoeId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 设置选课专业 + /// + /// 选中专业 + public void SetElectiveMajorOnline(List dataList, string olpoeId) + { + try + { + electiveMajorOnlineService.SetElectiveMajorOnline(dataList, olpoeId); + } + 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/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineEntity.cs new file mode 100644 index 000000000..8b3057149 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineEntity.cs @@ -0,0 +1,80 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-08-29 16:50 + /// 描 述:选课专业 + /// + public class ElectiveMajorOnlineEntity + { + #region 实体成员 + /// + /// Id + /// + [Column("ID")] + public string Id { get; set; } + /// + /// 选修课主键 + /// + [Column("LIOEOID")] + public string LIOEOId { get; set; } + /// + /// 可选课的专业 + /// + [Column("MAJORID")] + public string MajorId { get; set; } + /// + /// 年级 + /// + [Column("GRADE")] + public string Grade { get; set; } + /// + /// CreateUserId + /// + [Column("CREATEUSERID")] + public string CreateUserId { get; set; } + /// + /// CreateUserName + /// + [Column("CREATEUSERNAME")] + public string CreateUserName { get; set; } + /// + /// CreateDate + /// + [Column("CREATEDATE")] + public DateTime? CreateDate { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + #region 扩展字段 + [NotMapped] + public string MajorNo { get; set; } + [NotMapped] + public string MajorName { get; set; } + + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineIBLL.cs new file mode 100644 index 000000000..ccfb82e80 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineIBLL.cs @@ -0,0 +1,71 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-08-29 16:50 + /// 描 述:选课专业 + /// + public interface ElectiveMajorOnlineIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取ElectiveMajorOnline表实体数据 + /// 主键 + /// + /// + ElectiveMajorOnlineEntity GetElectiveMajorOnlineEntity(string keyValue); + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetList(string academicYearNo, string semester); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + void DeleteEntity(string keyValue); + void BatchDeleteEntity(string keyValue, string LIOEOId); + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + void SaveEntity(string keyValue, ElectiveMajorOnlineEntity entity); + #endregion + + #region 扩展数据 + + /// + /// 设置选课专业 + /// + /// + void SetElectiveMajorOnline(string keyValue, string olpoeId); + /// + /// 设置选课专业 + /// + /// 选中专业 + void SetElectiveMajorOnline(List dataList, string olpoeId); + + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineService.cs new file mode 100644 index 000000000..3ae2d83cd --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ElectiveMajorOnline/ElectiveMajorOnlineService.cs @@ -0,0 +1,420 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-08-29 16:50 + /// 描 述:选课专业 + /// + public class ElectiveMajorOnlineService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.MajorName,t.MajorNo,t.LengthOfSchooling,t.SubjectSpeciesNo,t.F_SchoolId,t.DeptNo,t.GraduateNo,a.LIOEOId,a.Id as ElectiveMajorOnlineId,a.Grade FROM ElectiveMajorOnline a left join CdMajor t on a.majorid=t.id"); + strSql.Append(" WHERE 1=1 and t.checkmark=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["LIOEOId"].IsEmpty()) + { + if (queryParam["LIOEOId"].ToString().Contains(",")) + { + //判断批量管理专业时 原先的专业是否一致。如果一致,显示列表,如果不一致,不显示 + var OLPOEId_arr = queryParam["LIOEOId"].ToString().Split(','); + var OLPOEIdfirst = OLPOEId_arr[0]; + var listfirst = this.BaseRepository("CollegeMIS") + .FindList($@"SELECT t.MajorNo+a.Grade as Id,t.MajorNo,a.Grade FROM ElectiveMajorOnline a left join CdMajor t on a.majorid=t.id + WHERE 1=1 and t.checkmark=1 AND a.LIOEOId ='{OLPOEIdfirst}'").ToList(); + bool flag = true; + foreach (var OLPOEId in OLPOEId_arr) + { + if (OLPOEId != OLPOEIdfirst) + { + var list = this.BaseRepository("CollegeMIS") + .FindList($@"SELECT t.MajorNo+a.Grade as Id,t.MajorNo,a.Grade FROM ElectiveMajorOnline a left join CdMajor t on a.majorid=t.id + WHERE 1=1 and t.checkmark=1 AND a.LIOEOId ='{OLPOEId}'").ToList(); + var Except1 = listfirst.Except(list, new ItemComparer()); + var Except2 = list.Except(listfirst, new ItemComparer()); + if (Except1.Count() > 0 || Except2.Count() > 0) + { + strSql.Append(" AND a.LIOEOId = '' "); + flag = false; + break; + } + } + + } + + if (flag) + { + strSql.Append($" AND a.LIOEOId = '{OLPOEIdfirst}' "); + } + } + else + { + dp.Add("LIOEOId", queryParam["LIOEOId"].ToString(), DbType.String); + strSql.Append(" AND a.LIOEOId = @LIOEOId "); + } + + } + if (!queryParam["MajorNo"].IsEmpty()) + { + dp.Add("MajorNo", "%" + queryParam["MajorNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.MajorNo Like @MajorNo "); + } + if (!queryParam["MajorName"].IsEmpty()) + { + dp.Add("MajorName", "%" + queryParam["MajorName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.MajorName Like @MajorName "); + } + if (!queryParam["DeptNo"].IsEmpty()) + { + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.DeptNo = @DeptNo "); + } + if (!queryParam["F_SchoolId"].IsEmpty()) + { + dp.Add("F_SchoolId", queryParam["F_SchoolId"].ToString(), DbType.String); + strSql.Append(" AND t.F_SchoolId = @F_SchoolId "); + } + if (!queryParam["Grade"].IsEmpty()) + { + dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String); + strSql.Append(" AND a.Grade = @Grade "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取ElectiveMajorOnline表实体数据 + /// 主键 + /// + /// + public ElectiveMajorOnlineEntity GetElectiveMajorOnlineEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList(string academicYearNo, string semester) + { + try + { + return this.BaseRepository("CollegeMIS").FindList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + if (keyValue.IndexOf(",") == -1) + { + db.Delete(x => x.Id == keyValue); + } + else + { + //多个删除 + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + db.Delete(t => t.Id == item); + } + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 批量删除 + /// + /// + /// + public void BatchDeleteEntity(string keyValue, string LIOEOId) + { + var db = this.BaseRepository("CollegeMIS"); + try + { + db.BeginTrans(); + if (LIOEOId.IndexOf(",") == -1) + { + if (keyValue.IndexOf(",") == -1) + { + db.Delete(x => x.Id == keyValue); + } + else + { + //多个删除 + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + db.Delete(t => t.Id == item); + } + } + } + else + { + var OLPOEIds = string.Join("','", LIOEOId.Split(',')); + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + var entity = db.FindEntity(item); + db.ExecuteBySql($"delete from ElectiveMajorOnline where MajorId='{entity.MajorId}' and Grade='{entity.Grade}' and LIOEOId in ('{OLPOEIds}')"); + } + } + + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, ElectiveMajorOnlineEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 扩展数据 + + /// + /// 设置选课专业 + /// + /// 专业列表 + /// 选修课主键 + public void SetElectiveMajorOnline(string keyValue, string olpoeId) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var now = DateTime.Now; + var loginInfo = LoginUserInfo.Get(); + //添加 + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + var entity = new ElectiveMajorOnlineEntity(); + entity.Create(); + entity.LIOEOId = olpoeId; + entity.MajorId = item; + entity.CreateUserId = loginInfo.userId; + entity.CreateUserName = loginInfo.realName; + entity.CreateDate = now; + db.Insert(entity); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 设置选课专业 + /// + /// 选中专业 + /// 选修课主键 + public void SetElectiveMajorOnline(List dataList, string olpoeId) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var loginInfo = LoginUserInfo.Get(); + + var OLPOEId_arr = olpoeId.Split(','); + //添加 + foreach (var item in dataList) + { + for (int i = 0; i < OLPOEId_arr.Length; i++) + { + var OLPOEId = OLPOEId_arr[i]; + var list = db.FindList(x => x.LIOEOId == OLPOEId); + //判断是否已选 + if (list.Where(x => x.MajorId == item.ID && x.Grade == item.Grade).Count() <= 0) + { + var entity = new ElectiveMajorOnlineEntity(); + entity.Create(); + entity.LIOEOId = OLPOEId;//olpoeId; + entity.MajorId = item.ID; + entity.Grade = item.Grade; + entity.CreateUserId = loginInfo.userId; + entity.CreateUserName = loginInfo.realName; + entity.CreateDate = DateTime.Now; + db.Insert(entity); + } + } + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + public class ElecticeMajorEntity + { + public string Id { get; set; } + public string MajorNo { get; set; } + public string Grade { get; set; } + } + public class ItemComparer : IEqualityComparer + { + public bool Equals(ElectiveMajorOnlineEntity x, ElectiveMajorOnlineEntity y) + { + if (x.Id == y.Id) + return true; + + return false; + } + + public int GetHashCode(ElectiveMajorOnlineEntity obj) + { + return obj.Id.GetHashCode(); + } + } + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineBLL.cs index d9fa9559c..508473bcd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineBLL.cs @@ -146,6 +146,54 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 设置可选/取消可选 + /// + /// + /// + public void SetUpIsAllowSelect(string keyValue, int IsAllowSelect) + { + try + { + lessonInfoOfElectiveOnlineService.SetUpIsAllowSelect(keyValue, IsAllowSelect); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 批量设置人数 + /// + /// + /// + public void SaveStuNumMax(string keyValue, int StuNumMax) + { + try + { + lessonInfoOfElectiveOnlineService.SaveStuNumMax(keyValue, StuNumMax); + } + 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/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineEntity.cs index 7c2a43aa7..48669b63d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineEntity.cs @@ -1,5 +1,6 @@ using Learun.Util; using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; namespace Learun.Application.TwoDevelopment.EducationalAdministration @@ -269,6 +270,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } #endregion #region 扩展字段 + + /// + /// 已报名人数 + /// + [NotMapped] + public int? StuNumOfApply { get; set; } + /// + /// 选课专业列表 + /// + [NotMapped] + public List ElectiveMajorOnlineList { get; set; } #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineIBLL.cs index 0dc23b21f..74258cac0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineIBLL.cs @@ -52,6 +52,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 void DoLock(string keyValue, string status); + /// + /// 设置可选/取消可选 + /// + /// + /// + void SetUpIsAllowSelect(string keyValue, int IsAllowSelect); + + /// + /// 批量设置人数 + /// + /// + /// + void SaveStuNumMax(string keyValue, int StuNumMax); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineService.cs index 1a3c1e19c..c65972529 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineService.cs @@ -4,6 +4,7 @@ using Learun.Util; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Text; namespace Learun.Application.TwoDevelopment.EducationalAdministration @@ -66,7 +67,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("CheckMark", queryParam["CheckMark"].ToString(), DbType.String); strSql.Append(" AND t.CheckMark = @CheckMark "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + var list = new List(); + list = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination).ToList(); + + //选课专业 + var majorSql = @"SELECT t.MajorName,t.MajorNo,a.* FROM ElectiveMajorOnline a left join CdMajor t on a.majorid=t.id"; + var electiveMajorOnlineList = this.BaseRepository("CollegeMIS").FindList(majorSql); + foreach (var item in list) + { + //模式二:正式选课 + var aa = this.BaseRepository("CollegeMIS").FindList(x => x.OLPEId == item.Id);//todo:改实体,改字段 + //已报名人数 + item.StuNumOfApply = aa.Where(x => (x.Status == 1 || x.Status == 2)).Count(); + //审核通过人数 + item.StuNum = aa.Where(x => x.Status == 2).Count(); + //选课专业 + item.ElectiveMajorOnlineList = electiveMajorOnlineList.Where(x => x.LIOEOId == item.Id).ToList(); + } + return list; } catch (Exception ex) { @@ -115,12 +133,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 public void DeleteEntity(string keyValue) { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { - this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue); + //单个删除 + //this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue); + + //批量删除 + foreach (var item in keyValue.Split(',')) + { + //删除选课专业 + db.ExecuteBySql($"delete from ElectiveMajorOnline where LIOEOId='{item}'"); + //删除选修课课程表 + db.ExecuteBySql($"delete from LessonInfoOfElectiveOnline where Id='{item}'"); + } + + db.Commit(); } catch (Exception ex) { + db.Rollback(); if (ex is ExceptionEx) { throw; @@ -177,7 +209,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - this.BaseRepository("CollegeMIS").ExecuteBySql($"update LessonInfoOfElectiveOnline set CheckMark='{status}' where Id='{keyValue}' "); + //单个启用 + //this.BaseRepository("CollegeMIS").ExecuteBySql($"update LessonInfoOfElectiveOnline set CheckMark='{status}' where Id='{keyValue}' "); + + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + + string sql = $"update LessonInfoOfElectiveOnline set IsAllowSelect='{status}' where Id in ('{keyValue}')"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } catch (Exception ex) { @@ -192,6 +233,63 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 设置可选/取消可选 + /// + /// + /// + public void SetUpIsAllowSelect(string keyValue, int IsAllowSelect) + { + try + { + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + + string sql = $"update LessonInfoOfElectiveOnline set IsAllowSelect='{IsAllowSelect}' where Id in ('{keyValue}')"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 批量设置人数 + /// + /// + /// + public void SaveStuNumMax(string keyValue, int StuNumMax) + { + try + { + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + this.BaseRepository("CollegeMIS").ExecuteBySql($"update LessonInfoOfElectiveOnline set StuNumMax='{StuNumMax}' where Id in ('{keyValue}')"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index f53437c44..baa4af633 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -91,6 +91,10 @@ + + + + From 315e790a4943749aeec4126de73be727bcf2bd7d Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Wed, 31 May 2023 16:01:41 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E8=B5=84=E4=BA=A7=E4=BC=98=E5=8C=96=EF=BC=9A?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E3=80=81=E4=BD=BF=E7=94=A8=E4=BA=BA=E4=B8=8E?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E9=83=A8=E9=97=A8=E8=81=94=E5=8A=A8=E3=80=81?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Ass_AssetsType/Index.js | 6 ++--- .../Views/Ass_FixAssets/Form.js | 26 +++++++++++++------ .../Views/Ass_FixAssets/FormView.js | 23 +++++++++++----- .../Views/Ass_FixAssets/Index.js | 3 ++- .../Views/Ass_FixAssets/IndexOfTeacher.js | 3 ++- 5 files changed, 41 insertions(+), 20 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsType/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsType/Index.js index aa84d516d..cf6cdc609 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsType/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsType/Index.js @@ -114,10 +114,10 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsType/GetList', headData: [ - { label: "资产类别编号", name: "ATCode", width: 200, align: "left" }, - { label: "资产类别名称", name: "AName", width: 200, align: "left" }, + { label: "资产分类编号", name: "ATCode", width: 200, align: "left" }, + { label: "资产分类名称", name: "AName", width: 200, align: "left" }, { - label: "上级资产类别", name: "ATPTId", width: 200, align: "left", + label: "上级资产分类", name: "ATPTId", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_AssetsType', diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Form.js index aea782ba9..8b2871aa1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Form.js @@ -64,13 +64,23 @@ var bootstrap = function ($, learun) { $('#ValueType').lrDataItemSelect({ code: 'ValueType' }); $('#GetWay').lrDataItemSelect({ code: 'GetWay' }); $('#UseCondition').lrDataItemSelect({ code: 'AssState' }); - $('#UseDepartment').lrDepartmentSelect(); + $('#UseDepartment').lrDepartmentSelect({ + select: function (item) { + $('#UsePeople').lrselectRefresh({ + url: top.$.rootUrl + '/LR_OrganizationModule/User/GetList', + param: { departmentId: item.value } + }); + } + }); $('#ManageDepartment').lrDepartmentSelect(); - $('#UsePeople').lrformselect({ - layerUrl: top.$.rootUrl + '/LR_OrganizationModule/User/SelectOnlyForm', - layerUrlW: 400, - layerUrlH: 300, - dataUrl: top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds' + $('#UsePeople').lrselect({ + value: 'F_UserId', + text: 'F_RealName', + title: 'F_RealName', + // 展开最大高度 + maxHeight: 110, + // 是否允许搜索 + allowSearch: true }); $('#Unit').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); $('#CardStatus').lrDataItemSelect({ code: 'CardStatus' }); @@ -160,7 +170,7 @@ var bootstrap = function ($, learun) { $('#NetValue').val(netValue); netValue == 0 ? $('#NetValue').attr('style', 'color:red;') : $('#NetValue').removeAttr('style'); }); - + //计算:价值数据=财政拨款 + 非财政拨款 let calcValue = function (a, b) { return Number(a) + Number(b); @@ -177,7 +187,7 @@ var bootstrap = function ($, learun) { let calcNetValue = function (a, b) { return (Number(a) - Number(b)) > 0 ? (Number(a) - Number(b)) : 0; } - + } }; // 设置表单数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/FormView.js index 0fa8a9adc..997545736 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/FormView.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/FormView.js @@ -64,13 +64,23 @@ var bootstrap = function ($, learun) { $('#ValueType').lrDataItemSelect({ code: 'ValueType' }); $('#GetWay').lrDataItemSelect({ code: 'GetWay' }); $('#UseCondition').lrDataItemSelect({ code: 'AssState' }); - $('#UseDepartment').lrDepartmentSelect(); + $('#UseDepartment').lrDepartmentSelect({ + select: function (item) { + $('#UsePeople').lrselectRefresh({ + url: top.$.rootUrl + '/LR_OrganizationModule/User/GetList', + param: { departmentId: item.value } + }); + } + }); $('#ManageDepartment').lrDepartmentSelect(); - $('#UsePeople').lrformselect({ - layerUrl: top.$.rootUrl + '/LR_OrganizationModule/User/SelectOnlyForm', - layerUrlW: 400, - layerUrlH: 300, - dataUrl: top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds' + $('#UsePeople').lrselect({ + value: 'F_UserId', + text: 'F_RealName', + title: 'F_RealName', + // 展开最大高度 + maxHeight: 110, + // 是否允许搜索 + allowSearch: true }); $('#Unit').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); $('#CardStatus').lrDataItemSelect({ code: 'CardStatus' }); @@ -182,7 +192,6 @@ var bootstrap = function ($, learun) { }; // 设置表单数据 setFormData = function (processId, param, callback) { - console.log('formview@'+processId); if (!!processId) { $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/Ass_FixAssets/GetFormDataByProcessId?processId=' + processId, function (data) { for (var id in data) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Index.js index c31dbc26c..d8111cf57 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Index.js @@ -392,7 +392,8 @@ var bootstrap = function ($, learun) { ], mainId: 'FAId', isPage: true, - sidx: 'CreateTime desc' + sidx: 'FACode,FAName', + sord:'asc' }); page.search(); }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/IndexOfTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/IndexOfTeacher.js index 5ff1b913a..8b5306efb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/IndexOfTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/IndexOfTeacher.js @@ -285,7 +285,8 @@ var bootstrap = function ($, learun) { ], mainId: 'FAId', isPage: true, - sidx: 'CreateTime desc' + sidx: 'FACode,FAName', + sord: 'asc' }); page.search(); }, From ecc217a53f8233bf6ef813aeffe3b474701171ee Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Wed, 31 May 2023 17:33:45 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E8=B5=84=E4=BA=A7=EF=BC=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E7=9A=84=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=92=8C=E4=BD=BF=E7=94=A8=E4=BA=BA=E8=81=94?= =?UTF-8?q?=E5=8A=A8=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Ass_FixAssets/Index.js | 19 +++++++++++++++++-- .../Views/Ass_FixAssets/IndexOfTeacher.js | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Index.js index d8111cf57..5a58174ce 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/Index.js @@ -37,9 +37,24 @@ var bootstrap = function ($, learun) { $('#ATId').lrselect({ allowSearch: true }); $('#GetWay').lrDataItemSelect({ code: 'GetWay' }); $('#UseCondition').lrDataItemSelect({ code: 'AssState' }); - $('#UseDepartment').lrDepartmentSelect(); + $('#UseDepartment').lrDepartmentSelect({ + select: function (item) { + $('#UsePeople').lrselectRefresh({ + url: top.$.rootUrl + '/LR_OrganizationModule/User/GetList', + param: { departmentId: item.value } + }); + } + }); $('#ManageDepartment').lrDepartmentSelect(); - $('#UsePeople').lrUserSelect(0); + $('#UsePeople').lrselect({ + value: 'F_UserId', + text: 'F_RealName', + title: 'F_RealName', + // 展开最大高度 + maxHeight: 110, + // 是否允许搜索 + allowSearch: true + }); $('#CardStatus').lrDataItemSelect({ code: 'CardStatus' }); $('#StorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' }); $('#DepreciationStatus').lrDataItemSelect({ code: 'DepreciationStatus' }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/IndexOfTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/IndexOfTeacher.js index 8b5306efb..563244fdc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/IndexOfTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_FixAssets/IndexOfTeacher.js @@ -36,9 +36,24 @@ var bootstrap = function ($, learun) { $('#ATId').lrselect({ allowSearch: true }); $('#GetWay').lrDataItemSelect({ code: 'GetWay' }); $('#UseCondition').lrDataItemSelect({ code: 'AssState' }); - $('#UseDepartment').lrDepartmentSelect(); + $('#UseDepartment').lrDepartmentSelect({ + select: function (item) { + $('#UsePeople').lrselectRefresh({ + url: top.$.rootUrl + '/LR_OrganizationModule/User/GetList', + param: { departmentId: item.value } + }); + } + }); $('#ManageDepartment').lrDepartmentSelect(); - $('#UsePeople').lrUserSelect(0); + $('#UsePeople').lrselect({ + value: 'F_UserId', + text: 'F_RealName', + title: 'F_RealName', + // 展开最大高度 + maxHeight: 110, + // 是否允许搜索 + allowSearch: true + }); $('#CardStatus').lrDataItemSelect({ code: 'CardStatus' }); $('#StorageId').lrDataSourceSelect({ code: 'Ass_StorageData', value: 'sid', text: 'sname' }); $('#DepreciationStatus').lrDataItemSelect({ code: 'DepreciationStatus' });