浏览代码

分账费率调整

lcl 1 年之前
父节点
当前提交
0c297bc6e1
共有 2 个文件被更改,包括 11 次插入2 次删除
  1. 5 1
      AppStart/Helper/AlipayPayBackService.cs
  2. 6 1
      AppStart/Helper/WeChatPayBackService.cs

+ 5 - 1
AppStart/Helper/AlipayPayBackService.cs

@@ -142,11 +142,15 @@ namespace MySystem
                                 {
                                 {
                                     string TradeNo = order.SeoTitle;
                                     string TradeNo = order.SeoTitle;
                                     string OrderNo = order.OrderNo;
                                     string OrderNo = order.OrderNo;
+                                    decimal hdfee = 0.0038M * order.PayMoney * (1 - set.GetPercent - 0.01M);
+                                    hdfee = decimal.Parse(hdfee.ToString("f2"));
+                                    decimal servicefee = 0.01M * order.PayMoney - hdfee;
+                                    servicefee = decimal.Parse(servicefee.ToString("f2"));
                                     List<RoyaltyParameters> Parameters = new List<RoyaltyParameters>();
                                     List<RoyaltyParameters> Parameters = new List<RoyaltyParameters>();
                                     Parameters.Add(new RoyaltyParameters()
                                     Parameters.Add(new RoyaltyParameters()
                                     {
                                     {
                                         Account = AlipayFunction.Instance.Pid,
                                         Account = AlipayFunction.Instance.Pid,
-                                        Amount = fee.ToString("f2"),
+                                        Amount = servicefee.ToString("f2"),
                                     });
                                     });
                                     string ProfitShareResult = AlipayFunction.Instance.Settle(OrderNo, TradeNo, Parameters, merchantAdd.AlipayAuthToken);
                                     string ProfitShareResult = AlipayFunction.Instance.Settle(OrderNo, TradeNo, Parameters, merchantAdd.AlipayAuthToken);
                                     order.DivideLog = "请求分账日志:" + ProfitShareResult;
                                     order.DivideLog = "请求分账日志:" + ProfitShareResult;

+ 6 - 1
AppStart/Helper/WeChatPayBackService.cs

@@ -180,12 +180,17 @@ namespace MySystem
                                 {
                                 {
                                     string TradeNo = order.SeoTitle;
                                     string TradeNo = order.SeoTitle;
                                     string OrderNo = order.OrderNo;
                                     string OrderNo = order.OrderNo;
+                                    decimal hdfee = 0.0038M * order.PayMoney * (1 - set.GetPercent - 0.01M);
+                                    hdfee = decimal.Parse(hdfee.ToString("f2"));
+                                    decimal servicefee = 0.01M * order.PayMoney - hdfee;
+                                    servicefee = servicefee * 100;
+                                    int servicefeeNum = int.Parse(servicefee.ToString("f0"));
                                     List<ReceiverList> Receivers = new List<ReceiverList>();
                                     List<ReceiverList> Receivers = new List<ReceiverList>();
                                     Receivers.Add(new ReceiverList()
                                     Receivers.Add(new ReceiverList()
                                     {
                                     {
                                         type = "MERCHANT_ID",  //分账接收方类型
                                         type = "MERCHANT_ID",  //分账接收方类型
                                         account = WeChatFunction.Instance.MchId,  //分账接收方账号
                                         account = WeChatFunction.Instance.MchId,  //分账接收方账号
-                                        amount = int.Parse(fee.ToString("f0")),  //分账金额
+                                        amount = servicefeeNum,  //分账金额
                                         description = "服务费",  //分账描述
                                         description = "服务费",  //分账描述
                                     });
                                     });
                                     LogHelper.Instance.WriteLog("TradeNo:" + TradeNo, "微信分账队列监听");
                                     LogHelper.Instance.WriteLog("TradeNo:" + TradeNo, "微信分账队列监听");