|
@@ -147,12 +147,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
decimal CreditTrade = 0;
|
|
decimal CreditTrade = 0;
|
|
|
- bool check = spdb.TradeRecord.Any(m => m.TradeSnNo == pos.PosSn);
|
|
|
|
|
|
|
+ string BindingTime = pos.BindingTime == null ? DateTime.Now.AddMonths(-1).ToString("yyyyMM") : pos.BindingTime.Value.ToString("yyyyMM");
|
|
|
|
|
+ string SpTradeRecordId = function.ReadInstance("/PublicParams/SpTradeRecordId" + BindingTime + ".txt");
|
|
|
|
|
+ int StartId = int.Parse(function.CheckInt(SpTradeRecordId));
|
|
|
|
|
+ bool check = spdb.TradeRecord.Any(m => m.Id > StartId && m.TradeSnNo == pos.PosSn);
|
|
|
if (check)
|
|
if (check)
|
|
|
{
|
|
{
|
|
|
- string BindingTime = pos.BindingTime == null ? DateTime.Now.AddMonths(-1).ToString("yyyyMM") : pos.BindingTime.Value.ToString("yyyyMM");
|
|
|
|
|
- string SpTradeRecordId = function.ReadInstance("/PublicParams/SpTradeRecordId" + BindingTime + ".txt");
|
|
|
|
|
- int StartId = int.Parse(function.CheckInt(SpTradeRecordId));
|
|
|
|
|
if (pos.BrandId == 1)
|
|
if (pos.BrandId == 1)
|
|
|
{
|
|
{
|
|
|
CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M700")).Sum(m => m.TradeAmount) / 100;
|
|
CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M700")).Sum(m => m.TradeAmount) / 100;
|
|
@@ -187,7 +187,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
}
|
|
|
pos.CreditTrade = CreditTrade;
|
|
pos.CreditTrade = CreditTrade;
|
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
|
- StatTradeAmount(pos.PosSn);
|
|
|
|
|
|
|
+ StatTradeAmount(pos.PosSn, StartId);
|
|
|
}
|
|
}
|
|
|
if (AddActPrize == 1)
|
|
if (AddActPrize == 1)
|
|
|
{
|
|
{
|
|
@@ -208,7 +208,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
if (pos.BindingTime != null && pos.ActivationTime != null)
|
|
if (pos.BindingTime != null && pos.ActivationTime != null)
|
|
|
{
|
|
{
|
|
|
TimeSpan ts = pos.ActivationTime.Value - pos.BindingTime.Value;
|
|
TimeSpan ts = pos.ActivationTime.Value - pos.BindingTime.Value;
|
|
|
- if (ts.TotalDays <= 30)
|
|
|
|
|
|
|
+ if (ts.TotalDays <= 30 || SysUserName == "admin")
|
|
|
{
|
|
{
|
|
|
AddAct(pos.Id);
|
|
AddAct(pos.Id);
|
|
|
}
|
|
}
|
|
@@ -767,7 +767,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
db.Dispose();
|
|
db.Dispose();
|
|
|
}
|
|
}
|
|
|
//重置交易额
|
|
//重置交易额
|
|
|
- public void StatTradeAmount(string PosSn)
|
|
|
|
|
|
|
+ public void StatTradeAmount(string PosSn, int StartId = 0)
|
|
|
{
|
|
{
|
|
|
DateTime start = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00");
|
|
DateTime start = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00");
|
|
|
if (DateTime.Now.Day == 1)
|
|
if (DateTime.Now.Day == 1)
|
|
@@ -775,7 +775,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
start = DateTime.Parse(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01 00:00:00");
|
|
start = DateTime.Parse(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01 00:00:00");
|
|
|
}
|
|
}
|
|
|
DateTime end = DateTime.Now;
|
|
DateTime end = DateTime.Now;
|
|
|
- SycnSpTradeService.Instance.Start(PosSn, start, end);
|
|
|
|
|
|
|
+ SycnSpTradeService.Instance.Start(PosSn, start, end, StartId);
|
|
|
RedisDbconn.Instance.AddList("ResetTradeAmountList", PosSn);
|
|
RedisDbconn.Instance.AddList("ResetTradeAmountList", PosSn);
|
|
|
}
|
|
}
|
|
|
|
|
|