Kaynağa Gözat

时间修改

master
xxe 2 yıl önce
ebeveyn
işleme
9d4ff79942
2 değiştirilmiş dosya ile 16 ekleme ve 16 silme
  1. +15
    -15
      HKCardOUT/Logic/Service/HKCore.cs
  2. +1
    -1
      HKCardOUT/ViewModels/RootViewModel.cs

+ 15
- 15
HKCardOUT/Logic/Service/HKCore.cs Dosyayı Görüntüle

@@ -28,9 +28,9 @@ namespace HKCardOUT.Logic.Service
}
var Old = DbContext.Context.Queryable<SaleLog>()
.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))
{
@@ -105,9 +105,9 @@ namespace HKCardOUT.Logic.Service
var Old = Commom(input);
if (Old == null) return false;
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();
HKLogImport.WriteInfo($"卡号{input.CardNo}上午消费次数:{AMDay}");
if (DataBus.Admin.Contains(input.CardNo))
@@ -167,9 +167,9 @@ namespace HKCardOUT.Logic.Service
var Old = Commom(input);
if (Old == null) return false;
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();
HKLog.HKLogImport.WriteInfo($"卡号{input.CardNo}中午消费次数:{PMDay}");
if (DataBus.Admin.Contains(input.CardNo))
@@ -229,9 +229,9 @@ namespace HKCardOUT.Logic.Service
var Old = Commom(input);
if (Old == null) return false;
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();
HKLog.HKLogImport.WriteInfo($"卡号{input.CardNo}下午消费次数:{ATDay}");
if (DataBus.Admin.Contains(input.CardNo))
@@ -279,7 +279,7 @@ namespace HKCardOUT.Logic.Service
/// <returns></returns>
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)
// .WhereIF(screen == 0, t => t.Location == "3" || t.Location == "4")
// .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());
string a = screen[0].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)
.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());
@@ -298,7 +298,7 @@ namespace HKCardOUT.Logic.Service
/// <returns></returns>
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();
return count.GroupBy(t => t).ToDictionary(t => t.Key, t => t.Count());
}


+ 1
- 1
HKCardOUT/ViewModels/RootViewModel.cs Dosyayı Görüntüle

@@ -212,7 +212,7 @@ namespace HKCardOUT.ViewModels
{
CardNo = input.ResData.Substring(1, input.ResData.Length - 1),
Location = input.Address.AsInt().ToString(),
Date = DateTime.Now
Date = DataBus.TodayTime
};
HKLogImport.WriteInfo("读卡成功:" + mo.ToJson());
if (Stacks.Count > 0)


Yükleniyor…
İptal
Kaydet