From 8ed1174f4fd1b2c3428e470494944148e34b75c2 Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 4 Mar 2022 16:08:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E6=9D=90=E5=BA=93=E5=AD=98=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20=E6=8F=90=E4=BA=A4=E6=8C=89=E9=92=AE=20=E6=95=99?= =?UTF-8?q?=E6=9D=90=E5=85=A5=E5=BA=93=20=E6=97=B6=E9=97=B4=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/TextbookInOutController.cs | 14 +++++++ .../Views/TextBookIn/FormIn.cshtml | 2 +- .../Views/TextBookIn/Index.js | 1 + .../Views/TextbookInOut/Form.cshtml | 12 ++++-- .../Views/TextbookInOut/Index.cshtml | 2 +- .../Views/TextbookInOut/Index.js | 29 ++++++++++++++ .../Learun.Application.Web.csproj | 2 +- .../TextBookIn/TextBookInService.cs | 7 +--- .../TextbookInOut/TextbookInOutBLL.cs | 22 +++++++++++ .../TextbookInOut/TextbookInOutEntity.cs | 6 +++ .../TextbookInOut/TextbookInOutIBLL.cs | 6 +++ .../TextbookInOut/TextbookInOutService.cs | 38 ++++++++++++++++++- 12 files changed, 127 insertions(+), 14 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs index 899aa1138..4909ea45e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs @@ -123,6 +123,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers if (string.IsNullOrEmpty(keyValue)) { entity.IsDel = 0; + entity.IsSubmit = 0; entity.FinallyNum = 0; entity.CreateTime = DateTime.Now; entity.CrateUserID = loginUserInfo.userId; @@ -135,6 +136,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers textbookInOutIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } + + /// + /// 提交 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult SubmitForm(string keyValue) + { + textbookInOutIBLL.SubmitEntity(keyValue); + return Success("删除成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormIn.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormIn.cshtml index 8c34732fa..66743b395 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormIn.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormIn.cshtml @@ -20,7 +20,7 @@
创建时间*
- +
备注
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/Index.js index e66a3c3a2..02e4d8de3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/Index.js @@ -89,6 +89,7 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.SqlParameter = ' and IsSubmit =1 '; $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Form.cshtml index 32adcf9b9..5b95a0334 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Form.cshtml @@ -8,15 +8,15 @@
库存编码*
- +
课程*
-
教材
- +
教材*
+
教材号
@@ -44,7 +44,11 @@
印次
- + +
+
+
数量*
+
备注
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.cshtml index a0b9f7e45..9048e57da 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.cshtml @@ -22,7 +22,7 @@  新增  编辑  删除 -
+   提交
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.js index be51f319e..fa6d1ca63 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/Index.js @@ -10,6 +10,7 @@ var bootstrap = function ($, learun) { var page = { init: function () { page.initGird(); + console.log(223223223); page.bind(); }, bind: function () { @@ -40,6 +41,11 @@ var bootstrap = function ($, learun) { $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { + var IsSubmit = $('#gridtable').jfGridValue('IsSubmit'); + if (IsSubmit == 1) { + learun.alert.warning("当前项目已提交,不可编辑!"); + return; + } learun.layerForm({ id: 'form', title: '编辑', @@ -56,6 +62,11 @@ var bootstrap = function ($, learun) { $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { + var IsSubmit = $('#gridtable').jfGridValue('IsSubmit'); + if (IsSubmit == 1) { + learun.alert.warning("当前项目已提交,不可删除!"); + return; + } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/DeleteForm', { keyValue: keyValue }, function () { @@ -64,6 +75,23 @@ var bootstrap = function ($, learun) { }); } }); + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + var IsSubmit = $('#gridtable').jfGridValue('IsSubmit'); + if (IsSubmit == 1) { + learun.alert.warning("当前项目已提交,请勿重复提交!"); + return; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/SubmitForm', { keyValue: keyValue }, function (res) { + refreshGirdData(res, {}); + }); + } + }); + } + }); }, initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ @@ -108,6 +136,7 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.SqlParameter = 'and IsDel = 0 '; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; 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 9787d6588..c0ecb02a2 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 @@ -841,7 +841,7 @@ - + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIn/TextBookInService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIn/TextBookInService.cs index f986761f5..bbad32cb9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIn/TextBookInService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIn/TextBookInService.cs @@ -32,12 +32,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { var strSql = new StringBuilder(); strSql.Append("SELECT "); - strSql.Append(@" - t.ID, - t.TextBookName, - t.CreateTime, - t.CrateUserID - "); + strSql.Append(@" * "); strSql.Append(" FROM TextBookIn t "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs index 54bd9e321..6549fa0d3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs @@ -166,6 +166,28 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 删除实体数据 + /// + /// 主键 + public void SubmitEntity(string keyValue) + { + try + { + textbookInOutService.SubmitEntity(keyValue); + } + 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/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs index ceb914435..8374b2990 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs @@ -140,6 +140,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("ISDEL")] public int? IsDel { get; set; } + /// + /// ISSUBMIT + /// + /// + [Column("ISSUBMIT")] + public int? IsSubmit { get; set; } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs index eec009143..270cb4693 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs @@ -55,6 +55,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// 实体 void SaveEntity(string keyValue, TextbookInOutEntity entity); + /// + /// 提交 + /// + /// + void SubmitEntity(string keyValue); + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs index b45e7d431..df66cd941 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs @@ -63,9 +63,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { var strSql = new StringBuilder(); strSql.Append("SELECT *"); - strSql.Append(" FROM TextbookInOut t where 1=1 and IsDel = 0 "); + strSql.Append(" FROM TextbookInOut t where 1=1 "); var queryParam = queryJson.ToJObject(); var dp = new DynamicParameters(new { }); + if (!queryParam["SqlParameter"].IsEmpty()) + { + string SqlParameter = queryParam["SqlParameter"].ToString(); + strSql.Append(SqlParameter); + } if (!queryParam["keyword"].IsEmpty()) { strSql.Append(" and ( t.TextBookNo like @keyword or t.TextBookName like @keyword or t.FirstAuthor like @keyword )"); @@ -184,6 +189,37 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 提交 + /// + /// + public void SubmitEntity(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + var entity = BaseRepository("CollegeMIS").FindEntity(x => x.ID == item); + entity.IsSubmit = 1; + db.Update(entity); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion }