|
@@ -28,9 +28,9 @@ namespace HKCardOUT.Logic.Service |
|
|
} |
|
|
} |
|
|
var Old = DbContext.Context.Queryable<SaleLog>() |
|
|
var Old = DbContext.Context.Queryable<SaleLog>() |
|
|
.Where(t => t.CardNo == input.CardNo) |
|
|
.Where(t => t.CardNo == input.CardNo) |
|
|
.Where(t => t.CreateTime.Year == DateTime.Now.Year) |
|
|
|
|
|
.Where(t => t.CreateTime.Month == DateTime.Now.Month) |
|
|
|
|
|
.Where(t => t.CreateTime.Day == DateTime.Now.Day).ToList(); |
|
|
|
|
|
|
|
|
.Where(t => t.CreateTime.Year == DataBus.TodayTime.Year) |
|
|
|
|
|
.Where(t => t.CreateTime.Month == DataBus.TodayTime.Month) |
|
|
|
|
|
.Where(t => t.CreateTime.Day == DataBus.TodayTime.Day).ToList(); |
|
|
|
|
|
|
|
|
if (DataBus.Admin.Contains(input.CardNo)) |
|
|
if (DataBus.Admin.Contains(input.CardNo)) |
|
|
{ |
|
|
{ |
|
@@ -105,9 +105,9 @@ namespace HKCardOUT.Logic.Service |
|
|
var Old = Commom(input); |
|
|
var Old = Commom(input); |
|
|
if (Old == null) return false; |
|
|
if (Old == null) return false; |
|
|
var AMDay = Old.Where(t => t.CreateTime >= DataBus.Times.AMStartTime && t.CreateTime < DataBus.Times.AMEndTime) |
|
|
var AMDay = Old.Where(t => t.CreateTime >= DataBus.Times.AMStartTime && t.CreateTime < DataBus.Times.AMEndTime) |
|
|
.Where(t => t.CreateTime.Year == DateTime.Now.Year) |
|
|
|
|
|
.Where(t => t.CreateTime.Month == DateTime.Now.Month) |
|
|
|
|
|
.Where(t => t.CreateTime.Day == DateTime.Now.Day) |
|
|
|
|
|
|
|
|
.Where(t => t.CreateTime.Year == DataBus.TodayTime.Year) |
|
|
|
|
|
.Where(t => t.CreateTime.Month == DataBus.TodayTime.Month) |
|
|
|
|
|
.Where(t => t.CreateTime.Day == DataBus.TodayTime.Day) |
|
|
.Count(); |
|
|
.Count(); |
|
|
HKLogImport.WriteInfo($"卡号{input.CardNo}上午消费次数:{AMDay}"); |
|
|
HKLogImport.WriteInfo($"卡号{input.CardNo}上午消费次数:{AMDay}"); |
|
|
if (DataBus.Admin.Contains(input.CardNo)) |
|
|
if (DataBus.Admin.Contains(input.CardNo)) |
|
@@ -167,9 +167,9 @@ namespace HKCardOUT.Logic.Service |
|
|
var Old = Commom(input); |
|
|
var Old = Commom(input); |
|
|
if (Old == null) return false; |
|
|
if (Old == null) return false; |
|
|
var PMDay = Old.Where(t => t.CreateTime >= DataBus.Times.PMStartTime && t.CreateTime < DataBus.Times.PMEndTime). |
|
|
var PMDay = Old.Where(t => t.CreateTime >= DataBus.Times.PMStartTime && t.CreateTime < DataBus.Times.PMEndTime). |
|
|
Where(t => t.CreateTime.Year == DateTime.Now.Year) |
|
|
|
|
|
.Where(t => t.CreateTime.Month == DateTime.Now.Month) |
|
|
|
|
|
.Where(t => t.CreateTime.Day == DateTime.Now.Day) |
|
|
|
|
|
|
|
|
Where(t => t.CreateTime.Year == DataBus.TodayTime.Year) |
|
|
|
|
|
.Where(t => t.CreateTime.Month == DataBus.TodayTime.Month) |
|
|
|
|
|
.Where(t => t.CreateTime.Day == DataBus.TodayTime.Day) |
|
|
.Count(); |
|
|
.Count(); |
|
|
HKLog.HKLogImport.WriteInfo($"卡号{input.CardNo}中午消费次数:{PMDay}"); |
|
|
HKLog.HKLogImport.WriteInfo($"卡号{input.CardNo}中午消费次数:{PMDay}"); |
|
|
if (DataBus.Admin.Contains(input.CardNo)) |
|
|
if (DataBus.Admin.Contains(input.CardNo)) |
|
@@ -229,9 +229,9 @@ namespace HKCardOUT.Logic.Service |
|
|
var Old = Commom(input); |
|
|
var Old = Commom(input); |
|
|
if (Old == null) return false; |
|
|
if (Old == null) return false; |
|
|
var ATDay = Old.Where(t => t.CreateTime >= DataBus.Times.ATStartTime && t.CreateTime < DataBus.Times.ATEndTime) |
|
|
var ATDay = Old.Where(t => t.CreateTime >= DataBus.Times.ATStartTime && t.CreateTime < DataBus.Times.ATEndTime) |
|
|
.Where(t => t.CreateTime.Year == DateTime.Now.Year) |
|
|
|
|
|
.Where(t => t.CreateTime.Month == DateTime.Now.Month) |
|
|
|
|
|
.Where(t => t.CreateTime.Day == DateTime.Now.Day) |
|
|
|
|
|
|
|
|
.Where(t => t.CreateTime.Year == DataBus.TodayTime.Year) |
|
|
|
|
|
.Where(t => t.CreateTime.Month == DataBus.TodayTime.Month) |
|
|
|
|
|
.Where(t => t.CreateTime.Day == DataBus.TodayTime.Day) |
|
|
.Count(); |
|
|
.Count(); |
|
|
HKLog.HKLogImport.WriteInfo($"卡号{input.CardNo}下午消费次数:{ATDay}"); |
|
|
HKLog.HKLogImport.WriteInfo($"卡号{input.CardNo}下午消费次数:{ATDay}"); |
|
|
if (DataBus.Admin.Contains(input.CardNo)) |
|
|
if (DataBus.Admin.Contains(input.CardNo)) |
|
@@ -279,7 +279,7 @@ namespace HKCardOUT.Logic.Service |
|
|
/// <returns></returns> |
|
|
/// <returns></returns> |
|
|
public Dictionary<string, int> PullDaySaleLog(int[] screen) |
|
|
public Dictionary<string, int> PullDaySaleLog(int[] screen) |
|
|
{ |
|
|
{ |
|
|
// var today = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")); |
|
|
|
|
|
|
|
|
// var today = DateTime.Parse(DataBus.TodayTime.ToString("yyyy-MM-dd 00:00:00")); |
|
|
// var count = DbContext.Context.Queryable<SaleLog>().Where(t => t.CreateTime >= today) |
|
|
// var count = DbContext.Context.Queryable<SaleLog>().Where(t => t.CreateTime >= today) |
|
|
// .WhereIF(screen == 0, t => t.Location == "3" || t.Location == "4") |
|
|
// .WhereIF(screen == 0, t => t.Location == "3" || t.Location == "4") |
|
|
// .WhereIF(screen == 1, t => t.Location == "1" || t.Location == "2") |
|
|
// .WhereIF(screen == 1, t => t.Location == "1" || t.Location == "2") |
|
@@ -287,7 +287,7 @@ namespace HKCardOUT.Logic.Service |
|
|
//return count.GroupBy(t => t).ToDictionary(t => t.Key, t => t.Count()); |
|
|
//return count.GroupBy(t => t).ToDictionary(t => t.Key, t => t.Count()); |
|
|
string a = screen[0].ToString(); |
|
|
string a = screen[0].ToString(); |
|
|
string b = screen[1].ToString(); |
|
|
string b = screen[1].ToString(); |
|
|
var today = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")); |
|
|
|
|
|
|
|
|
var today = DateTime.Parse(DataBus.TodayTime.ToString("yyyy-MM-dd 00:00:00")); |
|
|
var count = DbContext.Context.Queryable<SaleLog>().Where(t => t.CreateTime >= today) |
|
|
var count = DbContext.Context.Queryable<SaleLog>().Where(t => t.CreateTime >= today) |
|
|
.WhereIF(screen.Length == 2, t => t.Location == a || t.Location == b).Select(t => t.Location).ToList(); |
|
|
.WhereIF(screen.Length == 2, t => t.Location == a || t.Location == b).Select(t => t.Location).ToList(); |
|
|
return count.GroupBy(t => t).ToDictionary(t => t.Key, t => t.Count()); |
|
|
return count.GroupBy(t => t).ToDictionary(t => t.Key, t => t.Count()); |
|
@@ -298,7 +298,7 @@ namespace HKCardOUT.Logic.Service |
|
|
/// <returns></returns> |
|
|
/// <returns></returns> |
|
|
public Dictionary<string, int> GetDayData() |
|
|
public Dictionary<string, int> GetDayData() |
|
|
{ |
|
|
{ |
|
|
var today = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")); |
|
|
|
|
|
|
|
|
var today = DateTime.Parse(DataBus.TodayTime.ToString("yyyy-MM-dd 00:00:00")); |
|
|
var count = DbContext.Context.Queryable<SaleLog>().Select(t => t.Location).ToList(); |
|
|
var count = DbContext.Context.Queryable<SaleLog>().Select(t => t.Location).ToList(); |
|
|
return count.GroupBy(t => t).ToDictionary(t => t.Key, t => t.Count()); |
|
|
return count.GroupBy(t => t).ToDictionary(t => t.Key, t => t.Count()); |
|
|
} |
|
|
} |
|
|