|
@@ -212,13 +212,13 @@ namespace MySystem
|
|
if (IsAll == 0 && PayMoney >= MinPayMoney && GetPercent < 1)
|
|
if (IsAll == 0 && PayMoney >= MinPayMoney && GetPercent < 1)
|
|
{
|
|
{
|
|
decimal DiviMoney = PayMoney * (1 - GetPercent - cusumerFeePercent - profitPercent);
|
|
decimal DiviMoney = PayMoney * (1 - GetPercent - cusumerFeePercent - profitPercent);
|
|
- DiviMoney = Math.Round(DiviMoney, 2);
|
|
|
|
if (DiviMoney > 0)
|
|
if (DiviMoney > 0)
|
|
{
|
|
{
|
|
order.ReturnFlag = 1;
|
|
order.ReturnFlag = 1;
|
|
RedisDbconn.Instance.AddRightList("ConsumerOrders:Divi:" + PayMode + ":" + order.MerchantId, order);
|
|
RedisDbconn.Instance.AddRightList("ConsumerOrders:Divi:" + PayMode + ":" + order.MerchantId, order);
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
DiviMoney = DiviMoney / DiviPersons;
|
|
DiviMoney = DiviMoney / DiviPersons;
|
|
|
|
+ DiviMoney = Math.Round(DiviMoney, 2);
|
|
List<int> deletes = new List<int>();
|
|
List<int> deletes = new List<int>();
|
|
long CurDiviPersons = DiviPersons;
|
|
long CurDiviPersons = DiviPersons;
|
|
long QueueCount = RedisDbconn.Instance.Count("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId);
|
|
long QueueCount = RedisDbconn.Instance.Count("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId);
|
|
@@ -312,34 +312,36 @@ namespace MySystem
|
|
{
|
|
{
|
|
// RedisDbconn.Instance.AddList("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId, suborder);
|
|
// RedisDbconn.Instance.AddList("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId, suborder);
|
|
RedisDbconn.Instance.SetList("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId, 0, suborder);
|
|
RedisDbconn.Instance.SetList("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId, 0, suborder);
|
|
|
|
+ RedisDbconn.Instance.AddList("ConsumerOrdersSetDivi", "{\"OrderId\":\"" + suborder.Id + "\",\"DiviAmt\":\"" + suborder.CurDivi + "\"}");
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- suborder.CurDivi = TmpCurDivi;
|
|
|
|
- RedisDbconn.Instance.RemoveFromList("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId, suborder);
|
|
|
|
|
|
+ suborder.CurDivi = TmpCurDivi;
|
|
ConsumerOrders editOrder = db.ConsumerOrders.FirstOrDefault(m => m.Id == suborder.Id);
|
|
ConsumerOrders editOrder = db.ConsumerOrders.FirstOrDefault(m => m.Id == suborder.Id);
|
|
if (editOrder != null)
|
|
if (editOrder != null)
|
|
{
|
|
{
|
|
editOrder.ReturnFlag = 0;
|
|
editOrder.ReturnFlag = 0;
|
|
- editOrder.CurDivi = editOrder.MaxDivi;
|
|
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
|
|
+ RedisDbconn.Instance.AddList("ConsumerOrdersSetDiviHd", "{\"OrderId\":\"" + suborder.Id + "\",\"DiviAmt\":\"" + suborder.MaxDivi + "\"}");
|
|
}
|
|
}
|
|
|
|
+ RedisDbconn.Instance.RemoveFromList("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId, suborder);
|
|
}
|
|
}
|
|
- RedisDbconn.Instance.AddList("ConsumerOrdersSetDivi", "{\"OrderId\":\"" + suborder.Id + "\",\"DiviAmt\":\"" + suborder.CurDivi + "\"}");
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
//否者计算人数不计入退款名额
|
|
//否者计算人数不计入退款名额
|
|
- suborder.CurDivi = TmpCurDivi;
|
|
|
|
- RedisDbconn.Instance.RemoveFromList("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId, suborder);
|
|
|
|
|
|
+ suborder.CurDivi = TmpCurDivi;
|
|
ConsumerOrders editOrder = db.ConsumerOrders.FirstOrDefault(m => m.Id == suborder.Id);
|
|
ConsumerOrders editOrder = db.ConsumerOrders.FirstOrDefault(m => m.Id == suborder.Id);
|
|
if (editOrder != null)
|
|
if (editOrder != null)
|
|
{
|
|
{
|
|
editOrder.ReturnFlag = 0;
|
|
editOrder.ReturnFlag = 0;
|
|
- editOrder.CurDivi = editOrder.MaxDivi;
|
|
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
|
|
+ RedisDbconn.Instance.AddList("ConsumerOrdersSetDiviHd", "{\"OrderId\":\"" + suborder.Id + "\",\"DiviAmt\":\"" + suborder.MaxDivi + "\"}");
|
|
}
|
|
}
|
|
|
|
+ RedisDbconn.Instance.RemoveFromList("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId, suborder);
|
|
|
|
+ TmpOrder tmporder = Newtonsoft.Json.JsonConvert.DeserializeObject<TmpOrder>(Newtonsoft.Json.JsonConvert.SerializeObject(order));
|
|
|
|
+ RedisDbconn.Instance.RemoveFromList("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId, tmporder);
|
|
CurDiviPersons += 1;
|
|
CurDiviPersons += 1;
|
|
}
|
|
}
|
|
}
|
|
}
|