Commit cc483f04 authored by 黄奎's avatar 黄奎

代码优化

parent c01b360e
......@@ -24,14 +24,11 @@ namespace Mall.WebApi.Controllers.AppletWeChat
[EnableCors("AllowCors")]
public class WeChatNotifyController : Controller
{
private static object _lock = new object();
UserCommonModule userCommonModule = new UserCommonModule();
//public UserModule userModule = new UserModule();
Module.MarketingCenter.RechargeModule rechargeModule = new Module.MarketingCenter.RechargeModule();
Module.Education.PointModule pointModule = new Module.Education.PointModule();
private IHttpContextAccessor _accessor;
private readonly object _lock = new object();
readonly UserCommonModule userCommonModule = new UserCommonModule();
readonly Module.MarketingCenter.RechargeModule rechargeModule = new Module.MarketingCenter.RechargeModule();
readonly Module.Education.PointModule pointModule = new Module.Education.PointModule();
private readonly IHttpContextAccessor _accessor;
/// <summary>
/// 构造函数
......@@ -185,8 +182,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat
#region 新增订单支付信息
// 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(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 });
#endregion
}
......@@ -221,10 +218,10 @@ namespace Mall.WebApi.Controllers.AppletWeChat
var req = new RequestHandler();
App_Code.PayUtil PayUtil = new App_Code.PayUtil();
var result = PayUtil.NotifyZhouTian(_accessor);
LogHelper.WriteInfo( "NotifyZhouTian返回信息进来了" );
LogHelper.WriteInfo("NotifyZhouTian返回信息进来了");
if (result.IsSuccess)
{
LogHelper.WriteInfo( "NotifyZhouTian回调成功:"+ result.ToString());
LogHelper.WriteInfo("NotifyZhouTian回调成功:" + result.ToString());
var dic = ((Dictionary<string, string>)result.Data);
//开始回写订单状态
lock (_lock)
......@@ -240,7 +237,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
DateTime PayDate = DateTime.ParseExact(dic["PayDate"], "yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture);//转换时间// Convert.ToDateTime(dic["PayDate"]);
#region 新增订单支付信息
LogHelper.WriteInfo( "NotifyZhouTian订单信息");
LogHelper.WriteInfo("NotifyZhouTian订单信息");
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