|
@ -1236,5 +1236,113 @@ public class AssembleIssueJobAppService |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LocationDTO fromlocation = null; |
|
|
|
|
|
|
|
|
|
|
|
if (fromloc != null) |
|
|
|
|
|
{ |
|
|
|
|
|
fromlocation = await _locationAppService.GetByCodeAsync(fromloc.Code).ConfigureAwait(false); |
|
|
|
|
|
} |
|
|
|
|
|
if (fromlocation == null) |
|
|
|
|
|
{ |
|
|
|
|
|
errors.Add($"来源起始点{detail.BeginPosition}库位没查到"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var toloc = await _postionLocationAppService.GetByCodeAsync(detail.EndPosition) |
|
|
|
|
|
.ConfigureAwait(false); |
|
|
|
|
|
if (toloc == null) |
|
|
|
|
|
{ |
|
|
|
|
|
errors.Add($"结束点{detail.EndPosition}库位没查到"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
LocationDTO toLocation = null; |
|
|
|
|
|
|
|
|
|
|
|
if (toloc != null) |
|
|
|
|
|
{ |
|
|
|
|
|
toLocation = await _locationAppService.GetByCodeAsync(toloc.Code).ConfigureAwait(false); |
|
|
|
|
|
} |
|
|
|
|
|
if (toLocation == null) |
|
|
|
|
|
{ |
|
|
|
|
|
errors.Add($"结束点{detail.EndPosition}库位没查到"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var entity = itmDetails.FirstOrDefault(p => p.ItemCode == detail.MatCode); |
|
|
|
|
|
if (entity == null) |
|
|
|
|
|
{ |
|
|
|
|
|
errors.Add($"物料号{detail.MatCode}不在任务明细内!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var dto = new AssembleIssueJobDetailDTO(); |
|
|
|
|
|
dto.InjectFrom(entity); |
|
|
|
|
|
dto.HandledToLocationCode = toLocation.Code; |
|
|
|
|
|
dto.HandledToLocationGroup = toLocation.LocationGroupCode; |
|
|
|
|
|
dto.HandledToLocationArea = toLocation.AreaCode; |
|
|
|
|
|
dto.HandledToLocationErpCode = toLocation.ErpLocationCode; |
|
|
|
|
|
|
|
|
|
|
|
dto.HandledToWarehouseCode = toLocation.WarehouseCode; |
|
|
|
|
|
dto.HandledToQty = detail.MatQty; |
|
|
|
|
|
dto.HandledToLot =!string.IsNullOrEmpty(detail.BatchAttr07)? detail.BatchAttr07: string.Empty; |
|
|
|
|
|
dto.HandledToPackingCode = string.Empty; |
|
|
|
|
|
|
|
|
|
|
|
dto.HandledFromWarehouseCode = fromlocation.WarehouseCode; |
|
|
|
|
|
dto.HandledFromLocationCode = fromlocation.Code; |
|
|
|
|
|
dto.HandledFromLocationGroup = fromlocation.LocationGroupCode; |
|
|
|
|
|
dto.HandledFromLocationArea = fromlocation.AreaCode; |
|
|
|
|
|
dto.HandledFromLocationErpCode = fromlocation.ErpLocationCode; |
|
|
|
|
|
dto.HandledFromQty = detail.MatQty; |
|
|
|
|
|
dto.HandledFromLot = string.Empty; |
|
|
|
|
|
dto.HandledFromPackingCode = string.Empty; |
|
|
|
|
|
details.Add(dto); |
|
|
|
|
|
|
|
|
|
|
|
//await ExecuteDetailExtAsync(itm.Id, entity.Id, dto).ConfigureAwait(false);
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (errors.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
ret = new AgvResultObject() |
|
|
|
|
|
{ |
|
|
|
|
|
Code = "-1", |
|
|
|
|
|
ReqCode="", |
|
|
|
|
|
Message = string.Join(",", errors.ToArray()) |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
itm.Worker = "AGV"; |
|
|
|
|
|
itm.Details = details; |
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"{flag}接收Agv确认单据内容:" + json + "Agv任务完成"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
errors.Add("Agv确认单据里无数据! \n"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
ret = new AgvResultObject |
|
|
|
|
|
{ |
|
|
|
|
|
Code = "-1", |
|
|
|
|
|
ReqCode=job.AssembleRequestNumber, |
|
|
|
|
|
Message = ex.Message, |
|
|
|
|
|
}; |
|
|
|
|
|
await unitOfWork.RollbackAsync(); |
|
|
|
|
|
return ret; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (errors.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
ret = new AgvResultObject |
|
|
|
|
|
{ |
|
|
|
|
|
Code = "-1", |
|
|
|
|
|
Message = string.Join(",", errors.ToArray()), |
|
|
|
|
|
ReqCode=job.AssembleRequestNumber |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
return ret; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
#endregion
|
|
|
} |
|
|
} |
|
|