@@ -0,0 +1,117 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.PersonnelManagement; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-09-03 14:57 | |||
/// 描 述:考勤限制 | |||
/// </summary> | |||
public class ADR_RestrictionController : MvcControllerBase | |||
{ | |||
private ADR_RestrictionIBLL aDR_RestrictionIBLL = new ADR_RestrictionBLL(); | |||
#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="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = aDR_RestrictionIBLL.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 ADR_RestrictionData = aDR_RestrictionIBLL.GetADR_RestrictionEntity( keyValue ); | |||
var jsonData = new { | |||
ADR_Restriction = ADR_RestrictionData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
aDR_RestrictionIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
ADR_RestrictionEntity entity = strEntity.ToObject<ADR_RestrictionEntity>(); | |||
aDR_RestrictionIBLL.SaveEntity(keyValue,entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -52,7 +52,7 @@ var bootstrap = function ($, learun) { | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/PersonnelManagement/ADR_Record/Form', | |||
@@ -83,9 +83,9 @@ var bootstrap = function ($, learun) { | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ADR_Record/DeleteForm', { keyValue: keyValue}, function () { | |||
learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ADR_Record/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
@@ -98,24 +98,36 @@ var bootstrap = function ($, learun) { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/PersonnelManagement/ADR_Record/GetPageList', | |||
headData: [ | |||
{ label: "员工名字", name: "UserName", width: 100, align: "left"}, | |||
{ label: "员工编号", name: "UserNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op,$cell) { | |||
learun.clientdata.getAsync('user', { | |||
key: value, | |||
callback: function (_data) { | |||
callback(_data.name); | |||
} | |||
}); | |||
}}, | |||
{ label: "部门", name: "Department", width: 100, align: "left"}, | |||
{ label: "考勤日期", name: "ADDate", width: 100, align: "left"}, | |||
{ label: "考勤时间", name: "ADTime", width: 100, align: "left"}, | |||
{ label: "打卡时间", name: "ClockTime", width: 100, align: "left"}, | |||
{ label: "打卡状态", name: "ClockStatus", width: 100, align: "left"}, | |||
{ label: "打卡地点", name: "ClockPlace", width: 100, align: "left"}, | |||
{ label: "员工名字", name: "UserName", width: 100, align: "left" }, | |||
{ | |||
label: "员工编号", name: "UserNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('user', { | |||
key: value, | |||
callback: function (_data) { | |||
callback(_data.name); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "部门", name: "Department", width: 100, align: "left" }, | |||
{ label: "考勤日期", name: "ADDate", width: 100, align: "left" }, | |||
{ label: "考勤时间", name: "ADTime", width: 100, align: "left" }, | |||
{ label: "打卡时间", name: "ClockTime", width: 100, align: "left" }, | |||
{ | |||
label: "打卡状态", name: "ClockStatus", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'ADR_Status', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "打卡地点", name: "ClockPlace", width: 100, align: "left" }, | |||
], | |||
mainId:'ID', | |||
mainId: 'ID', | |||
isPage: true | |||
}); | |||
}, | |||
@@ -123,7 +135,7 @@ var bootstrap = function ($, learun) { | |||
param = param || {}; | |||
param.StartTime = startTime; | |||
param.EndTime = endTime; | |||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
@@ -0,0 +1,47 @@ | |||
@{ | |||
ViewBag.Title = "考勤限制"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction" > | |||
<div class="lr-form-item-title">开始时间</div> | |||
<input id="WorkTime" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction" > | |||
<div class="lr-form-item-title">结束时间</div> | |||
<input id="CloseTime" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction" > | |||
<div class="lr-form-item-title">签到有效时间</div> | |||
<input id="SignInStartTime" type="text" class="form-control "/> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction" > | |||
<div class="lr-form-item-title">-</div> | |||
<input id="SignInEndTime" type="text" class="form-control "/> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction" > | |||
<div class="lr-form-item-title">签退有效时间</div> | |||
<input id="SignOutStartTime" type="text" class="form-control "/> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction" > | |||
<div class="lr-form-item-title">-</div> | |||
<input id="SignOutEndTime" type="text" class="form-control "/> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction" > | |||
<div class="lr-form-item-title">迟到超过时间</div> | |||
<input id="LateOvertime" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction" > | |||
<div class="lr-form-item-title">早退超过时间</div> | |||
<input id="LeaveOverTime" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction" > | |||
<div class="lr-form-item-title">未签到,记为</div> | |||
<div id="NoSignIn" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction" > | |||
<div class="lr-form-item-title">未签退,记为</div> | |||
<div id="NoSignOut" ></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/PersonnelManagement/Views/ADR_Restriction/Form.js") |
@@ -0,0 +1,52 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-09-03 14:57 | |||
* 描 述:考勤限制 | |||
*/ | |||
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 () { | |||
$('#NoSignIn').lrDataItemSelect({ code: 'ADR_Status' }); | |||
$('#NoSignOut').lrDataItemSelect({ code: 'ADR_Status' }); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,26 @@ | |||
@{ | |||
ViewBag.Title = "考勤限制"; | |||
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> | |||
<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/ADR_Restriction/Index.js") |
@@ -0,0 +1,111 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-09-03 14:57 | |||
* 描 述:考勤限制 | |||
*/ | |||
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 + '/PersonnelManagement/ADR_Restriction/Form', | |||
width: 600, | |||
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/ADR_Restriction/Form?keyValue=' + keyValue, | |||
width: 600, | |||
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/ADR_Restriction/DeleteForm', { keyValue: keyValue}, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/GetPageList', | |||
headData: [ | |||
{ label: "开始时间", name: "WorkTime", width: 100, align: "left"}, | |||
{ label: "结束时间", name: "CloseTime", width: 100, align: "left"}, | |||
{ label: "签到有效时间", name: "SignInStartTime", width: 100, align: "left"}, | |||
{ label: "-", name: "SignInEndTime", width: 100, align: "left"}, | |||
{ label: "签退有效时间", name: "SignOutStartTime", width: 100, align: "left"}, | |||
{ label: "-", name: "SignOutEndTime", width: 100, align: "left"}, | |||
{ label: "迟到超过时间", name: "LateOvertime", width: 100, align: "left"}, | |||
{ label: "早退超过时间", name: "LeaveOverTime", width: 100, align: "left"}, | |||
{ label: "未签到,记为", name: "NoSignIn", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op,$cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'ADR_Status', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
}}, | |||
{ label: "未签退,记为", name: "NoSignOut", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op,$cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'ADR_Status', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
}}, | |||
], | |||
mainId:'ID', | |||
isPage: true | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -796,6 +796,7 @@ | |||
<Compile Include="Startup1.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\ADR_DeviceController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\ADR_DeviceLogController.cs" /> | |||
<Compile Include="Areas\PersonnelManagement\Controllers\ADR_RestrictionController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\RegistrateForm.js" /> | |||
@@ -6021,6 +6022,10 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\ADR_DeviceLog\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ADR_DeviceLog\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ADR_DeviceLog\Form.js" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ADR_Restriction\Index.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ADR_Restriction\Index.js" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ADR_Restriction\Form.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\ADR_Restriction\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\LR_Desktop\Models\" /> | |||
@@ -528,6 +528,7 @@ | |||
<Compile Include="LogisticsManagement\ADR_RecordMap.cs" /> | |||
<Compile Include="EducationalAdministration\ADR_DeviceMap.cs" /> | |||
<Compile Include="EducationalAdministration\ADR_DeviceLogMap.cs" /> | |||
<Compile Include="PersonnelManagement\ADR_RestrictionMap.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 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-09-03 14:57 | |||
/// 描 述:考勤限制 | |||
/// </summary> | |||
public class ADR_RestrictionMap : EntityTypeConfiguration<ADR_RestrictionEntity> | |||
{ | |||
public ADR_RestrictionMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("ADR_RESTRICTION"); | |||
//主键 | |||
this.HasKey(t => t.ID); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -1563,6 +1563,10 @@ | |||
<Compile Include="EducationalAdministration\ADR_DeviceLog\ADR_DeviceLogService.cs" /> | |||
<Compile Include="EducationalAdministration\ADR_DeviceLog\ADR_DeviceLogBLL.cs" /> | |||
<Compile Include="EducationalAdministration\ADR_DeviceLog\ADR_DeviceLogIBLL.cs" /> | |||
<Compile Include="PersonnelManagement\ADR_Restriction\ADR_RestrictionEntity.cs" /> | |||
<Compile Include="PersonnelManagement\ADR_Restriction\ADR_RestrictionService.cs" /> | |||
<Compile Include="PersonnelManagement\ADR_Restriction\ADR_RestrictionBLL.cs" /> | |||
<Compile Include="PersonnelManagement\ADR_Restriction\ADR_RestrictionIBLL.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -0,0 +1,125 @@ | |||
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 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-09-03 14:57 | |||
/// 描 述:考勤限制 | |||
/// </summary> | |||
public class ADR_RestrictionBLL : ADR_RestrictionIBLL | |||
{ | |||
private ADR_RestrictionService aDR_RestrictionService = new ADR_RestrictionService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ADR_RestrictionEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return aDR_RestrictionService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取ADR_Restriction表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public ADR_RestrictionEntity GetADR_RestrictionEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return aDR_RestrictionService.GetADR_RestrictionEntity(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 | |||
{ | |||
aDR_RestrictionService.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> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, ADR_RestrictionEntity entity) | |||
{ | |||
try | |||
{ | |||
aDR_RestrictionService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,95 @@ | |||
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 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-09-03 14:57 | |||
/// 描 述:考勤限制 | |||
/// </summary> | |||
public class ADR_RestrictionEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// 编号 | |||
/// </summary> | |||
[Column("ID")] | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// 上班时间 | |||
/// </summary> | |||
[Column("WORKTIME")] | |||
public string WorkTime { get; set; } | |||
/// <summary> | |||
/// 下班时间 | |||
/// </summary> | |||
[Column("CLOSETIME")] | |||
public string CloseTime { get; set; } | |||
/// <summary> | |||
/// 签到时间开始 | |||
/// </summary> | |||
[Column("SIGNINSTARTTIME")] | |||
public string SignInStartTime { get; set; } | |||
/// <summary> | |||
/// 签到时间结束 | |||
/// </summary> | |||
[Column("SIGNINENDTIME")] | |||
public string SignInEndTime { get; set; } | |||
/// <summary> | |||
/// 签退时间开始 | |||
/// </summary> | |||
[Column("SIGNOUTSTARTTIME")] | |||
public string SignOutStartTime { get; set; } | |||
/// <summary> | |||
/// 签退时间结束 | |||
/// </summary> | |||
[Column("SIGNOUTENDTIME")] | |||
public string SignOutEndTime { get; set; } | |||
/// <summary> | |||
/// 迟到超时 | |||
/// </summary> | |||
[Column("LATEOVERTIME")] | |||
public int? LateOvertime { get; set; } | |||
/// <summary> | |||
/// 早退超时 | |||
/// </summary> | |||
[Column("LEAVEOVERTIME")] | |||
public int? LeaveOverTime { get; set; } | |||
/// <summary> | |||
/// 未签到,记为 | |||
/// </summary> | |||
[Column("NOSIGNIN")] | |||
public int? NoSignIn { get; set; } | |||
/// <summary> | |||
/// 未签退,记为 | |||
/// </summary> | |||
[Column("NOSIGNOUT")] | |||
public int? NoSignOut { 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 | |||
#region 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,48 @@ | |||
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 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-09-03 14:57 | |||
/// 描 述:考勤限制 | |||
/// </summary> | |||
public interface ADR_RestrictionIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<ADR_RestrictionEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取ADR_Restriction表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
ADR_RestrictionEntity GetADR_RestrictionEntity(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, ADR_RestrictionEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,154 @@ | |||
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 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-09-03 14:57 | |||
/// 描 述:考勤限制 | |||
/// </summary> | |||
public class ADR_RestrictionService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ADR_RestrictionEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.ID, | |||
t.WorkTime, | |||
t.CloseTime, | |||
t.SignInStartTime, | |||
t.SignInEndTime, | |||
t.SignOutStartTime, | |||
t.SignOutEndTime, | |||
t.LateOvertime, | |||
t.LeaveOverTime, | |||
t.NoSignIn, | |||
t.NoSignOut | |||
"); | |||
strSql.Append(" FROM ADR_Restriction t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
return this.BaseRepository("CollegeMIS").FindList<ADR_RestrictionEntity>(strSql.ToString(),dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取ADR_Restriction表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public ADR_RestrictionEntity GetADR_RestrictionEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<ADR_RestrictionEntity>(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<ADR_RestrictionEntity>(t=>t.ID == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, ADR_RestrictionEntity 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 | |||
} | |||
} |