|
|
@ -87,6 +87,7 @@ public class KittingIssueJobAppService |
|
|
|
_agvOptions = agvOptions; |
|
|
|
_itemBasicAppService = itemBasicAppService; |
|
|
|
_locationDeliveryAppService = locationDeliveryAppService; |
|
|
|
_logger = logger; |
|
|
|
} |
|
|
|
|
|
|
|
[HttpPost("get-by-number-2")] |
|
|
@ -909,6 +910,8 @@ public class KittingIssueJobAppService |
|
|
|
return ReturnMessage("-1", $"{entity.Number}任务单据已结束!"); |
|
|
|
} |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
foreach (var detail in entity.Details) |
|
|
|
{ |
|
|
|
var detailDto = new KittingIssueJobDetailDTO(); |
|
|
@ -965,6 +968,11 @@ public class KittingIssueJobAppService |
|
|
|
} |
|
|
|
await ExecuteDetailExtAsync(entity.Id, entity.Details.First().Id, detailDto).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
return ReturnMessage("-1", ex.Message); |
|
|
|
} |
|
|
|
return ReturnMessage("0", "OK"); |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
@ -975,12 +983,22 @@ public class KittingIssueJobAppService |
|
|
|
/// <returns></returns>
|
|
|
|
private AgvResultObject ReturnMessage(string code, string message) |
|
|
|
{ |
|
|
|
return new AgvResultObject() |
|
|
|
var result = new AgvResultObject() |
|
|
|
{ |
|
|
|
Code = code, |
|
|
|
Message = message, |
|
|
|
ReqCode = "" |
|
|
|
}; |
|
|
|
if(code == "0") |
|
|
|
{ |
|
|
|
_logger.LogInformation("成功:"+JsonSerializer.Serialize(result)); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_logger.LogInformation("失败:"+JsonSerializer.Serialize(result)); |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -1184,8 +1202,11 @@ public class KittingIssueJobAppService |
|
|
|
httpclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", |
|
|
|
Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}"))); |
|
|
|
} |
|
|
|
|
|
|
|
var json = JsonSerializer.Serialize(request); |
|
|
|
var client = new AgvJobClient(_agvOptions.Value.Address, httpclient, _agvOptions.Value.Path); |
|
|
|
|
|
|
|
_logger.LogInformation($"{flag}发送AGV任务请求:{json }"); |
|
|
|
|
|
|
|
ret = await client.PushOutTaskKittingAsync(request).ConfigureAwait(false); |
|
|
|
|
|
|
|
} |
|
|
|