|
|
@@ -142,51 +142,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
decimal CreditTrade = 0;
|
|
|
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);
|
|
|
+ string TradeRecordId = function.ReadInstance("/PublicParams/TradeRecordId" + BindingTime + ".txt");
|
|
|
+ int StartId = int.Parse(function.CheckInt(TradeRecordId));
|
|
|
+ bool check = db.TradeRecord.Any(m => m.Id > StartId && m.SnNo == pos.PosSn);
|
|
|
if (check)
|
|
|
{
|
|
|
- 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;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 2)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "2").Sum(m => m.TradeAmount);
|
|
|
- }
|
|
|
- else if (pos.BrandId == 3)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M900")).Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 4 || pos.BrandId == 5)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "4").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 6)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "6").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 7)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "7" && m.TradeStatus == "00").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 8)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "8").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 9)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "9").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 10 || pos.BrandId == 11)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "10").Sum(m => m.TradeAmount);
|
|
|
- }
|
|
|
- else if (pos.BrandId == 12 || pos.BrandId == 13)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "12").Sum(m => m.TradeAmount);
|
|
|
- }
|
|
|
+ CreditTrade = db.TradeRecord.Where(m => m.Id > StartId && m.SnNo == pos.PosSn && m.BrandId == pos.BrandId).Sum(m => m.TradeAmount);
|
|
|
pos.CreditTrade = CreditTrade;
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
@@ -414,48 +375,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
}
|
|
|
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 TradeRecordId = function.ReadInstance("/PublicParams/TradeRecordId" + BindingTime + ".txt");
|
|
|
+ int StartId = int.Parse(function.CheckInt(TradeRecordId));
|
|
|
+ bool check = db.TradeRecord.Any(m => m.Id > StartId && m.SnNo == pos.PosSn);
|
|
|
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)
|
|
|
- {
|
|
|
- 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;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 2)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "2").Sum(m => m.TradeAmount);
|
|
|
- }
|
|
|
- else if (pos.BrandId == 3)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M900")).Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 4 || pos.BrandId == 5)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "4").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 6)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "6").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 8)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "8").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 9)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "9").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 10 || pos.BrandId == 11)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "10").Sum(m => m.TradeAmount);
|
|
|
- }
|
|
|
- else if (pos.BrandId == 12 || pos.BrandId == 13)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "12").Sum(m => m.TradeAmount);
|
|
|
- }
|
|
|
+ CreditTrade = db.TradeRecord.Where(m => m.Id > StartId && m.SnNo == pos.PosSn && m.BrandId == pos.BrandId).Sum(m => m.TradeAmount);
|
|
|
pos.CreditTrade = CreditTrade;
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
@@ -639,51 +565,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
decimal CreditTrade = 0;
|
|
|
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);
|
|
|
+ string TradeRecordId = function.ReadInstance("/PublicParams/TradeRecordId" + BindingTime + ".txt");
|
|
|
+ int StartId = int.Parse(function.CheckInt(TradeRecordId));
|
|
|
+ bool check = db.TradeRecord.Any(m => m.Id > StartId && m.SnNo == pos.PosSn);
|
|
|
if (check)
|
|
|
{
|
|
|
- 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;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 2)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "2").Sum(m => m.TradeAmount);
|
|
|
- }
|
|
|
- else if (pos.BrandId == 3)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M900")).Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 4 || pos.BrandId == 5)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "4").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 6)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "6").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 7)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "7" && m.TradeStatus == "00").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 8)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "8").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 9)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "9").Sum(m => m.TradeAmount) / 100;
|
|
|
- }
|
|
|
- else if (pos.BrandId == 10 || pos.BrandId == 11)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "10").Sum(m => m.TradeAmount);
|
|
|
- }
|
|
|
- else if (pos.BrandId == 12 || pos.BrandId == 13)
|
|
|
- {
|
|
|
- CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "12").Sum(m => m.TradeAmount);
|
|
|
- }
|
|
|
+ CreditTrade = db.TradeRecord.Where(m => m.Id > StartId && m.SnNo == pos.PosSn && m.BrandId == pos.BrandId).Sum(m => m.TradeAmount);
|
|
|
pos.CreditTrade = CreditTrade;
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
@@ -903,7 +790,8 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
List<decimal> prizes = new List<decimal>();
|
|
|
decimal ActPrize = decimal.Parse(function.CheckNum(pos.SeoKeyword));
|
|
|
- if (pos.BrandId == 1 || pos.BrandId == 3 || pos.BrandId == 4 || pos.BrandId == 5 || pos.BrandId == 6 || pos.BrandId == 8 || pos.BrandId == 9)
|
|
|
+ KqProducts product = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
|
|
|
+ if (product.NoticeMoneyUnit == 2)
|
|
|
{
|
|
|
ActPrize = ActPrize / 100;
|
|
|
}
|
|
|
@@ -1417,7 +1305,8 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
string tradeAmount = pos.CreditTrade.ToString();
|
|
|
decimal Deposit = decimal.Parse(function.CheckNum(pos.SeoKeyword));
|
|
|
var brand = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
|
|
|
- if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(Deposit.ToString()))
|
|
|
+ // if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(Deposit.ToString()))
|
|
|
+ if (brand.Id > 0 && brand.NoticeMoneyUnit == 2 && !string.IsNullOrEmpty(Deposit.ToString()))
|
|
|
{
|
|
|
Deposit = Deposit / 100;
|
|
|
}
|
|
|
@@ -1788,6 +1677,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
UseAmount = oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
|
|
|
BeforeAmount = TotalAmount,
|
|
|
AfterAmount = TotalAmount + oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
|
|
|
+ AfterTotalAmt = opUserAccount.TotalAmt,
|
|
|
+ AfterValidForGetAmount = opUserAccount.ValidForGetAmount,
|
|
|
+ AfterValidAmount = opUserAccount.ValidAmount,
|
|
|
}).Entity;
|
|
|
|
|
|
oldpos.OpReserve1 = 0;
|
|
|
@@ -1813,6 +1705,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
UseAmount = newpos.OpReserve3 + newpos.OpReserve2 + newpos.OpReserve1,
|
|
|
BeforeAmount = TotalAmount,
|
|
|
AfterAmount = TotalAmount + newpos.OpReserve3 + newpos.OpReserve2 + newpos.OpReserve1,
|
|
|
+ AfterTotalAmt = opUserAccount.TotalAmt,
|
|
|
+ AfterValidForGetAmount = opUserAccount.ValidForGetAmount,
|
|
|
+ AfterValidAmount = opUserAccount.ValidAmount,
|
|
|
}).Entity;
|
|
|
|
|
|
newpos.OpReserve1 = 0;
|
|
|
@@ -2047,6 +1942,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
UseAmount = oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
|
|
|
BeforeAmount = TotalAmount,
|
|
|
AfterAmount = TotalAmount + oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
|
|
|
+ AfterTotalAmt = opUserAccount.TotalAmt,
|
|
|
+ AfterValidForGetAmount = opUserAccount.ValidForGetAmount,
|
|
|
+ AfterValidAmount = opUserAccount.ValidAmount,
|
|
|
}).Entity;
|
|
|
}
|
|
|
if (newpos.OpId == 0)
|
|
|
@@ -2306,6 +2204,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
UseAmount = oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
|
|
|
BeforeAmount = TotalAmount,
|
|
|
AfterAmount = TotalAmount + oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
|
|
|
+ AfterTotalAmt = opUserAccount.TotalAmt,
|
|
|
+ AfterValidForGetAmount = opUserAccount.ValidForGetAmount,
|
|
|
+ AfterValidAmount = opUserAccount.ValidAmount,
|
|
|
}).Entity;
|
|
|
}
|
|
|
if (newpos.OpId == 0)
|
|
|
@@ -2554,6 +2455,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
UseAmount = oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
|
|
|
BeforeAmount = TotalAmount,
|
|
|
AfterAmount = TotalAmount + oldpos.OpReserve3 + oldpos.OpReserve2 + oldpos.OpReserve1,
|
|
|
+ AfterTotalAmt = opUserAccount.TotalAmt,
|
|
|
+ AfterValidForGetAmount = opUserAccount.ValidForGetAmount,
|
|
|
+ AfterValidAmount = opUserAccount.ValidAmount,
|
|
|
}).Entity;
|
|
|
}
|
|
|
if (newpos.OpId == 0)
|
|
|
@@ -4123,28 +4027,22 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
|
|
|
[HttpPost]
|
|
|
- public string SetPosFeeDo(string PosSn, string FeeType)
|
|
|
+ public string SetPosFeeDo(string PosSn, int FeeType, int RecordFlag = 0)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(PosSn))
|
|
|
{
|
|
|
return "请输入机具SN";
|
|
|
}
|
|
|
- if (string.IsNullOrEmpty(FeeType))
|
|
|
+ if (FeeType == 0)
|
|
|
{
|
|
|
return "请输入选择费率";
|
|
|
}
|
|
|
- if (FeeType == "0")
|
|
|
+ string Fee = "0.63";
|
|
|
+ if(FeeType == 3)
|
|
|
{
|
|
|
- FeeType = "0.6";
|
|
|
+ Fee = "0.6";
|
|
|
}
|
|
|
- if (FeeType == "1")
|
|
|
- {
|
|
|
- FeeType = "0.63";
|
|
|
- }
|
|
|
-
|
|
|
string[] PosSnList = PosSn.Replace("\r", "").Split('\n');
|
|
|
- var PosId = "";
|
|
|
- var RecordId = "";
|
|
|
var error = "";
|
|
|
foreach (var item in PosSnList)
|
|
|
{
|
|
|
@@ -4152,21 +4050,30 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == pos.SnId) ?? new PosMachinesTwo();
|
|
|
if (posInfo.Id > 0)
|
|
|
{
|
|
|
- var query = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
|
|
|
+ string RecordId = "";
|
|
|
+ if(RecordFlag == 1)
|
|
|
{
|
|
|
- Sort = posInfo.BrandId,
|
|
|
- CreateDate = DateTime.Now,
|
|
|
- PosId = posInfo.Id,
|
|
|
- PosSn = posInfo.PosSn,
|
|
|
- PosUserId = posInfo.UserId,
|
|
|
- MerchantId = posInfo.BindMerchantId,
|
|
|
- UserId = posInfo.UserId,
|
|
|
- ChangeFee = decimal.Parse(FeeType),
|
|
|
-
|
|
|
- }).Entity;
|
|
|
- db.SaveChanges();
|
|
|
- PosId += posInfo.Id + ",";
|
|
|
- RecordId += query.Id + ",";
|
|
|
+ decimal ChangeFee = decimal.Parse(Fee);
|
|
|
+ PosMachinesFeeChangeRecord query = db.PosMachinesFeeChangeRecord.FirstOrDefault(m => m.PosId == posInfo.Id && m.ChangeFee == ChangeFee && m.Status == 0);
|
|
|
+ if(query == null)
|
|
|
+ {
|
|
|
+ query = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
|
|
|
+ {
|
|
|
+ Sort = posInfo.BrandId,
|
|
|
+ CreateDate = DateTime.Now,
|
|
|
+ PosId = posInfo.Id,
|
|
|
+ PosSn = posInfo.PosSn,
|
|
|
+ PosUserId = posInfo.UserId,
|
|
|
+ }).Entity;
|
|
|
+ db.SaveChanges();
|
|
|
+ }
|
|
|
+ query.MerchantId = posInfo.BindMerchantId;
|
|
|
+ query.UserId = posInfo.UserId;
|
|
|
+ query.ChangeFee = ChangeFee;
|
|
|
+ RecordId = query.Id.ToString();
|
|
|
+ }
|
|
|
+ string data = "{\"RecordId\":\"" + RecordId + "\",\"PosId\":\"" + posInfo.Id + "\",\"Fee\": \"" + Fee + "\",\"Kind\": \"" + FeeType + "\",\"OpMan\": \"系统\"}";
|
|
|
+ RedisDbconn.Instance.AddList("SetDepositPostQueue", data);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -4177,11 +4084,6 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
return "Warning|" + error;
|
|
|
}
|
|
|
- PosId = PosId.TrimEnd(',');
|
|
|
- function.WriteLog(DateTime.Now.ToString() + ":请求参数," + PosId + ":" + SysUserName + "-" + SysRealName, "根据机具号设置费率");
|
|
|
-
|
|
|
- string data = "{\"RecordId\":\"" + RecordId + "\",\"PosId\":\"" + PosId + "\",\"Fee\": \"" + FeeType + "\",\"Kind\": \"2\",\"OpMan\": \"系统\"}";
|
|
|
- RedisDbconn.Instance.AddList("SetDepositPostQueue", data);
|
|
|
return "success";
|
|
|
}
|
|
|
#endregion
|
|
|
@@ -5676,7 +5578,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
condition += " and tb.BrandId=" + BrandId;
|
|
|
}
|
|
|
|
|
|
- DataTable dt = CustomerSqlConn.dtable("SELECT wname,k.`Name`,PosSn, merchantname,(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) SeoKeyword,DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') BindingTime,DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') ActivationTime,amount,maxdate, CreditRewardAmount, opdate, info from (select (select MerchantName from PosMerchantInfo where Id=pos.BindMerchantId limit 1) merchantname,(select SUM(RewardAmount) from ActiveReward where KqSnNo=pos.PosSn limit 1) amount,(select MAX(CreateDate) from ActiveReward where KqSnNo=pos.PosSn limit 1) maxdate,(SELECT CreditRewardAmount FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) CreditRewardAmount,(select CreateDate FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) opdate,(select CONCAT(MakerCode,'_',RealName ) from Users where Id=(SELECT UserId FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1)) info,(select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN (select SingleDepositApi from KqProducts where Id=pos.BrandId limit 1)=0 THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition, conn);
|
|
|
+ // DataTable dt = CustomerSqlConn.dtable("SELECT wname,k.`Name`,PosSn, merchantname,(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) SeoKeyword,DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') BindingTime,DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') ActivationTime,amount,maxdate, CreditRewardAmount, opdate, info from (select (select MerchantName from PosMerchantInfo where Id=pos.BindMerchantId limit 1) merchantname,(select SUM(RewardAmount) from ActiveReward where KqSnNo=pos.PosSn limit 1) amount,(select MAX(CreateDate) from ActiveReward where KqSnNo=pos.PosSn limit 1) maxdate,(SELECT CreditRewardAmount FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) CreditRewardAmount,(select CreateDate FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) opdate,(select CONCAT(MakerCode,'_',RealName ) from Users where Id=(SELECT UserId FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1)) info,(select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN (select SingleDepositApi from KqProducts where Id=pos.BrandId limit 1)=0 THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition, conn);
|
|
|
+
|
|
|
+ DataTable dt = CustomerSqlConn.dtable("SELECT wname,k.`Name`,PosSn, merchantname,(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) SeoKeyword,DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') BindingTime,DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') ActivationTime,amount,maxdate, CreditRewardAmount, opdate, info from (select (select MerchantName from PosMerchantInfo where Id=pos.BindMerchantId limit 1) merchantname,(select SUM(RewardAmount) from ActiveReward where KqSnNo=pos.PosSn limit 1) amount,(select MAX(CreateDate) from ActiveReward where KqSnNo=pos.PosSn limit 1) maxdate,(SELECT CreditRewardAmount FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) CreditRewardAmount,(select CreateDate FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) opdate,(select CONCAT(MakerCode,'_',RealName ) from Users where Id=(SELECT UserId FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1)) info,(select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN (select NoticeMoneyUnit from KqProducts where Id=pos.BrandId limit 1)=0 THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition, conn);
|
|
|
foreach (DataRow item in dt.Rows)
|
|
|
{
|
|
|
Dictionary<string, object> curData = new Dictionary<string, object>();
|
|
|
@@ -5761,7 +5665,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
condition += " and tb.BrandId=" + BrandId;
|
|
|
}
|
|
|
- var Sql = "select wname '伙伴名称',k.`Name` '机具品牌',PosSn '机具Sn', merchantname '商户姓名',(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) '服务费',DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') '绑定时间',DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') '激活时间',amount '返现金额',maxdate '返现时间', CreditRewardAmount '开机奖', opdate '开机奖发放时间', info '发放对象' from (select (select MerchantName from PosMerchantInfo where Id=pos.BindMerchantId limit 1) merchantname,(select SUM(RewardAmount) from ActiveReward where KqSnNo=pos.PosSn limit 1) amount,(select MAX(CreateDate) from ActiveReward where KqSnNo=pos.PosSn limit 1) maxdate,(SELECT CreditRewardAmount FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) CreditRewardAmount,(select CreateDate FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) opdate,(select CONCAT(MakerCode,'_',RealName ) from Users where Id=(SELECT UserId FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1)) info,(select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN (select SingleDepositApi from KqProducts where Id=pos.BrandId limit 1)=0 THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition;
|
|
|
+ // var Sql = "select wname '伙伴名称',k.`Name` '机具品牌',PosSn '机具Sn', merchantname '商户姓名',(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) '服务费',DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') '绑定时间',DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') '激活时间',amount '返现金额',maxdate '返现时间', CreditRewardAmount '开机奖', opdate '开机奖发放时间', info '发放对象' from (select (select MerchantName from PosMerchantInfo where Id=pos.BindMerchantId limit 1) merchantname,(select SUM(RewardAmount) from ActiveReward where KqSnNo=pos.PosSn limit 1) amount,(select MAX(CreateDate) from ActiveReward where KqSnNo=pos.PosSn limit 1) maxdate,(SELECT CreditRewardAmount FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) CreditRewardAmount,(select CreateDate FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) opdate,(select CONCAT(MakerCode,'_',RealName ) from Users where Id=(SELECT UserId FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1)) info,(select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN (select SingleDepositApi from KqProducts where Id=pos.BrandId limit 1)=0 THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition;
|
|
|
+
|
|
|
+ var Sql = "select wname '伙伴名称',k.`Name` '机具品牌',PosSn '机具Sn', merchantname '商户姓名',(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) '服务费',DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') '绑定时间',DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') '激活时间',amount '返现金额',maxdate '返现时间', CreditRewardAmount '开机奖', opdate '开机奖发放时间', info '发放对象' from (select (select MerchantName from PosMerchantInfo where Id=pos.BindMerchantId limit 1) merchantname,(select SUM(RewardAmount) from ActiveReward where KqSnNo=pos.PosSn limit 1) amount,(select MAX(CreateDate) from ActiveReward where KqSnNo=pos.PosSn limit 1) maxdate,(SELECT CreditRewardAmount FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) CreditRewardAmount,(select CreateDate FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1) opdate,(select CONCAT(MakerCode,'_',RealName ) from Users where Id=(SELECT UserId FROM OpenRewardDetail WHERE SnNo=pos.PosSn AND CreditRewardAmount=20 limit 1)) info,(select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN (select NoticeMoneyUnit from KqProducts where Id=pos.BrandId limit 1)=0 THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition;
|
|
|
|
|
|
var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
|
|
|
var FileName = MakerCode + RealName + "直营团队数据记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|