From 705088373f6df9b4b53293c5101b4997da1f216e Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Thu, 5 Sep 2024 09:42:56 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E7=BC=B4?= =?UTF-8?q?=E8=B4=B9=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86=EF=BC=9A=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=BC=B4=E8=B4=B9=E9=87=91=E9=A2=9D=E6=80=BB=E5=90=88?= =?UTF-8?q?=E8=AE=A1=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinaChargeStuOrderController.cs | 13 +++ .../Views/FinaChargeStuOrder/Index.cshtml | 3 + .../Views/FinaChargeStuOrder/Index.js | 88 +++++++++++-------- .../FinaChargeStuOrderBLL.cs | 26 +++++- .../FinaChargeStuOrderEntity.cs | 6 ++ .../FinaChargeStuOrderIBLL.cs | 6 ++ .../FinaChargeStuOrderService.cs | 87 ++++++++++++++++++ 7 files changed, 191 insertions(+), 38 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeStuOrderController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeStuOrderController.cs index b265324de..db34a0b9e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeStuOrderController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeStuOrderController.cs @@ -78,6 +78,19 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers return Success(jsonData); } /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetListSum(string queryJson) + { + var data = finaChargeStuOrderIBLL.GetListSum(queryJson).TotalSJAmount; + return Success(data); + } + /// /// 获取表单数据 /// /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuOrder/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuOrder/Index.cshtml index 20d4516f7..0fc091d90 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuOrder/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuOrder/Index.cshtml @@ -58,6 +58,9 @@ +
+
缴费金额合计:0
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuOrder/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuOrder/Index.js index e375f84ca..29c0408f9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuOrder/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuOrder/Index.js @@ -223,7 +223,7 @@ var bootstrap = function ($, learun) { }, { label: "年级", name: "Grade", width: 80, align: "left" }, { label: "缴费年度", name: "YearNo", width: 80, align: "left" }, - { label: "订单编号", name: "orderid", width: 150, align: "left"}, + { label: "订单编号", name: "orderid", width: 150, align: "left" }, { label: "收费标准", name: "YJAmount", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue.toFixed(2); @@ -244,43 +244,49 @@ var bootstrap = function ($, learun) { return cellvalue.toFixed(2); } }, - { label: "缴费状态", name: "Status", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'PayStatus', - callback: function (_data) { - callback(_data.text); - } - }); - }}, - { label: "订单生成时间", name: "PlaceOrderTime", width: 150, align: "left"}, - { label: "付款时间", name: "PayTime", width: 150, align: "left"}, - { label: "支付方式", name: "PayMode", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'PayMode', - callback: function (_data) { - callback(_data.text); - } - }); - }}, - { label: "订单来源", name: "OrderType", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'OrderType', - callback: function (_data) { - callback(_data.text); - } - }); - }}, - { label: "银行订单号", name: "BankOrder", width: 100, align: "left"}, + { + label: "缴费状态", name: "Status", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'PayStatus', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "订单生成时间", name: "PlaceOrderTime", width: 150, align: "left" }, + { label: "付款时间", name: "PayTime", width: 150, align: "left" }, + { + label: "支付方式", name: "PayMode", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'PayMode', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "订单来源", name: "OrderType", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'OrderType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "银行订单号", name: "BankOrder", width: 100, align: "left" }, ], - mainId:'Id', + mainId: 'Id', isPage: true, - sidx:'PlaceOrderTime desc' + sidx: 'PlaceOrderTime desc' }); }, search: function (param) { @@ -288,7 +294,15 @@ var bootstrap = function ($, learun) { param.StartTime = startTime; param.EndTime = endTime; param.YearNo = $('#YearNo').lrselectGet(); - $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + //计算缴费金额合计 + $.lrSetForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FinaChargeStuOrder/GetListSum?queryJson=' + JSON.stringify(param), function (data) { + if (data) { + $("#TotalSJAmount").html(data.toFixed(2)); + } else { + $("#TotalSJAmount").html(0); + } + }); } }; refreshGirdData = function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderBLL.cs index 5280243bb..88de3e120 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderBLL.cs @@ -43,6 +43,30 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement } } + /// + /// 获取列表数据的金额合计 + /// + /// 查询参数 + /// + public FinaChargeStuOrderEntity GetListSum(string queryJson) + { + try + { + return finaChargeStuOrderService.GetListSum(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 获取FinaChargeStuOrder表实体数据 /// @@ -147,7 +171,7 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement { try { - finaChargeStuOrderService.SaveOrderData( entity,list); + finaChargeStuOrderService.SaveOrderData(entity, list); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderEntity.cs index bf617c008..0f7b36e8c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderEntity.cs @@ -126,6 +126,12 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement public string Grade { get; set; } [NotMapped] public string Mobile { get; set; } + /// + /// 缴费金额合计 + /// + [NotMapped] + public decimal TotalSJAmount { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderIBLL.cs index e014c2c36..64d984331 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderIBLL.cs @@ -22,6 +22,12 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement /// IEnumerable GetPageList(Pagination pagination, string queryJson); /// + /// 获取列表数据的金额合计 + /// + /// 查询参数 + /// + FinaChargeStuOrderEntity GetListSum(string queryJson); + /// /// 获取FinaChargeStuOrder表实体数据 /// /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderService.cs index 4490e0b70..c874dbabe 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderService.cs @@ -114,6 +114,93 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement } } + /// + /// 获取列表数据的金额合计 + /// + /// 查询参数 + /// + public FinaChargeStuOrderEntity GetListSum(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT SUM(t.SJAmount) as TotalSJAmount "); + strSql.Append(" FROM FinaChargeStuOrder t left join FinaChargeStudent b on t.StuNo=b.StuNo "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( t.PlaceOrderTime >= @startTime AND t.PlaceOrderTime <= @endTime ) "); + } + if (!queryParam["YearNo"].IsEmpty()) + { + dp.Add("YearNo", "%" + queryParam["YearNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.YearNo Like @YearNo "); + } + if (!queryParam["StuNo"].IsEmpty()) + { + dp.Add("StuNo", "%" + queryParam["StuNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuNo Like @StuNo "); + } + if (!queryParam["DeptNo"].IsEmpty()) + { + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); + strSql.Append(" AND b.DeptNo = @DeptNo "); + } + if (!queryParam["MajorNo"].IsEmpty()) + { + dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); + strSql.Append(" AND b.MajorNo = @MajorNo "); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + strSql.Append(" AND b.ClassNo = @ClassNo "); + } + if (!queryParam["Grade"].IsEmpty()) + { + dp.Add("Grade", "%" + queryParam["Grade"].ToString() + "%", DbType.String); + strSql.Append(" AND b.Grade Like @Grade "); + } + if (!queryParam["Status"].IsEmpty()) + { + dp.Add("Status", queryParam["Status"].ToString(), DbType.String); + strSql.Append(" AND t.Status = @Status "); + } + if (!queryParam["PayMode"].IsEmpty()) + { + dp.Add("PayMode", queryParam["PayMode"].ToString(), DbType.String); + strSql.Append(" AND t.PayMode = @PayMode "); + } + if (!queryParam["OrderType"].IsEmpty()) + { + dp.Add("OrderType", queryParam["OrderType"].ToString(), DbType.String); + strSql.Append(" AND t.OrderType = @OrderType "); + } + if (!queryParam["BankOrder"].IsEmpty()) + { + dp.Add("BankOrder", "%" + queryParam["BankOrder"].ToString() + "%", DbType.String); + strSql.Append(" AND t.BankOrder Like @BankOrder "); + } + return this.BaseRepository("CollegeMIS").FindEntity(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 获取FinaChargeStuOrder表实体数据 ///