From d51b40f8478ddbc1c4c3c3d7d86f83171e701861 Mon Sep 17 00:00:00 2001 From: ndbs Date: Mon, 20 Feb 2023 18:05:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=B1=8D=E7=AE=A1=E7=90=86-=E5=A5=96?= =?UTF-8?q?=E5=8A=A9=E5=AD=A6=E9=87=91=E6=9F=A5=E7=9C=8B=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ScholarshipTranController.cs | 144 ++++++++++ .../QueryScholarshipIndex.cshtml | 61 ++++ .../StuTransferInfo/QueryScholarshipIndex.js | 126 +++++++++ .../Learun.Application.Web.csproj | 3 + .../ScholarshipTranMap.cs | 29 ++ .../Learun.Application.Mapping.csproj | 3 +- .../ScholarshipTran/ScholarshipTranBLL.cs | 153 +++++++++++ .../ScholarshipTran/ScholarshipTranEntity.cs | 117 ++++++++ .../ScholarshipTran/ScholarshipTranIBLL.cs | 55 ++++ .../ScholarshipTran/ScholarshipTranService.cs | 260 ++++++++++++++++++ .../Learun.Application.TwoDevelopment.csproj | 4 + 11 files changed, 954 insertions(+), 1 deletion(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ScholarshipTranController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/QueryScholarshipIndex.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/QueryScholarshipIndex.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ScholarshipTranMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ScholarshipTranController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ScholarshipTranController.cs new file mode 100644 index 000000000..f455aca39 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ScholarshipTranController.cs @@ -0,0 +1,144 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; +using System.Linq; +using System; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-09-27 10:33 + /// 描 述:学金类型 + /// + public class ScholarshipTranController : MvcControllerBase + { + private ScholarshipTranIBLL scholarshipTranIBLL = new ScholarshipTranBLL(); + + #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 = scholarshipTranIBLL.GetPageList(paginationobj, queryJson); + 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 ScholarshipData = scholarshipTranIBLL.GetScholarshipTranEntity(keyValue); + var jsonData = new + { + Scholarship = ScholarshipData, + }; + return Success(jsonData); + } + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList(string queryJson) + { + var data = scholarshipTranIBLL.GetList(queryJson); + + return Success(data); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + scholarshipTranIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + var LogUserinfo = LoginUserInfo.Get(); + ScholarshipTranEntity entity = strEntity.ToObject(); + if (string.IsNullOrEmpty(keyValue)) + { + entity.State = "0"; + } + if (entity.State != "0") + { + entity.AuditPeople = LogUserinfo.userId; + entity.AuditTime = DateTime.Today; + } + scholarshipTranIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + #endregion + + #region 扩展数据 + + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/QueryScholarshipIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/QueryScholarshipIndex.cshtml new file mode 100644 index 000000000..2e57af9a6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/QueryScholarshipIndex.cshtml @@ -0,0 +1,61 @@ +@{ + ViewBag.Title = "学籍异动列表"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+ @*
+
+
+
+
+
系部
+
+
+
+
专业
+
+
+
+
年级
+
+
+
+
班级
+
+
+
+
姓名
+ +
+
+
身份证号
+ +
+
+
学生编号
+ +
+
+
学籍号
+ +
+
+
+
+
*@ +
+
+ +
+
+
+
+ +
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuTransferInfo/QueryScholarshipIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/QueryScholarshipIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/QueryScholarshipIndex.js new file mode 100644 index 000000000..cb50bc7e4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/QueryScholarshipIndex.js @@ -0,0 +1,126 @@ +var refreshGirdData; +var StuId; +var tempdatra = new Array(); +var list = []; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.initGird2(); + page.bind(); + }, + bind: function () { + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGridLei({ + url: top.$.rootUrl + '/EducationalAdministration/ScholarshipTran/GetPageList', + headData: [ + { label: "学生", name: "StuName", width: 150, align: "left" }, + { label: "学生学号", name: "StuNo", width: 150, align: "left" }, + { label: "身份证号", name: "IdentityCardNo", width: 160, align: "left" }, + { + label: "班级", name: "ClassNo", width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { + label: "奖学金类型", name: "SchoolType", width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/EducationalAdministration/Scholarship/GetList?queryJson=' + JSON.stringify({ IsType: 0, IsValid: 0 }), + key: value, + keyId: 'Id', + callback: function (_data) { + callback(_data['ItemName']); + } + }); + } + }, + { + label: "获得时间", name: "GetTime", width: 150, align: "left", + formatter: function (cellvalue) { + return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + } + }, + ], + mainId: 'Id', + isPage: true, + }); + page.search(); + }, + initGird2: function () { + $('#gridtableTwo').lrAuthorizeJfGridLei({ + url: top.$.rootUrl + '/EducationalAdministration/ScholarshipTran/GetPageList', + headData: [ + { label: "学生", name: "StuName", width: 150, align: "left" }, + { label: "学生学号", name: "StuNo", width: 150, align: "left" }, + { label: "身份证号", name: "IdentityCardNo", width: 160, align: "left" }, + { + label: "班级", name: "ClassNo", width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { + label: "奖学金类型", name: "SchoolType", width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/EducationalAdministration/Scholarship/GetList?queryJson=' + JSON.stringify({ IsType: 0, IsValid: 0 }), + key: value, + keyId: 'Id', + callback: function (_data) { + callback(_data['ItemName']); + } + }); + } + }, + { + label: "获得时间", name: "GetTime", width: 150, align: "left", + formatter: function (cellvalue) { + return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + } + }, + ], + mainId: 'Id', + isPage: true, + }); + page.search2(); + }, + search: function (param) { + param = param || {}; + param.IsType = 0; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + }, + search2: function (param) { + param = param || {}; + param.IsType = 1; + $('#gridtableTwo').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + page.search2(); + }; + page.init(); +} \ No newline at end of file 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 5aa68124b..fe104ec01 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 @@ -349,6 +349,7 @@ + @@ -1365,6 +1366,7 @@ + @@ -8078,6 +8080,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ScholarshipTranMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ScholarshipTranMap.cs new file mode 100644 index 000000000..1754fe3b6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ScholarshipTranMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-09-27 10:33 + /// 描 述:学金类型 + /// + public class ScholarshipTranMap : EntityTypeConfiguration + { + public ScholarshipTranMap() + { + #region 表、主键 + //表 + this.ToTable("SCHOLARSHIPTRAN"); + //主键 + 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 fa50ce45e..685e5f2cf 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 @@ -1,4 +1,4 @@ - + @@ -107,6 +107,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranBLL.cs new file mode 100644 index 000000000..4444ad19e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranBLL.cs @@ -0,0 +1,153 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-09-27 10:33 + /// 描 述:学金类型 + /// + public class ScholarshipTranBLL : ScholarshipTranIBLL + { + private ScholarshipTranService ScholarshipTranService = new ScholarshipTranService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return ScholarshipTranService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取ScholarshipTran表实体数据 + /// + /// 主键 + /// + public ScholarshipTranEntity GetScholarshipTranEntity(string keyValue) + { + try + { + return ScholarshipTranService.GetScholarshipTranEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + return ScholarshipTranService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + ScholarshipTranService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, ScholarshipTranEntity entity) + { + try + { + ScholarshipTranService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 扩展数据 + + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranEntity.cs new file mode 100644 index 000000000..c67820b1e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranEntity.cs @@ -0,0 +1,117 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-09-27 10:33 + /// 描 述:学金类型 + /// + public class ScholarshipTranEntity + { + #region 实体成员 + /// + /// 主键 + /// + [Column("ID")] + public string Id { get; set; } + /// + /// 姓名 + /// + [Column("STUNAME")] + public string StuName { get; set; } + /// + /// 学号 + /// + [Column("STUNO")] + public string StuNo { get; set; } + /// + /// 班级 + /// + [Column("CLASSNO")] + public string ClassNo { get; set; } + /// + /// SchoolType + /// + [Column("SCHOOLTYPE")] + public string SchoolType { get; set; } + /// + /// 获得时间 /申请时间 + /// + [Column("GETTIME")] + public DateTime? GetTime { get; set; } + /// + /// 0奖学金 1助学金 + /// + [Column("ISTYPE")] + public string IsType { get; set; } + /// + /// 状态 0待审核 1 通过 2 不通过 + /// + [Column("STATE")] + public string State { get; set; } + /// + /// 审核人 + /// + [Column("AUDITPEOPLE")] + public string AuditPeople { get; set; } + /// + /// 审核时间 + /// + [Column("AUDITTIME")] + public DateTime? AuditTime { get; set; } + /// + /// 录入人 + /// + [Column("LRPEOPLE")] + public string LrPeople { get; set; } + /// + /// 录入时间 + /// + [Column("LRTIME")] + public DateTime? LrTime { get; set; } + /// + /// 附件 + /// + [Column("ATTACHMENTNAME")] + public string AttachmentName { get; set; } + /// + /// 备注 + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// 不同意原因 + /// + [Column("DEMO")] + public string Demo { 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 IdentityCardNo { get; set; } + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranIBLL.cs new file mode 100644 index 000000000..7003b1109 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranIBLL.cs @@ -0,0 +1,55 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-09-27 10:33 + /// 描 述:学金类型 + /// + public interface ScholarshipTranIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取ScholarshipTran表实体数据 + /// + /// 主键 + /// + ScholarshipTranEntity GetScholarshipTranEntity(string keyValue); + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + IEnumerable GetList(string queryJson); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, ScholarshipTranEntity entity); + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranService.cs new file mode 100644 index 000000000..f84ed4977 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ScholarshipTran/ScholarshipTranService.cs @@ -0,0 +1,260 @@ +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 V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-09-27 10:33 + /// 描 述:学金类型 + /// + public class ScholarshipTranService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" t.*,s.IdentityCardNo "); + strSql.Append(" FROM ScholarshipTran t "); + strSql.Append(" left join StuInfoBasic s on t.StuNo=s.StuNo "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["SchoolType"].IsEmpty()) + { + dp.Add("SchoolType", queryParam["SchoolType"].ToString(), DbType.String); + strSql.Append(" AND t.SchoolType = @SchoolType "); + } + if (!queryParam["StuName"].IsEmpty()) + { + dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuName Like @StuName "); + } + if (!queryParam["IsType"].IsEmpty()) + { + dp.Add("IsType", queryParam["IsType"].ToString(), DbType.String); + strSql.Append(" AND t.IsType = @IsType "); + } + if (!queryParam["State"].IsEmpty()) + { + dp.Add("State", queryParam["State"].ToString(), DbType.String); + strSql.Append(" AND t.State = @State "); + } + if (!queryParam["IdentityCardNo"].IsEmpty()) + { + dp.Add("IdentityCardNo", "%" + queryParam["IdentityCardNo"].ToString() + "%", DbType.String); + strSql.Append(" AND s.IdentityCardNo Like @IdentityCardNo "); + } + //var userlogin = LoginUserInfo.Get(); + //if (userlogin.Description == "学生") + //{ + // strSql.Append(" AND t.stuno = '" + userlogin.account + "' "); + //} + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取ScholarshipTran表实体数据 + /// + /// 主键 + /// + public ScholarshipTranEntity GetScholarshipTranEntity(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 queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.Id,t.GetTime,t.IsType,(case when t.State is not null then t.State else 0 end) as State "); + strSql.Append(" FROM ScholarshipTran t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["GetTime"].IsEmpty()) + { + dp.Add("GetTime", queryParam["GetTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND t.GetTime = @GetTime "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + 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 + { + //多个删除 + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + db.Delete(t => t.Id == item && t.State != "1"); + } + db.Commit(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, ScholarshipTranEntity 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 AuditEntity(string keyValue, string UserId) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + //多个审核 + var IdList = keyValue.Split(','); + foreach (var item in IdList) + { + var List = db.FindEntity(x => x.Id == item && x.State == "0"); + if (List != null) + { + List.State = "1"; + List.AuditTime = DateTime.Now; + List.AuditPeople = UserId; + db.Update(List); + } + } + db.Commit(); + } + 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 c7c1bd4df..6e26b839e 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 @@ -260,6 +260,10 @@ + + + +