From bf369fbca94cb982339debc4fed6d00b243cf080 Mon Sep 17 00:00:00 2001 From: ndbs Date: Wed, 2 Aug 2023 17:23:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=AE=89=E6=8E=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ActivityScheduleController.cs | 18 +- .../ActivityScheduleSienInController.cs | 121 ++++++++++ .../Views/ActivitySchedule/Index.cshtml | 12 +- .../Views/ActivitySchedule/Index.js | 38 +++- .../Views/ActivitySchedule/qrCode.cshtml | 26 +++ .../Views/ActivitySchedule/qrCode.js | 116 ++++++++++ .../Views/ActivityScheduleSienIn/Form.cshtml | 35 +++ .../Views/ActivityScheduleSienIn/Form.js | 38 ++++ .../Views/ActivityScheduleSienIn/Index.cshtml | 44 ++++ .../Views/ActivityScheduleSienIn/Index.js | 130 +++++++++++ .../Learun.Application.Web.csproj | 7 + .../ActivityScheduleApi.cs | 14 ++ .../Learun.Application.Mapping.csproj | 1 + .../ActivityScheduleSienInMap.cs | 29 +++ .../Learun.Application.TwoDevelopment.csproj | 4 + .../ActivitySchedule/ActivityScheduleBLL.cs | 18 ++ .../ActivitySchedule/ActivityScheduleIBLL.cs | 3 + .../ActivityScheduleService.cs | 67 +++++- .../ActivityScheduleSienInBLL.cs | 148 ++++++++++++ .../ActivityScheduleSienInEntity.cs | 80 +++++++ .../ActivityScheduleSienInIBLL.cs | 55 +++++ .../ActivityScheduleSienInService.cs | 210 ++++++++++++++++++ 22 files changed, 1191 insertions(+), 23 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ActivityScheduleSienInController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/qrCode.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/qrCode.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/PersonnelManagement/ActivityScheduleSienInMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ActivityScheduleController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ActivityScheduleController.cs index 5a0040fca..285f39d16 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ActivityScheduleController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ActivityScheduleController.cs @@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +35,12 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); + } + [HttpGet] + public ActionResult qrCode() + { + return View(); } #endregion @@ -82,8 +87,9 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var ActivityScheduleData = activityScheduleIBLL.GetActivityScheduleEntity( keyValue ); - var jsonData = new { + var ActivityScheduleData = activityScheduleIBLL.GetActivityScheduleEntity(keyValue); + var jsonData = new + { ActivitySchedule = ActivityScheduleData, }; return Success(jsonData); @@ -114,8 +120,8 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [AjaxOnly] public ActionResult SaveForm(string keyValue, string strEntity) { - UserInfo userInfo = LoginUserInfo.Get(); ActivityScheduleEntity entity = strEntity.ToObject(); - activityScheduleIBLL.SaveEntity(userInfo,keyValue,entity); + UserInfo userInfo = LoginUserInfo.Get(); ActivityScheduleEntity entity = strEntity.ToObject(); + activityScheduleIBLL.SaveEntity(userInfo, keyValue, entity); return Success("保存成功!"); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ActivityScheduleSienInController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ActivityScheduleSienInController.cs new file mode 100644 index 000000000..9f49d3c1f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ActivityScheduleSienInController.cs @@ -0,0 +1,121 @@ +using Learun.Application.TwoDevelopment.PersonnelManagement; +using Learun.Util; +using System.Data; +using System.Web.Mvc; + +namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-08-02 10:35 + /// 描 述:ActivityScheduleSienIn + /// + public class ActivityScheduleSienInController : MvcControllerBase + { + private ActivityScheduleSienInIBLL activityScheduleSienInIBLL = new ActivityScheduleSienInBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList( string queryJson ) + { + var data = activityScheduleSienInIBLL.GetList(queryJson); + return Success(data); + } + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = activityScheduleSienInIBLL.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 data = activityScheduleSienInIBLL.GetEntity(keyValue); + return Success(data); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + activityScheduleSienInIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue,ActivityScheduleSienInEntity entity) + { + activityScheduleSienInIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/Index.cshtml index d1780b192..ecf887aec 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/Index.cshtml @@ -2,7 +2,7 @@ ViewBag.Title = "活动安排"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+
@@ -11,8 +11,8 @@
@*
-
时间
-
*@ +
时间
+
*@
主题
@@ -26,9 +26,11 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/Index.js index c50bc456e..d30c10b9b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/Index.js @@ -62,17 +62,45 @@ var bootstrap = function ($, learun) { }); } }); + // 签到情况 + $('#lr_case').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'viewform', + title: '签到情况', + url: top.$.rootUrl + '/PersonnelManagement/ActivityScheduleSienIn/Index?ActyID=' + keyValue, + width: 1000, + height: 800, + btn: null + }); + } + }); + // 查看 + $('#lr_print').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'viewform', + title: '二维码', + url: top.$.rootUrl + '/PersonnelManagement/ActivitySchedule/qrCode?keyValue=' + keyValue, + width: 700, + height: 800, + btn: null + }); + } + }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/PersonnelManagement/ActivitySchedule/GetPageList', headData: [ - { label: "时间", name: "Date", width: 130, align: "left"}, - { label: "地点", name: "Address", width: 100, align: "left"}, - { label: "主题", name: "Title", width: 100, align: "left"}, - { label: "内容", name: "Content", width: 200, align: "left"}, - { label: "备注", name: "Remark", width: 100, align: "left"}, + { label: "时间", name: "Date", width: 150, align: "left"}, + { label: "地点", name: "Address", width: 150, align: "left"}, + { label: "主题", name: "Title", width: 150, align: "left"}, + { label: "内容", name: "Content", width: 150, align: "left"}, + { label: "备注", name: "Remark", width: 200, align: "left"}, ], mainId:'Id', isPage: true diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/qrCode.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/qrCode.cshtml new file mode 100644 index 000000000..fcf9d9c05 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/qrCode.cshtml @@ -0,0 +1,26 @@ +@{ + ViewBag.Title = "会议管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+ 打印 +
+
+
+
开始时间*
+ +
+
+
主题*
+ +
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/PersonnelManagement/Views/ActivitySchedule/qrCode.js") +@Html.AppendJsFile("/Content/jquery/jquery-1.10.2.min.js", "/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js", "/Content/js/qrcode.min.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/qrCode.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/qrCode.js new file mode 100644 index 000000000..6392b940b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivitySchedule/qrCode.js @@ -0,0 +1,116 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-02-21 10:07 + * 描 述:会议管理 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var bootstrap = function ($, learun) { + "use strict"; + // 设置权限 + setAuthorize = function (data) { + if (!!data) { + for (var field in data) { + if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 + $('#' + data[field].fieldId).parent().remove(); + } + else { + if (data[field].isEdit != 1) { + $('#' + data[field].fieldId).attr('disabled', 'disabled'); + if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { + $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); + $('#' + data[field].fieldId).find('.btn-success').remove(); + } + } + } + } + } + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + //$('#MeetingPlace').lrselect({ + // allowSearch: true, + // url: top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/GetList', + // value: "ID", + // text: "Name" + //}); + $('#subprint').on('click', function () { + $('#form').jqprint(); + }) + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/ActivitySchedule/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]); + } + //扫码签到 + makeCode(data[id].Id); + } + }); + } + } + }; + // 设置表单数据 + setFormData = function (processId, param, callback) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/ActivitySchedule/GetFormData?processId=' + processId, function (data) { + for (var id in data) { + if (!!data[id] && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + if (id == 'ActivitySchedule' && data[id]) { + keyValue = data[id].Id; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + callback && callback(); + } + // 验证数据是否填写完整 + validForm = function () { + if (!$('body').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + if (!!callBack) { + var res = { + code: 200, data: {} + }; + callBack(res, i); + } + }; + page.init(); +} +//扫码签到 +var qrcode = new QRCode(document.getElementById("qrCode"), { + width: 550, + height: 550 +}); +function makeCode(urls) { + qrcode.makeCode(urls); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Form.cshtml new file mode 100644 index 000000000..a90aea5d3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Form.cshtml @@ -0,0 +1,35 @@ +@{ + ViewBag.Title = "ActivityScheduleSienIn"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
ID*
+ +
+
+
ASID*
+ +
+
+
TeachOrStu*
+ +
+
+
SignInUserId*
+ +
+
+
SignInUserName*
+ +
+
+
IsSignIn*
+ +
+
+
SignInTime*
+ +
+
+@Html.AppendJsFile("/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Form.js new file mode 100644 index 000000000..650e3362e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Form.js @@ -0,0 +1,38 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-08-02 10:35 + * 描 述:ActivityScheduleSienIn + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var selectedRow = learun.frameTab.currentIframe().selectedRow; + var page = { + init: function () { + page.initData(); + }, + bind: function () { + }, + initData: function () { + if (!!selectedRow) { + $('#form').lrSetFormData(selectedRow); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(); + $.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/ActivityScheduleSienIn/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Index.cshtml new file mode 100644 index 000000000..33dfa580e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Index.cshtml @@ -0,0 +1,44 @@ +@{ + ViewBag.Title = "ActivityScheduleSienIn"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+ @*
+
+
*@ +
+
+
+ @*
+
教师或学生
+
+
*@ +
+
签到用户
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Index.js new file mode 100644 index 000000000..fc2795430 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ActivityScheduleSienIn/Index.js @@ -0,0 +1,130 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-08-02 10:35 + * 描 述:ActivityScheduleSienIn + */ +var refreshGirdData; +var ActyID = request('ActyID');//会议ID +var bootstrap = function ($, learun) { + "use strict"; + var startTime; + var endTime; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); + // 查询 + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/PersonnelManagement/ActivityScheduleSienIn/Form', + width: 700, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/PersonnelManagement/ActivityScheduleSienIn/Form?keyValue=' + keyValue, + width: 700, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ActivityScheduleSienIn/DeleteForm', { keyValue: keyValue }, function () { + }); + } + }); + } + }); + }, + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/PersonnelManagement/ActivityScheduleSienIn/GetPageList', + headData: [ + //{ label: '教师或学生', name: 'TeachOrStu', width: 200, align: "left" }, + //{ label: 'SignInUserName', name: 'SignInUserName', width: 200, align: "left" }, + { + label: '签到时间', name: 'SignInTime', width: 200, align: "left" + }, + { label: '签到用户', name: 'SignInUserId', width: 200, align: "left" }, + { + label: '是否签到', name: 'IsSignIn', width: 200, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "已签到" : "未签到"; + } + }, + ], + mainId: 'ID', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; + param.ActyID = ActyID; + $('#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 41e3c507e..40883b049 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 @@ -904,6 +904,7 @@ + @@ -1856,6 +1857,7 @@ + @@ -7115,6 +7117,10 @@ + + + + @@ -8119,6 +8125,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PersonnelManagement/ActivityScheduleApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PersonnelManagement/ActivityScheduleApi.cs index dd0a43112..8cfa8a2c7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PersonnelManagement/ActivityScheduleApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PersonnelManagement/ActivityScheduleApi.cs @@ -26,6 +26,7 @@ namespace Learun.Application.WebApi Get["/form"] = GetForm; Post["/delete"] = DeleteForm; Post["/save"] = SaveForm; + Get["/scan"] = Scan; } #region 获取数据 @@ -99,6 +100,13 @@ namespace Learun.Application.WebApi activityScheduleIBLL.SaveEntity(this.userInfo,parameter.keyValue,entity); return Success("保存成功!"); } + + public Response Scan(dynamic _) + { + ScanParam scanParam = this.GetReqData(); + var result = activityScheduleIBLL.Scan(scanParam.userid, scanParam.dcitid); + return Success(new { result }); + } #endregion #region 私有类 @@ -110,6 +118,12 @@ namespace Learun.Application.WebApi public string keyValue { get; set; } public string strEntity{ get; set; } } + + private class ScanParam + { + public string userid { get; set; } + public string dcitid { get; set; } + } #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 63777aa80..1bd3ab21d 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 @@ -663,6 +663,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/PersonnelManagement/ActivityScheduleSienInMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/PersonnelManagement/ActivityScheduleSienInMap.cs new file mode 100644 index 000000000..07b820454 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/PersonnelManagement/ActivityScheduleSienInMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.PersonnelManagement; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-08-02 10:35 + /// 描 述:ActivityScheduleSienIn + /// + public class ActivityScheduleSienInMap : EntityTypeConfiguration + { + public ActivityScheduleSienInMap() + { + #region 表、主键 + //表 + this.ToTable("ACTIVITYSCHEDULESIENIN"); + //主键 + this.HasKey(t => t.ID); + #endregion + + #region 配置关系 + #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 74789d1e5..0d58d3f8e 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 @@ -2072,6 +2072,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivitySchedule/ActivityScheduleBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivitySchedule/ActivityScheduleBLL.cs index ae9bd5b11..0f2c61ade 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivitySchedule/ActivityScheduleBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivitySchedule/ActivityScheduleBLL.cs @@ -143,6 +143,24 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + public string Scan(string scanParamUserid, string scanDutyid) + { + try + { + return activityScheduleService.Scan(scanParamUserid, scanDutyid); + } + 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/PersonnelManagement/ActivitySchedule/ActivityScheduleIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivitySchedule/ActivityScheduleIBLL.cs index beaa76ec7..5163a0291 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivitySchedule/ActivityScheduleIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivitySchedule/ActivityScheduleIBLL.cs @@ -50,6 +50,9 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// /// void SaveEntity(UserInfo userInfo, string keyValue, ActivityScheduleEntity entity); + + string Scan(string scanParamUserid, string scanParamDciyid); + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivitySchedule/ActivityScheduleService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivitySchedule/ActivityScheduleService.cs index d28d2a290..284b5b815 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivitySchedule/ActivityScheduleService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivitySchedule/ActivityScheduleService.cs @@ -39,7 +39,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement var dp = new DynamicParameters(new { }); if (!queryParam["Date"].IsEmpty()) { - dp.Add("Date",queryParam["Date"].ToString(), DbType.String); + dp.Add("Date", queryParam["Date"].ToString(), DbType.String); strSql.Append(" AND t.Date = @Date "); } if (!queryParam["Title"].IsEmpty()) @@ -47,7 +47,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement dp.Add("Title", "%" + queryParam["Title"].ToString() + "%", DbType.String); strSql.Append(" AND t.Title Like @Title "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -81,7 +81,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement var dp = new DynamicParameters(new { }); if (!queryParam["Date"].IsEmpty()) { - dp.Add("Date",queryParam["Date"].ToString(), DbType.String); + dp.Add("Date", queryParam["Date"].ToString(), DbType.String); strSql.Append(" AND t.Date = @Date "); } if (!queryParam["Title"].IsEmpty()) @@ -89,7 +89,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement dp.Add("Title", "%" + queryParam["Title"].ToString() + "%", DbType.String); strSql.Append(" AND t.Title Like @Title "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); } catch (Exception ex) { @@ -141,7 +141,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.Id == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue); } catch (Exception ex) { @@ -161,13 +161,13 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 主键 /// /// - public void SaveEntity( UserInfo userInfo, string keyValue, ActivityScheduleEntity entity) + public void SaveEntity(UserInfo userInfo, string keyValue, ActivityScheduleEntity entity) { try { if (!string.IsNullOrEmpty(keyValue)) { - entity.Modify(keyValue,userInfo); + entity.Modify(keyValue, userInfo); this.BaseRepository("CollegeMIS").Update(entity); } else @@ -189,6 +189,59 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + public string Scan(string scanParamUserid, string scanParamDutyid) + { + try + { + var result = ""; + var DutyEntity = this.BaseRepository("CollegeMIS").FindEntity(a => a.Id == scanParamDutyid); + if (DutyEntity != null) + { + var signInEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ASID == scanParamDutyid && x.SignInUserId == scanParamUserid); + var date = DateTime.Now; + DateTime BeginTime = DutyEntity.Date.ToDate(); + if (date.Subtract(BeginTime).Duration().Minutes <= 5 && BeginTime > date) + { + var signInInster = new ActivityScheduleSienInEntity + { + ASID = scanParamDutyid, + SignInTime = date, + SignInUserId = scanParamUserid, + SignInUserName = LoginUserInfo.Get().realName, + IsSignIn = true, + TeachOrStu = LoginUserInfo.Get().Description.ToString() == "教师" ? 0 : 1 + }; + signInInster.Create(); + this.BaseRepository("CollegeMIS").Insert(signInInster); + result = "签到成功"; + } + else if (BeginTime > date) + { + result = "签到未开始,签到失败"; + } + else + { + result = "签到失败!!!签到已开始"; + } + } + else + { + result = "签到失败!!!当前用户不可签到"; + } + return result; + } + 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/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInBLL.cs new file mode 100644 index 000000000..037e8a712 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInBLL.cs @@ -0,0 +1,148 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.PersonnelManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-08-02 10:35 + /// 描 述:ActivityScheduleSienIn + /// + public class ActivityScheduleSienInBLL : ActivityScheduleSienInIBLL + { + private ActivityScheduleSienInService activityScheduleSienInService = new ActivityScheduleSienInService(); + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList( string queryJson ) + { + try + { + return activityScheduleSienInService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return activityScheduleSienInService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取实体数据 + /// + /// 主键 + /// + public ActivityScheduleSienInEntity GetEntity(string keyValue) + { + try + { + return activityScheduleSienInService.GetEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + activityScheduleSienInService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, ActivityScheduleSienInEntity entity) + { + try + { + activityScheduleSienInService.SaveEntity(keyValue, entity); + } + 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/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInEntity.cs new file mode 100644 index 000000000..b453bb444 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInEntity.cs @@ -0,0 +1,80 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; +namespace Learun.Application.TwoDevelopment.PersonnelManagement + +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-08-02 10:35 + /// 描 述:ActivityScheduleSienIn + /// + public class ActivityScheduleSienInEntity + { + #region 实体成员 + /// + /// ID + /// + /// + [Column("ID")] + public string ID { get; set; } + /// + /// ASID + /// + /// + [Column("ASID")] + public string ASID { get; set; } + /// + /// TeachOrStu + /// + /// + [Column("TEACHORSTU")] + public int? TeachOrStu { get; set; } + /// + /// SignInUserId + /// + /// + [Column("SIGNINUSERID")] + public string SignInUserId { get; set; } + /// + /// SignInUserName + /// + /// + [Column("SIGNINUSERNAME")] + public string SignInUserName { get; set; } + /// + /// IsSignIn + /// + /// + [Column("ISSIGNIN")] + public bool? IsSignIn { get; set; } + /// + /// SignInTime + /// + /// + [Column("SIGNINTIME")] + public DateTime? SignInTime { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.ID = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.ID = keyValue; + } + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInIBLL.cs new file mode 100644 index 000000000..98e4793de --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInIBLL.cs @@ -0,0 +1,55 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.PersonnelManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-08-02 10:35 + /// 描 述:ActivityScheduleSienIn + /// + public interface ActivityScheduleSienInIBLL + { + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 查询参数 + /// + IEnumerable GetList( string queryJson ); + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取实体数据 + /// + /// 主键 + /// + ActivityScheduleSienInEntity GetEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, ActivityScheduleSienInEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInService.cs new file mode 100644 index 000000000..c8d7e3a51 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ActivityScheduleSienIn/ActivityScheduleSienInService.cs @@ -0,0 +1,210 @@ +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.PersonnelManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-08-02 10:35 + /// 描 述:ActivityScheduleSienIn + /// + public class ActivityScheduleSienInService : RepositoryFactory + { + #region 构造函数和属性 + + private string fieldSql; + /// + /// 构造方法 + /// + public ActivityScheduleSienInService() + { + fieldSql = @" + t.ID, + t.ASID, + t.TeachOrStu, + t.SignInUserId, + t.SignInUserName, + t.IsSignIn, + t.SignInTime + "; + } + #endregion + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 条件参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + //参考写法 + //var queryParam = queryJson.ToJObject(); + // 虚拟参数 + //var dp = new DynamicParameters(new { }); + //dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(fieldSql); + strSql.Append(" FROM ActivityScheduleSienIn t "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 条件参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(fieldSql); + strSql.Append(" FROM ActivityScheduleSienIn t "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["ActyID"].IsEmpty()) + { + dp.Add("ActyID", queryParam["ActyID"].ToString(), DbType.String); + strSql.Append(" AND t.ASID = @ActyID "); + } + if (!queryParam["SignInUserName"].IsEmpty()) + { + dp.Add("SignInUserName", "%" + queryParam["SignInUserName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.SignInUserName Like @SignInUserName "); + } + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( t.SignInTime >= @startTime AND t.SignInTime <= @endTime ) "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取实体数据 + /// + /// 主键 + /// + public ActivityScheduleSienInEntity GetEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, ActivityScheduleSienInEntity 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 + + } +}