diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
index d1ef8e3fb..028ad78ac 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
@@ -1,4 +1,8 @@
-
+//----------------------
+//
+// Generated using the NSwag toolchain v14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
+//
+//----------------------
#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
@@ -25,7 +29,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
#pragma warning restore 8618
private System.Net.Http.HttpClient _httpClient;
- private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true);
+ private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true);
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public Client(string baseUrl, System.Net.Http.HttpClient httpClient)
@@ -35,9 +39,9 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
_httpClient = httpClient;
}
- private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings()
+ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings()
{
- var settings = new System.Text.Json.JsonSerializerOptions();
+ var settings = new Newtonsoft.Json.JsonSerializerSettings();
UpdateJsonSerializerSettings(settings);
return settings;
}
@@ -53,9 +57,9 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
}
}
- protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } }
+ protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } }
- static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings);
+ static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
@@ -208,15 +212,15 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
/// Success
/// A server side error occurred.
- public virtual System.Threading.Tasks.Task> GetCargoStaticAsync(int? areaID)
+ public virtual System.Threading.Tasks.Task> GetCargoStaticAsync(string p_AreaID)
{
- return GetCargoStaticAsync(areaID, System.Threading.CancellationToken.None);
+ return GetCargoStaticAsync(p_AreaID, System.Threading.CancellationToken.None);
}
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// Success
/// A server side error occurred.
- public virtual async System.Threading.Tasks.Task> GetCargoStaticAsync(int? areaID, System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task> GetCargoStaticAsync(string p_AreaID, System.Threading.CancellationToken cancellationToken)
{
var client_ = _httpClient;
var disposeClient_ = false;
@@ -233,9 +237,9 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
// Operation Path: "CargoState/GetCargoStatic"
urlBuilder_.Append("CargoState/GetCargoStatic");
urlBuilder_.Append('?');
- if (areaID != null)
+ if (p_AreaID != null)
{
- urlBuilder_.Append(System.Uri.EscapeDataString("AreaID")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(areaID, System.Globalization.CultureInfo.InvariantCulture))).Append('&');
+ urlBuilder_.Append(System.Uri.EscapeDataString("p_AreaID")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(p_AreaID, System.Globalization.CultureInfo.InvariantCulture))).Append('&');
}
urlBuilder_.Length--;
@@ -378,10 +382,10 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings);
+ var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings);
return new ObjectResponseResult(typedBody, responseText);
}
- catch (System.Text.Json.JsonException exception)
+ catch (Newtonsoft.Json.JsonException exception)
{
var message = "Could not deserialize the response body string as " + typeof(T).FullName + ".";
throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception);
@@ -392,12 +396,15 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
try
{
using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false))
+ using (var streamReader = new System.IO.StreamReader(responseStream))
+ using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader))
{
- var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false);
+ var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings);
+ var typedBody = serializer.Deserialize(jsonTextReader);
return new ObjectResponseResult(typedBody, string.Empty);
}
}
- catch (System.Text.Json.JsonException exception)
+ catch (Newtonsoft.Json.JsonException exception)
{
var message = "Could not deserialize the response body stream as " + typeof(T).FullName + ".";
throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception);
@@ -463,20 +470,19 @@ 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 RemoteServiceErrorInfo
{
-
- [System.Text.Json.Serialization.JsonPropertyName("code")]
+ [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Code { get; set; }
- [System.Text.Json.Serialization.JsonPropertyName("message")]
+ [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Message { get; set; }
- [System.Text.Json.Serialization.JsonPropertyName("details")]
+ [Newtonsoft.Json.JsonProperty("details", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Details { get; set; }
- [System.Text.Json.Serialization.JsonPropertyName("data")]
+ [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.IDictionary Data { get; set; }
- [System.Text.Json.Serialization.JsonPropertyName("validationErrors")]
+ [Newtonsoft.Json.JsonProperty("validationErrors", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection ValidationErrors { get; set; }
}
@@ -484,8 +490,7 @@ 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 RemoteServiceErrorResponse
{
-
- [System.Text.Json.Serialization.JsonPropertyName("error")]
+ [Newtonsoft.Json.JsonProperty("error", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public RemoteServiceErrorInfo Error { get; set; }
}
@@ -493,11 +498,10 @@ 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 RemoteServiceValidationErrorInfo
{
-
- [System.Text.Json.Serialization.JsonPropertyName("message")]
+ [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Message { get; set; }
- [System.Text.Json.Serialization.JsonPropertyName("members")]
+ [Newtonsoft.Json.JsonProperty("members", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection Members { get; set; }
}
@@ -508,29 +512,25 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
///
/// 区域ID
///
-
- [System.Text.Json.Serialization.JsonPropertyName("areaID")]
- public int AreaID { get; set; }
+ [Newtonsoft.Json.JsonProperty("areaID", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
+ public string AreaID { get; set; }
///
/// 货位号
///
-
- [System.Text.Json.Serialization.JsonPropertyName("cargoID")]
+ [Newtonsoft.Json.JsonProperty("cargoID", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string CargoID { get; set; }
///
/// 零件号
///
-
- [System.Text.Json.Serialization.JsonPropertyName("partCode")]
+ [Newtonsoft.Json.JsonProperty("partCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string PartCode { get; set; }
///
/// 货位状态
///
-
- [System.Text.Json.Serialization.JsonPropertyName("flag")]
+ [Newtonsoft.Json.JsonProperty("flag", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int Flag { get; set; }
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs
index c4f76570c..a29d697f6 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs
@@ -88,7 +88,7 @@ public class InjectionMoldingRequestReader : IReader
List camralist = new List();
foreach (var itm in ids)//遍历区域查找所有货物
{
- var idsList= await client.GetCargoStaticAsync(int.Parse(itm)).ConfigureAwait(false);
+ var idsList= await client.GetCargoStaticAsync(itm).ConfigureAwait(false);
camralist.AddRange(idsList);
}
camralist = camralist.Where(p=>p.Flag==0).ToList();
@@ -195,10 +195,6 @@ public class InjectionMoldingRequestReader : IReader
if (itm == null) { errors.Add($"编号:{request.ItemCode}零件表中没找到!"); }
else
{
-
-
-
-
// 更新请求中的零件描述和名称
request.ItemDesc1 = itm.Desc1;
request.ItemDesc2 = itm.Desc2;
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/Class1.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/Class1.cs
index 70f06517a..e2d9b7254 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/Class1.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/Class1.cs
@@ -24,7 +24,7 @@ public class ResponCargoItem
{
// 区域ID
[Display(Name = "区域ID")]
- public int AreaID { set; get; } = 0;
+ public string AreaID { set; get; }
// 货位号
[Display(Name = "货位号")]
public string CargoID { set; get; } = "";
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Caches/CacheAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Caches/CacheAppService.cs
index 58707cc4b..2455909e8 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Caches/CacheAppService.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Caches/CacheAppService.cs
@@ -80,11 +80,21 @@ public class CacheService:ISingletonDependency
};
}).ConfigureAwait(false);
}
+
+
+
+
+
+
+
+
+
///
/// 异步开始生命周期操作不能堵塞
///
public async Task StartAsync()
{
+
BomsCycle();//异步处理不能堵塞主任务
}
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs
index 128d2a552..264c88719 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Threading.Tasks;
using DocumentFormat.OpenXml.Office2010.Drawing;
using Microsoft.AspNetCore.Authorization;
@@ -50,16 +51,16 @@ public class TestService:ApplicationService
///
/// 异步开始生命周期操作不能堵塞
///
- public async Task> GetCargoStatic(int AreaID)
+ public async Task> GetCargoStatic(string p_AreaID)
{
List result = new List();
- result.Add(new ResponCargoItem() { AreaID = 1, CargoID = "PTXB1", PartCode = "TMDLYA0A071AB", Flag = 0 });
- result.Add(new ResponCargoItem() { AreaID = 1, CargoID = "PTXB2", PartCode = "TMDLYA0A061AB", Flag = 0 });
- result.Add(new ResponCargoItem() { AreaID = 2, CargoID = "ZSXB2", PartCode = "TMDLYD0ABM5A", Flag = 0 });
-
+ result.Add(new ResponCargoItem() { AreaID = "1", CargoID = "PTXB1", PartCode = "TMDLYA0A071AB", Flag = 0 });
+ result.Add(new ResponCargoItem() { AreaID = "1", CargoID = "PTXB2", PartCode = "TMDLYA0A061AB", Flag = 0 });
+ result.Add(new ResponCargoItem() { AreaID = "2", CargoID = "ZSXB2", PartCode = "TMDLYD0ABM5A", Flag = 0 });
+ result = result.Where(p => p.AreaID == p_AreaID).ToList();
return result;