From d64e1e5d76063fc34017813274bfec51547a57ce Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 5 Jul 2022 17:46:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=94=9F=E7=BC=B4=E8=B4=B9=E7=AE=A1?= =?UTF-8?q?=E7=90=86--=E4=BA=8C=E7=BB=B4=E7=A0=81=E7=BC=B4=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ .../Controllers/StuInfoFreshController.cs | 33 ++++++++++++------- .../Views/StuInfoFresh/PayFeeForm.cshtml | 29 ++++++++-------- .../Views/StuInfoFresh/PayFeeForm.js | 22 ++++++++----- .../Learun.Application.Web.csproj | 1 + 5 files changed, 55 insertions(+), 32 deletions(-) diff --git a/.gitignore b/.gitignore index 8a18751f3..28c4a73a5 100644 --- a/.gitignore +++ b/.gitignore @@ -79,3 +79,5 @@ Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js /Learun.Framework.Ultimate V7/Learun.Application.Mobile/platforms/android/assets/www /Learun.Framework.Ultimate V7/Learun.Application.Mobile/www.7z /Learun.Framework.Ultimate V7/Learun.Application.WebApi/bin.7z +/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/QRCode +/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoFreshController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoFreshController.cs index 42e508bc2..b14c7d041 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoFreshController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoFreshController.cs @@ -1237,20 +1237,21 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// [HttpPost] [AjaxOnly] - public ActionResult PayFeeQRCode(string keyValue) + public ActionResult PayFeeQRCode(string keyValue, string strEntity) { + StuInfoFreshEntity entity = strEntity.ToObject(); + var model = stuInfoFreshIBLL.GetStuInfoFreshEntity(keyValue); var imgUrl = ""; - Random ran = new Random(); - string merchantid = "105000082201406"; //UAT--可用防钓鱼接口 - string posid = "043724806"; //分行代码 + Random ran = new Random(); + string merchantid = "105000082201406";//UAT--可用防钓鱼接口 + string posid = "043724806";//分行代码 string branchid = "510000000"; string orderid = DateTime.Now.ToString("yyyyMMddhhmmss") + ran.Next(0, 100000); - string payment = "788"; - //string payment = "0.1"; + string payment = entity.PayMoney.ToString(); string curcode = "01"; string txcode = "530550"; - string remark1 = "51d7ab92-1b3d-43f8-9b34-5ecc6e118804" + "-" + "2021";// bean.stuId +"-" + bean.feiYear; - string remark2 = "02!700&03!88&";// reKey; + string remark1 = model.StuNo + "-20" + model.Grade; + string remark2 = entity.PayFeeDetail.Replace("&", "-"); string returntype = "3"; string timeout = DateTime.Now.AddMinutes(10).ToString("yyyyMMddHHmmss"); string pub32tr2 = "40d987faa793a0a27e7a86ef020111"; @@ -1280,10 +1281,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers MemberInfoList = JsonConvert.DeserializeObject(imgCode); if (MemberInfoList.SUCCESS.Equals("true")) { - imgUrl = CreateQRImg(MemberInfoList.QRURL, orderid); + imgUrl = CreateQRImg(MemberInfoList.QRURL, orderid); } } + if (!string.IsNullOrEmpty(imgUrl)) + { + model.PayFeeDetail = entity.PayFeeDetail; + model.PayMoney = entity.PayMoney; + model.LoanMoney = entity.LoanMoney; + stuInfoFreshIBLL.SaveEntity(keyValue, model); + } + return Success(imgUrl); } #endregion @@ -1370,10 +1379,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers bt = qrCodeEncoder.Encode(enCodeString, Encoding.UTF8); //二维码图片的名称 string filename = orderId; + + var path = Server.MapPath("~/Content/images/QRCode/") + filename + ".jpg"; //保存二维码图片在photos路径下 try { - bt.Save(Server.MapPath("~/Content/images/") + filename + ".jpg"); + bt.Save(path); } catch (Exception ex) { @@ -1382,7 +1393,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } //图片控件要显示的二维码图片路径 - return "~/Content/images/" + filename + ".jpg"; + return "/Content/images/QRCode/" + filename + ".jpg"; } } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/PayFeeForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/PayFeeForm.cshtml index ba7fa3451..dfd317d8d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/PayFeeForm.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/PayFeeForm.cshtml @@ -3,34 +3,37 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
费用明细
- - -
+
支付
查询
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/PayFeeForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/PayFeeForm.js index c83802f23..55dd46335 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/PayFeeForm.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/PayFeeForm.js @@ -21,13 +21,22 @@ var bootstrap = function ($, learun) { if (parseFloat($('#PayMoney').html()) > PayFeeTotal) { return learun.alert.warning("所交费用超出应交费用!"); } - //$('.paydetail').each(function(i, item) { - // console.log('item',item); - //}); - learun.httpAsyncPost(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/PayFeeQRCode', { keyValue: keyValue }, function (res) { + var detail = ""; + $('.paydetail').each(function (i, item) { + detail += $(this).attr('id') + "!" + $(this).attr('value') + '&'; + }); + detail = detail.substring(0, detail.length - 1); + var param = {}; + param.LoanMoney = $('#LoanMoney').val(); + param.PayFeeDetail = detail; + param.PayMoney = $('#PayMoney').html(); + //console.log('asd', JSON.stringify(param)); + //$('#qrcodeImg').attr('src', "/Content/images/QRCode/2022070505103378891.jpg"); + //return; + learun.httpAsyncPost(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/PayFeeQRCode?keyValue=' + keyValue, { strEntity: JSON.stringify(param) }, function (res) { learun.loading(false); console.log(res); - $('#qrcodeImg').attr('src', res.info); + $('#qrcodeImg').attr('src', res.info); //if (res.code == learun.httpCode.success) { // if (!!callback) { // callback(res); @@ -40,9 +49,6 @@ var bootstrap = function ($, learun) { //} //layer.close(layer.index); }); - //learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/PayFeeQRCode', { keyValue: keyValue}, function () { - // learun.frameTab.currentIframe().refreshGirdData(); - //}); }); //取消缴费 $('#cancelPayFee').click(function () { 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 4f8c14602..a3db0315b 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 @@ -6432,6 +6432,7 @@ +