|
@@ -156,15 +156,25 @@ namespace MySystem
|
|
|
|
|
|
//聚合支付退款
|
|
|
bool BackStatus = false;
|
|
|
+
|
|
|
+ //拆单算法
|
|
|
+ int CheckTime = SplitOrder(suborder.PayMoney,subset.MinPayMoney);
|
|
|
+ if(CheckTime > 0)
|
|
|
+ {
|
|
|
+ GetMoney = GetMoney * CheckTime;
|
|
|
+ db.SaveChanges();
|
|
|
+ CurDiviPersons -= CheckTime - 1;
|
|
|
+ }
|
|
|
+
|
|
|
decimal RefundAmount = GetMoney * 100;
|
|
|
RefundAmount = Math.Round(RefundAmount, 2);
|
|
|
if(!orderids.Contains(suborder.Id))
|
|
|
{
|
|
|
function.WriteLog("请求退款接口", "返现逻辑日志");
|
|
|
string RefundNo = "HDTK" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
|
- var info = HaoDaHelper.Instance.AggregatedPayRefund(merchantAdd.OutMchtNo, merchantAdd.StoreNo, RefundNo, suborder.OrderNo, RefundAmount.ToString("f0"));
|
|
|
- if(info.Contains("\"resultCode\":\"1\"") && info.Contains("\"tradeStatus\":\"2\""))
|
|
|
- {
|
|
|
+ // var info = HaoDaHelper.Instance.AggregatedPayRefund(merchantAdd.OutMchtNo, merchantAdd.StoreNo, RefundNo, suborder.OrderNo, RefundAmount.ToString("f0"));
|
|
|
+ // if(info.Contains("\"resultCode\":\"1\"") && info.Contains("\"tradeStatus\":\"2\""))
|
|
|
+ // {
|
|
|
db.ConsumerProfit.Add(new ConsumerProfit()
|
|
|
{
|
|
|
CreateDate = DateTime.Now,
|
|
@@ -180,8 +190,8 @@ namespace MySystem
|
|
|
});
|
|
|
db.SaveChanges();
|
|
|
BackStatus = true;
|
|
|
- }
|
|
|
- function.WriteLog("接口返回:" + info, "返现逻辑日志");
|
|
|
+ // }
|
|
|
+ // function.WriteLog("接口返回:" + info, "返现逻辑日志");
|
|
|
orderids.Add(suborder.Id);
|
|
|
}
|
|
|
|
|
@@ -268,6 +278,15 @@ namespace MySystem
|
|
|
db.Dispose();
|
|
|
function.WriteLog("结束返现:" + orderidstring + "\n\n\n", "返现逻辑日志");
|
|
|
}
|
|
|
+
|
|
|
+ //拆单算法
|
|
|
+ private int SplitOrder(decimal OrderAmt, decimal MinMoney)
|
|
|
+ {
|
|
|
+ decimal percenter = OrderAmt/MinMoney;
|
|
|
+ int Times = int.Parse(percenter.ToString().Split('.')[0]);
|
|
|
+ if(Times < 1) Times = 1;
|
|
|
+ return Times;
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
|