Browse Source

增加测试调试

Lishi
xxe 2 years ago
parent
commit
84473df961
4 changed files with 11 additions and 3 deletions
  1. +2
    -0
      HKCardOUT/Bootstrapper.cs
  2. +1
    -0
      HKCardOUT/Helper/DataBus.cs
  3. +7
    -3
      HKCardOUT/Logic/Service/HKCore.cs
  4. +1
    -0
      HKCardOUT/options.json

+ 2
- 0
HKCardOUT/Bootstrapper.cs View File

@@ -11,6 +11,7 @@ using HKCardOUT.QuartzUtil;
using HKCardOUT.Logic;
using HKCardOUT.Logic.Service;
using ImTools;
using XExten.Advance.LinqFramework;

namespace HKCardOUT
{
@@ -40,6 +41,7 @@ namespace HKCardOUT
DataBus.SaasRoute = configer["SaasRoute"];
DataBus.StoreId = configer["StoreId"];
DataBus.COM = configer["COM"];
DataBus.IsTest = configer["IsTest"].AsBool();
DbContext.InitTable();
RemoteService.PullShopInfo();
base.Configure();


+ 1
- 0
HKCardOUT/Helper/DataBus.cs View File

@@ -26,6 +26,7 @@ namespace HKCardOUT.Helper
}
public static bool NetWordState { get; set; } = false;
public static string Cron { get; set; }
public static bool IsTest { get; set; }
public static string StoreId { get; set; }
public static string COM { get; set; }
public static string SaasRoute { get; set; }


+ 7
- 3
HKCardOUT/Logic/Service/HKCore.cs View File

@@ -1,4 +1,5 @@
using HandyControl.Controls;
using HKCardOUT.Helper;
using HKCardOUT.Logic.Model;
using HKControl;
using System;
@@ -20,7 +21,8 @@ namespace HKCardOUT.Logic.Service
public bool DeviceSale(SaleLog input)
{
if (RemoteService.CheckCardStuatas(input.CardNo) != 1) return false;
if (!Main.GetInstance.GetIsSwipe(input.Location.AsInt())) return false;
if (!DataBus.IsTest)
if (!Main.GetInstance.GetIsSwipe(input.Location.AsInt())) return false;
var Old = DbContext.Context.Queryable<SaleLog>()
.Where(t => t.CardNo == input.CardNo).OrderByDescending(t => t.CreateTime).First();
if (Old != null)
@@ -29,7 +31,8 @@ namespace HKCardOUT.Logic.Service
if (entity.Id != Guid.Empty)
{
var res = RemoteService.SyncSaleLog(input.CardNo, input.Location);
Main.GetInstance.Start(input.Location.AsInt());
if (!DataBus.IsTest)
Main.GetInstance.Start(input.Location.AsInt());
DbContext.Context.Updateable<SaleLog>().SetColumns(t => t.IsSync == true).Where(t => t.Id == entity.Id).ExecuteCommand();
return res;
}
@@ -41,7 +44,8 @@ namespace HKCardOUT.Logic.Service
if (entity.Id != Guid.Empty)
{
var res = RemoteService.SyncSaleLog(input.CardNo, input.Location);
Main.GetInstance.Start(input.Location.AsInt());
if (!DataBus.IsTest)
Main.GetInstance.Start(input.Location.AsInt());
DbContext.Context.Updateable<SaleLog>().SetColumns(t => t.IsSync == true).Where(t => t.Id == entity.Id).ExecuteCommand();
return res;
}


+ 1
- 0
HKCardOUT/options.json View File

@@ -1,6 +1,7 @@
{
//服务地址
"SaasRoute": "https://bpa.black-pa.com:21527/kitchen/",
"IsTest": true,
"COM": "COM3",
//定时任务时间表达式
"Cron": "0 0 11,15 * * ? ",


Loading…
Cancel
Save