Browse Source

修改agv创建发料

Agv分支2024-11-19
郑勃旭 5 months ago
parent
commit
85dc0d8279
  1. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AssembleIssueJobs/IAssembleIssueJobAppService.cs
  2. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/AgvJobs/AgvJobOutputService.cs
  3. 34
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs
  4. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/IssueRequest/AssembleIssueRequestEventHandler.cs

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AssembleIssueJobs/IAssembleIssueJobAppService.cs

@ -28,7 +28,5 @@ public interface IAssembleIssueJobAppService
Task<AssembleIssueJobDTO> GetByNumber2Async(string number); Task<AssembleIssueJobDTO> GetByNumber2Async(string number);
Task<AssembleIssueJobDTO> GetJobByPackingCodeAsync(string packingCode); Task<AssembleIssueJobDTO> GetJobByPackingCodeAsync(string packingCode);
Task<AgvResultObject> CallBackAgvAsync(AgvRequestDto request);
Task<ReusltObject> CallAgvAsync(AssembleIssueJobDTO input);
} }

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/AgvJobs/AgvJobOutputService.cs

@ -86,7 +86,7 @@ public class AgvJobOutputService : ApplicationService
public async Task<Win_in.Sfs.Wms.Store.Application.Contracts.ReusltObject> Assemble_CallAgvAsync(Guid id) public async Task<Win_in.Sfs.Wms.Store.Application.Contracts.ReusltObject> Assemble_CallAgvAsync(Guid id)
{ {
var jobdto= await _assembleIssueJobAppService.GetAsync(id).ConfigureAwait(false); var jobdto= await _assembleIssueJobAppService.GetAsync(id).ConfigureAwait(false);
var ret= await _assembleIssueJobAppService.CallAgvAsync(jobdto).ConfigureAwait(false); var ret= await _assembleIssueJobAppService.CallAgvAsync(jobdto,"123","321").ConfigureAwait(false);
return ret; return ret;
} }
@ -98,7 +98,7 @@ public class AgvJobOutputService : ApplicationService
[HttpPost("assemble-test-callagv1")] [HttpPost("assemble-test-callagv1")]
public async Task<Win_in.Sfs.Wms.Store.Application.Contracts.ReusltObject> Assemble_CallAgvAsync1(AssembleIssueJobDTO jobdto) public async Task<Win_in.Sfs.Wms.Store.Application.Contracts.ReusltObject> Assemble_CallAgvAsync1(AssembleIssueJobDTO jobdto)
{ {
var ret = await _assembleIssueJobAppService.CallAgvAsync(jobdto).ConfigureAwait(false); var ret = await _assembleIssueJobAppService.CallAgvAsync(jobdto, "123", "321").ConfigureAwait(false);
return ret; return ret;
} }
/// <summary> /// <summary>

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

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

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/IssueRequest/AssembleIssueRequestEventHandler.cs

@ -605,6 +605,12 @@ public class AssembleIssueRequestEventHandler
if (assembleIssueJobEditInputs.Count > 0) //有库存 可以创建任务 if (assembleIssueJobEditInputs.Count > 0) //有库存 可以创建任务
{ {
assembleIssueJobEditInputs.ForEach(p =>
{
p.Details.ForEach(x => x.Remark = assembleIssueRequest.Remark);
p.Remark = assembleIssueRequest.Remark;
});
//新增任务 //新增任务
var addAssembleIssueJobDtos = await _assembleIssueJobAppService var addAssembleIssueJobDtos = await _assembleIssueJobAppService
.CreateManyAsync(assembleIssueJobEditInputs) .CreateManyAsync(assembleIssueJobEditInputs)

Loading…
Cancel
Save