|
@@ -351,6 +351,10 @@ namespace MySystem
|
|
BrandIds.Add(19);
|
|
BrandIds.Add(19);
|
|
BrandIds.Add(20);
|
|
BrandIds.Add(20);
|
|
BrandIds.Add(21);
|
|
BrandIds.Add(21);
|
|
|
|
+ BrandIds.Add(23);
|
|
|
|
+ BrandIds.Add(24);
|
|
|
|
+ BrandIds.Add(25);
|
|
|
|
+ BrandIds.Add(26);
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
DateTime yesterday = DateTime.Now.AddDays(-1);
|
|
DateTime yesterday = DateTime.Now.AddDays(-1);
|
|
DateTime today = DateTime.Now.AddMinutes(-10);
|
|
DateTime today = DateTime.Now.AddMinutes(-10);
|
|
@@ -456,7 +460,17 @@ namespace MySystem
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
DateTime yesterday = DateTime.Now.AddDays(-31);
|
|
DateTime yesterday = DateTime.Now.AddDays(-31);
|
|
DateTime today = DateTime.Now.AddMinutes(-10);
|
|
DateTime today = DateTime.Now.AddMinutes(-10);
|
|
- IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.ActivationState == 1 && (string.IsNullOrEmpty(m.SeoKeyword) || m.SeoKeyword == "0") && m.CreditTrade >= 5000 && m.BrandId != 12 && m.BrandId != 13 && m.BrandId != 14 && m.BrandId != 15 && m.BrandId != 16 && m.Detail != "1");
|
|
|
|
|
|
+ List<int> BrandIds = new List<int>();
|
|
|
|
+ BrandIds.Add(12);
|
|
|
|
+ BrandIds.Add(13);
|
|
|
|
+ BrandIds.Add(14);
|
|
|
|
+ BrandIds.Add(15);
|
|
|
|
+ BrandIds.Add(16);
|
|
|
|
+ BrandIds.Add(23);
|
|
|
|
+ BrandIds.Add(24);
|
|
|
|
+ BrandIds.Add(25);
|
|
|
|
+ BrandIds.Add(26);
|
|
|
|
+ IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.ActivationState == 1 && (string.IsNullOrEmpty(m.SeoKeyword) || m.SeoKeyword == "0") && m.CreditTrade >= 5000 && !BrandIds.Contains(m.BrandId) && m.Detail != "1");
|
|
if (posid > 0)
|
|
if (posid > 0)
|
|
{
|
|
{
|
|
posList = posList.Where(m => m.Id == posid);
|
|
posList = posList.Where(m => m.Id == posid);
|
|
@@ -773,7 +787,7 @@ namespace MySystem
|
|
{
|
|
{
|
|
string MerNo = merchant.KqMerNo;
|
|
string MerNo = merchant.KqMerNo;
|
|
//判断商户号是否为空,避免下次再有空商户的情况,导致奖励不发放
|
|
//判断商户号是否为空,避免下次再有空商户的情况,导致奖励不发放
|
|
- if(string.IsNullOrEmpty(MerNo))
|
|
|
|
|
|
+ if(string.IsNullOrEmpty(MerNo) && (pos.BrandId < 23 || pos.BrandId > 26))
|
|
{
|
|
{
|
|
// MerNo = "n" + DateTime.Now.ToString("yyyyMMddHHmmssfff");
|
|
// MerNo = "n" + DateTime.Now.ToString("yyyyMMddHHmmssfff");
|
|
RedisDbconn.Instance.AddList("ActiveRewardFailQueue", "{\"PosId\":\"" + pos.Id + "\",\"UserId\":\"" + GetUserId + "\",\"ActPrize\":\"" + ActPrize + "\",\"ChangeType\":\"" + ChangeType + "\",\"ActType\":\"" + ActType + "\"}");
|
|
RedisDbconn.Instance.AddList("ActiveRewardFailQueue", "{\"PosId\":\"" + pos.Id + "\",\"UserId\":\"" + GetUserId + "\",\"ActPrize\":\"" + ActPrize + "\",\"ChangeType\":\"" + ChangeType + "\",\"ActType\":\"" + ActType + "\"}");
|
|
@@ -784,6 +798,10 @@ namespace MySystem
|
|
BrandIds.Add(19);
|
|
BrandIds.Add(19);
|
|
BrandIds.Add(20);
|
|
BrandIds.Add(20);
|
|
BrandIds.Add(21);
|
|
BrandIds.Add(21);
|
|
|
|
+ BrandIds.Add(23);
|
|
|
|
+ BrandIds.Add(24);
|
|
|
|
+ BrandIds.Add(25);
|
|
|
|
+ BrandIds.Add(26);
|
|
bool check = false;
|
|
bool check = false;
|
|
if(!BrandIds.Contains(pos.BrandId))
|
|
if(!BrandIds.Contains(pos.BrandId))
|
|
{
|
|
{
|
|
@@ -1192,6 +1210,10 @@ namespace MySystem
|
|
BrandIds.Add(19);
|
|
BrandIds.Add(19);
|
|
BrandIds.Add(20);
|
|
BrandIds.Add(20);
|
|
BrandIds.Add(21);
|
|
BrandIds.Add(21);
|
|
|
|
+ BrandIds.Add(23);
|
|
|
|
+ BrandIds.Add(24);
|
|
|
|
+ BrandIds.Add(25);
|
|
|
|
+ BrandIds.Add(26);
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
OpModels.WebCMSEntities opdb = new OpModels.WebCMSEntities();
|
|
OpModels.WebCMSEntities opdb = new OpModels.WebCMSEntities();
|
|
PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId && m.ActivationState == 1 && ((!string.IsNullOrEmpty(m.SeoKeyword) && m.SeoKeyword != "0" && m.CreditTrade >= 1000) || BrandIds.Contains(m.BrandId)));
|
|
PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId && m.ActivationState == 1 && ((!string.IsNullOrEmpty(m.SeoKeyword) && m.SeoKeyword != "0" && m.CreditTrade >= 1000) || BrandIds.Contains(m.BrandId)));
|
|
@@ -1225,6 +1247,10 @@ namespace MySystem
|
|
{
|
|
{
|
|
Prize = 20;
|
|
Prize = 20;
|
|
}
|
|
}
|
|
|
|
+ if(pos.BrandId == 23 || pos.BrandId == 24 || pos.BrandId == 25 || pos.BrandId == 26)
|
|
|
|
+ {
|
|
|
|
+ Prize = 3;
|
|
|
|
+ }
|
|
string[] ParentNavs = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
string[] ParentNavs = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
for (int i = ParentNavs.Length - 1; i >= 0; i--)
|
|
for (int i = ParentNavs.Length - 1; i >= 0; i--)
|
|
{
|
|
{
|
|
@@ -2111,12 +2137,55 @@ namespace MySystem
|
|
string start = date + " 00:00:00";
|
|
string start = date + " 00:00:00";
|
|
string end = DateTime.Parse(date).AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00";
|
|
string end = DateTime.Parse(date).AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00";
|
|
CustomerSqlConn.op("insert into PosMerchantTradeSummay (MerchantId,BrandId,TradeDate,TradeMonth,TradeAmount,CreateDate) select *,now() from (select MerchantId,BrandId,DATE_FORMAT(CreateDate,'%Y%m%d') as TradeDate,DATE_FORMAT(CreateDate,'%Y%m') as TradeMonth,sum(TradeAmount) as TradeAmount from TradeRecord where Id>=13000000 and CreateDate>='" + start + "' and CreateDate<'" + end + "' and ActStatus=1 and BrandId!=14 group by MerchantId,BrandId,DATE_FORMAT(CreateDate,'%Y%m%d'),TradeDate,DATE_FORMAT(CreateDate,'%Y%m') order by MerchantId,BrandId,DATE_FORMAT(CreateDate,'%Y%m%d')) tb", MysqlConn.SqlConnStr);
|
|
CustomerSqlConn.op("insert into PosMerchantTradeSummay (MerchantId,BrandId,TradeDate,TradeMonth,TradeAmount,CreateDate) select *,now() from (select MerchantId,BrandId,DATE_FORMAT(CreateDate,'%Y%m%d') as TradeDate,DATE_FORMAT(CreateDate,'%Y%m') as TradeMonth,sum(TradeAmount) as TradeAmount from TradeRecord where Id>=13000000 and CreateDate>='" + start + "' and CreateDate<'" + end + "' and ActStatus=1 and BrandId!=14 group by MerchantId,BrandId,DATE_FORMAT(CreateDate,'%Y%m%d'),TradeDate,DATE_FORMAT(CreateDate,'%Y%m') order by MerchantId,BrandId,DATE_FORMAT(CreateDate,'%Y%m%d')) tb", MysqlConn.SqlConnStr);
|
|
-
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计商户的交易额");
|
|
function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计商户的交易额");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ WebCMSEntities db = new WebCMSEntities();
|
|
|
|
+ var tran = db.Database.BeginTransaction();
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ SpModels.WebCMSEntities spdb = new SpModels.WebCMSEntities();
|
|
|
|
+ DateTime s = DateTime.Parse(date + " 00:00:00");
|
|
|
|
+ DateTime e = s.AddDays(1);
|
|
|
|
+ int StartId = int.Parse(function.CheckInt(function.ReadInstance("/SycnSp/TradeRecordId.txt")));
|
|
|
|
+ IQueryable<SpModels.TradeRecord> trades = spdb.TradeRecord.Where(m => m.Id >= StartId && m.ProductType == "23" && m.CreateDate >= s && m.CreateDate < e).OrderBy(m => m.CreateDate);
|
|
|
|
+ foreach (SpModels.TradeRecord trade in trades.ToList())
|
|
|
|
+ {
|
|
|
|
+ string MerNo = trade.MerNo;
|
|
|
|
+ string TradeDate = trade.CreateDate.Value.ToString("yyyyMMdd");
|
|
|
|
+ string TradeMonth = TradeDate.Substring(0, 6);
|
|
|
|
+ PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.KqMerNo == MerNo);
|
|
|
|
+ if(merchant != null)
|
|
|
|
+ {
|
|
|
|
+ PosMerchantTradeSummay stat = db.PosMerchantTradeSummay.FirstOrDefault(m => m.MerchantId == merchant.Id && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == merchant.BrandId);
|
|
|
|
+ if (stat == null)
|
|
|
|
+ {
|
|
|
|
+ stat = db.PosMerchantTradeSummay.Add(new PosMerchantTradeSummay()
|
|
|
|
+ {
|
|
|
|
+ MerchantId = merchant.Id,
|
|
|
|
+ TradeMonth = TradeMonth,
|
|
|
|
+ TradeDate = TradeDate,
|
|
|
|
+ BrandId = merchant.BrandId,
|
|
|
|
+ }).Entity;
|
|
|
|
+ db.SaveChanges();
|
|
|
|
+ }
|
|
|
|
+ stat.TradeAmount += trade.TradeAmount / 100;
|
|
|
|
+ db.SaveChanges();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ spdb.Dispose();
|
|
|
|
+ tran.Commit();
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex)
|
|
|
|
+ {
|
|
|
|
+ tran.Rollback();
|
|
|
|
+ function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计WIFI商户的交易额");
|
|
|
|
+ }
|
|
|
|
+ tran.Dispose();
|
|
|
|
+ db.Dispose();
|
|
function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行商户交易额日志");
|
|
function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行商户交易额日志");
|
|
}
|
|
}
|
|
|
|
|