From 33fb37e6918f53a13bad95a0f8b3008d014fd881 Mon Sep 17 00:00:00 2001 From: fzp <645608524@qq.com> Date: Fri, 4 Aug 2023 21:54:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/SP_FeeItemController.cs | 29 ++++++-- .../StuPayManage/Views/SP_FeeItem/Form.cshtml | 22 +++--- .../StuPayManage/Views/SP_FeeItem/Form.js | 2 + .../Views/SP_FeeItem/Index.cshtml | 5 ++ .../StuPayManage/Views/SP_FeeItem/Index.js | 33 +++++++-- .../XmlConfig/database.config | 7 +- .../StuPayManage/SP_FeeItem/SP_FeeItemBLL.cs | 38 ++++++++++ .../StuPayManage/SP_FeeItem/SP_FeeItemIBLL.cs | 14 ++++ .../SP_FeeItem/SP_FeeItemService.cs | 70 ++++++++++++++++--- 9 files changed, 192 insertions(+), 28 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Controllers/SP_FeeItemController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Controllers/SP_FeeItemController.cs index e2a483b05..fa4ab32db 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Controllers/SP_FeeItemController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Controllers/SP_FeeItemController.cs @@ -5,6 +5,9 @@ using System.Web.Mvc; using System.Collections.Generic; using Learun.Util.Operat; using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Text.Json.Nodes; +using Newtonsoft.Json; +using System.Linq; namespace Learun.Application.Web.Areas.StuPayManage.Controllers { @@ -28,7 +31,7 @@ namespace Learun.Application.Web.Areas.StuPayManage.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -37,7 +40,7 @@ namespace Learun.Application.Web.Areas.StuPayManage.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } #endregion @@ -73,7 +76,7 @@ namespace Learun.Application.Web.Areas.StuPayManage.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var SP_FeeItemData = sP_FeeItemIBLL.GetSP_FeeItemEntity( keyValue ); + var SP_FeeItemData = sP_FeeItemIBLL.GetSP_FeeItemEntity(keyValue); var jsonData = new { SP_FeeItem = SP_FeeItemData, }; @@ -92,13 +95,31 @@ namespace Learun.Application.Web.Areas.StuPayManage.Controllers [AjaxOnly] public ActionResult DeleteForm(string keyValue) { - SP_FeeItemEntity entity =sP_FeeItemIBLL.GetSP_FeeItemEntity(keyValue); + SP_FeeItemEntity entity = sP_FeeItemIBLL.GetSP_FeeItemEntity(keyValue); if (entity == null) throw new System.Exception("主键无效"); sP_FeeItemIBLL.DeleteEntity(keyValue); //return Success("删除成功!"); return Success_SP("删除成功!", "收费项目", OperationType.Delete, entity.F_Id, entity.ToJson()); } + + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForms(string keyValue) { + + var jsonObj = new { + ids = string.Join(",", keyValue.Split(',').Select(x => $"'{x}'")) + }; + + string queryJson = JsonConvert.SerializeObject(jsonObj); + IEnumerable entitys = sP_FeeItemIBLL.GetList(queryJson); + if (entitys == null || entitys.Count()==0) throw new System.Exception("查无数据"); + sP_FeeItemIBLL.DeleteEntity(entitys); + //return Success("删除成功!"); + return Success_SP("删除成功!", "收费项目", OperationType.Delete, null, entitys.ToJson()); + + } + /// /// 保存实体数据(新增、修改) /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Form.cshtml index b9825b012..fd9e85c82 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Form.cshtml @@ -7,29 +7,33 @@
收费年度*
-
+
项目代码*
-
+
项目名称*
-
+
收费标准*
-
+
项目类型*
-
+
-
+
专业*
-
+
-
+
备注
- + +
+
@Html.AppendJsFile("/Areas/StuPayManage/Views/SP_FeeItem/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Form.js index 605f59284..af7c33f81 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Form.js @@ -25,6 +25,8 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $('#F_Status').lrDataItemSelect({ code: 'SP_AppStatus' }); + $('#F_Status').lrselectSet("0"); }, initData: function () { if (!!keyValue) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Index.cshtml index cb0e5ff79..12c8a0ee9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Index.cshtml @@ -12,6 +12,7 @@
收费年度
+
项目类型
@@ -29,6 +30,10 @@
专业
+
+
审核状态
+
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Index.js index 8d9499d86..ff6ae10b1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/StuPayManage/Views/SP_FeeItem/Index.js @@ -15,9 +15,18 @@ var bootstrap = function ($, learun) { bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); - }, 220, 400); + }, 250, 400); + //收费年度 + $('#YearNo').lrselect({ + placeholder: "请选择", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GenerateNearByYear', + value: 'value', + text: 'text' + }); $('#ChargeItemType').lrDataItemSelect({ code: 'ChargeItemType' }); - $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo',value: 'majorno',text: 'majorname' }); + $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); + $('#F_Status').lrDataItemSelect({ code: 'SP_AppStatus' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -57,7 +66,7 @@ var bootstrap = function ($, learun) { if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/StuPayManage/SP_FeeItem/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/StuPayManage/SP_FeeItem/DeleteForms', { keyValue: keyValue}, function () { refreshGirdData(); }); } @@ -115,10 +124,24 @@ var bootstrap = function ($, learun) { }); }}, { label: "收费标准", name: "Standard", width: 100, align: "center"}, - { label: "备注", name: "Remark", width: 100, align: "left"}, + { label: "备注", name: "Remark", width: 100, align: "left" }, + { label: "审核状态", name: "F_Status", width: 100, align: "center", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'SP_AppStatus', + callback: function (_data) { + callback(_data.text); + } + }); + } + } ], mainId:'F_Id', - isPage: true + isPage: true, + isMultiselect: true, + sord: 'desc', + sidx: 'F_CreateDate' }); page.search(); }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config index 63a1b93ce..fed5c5997 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config @@ -40,8 +40,11 @@ - - + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StuPayManage/SP_FeeItem/SP_FeeItemBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StuPayManage/SP_FeeItem/SP_FeeItemBLL.cs index 8aae83789..9ab4c5e5d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StuPayManage/SP_FeeItem/SP_FeeItemBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StuPayManage/SP_FeeItem/SP_FeeItemBLL.cs @@ -18,6 +18,25 @@ namespace Learun.Application.TwoDevelopment.StuPayManage #region 获取数据 + public IEnumerable GetList(string queryJson) + { + try + { + return sP_FeeItemService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 获取页面显示列表数据 /// @@ -94,6 +113,25 @@ namespace Learun.Application.TwoDevelopment.StuPayManage } } + public void DeleteEntity(IEnumerable entities) { + + try + { + sP_FeeItemService.DeleteEntity(entities); + } + 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/StuPayManage/SP_FeeItem/SP_FeeItemIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StuPayManage/SP_FeeItem/SP_FeeItemIBLL.cs index 28e9fb701..1647615cc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StuPayManage/SP_FeeItem/SP_FeeItemIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StuPayManage/SP_FeeItem/SP_FeeItemIBLL.cs @@ -15,6 +15,13 @@ namespace Learun.Application.TwoDevelopment.StuPayManage { #region 获取数据 + /// + /// 获取列表数据 + /// + /// + /// + IEnumerable GetList(string queryJson); + /// /// 获取页面显示列表数据 /// @@ -36,6 +43,13 @@ namespace Learun.Application.TwoDevelopment.StuPayManage ///
/// 主键 void DeleteEntity(string keyValue); + + /// + /// 批量删除实体数据 + /// + /// 实体数据列表 + void DeleteEntity(IEnumerable entities); + /// /// 保存实体数据(新增、修改) /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StuPayManage/SP_FeeItem/SP_FeeItemService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StuPayManage/SP_FeeItem/SP_FeeItemService.cs index 37baf2dc4..09f2df278 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StuPayManage/SP_FeeItem/SP_FeeItemService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/StuPayManage/SP_FeeItem/SP_FeeItemService.cs @@ -19,6 +19,43 @@ namespace Learun.Application.TwoDevelopment.StuPayManage { #region 获取数据 + /// + /// 获取列表数据 + /// + /// + /// + public IEnumerable GetList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append(" SELECT t.*"); + strSql.Append(" FROM SP_FeeItem t "); + strSql.Append(" where 1=1 "); + + //参数写法 + var queryParam=queryJson.ToJObject(); + // 虚拟参数 + var dp=new DynamicParameters(new {}); + if (!queryParam["ids"].IsEmpty()) { + dp.Add("ids", $"{queryParam["ids"].ToString()}", DbType.String); + strSql.Append(" and t.F_Id in ( @ids ) "); + } + + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } /// /// 获取页面显示列表数据 /// @@ -32,14 +69,7 @@ namespace Learun.Application.TwoDevelopment.StuPayManage var strSql = new StringBuilder(); strSql.Append("SELECT "); strSql.Append(@" - t.F_Id, - t.YearNo, - t.ChargeItemCode, - t.ChargeItemName, - t.MajorNo, - t.ChargeItemType, - t.Standard, - t.Remark + * "); strSql.Append(" FROM SP_FeeItem t "); strSql.Append(" WHERE 1=1 "); @@ -137,6 +167,30 @@ namespace Learun.Application.TwoDevelopment.StuPayManage } } + + /// + /// 批量删除实体数据 + /// + /// 实体数据列表 + public void DeleteEntity(IEnumerable entities) + { + try + { + this.BaseRepository("CollegeMIS").Delete>(entities); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 保存实体数据(新增、修改) ///