Commit 4c86849c authored by 吴春's avatar 吴春
parents 90e1acfa 3e3edcaa
......@@ -269,6 +269,10 @@ namespace Mall.Module.Product
/// </summary>
private readonly RB_SmallShops_CommissionRepository smallShopsCommissionRepository = new RB_SmallShops_CommissionRepository();
/// <summary>
/// 微店提现
/// </summary>
private readonly RB_SmallShops_RemitRepository smallShops_RemitRepository = new RB_SmallShops_RemitRepository();
/// <summary>
/// 微店信息
/// </summary>
private readonly RB_SmallShops_InfoRepository smallShopsInfoRepository = new RB_SmallShops_InfoRepository();
......@@ -8424,9 +8428,9 @@ namespace Mall.Module.Product
TotalCommission += (item.Commission ?? 0);
}
#region 看微店佣金是否是负数 是的话 需要走总佣金里减去
OldCommission = TotalCommission;
if ((smallModel.Commission ?? 0) < 0)
{
OldCommission = TotalCommission;
TotalCommission += (smallModel?.Commission ?? 0);
}
#endregion
......@@ -8475,7 +8479,7 @@ namespace Mall.Module.Product
}
}
//写入已提现数据
distributor_RemitRepository.Insert(new Model.Entity.User.RB_Distributor_Remit()
smallShops_RemitRepository.Insert(new Model.Entity.User.RB_SmallShops_Remit()
{
Id = 0,
AccountName = "",
......@@ -8495,9 +8499,8 @@ namespace Mall.Module.Product
RemitDate = DateTime.Now,
RemitMoney = RemitMoney,
RemitRemark = "自动结算打款",
ReOrderIds = (orderModel.OrderId).ToString(),
ReOrderNos = orderModel.OrderNo,
ReVipIds = "",
ReOrderIds = "[" + (orderModel.OrderId).ToString() + "]",
ReOrderNos = "\"" + orderModel.OrderNo + "\":" + RemitMoney + "元",
TenantId = tenantId,
UserId = ssmodel.UserId,
WithdrawalWay = DistrbutorWithdrawWayEnum.ZDXJ
......@@ -8527,14 +8530,14 @@ namespace Mall.Module.Product
}
}
//写入已提现数据
distributor_RemitRepository.Insert(new Model.Entity.User.RB_Distributor_Remit()
smallShops_RemitRepository.Insert(new Model.Entity.User.RB_SmallShops_Remit()
{
Id = 0,
AccountName = "",
AccountNumber = "",
AppliedMoney = TotalCommission,
AuditDate = DateTime.Now,
AuditRemark = "自动结算失败,请手动打款",
AuditRemark = "自动现结失败,变更为手动打款",
AuditStatus = DistributorRemitAuditStatusEnum.ToPlayWith,
BankName = "",
CreateDate = DateTime.Now,
......@@ -8547,20 +8550,17 @@ namespace Mall.Module.Product
RemitDate = DateTime.Now,
RemitMoney = RemitMoney,
RemitRemark = "",
ReOrderIds = (orderModel.OrderId).ToString(),
ReOrderNos = orderModel.OrderNo,
ReVipIds = "",
ReOrderIds = "[" + (orderModel.OrderId).ToString() + "]",
ReOrderNos = "\"" + orderModel.OrderNo + "\":" + RemitMoney + "元",
TenantId = tenantId,
UserId = ssmodel.UserId,
WithdrawalWay = DistrbutorWithdrawWayEnum.ZDDK
});
}
if ((smallModel.Commission ?? 0) < 0)
{
//更新微店佣金等于0
Dictionary<string, object> keyValues2 = new Dictionary<string, object>() {
{ nameof(RB_SmallShops_Info_Extend.TotalCommission),(smallModel.TotalCommission??0) + OldCommission},
{ nameof(RB_SmallShops_Info_Extend.Commission),0},
{ nameof(RB_SmallShops_Info_Extend.Commission), TotalCommission}
};
List<WhereHelper> wheres2 = new List<WhereHelper>() {
new WhereHelper(){
......@@ -8571,7 +8571,6 @@ namespace Mall.Module.Product
};
bool flag1 = smallShops_InfoRepository.Update(keyValues2, wheres2);
}
}
else if (TotalCommission < 0)
{
//存在微店佣金里 继续负数累加
......
......@@ -413,8 +413,6 @@ namespace Mall.Module.User
//开始递减金额 订单不足的 给与提示
foreach (var item in olist)
{
if (TMoney > 0)
{
decimal CommMoney = 0;
var chlist = clist.Where(x => x.OrderId == item.OrderId).ToList();
......@@ -437,7 +435,6 @@ namespace Mall.Module.User
OrderNos += "\"" + item.OrderNo + "\":" + CommMoney + "元,";
OrderIdList.Add(item.OrderId);
}
}
if (!string.IsNullOrEmpty(OrderNos))
{
OrderNos = OrderNos[0..^1];
......
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