|
|
@@ -2,6 +2,7 @@ |
|
|
|
using HKCardOUT.Helper; |
|
|
|
using HKCardOUT.Logic.Model; |
|
|
|
using HKControl; |
|
|
|
using HKLog; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
@@ -16,8 +17,12 @@ namespace HKCardOUT.Logic.Service |
|
|
|
{ |
|
|
|
List<SaleLog> Commom(SaleLog input) |
|
|
|
{ |
|
|
|
if (DataBus.StartDevice) |
|
|
|
if (!Main.GetInstance.GetIsSwipe(input.Location.AsInt())) return null; |
|
|
|
if (DataBus.StartDevice) { |
|
|
|
|
|
|
|
var checkDevice = !Main.GetInstance.GetIsSwipe(input.Location.AsInt()); |
|
|
|
HKLogImport.WriteInfo("设备是否可以出餐" + checkDevice); |
|
|
|
if (checkDevice) return null; |
|
|
|
} |
|
|
|
var Old = DbContext.Context.Queryable<SaleLog>() |
|
|
|
.Where(t => t.CardNo == input.CardNo) |
|
|
|
.Where(t => t.CreateTime.Year == DateTime.Now.Year) |
|
|
@@ -81,7 +86,11 @@ namespace HKCardOUT.Logic.Service |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
if (!GetCardStutas(input.CardNo)) return false; |
|
|
|
if (!GetCardStutas(input.CardNo)) |
|
|
|
{ |
|
|
|
HKLogImport.WriteInfo($"当前卡异常,卡号:【{input.CardNo}】"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
var Old = Commom(input); |
|
|
|
if (Old == null) return false; |
|
|
|
var AMDay = Old.Where(t => t.CreateTime >= DataBus.Times.AMStartTime && t.CreateTime < DataBus.Times.AMEndTime) |
|
|
@@ -89,7 +98,7 @@ namespace HKCardOUT.Logic.Service |
|
|
|
.Where(t => t.CreateTime.Month == DateTime.Now.Month) |
|
|
|
.Where(t => t.CreateTime.Day == DateTime.Now.Day) |
|
|
|
.Count(); |
|
|
|
HKLog.HKLogImport.WriteInfo($"卡号{input.CardNo}上午消费次数:{AMDay}"); |
|
|
|
HKLogImport.WriteInfo($"卡号{input.CardNo}上午消费次数:{AMDay}"); |
|
|
|
if (DataBus.Admin.Contains(input.CardNo)) |
|
|
|
{ |
|
|
|
var entity1 = DbContext.Context.Insertable(input).CallEntityMethod(t => t.Create()).ExecuteReturnEntity(); |
|
|
@@ -97,8 +106,8 @@ namespace HKCardOUT.Logic.Service |
|
|
|
{ |
|
|
|
if (DataBus.StartDevice) |
|
|
|
{ |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
UHF_RS485_Helper.GetInstance().OpenBeep(input.Location.AsInt()); |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
HKLogImport.WriteInfo($"设备位置:{input.Location},卡号:{input.CardNo},成功出餐"); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
@@ -111,7 +120,7 @@ namespace HKCardOUT.Logic.Service |
|
|
|
if (DataBus.StartDevice) |
|
|
|
{ |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
UHF_RS485_Helper.GetInstance().OpenBeep(input.Location.AsInt()); |
|
|
|
HKLogImport.WriteInfo($"设备位置:{input.Location},卡号:{input.CardNo},成功出餐"); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
@@ -135,7 +144,11 @@ namespace HKCardOUT.Logic.Service |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
if (!GetCardStutas(input.CardNo)) return false; |
|
|
|
if (!GetCardStutas(input.CardNo)) |
|
|
|
{ |
|
|
|
HKLogImport.WriteInfo($"当前卡异常,卡号:【{input.CardNo}】"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
var Old = Commom(input); |
|
|
|
if (Old == null) return false; |
|
|
|
var PMDay = Old.Where(t => t.CreateTime >= DataBus.Times.PMStartTime && t.CreateTime < DataBus.Times.PMEndTime). |
|
|
@@ -152,7 +165,7 @@ namespace HKCardOUT.Logic.Service |
|
|
|
if (DataBus.StartDevice) |
|
|
|
{ |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
UHF_RS485_Helper.GetInstance().OpenBeep(input.Location.AsInt()); |
|
|
|
HKLogImport.WriteInfo($"设备位置:{input.Location},卡号:{input.CardNo},成功出餐"); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
@@ -165,7 +178,7 @@ namespace HKCardOUT.Logic.Service |
|
|
|
if (DataBus.StartDevice) |
|
|
|
{ |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
UHF_RS485_Helper.GetInstance().OpenBeep(input.Location.AsInt()); |
|
|
|
HKLogImport.WriteInfo($"设备位置:{input.Location},卡号:{input.CardNo},成功出餐"); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
@@ -189,7 +202,11 @@ namespace HKCardOUT.Logic.Service |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
if (!GetCardStutas(input.CardNo)) return false; |
|
|
|
if (!GetCardStutas(input.CardNo)) |
|
|
|
{ |
|
|
|
HKLogImport.WriteInfo($"当前卡异常,卡号:【{input.CardNo}】"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
var Old = Commom(input); |
|
|
|
if (Old == null) return false; |
|
|
|
var ATDay = Old.Where(t => t.CreateTime >= DataBus.Times.ATStartTime && t.CreateTime < DataBus.Times.ATEndTime) |
|
|
@@ -206,7 +223,7 @@ namespace HKCardOUT.Logic.Service |
|
|
|
if (DataBus.StartDevice) |
|
|
|
{ |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
UHF_RS485_Helper.GetInstance().OpenBeep(input.Location.AsInt()); |
|
|
|
HKLogImport.WriteInfo($"设备位置:{input.Location},卡号:{input.CardNo},成功出餐"); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
@@ -219,7 +236,7 @@ namespace HKCardOUT.Logic.Service |
|
|
|
if (DataBus.StartDevice) |
|
|
|
{ |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
UHF_RS485_Helper.GetInstance().OpenBeep(input.Location.AsInt()); |
|
|
|
HKLogImport.WriteInfo($"设备位置:{input.Location},卡号:{input.CardNo},成功出餐"); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|