|
|
@ -145,7 +145,8 @@ public class AssembleIssueJobAppService |
|
|
|
foreach (var assembleIssueJobDto in assembleIssueJobDtos) |
|
|
|
{ |
|
|
|
await DoingDimensionalStorehouseAsync(assembleIssueJobDto).ConfigureAwait(false); |
|
|
|
await DoingAgvAsync(assembleIssueJobDto).ConfigureAwait(false); |
|
|
|
var firstDetail = assembleIssueJobDto.Details.First(); |
|
|
|
await DoingAgvAsync(assembleIssueJobDto, firstDetail.RecommendFromLocationCode, firstDetail.RecommendToLocationCode).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
return assembleIssueJobDtos; |
|
|
@ -165,7 +166,8 @@ public class AssembleIssueJobAppService |
|
|
|
await DoingDimensionalStorehouseAsync(assembleIssueJobDto).ConfigureAwait(false); |
|
|
|
if (flagDimensionalStorehouse == false) |
|
|
|
{ |
|
|
|
await DoingAgvAsync(assembleIssueJobDto).ConfigureAwait(false); |
|
|
|
var firstDetail = assembleIssueJobDto.Details.First(); |
|
|
|
await DoingAgvAsync(assembleIssueJobDto, firstDetail.RecommendFromLocationCode, firstDetail.RecommendToLocationCode).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
return assembleIssueJobDto; |
|
|
@ -495,7 +497,10 @@ public class AssembleIssueJobAppService |
|
|
|
jobDetail.TransferLibToSupplierBatch = transferLibNoteDetail.HandledToSupplierBatch; |
|
|
|
jobDetail.TransferLibToWarehouseCode = transferLibNoteDetail.HandledToWarehouseCode; |
|
|
|
|
|
|
|
await _repository.UpdateAsync(job).ConfigureAwait(false); |
|
|
|
job=await _repository.UpdateAsync(job).ConfigureAwait(false); |
|
|
|
var jobDto=ObjectMapper.Map<AssembleIssueJob, AssembleIssueJobDTO>(job); |
|
|
|
|
|
|
|
await DoingAgvAsync(jobDto, jobDetail.TransferLibToLocationCode,jobDetail.RecommendToLocationCode).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
#endregion
|
|
|
@ -805,17 +810,20 @@ public class AssembleIssueJobAppService |
|
|
|
/// 调用AGV
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="assembleIssueJobDto"></param>
|
|
|
|
/// <param name="fromLocationCode"></param>
|
|
|
|
/// <param name="toLocationCode"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
private async Task DoingAgvAsync(AssembleIssueJobDTO assembleIssueJobDto) |
|
|
|
private async Task DoingAgvAsync(AssembleIssueJobDTO assembleIssueJobDto,string fromLocationCode,string toLocationCode) |
|
|
|
{ |
|
|
|
var jobDetailInputdetail = assembleIssueJobDto.Details.FirstOrDefault(); |
|
|
|
var locationDeliveryDto = await _locationDeliveryAppService.GetByFromLocationCodeAndToLocationCodeAsync( |
|
|
|
jobDetailInputdetail.RecommendFromLocationCode, jobDetailInputdetail.RecommendToLocationCode).ConfigureAwait(false); |
|
|
|
fromLocationCode, toLocationCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
if (locationDeliveryDto != null && locationDeliveryDto.EnumLocationDeliveryType == EnumLocationDeliveryType.Agv) |
|
|
|
{ |
|
|
|
//TODO AGV
|
|
|
|
var ret = await CallAgvAsync(assembleIssueJobDto).ConfigureAwait(false); |
|
|
|
//来源永远是库位 目标永远是工位
|
|
|
|
var ret = await CallAgvAsync(assembleIssueJobDto, fromLocationCode, jobDetailInputdetail.Remark).ConfigureAwait(false); |
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
|
|
|
@ -855,17 +863,17 @@ public class AssembleIssueJobAppService |
|
|
|
/// 调用 Agv 接口
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="input"></param>
|
|
|
|
/// <param name="pLoc"></param>
|
|
|
|
/// <param name="uid"></param>
|
|
|
|
/// <param name="beginPosition"></param>
|
|
|
|
/// <param name="endPosition"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("call-agv")] |
|
|
|
public async Task<ReusltObject> CallAgvAsync(AssembleIssueJobDTO input) |
|
|
|
public async Task<ReusltObject> CallAgvAsync(AssembleIssueJobDTO input, string beginPosition, string endPosition) |
|
|
|
{ |
|
|
|
var res = new ReusltObject(); |
|
|
|
List<string> errors = new List<string>(); |
|
|
|
List<string> successList = new List<string>(); |
|
|
|
|
|
|
|
var jobres = await SendInterFaceAsync(input).ConfigureAwait(false); |
|
|
|
var jobres = await SendInterFaceAsync(input, beginPosition, endPosition).ConfigureAwait(false); |
|
|
|
if (jobres.Code != "0") |
|
|
|
{ |
|
|
|
_logger.LogInformation(jobres.Message); |
|
|
@ -1076,8 +1084,10 @@ public class AssembleIssueJobAppService |
|
|
|
/// 调用Agv接口实现
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="job"></param>
|
|
|
|
/// <param name="beginPosition"></param>
|
|
|
|
/// <param name="endPosition"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
private async Task<AgvResultObject> SendInterFaceAsync(AssembleIssueJobDTO job) |
|
|
|
private async Task<AgvResultObject> SendInterFaceAsync(AssembleIssueJobDTO job,string beginPosition, string endPosition) |
|
|
|
{ |
|
|
|
#if DEBUG
|
|
|
|
|
|
|
@ -1107,6 +1117,8 @@ public class AssembleIssueJobAppService |
|
|
|
request.MatQty = first.HandledToQty; |
|
|
|
request.OrderNum = job.Number; |
|
|
|
request.OrderType = EnumJobType.AssembleIssueJob.ToString(); |
|
|
|
request.BeginPosition = beginPosition; |
|
|
|
request.EndPosition = endPosition; |
|
|
|
|
|
|
|
var httpclient = _httpClientFactory.CreateClient(); |
|
|
|
_agvOptions.Value.Address = string.IsNullOrEmpty(_agvOptions.Value.Address) |
|
|
|