|
@@ -553,43 +553,52 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
userAccountOld.TempAmountForBalance = 0;
|
|
userAccountOld.TempAmountForBalance = 0;
|
|
|
if (sto.OpId > 0)
|
|
if (sto.OpId > 0)
|
|
|
{
|
|
{
|
|
|
- var amount = opdb.UserAccount.FirstOrDefault(m => m.UserId == sto.OpId) ?? new OpModels.UserAccount();
|
|
|
|
|
- if (newdeposit > olddeposit)
|
|
|
|
|
|
|
+ var UseAmount = 0.00M;
|
|
|
|
|
+ var OperateType = 0;
|
|
|
|
|
+ if (newdeposit >= olddeposit)
|
|
|
{
|
|
{
|
|
|
- var amoutRecord = opdb.AmountRecord.Add(new OpModels.AmountRecord
|
|
|
|
|
- {
|
|
|
|
|
- Version = 3,//1 未使用额度 2 可提现额度 3 关联分仓额度
|
|
|
|
|
- CreateDate = DateTime.Now,
|
|
|
|
|
- UserId = sto.OpId,
|
|
|
|
|
- SeoDescription = "分仓押金变更",
|
|
|
|
|
- OperateType = 1,
|
|
|
|
|
- UseAmount = newdeposit - olddeposit,
|
|
|
|
|
- BeforeAmount = amount.ValidAmount,
|
|
|
|
|
- AfterAmount = amount.ValidAmount + newdeposit - olddeposit,
|
|
|
|
|
- AfterTotalAmt = amount.TotalAmt,
|
|
|
|
|
- AfterValidForGetAmount = amount.ValidForGetAmount,
|
|
|
|
|
- AfterValidAmount = amount.ValidAmount + newdeposit - olddeposit,
|
|
|
|
|
- }).Entity;
|
|
|
|
|
|
|
+ UseAmount = newdeposit - olddeposit;
|
|
|
|
|
+ OperateType = 1;
|
|
|
}
|
|
}
|
|
|
if (newdeposit < olddeposit)
|
|
if (newdeposit < olddeposit)
|
|
|
{
|
|
{
|
|
|
- var amoutRecord = opdb.AmountRecord.Add(new OpModels.AmountRecord
|
|
|
|
|
|
|
+ UseAmount = olddeposit - newdeposit;
|
|
|
|
|
+ OperateType = 2;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (UseAmount > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ var amount = opdb.UserAccount.FirstOrDefault(m => m.UserId == sto.OpId) ?? new OpModels.UserAccount();
|
|
|
|
|
+ var amoutRecord = opdb.AmountRecord.Add(new OpModels.AmountRecord()
|
|
|
{
|
|
{
|
|
|
Version = 3,//1 未使用额度 2 可提现额度 3 关联分仓额度
|
|
Version = 3,//1 未使用额度 2 可提现额度 3 关联分仓额度
|
|
|
CreateDate = DateTime.Now,
|
|
CreateDate = DateTime.Now,
|
|
|
UserId = sto.OpId,
|
|
UserId = sto.OpId,
|
|
|
SeoDescription = "分仓押金变更",
|
|
SeoDescription = "分仓押金变更",
|
|
|
- OperateType = 2,
|
|
|
|
|
- UseAmount = olddeposit - newdeposit,
|
|
|
|
|
|
|
+ OperateType = OperateType,
|
|
|
|
|
+ UseAmount = UseAmount,
|
|
|
BeforeAmount = amount.ValidAmount,
|
|
BeforeAmount = amount.ValidAmount,
|
|
|
- AfterAmount = amount.ValidAmount + newdeposit - olddeposit,
|
|
|
|
|
|
|
+ AfterAmount = amount.ValidAmount + UseAmount,
|
|
|
AfterTotalAmt = amount.TotalAmt,
|
|
AfterTotalAmt = amount.TotalAmt,
|
|
|
AfterValidForGetAmount = amount.ValidForGetAmount,
|
|
AfterValidForGetAmount = amount.ValidForGetAmount,
|
|
|
- AfterValidAmount = amount.ValidAmount + newdeposit - olddeposit
|
|
|
|
|
|
|
+ AfterValidAmount = amount.ValidAmount + UseAmount,
|
|
|
|
|
+ }).Entity;
|
|
|
|
|
+
|
|
|
|
|
+ var amountChangeRecord = opdb.AmountChangeRecord.Add(new OpModels.AmountChangeRecord()
|
|
|
|
|
+ {
|
|
|
|
|
+ AmountType = 3,//1 未使用额度 2 可提现额度 3 关联分仓额度
|
|
|
|
|
+ CreateDate = DateTime.Now,
|
|
|
|
|
+ Title = "分仓押金变更",
|
|
|
|
|
+ UserId = sto.OpId, //运营中心Id
|
|
|
|
|
+ // Operater = SysUserName + "-" + SysRealName,
|
|
|
|
|
+ BeforeAmount = amount.ValidAmount,//使用前剩余额度
|
|
|
|
|
+ AfterAmount = amount.ValidAmount + UseAmount,//使用后剩余额度
|
|
|
|
|
+ ChangeAmount = UseAmount,//操作金额
|
|
|
|
|
+ OperateType = OperateType,//操作类别
|
|
|
}).Entity;
|
|
}).Entity;
|
|
|
|
|
+
|
|
|
|
|
+ amount.ValidAmount -= sto.Deposit;
|
|
|
|
|
+ amount.ValidAmount += data.Deposit;
|
|
|
}
|
|
}
|
|
|
- amount.ValidAmount -= sto.Deposit;
|
|
|
|
|
- amount.ValidAmount += data.Deposit;
|
|
|
|
|
}
|
|
}
|
|
|
var oldUserInfo = db.Users.FirstOrDefault(m => m.Id == sto.UserId) ?? new Users();
|
|
var oldUserInfo = db.Users.FirstOrDefault(m => m.Id == sto.UserId) ?? new Users();
|
|
|
var newUserInfo = db.Users.FirstOrDefault(m => m.Id == user.UserId) ?? new Users();
|
|
var newUserInfo = db.Users.FirstOrDefault(m => m.Id == user.UserId) ?? new Users();
|
|
@@ -628,43 +637,52 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
userAccount.StoreDeposit = data.Deposit;
|
|
userAccount.StoreDeposit = data.Deposit;
|
|
|
if (sto.OpId > 0)
|
|
if (sto.OpId > 0)
|
|
|
{
|
|
{
|
|
|
- var amount = opdb.UserAccount.FirstOrDefault(m => m.UserId == sto.OpId) ?? new OpModels.UserAccount();
|
|
|
|
|
- if (newdeposit > olddeposit)
|
|
|
|
|
|
|
+ var UseAmount = 0.00M;
|
|
|
|
|
+ var OperateType = 0;
|
|
|
|
|
+ if (newdeposit >= olddeposit)
|
|
|
{
|
|
{
|
|
|
- var amoutRecord = opdb.AmountRecord.Add(new OpModels.AmountRecord
|
|
|
|
|
- {
|
|
|
|
|
- Version = 3,//1 未使用额度 2 可提现额度 3 关联分仓额度
|
|
|
|
|
- CreateDate = DateTime.Now,
|
|
|
|
|
- UserId = sto.OpId,
|
|
|
|
|
- SeoDescription = "分仓押金变更",
|
|
|
|
|
- OperateType = 1,
|
|
|
|
|
- UseAmount = newdeposit - olddeposit,
|
|
|
|
|
- BeforeAmount = amount.ValidAmount,
|
|
|
|
|
- AfterAmount = amount.ValidAmount + newdeposit - olddeposit,
|
|
|
|
|
- AfterTotalAmt = amount.TotalAmt,
|
|
|
|
|
- AfterValidForGetAmount = amount.ValidForGetAmount,
|
|
|
|
|
- AfterValidAmount = amount.ValidAmount + newdeposit - olddeposit
|
|
|
|
|
- }).Entity;
|
|
|
|
|
|
|
+ UseAmount = newdeposit - olddeposit;
|
|
|
|
|
+ OperateType = 1;
|
|
|
}
|
|
}
|
|
|
if (newdeposit < olddeposit)
|
|
if (newdeposit < olddeposit)
|
|
|
{
|
|
{
|
|
|
- var amoutRecord = opdb.AmountRecord.Add(new OpModels.AmountRecord
|
|
|
|
|
|
|
+ UseAmount = olddeposit - newdeposit;
|
|
|
|
|
+ OperateType = 2;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (UseAmount > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ var amount = opdb.UserAccount.FirstOrDefault(m => m.UserId == sto.OpId) ?? new OpModels.UserAccount();
|
|
|
|
|
+ var amoutRecord = opdb.AmountRecord.Add(new OpModels.AmountRecord()
|
|
|
{
|
|
{
|
|
|
Version = 3,//1 未使用额度 2 可提现额度 3 关联分仓额度
|
|
Version = 3,//1 未使用额度 2 可提现额度 3 关联分仓额度
|
|
|
CreateDate = DateTime.Now,
|
|
CreateDate = DateTime.Now,
|
|
|
UserId = sto.OpId,
|
|
UserId = sto.OpId,
|
|
|
SeoDescription = "分仓押金变更",
|
|
SeoDescription = "分仓押金变更",
|
|
|
- OperateType = 2,
|
|
|
|
|
- UseAmount = olddeposit - newdeposit,
|
|
|
|
|
|
|
+ OperateType = OperateType,
|
|
|
|
|
+ UseAmount = UseAmount,
|
|
|
BeforeAmount = amount.ValidAmount,
|
|
BeforeAmount = amount.ValidAmount,
|
|
|
- AfterAmount = amount.ValidAmount + newdeposit - olddeposit,
|
|
|
|
|
|
|
+ AfterAmount = amount.ValidAmount + UseAmount,
|
|
|
AfterTotalAmt = amount.TotalAmt,
|
|
AfterTotalAmt = amount.TotalAmt,
|
|
|
AfterValidForGetAmount = amount.ValidForGetAmount,
|
|
AfterValidForGetAmount = amount.ValidForGetAmount,
|
|
|
- AfterValidAmount = amount.ValidAmount + newdeposit - olddeposit
|
|
|
|
|
|
|
+ AfterValidAmount = amount.ValidAmount + UseAmount,
|
|
|
}).Entity;
|
|
}).Entity;
|
|
|
|
|
+
|
|
|
|
|
+ var amountChangeRecord = opdb.AmountChangeRecord.Add(new OpModels.AmountChangeRecord()
|
|
|
|
|
+ {
|
|
|
|
|
+ AmountType = 3,//1 未使用额度 2 可提现额度 3 关联分仓额度
|
|
|
|
|
+ CreateDate = DateTime.Now,
|
|
|
|
|
+ Title = "分仓押金变更",
|
|
|
|
|
+ UserId = sto.OpId, //运营中心Id
|
|
|
|
|
+ // Operater = SysUserName + "-" + SysRealName,
|
|
|
|
|
+ BeforeAmount = amount.ValidAmount,//使用前剩余额度
|
|
|
|
|
+ AfterAmount = amount.ValidAmount + UseAmount,//使用后剩余额度
|
|
|
|
|
+ ChangeAmount = UseAmount,//操作金额
|
|
|
|
|
+ OperateType = OperateType,//操作类别
|
|
|
|
|
+ }).Entity;
|
|
|
|
|
+
|
|
|
|
|
+ amount.ValidAmount -= sto.Deposit;
|
|
|
|
|
+ amount.ValidAmount += data.Deposit;
|
|
|
}
|
|
}
|
|
|
- amount.ValidAmount -= sto.Deposit;
|
|
|
|
|
- amount.ValidAmount += data.Deposit;
|
|
|
|
|
}
|
|
}
|
|
|
foreach (var item in store)
|
|
foreach (var item in store)
|
|
|
{
|
|
{
|
|
@@ -2030,6 +2048,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
userAmount.ValidAmount += deposit;
|
|
userAmount.ValidAmount += deposit;
|
|
|
opdb.SaveChanges();
|
|
opdb.SaveChanges();
|
|
|
decimal toAmount = userAmount.ValidAmount + userAmount.TotalAmt + userAmount.ValidForGetAmount;//新的总金额
|
|
decimal toAmount = userAmount.ValidAmount + userAmount.TotalAmt + userAmount.ValidForGetAmount;//新的总金额
|
|
|
|
|
+ decimal ValidAmount = 0.00M;//关联分仓额度
|
|
|
|
|
+ decimal TotalAmt = 0.00M; //未使用额度
|
|
|
|
|
+ decimal ValidForGetAmount = 0.00M; //可提现额度
|
|
|
if (toAmount >= tamount)
|
|
if (toAmount >= tamount)
|
|
|
{
|
|
{
|
|
|
foreach (var item in idlist)
|
|
foreach (var item in idlist)
|
|
@@ -2059,6 +2080,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
posInfo.OpId = sysAdmin.UserId;
|
|
posInfo.OpId = sysAdmin.UserId;
|
|
|
if (userAmount.ValidAmount - amount >= 0)
|
|
if (userAmount.ValidAmount - amount >= 0)
|
|
|
{
|
|
{
|
|
|
|
|
+ ValidAmount += amount;
|
|
|
userAmount.ValidAmount -= amount;
|
|
userAmount.ValidAmount -= amount;
|
|
|
posInfo.OpReserve3 += amount; //关联分仓额度
|
|
posInfo.OpReserve3 += amount; //关联分仓额度
|
|
|
posInfo.OpReserve1 = 0; //未使用额度
|
|
posInfo.OpReserve1 = 0; //未使用额度
|
|
@@ -2069,6 +2091,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
{
|
|
|
if (userAmount.TotalAmt - amount >= 0)
|
|
if (userAmount.TotalAmt - amount >= 0)
|
|
|
{
|
|
{
|
|
|
|
|
+ TotalAmt += amount - userAmount.ValidAmount;
|
|
|
userAmount.TotalAmt -= amount - userAmount.ValidAmount;
|
|
userAmount.TotalAmt -= amount - userAmount.ValidAmount;
|
|
|
posInfo.OpReserve3 = userAmount.ValidAmount;
|
|
posInfo.OpReserve3 = userAmount.ValidAmount;
|
|
|
posInfo.OpReserve1 = amount - userAmount.ValidAmount;
|
|
posInfo.OpReserve1 = amount - userAmount.ValidAmount;
|
|
@@ -2079,6 +2102,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
{
|
|
|
if (userAmount.ValidForGetAmount - amount >= 0)
|
|
if (userAmount.ValidForGetAmount - amount >= 0)
|
|
|
{
|
|
{
|
|
|
|
|
+ ValidForGetAmount += amount - userAmount.TotalAmt;
|
|
|
userAmount.ValidForGetAmount -= amount - userAmount.TotalAmt;
|
|
userAmount.ValidForGetAmount -= amount - userAmount.TotalAmt;
|
|
|
posInfo.OpReserve3 = 0;
|
|
posInfo.OpReserve3 = 0;
|
|
|
posInfo.OpReserve1 = userAmount.TotalAmt;
|
|
posInfo.OpReserve1 = userAmount.TotalAmt;
|
|
@@ -2127,31 +2151,27 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
}
|
|
|
if (IsOk == "1")
|
|
if (IsOk == "1")
|
|
|
{
|
|
{
|
|
|
- if (deposit > tamount)
|
|
|
|
|
|
|
+ var OperateType = 0;
|
|
|
|
|
+ var Amount = 0.00M;
|
|
|
|
|
+ if (deposit >= tamount)
|
|
|
{
|
|
{
|
|
|
- var amoutRecord = opdb.AmountRecord.Add(new OpModels.AmountRecord
|
|
|
|
|
- {
|
|
|
|
|
- CreateDate = DateTime.Now,
|
|
|
|
|
- UserId = sysAdmin.UserId,
|
|
|
|
|
- SeoDescription = "关联分仓",
|
|
|
|
|
- OperateType = 1,
|
|
|
|
|
- UseAmount = deposit - tamount,
|
|
|
|
|
- BeforeAmount = TotalAmount,
|
|
|
|
|
- AfterAmount = TotalAmount + deposit - tamount,
|
|
|
|
|
- AfterTotalAmt = userAmount.TotalAmt,
|
|
|
|
|
- AfterValidForGetAmount = userAmount.ValidForGetAmount,
|
|
|
|
|
- AfterValidAmount = userAmount.ValidAmount,
|
|
|
|
|
- }).Entity;
|
|
|
|
|
|
|
+ OperateType = 1;
|
|
|
|
|
+ Amount = deposit - tamount;
|
|
|
}
|
|
}
|
|
|
if (deposit < tamount)
|
|
if (deposit < tamount)
|
|
|
|
|
+ {
|
|
|
|
|
+ OperateType = 2;
|
|
|
|
|
+ Amount = tamount - deposit;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Amount > 0)
|
|
|
{
|
|
{
|
|
|
var amoutRecord = opdb.AmountRecord.Add(new OpModels.AmountRecord
|
|
var amoutRecord = opdb.AmountRecord.Add(new OpModels.AmountRecord
|
|
|
{
|
|
{
|
|
|
CreateDate = DateTime.Now,
|
|
CreateDate = DateTime.Now,
|
|
|
UserId = sysAdmin.UserId,
|
|
UserId = sysAdmin.UserId,
|
|
|
SeoDescription = "关联分仓",
|
|
SeoDescription = "关联分仓",
|
|
|
- OperateType = 2,
|
|
|
|
|
- UseAmount = tamount - deposit,
|
|
|
|
|
|
|
+ OperateType = OperateType,
|
|
|
|
|
+ UseAmount = Amount,
|
|
|
BeforeAmount = TotalAmount,
|
|
BeforeAmount = TotalAmount,
|
|
|
AfterAmount = TotalAmount + deposit - tamount,
|
|
AfterAmount = TotalAmount + deposit - tamount,
|
|
|
AfterTotalAmt = userAmount.TotalAmt,
|
|
AfterTotalAmt = userAmount.TotalAmt,
|
|
@@ -2159,6 +2179,46 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
AfterValidAmount = userAmount.ValidAmount,
|
|
AfterValidAmount = userAmount.ValidAmount,
|
|
|
}).Entity;
|
|
}).Entity;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 1; i <= 3; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ var UseAmount = 0.00M;
|
|
|
|
|
+ var BeforeAmount = 0.00M;
|
|
|
|
|
+ var AfterAmount = 0.00M;
|
|
|
|
|
+ if (i == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ UseAmount = TotalAmt;
|
|
|
|
|
+ BeforeAmount = userAmount.TotalAmt + UseAmount;
|
|
|
|
|
+ AfterAmount = userAmount.TotalAmt;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ UseAmount = ValidForGetAmount;
|
|
|
|
|
+ BeforeAmount = userAmount.ValidForGetAmount + UseAmount;
|
|
|
|
|
+ AfterAmount = userAmount.ValidForGetAmount;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i == 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ UseAmount = ValidAmount;
|
|
|
|
|
+ BeforeAmount = userAmount.ValidAmount + UseAmount;
|
|
|
|
|
+ AfterAmount = userAmount.ValidAmount;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i > 0 && UseAmount > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ var amountChangeRecord = opdb.AmountChangeRecord.Add(new OpModels.AmountChangeRecord()
|
|
|
|
|
+ {
|
|
|
|
|
+ AmountType = i,//1 未使用额度 2 可提现额度 3 关联分仓额度
|
|
|
|
|
+ CreateDate = DateTime.Now,
|
|
|
|
|
+ Title = "关联分仓",
|
|
|
|
|
+ UserId = sysAdmin.UserId, //运营中心Id
|
|
|
|
|
+ Operater = SysUserName + "-" + SysRealName,
|
|
|
|
|
+ BeforeAmount = BeforeAmount,//使用前剩余额度
|
|
|
|
|
+ AfterAmount = AfterAmount,//使用后剩余额度
|
|
|
|
|
+ ChangeAmount = UseAmount,//操作金额
|
|
|
|
|
+ OperateType = OperateType,//操作类别
|
|
|
|
|
+ }).Entity;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
opdb.SaveChanges();
|
|
opdb.SaveChanges();
|
|
|
}
|
|
}
|
|
|
sysAdmin.StoreCount += idlist.Count();//添加关联分仓数
|
|
sysAdmin.StoreCount += idlist.Count();//添加关联分仓数
|
|
@@ -2262,9 +2322,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
var amount = 0;
|
|
var amount = 0;
|
|
|
var tamount = 0;
|
|
var tamount = 0;
|
|
|
decimal deposit = 0;
|
|
decimal deposit = 0;
|
|
|
- decimal ValidAmount = 0;
|
|
|
|
|
- decimal TotalAmt = 0;
|
|
|
|
|
- decimal ValidForGetAmount = 0;
|
|
|
|
|
|
|
+ decimal ValidAmount = 0.00M;//关联分仓额度
|
|
|
|
|
+ decimal TotalAmt = 0.00M; //未使用额度
|
|
|
|
|
+ decimal ValidForGetAmount = 0.00M; //可提现额度
|
|
|
var pCount = 0;
|
|
var pCount = 0;
|
|
|
var userIds = "";
|
|
var userIds = "";
|
|
|
string error = "";
|
|
string error = "";
|
|
@@ -2353,31 +2413,28 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
|
|
sysAdmin.StoreCount -= idlist.Count();//减少关联分仓数
|
|
sysAdmin.StoreCount -= idlist.Count();//减少关联分仓数
|
|
|
sysAdmin.TotalMachineCount -= pCount;//减少关联分仓机具数
|
|
sysAdmin.TotalMachineCount -= pCount;//减少关联分仓机具数
|
|
|
- if (deposit > tamount)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ var OperateType = 0;
|
|
|
|
|
+ var Amount = 0.00M;
|
|
|
|
|
+ if (deposit >= tamount)
|
|
|
{
|
|
{
|
|
|
- var amoutRecord = opdb.AmountRecord.Add(new OpModels.AmountRecord
|
|
|
|
|
- {
|
|
|
|
|
- CreateDate = DateTime.Now,
|
|
|
|
|
- UserId = sysAdmin.UserId,
|
|
|
|
|
- SeoDescription = "取消关联分仓",
|
|
|
|
|
- OperateType = 2,
|
|
|
|
|
- UseAmount = deposit - tamount,
|
|
|
|
|
- BeforeAmount = TotalAmount,
|
|
|
|
|
- AfterAmount = TotalAmount - deposit + tamount,
|
|
|
|
|
- AfterTotalAmt = userAmount.TotalAmt,
|
|
|
|
|
- AfterValidForGetAmount = userAmount.ValidForGetAmount,
|
|
|
|
|
- AfterValidAmount = userAmount.ValidAmount,
|
|
|
|
|
- }).Entity;
|
|
|
|
|
|
|
+ OperateType = 1;
|
|
|
|
|
+ Amount = deposit - tamount;
|
|
|
}
|
|
}
|
|
|
if (deposit < tamount)
|
|
if (deposit < tamount)
|
|
|
|
|
+ {
|
|
|
|
|
+ OperateType = 2;
|
|
|
|
|
+ Amount = tamount - deposit;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Amount > 0)
|
|
|
{
|
|
{
|
|
|
var amoutRecord = opdb.AmountRecord.Add(new OpModels.AmountRecord
|
|
var amoutRecord = opdb.AmountRecord.Add(new OpModels.AmountRecord
|
|
|
{
|
|
{
|
|
|
CreateDate = DateTime.Now,
|
|
CreateDate = DateTime.Now,
|
|
|
UserId = sysAdmin.UserId,
|
|
UserId = sysAdmin.UserId,
|
|
|
SeoDescription = "取消关联分仓",
|
|
SeoDescription = "取消关联分仓",
|
|
|
- OperateType = 1,
|
|
|
|
|
- UseAmount = tamount - deposit,
|
|
|
|
|
|
|
+ OperateType = OperateType,
|
|
|
|
|
+ UseAmount = Amount,
|
|
|
BeforeAmount = TotalAmount,
|
|
BeforeAmount = TotalAmount,
|
|
|
AfterAmount = TotalAmount - deposit + tamount,
|
|
AfterAmount = TotalAmount - deposit + tamount,
|
|
|
AfterTotalAmt = userAmount.TotalAmt,
|
|
AfterTotalAmt = userAmount.TotalAmt,
|
|
@@ -2385,6 +2442,46 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
AfterValidAmount = userAmount.ValidAmount,
|
|
AfterValidAmount = userAmount.ValidAmount,
|
|
|
}).Entity;
|
|
}).Entity;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 1; i <= 3; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ var UseAmount = 0.00M;
|
|
|
|
|
+ var BeforeAmount = 0.00M;
|
|
|
|
|
+ var AfterAmount = 0.00M;
|
|
|
|
|
+ if (i == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ UseAmount = TotalAmt;
|
|
|
|
|
+ BeforeAmount = userAmount.TotalAmt - UseAmount;
|
|
|
|
|
+ AfterAmount = userAmount.TotalAmt;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ UseAmount = ValidForGetAmount;
|
|
|
|
|
+ BeforeAmount = userAmount.ValidForGetAmount - UseAmount;
|
|
|
|
|
+ AfterAmount = userAmount.ValidForGetAmount;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i == 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ UseAmount = ValidAmount;
|
|
|
|
|
+ BeforeAmount = userAmount.ValidAmount - UseAmount;
|
|
|
|
|
+ AfterAmount = userAmount.ValidAmount;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i > 0 && UseAmount > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ var amountChangeRecord = opdb.AmountChangeRecord.Add(new OpModels.AmountChangeRecord()
|
|
|
|
|
+ {
|
|
|
|
|
+ AmountType = i,//1 未使用额度 2 可提现额度 3 关联分仓额度
|
|
|
|
|
+ CreateDate = DateTime.Now,
|
|
|
|
|
+ Title = "取消关联分仓",
|
|
|
|
|
+ UserId = sysAdmin.UserId, //运营中心Id
|
|
|
|
|
+ Operater = SysUserName + "-" + SysRealName,
|
|
|
|
|
+ BeforeAmount = BeforeAmount,//使用前剩余额度
|
|
|
|
|
+ AfterAmount = AfterAmount,//使用后剩余额度
|
|
|
|
|
+ ChangeAmount = UseAmount,//操作金额
|
|
|
|
|
+ OperateType = OperateType,//操作类别
|
|
|
|
|
+ }).Entity;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
opdb.SaveChanges();
|
|
opdb.SaveChanges();
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|