Browse Source

修改 拆箱 合箱

Agv分支2024-11-19
郑勃旭 4 months ago
parent
commit
32afc10f4b
  1. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs
  2. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs
  3. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs
  4. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs
  5. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAppService.cs
  6. 30
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs
  7. 107
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs
  8. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs

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

@ -1178,7 +1178,7 @@ public class AssembleIssueJobAppService
var first = job.Details.FirstOrDefault();
var request = new AgvRequest();
request.MatCode = first.ItemCode;
request.MatQty = first.HandledToQty;
request.MatQty = first.HandledFromQty;
request.OrderNum = job.Number;
request.OrderType = EnumJobType.AssembleIssueJob.ToString();
request.BeginPosition = beginPosition;

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs

@ -1211,7 +1211,7 @@ public class CoatingIssueJobAppService
var first = job.Details.FirstOrDefault();
var request = new AgvRequest();
request.MatCode = first.ItemCode;
request.MatQty = first.HandledToQty;
request.MatQty = first.HandledFromQty;
request.OrderNum = job.Number;
request.OrderType = ((int)EnumJobType.CoatingIssueJob).ToString();
request.BeginPosition = beginPosition;
@ -1250,6 +1250,9 @@ public class CoatingIssueJobAppService
}
var client = new AgvJobClient(_agvOptions.Value.Address, httpclient, _agvOptions.Value.Path);
_logger.LogInformation($"发送Json{JsonSerializer.Serialize(request)}{DateTime.Now.ToString()}");
ret = await client.PushOutTaskCoatingAsync(request).ConfigureAwait(false);
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs

@ -1168,7 +1168,7 @@ public class KittingIssueJobAppService
var first = job.Details.FirstOrDefault();
var request = new AgvRequest();
request.MatCode = first.ItemCode;
request.MatQty = first.HandledToQty;
request.MatQty = first.HandledFromQty;
request.OrderNum = job.Number;
request.State = "0";
request.PakingCode = !string.IsNullOrEmpty(first.HandledFromPackingCode)?first.HandledFromPackingCode:string.Empty;

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs

@ -882,7 +882,7 @@ public class UnplannedIssueJobAppService
httpclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic",
Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}")));
}
_logger.LogInformation($"发送Json{JsonSerializer.Serialize(request)}{DateTime.Now.ToString()}");
var client = new AgvJobClient(_agvOptions.Value.Address, httpclient, _agvOptions.Value.Path);
ret = await client.PushOutTaskUnplannedAsync(request).ConfigureAwait(false);

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAppService.cs

@ -512,6 +512,9 @@ public class UnplannedReceiptJobAppService
}
var client = new AgvJobClient(_agvOptions.Value.Address, httpclient, _agvOptions.Value.Path);
_logger.LogInformation($"发送Json{JsonSerializer.Serialize(request)}{DateTime.Now.ToString()}");
ret = await client.PushOutTaskUnplannedReceiptAsync(request).ConfigureAwait(false);

30
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs

@ -93,7 +93,7 @@ public class CustomerProductionReturnNoteAppService :
if (customerlist.Count > 0)
{
entity.CustomerName = customerlist.FirstOrDefault().Name;
entity.CustomerName =$"{customerlist.FirstOrDefault().Name}({entity.CustomerCode})" ;
}
else
{
@ -105,16 +105,16 @@ public class CustomerProductionReturnNoteAppService :
var custitmDetail = await _customerItemAppService.GetListByPartsAsync(parts.ToList()).ConfigureAwait(false);
#region 20241230修改
var query = from itm in custitmDetail
join itm1 in custitmDetail on itm.ItemCode equals itm1.ItemCode
where itm.CustomerCode != itm1.CustomerCode
select itm;
var diff= query.ToList();
if (diff.Count > 0)
{
var diffparts=diff.Select(p => p.ItemCode).Distinct().ToList();
throw new UserFriendlyException($"零件编号{string.Join(",",diffparts)},对应多个客户不能进行退货,请查看客户零件关系表!");
}
//var query = from itm in custitmDetail
// join itm1 in custitmDetail on itm.ItemCode equals itm1.ItemCode
// where itm.CustomerCode != itm1.CustomerCode
// select itm;
//var diff= query.ToList();
//if (diff.Count > 0)
//{
// var diffparts=diff.Select(p => p.ItemCode).Distinct().ToList();
// throw new UserFriendlyException($"零件编号{string.Join(",",diffparts)},对应多个客户不能进行退货,请查看客户零件关系表!");
//}
#endregion
#region 20241230修改
@ -123,15 +123,9 @@ public class CustomerProductionReturnNoteAppService :
var part= custitmDetail.FirstOrDefault(p => p.CustomerCode == entity.CustomerCode && p.ItemCode==itm.ItemCode);
if (part == null)
{
throw new UserFriendlyException($"零件编号{itm.ItemCode}客户编码{entity.CustomerCode}在零件关系表中不存在!");
throw new UserFriendlyException($"零件编号{itm.ItemCode}客户编码{entity.CustomerCode}在客户物料关系表中不存在!");
}
}
#endregion

107
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs

@ -80,29 +80,103 @@ public class IntegrationPackingNoteAppService :
if (input.Details.Any(p=>p.Qty<=0))
{
throw new UserFriendlyException($"数量必须大于0");
}
var entity = input.ToObject<IntegrationPackingNote>();
var number = await GenerateNumberAsync(nameof(IntegrationPackingNote), Clock.Now).ConfigureAwait(false);
entity.Number = number;
entity.SetId(GuidGenerator.Create());
entity.SetIdAndNumberWithDetails(GuidGenerator, entity.Number);
entity = await _repository.InsertAsync(entity).ConfigureAwait(false);
var dto = entity.ToObject<IntegrationPackingNoteDTO>();
//标签记录
var splitPackingRecDtos = await _splitPackingRecAppService.GetListByToPackingCode(new List<string> { input.PackingCode }).ConfigureAwait(false);
var splitPackingRecDto = splitPackingRecDtos.First();
var inventoryLabelWithoutCodeCreateInput = new InventoryLabelWithoutCodeCreateInput
{
Qty = detailInput.Qty, ItemCode = detailInput.ItemCode,
SupplierCode = detailInput.SupplierCode,
Lot = detailInput.Lot,
Uom = detailInput.Uom,
LocationErpCode = detailInput.LocationErpCode,
ItemDesc1 = detailInput.ItemDesc1,
ArriveDate = detailInput.ArriveDate,
StdPackQty = detailInput.StdPackQty,
ProdLine = string.Empty,
AsnNumber = detailInput.PurchaseInfo_AsnNumber,
ContainerCode = detailInput.ContainerCode,
ExpireDate = detailInput.ExpireDate,
FullBarcodeString = string.Empty,
ItemDesc2 = detailInput.ItemDesc2,
ItemName = detailInput.ItemName,
SupplierName = detailInput.SupplierName,
Remark = detailInput.Remark,
LabelStatus = LabelStatus.Enable,
LabelType = detailInput.LabelType,
PlanArriveDate = detailInput.PlanArriveDate,
PoNumber = detailInput.PurchaseInfo_PoNumber,
ProduceDate = detailInput.ProduceDate,
QLevel = string.Empty,
QualityFile = string.Empty,
RecommendLocationCode = detailInput.RecommendLocationCode,
RpNumber = detailInput.RpNumber,
Shift = string.Empty,
Specifications = string.Empty,
SupplierBatch = detailInput.SupplierBatch,
SupplierItemCode = detailInput.ItemCode,
SupplierItemName = detailInput.SupplierItemName,
SupplierSimpleName = detailInput.SupplierSimpleName,
Team = string.Empty,
};
var inventoryLabelDto=await _inventoryLabelAppService.GenerateAndCreateAsync(inventoryLabelWithoutCodeCreateInput).ConfigureAwait(false);
var splitPackingRecEditInputs = new List<SplitPackingRecEditInput>()
{
new SplitPackingRecEditInput()
{
ItemCode = inventoryLabelDto.ItemCode,
SupplierCode = inventoryLabelDto.SupplierCode,
ToPackingCode = inventoryLabelDto.Code,
FromPackingCode = input.PackingCode,
LocationErpCode = inventoryLabelDto.LocationErpCode,
ItemDesc1 = inventoryLabelDto.ItemDesc1,
FromLot = input.Lot,
ToLot = inventoryLabelDto.Lot,
ArriveDate = inventoryLabelDto.ArriveDate,
ItemName = inventoryLabelDto.ItemName,
ItemDesc2 = inventoryLabelDto.ItemDesc2,
PurchaseInfo_PoNumber = inventoryLabelDto.PoNumber,
LabelType = (EnumLabelType)inventoryLabelDto.LabelType,
RecommendLocationCode = inventoryLabelDto.RecommendLocationCode,
RpNumber = inventoryLabelDto.RpNumber,
SupplierName = inventoryLabelDto.SupplierName,
Remark = inventoryLabelDto.Remark,
FromQty = input.Qty,
ToQty = inventoryLabelDto.Qty,
PurchaseInfo_AsnNumber = inventoryLabelDto.AsnNumber,
ExpireDate = inventoryLabelDto.ExpireDate,
FullBarcodeString = inventoryLabelDto.FullBarcodeString,
SupplierBatch = inventoryLabelDto.SupplierBatch,
ProduceDate = inventoryLabelDto.ProduceDate,
LabelStatus = Basedata.LabelStatus.Enable,
SupplierSimpleName = inventoryLabelDto.SupplierSimpleName,
SupplierItemCode = inventoryLabelDto.SupplierItemCode,
SupplierItemName = inventoryLabelDto.SupplierItemName,
PlanArriveDate = inventoryLabelDto.PlanArriveDate,
FromStdPackQty = input.StdPackQty,
FromUom = input.Uom,
OprType = OprTypeEnum.SplitBox,
ReceiptRecNumber = inventoryLabelDto.RpNumber,
ToStdPackQty = inventoryLabelDto.StdPackQty,
ToUom = inventoryLabelDto.Uom,
TaskOrderNumber = detailInput.TaskOrderNumber,
ArrivalNoticNumber = detailInput.ArrivalNoticNumber,
PutOnShelfNumber = detailInput.PutOnShelfNumber,
}
};
await _splitPackingRecAppService.BatchInsertAsync(splitPackingRecEditInputs).ConfigureAwait(false);
//var dto = await base.CreateAsync(input).ConfigureAwait(false);
//创建标签
var dto= await base.CreateAsync(input).ConfigureAwait(false);
foreach (var detailInput in input.Details)
{
//库存移动
var transferLogEditInput = await BuildTransferLogsAsync(dto, detailInput).ConfigureAwait(false);
var transferLogEditInput=await BuildTransferLogsAsync(dto, detailInput, splitPackingRecEditInputs.First()).ConfigureAwait(false);
transferLogEditInputs.Add(transferLogEditInput);
}
await _transferLogAppService.AddManyAsync(transferLogEditInputs).ConfigureAwait(false);
return dto;
}
/// <summary>
@ -159,4 +233,9 @@ public class IntegrationPackingNoteAppService :
return transferLogEditInput;
}
private async Task CreateLabelAsync()
{
var batchInsert=await _splitPackingRecAppService.BatchInsertAsync().ConfigureAwait(false);
}
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs

@ -715,7 +715,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
{
errors.Add($"结束点{detail.EndPosition}库位没查到");
}
var productionline=await _productionLineAppService.GetByCodeAsync(tolocation.Code).ConfigureAwait(false);
var productionline=await _productionLineAppService.GetByLocationCodeAsync(tolocation.Code).ConfigureAwait(false);
if (productionline == null)
{
errors.Add($"结束点{detail.EndPosition}库位不在生产线中!");

Loading…
Cancel
Save