@@ -10,11 +10,14 @@ using NPOI.XSSF.UserModel; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Data; | using System.Data; | ||||
using System.Drawing; | |||||
using System.IO; | using System.IO; | ||||
using System.Linq; | using System.Linq; | ||||
using System.Security.Cryptography; | |||||
using System.Text; | using System.Text; | ||||
using System.Web; | using System.Web; | ||||
using System.Web.Mvc; | using System.Web.Mvc; | ||||
using ThoughtWorks.QRCode.Codec; | |||||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | ||||
{ | { | ||||
@@ -634,6 +637,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
var PayFeeTotal = FinaChargesStandardList.Select(x => x.Standard).Sum(); | var PayFeeTotal = FinaChargesStandardList.Select(x => x.Standard).Sum(); | ||||
var jsonData = new | var jsonData = new | ||||
{ | { | ||||
StuInfoFreshData = StuInfoFreshData, | |||||
FinaChargesStandardList = FinaChargesStandardList, | FinaChargesStandardList = FinaChargesStandardList, | ||||
PayFeeTotal = PayFeeTotal | PayFeeTotal = PayFeeTotal | ||||
}; | }; | ||||
@@ -1226,6 +1230,62 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
} | } | ||||
/// <summary> | |||||
/// 生成缴费二维码 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult PayFeeQRCode(string keyValue) | |||||
{ | |||||
var imgUrl = ""; | |||||
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 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 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); | |||||
//HttpConnect conn = new HttpConnect(); | |||||
//string reJson = conn.Post(url, ""); | |||||
JsonBean MemberInfoList = JsonConvert.DeserializeObject<JsonBean>(reJson); | |||||
if (MemberInfoList.SUCCESS.Equals("true")) | |||||
{ | |||||
string imgCode = HttpMethods.Post(MemberInfoList.PAYURL); | |||||
MemberInfoList = JsonConvert.DeserializeObject<JsonBean>(imgCode); | |||||
if (MemberInfoList.SUCCESS.Equals("true")) | |||||
{ | |||||
imgUrl = CreateQRImg(MemberInfoList.QRURL, orderid); | |||||
} | |||||
} | |||||
return Success(imgUrl); | |||||
} | |||||
#endregion | #endregion | ||||
#region 上传图片 | #region 上传图片 | ||||
@@ -1279,5 +1339,50 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
} | } | ||||
#endregion | #endregion | ||||
public class JsonBean | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string SUCCESS { get; set; } | |||||
public string PAYURL { get; set; } | |||||
public string QRURL { get; set; } | |||||
} | |||||
/// <summary> | |||||
/// 生成并保存二维码图片的方法 | |||||
/// </summary> | |||||
/// <param name="str">输入的内容</param> | |||||
public string CreateQRImg(string str, string orderId) | |||||
{ | |||||
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; | |||||
//保存二维码图片在photos路径下 | |||||
try | |||||
{ | |||||
bt.Save(Server.MapPath("~/Content/images/") + filename + ".jpg"); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
return ""; | |||||
} | |||||
//图片控件要显示的二维码图片路径 | |||||
return "~/Content/images/" + filename + ".jpg"; | |||||
} | |||||
} | } | ||||
} | } |
@@ -18,21 +18,23 @@ | |||||
margin-right:50px; | margin-right:50px; | ||||
margin-top:20px; | margin-top:20px; | ||||
} | } | ||||
.table { | |||||
text-align: center; | |||||
margin: auto; | |||||
} | |||||
.tableLeft { | |||||
width: 30%; | |||||
} | |||||
</style> | </style> | ||||
<div class="lr-form-wrap" id="form"> | <div class="lr-form-wrap" id="form"> | ||||
<div class="title">费用明细</div> | <div class="title">费用明细</div> | ||||
<table class="table table-bordered" id="PayFeeDetail"> | |||||
@*<tr> | |||||
<td>第一项</td> | |||||
<td>100元</td> | |||||
</tr> | |||||
<tr> | |||||
<td colspan="2">合计:200元</td> | |||||
</tr>*@ | |||||
</table> | |||||
<table class="table table-bordered" id="PayFeeDetail"> | |||||
</table> | |||||
<div id="btnBox"> | <div id="btnBox"> | ||||
<div id="confirmPayFee" class="btn btn-primary">确认缴费</div> | |||||
<div id="cancelPayFee" class="btn btn-default">取消缴费</div> | |||||
<div id="confirmPayFee" class="btn btn-primary">支付</div> | |||||
<div id="searchPayFee" class="btn btn-success">查询</div> | |||||
<div id="cancelPayFee" class="btn btn-default">取消</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuInfoFresh/PayFeeForm.js") | @Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuInfoFresh/PayFeeForm.js") |
@@ -6,6 +6,7 @@ | |||||
*/ | */ | ||||
var acceptClick; | var acceptClick; | ||||
var keyValue = request('keyValue'); | var keyValue = request('keyValue'); | ||||
var PayFeeTotal = 0;//应交费用 | |||||
var bootstrap = function ($, learun) { | var bootstrap = function ($, learun) { | ||||
"use strict"; | "use strict"; | ||||
var page = { | var page = { | ||||
@@ -15,11 +16,33 @@ var bootstrap = function ($, learun) { | |||||
page.initData(); | page.initData(); | ||||
}, | }, | ||||
bind: function () { | bind: function () { | ||||
//确认缴费 | |||||
//获取缴费二维码 | |||||
$('#confirmPayFee').click(function () { | $('#confirmPayFee').click(function () { | ||||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/IsPayFee', { keyValue: keyValue, status: 1 }, function () { | |||||
learun.frameTab.currentIframe().refreshGirdData(); | |||||
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) { | |||||
learun.loading(false); | |||||
console.log(res); | |||||
$('#qrcodeImg').attr('src', res.info); | |||||
//if (res.code == learun.httpCode.success) { | |||||
// if (!!callback) { | |||||
// callback(res); | |||||
// } | |||||
// learun.alert.success(res.info); | |||||
//} | |||||
//else { | |||||
// learun.alert.error(res.info); | |||||
// learun.httpErrorLog(res.info); | |||||
//} | |||||
//layer.close(layer.index); | |||||
}); | }); | ||||
//learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/PayFeeQRCode', { keyValue: keyValue}, function () { | |||||
// learun.frameTab.currentIframe().refreshGirdData(); | |||||
//}); | |||||
}); | }); | ||||
//取消缴费 | //取消缴费 | ||||
$('#cancelPayFee').click(function () { | $('#cancelPayFee').click(function () { | ||||
@@ -28,16 +51,51 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
}); | }); | ||||
//计算实交金额 | |||||
$('table').on('change', | |||||
'.paydetail', | |||||
function () { | |||||
var num = 0; | |||||
$(".paydetail").each(function (i, item) { | |||||
num += parseFloat($(this).val()); | |||||
}); | |||||
$('#PayMoney').html(num); | |||||
}); | |||||
}, | }, | ||||
initData: function () { | initData: function () { | ||||
if (!!keyValue) { | if (!!keyValue) { | ||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetPayFeeDetail?keyValue=' + keyValue, function (data) { | $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetPayFeeDetail?keyValue=' + keyValue, function (data) { | ||||
var html = ""; | |||||
html += '<tr><td>收费项目名称</td><td>收费项目标准</td></tr>'; | |||||
var StuInfoFresh = data['StuInfoFreshData']; | |||||
var className = ""; | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||||
key: StuInfoFresh.ClassNo, | |||||
keyId: 'classno', | |||||
callback: function (_data) { | |||||
className = _data['classname']; | |||||
} | |||||
}); | |||||
var deptName = ""; | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', | |||||
key: StuInfoFresh.DeptNo, | |||||
keyId: 'deptno', | |||||
callback: function (_data) { | |||||
deptName = _data['deptname']; | |||||
} | |||||
}); | |||||
PayFeeTotal = parseFloat(data['PayFeeTotal']); | |||||
var html = "<tr><td class=\"tableLeft\">学号</td><td class=\"tableLeft\">" + StuInfoFresh.StuNo + "</td><td class=\"tableRight qrcode\" rowspan=\"4\"><img id='qrcodeImg'/></td></tr>"; | |||||
html += "<tr><td>姓名</td> <td>" + StuInfoFresh.StuName + "</td></tr>"; | |||||
html += "<tr><td>班级</td><td>" + className + "</td></tr>"; | |||||
html += "<tr><td>系别</td><td>" + deptName + "</td></tr>"; | |||||
html += '<tr><td>缴费项目</td><td>应交费用</td><td>本次实交</td></tr>'; | |||||
$.each(data['FinaChargesStandardList'], function (i, item) { | $.each(data['FinaChargesStandardList'], function (i, item) { | ||||
html += '<tr><td>' + item.ChargeItemName + '</td><td>' + item.Standard + '元</td></tr>'; | |||||
html += '<tr><td>' + item.ChargeItemName + '</td><td>' + item.Standard + '元</td><td><input id="' + item.ChargeItemID + '" type="number" class="form-control paydetail" value="' + item.Standard + '" /></td></tr>'; | |||||
}); | }); | ||||
html += '<tr><td colspan = "2">合计: ' + data['PayFeeTotal'] + '元</td></tr>'; | |||||
html += '<tr><td>合计</td><td>' + data['PayFeeTotal'] + '元</td><td><span id="PayMoney">' + data['PayFeeTotal'] + '</span></td></tr>'; | |||||
html += '<tr><td>贷款金额</td><td colspan="2"><input id="LoanMoney" type="number" class="form-control" /></td></tr>'; | |||||
html += '<tr><td>已交金额</td><td colspan="2"></td></tr>'; | |||||
$('#PayFeeDetail').html(html); | $('#PayFeeDetail').html(html); | ||||
}); | }); | ||||
} | } | ||||
@@ -25,6 +25,7 @@ | |||||
<a id="lr_synchronous" class="btn btn-default"><i class="fa fa-plus"></i> 同步</a> | <a id="lr_synchronous" class="btn btn-default"><i class="fa fa-plus"></i> 同步</a> | ||||
<a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 查看</a> | <a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 查看</a> | ||||
@*<a id="lr_payFee" class="btn btn-default"><i class="fa fa-plus"></i> 缴费</a>*@ | @*<a id="lr_payFee" class="btn btn-default"><i class="fa fa-plus"></i> 缴费</a>*@ | ||||
<a id="lr_payCode" class="btn btn-default"><i class="fa fa-plus"></i> 二维码缴费</a> | |||||
<a id="lr_pay" class="btn btn-default"><i class="fa fa-plus"></i> 线上缴费</a> | <a id="lr_pay" class="btn btn-default"><i class="fa fa-plus"></i> 线上缴费</a> | ||||
<a id="lr_cancelPay" class="btn btn-default"><i class="fa fa-trash-o"></i> 取消线上缴费</a> | <a id="lr_cancelPay" class="btn btn-default"><i class="fa fa-trash-o"></i> 取消线上缴费</a> | ||||
@*<a id="lr_loan" class="btn btn-default"><i class="fa fa-plus"></i> 填写贷款回执码</a>*@ | @*<a id="lr_loan" class="btn btn-default"><i class="fa fa-plus"></i> 填写贷款回执码</a>*@ | ||||
@@ -39,6 +39,25 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
//二维码缴费 | |||||
$('#lr_payCode').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||||
selectedRow = $('#gridtable').jfGridGet('rowdata'); | |||||
if (learun.checkrow(keyValue)) { | |||||
if (selectedRow.PayFeeStatus == "1") { | |||||
learun.alert.warning("当前新生已缴费!"); | |||||
return; | |||||
} | |||||
learun.layerForm({ | |||||
id: 'form_payCode', | |||||
title: '二维码缴费', | |||||
url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/PayFeeForm?keyValue=' + keyValue, | |||||
width: 800, | |||||
height: 600, | |||||
btn: null | |||||
}); | |||||
} | |||||
}); | |||||
// 缴费 | // 缴费 | ||||
$('#lr_payFee').on('click', function () { | $('#lr_payFee').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
@@ -265,6 +265,9 @@ | |||||
<Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | <Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||||
<HintPath>..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath> | <HintPath>..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath> | ||||
</Reference> | </Reference> | ||||
<Reference Include="ThoughtWorks.QRCode, Version=1.0.4778.30637, Culture=neutral, processorArchitecture=MSIL"> | |||||
<HintPath>..\packages\ThoughtWorks.QRCode.1.1.0\lib\ThoughtWorks.QRCode.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="WindowsBase" /> | <Reference Include="WindowsBase" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -75,5 +75,6 @@ | |||||
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net462" /> | <package id="System.Threading.Timer" version="4.3.0" targetFramework="net462" /> | ||||
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net462" /> | <package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net462" /> | ||||
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="net462" /> | <package id="System.Xml.XDocument" version="4.3.0" targetFramework="net462" /> | ||||
<package id="ThoughtWorks.QRCode" version="1.1.0" targetFramework="net462" /> | |||||
<package id="Unity" version="4.0.1" targetFramework="net45" /> | <package id="Unity" version="4.0.1" targetFramework="net45" /> | ||||
</packages> | </packages> |
@@ -619,6 +619,27 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
[Column("BANKLOCATION")] | [Column("BANKLOCATION")] | ||||
public string BankLocation { get; set; } | public string BankLocation { get; set; } | ||||
/// <summary> | |||||
/// 缴费明细 | |||||
/// </summary> | |||||
[Column("PAYFEEDETAIL")] | |||||
public string PayFeeDetail { get; set; } | |||||
/// <summary> | |||||
/// 缴费金额 | |||||
/// </summary> | |||||
[Column("PAYMONEY")] | |||||
public decimal? PayMoney { get; set; } | |||||
/// <summary> | |||||
/// 贷款金额 | |||||
/// </summary> | |||||
[Column("LOANMONEY")] | |||||
public decimal? LoanMoney { get; set; } | |||||
/// <summary> | |||||
/// 是否开票 | |||||
/// </summary> | |||||
[Column("ISINVOICE")] | |||||
public int? IsInvoice { get; set; } | |||||
#endregion | #endregion | ||||
#region 扩展操作 | #region 扩展操作 | ||||