Browse Source

提交

Agv分支2024-11-19
赵新宇 4 months ago
parent
commit
16379d23a2
  1. 13
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Properties/PublishProfiles/FolderProfile.pubxml
  2. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/IUnplannedReceiptJobAppService.cs
  3. 78
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs
  4. 373
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAppService.cs
  5. 15
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs

13
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Properties/PublishProfiles/FolderProfile.pubxml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net6.0\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
</PropertyGroup>
</Project>

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/IUnplannedReceiptJobAppService.cs

@ -31,6 +31,10 @@ public interface IUnplannedReceiptJobAppService
/// <returns></returns>
Task<bool> IsAllJobOverByRequestNumberAsync(string requestNumber);
Task<ReusltObject> CallAgvAsync(UnplannedReceiptJobDTO input);
/// <summary>
/// Agv 回调 接口
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<AgvResultObject> CallBackAgvAsync(AgvRequestUnplannedDto request);
}

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

@ -913,12 +913,12 @@ public class AssembleIssueJobAppService
}
/// <summary>
/// Agv 回调 接口
/// Agv 执行完发料回调接口
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost("call-back-agv")]
public async Task<AgvResultObject> CallBackAgvAsync(AgvRequestDto request)
public async Task<AgvResultObject> CallBackAgvIssueAsync(AgvRequestDto request)
{
var entity=await _repository.FindAsync(p => p.Number == request.Data.First().OrderNum).ConfigureAwait(false);
var dto=ObjectMapper.Map<AssembleIssueJob, AssembleIssueJobDTO>(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<TransferNoteDetailInput> transferNoteDetailInputs = new List<TransferNoteDetailInput>();
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)
transfer.Confirmed = true;
var detailInput = new TransferNoteDetailInput();
var fromPosition = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false);
if (fromPosition == null)
{
tolocation = await _locationAppService.GetByCodeAsync(toloc.LocationCode).ConfigureAwait(false);
errors.Add($"未查询到工位{detail.BeginPosition}关联的库位");
}
if (tolocation == null)
var fromLocationDto = await _locationAppService.GetByCodeAsync(fromPosition.LocationCode).ConfigureAwait(false);
var tolocationDto = await _locationAppService.GetByCodeAsync(detail.EndPosition).ConfigureAwait(false);
if (tolocationDto != 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);

373
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<UnplannedReceiptJobAppService> _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<UnplannedReceiptJobAppService> 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<UnplannedReceiptJobDetailDTO>, List<UnplannedReceiptJobDetail>>(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,10 +209,21 @@ 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<UnplannedReceiptJob>(job), false).ConfigureAwait(false);
if (!isHasAgvFlag)//没有AGV就执行
{
await LocalEventBus.PublishAsync(new SfsCompletedEntityEventData<UnplannedReceiptJob>(job), false)
.ConfigureAwait(false);
await UpdateRequestStatusAsync(job.UnplannedReceiptRequestNumber).ConfigureAwait(false);
}
}
/// <summary>
/// 构造任务Dto
@ -326,21 +345,21 @@ public class UnplannedReceiptJobAppService
}
return true;
}
/// <summary>
/// 调用 Agv 接口
/// </summary>
/// <param name="input"></param>
/// <param name="pLoc"></param>
/// <param name="uid"></param>
/// <param name="job"></param>
/// <param name="detail"></param>
/// <returns></returns>
[HttpPost("call-agv")]
public async Task<ReusltObject> CallAgvAsync(UnplannedReceiptJobDTO input)
public async Task<ReusltObject> CallAgvAsync(UnplannedReceiptJob job,UnplannedReceiptJobDetail detail)
{
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(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<AgvResultObject> 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<string>();
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<UnplannedReceiptJob>, List<UnplannedReceiptJobDTO>>(entities);
foreach (var itm in dtos)
{
var arys = jobs.Where(p => p.OrderNum == itm.Number);
var itmDetails = itm.Details.ToList();
var details = new List<UnplannedReceiptJobDetailDTO>();
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 agvRequest = request.Data.First();
var toloc = await _postionLocationAppService.GetByCodeAsync(detail.EndPosition)
.ConfigureAwait(false);
if (toloc == null)
var job = await _repository.FindAsync(p => p.Number == agvRequest.OrderNum).ConfigureAwait(false);
if (job == null)
{
errors.Add($"结束点{detail.EndPosition}库位没查到");
throw new UserFriendlyException("未找到该任务");
}
LocationDTO tolocation = null;
if (toloc != null)
if (job.JobStatus != EnumJobStatus.WaitAgv)
{
tolocation = await _locationAppService.GetByCodeAsync(toloc.LocationCode).ConfigureAwait(false);
}
if (tolocation == null)
{
errors.Add($"结束点{detail.EndPosition}库位没查到");
throw new UserFriendlyException("该任务状态不是等待AGV中");
}
var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false);
var toLocationDto = await _locationAppService.GetByCodeAsync(agvRequest.EndPosition).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);
}
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;
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;
}
if (errors.Count > 0)
{
ret = new AgvResultObject
{
Code = "-1",
Message = string.Join(",", errors.ToArray()),
ReqCode = job.UnplannedReceiptRequestNumber
};
}
return ret;
}
/// <summary>
/// Agv 回库 接口
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost("call-return-back-agv")]
public async Task<AgvResultObject> 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<string>();
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<TransferNoteDetailInput> transferNoteDetailInputs = new List<TransferNoteDetailInput>();
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)
job = await _repository.UpdateAsync(job).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsCompletedEntityEventData<UnplannedReceiptJob>(job), false)
.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;
await UpdateRequestStatusAsync(job.UnplannedReceiptRequestNumber).ConfigureAwait(false);//await ExecuteDetailExtAsync(itm.Id, entity.Id, dto).ConfigureAwait(false);
transfer.Details.Add(detailInput);
await _transferNoteAppService.CreateAsync(transfer).ConfigureAwait(false);
}
}
else
return new AgvResultObject()
{
errors.Add("Agv确认单据里无数据! \n");
}
}
catch (Exception ex)
{
ret = new AgvResultObject
{
Code = "-1",
ReqCode = "",
Message = ex.Message
};
await unitOfWork.RollbackAsync().ConfigureAwait(false);
}
if (errors.Count > 0)
{
ret = new AgvResultObject
{
Code = "-1",
Message = string.Join(",", errors.ToArray()),
Code = "",
Message = "",
ReqCode = ""
};
await unitOfWork.RollbackAsync().ConfigureAwait(false);
}
return ret;
}
/// <summary>
/// 调用Agv接口实现
/// </summary>
/// <param name="job"></param>
/// <param name="detail"></param>
/// <returns></returns>
private async Task<AgvResultObject> SendInterFaceAsync(UnplannedReceiptJobDTO job)
private async Task<AgvResultObject> SendInterFaceAsync(UnplannedReceiptJob job,UnplannedReceiptJobDetail detail)
{
#if DEBUG
return new AgvResultObject();
#endif
var ret = new AgvResultObject
{
@ -699,20 +450,14 @@ 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(); ;

15
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);

Loading…
Cancel
Save