瀏覽代碼

fzp 正式部署参数

master
liangkun 1 年之前
父節點
當前提交
b33afb7323
共有 1 個文件被更改,包括 48 次插入48 次删除
  1. +48
    -48
      DigitalSchoolApi/Controllers/PayFeeResultTwoController.cs

+ 48
- 48
DigitalSchoolApi/Controllers/PayFeeResultTwoController.cs 查看文件

@@ -33,7 +33,7 @@ namespace DigitalSchoolApi.Controllers
/// <returns></returns>
public IHttpActionResult GetLastTenMinutes()
{
RecurringJob.AddOrUpdate("PayFeeResultMinutes",
RecurringJob.AddOrUpdate("PayFeeResultMinutes20",
() => GetResult(true),
Cron.Minutely, TimeZoneInfo.Local);
return Ok();
@@ -44,7 +44,7 @@ namespace DigitalSchoolApi.Controllers
/// <returns></returns>
public IHttpActionResult GetLastDay()
{
RecurringJob.AddOrUpdate("PayFeeResultDay",
RecurringJob.AddOrUpdate("PayFeeResultDay20",
() => GetResult(false),
Cron.Daily(0), TimeZoneInfo.Local);
return Ok();
@@ -119,49 +119,49 @@ namespace DigitalSchoolApi.Controllers
foreach (var item in list)
{
//轮询建行商户平台
//XmlDocument xml = new XmlDocument();
//xml.Load(AppContext.BaseDirectory + "\\Content\\payxml\\PayResultXMLFile.xml");
//((XmlElement)xml.SelectSingleNode("TX/REQUEST_SN")).InnerText = DateTime.Now.ToString("yyyyMMddHHmmssfff");
//((XmlElement)xml.SelectSingleNode("TX/TX_INFO/ORDER")).InnerText = item.orderid;
//((XmlElement)xml.SelectSingleNode("TX/USER_ID")).InnerText = "002";
//((XmlElement)xml.SelectSingleNode("TX/PASSWORD")).InnerText = "xcyz123456";
//string par = "requestXml=" + xml.InnerXml;
////最后将字符串参数进行Url编码
//Encoding encoding = Encoding.GetEncoding("gb2312");
//byte[] payload = encoding.GetBytes(par);
//HttpClient httpClient = new HttpClient();
//HttpContent content = new ByteArrayContent(payload);
//string reStr = httpClient.PostAsync(payresulturl, content).Result.Content.ReadAsStringAsync().Result;
//xml.LoadXml(reStr);
//string s = ((XmlElement)xml.SelectSingleNode("TX/RETURN_CODE")).InnerText;
string s = "000000";
XmlDocument xml = new XmlDocument();
xml.Load(AppContext.BaseDirectory + "\\Content\\payxml\\PayResultXMLFile.xml");
((XmlElement)xml.SelectSingleNode("TX/REQUEST_SN")).InnerText = DateTime.Now.ToString("yyyyMMddHHmmssfff");
((XmlElement)xml.SelectSingleNode("TX/TX_INFO/ORDER")).InnerText = item.orderid;
((XmlElement)xml.SelectSingleNode("TX/USER_ID")).InnerText = "002";
((XmlElement)xml.SelectSingleNode("TX/PASSWORD")).InnerText = "xcyz123456";
string par = "requestXml=" + xml.InnerXml;
//最后将字符串参数进行Url编码
Encoding encoding = Encoding.GetEncoding("gb2312");
byte[] payload = encoding.GetBytes(par);
HttpClient httpClient = new HttpClient();
HttpContent content = new ByteArrayContent(payload);
string reStr = httpClient.PostAsync(payresulturl, content).Result.Content.ReadAsStringAsync().Result;
xml.LoadXml(reStr);
string s = ((XmlElement)xml.SelectSingleNode("TX/RETURN_CODE")).InnerText;
//string s = "000000";
if (s.Equals("000000"))
{
//using (IDbConnection conncore = new SqlConnection(_coresqlConnection))
//{
// conncore.Execute(
// "insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'ccb','" + Learun.Util.Str.ReplaceHtml(reStr) + "',getdate())");
//}
//string Orderid = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/ORDER")).InnerText;
//string PAYMENT_MONEY = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/PAYMENT_MONEY")).InnerText;
//string ORDER_STATUS = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/ORDER_STATUS")).InnerText;
//string PAY_MODE = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/PAY_MODE")).InnerText;
//string OriOvrlsttnEV_Trck_No = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/OriOvrlsttnEV_Trck_No")).InnerText;
//string TRAN_DATE = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/TRAN_DATE")).InnerText;
//DateTime paytimedatetime = DateTime.Now;
//DateTime.TryParse(TRAN_DATE, out paytimedatetime);
////remark1 为学号
//string REM1 = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/REM1")).InnerText;
////remark2 为缴费年度
//string REM2 = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/REM2")).InnerText;
string PAYMENT_MONEY = item.SJAmount.ToString();
string ORDER_STATUS = "1";
string TRAN_DATE = DateTime.Now.ToString();
string PAY_MODE = "ZFB";
string OriOvrlsttnEV_Trck_No = "test001";
string Orderid = item.orderid;
string REM1 = item.StuNo;
string REM2 = item.YearNo.ToString();
using (IDbConnection conncore = new SqlConnection(_coresqlConnection))
{
conncore.Execute(
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'ccb','" + Learun.Util.Str.ReplaceHtml(reStr) + "',getdate())");
}
string Orderid = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/ORDER")).InnerText;
string PAYMENT_MONEY = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/PAYMENT_MONEY")).InnerText;
string ORDER_STATUS = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/ORDER_STATUS")).InnerText;
string PAY_MODE = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/PAY_MODE")).InnerText;
string OriOvrlsttnEV_Trck_No = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/OriOvrlsttnEV_Trck_No")).InnerText;
string TRAN_DATE = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/TRAN_DATE")).InnerText;
DateTime paytimedatetime = DateTime.Now;
DateTime.TryParse(TRAN_DATE, out paytimedatetime);
//remark1 为学号
string REM1 = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/REM1")).InnerText;
//remark2 为缴费年度
string REM2 = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/REM2")).InnerText;
//string PAYMENT_MONEY = item.SJAmount.ToString();
//string ORDER_STATUS = "1";
//string TRAN_DATE = DateTime.Now.ToString();
//string PAY_MODE = "ZFB";
//string OriOvrlsttnEV_Trck_No = "test001";
//string Orderid = item.orderid;
//string REM1 = item.StuNo;
//string REM2 = item.YearNo.ToString();
if (ORDER_STATUS=="1")
{
conn.Execute("update FinaChargeStuOrder set SJAmount='" + PAYMENT_MONEY + "',Status='" + ORDER_STATUS + "',PayTime='" + TRAN_DATE + "',PayMode='" + PAY_MODE + "',BankOrder='" + OriOvrlsttnEV_Trck_No + "' where orderid='" + Orderid + "'");
@@ -231,11 +231,11 @@ group by a.FSYear,b.StuNo ) aa left join
}
else
{
//using (IDbConnection conncore = new SqlConnection(_coresqlConnection))
//{
// conncore.Execute(
// "insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'ccb','error:code=" + s + "xml=" + Learun.Util.Str.ReplaceHtml(reStr) + "',getdate())");
//}
using (IDbConnection conncore = new SqlConnection(_coresqlConnection))
{
conncore.Execute(
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'ccb','error:code=" + s + "xml=" + Learun.Util.Str.ReplaceHtml(reStr) + "',getdate())");
}
}
}
}


Loading…
取消
儲存