Browse Source

考勤限制增加启用功能

大厂分支
zhichao lei 4 years ago
parent
commit
2d5cebcf36
6 changed files with 129 additions and 35 deletions
  1. +18
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ADR_RestrictionController.cs
  2. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.cshtml
  3. +50
    -27
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.js
  4. +22
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs
  5. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs
  6. +33
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs

+ 18
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ADR_RestrictionController.cs View File

@@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
[HttpGet]
public ActionResult Index()
{
return View();
return View();
}
/// <summary>
/// 表单页
@@ -35,7 +35,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
[HttpGet]
public ActionResult Form()
{
return View();
return View();
}
#endregion

@@ -71,8 +71,9 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
[AjaxOnly]
public ActionResult GetFormData(string keyValue)
{
var ADR_RestrictionData = aDR_RestrictionIBLL.GetADR_RestrictionEntity( keyValue );
var jsonData = new {
var ADR_RestrictionData = aDR_RestrictionIBLL.GetADR_RestrictionEntity(keyValue);
var jsonData = new
{
ADR_Restriction = ADR_RestrictionData,
};
return Success(jsonData);
@@ -94,6 +95,18 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
return Success("删除成功!");
}
/// <summary>
/// 启用限制
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult Enable(string keyValue)
{
aDR_RestrictionIBLL.Enable(keyValue);
return Success("启用成功!");
}
/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
@@ -105,7 +118,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
public ActionResult SaveForm(string keyValue, string strEntity)
{
ADR_RestrictionEntity entity = strEntity.ToObject<ADR_RestrictionEntity>();
aDR_RestrictionIBLL.SaveEntity(keyValue,entity);
aDR_RestrictionIBLL.SaveEntity(keyValue, entity);
if (string.IsNullOrEmpty(keyValue))
{
}


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.cshtml View File

@@ -16,6 +16,7 @@
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_enable" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;启用</a>
</div>
</div>
</div>


+ 50
- 27
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.js View File

@@ -52,56 +52,79 @@ var bootstrap = function ($, learun) {
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/DeleteForm', { keyValue: keyValue}, function () {
learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/DeleteForm', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
});
}
});
// 启用
$('#lr_enable').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认启用!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/Enable', { 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: "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: 'ADStatus',
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: 'ADStatus',
callback: function (_data) {
callback(_data.text);
}
});
}},
{ 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: 'ADStatus',
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: 'ADStatus',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{
label: "是否启用", name: "REnable", width: 100, align: "left", formatter: function (val) {
return val ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
}
},
],
mainId:'ID',
mainId: 'ID',
isPage: true
});
page.search();
},
search: function (param) {
param = param || {};
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {


+ 22
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs View File

@@ -93,6 +93,28 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}
}
/// <summary>
/// 启用限制
/// </summary>
/// <param name="keyValue">主键</param>
public void Enable(string keyValue)
{
try
{
aDR_RestrictionService.Enable(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs View File

@@ -37,6 +37,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// <param name="keyValue">主键</param>
void DeleteEntity(string keyValue);
/// <summary>
/// 启用限制
/// </summary>
/// <param name="keyValue">主键</param>
void Enable(string keyValue);
/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>


+ 33
- 3
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs View File

@@ -42,6 +42,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
t.LateOvertime,
t.LeaveOverTime,
t.NoSignIn,
t.REnable,
t.NoSignOut
");
strSql.Append(" FROM ADR_Restriction t ");
@@ -49,7 +50,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
return this.BaseRepository("CollegeMIS").FindList<ADR_RestrictionEntity>(strSql.ToString(),dp, pagination);
return this.BaseRepository("CollegeMIS").FindList<ADR_RestrictionEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
{
@@ -100,7 +101,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
{
try
{
this.BaseRepository("CollegeMIS").Delete<ADR_RestrictionEntity>(t=>t.ID == keyValue);
this.BaseRepository("CollegeMIS").Delete<ADR_RestrictionEntity>(t => t.ID == keyValue);
}
catch (Exception ex)
{
@@ -114,6 +115,35 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}
}
/// <summary>
/// 启用限制
/// </summary>
/// <param name="keyValue">主键</param>
public void Enable(string keyValue)
{
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
var sql = "UPDATE dbo.ADR_Restriction SET REnable='false'";
db.ExecuteBySql(sql);
var entity = db.FindEntity<ADR_RestrictionEntity>(a => a.ID == keyValue);
entity.REnable = true;
db.Update(entity);
db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
@@ -154,7 +184,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<ADR_RestrictionEntity>(m=>m.REnable==true);
return this.BaseRepository("CollegeMIS").FindEntity<ADR_RestrictionEntity>(m => m.REnable == true);
}
catch (Exception ex)
{


Loading…
Cancel
Save