@@ -65,12 +65,11 @@ namespace HKCardOUT | |||||
DataBus.COM = configer["COM"]; | DataBus.COM = configer["COM"]; | ||||
DataBus.StartDevice = configer["StartDevice"].AsBool(); | DataBus.StartDevice = configer["StartDevice"].AsBool(); | ||||
DataBus.Cancel = configer["Cancel"].AsBool(); | DataBus.Cancel = configer["Cancel"].AsBool(); | ||||
DataBus.AM = configer["AM"]; | |||||
DataBus.PM = configer["PM"]; | |||||
DataBus.Count = configer["Count"].AsInt(); | DataBus.Count = configer["Count"].AsInt(); | ||||
DataBus.AT = configer["AT"]; | |||||
HKLib.Configer.SaasRoute = DataBus.SaasRoute; | HKLib.Configer.SaasRoute = DataBus.SaasRoute; | ||||
HKLib.Configer.MqAddress = configer["MQ"]; | HKLib.Configer.MqAddress = configer["MQ"]; | ||||
RemoteService.GetCardStuatas(); | |||||
DbContext.InitTable(); | DbContext.InitTable(); | ||||
RemoteService.PullShopInfo(); | RemoteService.PullShopInfo(); | ||||
base.Configure(); | base.Configure(); | ||||
@@ -14,9 +14,9 @@ | |||||
<AssemblyVersion>1.0.0.0</AssemblyVersion> | <AssemblyVersion>1.0.0.0</AssemblyVersion> | ||||
<Platforms>AnyCPU;x86</Platforms> | <Platforms>AnyCPU;x86</Platforms> | ||||
</PropertyGroup> | </PropertyGroup> | ||||
<PropertyGroup> | |||||
<!--<PropertyGroup> | |||||
<ApplicationManifest>App.manifest</ApplicationManifest> | <ApplicationManifest>App.manifest</ApplicationManifest> | ||||
</PropertyGroup> | |||||
</PropertyGroup>--> | |||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||||
<DefineConstants>TRACE;Core</DefineConstants> | <DefineConstants>TRACE;Core</DefineConstants> | ||||
</PropertyGroup> | </PropertyGroup> | ||||
@@ -1,4 +1,5 @@ | |||||
using HKCardOUT.Views; | using HKCardOUT.Views; | ||||
using HKLib.Dto; | |||||
using Logic.RemoteModel; | using Logic.RemoteModel; | ||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
@@ -31,10 +32,8 @@ namespace HKCardOUT.Helper | |||||
public static string StoreId { get; set; } | public static string StoreId { get; set; } | ||||
public static string COM { get; set; } | public static string COM { get; set; } | ||||
public static string SaasRoute { get; set; } | public static string SaasRoute { get; set; } | ||||
public static string AM { get; set; } | |||||
public static string PM { get; set; } | |||||
public static string AT { get; set; } | |||||
public static int Count { get; set; } | public static int Count { get; set; } | ||||
public static TimeSpilte Times { get; set; } | |||||
public static StoreInfoResponse StoreInfo { get; set; } | public static StoreInfoResponse StoreInfo { get; set; } | ||||
public static Dictionary<string, AdWindow> AdStatus { get; set; } = new Dictionary<string, AdWindow>(); | public static Dictionary<string, AdWindow> AdStatus { get; set; } = new Dictionary<string, AdWindow>(); | ||||
} | } | ||||
@@ -1,10 +1,9 @@ | |||||
using HKCardOUT.Logic; | |||||
using SqlSugar; | |||||
using SqlSugar; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
namespace Logic.Model | |||||
namespace HKCardOUT.Logic.Model | |||||
{ | { | ||||
[SugarTable("CardStutas")] | [SugarTable("CardStutas")] | ||||
public class CardStutas: BaseEntity | public class CardStutas: BaseEntity | ||||
@@ -1,4 +1,6 @@ | |||||
using HKCardOUT.Helper; | using HKCardOUT.Helper; | ||||
using HKCardOUT.Logic.Model; | |||||
using HKCardOUT.Logic.Service; | |||||
using Logic.RemoteModel; | using Logic.RemoteModel; | ||||
using Newtonsoft.Json.Linq; | using Newtonsoft.Json.Linq; | ||||
using System; | using System; | ||||
@@ -22,15 +24,29 @@ namespace HKCardOUT.Logic | |||||
/// 获取所有卡状态和卡号 | /// 获取所有卡状态和卡号 | ||||
/// </summary> | /// </summary> | ||||
/// <param name="input"></param> | /// <param name="input"></param> | ||||
public static int CheckCardStuatas() | |||||
public static int GetCardStuatas() | |||||
{ | { | ||||
var data = IHttpMultiClient.HttpMulti.AddNode(t => | var data = IHttpMultiClient.HttpMulti.AddNode(t => | ||||
{ | { | ||||
t.NodePath = ApiRoute.CheckCardStatus; | t.NodePath = ApiRoute.CheckCardStatus; | ||||
t.ReqType = MultiType.GET; | t.ReqType = MultiType.GET; | ||||
}).Build().RunStringFirst().ToModel<JObject>()["data"]["cardState"]; | }).Build().RunStringFirst().ToModel<JObject>()["data"]["cardState"]; | ||||
HKCore.AddCard(new CardStutas | |||||
{ | |||||
}); | |||||
return data != null ? data.ToString().AsInt() : 0; | return data != null ? data.ToString().AsInt() : 0; | ||||
} | } | ||||
public static void SyncTime() | |||||
{ | |||||
var data = IHttpMultiClient.HttpMulti.AddNode(t => | |||||
{ | |||||
t.NodePath = ApiRoute.CheckCardStatus; | |||||
t.ReqType = MultiType.GET; | |||||
}).Build().RunStringFirst().ToModel<JObject>()["data"]; | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 同步消费记录 | /// 同步消费记录 | ||||
/// </summary> | /// </summary> | ||||
@@ -2,7 +2,6 @@ | |||||
using HKCardOUT.Helper; | using HKCardOUT.Helper; | ||||
using HKCardOUT.Logic.Model; | using HKCardOUT.Logic.Model; | ||||
using HKControl; | using HKControl; | ||||
using Logic.Model; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
@@ -36,11 +35,15 @@ namespace HKCardOUT.Logic.Service | |||||
if (data.Stutas != 1) return false; | if (data.Stutas != 1) return false; | ||||
return true; | return true; | ||||
} | } | ||||
public static void AddCard(CardStutas input) | |||||
{ | |||||
DbContext.Context.Insertable(input).CallEntityMethod(t => t.Create()).ExecuteCommand(); | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 早上消费 | /// 早上消费 | ||||
/// </summary> | /// </summary> | ||||
/// <param name="input"></param> | /// <param name="input"></param> | ||||
/// <param name="Old"></param> | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public bool DeviceSaleAM(SaleLog input) | public bool DeviceSaleAM(SaleLog input) | ||||
{ | { | ||||
@@ -49,8 +52,10 @@ namespace HKCardOUT.Logic.Service | |||||
if(!GetCardStutas(input.CardNo)) return false; | if(!GetCardStutas(input.CardNo)) return false; | ||||
var Old = Commom(input); | var Old = Commom(input); | ||||
if (Old == null) return false; | if (Old == null) return false; | ||||
var AM = DataBus.AM.Split(",").Select(t => t.AsInt()).ToList(); | |||||
var AMDay = Old.Where(t => t.CreateTime.Hour >= AM[0] && t.CreateTime.Hour < AM[1]) | |||||
var AM = DataBus.Times.AM.Split(","); | |||||
var S = DateTime.Parse(AM[0]); | |||||
var E = DateTime.Parse(AM[1]); | |||||
var AMDay = Old.Where(t => t.CreateTime >=S && t.CreateTime < E) | |||||
.Where(t => t.CreateTime.Year == DateTime.Now.Year) | .Where(t => t.CreateTime.Year == DateTime.Now.Year) | ||||
.Where(t => t.CreateTime.Month == DateTime.Now.Month) | .Where(t => t.CreateTime.Month == DateTime.Now.Month) | ||||
.Where(t => t.CreateTime.Day == DateTime.Now.Day) | .Where(t => t.CreateTime.Day == DateTime.Now.Day) | ||||
@@ -110,8 +115,10 @@ namespace HKCardOUT.Logic.Service | |||||
if (!GetCardStutas(input.CardNo)) return false; | if (!GetCardStutas(input.CardNo)) return false; | ||||
var Old = Commom(input); | var Old = Commom(input); | ||||
if (Old == null) return false; | if (Old == null) return false; | ||||
var PM = DataBus.PM.Split(",").Select(t => t.AsInt()).ToList(); | |||||
var PMDay = Old.Where(t => t.CreateTime.Hour >= PM[0] && t.CreateTime.Hour < PM[1]). | |||||
var PM = DataBus.Times.PM.Split(","); | |||||
var S = DateTime.Parse(PM[0]); | |||||
var E = DateTime.Parse(PM[1]); | |||||
var PMDay = Old.Where(t => t.CreateTime >= S && t.CreateTime < E). | |||||
Where(t => t.CreateTime.Year == DateTime.Now.Year) | Where(t => t.CreateTime.Year == DateTime.Now.Year) | ||||
.Where(t => t.CreateTime.Month == DateTime.Now.Month) | .Where(t => t.CreateTime.Month == DateTime.Now.Month) | ||||
.Where(t => t.CreateTime.Day == DateTime.Now.Day) | .Where(t => t.CreateTime.Day == DateTime.Now.Day) | ||||
@@ -169,8 +176,10 @@ namespace HKCardOUT.Logic.Service | |||||
if (!GetCardStutas(input.CardNo)) return false; | if (!GetCardStutas(input.CardNo)) return false; | ||||
var Old = Commom(input); | var Old = Commom(input); | ||||
if (Old == null) return false; | if (Old == null) return false; | ||||
var AT = DataBus.AT.Split(",").Select(t => t.AsInt()).ToList(); | |||||
var ATDay = Old.Where(t => t.CreateTime.Hour >= AT[0] && t.CreateTime.Hour < AT[1]) | |||||
var AT = DataBus.Times.AT.Split(","); | |||||
var S = DateTime.Parse(AT[0]); | |||||
var E = DateTime.Parse(AT[1]); | |||||
var ATDay = Old.Where(t => t.CreateTime >= S && t.CreateTime <E) | |||||
.Where(t => t.CreateTime.Year == DateTime.Now.Year) | .Where(t => t.CreateTime.Year == DateTime.Now.Year) | ||||
.Where(t => t.CreateTime.Month == DateTime.Now.Month) | .Where(t => t.CreateTime.Month == DateTime.Now.Month) | ||||
.Where(t => t.CreateTime.Day == DateTime.Now.Day) | .Where(t => t.CreateTime.Day == DateTime.Now.Day) | ||||
@@ -1,7 +1,7 @@ | |||||
using HKCardOUT.Logic; | using HKCardOUT.Logic; | ||||
using HKCardOUT.Logic.Model; | |||||
using HKLib.Dto; | using HKLib.Dto; | ||||
using HKLib.RabbitMQ.Config; | using HKLib.RabbitMQ.Config; | ||||
using Logic.Model; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -199,10 +199,10 @@ namespace HKCardOUT.ViewModels | |||||
lock (locker) | lock (locker) | ||||
{ | { | ||||
var Core = Container.Get<HKCore>(); | var Core = Container.Get<HKCore>(); | ||||
var AM = DataBus.AM.Split(",").Select(t => t.AsInt()).ToList(); | |||||
var PM = DataBus.PM.Split(",").Select(t => t.AsInt()).ToList(); | |||||
var AT = DataBus.AT.Split(",").Select(t => t.AsInt()).ToList(); | |||||
if (DateTime.Now.Hour >= AM[0] && DateTime.Now.Hour < AM[1]) | |||||
var AM = DataBus.Times.AM.Split(","); | |||||
var PM = DataBus.Times.PM.Split(","); | |||||
var AT = DataBus.Times.AT.Split(","); | |||||
if (DateTime.Now >= DateTime.Parse(AM[0]) && DateTime.Now < DateTime.Parse(AM[1])) | |||||
{ | { | ||||
Core.DeviceSaleAM(new SaleLog | Core.DeviceSaleAM(new SaleLog | ||||
{ | { | ||||
@@ -211,7 +211,7 @@ namespace HKCardOUT.ViewModels | |||||
IsSync = false | IsSync = false | ||||
}); | }); | ||||
} | } | ||||
if (DateTime.Now.Hour >= PM[0] && DateTime.Now.Hour < PM[1]) | |||||
if (DateTime.Now >= DateTime.Parse(PM[0]) && DateTime.Now < DateTime.Parse(PM[1])) | |||||
{ | { | ||||
Core.DeviceSalePM(new SaleLog | Core.DeviceSalePM(new SaleLog | ||||
{ | { | ||||
@@ -220,7 +220,7 @@ namespace HKCardOUT.ViewModels | |||||
IsSync = false | IsSync = false | ||||
}); | }); | ||||
} | } | ||||
if (DateTime.Now.Hour >= AT[0] && DateTime.Now.Hour < AT[1]) | |||||
if (DateTime.Now >= DateTime.Parse(AT[0]) && DateTime.Now < DateTime.Parse(AT[1])) | |||||
{ | { | ||||
Core.DeviceSaleAT(new SaleLog | Core.DeviceSaleAT(new SaleLog | ||||
{ | { | ||||
@@ -13,12 +13,6 @@ | |||||
"ConnectionStrings": { | "ConnectionStrings": { | ||||
"Sqlite": "HKSQL.db3" | "Sqlite": "HKSQL.db3" | ||||
}, | }, | ||||
//早上 | |||||
"AM": "6,9", | |||||
//中午 | |||||
"PM": "11,14", | |||||
//下午 | |||||
"AT": "17,20", | |||||
//每个时间段的刷卡次数 | //每个时间段的刷卡次数 | ||||
"Count": 1, | "Count": 1, | ||||
//取消单卡刷卡限制 | //取消单卡刷卡限制 | ||||
@@ -14,5 +14,9 @@ namespace HKLib.Dto | |||||
/// 状态 0.禁用 1.正常 2.挂失 3.作废 | /// 状态 0.禁用 1.正常 2.挂失 3.作废 | ||||
/// </summary> | /// </summary> | ||||
public int Stutas { get; set; } | public int Stutas { get; set; } | ||||
/// <summary> | |||||
/// 手机号 名称 | |||||
/// </summary> | |||||
public string keywrod { get; set; } | |||||
} | } | ||||
} | } |
@@ -38,7 +38,7 @@ namespace HKLib.Interfaces | |||||
/// <summary> | /// <summary> | ||||
/// 修改机构 | /// 修改机构 | ||||
/// </summary> | /// </summary> | ||||
public static bool AlterOrg(string input,string Sid) | |||||
public static bool AlterOrg(string input, string Sid) | |||||
{ | { | ||||
return IHttpMultiClient.HttpMulti.AddNode(t => | return IHttpMultiClient.HttpMulti.AddNode(t => | ||||
{ | { | ||||
@@ -52,13 +52,14 @@ namespace HKLib.Interfaces | |||||
/// 根据用户命获取下拉用户列表 | /// 根据用户命获取下拉用户列表 | ||||
/// </summary> | /// </summary> | ||||
/// <param name="keyword"></param> | /// <param name="keyword"></param> | ||||
public static void GetUserList(string keyword) | |||||
public static string GetUserList(string keyword) | |||||
{ | { | ||||
IHttpMultiClient.HttpMulti.AddNode(t => | IHttpMultiClient.HttpMulti.AddNode(t => | ||||
{ | { | ||||
t.NodePath = $"{Configer.SaasRoute}/{keyword}"; | t.NodePath = $"{Configer.SaasRoute}/{keyword}"; | ||||
t.ReqType = MultiType.GET; | t.ReqType = MultiType.GET; | ||||
}).Build().RunStringFirst(); | }).Build().RunStringFirst(); | ||||
return ""; | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 添加用户 | /// 添加用户 | ||||
@@ -79,6 +80,8 @@ namespace HKLib.Interfaces | |||||
/// <param name="input"></param> | /// <param name="input"></param> | ||||
public static void CardStutasChange(CardStutasDto input) | public static void CardStutasChange(CardStutasDto input) | ||||
{ | { | ||||
input.CardNo = GetUserList(input.keywrod); | |||||
IHttpMultiClient.HttpMulti.AddNode(t => | IHttpMultiClient.HttpMulti.AddNode(t => | ||||
{ | { | ||||
t.NodePath = $"{Configer.SaasRoute}"; | t.NodePath = $"{Configer.SaasRoute}"; | ||||
@@ -92,7 +95,7 @@ namespace HKLib.Interfaces | |||||
/// </summary> | /// </summary> | ||||
/// <param name="input"></param> | /// <param name="input"></param> | ||||
/// <param name="type">1 计次就餐天消费表(每人),2每月餐段消费报表,3月餐段汇总表</param> | /// <param name="type">1 计次就餐天消费表(每人),2每月餐段消费报表,3月餐段汇总表</param> | ||||
public static void Report(ReportDto input,int type=1) | |||||
public static void Report(ReportDto input, int type = 1) | |||||
{ | { | ||||
IHttpMultiClient.HttpMulti.AddNode(t => | IHttpMultiClient.HttpMulti.AddNode(t => | ||||
{ | { | ||||
@@ -1,6 +1,5 @@ | |||||
using EasyNetQ; | using EasyNetQ; | ||||
using EasyNetQ.Topology; | using EasyNetQ.Topology; | ||||
using HKLib.DataBus.数据缓存; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Configuration; | using System.Configuration; | ||||