From bb406f3ad87c126cde0e05539bbb81546aba9264 Mon Sep 17 00:00:00 2001 From: fzp <645608524@qq.com> Date: Wed, 16 Aug 2023 22:03:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BAapi=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Learun.Application.WebApi.csproj | 6 +- .../FinaChargeStuYearApi.cs | 213 ++++++++++++ .../Learun.Application.WebApi/Web.config | 100 +++--- .../LearunApp-2.2.0/config.js | 10 +- .../ReceiveSendFeeManagement/PayFee/list.vue | 275 +++++++++++++++ .../PayFee/payInvioce.vue | 87 +++++ .../PayFee/single.vue | 319 ++++++++++++++++++ 7 files changed, 951 insertions(+), 59 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/ReceiveSendFeeManagement/FinaChargeStuYearApi.cs create mode 100644 Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ReceiveSendFeeManagement/PayFee/list.vue create mode 100644 Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ReceiveSendFeeManagement/PayFee/payInvioce.vue create mode 100644 Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ReceiveSendFeeManagement/PayFee/single.vue diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj index 64ec50975..d1b76cfc4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj @@ -13,7 +13,7 @@ Properties Learun.Application.WebApi Learun.Application.WebApi - v4.6.1 + v4.6.2 true @@ -107,7 +107,6 @@ ..\packages\Oracle.ManagedDataAccess.EntityFramework.12.1.2400\lib\net45\Oracle.ManagedDataAccess.EntityFramework.dll - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.4\lib\net45\System.Net.Http.Formatting.dll @@ -121,7 +120,6 @@ - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll @@ -155,7 +153,6 @@ - ..\packages\ThoughtWorks.QRCode.1.1.0\lib\ThoughtWorks.QRCode.dll @@ -195,6 +192,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/ReceiveSendFeeManagement/FinaChargeStuYearApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/ReceiveSendFeeManagement/FinaChargeStuYearApi.cs new file mode 100644 index 000000000..0d670acc9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/ReceiveSendFeeManagement/FinaChargeStuYearApi.cs @@ -0,0 +1,213 @@ +using System; +using Learun.Application.Organization; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Application.TwoDevelopment.EvaluationTeach; +using Learun.Util; +using Nancy; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Security.Cryptography; +using System.Text; +using System.Web; +using System.Web.Mvc; +using Learun.Application.Base.SystemModule; +using Learun.Application.TwoDevelopment.Ask; +using Learun.Application.TwoDevelopment.ReceiveSendFeeManagement; +using Newtonsoft.Json; +using ThoughtWorks.QRCode.Codec; + +namespace Learun.Application.WebApi.Modules +{ + /// + /// 版 本 Learun-ADMS V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创建人:数字化智慧校园-框架开发组 + /// 日 期:2018.01.04 + /// 描 述: + /// + public class FinaChargeStuYearApi : BaseApi + { + private FinaChargeStuYearIBLL finaChargeStuYearIBLL = new FinaChargeStuYearBLL(); + + public FinaChargeStuYearApi() + : base("/ReceiveSendFeeManagement/FinaChargeStuYearApi") + { + Get["/getpayfeelist"] = GetPayfeeList;// 获取缴费列表 + //Get["/getpayfeeinfo"] = GetPayfeeInfo;//获取缴费明细 + //Post["/generateqrcode"] = PayFeeQRCode;//生成缴费二维码 + //Get["/getinvoice"] = GetInvoice;//获取发票 + } + + //public Response GetInvoice(dynamic _) + //{ + // string keyValue = Request.Query["keyValue"]; + // var list = stuInfoFreshIBLL.GetStuEnrollFeeOrder(keyValue, false); + // return Success(list); + //} + + public Response GetPayfeeList(dynamic _) + { + ReqPageParam parameter = this.GetReqData(); + var data = finaChargeStuYearIBLL.GetPageList(parameter.pagination, parameter.queryJson); + var jsonData = new + { + rows = data, + total = parameter.pagination.total, + page = parameter.pagination.page, + records = parameter.pagination.records + }; + return Success(jsonData); + } + + //public Response GetPayfeeInfo(dynamic _) + //{ + // string keyValue = Request.Query["keyValue"]; + // var stuInfoBasic_PayFeeEntity = stuInfoBasic_PayFeeIBLL.GetStuInfoBasic_PayFeeEntity(keyValue); + // var StuInfoFreshData = stuInfoBasicIbll.GetStuInfoBasicEntityByStuNo(stuInfoBasic_PayFeeEntity.StuNo); + // //当前年度缴费记录 + // var FinaChargesStandardList = new List(); + // FinaChargesStandardList = finaChargesStandardIBLL.GetFinaChargesStandardListByYongYou(StuInfoFreshData.StuNo, stuInfoBasic_PayFeeEntity.PayYear.Value).ToList(); + // var PayFeeTotal = FinaChargesStandardList.Select(x => x.SJAmount).Sum(); + // var jsonData = new + // { + // StuInfoFreshData = StuInfoFreshData, + // FinaChargesStandardList = FinaChargesStandardList, + // PayFeeTotal = PayFeeTotal, + // YJAmount = FinaChargesStandardList.Sum(x => x.PayedMoney) + // }; + // return Success(jsonData); + //} + + + public class PayfeeRequest + { + public string strEntity { get; set; } + public string detailList { get; set; } + } + + /// + /// 生成缴费二维码 + /// + /// + //public Response PayFeeQRCode(dynamic _) + //{ + // string keyValue = Request.Query["keyValue"]; + // PayfeeRequest parameter = this.GetReqData(); + // StuInfoFreshEntity entity = parameter.strEntity.ToObject(); + // List list = parameter.detailList.ToObject>(); + // var model = stuInfoBasic_PayFeeIBLL.GetStuInfoBasic_PayFeeEntity(keyValue); + // var imgUrl = ""; + // Random ran = new Random(); + // string merchantid = "105000082201406";//商户号 + // string posid = "043724806";//商户柜台代码 + // string branchid = "510000000";//分行代码 + // string orderid = DateTime.Now.ToString("yyyyMMddhhmmss") + ran.Next(0, 100000); + // string payment = entity.PayMoney.ToString(); + // string curcode = "01"; + // string txcode = "530550"; + // string remark1 = model.StuNo; + // string remark2 = model.PayYear.ToString(); + // string returntype = "3"; + // string timeout = DateTime.Now.AddMinutes(10).ToString("yyyyMMddHHmmss"); + // string pub32tr2 = "40d987faa793a0a27e7a86ef020111"; + // string bankURL = "https://ibsbjstar.ccb.com.cn/CCBIS/ccbMain?CCB_IBSVersion=V6"; + // string tmp = "MERCHANTID=" + merchantid + "&POSID=" + posid + "&BRANCHID=" + branchid + "&ORDERID=" + orderid; + // tmp += "&PAYMENT=" + payment + "&CURCODE=" + curcode + "&TXCODE=" + txcode + "&REMARK1=" + remark1; + // tmp += "&REMARK2=" + remark2 + "&RETURNTYPE=" + returntype + "&TIMEOUT=" + timeout; + // MD5 md5 = MD5.Create(); + // string tmp1 = tmp; + // tmp += "&PUB=" + pub32tr2; + // byte[] buffer = Encoding.Default.GetBytes(tmp); + // byte[] md5Buffer = md5.ComputeHash(buffer); + // string strMd5 = ""; + // //hdnOrderId.Value = orderid; + // foreach (byte item in md5Buffer) + // { + // strMd5 += item.ToString("x2"); + // } + // string url = bankURL + "&" + tmp1 + "&MAC=" + strMd5; + // string reJson = HttpMethods.Post(url); + // LogEntity logEntity = new LogEntity(); + // logEntity.F_CategoryId = 121; + // logEntity.F_ExecuteResultJson = reJson; + // logEntity.WriteLog(); + // //HttpConnect conn = new HttpConnect(); + // //string reJson = conn.Post(url, ""); + // JsonBean MemberInfoList = JsonConvert.DeserializeObject(reJson); + // if (MemberInfoList.SUCCESS.Equals("true")) + // { + // string imgCode = HttpMethods.Post(MemberInfoList.PAYURL); + // logEntity.F_CategoryId = 121; + // logEntity.F_ExecuteResultJson = imgCode; + // logEntity.WriteLog(); + // MemberInfoList = JsonConvert.DeserializeObject(imgCode); + // if (MemberInfoList.SUCCESS.Equals("true")) + // { + // imgUrl = CreateQRImg(MemberInfoList.QRURL, orderid); + // } + // } + + // if (!string.IsNullOrEmpty(imgUrl)) + // { + // model.orderid = orderid; + // stuInfoFreshIBLL.SaveFeeData(keyValue, model, list); + // } + + // var backimgUrl = new{ imgUrl }; + // return Success(backimgUrl); + //} + + public class JsonBean + { + /// + /// + /// + public string SUCCESS { get; set; } + public string PAYURL { get; set; } + public string QRURL { get; set; } + } + /// + /// 生成并保存二维码图片的方法 + /// + /// 输入的内容 + public string CreateQRImg(string str, string orderId) + { + string QRCodeFile = Config.GetValue("QRCodeFile"); + Random ran = new Random(); + Bitmap bt; + str = HttpUtility.UrlDecode(str); + string enCodeString = str; + //生成设置编码实例 + QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); + //设置二维码的规模,默认4 + qrCodeEncoder.QRCodeScale = 3; + //设置二维码的版本,默认7 + qrCodeEncoder.QRCodeVersion = 7; + //设置错误校验级别,默认中等 + qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M; + //生成二维码图片 + bt = qrCodeEncoder.Encode(enCodeString, Encoding.UTF8); + //二维码图片的名称 + string filename = orderId; + if (!DirFileHelper.IsExistFile(QRCodeFile+"/Content/images/QRCode/")) + { + Directory.CreateDirectory(QRCodeFile + "/Content/images/QRCode/"); + } + var path = QRCodeFile + "/Content/images/QRCode/" + filename + ".jpg"; + //保存二维码图片在photos路径下 + try + { + bt.Save(path); + } + catch (Exception ex) + { + return ""; + } + + //图片控件要显示的二维码图片路径 + return "/Content/images/QRCode/" + filename + ".jpg"; + } + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Web.config b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Web.config index 2666c219b..ff05da742 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Web.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Web.config @@ -1,4 +1,4 @@ - + -
-
-
-
-
+
+
+
+
+
- - - - + + + + - - + + - + - + - + - - - + + + - - + + - - - - - + + + + + - - - - + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js index 599dabebe..18fcbc9e6 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js @@ -2,7 +2,7 @@ export default { // 登录页显示的公司名称 "company": "数字化智慧校园", // App 版本号 - "appVersion": "2.0", + "appVersion": "1.0.0", // 是否允许用户注册 "enableSignUp": true, //请求数据的接口地址;可以配置多个,开发环境下登录页会出现选择菜单供您选择 @@ -21,12 +21,12 @@ export default { // "http://192.168.2.98:8088/" // ], "apiHost": [ - // "http://localhost:31173/" + "http://localhost:31173/" // "http://123.57.209.16:31173/" - "http://112.45.152.8:8083/" + // "http://112.45.152.8:8083/" ], - // "webHost":"http://123.57.209.16:8081/", - "webHost":"http://112.45.152.8:8000/", + "webHost":"http://localhost:20472/", + // "webHost":"http://112.45.152.8:8000/", // 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 "devAccount": [ // 20201130230 21364200000400266 老师 420528196310072253 学生 420528200606205026 420528200507261428 diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ReceiveSendFeeManagement/PayFee/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ReceiveSendFeeManagement/PayFee/list.vue new file mode 100644 index 000000000..d3ea0a891 --- /dev/null +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ReceiveSendFeeManagement/PayFee/list.vue @@ -0,0 +1,275 @@ + + + + + diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ReceiveSendFeeManagement/PayFee/payInvioce.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ReceiveSendFeeManagement/PayFee/payInvioce.vue new file mode 100644 index 000000000..72fb2501f --- /dev/null +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ReceiveSendFeeManagement/PayFee/payInvioce.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ReceiveSendFeeManagement/PayFee/single.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ReceiveSendFeeManagement/PayFee/single.vue new file mode 100644 index 000000000..c7f473bec --- /dev/null +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ReceiveSendFeeManagement/PayFee/single.vue @@ -0,0 +1,319 @@ + + + + + +