@@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -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<ActivityScheduleEntity>(); | |||
activityScheduleIBLL.SaveEntity(userInfo,keyValue,entity); | |||
UserInfo userInfo = LoginUserInfo.Get(); ActivityScheduleEntity entity = strEntity.ToObject<ActivityScheduleEntity>(); | |||
activityScheduleIBLL.SaveEntity(userInfo, keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
@@ -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 | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2023-08-02 10:35 | |||
/// 描 述:ActivityScheduleSienIn | |||
/// </summary> | |||
public class ActivityScheduleSienInController : MvcControllerBase | |||
{ | |||
private ActivityScheduleSienInIBLL activityScheduleSienInIBLL = new ActivityScheduleSienInBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetList( string queryJson ) | |||
{ | |||
var data = activityScheduleSienInIBLL.GetList(queryJson); | |||
return Success(data); | |||
} | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = activityScheduleSienInIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var data = activityScheduleSienInIBLL.GetEntity(keyValue); | |||
return Success(data); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
activityScheduleSienInIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue,ActivityScheduleSienInEntity entity) | |||
{ | |||
activityScheduleSienInIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
ViewBag.Title = "活动安排"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
@@ -11,8 +11,8 @@ | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
@*<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">时间</div> | |||
</div>*@ | |||
<div class="lr-form-item-title">时间</div> | |||
</div>*@ | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">主题</div> | |||
<input id="Title" type="text" class="form-control" /> | |||
@@ -26,9 +26,11 @@ | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 二维码</a> | |||
<a id="lr_case" class="btn btn-default"><i class="fa fa-plus"></i> 签到情况</a> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -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 | |||
@@ -0,0 +1,26 @@ | |||
@{ | |||
ViewBag.Title = "会议管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<script src="~/Content/jquery/qrcode.min.js"></script> | |||
<div id="subprint" style="margin:0 auto;cursor:pointer;margin-bottom:10px; position:relative; width:80px; height:28px;line-height:28px;border-radius:4px; background:#039cfd;color:#FFF;text-align:center;"> | |||
打印 | |||
</div> | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-6 lr-form-item" data-table="ActivitySchedule"> | |||
<div class="lr-form-item-title">开始时间<font face="宋体">*</font></div> | |||
<input id="Date" type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" data-dateFmt="yyyy-MM-dd HH:mm:ss" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="ActivitySchedule"> | |||
<div class="lr-form-item-title">主题<font face="宋体">*</font></div> | |||
<input id="Title" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="ActivitySchedule"> | |||
</div> | |||
<div class="col lr-form-item" data-table="ActivitySchedule"> | |||
<div id="qrCode" style="text-align:center"></div> | |||
</div> | |||
</div> | |||
@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") |
@@ -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); | |||
} |
@@ -0,0 +1,35 @@ | |||
@{ | |||
ViewBag.Title = "ActivityScheduleSienIn"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">ID<font face="宋体">*</font></div> | |||
<input id="ID" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">ASID<font face="宋体">*</font></div> | |||
<input id="ASID" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">TeachOrStu<font face="宋体">*</font></div> | |||
<input id="TeachOrStu" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">SignInUserId<font face="宋体">*</font></div> | |||
<input id="SignInUserId" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">SignInUserName<font face="宋体">*</font></div> | |||
<input id="SignInUserName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">IsSignIn<font face="宋体">*</font></div> | |||
<input id="IsSignIn" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">SignInTime<font face="宋体">*</font></div> | |||
<input id="SignInTime" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/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(); | |||
} |
@@ -0,0 +1,44 @@ | |||
@{ | |||
ViewBag.Title = "ActivityScheduleSienIn"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout"> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
@*<div class="lr-layout-tool-item"> | |||
<div id="datesearch"></div> | |||
</div>*@ | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
@*<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">教师或学生</div> | |||
<div id="TeachOrStu"></div> | |||
</div>*@ | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">签到用户</div> | |||
<input id="SignInUserName" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/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(); | |||
} |
@@ -904,6 +904,7 @@ | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuScoreTranController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuScoreNotPassTranController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuScoreNotPassTwoTranController.cs" /> | |||
<Compile Include="Areas\PersonnelManagement\Controllers\ActivityScheduleSienInController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | |||
@@ -1856,6 +1857,7 @@ | |||
<Content Include="Areas\LR_TaskScheduling\Views\TSScheme\SelectExpressForm.css" /> | |||
<Content Include="Areas\LR_TaskScheduling\Views\TSScheme\SelectExpressForm.js" /> | |||
<Content Include="Areas\Permission\Views\Perm_FunctionVisit\IndexForCount.js" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ActivitySchedule\qrCode.js" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ContractManagement\FormRemove.js" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ContractManagement\FormTerminate.js" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ContractManagement\FormRenew.js" /> | |||
@@ -7115,6 +7117,10 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwoTran\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwoTran\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwoTran\Form.js" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ActivityScheduleSienIn\Index.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ActivityScheduleSienIn\Index.js" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ActivityScheduleSienIn\Form.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ActivityScheduleSienIn\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElectivePre\" /> | |||
@@ -8119,6 +8125,7 @@ | |||
<Content Include="Areas\LR_NewWorkFlow\Views\NWFProcess\StatsIndex.cshtml" /> | |||
<Content Include="Areas\LR_NewWorkFlow\Views\NWFProcess\TeachLeaveIndex.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\DutySchedule\qrCode.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ActivitySchedule\qrCode.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -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<ScanParam>(); | |||
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 | |||
} | |||
@@ -663,6 +663,7 @@ | |||
<Compile Include="EducationalAdministration\StuScoreTranMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreNotPassTranMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreNotPassTwoTranMap.cs" /> | |||
<Compile Include="PersonnelManagement\ActivityScheduleSienInMap.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.PersonnelManagement; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2023-08-02 10:35 | |||
/// 描 述:ActivityScheduleSienIn | |||
/// </summary> | |||
public class ActivityScheduleSienInMap : EntityTypeConfiguration<ActivityScheduleSienInEntity> | |||
{ | |||
public ActivityScheduleSienInMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("ACTIVITYSCHEDULESIENIN"); | |||
//主键 | |||
this.HasKey(t => t.ID); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -2072,6 +2072,10 @@ | |||
<Compile Include="EducationalAdministration\StuScoreNotPassTwoTran\StuScoreNotPassTwoTranService.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreNotPassTwoTran\StuScoreNotPassTwoTranIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreNotPassTwoTran\StuScoreNotPassTwoTranBLL.cs" /> | |||
<Compile Include="PersonnelManagement\ActivityScheduleSienIn\ActivityScheduleSienInEntity.cs" /> | |||
<Compile Include="PersonnelManagement\ActivityScheduleSienIn\ActivityScheduleSienInService.cs" /> | |||
<Compile Include="PersonnelManagement\ActivityScheduleSienIn\ActivityScheduleSienInIBLL.cs" /> | |||
<Compile Include="PersonnelManagement\ActivityScheduleSienIn\ActivityScheduleSienInBLL.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -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 | |||
} | |||
@@ -50,6 +50,9 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
/// <summary> | |||
/// <returns></returns> | |||
void SaveEntity(UserInfo userInfo, string keyValue, ActivityScheduleEntity entity); | |||
string Scan(string scanParamUserid, string scanParamDciyid); | |||
#endregion | |||
} | |||
@@ -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<ActivityScheduleEntity>(strSql.ToString(),dp, pagination); | |||
return this.BaseRepository("CollegeMIS").FindList<ActivityScheduleEntity>(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<ActivityScheduleEntity>(strSql.ToString(),dp); | |||
return this.BaseRepository("CollegeMIS").FindList<ActivityScheduleEntity>(strSql.ToString(), dp); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -141,7 +141,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<ActivityScheduleEntity>(t=>t.Id == keyValue); | |||
this.BaseRepository("CollegeMIS").Delete<ActivityScheduleEntity>(t => t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -161,13 +161,13 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
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<ActivityScheduleEntity>(a => a.Id == scanParamDutyid); | |||
if (DutyEntity != null) | |||
{ | |||
var signInEntity = this.BaseRepository("CollegeMIS").FindEntity<ActivityScheduleSienInEntity>(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 | |||
} | |||
@@ -0,0 +1,148 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2023-08-02 10:35 | |||
/// 描 述:ActivityScheduleSienIn | |||
/// </summary> | |||
public class ActivityScheduleSienInBLL : ActivityScheduleSienInIBLL | |||
{ | |||
private ActivityScheduleSienInService activityScheduleSienInService = new ActivityScheduleSienInService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ActivityScheduleSienInEntity> GetList( string queryJson ) | |||
{ | |||
try | |||
{ | |||
return activityScheduleSienInService.GetList(queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ActivityScheduleSienInEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return activityScheduleSienInService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
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 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
activityScheduleSienInService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
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 | |||
} | |||
} |
@@ -0,0 +1,80 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2023-08-02 10:35 | |||
/// 描 述:ActivityScheduleSienIn | |||
/// </summary> | |||
public class ActivityScheduleSienInEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// ID | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ID")] | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// ASID | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ASID")] | |||
public string ASID { get; set; } | |||
/// <summary> | |||
/// TeachOrStu | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TEACHORSTU")] | |||
public int? TeachOrStu { get; set; } | |||
/// <summary> | |||
/// SignInUserId | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("SIGNINUSERID")] | |||
public string SignInUserId { get; set; } | |||
/// <summary> | |||
/// SignInUserName | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("SIGNINUSERNAME")] | |||
public string SignInUserName { get; set; } | |||
/// <summary> | |||
/// IsSignIn | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ISSIGNIN")] | |||
public bool? IsSignIn { get; set; } | |||
/// <summary> | |||
/// SignInTime | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("SIGNINTIME")] | |||
public DateTime? SignInTime { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.ID = Guid.NewGuid().ToString(); | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.ID = keyValue; | |||
} | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,55 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2023-08-02 10:35 | |||
/// 描 述:ActivityScheduleSienIn | |||
/// </summary> | |||
public interface ActivityScheduleSienInIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<ActivityScheduleSienInEntity> GetList( string queryJson ); | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<ActivityScheduleSienInEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
ActivityScheduleSienInEntity GetEntity(string keyValue); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, ActivityScheduleSienInEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -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 | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2023-08-02 10:35 | |||
/// 描 述:ActivityScheduleSienIn | |||
/// </summary> | |||
public class ActivityScheduleSienInService : RepositoryFactory | |||
{ | |||
#region 构造函数和属性 | |||
private string fieldSql; | |||
/// <summary> | |||
/// 构造方法 | |||
/// </summary> | |||
public ActivityScheduleSienInService() | |||
{ | |||
fieldSql = @" | |||
t.ID, | |||
t.ASID, | |||
t.TeachOrStu, | |||
t.SignInUserId, | |||
t.SignInUserName, | |||
t.IsSignIn, | |||
t.SignInTime | |||
"; | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">条件参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ActivityScheduleSienInEntity> 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<ActivityScheduleSienInEntity>(strSql.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">条件参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ActivityScheduleSienInEntity> 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<ActivityScheduleSienInEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public ActivityScheduleSienInEntity GetEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<ActivityScheduleSienInEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<ActivityScheduleSienInEntity>(t => t.ID == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// </summary> | |||
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 | |||
} | |||
} |