pry 2 anos atrás
pai
commit
568022aa8b
4 arquivos alterados com 58 adições e 10 exclusões
  1. +1
    -0
      HKCardOUT/Helper/DataBus.cs
  2. +5
    -2
      HKCardOUT/Logic/RemoteService.cs
  3. +33
    -0
      HKLib/Dto/TimeSpilte.cs
  4. +19
    -8
      HKLib/Interfaces/HKLibHelper.cs

+ 1
- 0
HKCardOUT/Helper/DataBus.cs Ver arquivo

@@ -40,6 +40,7 @@ namespace HKCardOUT.Helper
}
public class ApiRoute
{
public static string GetTime = "http://192.168.1.22:5000/api/one-card/eat-time-interval";
/// <summary>
/// 获取所有卡
/// </summary>


+ 5
- 2
HKCardOUT/Logic/RemoteService.cs Ver arquivo

@@ -43,11 +43,14 @@ namespace HKCardOUT.Logic
/// </summary>
public static void SyncTime()
{
/*
{"statusCode":200,"data":{"isSuccess":true,"msg":null,"data":{"amStartTime":"17:50","amEndTime":"17:50","pmStartTime":"17:50","pmEndTime":"17:50","atStartTime":"17:50","atEndTime":"17:50"}},"succeeded":true,"errors":null,"extras":null,"timestamp":1665654784093}
*/
var data = IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = ApiRoute.CheckCardStatus;
t.NodePath = ApiRoute.GetTime;
t.ReqType = MultiType.GET;
}).Build().RunStringFirst().ToModel<JObject>()["data"]["data"];
}).Build().RunStringFirst();

}



+ 33
- 0
HKLib/Dto/TimeSpilte.cs Ver arquivo

@@ -38,6 +38,39 @@ namespace HKLib.Dto
public DateTime ATEndTime { get; set; }

}
public class TimeSpilteDto
{

/// <summary>
/// 早上开始时间
/// </summary>
public string AMStartTime { get; set; }

/// <summary>
/// 早上结束时间
/// </summary>
public string AMEndTime { get; set; }

/// <summary>
/// 中午开始时间
/// </summary>
public string PMStartTime { get; set; }

/// <summary>
/// 中午结束时间
/// </summary>
public string PMEndTime { get; set; }

/// <summary>
/// 晚上开始时间
/// </summary>
public string ATStartTime { get; set; }

/// <summary>
/// 晚上结束时间
/// </summary>
public string ATEndTime { get; set; }

}

}

+ 19
- 8
HKLib/Interfaces/HKLibHelper.cs Ver arquivo

@@ -20,14 +20,25 @@ namespace HKLib.Interfaces
/// </summary>
public static bool SetTime(TimeSpilte input)
{
return IHttpMultiClient.HttpMulti
TimeSpilteDto dto = new TimeSpilteDto
{
AMEndTime = input.AMEndTime.ToShortTimeString(),
AMStartTime = input.AMStartTime.ToShortTimeString(),
PMEndTime = input.PMEndTime.ToShortTimeString(),
PMStartTime = input.PMStartTime.ToShortTimeString(),
ATEndTime = input.ATEndTime.ToShortTimeString(),
ATStartTime = input.ATStartTime.ToShortTimeString(),
};

var data = IHttpMultiClient.HttpMulti
.AddHeader(t => t.Headers = Header)
.AddNode(t =>
{
t.NodePath = $"{Configer.SaasRoute}";
t.JsonParam = input.ToJson();
t.ReqType = MultiType.POST;
}).Build().RunStringFirst().ToModel<JObject>()["isSuccess"].ToString().AsBool();
t.NodePath = $"{Configer.SaasRoute}api/one-card/eat-time-interval";
t.JsonParam = dto.ToJson();
t.ReqType = MultiType.PUT;
}).Build().RunStringFirst();
return data.ToModel<JObject>()["data"]["isSuccess"].ToString().AsBool();
}

/// <summary>
@@ -165,9 +176,9 @@ namespace HKLib.Interfaces
{
t.NodePath = Route;
t.ReqType = MultiType.POST;
t.JsonParam = input.ToJson();
}).Build().RunStringFirst().ToModel<JObject>()["data"]["data"].ToJson().ToModel<List<ReportCountDto>>();
return data;
t.JsonParam = (new { StartTime =input.StartTime.ToShortDateString(), EndTime=input.EndTime.ToShortDateString() }).ToJson();
}).Build().RunStringFirst();
return data.ToModel<JObject>()["data"]["data"].ToJson().ToModel<List<ReportCountDto>>();
}
}
}

Carregando…
Cancelar
Salvar