|
|
@@ -29,12 +29,12 @@ namespace MySystem
|
|
|
{
|
|
|
if (DateTime.Now.Hour >= 3)
|
|
|
{
|
|
|
- StatSendEverDayV2();
|
|
|
+ StatSendEverDay();
|
|
|
}
|
|
|
Thread.Sleep(30000);
|
|
|
}
|
|
|
}
|
|
|
- public void StatSendEverDayV2()
|
|
|
+ public void StatSendEverDay()
|
|
|
{
|
|
|
OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "运营中心发货统计日志");
|
|
|
@@ -69,7 +69,7 @@ namespace MySystem
|
|
|
string TradeDate = selfDr[3].ToString();
|
|
|
string TradeMonth = TradeDate.Substring(0, 6);
|
|
|
int SendCount = int.Parse(selfDr[4].ToString());
|
|
|
- if(TransType == 1)
|
|
|
+ if(TransType == 10 || TransType == 11)
|
|
|
{
|
|
|
SendDaySummary selfStat = db.SendDaySummary.FirstOrDefault(m => m.OpId == OpId && m.TradeDate == TradeDate);
|
|
|
if (selfStat == null)
|
|
|
@@ -94,32 +94,30 @@ namespace MySystem
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
monthStat.SendCount += SendCount;
|
|
|
- }
|
|
|
- else if(TransType == 2 || TransType == 10 || TransType == 11)
|
|
|
- {
|
|
|
- StoreSendDaySummary selfStat = db.StoreSendDaySummary.FirstOrDefault(m => m.OpId == StoreId && m.TradeDate == TradeDate);
|
|
|
- if (selfStat == null)
|
|
|
+
|
|
|
+ StoreSendDaySummary selfStoreStat = db.StoreSendDaySummary.FirstOrDefault(m => m.OpId == StoreId && m.TradeDate == TradeDate);
|
|
|
+ if (selfStoreStat == null)
|
|
|
{
|
|
|
- selfStat = db.StoreSendDaySummary.Add(new StoreSendDaySummary()
|
|
|
+ selfStoreStat = db.StoreSendDaySummary.Add(new StoreSendDaySummary()
|
|
|
{
|
|
|
TradeDate = TradeDate,
|
|
|
OpId = StoreId,
|
|
|
}).Entity;
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
- selfStat.SendCount += SendCount;
|
|
|
+ selfStoreStat.SendCount += SendCount;
|
|
|
|
|
|
- StoreSendMonthSummary monthStat = db.StoreSendMonthSummary.FirstOrDefault(m => m.OpId == StoreId && m.TradeMonth == TradeMonth);
|
|
|
- if (monthStat == null)
|
|
|
+ StoreSendMonthSummary monthStoreStat = db.StoreSendMonthSummary.FirstOrDefault(m => m.OpId == StoreId && m.TradeMonth == TradeMonth);
|
|
|
+ if (monthStoreStat == null)
|
|
|
{
|
|
|
- monthStat = db.StoreSendMonthSummary.Add(new StoreSendMonthSummary()
|
|
|
+ monthStoreStat = db.StoreSendMonthSummary.Add(new StoreSendMonthSummary()
|
|
|
{
|
|
|
TradeMonth = TradeMonth,
|
|
|
OpId = StoreId,
|
|
|
}).Entity;
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
- monthStat.SendCount += SendCount;
|
|
|
+ monthStoreStat.SendCount += SendCount;
|
|
|
}
|
|
|
}
|
|
|
OtherMySqlConn.op("update StoreStockChange set Status=1 where Id in (" + ids.TrimEnd(',') + ")");
|
|
|
@@ -277,7 +275,7 @@ namespace MySystem
|
|
|
{
|
|
|
startId = "0";
|
|
|
}
|
|
|
- DataTable idsDt = OtherMySqlConn.dtable("select Id from PosCouponRecord where Id>=" + startId + " and CreateDate>='2022-12-19 00:00:00' and OpId>0 and Status=0 order by Id limit 50");
|
|
|
+ DataTable idsDt = OtherMySqlConn.dtable("select Id from PosCoupons where Id>=" + startId + " and CreateDate>='2022-12-19 00:00:00' and OpId>0 and Status=0 order by Id limit 50");
|
|
|
if (idsDt.Rows.Count > 0)
|
|
|
{
|
|
|
string ids = "";
|
|
|
@@ -286,7 +284,7 @@ namespace MySystem
|
|
|
ids += idsDr["Id"].ToString() + ",";
|
|
|
startId = idsDr["Id"].ToString();
|
|
|
}
|
|
|
- DataTable selfDt = OtherMySqlConn.dtable("select OpId,DATE_FORMAT(CreateDate,'%Y%m%d'),count(Id) from PosCouponRecord where Id in (" + ids.TrimEnd(',') + ") group by OpId,DATE_FORMAT(CreateDate,'%Y%m%d')");
|
|
|
+ DataTable selfDt = OtherMySqlConn.dtable("select OpId,DATE_FORMAT(CreateDate,'%Y%m%d'),count(Id) from PosCoupons where Id in (" + ids.TrimEnd(',') + ") group by OpId,DATE_FORMAT(CreateDate,'%Y%m%d')");
|
|
|
if (selfDt.Rows.Count > 0)
|
|
|
{
|
|
|
function.WriteLog("人数:" + selfDt.Rows.Count + "\n\n", "运营中心机具券销售量日志");
|
|
|
@@ -321,7 +319,7 @@ namespace MySystem
|
|
|
monthStat.SaleCount += SaleCount;
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
- OtherMySqlConn.op("update PosCouponRecord set Status=1 where Id in (" + ids.TrimEnd(',') + ")");
|
|
|
+ OtherMySqlConn.op("update PosCoupons set Status=1 where Id in (" + ids.TrimEnd(',') + ")");
|
|
|
function.WritePage("/SaleStat/", "Id.txt", startId);
|
|
|
}
|
|
|
}
|