Browse Source

摄像头采集接口POST改成GET请求

dev_DY_CC
赵新宇 11 months ago
parent
commit
59cb8985ec
  1. 29
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
  2. 6
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs
  3. 24
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs
  4. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs

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

@ -1,3 +1,5 @@
//---------------------- //----------------------
// <auto-generated> // <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) // Generated using the NSwag toolchain v14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
@ -212,15 +214,15 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
/// <returns>Success</returns> /// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception> /// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ResponCargoItem>> GetCargoStaticAsync(string p_AreaID) public virtual System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ResponCargoItem>> GetCargoStaticAsync(string areaID)
{ {
return GetCargoStaticAsync(p_AreaID, System.Threading.CancellationToken.None); return GetCargoStaticAsync(areaID, System.Threading.CancellationToken.None);
} }
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns> /// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception> /// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ResponCargoItem>> GetCargoStaticAsync(string p_AreaID, System.Threading.CancellationToken cancellationToken) public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ResponCargoItem>> GetCargoStaticAsync(string areaID, System.Threading.CancellationToken cancellationToken)
{ {
var client_ = _httpClient; var client_ = _httpClient;
var disposeClient_ = false; var disposeClient_ = false;
@ -228,8 +230,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
{ {
using (var request_ = new System.Net.Http.HttpRequestMessage()) using (var request_ = new System.Net.Http.HttpRequestMessage())
{ {
request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain"); request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
var urlBuilder_ = new System.Text.StringBuilder(); var urlBuilder_ = new System.Text.StringBuilder();
@ -237,9 +238,9 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
// Operation Path: "CargoState/GetCargoStatic" // Operation Path: "CargoState/GetCargoStatic"
urlBuilder_.Append("CargoState/GetCargoStatic"); urlBuilder_.Append("CargoState/GetCargoStatic");
urlBuilder_.Append('?'); urlBuilder_.Append('?');
if (p_AreaID != null) if (areaID != null)
{ {
urlBuilder_.Append(System.Uri.EscapeDataString("p_AreaID")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(p_AreaID, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); urlBuilder_.Append(System.Uri.EscapeDataString("AreaID")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(areaID, System.Globalization.CultureInfo.InvariantCulture))).Append('&');
} }
urlBuilder_.Length--; urlBuilder_.Length--;
@ -535,16 +536,8 @@ 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 ResponCargoItem1 public partial class ResponCargoItem1
{ {
/// <summary>
/// 读取次数
/// </summary>
[Newtonsoft.Json.JsonProperty("number", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Number { get; set; }
/// <summary> /// <summary>
/// 区域ID /// 区域ID
/// </summary> /// </summary>
@ -569,8 +562,12 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
[Newtonsoft.Json.JsonProperty("flag", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [Newtonsoft.Json.JsonProperty("flag", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int Flag { get; set; } public int Flag { get; set; }
}
[Newtonsoft.Json.JsonProperty("number", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Number { get; set; }
}

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

@ -50,7 +50,6 @@ public class InjectionMoldingRequestReader : IReader
) )
{ {
_injectionRequest = injectionRequest; _injectionRequest = injectionRequest;
_logger = logger; _logger = logger;
_options = options; _options = options;
_httpClientFactory = httpClientFactory; _httpClientFactory = httpClientFactory;
@ -102,8 +101,7 @@ public class InjectionMoldingRequestReader : IReader
{ {
var idsList = await client.GetCargoStaticAsync(itm).ConfigureAwait(false); var idsList = await client.GetCargoStaticAsync(itm).ConfigureAwait(false);
Thread.Sleep(500);//设备读取50ms延时,设置延时时间为1000ms保证读取更新到信息
Thread.Sleep(1000);//设备读取50ms延时,设置延时时间为1000ms保证读取更新到信息
//flag 1-有货 0-空闲 //flag 1-有货 0-空闲
foreach (var respon in idsList.Where(r => r.Flag == 0)) foreach (var respon in idsList.Where(r => r.Flag == 0))
{ {
@ -167,6 +165,8 @@ public class InjectionMoldingRequestReader : IReader
_logger.LogInformation(MakeGrid($"{guid}同步WMS内容", injectionList)); _logger.LogInformation(MakeGrid($"{guid}同步WMS内容", injectionList));
//_logger.LogInformation($"标识{guid}同步WMS开始");
foreach (var inject in injectionList) foreach (var inject in injectionList)

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

@ -47,11 +47,11 @@ public class TestService:ApplicationService
[HttpPost("GetCargoStatic")] [HttpGet("GetCargoStatic")]
/// <summary> /// <summary>
/// 异步开始生命周期操作不能堵塞 /// 异步开始生命周期操作不能堵塞
/// </summary> /// </summary>
public async Task<List<ResponCargoItem>> GetCargoStatic(string p_AreaID) public async Task<List<ResponCargoItem>> GetCargoStatic(string AreaID)
{ {
List<ResponCargoItem> result = new List<ResponCargoItem>(); List<ResponCargoItem> result = new List<ResponCargoItem>();
@ -60,28 +60,28 @@ public class TestService:ApplicationService
result.Add(new ResponCargoItem() { AreaID = "1", CargoID = "PTXB2", PartCode = "TMDLYA0A061AB", 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 = "2", CargoID = "ZSXB2", PartCode = "TMDLYD0ABM5A", Flag = 0 });
result = result.Where(p => p.AreaID == p_AreaID).ToList(); result = result.Where(p => p.AreaID == AreaID).ToList();
return result; return result;
} }
[HttpPost("SyncIssueJobStereo")] //[HttpPost("SyncIssueJobStereo")]
public virtual async Task<ReusltObject> SyncIssueJobStereoAsync(IssueJobToRestoDTO input) //public virtual async Task<ReusltObject> SyncIssueJobStereoAsync(IssueJobToRestoDTO input)
{ //{
ReusltObject reuslt=new ReusltObject(); // ReusltObject reuslt=new ReusltObject();
reuslt.Code = "1"; // reuslt.Code = "1";
reuslt.Message = "操作成功"; // reuslt.Message = "操作成功";
reuslt.OperateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); // reuslt.OperateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
return reuslt; // return reuslt;
} //}

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs

@ -591,7 +591,6 @@ public class AssembleIssueJobAppService
{ {
var jobDetailInputdetail = assembleIssueJobDto.Details.FirstOrDefault(); var jobDetailInputdetail = assembleIssueJobDto.Details.FirstOrDefault();
var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode) var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode)
.ConfigureAwait(false); .ConfigureAwait(false);

Loading…
Cancel
Save