Commit cc483f04 authored by 黄奎's avatar 黄奎

代码优化

parent c01b360e
...@@ -24,14 +24,11 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -24,14 +24,11 @@ namespace Mall.WebApi.Controllers.AppletWeChat
[EnableCors("AllowCors")] [EnableCors("AllowCors")]
public class WeChatNotifyController : Controller public class WeChatNotifyController : Controller
{ {
private static object _lock = new object(); private readonly object _lock = new object();
readonly UserCommonModule userCommonModule = new UserCommonModule();
UserCommonModule userCommonModule = new UserCommonModule(); readonly Module.MarketingCenter.RechargeModule rechargeModule = new Module.MarketingCenter.RechargeModule();
readonly Module.Education.PointModule pointModule = new Module.Education.PointModule();
//public UserModule userModule = new UserModule(); private readonly IHttpContextAccessor _accessor;
Module.MarketingCenter.RechargeModule rechargeModule = new Module.MarketingCenter.RechargeModule();
Module.Education.PointModule pointModule = new Module.Education.PointModule();
private IHttpContextAccessor _accessor;
/// <summary> /// <summary>
/// 构造函数 /// 构造函数
...@@ -186,7 +183,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -186,7 +183,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
#region 新增订单支付信息 #region 新增订单支付信息
// pointModule.UpdatePointOrder(UserId, OrderId, sOrderNo, TransactionId, Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, PayType, dPaid, PayDate); // pointModule.UpdatePointOrder(UserId, OrderId, sOrderNo, TransactionId, Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, PayType, dPaid, PayDate);
pointModule.UpdatePointOrder(new Model.Extend.Point.RB_Point_Order_Extend { ID= OrderId,OrderNo=sOrderNo,Income= dPaid ,MerchantsNo= TransactionId,PaymentTime= PayDate }); pointModule.UpdatePointOrder(new Model.Extend.Point.RB_Point_Order_Extend { ID = OrderId, OrderNo = sOrderNo, Income = dPaid, MerchantsNo = TransactionId, PaymentTime = PayDate });
#endregion #endregion
} }
...@@ -221,10 +218,10 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -221,10 +218,10 @@ namespace Mall.WebApi.Controllers.AppletWeChat
var req = new RequestHandler(); var req = new RequestHandler();
App_Code.PayUtil PayUtil = new App_Code.PayUtil(); App_Code.PayUtil PayUtil = new App_Code.PayUtil();
var result = PayUtil.NotifyZhouTian(_accessor); var result = PayUtil.NotifyZhouTian(_accessor);
LogHelper.WriteInfo( "NotifyZhouTian返回信息进来了" ); LogHelper.WriteInfo("NotifyZhouTian返回信息进来了");
if (result.IsSuccess) if (result.IsSuccess)
{ {
LogHelper.WriteInfo( "NotifyZhouTian回调成功:"+ result.ToString()); LogHelper.WriteInfo("NotifyZhouTian回调成功:" + result.ToString());
var dic = ((Dictionary<string, string>)result.Data); var dic = ((Dictionary<string, string>)result.Data);
//开始回写订单状态 //开始回写订单状态
lock (_lock) lock (_lock)
...@@ -240,7 +237,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -240,7 +237,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
DateTime PayDate = DateTime.ParseExact(dic["PayDate"], "yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture);//转换时间// Convert.ToDateTime(dic["PayDate"]); DateTime PayDate = DateTime.ParseExact(dic["PayDate"], "yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture);//转换时间// Convert.ToDateTime(dic["PayDate"]);
#region 新增订单支付信息 #region 新增订单支付信息
LogHelper.WriteInfo( "NotifyZhouTian订单信息"); LogHelper.WriteInfo("NotifyZhouTian订单信息");
userCommonModule.InsertOrderPayInfo(UserId, OrderId, sOrderNo, TransactionId, Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, PayType, dPaid, PayDate, 0); userCommonModule.InsertOrderPayInfo(UserId, OrderId, sOrderNo, TransactionId, Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, PayType, dPaid, PayDate, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment