From 9c0ad63b20f0bfa1df5f3bbfd4ecdebcbd424a43 Mon Sep 17 00:00:00 2001 From: liangkun Date: Thu, 3 Aug 2023 11:56:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4=E8=A7=84=E5=88=99=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E4=BD=9C=E6=97=A5=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ADR_RestrictionController.cs | 31 +++++++++++ .../Views/ADR_Restriction/Form.cshtml | 23 +++++++- .../Views/ADR_Restriction/FormDay.cshtml | 22 ++++++++ .../Views/ADR_Restriction/FormDay.js | 51 ++++++++++++++++++ .../Views/ADR_Restriction/Index.cshtml | 7 +-- .../Views/ADR_Restriction/Index.js | 16 ++++++ .../Learun.Application.Web.csproj | 2 + .../Learun.Application.Mapping.csproj | 1 + .../ADR_RestrictionDayMap.cs | 29 ++++++++++ .../Learun.Application.TwoDevelopment.csproj | 1 + .../ADR_Restriction/ADR_RestrictionBLL.cs | 39 ++++++++++++++ .../ADR_RestrictionDayEntity.cs | 54 +++++++++++++++++++ .../ADR_Restriction/ADR_RestrictionIBLL.cs | 2 + .../ADR_Restriction/ADR_RestrictionService.cs | 43 +++++++++++++++ 14 files changed, 317 insertions(+), 4 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/PersonnelManagement/ADR_RestrictionDayMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionDayEntity.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ADR_RestrictionController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ADR_RestrictionController.cs index 7854787e5..2abbb9ee5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ADR_RestrictionController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ADR_RestrictionController.cs @@ -37,6 +37,12 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers { return View(); } + + [HttpGet] + public ActionResult FormDay() + { + return View(); + } #endregion #region 获取数据 @@ -78,6 +84,18 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers }; return Success(jsonData); } + + [HttpGet] + [AjaxOnly] + public ActionResult GetFormDayData(string keyValue) + { + var ADR_RestrictionData = aDR_RestrictionIBLL.GetADR_RestrictionDay(keyValue); + var jsonData = new + { + ADR_RestrictionDay = ADR_RestrictionData, + }; + return Success(jsonData); + } #endregion #region 提交数据 @@ -124,6 +142,19 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers } return Success("保存成功!"); } + + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveFormDay(string keyValue, string strEntity) + { + List entity = strEntity.ToObject>(); + aDR_RestrictionIBLL.SaveFormDay(keyValue, entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.cshtml index 4fec33d86..bf5832caa 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.cshtml @@ -82,10 +82,31 @@
未签退,记为*
-
+
考勤人员类型*
+
+
地图
+
+
+
+
经度*
+ +
+
+
纬度*
+ +
+
+
范围*
+ +
+
+
地址*
+ +
+ @Html.AppendJsFile("/Areas/PersonnelManagement/Views/ADR_Restriction/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.cshtml new file mode 100644 index 000000000..152cc762f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.cshtml @@ -0,0 +1,22 @@ +@{ + ViewBag.Title = "工作日配置"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+
+
上班日期*
+ +
+ +
+@Html.AppendJsFile("/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.js new file mode 100644 index 000000000..46c6cb26c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.js @@ -0,0 +1,51 @@ +/* * 版 本 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 () { + + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/GetFormDayData?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/SaveFormDay', postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.cshtml index bcfbbe1a1..42106458a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.cshtml @@ -12,11 +12,12 @@
- diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.js index 2751a6e1f..c07a7f913 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.js @@ -30,6 +30,22 @@ var bootstrap = function ($, learun) { } }); }); + //工作日配置 + $('#lr_day').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formday', + title: '工作日配置', + url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/FormDay?keyValue=' + keyValue, + width: 600, + height: 520, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); 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 a4b03ae8a..0bd545255 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 @@ -1720,6 +1720,7 @@ + @@ -8269,6 +8270,7 @@ + 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 daa7819da..5989d7280 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 @@ -240,6 +240,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/PersonnelManagement/ADR_RestrictionDayMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/PersonnelManagement/ADR_RestrictionDayMap.cs new file mode 100644 index 000000000..0107baf71 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/PersonnelManagement/ADR_RestrictionDayMap.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 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2020-09-03 14:57 + /// 描 述:考勤限制 + /// + public class ADR_RestrictionDayMap : EntityTypeConfiguration + { + public ADR_RestrictionDayMap() + { + #region 表、主键 + //表 + this.ToTable("ADR_RESTRICTIONDAY"); + //主键 + 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 0f0f7e6c3..9192d228a 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 @@ -465,6 +465,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs index aa70dad5f..c37e0c508 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs @@ -203,6 +203,45 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } } + + + public IEnumerable GetADR_RestrictionDay(string keyValue) + { + try + { + return aDR_RestrictionService.GetADR_RestrictionDay(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void SaveFormDay(string keyValue, List entity) + { + try + { + aDR_RestrictionService.SaveFormDay(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/ADR_Restriction/ADR_RestrictionDayEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionDayEntity.cs new file mode 100644 index 000000000..ffbbdb7d3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionDayEntity.cs @@ -0,0 +1,54 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.PersonnelManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2020-09-03 14:57 + /// 描 述:考勤限制 + /// + public class ADR_RestrictionDayEntity + { + #region 实体成员 + /// + /// 编号 + /// + [Column("ID")] + public string Id { get; set; } + + [Column("RID")] + public string RId { get; set; } + /// + /// 上班日期 + /// + [Column("WORKDAY")] + public DateTime WorkDay { get; set; } + + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs index 75dc6b1ef..9748d5338 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs @@ -59,5 +59,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement #endregion ADR_RestrictionEntity GetADR_RestrictionEntityEnabled(); + IEnumerable GetADR_RestrictionDay(string keyValue); + void SaveFormDay(string keyValue, List entity); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs index 1d1548666..4bfb89256 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs @@ -1322,5 +1322,48 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } } + + public IEnumerable GetADR_RestrictionDay(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindList(m=>m.RId== keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public void SaveFormDay(string keyValue, List entity) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql("delete from ADR_RestrictionDay where RId='"+keyValue+"'"); + foreach (var item in entity) + { + item.Create(); + } + this.BaseRepository("CollegeMIS").Insert(entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } } }