Browse Source

接口修改

master
lvzb 5 months ago
parent
commit
0ed63549d2
  1. 25
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Agent/AsnBackgroundWorker/AsnBackgroundWorker.cs
  2. 6
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/NoPoASN/AsnMstr.cs

25
WebApiService/src/Win_in.Sfs.Scp.WebApi.Agent/AsnBackgroundWorker/AsnBackgroundWorker.cs

@ -115,12 +115,10 @@ namespace Win_in.Sfs.Scp.WebApi
var jsonString = noPoAsn.JsonString; var jsonString = noPoAsn.JsonString;
try try
{ {
var a = 0;
var ss = 8 / a;
var result = await _postService.PostAsync(baseUrl, apiUrl, jsonString, username, password); var result = await _postService.PostAsync(baseUrl, apiUrl, jsonString, username, password);
if (result == null) if (result == null)
{ {
noPoAsn.SetError("Boomi", EnumExchangeDataErrorCode.None, "Boomi没有返回值"); noPoAsn.SetError("Boomi", EnumExchangeDataErrorCode.None, "Boomi没有返回值","Boomi接口执行失败");
} }
if (result?.Status == "SUCCESS") if (result?.Status == "SUCCESS")
{ {
@ -128,18 +126,18 @@ namespace Win_in.Sfs.Scp.WebApi
} }
else if (result?.Status == "EXCEPTION") else if (result?.Status == "EXCEPTION")
{ {
noPoAsn.SetError("Boomi", EnumExchangeDataErrorCode.Exception, "EXCEPTION" + result?.ErrorMessage); noPoAsn.SetError("Boomi", EnumExchangeDataErrorCode.Exception, "EXCEPTION" + result?.ErrorMessage, "Boomi接口执行失败");
} }
else if (result?.Status == "FAIL") else if (result?.Status == "FAIL")
{ {
noPoAsn.SetError("Boomi", EnumExchangeDataErrorCode.FAIL, "FAIL" + result?.ErrorMessage); noPoAsn.SetError("Boomi", EnumExchangeDataErrorCode.FAIL, "FAIL" + result?.ErrorMessage, "Boomi接口执行失败");
} }
} }
catch (Exception e) catch (Exception e)
{ {
Logger.LogException(e); Logger.LogException(e);
e = e.GetBaseException(); e = e.GetBaseException();
noPoAsn.SetError("Boomi", EnumExchangeDataErrorCode.Exception, "接口程序异常"+e.Message); noPoAsn.SetError("Boomi", EnumExchangeDataErrorCode.Exception, "接口程序异常"+e.Message, "Boomi接口执行失败");
} }
finally finally
{ {
@ -187,7 +185,6 @@ namespace Win_in.Sfs.Scp.WebApi
vendorCode = asn.VendId, vendorCode = asn.VendId,
contacts = asn.ReceiveUser, contacts = asn.ReceiveUser,
phone = "", phone = "",
status = null,
truckNbr = asn.PlateNumber, truckNbr = asn.PlateNumber,
whse = "", whse = "",
dock = asn.Dock, dock = asn.Dock,
@ -195,10 +192,11 @@ namespace Win_in.Sfs.Scp.WebApi
dueDate = asn.ReceiveTime, dueDate = asn.ReceiveTime,
timeWindow = asn.ReceivedPort, timeWindow = asn.ReceivedPort,
remark = asn.Remark, remark = asn.Remark,
subsite=asn.WebSubSite
}; };
if (string.IsNullOrEmpty(asnMstr.TimeWindow)) if (string.IsNullOrEmpty(asnMstr.timeWindow))
{ {
asnMstr.TimeWindow = "00:00-00:00"; asnMstr.timeWindow = "00:00-00:00";
} }
foreach (var barcode in barcodes) foreach (var barcode in barcodes)
{ {
@ -291,7 +289,14 @@ namespace Win_in.Sfs.Scp.WebApi
{ {
exist.JsonString = x12Asn.JsonString; exist.JsonString = x12Asn.JsonString;
exist.EdiString = x12Asn.EdiString; exist.EdiString = x12Asn.EdiString;
exist.Reset(); if(x12Asn.Status== EnumExchangeDataStatus.Finish)
{
exist.SetSuccess(x12Asn.Reader);
}
else
{
exist.SetError(x12Asn.Reader, (EnumExchangeDataErrorCode) x12Asn.ErrorCode, x12Asn.ErrorMessage, x12Asn.Remark);
}
await x12AsnRepository.UpdateAsync(exist); await x12AsnRepository.UpdateAsync(exist);
} }
} }

6
WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/NoPoASN/AsnMstr.cs

@ -44,10 +44,6 @@ namespace Win_in.Sfs.Scp.WebApi
/// 供应商 /// 供应商
/// </summary> /// </summary>
public virtual string vendorCode { get; set; } public virtual string vendorCode { get; set; }
/// <summary>
/// 状态
/// </summary>
public string status { get; set; }
/// <summary> /// <summary>
/// 联系人 /// 联系人
@ -97,7 +93,7 @@ namespace Win_in.Sfs.Scp.WebApi
/// <summary> /// <summary>
/// 工厂编码 /// 工厂编码
/// </summary> /// </summary>
public virtual string Subsite { get; set; } public virtual string subsite { get; set; }
public virtual List<AsnDet> details { get; set; } = new List<AsnDet>(); public virtual List<AsnDet> details { get; set; } = new List<AsnDet>();

Loading…
Cancel
Save