|
|
@@ -1696,24 +1696,30 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
posInfo.OpId = sysAdmin.UserId;
|
|
|
if (userAmount.ValidAmount - amount >= 0)
|
|
|
{
|
|
|
- posInfo.OpReserveKind = 3;//标记为关联分仓额度
|
|
|
userAmount.ValidAmount -= amount;
|
|
|
+ posInfo.OpReserve3 += amount;
|
|
|
+ posInfo.OpReserve1 = 0;
|
|
|
+ posInfo.OpReserve2 = 0;
|
|
|
opdb.SaveChanges();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if (userAmount.TotalAmt - amount >= 0)
|
|
|
{
|
|
|
- posInfo.OpReserveKind = 1;//标记为未使用额度
|
|
|
- userAmount.TotalAmt -= amount;
|
|
|
+ userAmount.TotalAmt -= amount - userAmount.ValidAmount;
|
|
|
+ posInfo.OpReserve3 = userAmount.ValidAmount;
|
|
|
+ posInfo.OpReserve1 = amount - userAmount.ValidAmount;
|
|
|
+ posInfo.OpReserve2 = 0;
|
|
|
opdb.SaveChanges();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if (userAmount.ValidForGetAmount - amount >= 0)
|
|
|
{
|
|
|
- posInfo.OpReserveKind = 2;//标记为可提现额度
|
|
|
- userAmount.ValidForGetAmount -= amount;
|
|
|
+ userAmount.ValidForGetAmount -= amount - userAmount.TotalAmt;
|
|
|
+ posInfo.OpReserve3 = 0;
|
|
|
+ posInfo.OpReserve1 = userAmount.TotalAmt;
|
|
|
+ posInfo.OpReserve2 = amount - userAmount.TotalAmt;
|
|
|
opdb.SaveChanges();
|
|
|
}
|
|
|
}
|
|
|
@@ -1768,7 +1774,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
OperateType = 1,
|
|
|
UseAmount = deposit - tamount,
|
|
|
BeforeAmount = TotalAmount,
|
|
|
- AfterAmount = TotalAmount + deposit- tamount,
|
|
|
+ AfterAmount = TotalAmount + deposit - tamount,
|
|
|
}).Entity;
|
|
|
}
|
|
|
if (deposit < tamount)
|
|
|
@@ -1919,22 +1925,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
foreach (var items in pos)
|
|
|
{
|
|
|
var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == items.Id) ?? new PosMachinesTwo();
|
|
|
- if (posInfo.OpReserveKind == 3)
|
|
|
- {
|
|
|
- userAmount.ValidAmount += amount;//标记为关联分仓额度
|
|
|
- opdb.SaveChanges();
|
|
|
- }
|
|
|
- if (posInfo.OpReserveKind == 1)
|
|
|
- {
|
|
|
- userAmount.TotalAmt += amount;//标记为未使用额度
|
|
|
- opdb.SaveChanges();
|
|
|
- }
|
|
|
- if (posInfo.OpReserveKind == 2)
|
|
|
- {
|
|
|
- userAmount.ValidForGetAmount += amount;//标记为可提现额度
|
|
|
- opdb.SaveChanges();
|
|
|
- }
|
|
|
- posInfo.OpReserveKind = 0;
|
|
|
+ userAmount.ValidAmount += posInfo.OpReserve3;
|
|
|
+ userAmount.TotalAmt += posInfo.OpReserve1;
|
|
|
+ userAmount.ValidForGetAmount += posInfo.OpReserve2;
|
|
|
+ posInfo.OpReserve3 = 0;
|
|
|
+ posInfo.OpReserve1 = 0;
|
|
|
+ posInfo.OpReserve2 = 0;
|
|
|
+ opdb.SaveChanges();
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
tamount += amount * posCount;//扣减运营中心该品牌机具额度
|