diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Properties/PublishProfiles/FolderProfile.pubxml b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 000000000..154e03532 --- /dev/null +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,13 @@ + + + + + Release + Any CPU + bin\Release\net6.0\publish\ + FileSystem + <_TargetId>Folder + + \ No newline at end of file diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/IUnplannedReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/IUnplannedReceiptJobAppService.cs index 69b63deef..11009929a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/IUnplannedReceiptJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/IUnplannedReceiptJobAppService.cs @@ -31,6 +31,10 @@ public interface IUnplannedReceiptJobAppService /// Task IsAllJobOverByRequestNumberAsync(string requestNumber); - - Task CallAgvAsync(UnplannedReceiptJobDTO input); + /// + /// Agv 回调 接口 + /// + /// + /// + Task CallBackAgvAsync(AgvRequestUnplannedDto request); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs index 7981b9ec2..cf7fe2f57 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs @@ -913,12 +913,12 @@ public class AssembleIssueJobAppService } /// - /// Agv 回调 接口 + /// Agv 执行完发料回调接口 /// /// /// [HttpPost("call-back-agv")] - public async Task CallBackAgvAsync(AgvRequestDto request) + public async Task CallBackAgvIssueAsync(AgvRequestDto request) { var entity=await _repository.FindAsync(p => p.Number == request.Data.First().OrderNum).ConfigureAwait(false); var dto=ObjectMapper.Map(entity); @@ -1018,46 +1018,29 @@ public class AssembleIssueJobAppService foreach (var detail in notes) { - TransferNoteEditInput transfer = new TransferNoteEditInput(); + var transfer = new TransferNoteEditInput(); transfer.CallJobNumber = detail.OrderNum; - transfer.Type = EnumTransSubType.Agv_Return_Assemble.ToString(); + transfer.Type = EnumTransSubType.Transfer_WIP.ToString(); transfer.Worker = "Agv"; transfer.UseOnTheWayLocation = false; - List transferNoteDetailInputs = new List(); - TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); - var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); - if (fromloc == null) + transfer.Confirmed = true; + var detailInput = new TransferNoteDetailInput(); + + var fromPosition = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); + if (fromPosition == null) { - errors.Add($"来源起始点{detail.BeginPosition}没查到"); + errors.Add($"未查询到工位{detail.BeginPosition}关联的库位"); } - LocationDTO fromlocation = null; - if (fromloc != null) + var fromLocationDto = await _locationAppService.GetByCodeAsync(fromPosition.LocationCode).ConfigureAwait(false); + var tolocationDto = await _locationAppService.GetByCodeAsync(detail.EndPosition).ConfigureAwait(false); + if (tolocationDto != null) { - fromlocation = await _locationAppService.GetByCodeAsync(fromloc.LocationCode).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.LocationCode).ConfigureAwait(false); - } - if (tolocation == null) - { - errors.Add($"结束点{detail.EndPosition}库位没查到"); + tolocationDto = await _locationAppService.GetByCodeAsync(detail.EndPosition).ConfigureAwait(false); } var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); if (item == null) { - errors.Add($"零件号{detail.MatCode}的零件不存在!"); + errors.Add($"ERP料号{detail.MatCode}不存在!"); } else { @@ -1075,27 +1058,26 @@ public class AssembleIssueJobAppService Message = string.Join(",", errors.ToArray()) }; } - detailInput.ToLocationCode = tolocation.Code; - detailInput.ToLocationGroup = tolocation.LocationGroupCode; - detailInput.ToLocationArea = tolocation.AreaCode; - detailInput.ToLocationErpCode = tolocation.ErpLocationCode; - detailInput.ToWarehouseCode = tolocation.WarehouseCode; - detailInput.FromStatus = tolocation.DefaultInventoryStatus; - - + detailInput.ToLocationCode = tolocationDto.Code; + detailInput.ToLocationGroup = tolocationDto.LocationGroupCode; + detailInput.ToLocationArea = tolocationDto.AreaCode; + detailInput.ToLocationErpCode = tolocationDto.ErpLocationCode; + detailInput.ToWarehouseCode = tolocationDto.WarehouseCode; + + detailInput.FromLocationCode = fromLocationDto.Code; + detailInput.FromLocationGroup = fromLocationDto.LocationGroupCode; + detailInput.FromLocationArea = fromLocationDto.AreaCode; + detailInput.FromLocationErpCode = fromLocationDto.ErpLocationCode; + detailInput.FromWarehouseCode = fromLocationDto.WarehouseCode; detailInput.Qty = detail.MatQty; - detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.ToLot = detail.BatchAttr07; detailInput.ToPackingCode = detail.PakingCode; - detailInput.FromWarehouseCode = fromlocation.WarehouseCode; - detailInput.FromLocationCode = fromlocation.Code; - detailInput.FromLocationGroup = fromlocation.LocationGroupCode; - detailInput.FromLocationArea = fromlocation.AreaCode; - detailInput.FromLocationErpCode = fromlocation.ErpLocationCode; - detailInput.ToStatus = fromlocation.DefaultInventoryStatus; - detailInput.Qty = detail.MatQty; - detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.FromLot = detail.BatchAttr07; detailInput.FromPackingCode = detail.PakingCode; + detailInput.FromStatus = EnumInventoryStatus.OK; + detailInput.ToStatus = EnumInventoryStatus.OK; + detailInput.Remark = "AGV反库"; transfer.Details.Add(detailInput); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAppService.cs index 172c90c0d..eed580955 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAppService.cs @@ -57,7 +57,7 @@ public class UnplannedReceiptJobAppService private readonly IPostionLocationAppService _postionLocationAppService; private readonly ILogger _logger; private readonly ITransferNoteAppService _transferNoteAppService; - + private readonly ILocationDeliveryAppService _locationDeliveryAppService; public UnplannedReceiptJobAppService( IUnplannedReceiptJobRepository repository, IUnplannedReceiptJobManager UnplannedReceiptJobManager, IPostionLocationAppService postionLocationAppService, @@ -68,10 +68,8 @@ public class UnplannedReceiptJobAppService IHttpClientFactory httpClientFactory, IUnitOfWorkManager unitOfWorkManager, ILogger logger, - ITransferNoteAppService transferNoteAppService - - - ) : base(repository, UnplannedReceiptJobManager) + ITransferNoteAppService transferNoteAppService, + ILocationDeliveryAppService locationDeliveryAppService) : base(repository, UnplannedReceiptJobManager) { _unplannedReceiptJobManager = UnplannedReceiptJobManager; _locationAppService = locationAppService; @@ -84,6 +82,7 @@ public class UnplannedReceiptJobAppService _logger = logger; _postionLocationAppService = postionLocationAppService; _transferNoteAppService = transferNoteAppService; + _locationDeliveryAppService = locationDeliveryAppService; } @@ -110,6 +109,7 @@ public class UnplannedReceiptJobAppService public async Task CreateByFreeAsync(UnplannedReceiptRequestDTO requestDto) { var jobs=await BuildUnplannedReceiptJobAsync(requestDto).ConfigureAwait(false); + await CreateManyAsync(jobs).ConfigureAwait(false); } @@ -126,6 +126,7 @@ public class UnplannedReceiptJobAppService { var details = ObjectMapper.Map, List>(detailDtos); var job=await _repository.FindAsync(p => p.Number == jobNumber).ConfigureAwait(false); + var isHasAgvFlag = false; if (job == null) { @@ -194,6 +195,13 @@ public class UnplannedReceiptJobAppService { throw new UserFriendlyException("立库功能暂未开放"); } + + var dto=await _locationDeliveryAppService.GetByFromLocationCodeAndToLocationCodeAsync(detail.HandledToLocationCode, detail.HandledToLocationCode).ConfigureAwait(false); + if (dto != null) + { + await CallAgvAsync(job,detail).ConfigureAwait(false); + isHasAgvFlag = true; + } } job.Details = details; @@ -201,9 +209,20 @@ public class UnplannedReceiptJobAppService job.JobStatus = EnumJobStatus.Done; job.CompleteTime=DateTime.Now; job.Worker=worker; + + if (isHasAgvFlag) + { + job.JobStatus = EnumJobStatus.WaitAgv; + } + job =await _repository.UpdateAsync(job).ConfigureAwait(false); - await LocalEventBus.PublishAsync(new SfsCompletedEntityEventData(job), false).ConfigureAwait(false); - await UpdateRequestStatusAsync(job.UnplannedReceiptRequestNumber).ConfigureAwait(false); + + if (!isHasAgvFlag)//没有AGV就执行 + { + await LocalEventBus.PublishAsync(new SfsCompletedEntityEventData(job), false) + .ConfigureAwait(false); + await UpdateRequestStatusAsync(job.UnplannedReceiptRequestNumber).ConfigureAwait(false); + } } /// @@ -326,21 +345,21 @@ public class UnplannedReceiptJobAppService } return true; } + /// /// 调用 Agv 接口 /// - /// - /// - /// + /// + /// /// [HttpPost("call-agv")] - public async Task CallAgvAsync(UnplannedReceiptJobDTO input) + public async Task CallAgvAsync(UnplannedReceiptJob job,UnplannedReceiptJobDetail detail) { var res = new ReusltObject(); List errors = new List(); List successList = new List(); - var jobres = await SendInterFaceAsync(input).ConfigureAwait(false); + var jobres = await SendInterFaceAsync(job,detail).ConfigureAwait(false); if (jobres.Code != "0") { _logger.LogInformation(jobres.Message); @@ -368,321 +387,53 @@ public class UnplannedReceiptJobAppService [HttpPost("call-back-agv")] public async Task CallBackAgvAsync(AgvRequestUnplannedDto request) { - var json = JsonSerializer.Serialize(request); - var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); - _logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json); -#if DEBUG -#endif - var errors = new List(); - var first = request.Data.FirstOrDefault(); - var job = await _repository.GetAsync(p => p.Number == first.OrderNum).ConfigureAwait(false); - var ret = new AgvResultObject - { - Code = "0", - Message = "OK", - ReqCode = job.UnplannedReceiptRequestNumber, - }; - using var unitOfWork = _unitOfWorkManager.Begin(); - try - { - if (request.Data.Count > 0) - { - var jobs = request.Data; - var numbers = jobs.Select(p => p.OrderNum); - var query = _repository.WithDetails() - .Where(p => numbers.Contains(p.Number) && p.JobStatus != EnumJobStatus.Done); - var entities = query.ToList(); - if (entities.Count == 0) - { - errors.Add($"任务号{string.Join(",", numbers)}不存在!"); - } - var dtos = ObjectMapper.Map, List>(entities); - - foreach (var itm in dtos) - { - var arys = jobs.Where(p => p.OrderNum == itm.Number); - var itmDetails = itm.Details.ToList(); - var details = new List(); - foreach (var detail in arys) - { - var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); - if (fromloc == null) - { - errors.Add($"来源起始点{detail.BeginPosition}没查到"); - } - - LocationDTO fromlocation = null; - - if (fromloc != null) - { - fromlocation = await _locationAppService.GetByCodeAsync(fromloc.LocationCode).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.LocationCode).ConfigureAwait(false); - } - if (tolocation == null) - { - errors.Add($"结束点{detail.EndPosition}库位没查到"); - } - - var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); - - if (item == null) - { - errors.Add($"零件号{detail.MatCode}不存在!"); - } - var entity = itmDetails.FirstOrDefault(p => p.ItemCode == detail.MatCode); - if (entity == null) - { - errors.Add($"零件号{detail.MatCode}不在任务明细内!"); - } - if (errors.Count > 0) - { - await unitOfWork.RollbackAsync().ConfigureAwait(false); - return ret = new AgvResultObject() - { - Code = "-1", - ReqCode = "", - Message = string.Join(",", errors.ToArray()) - }; - } - var dto = new UnplannedReceiptJobDetailDTO(); - dto.InjectFrom(entity); - dto.HandledQty = detail.MatQty; - dto.HandledPackingCode = detail.PakingCode; - dto.HandledToWarehouseCode = tolocation.WarehouseCode; - dto.HandledToLocationCode = tolocation.Code; - dto.HandledToLocationGroup = tolocation.LocationGroupCode; - dto.HandledToLocationArea = tolocation.AreaCode; - dto.HandledToLocationErpCode = tolocation.ErpLocationCode; - - details.Add(dto); - //await ExecuteDetailExtAsync(itm.Id, entity.Id, dto).ConfigureAwait(false); - } - - if (errors.Count > 0) - { - await unitOfWork.RollbackAsync().ConfigureAwait(false); - ret = new AgvResultObject() - { - Code = "-1", - ReqCode = "", - Message = string.Join(",", errors.ToArray()) - }; - } - itm.Worker = "AGV"; - itm.Details = details; - - - await CompleteAsync(itm.Id, itm).ConfigureAwait(false);//是否这么调待明确 - - - - _logger.LogInformation($"{flag}接收Agv确认单据内容:" + json + "Agv任务完成"); - } - } - else - { - errors.Add("Agv确认单据里无数据! \n"); - } - } - catch (Exception ex) - { - ret = new AgvResultObject - { - Code = "-1", - ReqCode = job.UnplannedReceiptRequestNumber, - Message = ex.Message - }; - await unitOfWork.RollbackAsync().ConfigureAwait(false); - return ret; - } + var agvRequest = request.Data.First(); - if (errors.Count > 0) - { - ret = new AgvResultObject - { - Code = "-1", - Message = string.Join(",", errors.ToArray()), - ReqCode = job.UnplannedReceiptRequestNumber - }; - } - return ret; - } - /// - /// Agv 回库 接口 - /// - /// - /// - [HttpPost("call-return-back-agv")] - public async Task CallReturnBackAgvAsync(AgvRequestDto request) - { - var json = JsonSerializer.Serialize(request); - var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); - _logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json); -#if DEBUG -#endif - var errors = new List(); - var ret = new AgvResultObject - { - Code = "0", - Message = "OK", - ReqCode = "", - }; - using var unitOfWork = _unitOfWorkManager.Begin(); - try - { - if (request.Data.Count > 0) - { - var notes = request.Data; - - foreach (var detail in notes) - { - TransferNoteEditInput transfer = new TransferNoteEditInput(); - transfer.CallJobNumber = detail.OrderNum; - transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); - transfer.Worker = "Agv"; - transfer.UseOnTheWayLocation = false; - List transferNoteDetailInputs = new List(); - TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); - var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); - if (fromloc == null) - { - errors.Add($"来源起始点{detail.BeginPosition}没查到"); - } - LocationDTO fromlocation = null; - if (fromloc != null) - { - fromlocation = await _locationAppService.GetByCodeAsync(fromloc.LocationCode).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.LocationCode).ConfigureAwait(false); - } - if (tolocation == null) - { - errors.Add($"结束点{detail.EndPosition}库位没查到"); - } - var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); - if (item == null) - { - errors.Add($"零件号{detail.MatCode}的零件不存在!"); - } - else - { - detailInput.ItemCode = item.Code; - detailInput.Uom = item.BasicUom; - detailInput.ItemName = item.Name; - detailInput.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : string.Empty; - } - if (errors.Count > 0) - { - return ret = new AgvResultObject() - { - Code = "-1", - ReqCode = "", - Message = string.Join(",", errors.ToArray()) - }; - } - detailInput.ToLocationCode = tolocation.Code; - detailInput.ToLocationGroup = tolocation.LocationGroupCode; - detailInput.ToLocationArea = tolocation.AreaCode; - detailInput.ToLocationErpCode = tolocation.ErpLocationCode; - detailInput.ToWarehouseCode = tolocation.WarehouseCode; - detailInput.FromStatus = tolocation.DefaultInventoryStatus; - - - - detailInput.Qty = detail.MatQty; - detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.ToPackingCode = string.Empty; - detailInput.FromWarehouseCode = fromlocation.WarehouseCode; - detailInput.FromLocationCode = fromlocation.Code; - detailInput.FromLocationGroup = fromlocation.LocationGroupCode; - detailInput.FromLocationArea = fromlocation.AreaCode; - detailInput.FromLocationErpCode = fromlocation.ErpLocationCode; - detailInput.ToStatus = fromlocation.DefaultInventoryStatus; - detailInput.Qty = detail.MatQty; - detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.FromPackingCode = string.Empty; - - transfer.Details.Add(detailInput); - - - await _transferNoteAppService.CreateAsync(transfer).ConfigureAwait(false); - } - } - else - { - errors.Add("Agv确认单据里无数据! \n"); - } - } - catch (Exception ex) + var job = await _repository.FindAsync(p => p.Number == agvRequest.OrderNum).ConfigureAwait(false); + if (job == null) { - ret = new AgvResultObject - { - Code = "-1", - ReqCode = "", - Message = ex.Message - }; - await unitOfWork.RollbackAsync().ConfigureAwait(false); - + throw new UserFriendlyException("未找到该任务"); } - if (errors.Count > 0) + if (job.JobStatus != EnumJobStatus.WaitAgv) { - ret = new AgvResultObject - { - Code = "-1", - Message = string.Join(",", errors.ToArray()), - ReqCode = "" - }; - await unitOfWork.RollbackAsync().ConfigureAwait(false); + throw new UserFriendlyException("该任务状态不是等待AGV中"); } - return ret; + var toLocationDto = await _locationAppService.GetByCodeAsync(agvRequest.EndPosition).ConfigureAwait(false); + var detail = job.Details.First(); + detail.HandledQty = agvRequest.MatQty; + detail.HandledPackingCode = agvRequest.PakingCode; + detail.HandledToWarehouseCode = toLocationDto.WarehouseCode; + detail.HandledToLocationCode = toLocationDto.Code; + detail.HandledToLocationGroup = toLocationDto.LocationGroupCode; + detail.HandledToLocationArea = toLocationDto.AreaCode; + detail.HandledToLocationErpCode = toLocationDto.ErpLocationCode; + job = await _repository.UpdateAsync(job).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new SfsCompletedEntityEventData(job), false) + .ConfigureAwait(false); + await UpdateRequestStatusAsync(job.UnplannedReceiptRequestNumber).ConfigureAwait(false);//await ExecuteDetailExtAsync(itm.Id, entity.Id, dto).ConfigureAwait(false); + return new AgvResultObject() + { + Code = "", + Message = "", + ReqCode = "" + }; } - - /// /// 调用Agv接口实现 /// /// + /// /// - private async Task SendInterFaceAsync(UnplannedReceiptJobDTO job) + private async Task SendInterFaceAsync(UnplannedReceiptJob job,UnplannedReceiptJobDetail detail) { #if DEBUG - + return new AgvResultObject(); #endif var ret = new AgvResultObject { @@ -698,21 +449,15 @@ public class UnplannedReceiptJobAppService { throw new UserFriendlyException($"任务{job.Number}为已完成状态,不能发起AGV任务!"); } - - if (job.Details.Count==0) - { - throw new UserFriendlyException($"任务{job.Number}没有推荐库存!"); - } - var first = job.Details.FirstOrDefault(); var request = new AgvRequestUnplanned(); - request.MatCode = first.ItemCode; - request.MatQty = first.RecommendQty; + request.MatCode = detail.ItemCode; + request.MatQty = detail.RecommendQty; request.OrderNum = job.Number; - request.Batch = first.HandledPackingCode; + request.Batch = detail.HandledPackingCode; request.ErpLocationCode = job.FromErpLocationCode; - request.PakingCode = first.HandledPackingCode; - request.EndPosition = first.HandledToLocationCode; + request.PakingCode = detail.HandledPackingCode; + request.EndPosition = detail.HandledToLocationCode; request.OrderType = request.OrderType = job.UnplannedReceiptType == EnumUnplannedReceiptType.Raw ? EnumJobType.UnplannedReceiptJobHasPacking.ToString() : EnumJobType.UnplannedReceiptJobNoPacking.ToString(); ; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs index aa98ed63d..7859312ba 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs @@ -79,21 +79,6 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ entity.AutoHandle = true; entity.DirectCreateNote = false; entity.Worker = input.Worker; - //var user = await _sfsUserAppService.FindUserByUserNameAsync(input.Worker).ConfigureAwait(false); - //if (string.IsNullOrEmpty(user)) - //{ - // throw new UserFriendlyException("没有查到用户"); - //} - //entity.Worker = user; - //var userEntity = await _userRepository.FindByNormalizedUserNameAsync(input.Worker).ConfigureAwait(false); - //if (userEntity == null) - //{ - // throw new UserFriendlyException("没有查到用户"); - //} - - - - var res = await _unplannedReceiptRequestManager.CreateAsync(entity).ConfigureAwait(false);