From 5ba84b8bc411187c17ee8e5fc2175f33a0f1c498 Mon Sep 17 00:00:00 2001 From: hwh2023 <598694955@qq.com> Date: Sat, 7 Oct 2023 16:47:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Notice_Train_TeamsController.cs | 120 +++++++++++ .../Ask/Views/Notice_Train_Teams/Form.cshtml | 39 ++++ .../Ask/Views/Notice_Train_Teams/Form.js | 62 ++++++ .../Ask/Views/Notice_Train_Teams/Index.cshtml | 26 +++ .../Ask/Views/Notice_Train_Teams/Index.js | 111 ++++++++++ .../Learun.Application.Web.csproj | 5 + .../Ask/NoticeLog_Train_TeamsMap.cs | 29 +++ .../Ask/Notice_Train_TeamsMap.cs | 29 +++ .../Learun.Application.Mapping.csproj | 2 + .../NoticeLog_Train_TeamsEntity.cs | 62 ++++++ .../Notice_Train_TeamsBLL.cs | 149 ++++++++++++++ .../Notice_Train_TeamsEntity.cs | 104 ++++++++++ .../Notice_Train_TeamsIBLL.cs | 54 +++++ .../Notice_Train_TeamsService.cs | 192 ++++++++++++++++++ .../Learun.Application.TwoDevelopment.csproj | 5 + 15 files changed, 989 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_TeamsController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Ask/NoticeLog_Train_TeamsMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Ask/Notice_Train_TeamsMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/NoticeLog_Train_TeamsEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_TeamsController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_TeamsController.cs new file mode 100644 index 000000000..053dee708 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_TeamsController.cs @@ -0,0 +1,120 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.Ask; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.Ask.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-09-28 14:30 + /// 描 述:运动对集训安排 + /// + public class Notice_Train_TeamsController : MvcControllerBase + { + private Notice_Train_TeamsIBLL notice_Train_TeamsIBLL = new Notice_Train_TeamsBLL(); + + #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 = notice_Train_TeamsIBLL.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 Notice_Train_TeamsData = notice_Train_TeamsIBLL.GetNotice_Train_TeamsEntity( keyValue ); + var NoticeLog_Train_TeamsData = notice_Train_TeamsIBLL.GetNoticeLog_Train_TeamsEntity( Notice_Train_TeamsData.T_id ); + var jsonData = new { + Notice_Train_Teams = Notice_Train_TeamsData, + NoticeLog_Train_Teams = NoticeLog_Train_TeamsData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + notice_Train_TeamsIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity, string strnoticeLog_Train_TeamsEntity) + { + Notice_Train_TeamsEntity entity = strEntity.ToObject(); + NoticeLog_Train_TeamsEntity noticeLog_Train_TeamsEntity = strnoticeLog_Train_TeamsEntity.ToObject(); + notice_Train_TeamsIBLL.SaveEntity(keyValue,entity,noticeLog_Train_TeamsEntity); + if (keyValue != null) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Form.cshtml new file mode 100644 index 000000000..b99463dff --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Form.cshtml @@ -0,0 +1,39 @@ +@{ + ViewBag.Title = "运动对集训安排"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
标题*
+ +
+
+
类别
+
+
+
+
发布时间*
+ +
+
+
信息来源
+ +
+
+
来源地址
+ +
+
+
下发部门
+
+
+
+
附件上传
+
+
+
+
内容*
+ +
+
+@Html.AppendJsFile("/Areas/Ask/Views/Notice_Train_Teams/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Form.js new file mode 100644 index 000000000..001c83a27 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Form.js @@ -0,0 +1,62 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-09-28 14:30 + * 描 述:运动对集训安排 + */ +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 () { + $('#T_type').lrRadioCheckbox({ + type: 'radio', + code: '', + }); + $('#Noticedept').lrRadioCheckbox({ + type: 'checkbox', + dataType: 'dataSource', + code: 'classdata', + value: 'id', + text: 'name', + }); + $('#Files').lrUploader(); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/Ask/Notice_Train_Teams/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 = {}; + postData.strEntity = JSON.stringify($('[data-table="Notice_Train_Teams"]').lrGetFormData()); + postData.strnoticeLog_Train_TeamsEntity = JSON.stringify($('[data-table="NoticeLog_Train_Teams"]').lrGetFormData()); + $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_Train_Teams/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Index.cshtml new file mode 100644 index 000000000..c3a065c8b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Index.cshtml @@ -0,0 +1,26 @@ +@{ + ViewBag.Title = "运动对集训安排"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/Ask/Views/Notice_Train_Teams/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Index.js new file mode 100644 index 000000000..2d7af5ccb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Teams/Index.js @@ -0,0 +1,111 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-09-28 14:30 + * 描 述:运动对集训安排 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/Ask/Notice_Train_Teams/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('BelongId'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/Ask/Notice_Train_Teams/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('BelongId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/Ask/Notice_Train_Teams/DeleteForm', { keyValue: keyValue}, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/Ask/Notice_Train_Teams/GetPageList', + headData: [ + { label: "标题", name: "T_title", width: 100, align: "left"}, + { label: "类别", name: "T_type", width: 100, align: "left", + formatterAsync: function (callback, value, row, op,$cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: '', + callback: function (_data) { + callback(_data.text); + } + }); + }}, + { label: "发布时间", name: "Createtime", width: 100, align: "left"}, + { label: "信息来源", name: "Source", width: 100, align: "left"}, + { label: "来源地址", name: "SourceUrl", width: 100, align: "left"}, + { label: "下发部门", name: "Noticedept", width: 100, align: "left", + formatterAsync: function (callback, value, row, op,$cell) { + learun.clientdata.getsAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', + key: value, + keyId: 'id', + textId: 'name', + callback: function (text) { + callback(text); + } + }); + }}, + { label: "附件上传", name: "Files", width: 100, align: "left"}, + { label: "内容", name: "T_Content", width: 100, align: "left"}, + ], + mainId:'BelongId', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + 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 12a27cd53..739c78688 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 @@ -896,6 +896,7 @@ + @@ -6853,6 +6854,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Ask/NoticeLog_Train_TeamsMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Ask/NoticeLog_Train_TeamsMap.cs new file mode 100644 index 000000000..e6cf3826b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Ask/NoticeLog_Train_TeamsMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.Ask; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-09-28 14:30 + /// 描 述:运动对集训安排 + /// + public class NoticeLog_Train_TeamsMap : EntityTypeConfiguration + { + public NoticeLog_Train_TeamsMap() + { + #region 表、主键 + //表 + this.ToTable("NOTICELOG_TRAIN_TEAMS"); + //主键 + this.HasKey(t => t.N_id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Ask/Notice_Train_TeamsMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Ask/Notice_Train_TeamsMap.cs new file mode 100644 index 000000000..9263f525d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Ask/Notice_Train_TeamsMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.Ask; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-09-28 14:30 + /// 描 述:运动对集训安排 + /// + public class Notice_Train_TeamsMap : EntityTypeConfiguration + { + public Notice_Train_TeamsMap() + { + #region 表、主键 + //表 + this.ToTable("NOTICE_TRAIN_TEAMS"); + //主键 + this.HasKey(t => 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 753a63411..18d12646d 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 @@ -626,6 +626,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/NoticeLog_Train_TeamsEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/NoticeLog_Train_TeamsEntity.cs new file mode 100644 index 000000000..8982fc732 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/NoticeLog_Train_TeamsEntity.cs @@ -0,0 +1,62 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.Ask +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-09-28 14:30 + /// 描 述:运动对集训安排 + /// + public class NoticeLog_Train_TeamsEntity + { + #region 实体成员 + /// + /// L_id + /// + [Column("L_ID")] + public string L_id { get; set; } + /// + /// N_id + /// + [Column("N_ID")] + public string N_id { get; set; } + /// + /// Userid + /// + [Column("USERID")] + public string Userid { get; set; } + /// + /// Status + /// + [Column("STATUS")] + public int? Status { get; set; } + /// + /// Createtime + /// + [Column("CREATETIME")] + public DateTime? Createtime { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.L_id = keyValue; + } + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsBLL.cs new file mode 100644 index 000000000..ca256dd09 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsBLL.cs @@ -0,0 +1,149 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.Ask +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-09-28 14:30 + /// 描 述:运动对集训安排 + /// + public class Notice_Train_TeamsBLL : Notice_Train_TeamsIBLL + { + private Notice_Train_TeamsService notice_Train_TeamsService = new Notice_Train_TeamsService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return notice_Train_TeamsService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Notice_Train_Teams表实体数据 + /// + /// 主键 + /// + public Notice_Train_TeamsEntity GetNotice_Train_TeamsEntity(string keyValue) + { + try + { + return notice_Train_TeamsService.GetNotice_Train_TeamsEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取NoticeLog_Train_Teams表实体数据 + /// + /// 主键 + /// + public NoticeLog_Train_TeamsEntity GetNoticeLog_Train_TeamsEntity(string keyValue) + { + try + { + return notice_Train_TeamsService.GetNoticeLog_Train_TeamsEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + notice_Train_TeamsService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Notice_Train_TeamsEntity entity,NoticeLog_Train_TeamsEntity noticeLog_Train_TeamsEntity) + { + try + { + notice_Train_TeamsService.SaveEntity(keyValue, entity,noticeLog_Train_TeamsEntity); + } + 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/Ask/Notice_Train_Teams/Notice_Train_TeamsEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsEntity.cs new file mode 100644 index 000000000..15e1f52da --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsEntity.cs @@ -0,0 +1,104 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.Ask +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-09-28 14:30 + /// 描 述:运动对集训安排 + /// + public class Notice_Train_TeamsEntity + { + #region 实体成员 + /// + /// T_id + /// + [Column("T_ID")] + public string T_id { get; set; } + /// + /// T_type + /// + [Column("T_TYPE")] + public string T_type { get; set; } + /// + /// T_title + /// + [Column("T_TITLE")] + public string T_title { get; set; } + /// + /// Source + /// + [Column("SOURCE")] + public string Source { get; set; } + /// + /// SourceUrl + /// + [Column("SOURCEURL")] + public string SourceUrl { get; set; } + /// + /// Files + /// + [Column("FILES")] + public string Files { get; set; } + /// + /// T_Content + /// + [Column("T_CONTENT")] + public string T_Content { get; set; } + /// + /// Noticedept + /// + [Column("NOTICEDEPT")] + public string Noticedept { get; set; } + /// + /// Noticepeople + /// + [Column("NOTICEPEOPLE")] + public string Noticepeople { get; set; } + /// + /// Createtime + /// + [Column("CREATETIME")] + public DateTime? Createtime { get; set; } + /// + /// Updatetime + /// + [Column("UPDATETIME")] + public DateTime? Updatetime { get; set; } + /// + /// Creator + /// + [Column("CREATOR")] + public string Creator { get; set; } + /// + /// Status + /// + [Column("STATUS")] + public int? Status { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.T_id = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsIBLL.cs new file mode 100644 index 000000000..01b4b37da --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsIBLL.cs @@ -0,0 +1,54 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.Ask +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-09-28 14:30 + /// 描 述:运动对集训安排 + /// + public interface Notice_Train_TeamsIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取Notice_Train_Teams表实体数据 + /// + /// 主键 + /// + Notice_Train_TeamsEntity GetNotice_Train_TeamsEntity(string keyValue); + /// + /// 获取NoticeLog_Train_Teams表实体数据 + /// + /// 主键 + /// + NoticeLog_Train_TeamsEntity GetNoticeLog_Train_TeamsEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Notice_Train_TeamsEntity entity,NoticeLog_Train_TeamsEntity noticeLog_Train_TeamsEntity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsService.cs new file mode 100644 index 000000000..a4d0423fd --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Teams/Notice_Train_TeamsService.cs @@ -0,0 +1,192 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.Ask +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-09-28 14:30 + /// 描 述:运动对集训安排 + /// + public class Notice_Train_TeamsService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.BelongId, + t.T_title, + t.T_type, + t.Createtime, + t.Source, + t.SourceUrl, + t.Noticedept, + t.Files, + t.T_Content + "); + strSql.Append(" FROM Notice_Train_Teams t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Notice_Train_Teams表实体数据 + /// + /// 主键 + /// + public Notice_Train_TeamsEntity GetNotice_Train_TeamsEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue.ToInt()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取NoticeLog_Train_Teams表实体数据 + /// + /// 主键 + /// + public NoticeLog_Train_TeamsEntity GetNoticeLog_Train_TeamsEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(t=>t.N_id == keyValue); + } + 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 notice_Train_TeamsEntity = GetNotice_Train_TeamsEntity(keyValue); + db.Delete(t=>t.T_id == keyValue); + db.Delete(t=>t.N_id == notice_Train_TeamsEntity.T_id); + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Notice_Train_TeamsEntity entity,NoticeLog_Train_TeamsEntity noticeLog_Train_TeamsEntity) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + if (keyValue != null) + { + var notice_Train_TeamsEntityTmp = GetNotice_Train_TeamsEntity(keyValue); + entity.Modify(keyValue); + db.Update(entity); + db.Delete(t=>t.N_id == notice_Train_TeamsEntityTmp.T_id); + noticeLog_Train_TeamsEntity.Create(); + noticeLog_Train_TeamsEntity.N_id = notice_Train_TeamsEntityTmp.T_id; + db.Insert(noticeLog_Train_TeamsEntity); + } + else + { + entity.Create(); + db.Insert(entity); + noticeLog_Train_TeamsEntity.Create(); + noticeLog_Train_TeamsEntity.N_id = entity.T_id; + db.Insert(noticeLog_Train_TeamsEntity); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + 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 59a519f68..e9fccc771 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 @@ -1929,6 +1929,11 @@ + + + + +