Kaynağa Gözat

修改

Lishi
xxe 2 yıl önce
ebeveyn
işleme
5cab8d7d23
12 değiştirilmiş dosya ile 59 ekleme ve 37 silme
  1. +2
    -3
      HKCardOUT/Bootstrapper.cs
  2. +2
    -2
      HKCardOUT/HKCardOUT.csproj
  3. +2
    -3
      HKCardOUT/Helper/DataBus.cs
  4. +2
    -3
      HKCardOUT/Logic/Model/CardStutas.cs
  5. +17
    -1
      HKCardOUT/Logic/RemoteService.cs
  6. +17
    -8
      HKCardOUT/Logic/Service/HKCore.cs
  7. +1
    -1
      HKCardOUT/MqHandle.cs
  8. +6
    -6
      HKCardOUT/ViewModels/RootViewModel.cs
  9. +0
    -6
      HKCardOUT/options.json
  10. +4
    -0
      HKLib/Dto/CardStutasDto.cs
  11. +6
    -3
      HKLib/Interfaces/HKLibHelper.cs
  12. +0
    -1
      HKLib/RabbitMq/Config/MQFactory.cs

+ 2
- 3
HKCardOUT/Bootstrapper.cs Dosyayı Görüntüle

@@ -65,12 +65,11 @@ namespace HKCardOUT
DataBus.COM = configer["COM"];
DataBus.StartDevice = configer["StartDevice"].AsBool();
DataBus.Cancel = configer["Cancel"].AsBool();
DataBus.AM = configer["AM"];
DataBus.PM = configer["PM"];
DataBus.Count = configer["Count"].AsInt();
DataBus.AT = configer["AT"];
HKLib.Configer.SaasRoute = DataBus.SaasRoute;
HKLib.Configer.MqAddress = configer["MQ"];

RemoteService.GetCardStuatas();
DbContext.InitTable();
RemoteService.PullShopInfo();
base.Configure();


+ 2
- 2
HKCardOUT/HKCardOUT.csproj Dosyayı Görüntüle

@@ -14,9 +14,9 @@
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Platforms>AnyCPU;x86</Platforms>
</PropertyGroup>
<PropertyGroup>
<!--<PropertyGroup>
<ApplicationManifest>App.manifest</ApplicationManifest>
</PropertyGroup>
</PropertyGroup>-->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;Core</DefineConstants>
</PropertyGroup>


+ 2
- 3
HKCardOUT/Helper/DataBus.cs Dosyayı Görüntüle

@@ -1,4 +1,5 @@
using HKCardOUT.Views;
using HKLib.Dto;
using Logic.RemoteModel;
using System;
using System.Collections.Generic;
@@ -31,10 +32,8 @@ namespace HKCardOUT.Helper
public static string StoreId { get; set; }
public static string COM { 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 TimeSpilte Times { get; set; }
public static StoreInfoResponse StoreInfo { get; set; }
public static Dictionary<string, AdWindow> AdStatus { get; set; } = new Dictionary<string, AdWindow>();
}


+ 2
- 3
HKCardOUT/Logic/Model/CardStutas.cs Dosyayı Görüntüle

@@ -1,10 +1,9 @@
using HKCardOUT.Logic;
using SqlSugar;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;

namespace Logic.Model
namespace HKCardOUT.Logic.Model
{
[SugarTable("CardStutas")]
public class CardStutas: BaseEntity


+ 17
- 1
HKCardOUT/Logic/RemoteService.cs Dosyayı Görüntüle

@@ -1,4 +1,6 @@
using HKCardOUT.Helper;
using HKCardOUT.Logic.Model;
using HKCardOUT.Logic.Service;
using Logic.RemoteModel;
using Newtonsoft.Json.Linq;
using System;
@@ -22,15 +24,29 @@ namespace HKCardOUT.Logic
/// 获取所有卡状态和卡号
/// </summary>
/// <param name="input"></param>
public static int CheckCardStuatas()
public static int GetCardStuatas()
{
var data = IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = ApiRoute.CheckCardStatus;
t.ReqType = MultiType.GET;
}).Build().RunStringFirst().ToModel<JObject>()["data"]["cardState"];
HKCore.AddCard(new CardStutas
{
});
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>


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

@@ -2,7 +2,6 @@
using HKCardOUT.Helper;
using HKCardOUT.Logic.Model;
using HKControl;
using Logic.Model;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -36,11 +35,15 @@ namespace HKCardOUT.Logic.Service
if (data.Stutas != 1) return false;
return true;
}
public static void AddCard(CardStutas input)
{
DbContext.Context.Insertable(input).CallEntityMethod(t => t.Create()).ExecuteCommand();
}

/// <summary>
/// 早上消费
/// </summary>
/// <param name="input"></param>
/// <param name="Old"></param>
/// <returns></returns>
public bool DeviceSaleAM(SaleLog input)
{
@@ -49,8 +52,10 @@ namespace HKCardOUT.Logic.Service
if(!GetCardStutas(input.CardNo)) return false;
var Old = Commom(input);
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.Month == DateTime.Now.Month)
.Where(t => t.CreateTime.Day == DateTime.Now.Day)
@@ -110,8 +115,10 @@ namespace HKCardOUT.Logic.Service
if (!GetCardStutas(input.CardNo)) return false;
var Old = Commom(input);
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.Month == DateTime.Now.Month)
.Where(t => t.CreateTime.Day == DateTime.Now.Day)
@@ -169,8 +176,10 @@ namespace HKCardOUT.Logic.Service
if (!GetCardStutas(input.CardNo)) return false;
var Old = Commom(input);
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.Month == DateTime.Now.Month)
.Where(t => t.CreateTime.Day == DateTime.Now.Day)


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

@@ -1,7 +1,7 @@
using HKCardOUT.Logic;
using HKCardOUT.Logic.Model;
using HKLib.Dto;
using HKLib.RabbitMQ.Config;
using Logic.Model;
using System;
using System.Collections.Generic;
using System.Text;


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

@@ -199,10 +199,10 @@ namespace HKCardOUT.ViewModels
lock (locker)
{
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
{
@@ -211,7 +211,7 @@ namespace HKCardOUT.ViewModels
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
{
@@ -220,7 +220,7 @@ namespace HKCardOUT.ViewModels
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
{


+ 0
- 6
HKCardOUT/options.json Dosyayı Görüntüle

@@ -13,12 +13,6 @@
"ConnectionStrings": {
"Sqlite": "HKSQL.db3"
},
//早上
"AM": "6,9",
//中午
"PM": "11,14",
//下午
"AT": "17,20",
//每个时间段的刷卡次数
"Count": 1,
//取消单卡刷卡限制


+ 4
- 0
HKLib/Dto/CardStutasDto.cs Dosyayı Görüntüle

@@ -14,5 +14,9 @@ namespace HKLib.Dto
/// 状态 0.禁用 1.正常 2.挂失 3.作废
/// </summary>
public int Stutas { get; set; }
/// <summary>
/// 手机号 名称
/// </summary>
public string keywrod { get; set; }
}
}

+ 6
- 3
HKLib/Interfaces/HKLibHelper.cs Dosyayı Görüntüle

@@ -38,7 +38,7 @@ namespace HKLib.Interfaces
/// <summary>
/// 修改机构
/// </summary>
public static bool AlterOrg(string input,string Sid)
public static bool AlterOrg(string input, string Sid)
{
return IHttpMultiClient.HttpMulti.AddNode(t =>
{
@@ -52,13 +52,14 @@ namespace HKLib.Interfaces
/// 根据用户命获取下拉用户列表
/// </summary>
/// <param name="keyword"></param>
public static void GetUserList(string keyword)
public static string GetUserList(string keyword)
{
IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = $"{Configer.SaasRoute}/{keyword}";
t.ReqType = MultiType.GET;
}).Build().RunStringFirst();
return "";
}
/// <summary>
/// 添加用户
@@ -79,6 +80,8 @@ namespace HKLib.Interfaces
/// <param name="input"></param>
public static void CardStutasChange(CardStutasDto input)
{
input.CardNo = GetUserList(input.keywrod);

IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = $"{Configer.SaasRoute}";
@@ -92,7 +95,7 @@ namespace HKLib.Interfaces
/// </summary>
/// <param name="input"></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 =>
{


+ 0
- 1
HKLib/RabbitMq/Config/MQFactory.cs Dosyayı Görüntüle

@@ -1,6 +1,5 @@
using EasyNetQ;
using EasyNetQ.Topology;
using HKLib.DataBus.数据缓存;
using System;
using System.Collections.Generic;
using System.Configuration;


Yükleniyor…
İptal
Kaydet