|
|
@@ -2,6 +2,7 @@ |
|
|
|
using HKCardOUT.Helper; |
|
|
|
using HKCardOUT.Logic.Model; |
|
|
|
using HKControl; |
|
|
|
using HKLib.Dto; |
|
|
|
using HKLog; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
@@ -16,6 +17,13 @@ namespace HKCardOUT.Logic.Service |
|
|
|
{ |
|
|
|
public class HKCore |
|
|
|
{ |
|
|
|
public void GetRecrod() |
|
|
|
{ |
|
|
|
MemoryBus.CardRecord = DbContext.Context.Queryable<SaleLog>() |
|
|
|
.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(); |
|
|
|
} |
|
|
|
List<SaleLog> Commom(SaleLog input) |
|
|
|
{ |
|
|
|
if (DataBus.StartDevice) |
|
|
@@ -25,7 +33,7 @@ namespace HKCardOUT.Logic.Service |
|
|
|
HKLogImport.WriteInfo("设备出餐状态:" + checkDevice); |
|
|
|
if (checkDevice) return null; |
|
|
|
} |
|
|
|
var Old = DbContext.Context.Queryable<SaleLog>() |
|
|
|
var Old = MemoryBus.CardRecord |
|
|
|
.Where(t => t.CardNo == input.CardNo) |
|
|
|
.Where(t => t.CreateTime.Year == DateTime.Now.Year) |
|
|
|
.Where(t => t.CreateTime.Month == DateTime.Now.Month) |
|
|
@@ -45,11 +53,19 @@ namespace HKCardOUT.Logic.Service |
|
|
|
|
|
|
|
bool GetCardStutas(string CardNo) |
|
|
|
{ |
|
|
|
var data = DbContext.Context.Queryable<CardStutas>().First(t => t.CardNo == CardNo); |
|
|
|
var data = MemoryBus.CardStatus.First(t => t.CardNo == CardNo); |
|
|
|
if (data == null) return false; |
|
|
|
if (data.Stutas != 1) return false; |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 获取所有的卡状态 |
|
|
|
/// </summary> |
|
|
|
public void GetAllCardStatus() |
|
|
|
{ |
|
|
|
MemoryBus.CardStatus = DbContext.Context.Queryable<CardStutas>().ToList(); |
|
|
|
} |
|
|
|
public static void AddCard(List<CardStutas> input) |
|
|
|
{ |
|
|
|
var temp = DbContext.Context.Queryable<CardStutas>().Where(t => input.Select(m => m.CardNo).Contains(t.CardNo)).Distinct().ToList(); |
|
|
@@ -292,6 +308,7 @@ namespace HKCardOUT.Logic.Service |
|
|
|
entity.State = true; |
|
|
|
HKLogImport.WriteInfo("正在写入数据库,当前数据:" + entity.ToJson()); |
|
|
|
DbContext.Context.Insertable(entity).CallEntityMethod(t => t.Create()).ExecuteReturnEntity(); |
|
|
|
GetRecrod(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|