Browse Source

更新

dev_DY_CC
赵新宇 10 months ago
parent
commit
ecc5292653
  1. BIN
      .vs/WZC2/v17/.wsuo
  2. 54
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
  3. 12
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs
  4. 36
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs
  5. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/appsettings.json
  6. 20
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/Class1.cs
  7. 18
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs

BIN
.vs/WZC2/v17/.wsuo

Binary file not shown.

54
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs

@ -1,5 +1,3 @@
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
@ -72,7 +70,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
/// </summary>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<int> GetMacStaticAsync()
public virtual System.Threading.Tasks.Task<ResultJson> GetMacStaticAsync()
{
return GetMacStaticAsync(System.Threading.CancellationToken.None);
}
@ -83,7 +81,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
/// </summary>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<int> GetMacStaticAsync(System.Threading.CancellationToken cancellationToken)
public virtual async System.Threading.Tasks.Task<ResultJson> GetMacStaticAsync(System.Threading.CancellationToken cancellationToken)
{
var client_ = _httpClient;
var disposeClient_ = false;
@ -125,7 +123,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<int>(response_, headers_, cancellationToken).ConfigureAwait(false);
var objectResponse_ = await ReadObjectResponseAsync<ResultJson>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@ -214,7 +212,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ResponCargoItem>> GetCargoStaticAsync(string areaID)
public virtual System.Threading.Tasks.Task<ResponCargos> GetCargoStaticAsync(string areaID)
{
return GetCargoStaticAsync(areaID, System.Threading.CancellationToken.None);
}
@ -222,7 +220,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ResponCargoItem>> GetCargoStaticAsync(string areaID, System.Threading.CancellationToken cancellationToken)
public virtual async System.Threading.Tasks.Task<ResponCargos> GetCargoStaticAsync(string areaID, System.Threading.CancellationToken cancellationToken)
{
var client_ = _httpClient;
var disposeClient_ = false;
@ -269,7 +267,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<ResponCargoItem>>(response_, headers_, cancellationToken).ConfigureAwait(false);
var objectResponse_ = await ReadObjectResponseAsync<ResponCargos>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
@ -536,6 +534,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
}
public partial class ResponCargoItem1
{
/// <summary>
@ -572,6 +571,45 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class ResponCargos
{
[Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int Code { get; set; }
[Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Value { get; set; }
[Newtonsoft.Json.JsonProperty("msg", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Msg { get; set; }
[Newtonsoft.Json.JsonProperty("datalist", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<ResponCargoItem> Datalist { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class ResultJson
{
[Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int Code { get; set; }
[Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int Value { get; set; }
[Newtonsoft.Json.JsonProperty("result", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Result { get; set; }
[Newtonsoft.Json.JsonProperty("msg", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Msg { get; set; }
[Newtonsoft.Json.JsonProperty("valuestr", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Valuestr { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class ApiException : System.Exception
{

12
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs

@ -76,7 +76,7 @@ public class InjectionMoldingRequestReader : IReader
Stopwatch sw = Stopwatch.StartNew();
Client client = new Client(_options.Value.AutoRemote.IpAddress, _httpClientFactory.CreateClient());//调用客户记录
var flag = await client.GetMacStaticAsync().ConfigureAwait(false);
if (flag != 1)
if (flag.Code != 200)
{
// 记录错误日志并返回空列表
_logger.LogInformation($"读取到摄像头信息为不可用{DateTime.Now},请检查摄像头");
@ -94,7 +94,15 @@ public class InjectionMoldingRequestReader : IReader
{
foreach (var itm in ids)//遍历区域查找所有货物
{
var idsList = await client.GetCargoStaticAsync(itm).ConfigureAwait(false);
var obj= await client.GetCargoStaticAsync(itm).ConfigureAwait(false);
var idsList = obj.Datalist;
if (idsList == null)
{
_logger.LogInformation($"没有设置指定区域无数据");
return new List<IncomingFromExternal>();
}

36
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs

@ -40,24 +40,24 @@ public class InjectionMoldingTaskIncomingBackgroundWorker : AsyncPeriodicBackgro
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
Logger.LogInformation($"开始: 执行 {Incoming}");
var configManager = workerContext.ServiceProvider.GetRequiredService<IInterfaceConfigManager>();
var confitem = await configManager.GetInterfaceConfig("SJ-IN").ConfigureAwait(false);
if (confitem == null)
{
if (!_options.Value.IncomingOptions.Active)
{
Logger.LogInformation($"{Incoming} 已关闭没有执行!");
return;
}
}
else
{
if (!confitem.Active)
{
Logger.LogInformation($"{Incoming} 已关闭没有执行!");
return;
}
}
//var configManager = workerContext.ServiceProvider.GetRequiredService<IInterfaceConfigManager>();
//var confitem = await configManager.GetInterfaceConfig("SJ-IN").ConfigureAwait(false);
//if (confitem == null)
//{
// if (!_options.Value.IncomingOptions.Active)
// {
// Logger.LogInformation($"{Incoming} 已关闭没有执行!");
// return;
// }
//}
//else
//{
// if (!confitem.Active)
// {
// Logger.LogInformation($"{Incoming} 已关闭没有执行!");
// return;
// }
//}
Logger.LogInformation($"注塑任务");//缴库
var reader = workerContext.ServiceProvider.GetService<InjectionMoldingRequestReader>();

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/appsettings.json

@ -67,7 +67,7 @@
"InjectionMoldingTaskOptions": {
"AutoRemote": {
"IpAddress": "http://10.164.227.103:30000/",
"IpAddress": " http://localhost:59094/",
"UserName": "",
"Password": "",
"Token": "",

20
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/Class1.cs

@ -35,3 +35,23 @@ public class ResponCargoItem
[Display(Name = "货位状态")]
public int Flag { set; get; } = 0;
}
public class ResponCargos : ResponseJson
{
//货位状态列表
public List<ResponCargoItem> Datalist { set; get; }
}
public class ResultJson
{
// 错误码:
public int Code { set; get; } = 0;
// 返回值 其具体含义由调用接口确定
public int Value { set; get; } = 0;
// 错误消息
public string Result { set; get; } = "";
public string Msg { set; get; } = "";
public string Valuestr { set; get; }
}

18
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs

@ -40,9 +40,12 @@ public class TestService:ApplicationService
/// 生命周期操作
/// </summary>
[HttpPost("GetMacStatic")]
public async Task<int> GetMacStatic()
public async Task<ResultJson> GetMacStatic()
{
return 1;
return new ResultJson() { Code = 200, Msg = "SUCESS", Value = 1 , Valuestr = "", Result = ""};
}
@ -51,7 +54,7 @@ public class TestService:ApplicationService
/// <summary>
/// 异步开始生命周期操作不能堵塞
/// </summary>
public async Task<List<ResponCargoItem>> GetCargoStatic(string AreaID)
public async Task<ResponCargos> GetCargoStatic(string AreaID)
{
List<ResponCargoItem> result = new List<ResponCargoItem>();
@ -63,7 +66,14 @@ public class TestService:ApplicationService
result = result.Where(p => p.AreaID == AreaID).ToList();
return result;
var t = new ResponCargos();
t.Code = 200;
t.Msg = "Success";
t.Datalist = result;
return t;
}
//[HttpPost("SyncIssueJobStereo")]

Loading…
Cancel
Save