From 861e1331acbce8c4a10180e101e7c896ed6d2f99 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Fri, 11 Jun 2021 14:50:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E7=AB=A0=E7=94=B3=E8=AF=B7=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E3=80=81=E5=85=AC=E7=AB=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/OfficialSealController.cs | 14 ++++++- .../Views/OfficialSeal/Index.cshtml | 1 + .../Views/OfficialSeal/Index.js | 18 ++++++++ .../Views/OfficialSealRecord/Index.js | 32 ++++++++++++--- .../Views/OfficialSealUse/Index.js | 8 +++- .../OfficialSeal/OfficialSealBLL.cs | 25 +++++++++++ .../OfficialSeal/OfficialSealIBLL.cs | 5 +++ .../OfficialSeal/OfficialSealService.cs | 41 +++++++++++++++++++ .../OfficialSealRecordService.cs | 4 +- .../OfficialSealUse/OfficialSealUseEntity.cs | 4 +- .../OfficialSealUse/OfficialSealUseService.cs | 14 +++++-- 11 files changed, 150 insertions(+), 16 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/OfficialSealController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/OfficialSealController.cs index 16f5da6bb..683c40168 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/OfficialSealController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/OfficialSealController.cs @@ -106,7 +106,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers var entity = officialSealIBLL.GetOfficialSealEntity(keyValue); entity.Enable = Enable; officialSealIBLL.SaveEntity(keyValue, entity); - return Success("删除成功!"); + return Success("操作成功!"); } /// /// @@ -121,6 +121,18 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers return Success("操作成功!"); } /// + /// 归还 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult Return(string keyValue) + { + officialSealIBLL.Return(keyValue); + return Success("操作成功!"); + } + /// /// 保存实体数据(新增、修改) /// /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSeal/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSeal/Index.cshtml index 59ae161c3..ff48e6d3c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSeal/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSeal/Index.cshtml @@ -41,6 +41,7 @@
  •  禁用
  •  挂失
  •  取消挂失
  • +
  •  归还
  •  销毁
  • diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSeal/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSeal/Index.js index e4e518bbd..af1cf57bc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSeal/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSeal/Index.js @@ -138,6 +138,24 @@ var bootstrap = function ($, learun) { }); } }); + + // 归还 + $('#lr_return').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status != 1) { + return learun.alert.warning('未借出无需归还!'); + } + learun.layerConfirm('是否确认归还该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/OfficialSeal/Return', { keyValue: keyValue, Status: 0 }, function () { + refreshGirdData(); + }); + } + }); + } + }); // 打印 $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSealRecord/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSealRecord/Index.js index 3d4fb8467..39fa5b00a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSealRecord/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSealRecord/Index.js @@ -15,7 +15,7 @@ var bootstrap = function ($, learun) { bind: function () { // 初始化左侧树形数据 $('#dataTree').lrtree({ - url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetTree?code=OfficialSealData&parentId=type&Id=id&showId=name', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetTree?code=OfficialSealInfo&parentId=type&Id=id&showId=name', nodeClick: function (item) { page.search({ SealId: item.value }); } @@ -73,7 +73,7 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/CustomFunction/OfficialSealRecord/GetPageList', headData: [ { label: "公章类型", name: "SealType", width: 100, align: "left", @@ -89,17 +89,39 @@ var bootstrap = function ($, learun) { { label: "公章名称", name: "SealId", width: 100, align: "left", formatterAsync: function (callback, value, row, op,$cell) { learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'OfficialSealData', + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'OfficialSealInfo', key: value, keyId: 'id', callback: function (_data) { callback(_data['name']); } }); - }}, + } + }, + { + label: "状态", name: "Status", width: 100, align: "left", + formatter: function (cellvalue) { + if (cellvalue == '0') { + return '正常'; + } else if (cellvalue == '1') { + return '借出'; + } else if (cellvalue == '2') { + return '挂失'; + } else if (cellvalue == '3') { + return '归还'; + }else if (cellvalue == '99') { + return '销毁'; + } + + } + }, + { label: "申请人", name: "ApplyUserName", width: 100, align: "left" }, + { label: "申请时间", name: "ApplyTime", width: 150, align: "left" }, ], mainId:'Id', - isPage: true + isPage: true, + sidx: 'ApplyTime', + sord: 'ASC', }); page.search(); }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSealUse/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSealUse/Index.js index 9c4af7030..357ba7b59 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSealUse/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/OfficialSealUse/Index.js @@ -72,8 +72,12 @@ var bootstrap = function ($, learun) { // 提交 $('#lr_submit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); - + if (learun.checkrow(keyValue)) { + var status = $('#gridtable').jfGridValue('Status'); + if (status != '0') { + return learun.alert.warning('只有草稿状态才可提交!'); + } learun.layerConfirm('是否确认提交该项!', function (res) { if (res) { learun.postForm(top.$.rootUrl + '/CustomFunction/OfficialSealUse/UpdateStatus', { keyValue: keyValue, Status: 1 }, function () { @@ -151,7 +155,7 @@ var bootstrap = function ($, learun) { if (cellvalue == 0) { return "草稿"; } else if (cellvalue == 1) { - return "审批中"; + return "进行中"; } else if (cellvalue == 2) { return "已通过"; } else if (cellvalue == 99) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSeal/OfficialSealBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSeal/OfficialSealBLL.cs index 08f83d286..71255e060 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSeal/OfficialSealBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSeal/OfficialSealBLL.cs @@ -116,6 +116,31 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } } + + + /// + /// + /// + /// 主键 + public void Return(string keyValue) + { + try + { + officialSealService.Return(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 保存实体数据(新增、修改) /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSeal/OfficialSealIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSeal/OfficialSealIBLL.cs index 1f33f262b..b743bc6d3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSeal/OfficialSealIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSeal/OfficialSealIBLL.cs @@ -48,6 +48,11 @@ namespace Learun.Application.TwoDevelopment.CustomFunction /// /// void UpdateStatus(string keyValue, string Status); + /// + /// 归还 + /// + /// + void Return(string keyValue); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSeal/OfficialSealService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSeal/OfficialSealService.cs index 8c8f0f390..9693fc0a4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSeal/OfficialSealService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSeal/OfficialSealService.cs @@ -144,6 +144,47 @@ t.Status } } } + + + /// + /// 归还 + /// + /// 主键 + public void Return(string keyValue) + { + try + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + var entity = this.BaseRepository("CollegeMIS").FindEntity(keyValue); + entity.Status = "0"; + db.Update(entity); + + var userInfo = LoginUserInfo.Get(); + OfficialSealRecordEntity RecordEntity = new OfficialSealRecordEntity(); + RecordEntity.Create(); + RecordEntity.SealId = entity.Id; + RecordEntity.SealType = entity.Type; + RecordEntity.Status = 3;//归还 + RecordEntity.ApplyUserId = userInfo.userId; + RecordEntity.ApplyUserName = userInfo.realName; + RecordEntity.ApplyTime = DateTime.Now; + db.Insert(RecordEntity); + + db.Commit(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 保存实体数据(新增、修改) /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSealRecord/OfficialSealRecordService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSealRecord/OfficialSealRecordService.cs index 69649d93d..6ca0e11bd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSealRecord/OfficialSealRecordService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSealRecord/OfficialSealRecordService.cs @@ -32,9 +32,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction var strSql = new StringBuilder(); strSql.Append("SELECT "); strSql.Append(@" - t.Id, - t.SealType, - t.SealId + t.* "); strSql.Append(" FROM OfficialSealRecord t "); strSql.Append(" WHERE 1=1 "); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSealUse/OfficialSealUseEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSealUse/OfficialSealUseEntity.cs index 7e2d0cbf6..ef0c6222f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSealUse/OfficialSealUseEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSealUse/OfficialSealUseEntity.cs @@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction /// 日 期:2021-06-09 16:19 /// 描 述:公章申请审批 ///
    - public class OfficialSealUseEntity + public class OfficialSealUseEntity { #region 实体成员 /// @@ -64,7 +64,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction { this.Id = Guid.NewGuid().ToString(); this.Status = 0; - + this.ApplyUserName = LoginUserInfo.Get().realName; } /// /// 编辑调用 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSealUse/OfficialSealUseService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSealUse/OfficialSealUseService.cs index 89b5e70b0..69c254cc2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSealUse/OfficialSealUseService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/OfficialSealUse/OfficialSealUseService.cs @@ -127,7 +127,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction /// - /// + /// 审批通过 /// /// 主键 public void UpdateStatus(string keyValue, int Status) @@ -138,13 +138,18 @@ namespace Learun.Application.TwoDevelopment.CustomFunction OfficialSealUseEntity entity = GetOfficialSealUseEntity(keyValue); entity.Status = Status; db.Update(entity); - if (Status == 2) + OfficialSealEntity sealEntity = this.BaseRepository("CollegeMIS") + .FindEntity(x => x.Id == entity.SealId); + sealEntity.Status = "1"; + db.Update(sealEntity); + + if (Status == 2)//审批通过 { OfficialSealRecordEntity RecordEntity = new OfficialSealRecordEntity(); RecordEntity.Create(); RecordEntity.SealId = entity.SealId; RecordEntity.SealType = entity.Type; - RecordEntity.Status = 1; + RecordEntity.Status = 1;//借出 RecordEntity.ApplyUserId = entity.ApplyUserId; RecordEntity.ApplyUserName = entity.ApplyUserName; RecordEntity.ApplyTime = DateTime.Now; @@ -165,6 +170,9 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } } + + + /// /// 保存实体数据(新增、修改) ///