diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs index 989eb2391..496e2efdc 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs @@ -114,7 +114,7 @@ public class ArriveConverter : IOutgoingConverter PlanBillNo = detail.PoNumber, ShipBillNo = detail.AsnNumber, DocNo = exchangeReceipt.Number, - DetailMatNo = detail.ToPackingCode, + DetailMatNo =string.IsNullOrEmpty(detail.Remark) ? detail.ToPackingCode: detail.Remark, ERP = detail.ItemCode, Qty = detail.Qty, HgQty = detail.Qty, diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ReturnConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ReturnConverter.cs index cef94089a..058748ba5 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ReturnConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ReturnConverter.cs @@ -80,7 +80,7 @@ public class ReturnConverter : IOutgoingConverter PlanBillNo = exchangeReturn.PoNumber, ShipBillNo = exchangeReturn.AsnNumber, DocNo = exchangeReturn.Number, - DetailMatNo = detail.PackingCode, + DetailMatNo = string.IsNullOrEmpty(detail.Remark)? detail.PackingCode: detail.Remark, ERP = detail.ItemCode, RtQty = detail.Qty, RtSon = detail.Reason, diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/FawtygAutoMapperProfile.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/FawtygAutoMapperProfile.cs index 7f5cc4065..e5fd5ef17 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/FawtygAutoMapperProfile.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/FawtygAutoMapperProfile.cs @@ -250,7 +250,6 @@ public class FawtygAutoMapperProfile : Profile .Ignore(x => x.StdPackQty); CreateMap() - .Ignore(x => x.DeliverPlanNumber) .Ignore(x => x.ExtraProperties) .Ignore(x => x.Details) .Ignore(x => x.CustomerAddressCode) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/DeliveryReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/DeliveryReader.cs index 6a5238413..1f6f35bbb 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/DeliveryReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/DeliveryReader.cs @@ -98,11 +98,13 @@ public class DeliveryReader : IReader var mesRequest = new DeliverRequestExchangeDto() { DeliverRequestType = Delivery.mesout_delivery_type == "0" ? EnumDeliverRequestType.FIS : EnumDeliverRequestType.Normal, + DeliverPlanNumber= Delivery.mesout_delivery_type == "0" ? Delivery.mesout_delivery_no : Delivery.mesout_delivery_plan, CustomerCode = Delivery.mesout_delivery_customer, Number = Delivery.mesout_delivery_no, Worker = "MESFY", ActiveDate = DateTime.TryParse(Delivery.mesout_delivery_wt, out DateTime dateTime) ? dateTime : DateTime.Now, - DeliverTime = DateTime.TryParse(Delivery.mesout_delivery_wt, out DateTime dateTime1) ? dateTime1 : DateTime.Now + DeliverTime = DateTime.TryParse(Delivery.mesout_delivery_wt, out DateTime dateTime1) ? dateTime1 : DateTime.Now, + MesTruckNumber=Delivery.mesout_delivery_carno, }; var mesRequestDetail = new DeliverRequestDetailExchangeDto() { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs index 1f186a5c6..d4be75195 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs @@ -119,6 +119,16 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase //转换Dictpj await dictConverter.ConvertAsync(dictpjOutsFromExternalList).ConfigureAwait(false); + + Logger.LogInformation($"Read ErpLocation");//ERP库位 + var ErpLocationReader = workerContext.ServiceProvider.GetRequiredService(); + var ErpLocationConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保存ErpLocationItem + var erpLocationFromExternalList = await ErpLocationReader.ReadAsync().ConfigureAwait(false); + //转换ErpLocationItem + await ErpLocationConverter.ConvertAsync(erpLocationFromExternalList).ConfigureAwait(false); + + Logger.LogInformation($"Read Customer");//客户资料 var CustomerReader = workerContext.ServiceProvider.GetRequiredService(); var CustomerConverter = workerContext.ServiceProvider.GetRequiredService(); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CustomerReturnNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CustomerReturnNoteConverter.cs index 17c559965..2dcee1142 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CustomerReturnNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CustomerReturnNoteConverter.cs @@ -41,7 +41,7 @@ public class CustomerReturnNoteConverter : IOutgoingConverter { var outgoingToExternalList = new List(); //获取要同步得数据 - var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.UnplannedReceipt, EnumSystemType.ERP).ConfigureAwait(false); + var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.CustomerReturn, EnumSystemType.ERP).ConfigureAwait(false); foreach (var outgoingFromWms in outgoingFromWmsList) { #region 主表 diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs index 038899008..0d650b7c2 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs @@ -156,12 +156,19 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase } #endregion - #region --接口以关闭-- 退货单 UnplannedReceipt wmsoutm + #region --接口以关闭-- 退货单 CustomerReturn wmsoutm //暂无此接口 - //Logger.LogInformation($"Write CustomerReturnNote");//退货单 - //var customerReturnNoteConvert = workerContext.ServiceProvider.GetRequiredService(); - //var customerReturnNoteList = await customerReturnNoteConvert.ConvertAsync().ConfigureAwait(false); - //await wmsoutmWriter.WriteAsync(customerReturnNoteList).ConfigureAwait(false); + Logger.LogInformation($"Write CustomerReturnNote");//退货单 + var customerReturnNoteConvert = workerContext.ServiceProvider.GetRequiredService(); + var customerReturnNoteList = await customerReturnNoteConvert.ConvertAsync().ConfigureAwait(false); + await wmsoutmWriter.WriteAsync(customerReturnNoteList).ConfigureAwait(false); + #endregion + + #region 客户退货单 CustomerReturn wmsoutm + Logger.LogInformation($"Write CustomerReturnNote");//退货单 + var customerReturnNoteConvert = workerContext.ServiceProvider.GetRequiredService(); + var customerReturnNoteList = await customerReturnNoteConvert.ConvertAsync().ConfigureAwait(false); + await wmsoutmWriter.WriteAsync(customerReturnNoteList).ConfigureAwait(false); #endregion #region 非生产领料单 UnplannedIssue wmsoutm diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json index 2e0324e5f..0f8bdf492 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json @@ -26,10 +26,10 @@ "RemoteServices": { "BaseData": { - "BaseUrl": "http://localhost:59094/" + "BaseUrl": "http://dev.ccwin-in.com:60084/" }, "Store": { - "BaseUrl": "http://localhost:59095/" + "BaseUrl": "http://dev.ccwin-in.com:60085/" }, "Label": { "BaseUrl": "http://dev.ccwin-in.com:60082/" diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/DeliverRequest/DeliverRequestExchangeDto.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/DeliverRequest/DeliverRequestExchangeDto.cs index 7273c7ce0..d98237813 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/DeliverRequest/DeliverRequestExchangeDto.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/DeliverRequest/DeliverRequestExchangeDto.cs @@ -27,7 +27,14 @@ public class DeliverRequestExchangeDto /// 发货类型 /// public EnumDeliverRequestType DeliverRequestType { get; set; } - + /// + /// 看板件发货计划单号/JIS发货单号 + /// + public string DeliverPlanNumber { get; set; } + /// + /// Mes车牌号 + /// + public string MesTruckNumber { get; set; } /// /// 客户 /// diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml index 0799d6c0e..84bf66f23 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml @@ -626,6 +626,16 @@ 发货类型 + + + 看板件发货计划单号/JIS发货单号 + + + + + Mes车牌号 + + 客户 diff --git a/be/Hosts/Core.Host/Win_in.Sfs.Core.Host/Properties/PublishProfiles/FolderProfile.pubxml b/be/Hosts/Core.Host/Win_in.Sfs.Core.Host/Properties/PublishProfiles/FolderProfile.pubxml index 5eeeba510..df0967a6b 100644 --- a/be/Hosts/Core.Host/Win_in.Sfs.Core.Host/Properties/PublishProfiles/FolderProfile.pubxml +++ b/be/Hosts/Core.Host/Win_in.Sfs.Core.Host/Properties/PublishProfiles/FolderProfile.pubxml @@ -4,17 +4,17 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - true + false false true Release Any CPU FileSystem - .\..\..\..\OutPut\Core\ + D:\发布\WMS\core FileSystem net6.0 230d2ddc-4797-4c9b-a84c-9eb57aa16297 false - + \ No newline at end of file diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/InjectionPlanRequestController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/InjectionPlanRequestController.cs index 904a3f8ed..f37f32737 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/InjectionPlanRequestController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/InjectionPlanRequestController.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; @@ -16,14 +17,16 @@ namespace Win_in.Sfs.Wms.Pda.Controllers.Stores; public class InjectionPlanRequestController : AbpController { private readonly IInjectionPlanRequestAppService _injectionRequestAppService; + private readonly IItemContainerAppService _itemContainerAppService; /// /// /// /// - public InjectionPlanRequestController(IInjectionPlanRequestAppService InjectionPlanRequestAppService) + public InjectionPlanRequestController(IInjectionPlanRequestAppService InjectionPlanRequestAppService, IItemContainerAppService itemContainerAppService) { _injectionRequestAppService = InjectionPlanRequestAppService; + _itemContainerAppService = itemContainerAppService; } /// @@ -34,7 +37,7 @@ public class InjectionPlanRequestController : AbpController [HttpPost("")] public virtual async Task> CreateAsync(InjectionPlanRequestEditInput input) { - var result = await _injectionRequestAppService.CreateAsync(input).ConfigureAwait(false); + var result = await _injectionRequestAppService.CreateAndHandleAsync(input).ConfigureAwait(false); return Ok(result); } @@ -52,16 +55,46 @@ public class InjectionPlanRequestController : AbpController } /// - /// 获取物品类别列表 + /// 获取物品类别名称 + /// + /// + [HttpGet("item-category-name")] + public virtual async Task> GetItemCategoryNameAsync() + { + var entities = await _injectionRequestAppService.GetItemCategoryListAsync().ConfigureAwait(false); + var categoryNames = entities.Select(p => p.Category).Distinct().ToList(); + + return categoryNames; + } + + /// + /// 根据类别名称获取物品类别列表 /// - /// + /// /// [HttpGet("list/item-category")] - public virtual async Task> GetItemCategoryListAsync() + public virtual async Task> GetItemCategoryListAsync(string categoryName) { var entities = await _injectionRequestAppService.GetItemCategoryListAsync().ConfigureAwait(false); - return entities; + var itemEntities = entities.Where(p => p.Category == categoryName).ToList(); + foreach (var item in itemEntities) + { + var itemContainerDto = await _itemContainerAppService.GetByItemCodeAsync(item.Code).ConfigureAwait(false); + + if(itemContainerDto != null) + { + item.StdPackQty = itemContainerDto.Qty; + item.BasicUom = itemContainerDto.BasicUom; + } + else + { + item.StdPackQty = 1; + } + + } + + return itemEntities; } } diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueRequest/InjectionRequestController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueRequest/InjectionRequestController.cs index d04c8024e..ae2a27efc 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueRequest/InjectionRequestController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueRequest/InjectionRequestController.cs @@ -35,7 +35,7 @@ public class InjectionRequestController : AbpController } /// - /// Kitting叫料申请 + /// 注塑叫料申请 /// /// /// diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptRequestController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptRequestController.cs index b7cdd062a..4de253506 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptRequestController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptRequestController.cs @@ -48,4 +48,19 @@ public class PurchaseReceiptRequestController : AbpController { return await _purchaseReceiptRequestAppService.GetDetailByItemAndPackingAsync(itemCode, packingCode).ConfigureAwait(false); } + + /// + /// 【获取】【收货记录详情】根据 物品 传入箱码的根箱码 + /// + /// + /// + /// + [HttpGet("detail-by-item-and-rootpacking")] + public virtual async Task GetDetailByItemAndRootPackingAsync(string itemCode, + string packingCode) + { + return await _purchaseReceiptRequestAppService.GetDetailByItemAndRootPackingAsync(itemCode, packingCode).ConfigureAwait(false); + } + + } diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs index 1b5403630..988c531e5 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs @@ -148,7 +148,7 @@ public class PurchaseReturnNoteController : AbpController { var po = await _purchaseOrderAppService.GetListByNumberAndItemCodeAsync(poNumber, createInputDetail.ItemCode).ConfigureAwait(false); Check.NotNull(po, nameof(PurchaseOrderDTO)); - var detail = po.Details.FirstOrDefault(r => r.ItemCode == createInputDetail.ItemCode); + var detail = po.Details.FirstOrDefault(r => r.ItemCode == createInputDetail.ItemCode && r.Lot== createInputDetail.Lot); Check.NotNull(detail, nameof(PurchaseOrderDetailDTO)); createInputDetail.PoLine = detail.PoLine; } diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnRequestController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnRequestController.cs index 781dae313..9c52d5757 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnRequestController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnRequestController.cs @@ -35,7 +35,7 @@ public class PurchaseReturnRequestController : AbpController /// 创建退货申请 /// [HttpPost("create-many")] - public virtual async Task CreateManyAsync(List input) + public virtual async Task> CreateManyAsync(List input) { List entitys = new List(); var groups = input.GroupBy(r => r.AsnNumber).ToList(); @@ -57,8 +57,7 @@ public class PurchaseReturnRequestController : AbpController } entitys.Add(entity); } - await _purchaseReturnRequestAppService.CreateManyAsync(entitys).ConfigureAwait(false); - return Ok(); + return await _purchaseReturnRequestAppService.CreateManyAsync(entitys).ConfigureAwait(false); } /// diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAppService.cs index 828a8bba0..67c7941df 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAppService.cs @@ -17,6 +17,7 @@ using System.Text; using DocumentFormat.OpenXml.Office2010.ExcelAc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; +using Volo.Abp; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories; using Win_in.Sfs.Shared; @@ -60,9 +61,17 @@ public class DictAppService : SfsBaseDataWithCodeAppServiceBase UpdateAsync(Guid id, DictEditInput input) + public override async Task UpdateAsync(Guid id, DictEditInput input) { - return base.UpdateAsync(id, input); + //return await base.UpdateAsync(id, input).ConfigureAwait(false); //lyf at 0621, 更新报错所以注释 + var entity = await _repository.GetAsync(id).ConfigureAwait(false); + if (entity == null) + { + throw new UserFriendlyException($"根据Id取字典表为空:{id}"); + } + ObjectMapper.Map(input, entity); + await _repository.UpdateAsync(entity, true).ConfigureAwait(false); + return ObjectMapper.Map(entity); } [HttpPost("update")] diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCodes/PositionCodeAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCodes/PositionCodeAppService.cs index d4390441c..ad08bd229 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCodes/PositionCodeAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCodes/PositionCodeAppService.cs @@ -56,14 +56,14 @@ public class PositionCodeAppService var existEntity = await GetByCodeAsync(input.Code).ConfigureAwait(false); if (existEntity != null) { - throw new UserFriendlyException($"{input.Code} 已存在"); + throw new UserFriendlyException($"位置码{input.Code} 已存在!"); } - var itemEntity = await _repository.FirstOrDefaultAsync(p => p.PartCode == input.PartCode).ConfigureAwait(false); - if(itemEntity != null) - { - throw new UserFriendlyException($"{input.PartCode} 物品已存在"); - } + //var itemEntity = await _repository.FirstOrDefaultAsync(p => p.LocationCode == input.LocationCode && p.PartCode == input.PartCode && p.Type == input.Type).ConfigureAwait(false); + //if (itemEntity != null) + //{ + // throw new UserFriendlyException($"类型{input.Type.ToString()}物品{input.PartCode}目标库位{input.LocationCode}已存在!"); + //} var itemBasic = await ItemBasicAppService.GetByCodeAsync(input.PartCode).ConfigureAwait(false); Check.NotNull(itemBasic, "ERP料号", $"物品 {input.PartCode} 不存在"); diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs index 04916ad6d..a4564026f 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs @@ -42,22 +42,14 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager { throw new UserFriendlyException("操作类型不是拆箱或合箱状态,源箱码和目标箱码必须相同!"); } - if (item.FromTopPackingCode.IsNullOrEmpty()) - { - item.FromTopPackingCode = item.FromPackingCode; - } - if (item.ToTopPackingCode.IsNullOrEmpty()) - { - item.ToTopPackingCode = item.FromPackingCode;// ToPackingCode; - } } #endregion if (item.OprType == OprTypeEnum.SplitBox || item.OprType == OprTypeEnum.MergeBox) { //设置顶级箱码 - item.FromTopPackingCode = GetTopPackingCode(query, item.FromPackingCode); - item.ToTopPackingCode = GetTopPackingCode(query, item.FromPackingCode); //ToPackingCode + item.FromTopPackingCode = CalcuTopPackingCode(query, item.FromPackingCode); + item.ToTopPackingCode = CalcuTopPackingCode(query, item.FromPackingCode); //ToPackingCode if (item.FromTopPackingCode.IsNullOrEmpty()) { item.FromTopPackingCode = item.FromPackingCode; @@ -91,6 +83,14 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager } else { + if (item.FromTopPackingCode.IsNullOrEmpty()) + { + item.FromTopPackingCode = item.FromPackingCode; + } + if (item.ToTopPackingCode.IsNullOrEmpty()) + { + item.ToTopPackingCode = item.FromPackingCode;// ToPackingCode; + } SplitPackingRec newEntity = CommonHelper.CloneObj(item); newEntity.SetId(GuidGenerator.Create()); var ret = await _repository.InsertAsync(newEntity, true).ConfigureAwait(false); @@ -202,24 +202,42 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager /// 取顶级箱码 /// /// 箱码历史 - /// 当前箱码 + /// 箱码,from to时都传入from /// - private static string GetTopPackingCode(IQueryable historyQuery, string packingCode) + private static string CalcuTopPackingCode(IQueryable historyQuery, string packingCode) { - var historyRec = historyQuery.Where(itm => itm.FromPackingCode == packingCode).OrderBy(itm => itm.CreationTime).FirstOrDefault(); - if (historyRec != null) - { - return historyRec.FromTopPackingCode; - } - else + var qry = historyQuery.Where(itm => itm.OprType == OprTypeEnum.SplitBox || itm.OprType == OprTypeEnum.MergeBox); + string ret = null; + SplitPackingRec? firstObj = null; + string toCode = packingCode; + while (1 == 1) { - historyRec = historyQuery.Where(itm => itm.ToPackingCode == packingCode).OrderBy(itm => itm.CreationTime).FirstOrDefault(); - if (historyRec != null) + firstObj = qry.FirstOrDefault(itm => itm.ToPackingCode == toCode); + if (firstObj == null) + { + ret = toCode; + break; + } + else { - return historyRec.ToTopPackingCode; + toCode = firstObj.FromPackingCode; } } - return null; + return ret; + //var historyRec = historyQuery.Where(itm => itm.FromPackingCode == packingCode).OrderBy(itm => itm.CreationTime).FirstOrDefault(); + //if (historyRec != null) + //{ + // return historyRec.FromTopPackingCode; + //} + //else + //{ + // historyRec = historyQuery.Where(itm => itm.ToPackingCode == packingCode).OrderBy(itm => itm.CreationTime).FirstOrDefault(); + // if (historyRec != null) + // { + // return historyRec.ToTopPackingCode; + // } + //} + //return null; } private static void SetBillNumber(IQueryable historyQuery, SplitPackingRec obj) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PositionCodes/PositionCodeDbContextModelCreatingExtensions.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PositionCodes/PositionCodeDbContextModelCreatingExtensions.cs index 33f7bd550..0110994ea 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PositionCodes/PositionCodeDbContextModelCreatingExtensions.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PositionCodes/PositionCodeDbContextModelCreatingExtensions.cs @@ -34,7 +34,6 @@ public static class PositionCodeDbContextModelCreatingExtensions //Indexes b.HasIndex(q => new { q.Code,q.PartCode,q.LocationCode }).IsUnique(); b.HasIndex(q => new { q.Code }).IsUnique(); - b.HasIndex(q => new { q.PartCode }).IsUnique(); }); } } diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/Transaction.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/Transaction.cs index 2996f4c6d..9829e129a 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/Transaction.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/Transaction.cs @@ -233,12 +233,12 @@ public class Transaction : SfsInventoryAggregateRootBase public void TrySetItemAndLocation(ItemBasicDTO item, LocationDTO location) { ManageType = item.ManageType; + StdPackQty = item.StdPackQty; if (string.IsNullOrEmpty(ItemName)) { ItemName = item.Name; ItemDesc1 = item.Desc1; - ItemDesc2 = item.Desc2; - StdPackQty = item.StdPackQty; + ItemDesc2 = item.Desc2; } if (string.IsNullOrEmpty(WarehouseCode)) { diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/ExportAndImport/ClosedXmlExportImportService.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/ExportAndImport/ClosedXmlExportImportService.cs index 316297788..9e043395e 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/ExportAndImport/ClosedXmlExportImportService.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/ExportAndImport/ClosedXmlExportImportService.cs @@ -333,7 +333,7 @@ public class ClosedXmlExportImportService : IExportImportService else { SetCellStyle(row.Cell(1).SetValue("失败"), rowIndex, 1, fontColor: XLColor.Red); - var desc = string.Join("\n", errors.Select(o => $"{o.MemberNames?.First()} {o.ErrorMessage}")); + string desc = string.Join("\n", errors.Select(o => $"{(o.MemberNames.Any() ? o.MemberNames.First() : String.Empty)} {o.ErrorMessage}")); SetCellStyle(row.Cell(2).SetValue(desc), rowIndex, 2, fontColor: XLColor.Red); } } diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransType.cs index f1faf5320..e01e910a5 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransType.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransType.cs @@ -174,8 +174,4 @@ public enum EnumTransType MesUnFreezed = 41, - - - - } diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobStatus.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobStatus.cs index 619e84684..b626f9ef6 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobStatus.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobStatus.cs @@ -48,8 +48,8 @@ public enum EnumJobStatus Cancelled = 9, /// - /// 等待 + /// 待库移 /// - [Display(Name = "等待")] + [Display(Name = "待库移")] Wait=30, } diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumIssueRequestType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumIssueRequestType.cs index d9b2baaee..6518de328 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumIssueRequestType.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumIssueRequestType.cs @@ -39,4 +39,10 @@ public enum EnumIssueRequestType /// [Display(Name = "EXCEL导入")] ExcelImport=5, + + /// + /// 注塑计划 + /// + [Display(Name = "EXCEL导入")] + InjectionPlan = 6, } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/DeliverJobs/DTOs/DeliverJobDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/DeliverJobs/DTOs/DeliverJobDTO.cs index 7c0feea34..7b2546cb4 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/DeliverJobs/DTOs/DeliverJobDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/DeliverJobs/DTOs/DeliverJobDTO.cs @@ -38,5 +38,10 @@ public class DeliverJobDTO : SfsJobDTOBase /// [Display(Name = "发货请求单号")] public string DeliverRequestNumber { get; set; } + /// + /// Mes车牌号 + /// + [Display(Name = "Mes车牌号")] + public string MesTruckNumber { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/DeliverJobs/Inputs/DeliverJobEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/DeliverJobs/Inputs/DeliverJobEditInput.cs index 2e8d7a2a8..66ffb8100 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/DeliverJobs/Inputs/DeliverJobEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/DeliverJobs/Inputs/DeliverJobEditInput.cs @@ -73,5 +73,10 @@ public class DeliverJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCreateInp /// [Display(Name = "发货计划单号")] public string DeliverPlanNumber { get; set; } + /// + /// Mes车牌号 + /// + [Display(Name = "Mes车牌号")] + public string MesTruckNumber { get; set; } #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/DTOs/DeliverNoteDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/DTOs/DeliverNoteDTO.cs index 0bc9f5a03..e91ba0574 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/DTOs/DeliverNoteDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/DTOs/DeliverNoteDTO.cs @@ -54,6 +54,11 @@ public class DeliverNoteDTO : SfsStoreDTOBase /// [Display(Name = "打印次数")] public int CountPrint { get; set; } + /// + /// Mes车牌号 + /// + [Display(Name = "Mes车牌号")] + public string MesTruckNumber { get; set; } /// /// 发货类型 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/Inputs/DeliverNoteEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/Inputs/DeliverNoteEditInput.cs index 38c0e9206..bd1154061 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/Inputs/DeliverNoteEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/Inputs/DeliverNoteEditInput.cs @@ -57,7 +57,11 @@ public class DeliverNoteEditInput : SfsStoreCreateOrUpdateInputBase /// [Display(Name = "发货类型")] public EnumDeliverRequestType DeliverRequestType { get; set; } - + /// + /// Mes车牌号 + /// + [Display(Name = "Mes车牌号")] + public string MesTruckNumber { get; set; } /// /// 明细列表 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InventoryInitialNotes/Inputs/InventoryInitialNoteImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InventoryInitialNotes/Inputs/InventoryInitialNoteImportInput.cs index 96f27424d..25d037679 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InventoryInitialNotes/Inputs/InventoryInitialNoteImportInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InventoryInitialNotes/Inputs/InventoryInitialNoteImportInput.cs @@ -10,6 +10,7 @@ public class InventoryInitialNoteImportInput : SfsStoreImportInputBase, IHasQty, /// 仓库代码 /// [Display(Name = "仓库代码")] + [Required(ErrorMessage = "{0}是必填项")] public string WarehouseCode { get; set; } /// @@ -22,6 +23,7 @@ public class InventoryInitialNoteImportInput : SfsStoreImportInputBase, IHasQty, /// ERP料号 /// [Display(Name = "ERP料号")] + [Required(ErrorMessage = "{0}是必填项")] public string ItemCode { get; set; } /// @@ -35,24 +37,28 @@ public class InventoryInitialNoteImportInput : SfsStoreImportInputBase, IHasQty, /// 单位 /// [Display(Name = "单位")] + [Required(ErrorMessage = "{0}是必填项")] public string Uom { get; set; } /// /// 批次 /// [Display(Name = "批次")] + [Required(ErrorMessage = "{0}是必填项")] public string Lot { get; set; } /// /// 库位代码 /// [Display(Name = "库位代码")] + [Required(ErrorMessage = "{0}是必填项")] public string LocationCode { get; set; } /// /// ERP库位 /// [Display(Name = "ERP库位")] + [Required(ErrorMessage = "{0}是必填项")] public string LocationErpCode { get; set; } /// @@ -72,11 +78,13 @@ public class InventoryInitialNoteImportInput : SfsStoreImportInputBase, IHasQty, /// 库区 /// [Display(Name = "库区")] + [Required(ErrorMessage = "{0}是必填项")] public string LocationArea { get; set; } /// /// 库位组 /// [Display(Name = "库位组")] + [Required(ErrorMessage = "{0}是必填项")] public string LocationGroup { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/DTOs/DeliverRequestDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/DTOs/DeliverRequestDTO.cs index a3686c8a1..729272318 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/DTOs/DeliverRequestDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/DTOs/DeliverRequestDTO.cs @@ -31,4 +31,8 @@ public class DeliverRequestDTO : SfsStoreRequestDTOBase /// [Display(Name = "客户地址")] public string CustomerAddressCode { get; set; } + /// + /// Mes车牌号 + /// + public string MesTruckNumber { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/Inputs/DeliverRequestEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/Inputs/DeliverRequestEditInput.cs index f58713e69..b612b97f3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/Inputs/DeliverRequestEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/Inputs/DeliverRequestEditInput.cs @@ -33,6 +33,8 @@ public class DeliverRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase [Display(Name = "发货类型")] public EnumDeliverRequestType DeliverRequestType { get; set; } + [Display(Name = "Mes车牌号")] + public string MesTruckNumber { get; set; } [Display(Name = "明细列表")] public List Details { get; set; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/Inputs/DeliverRequestImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/Inputs/DeliverRequestImportInput.cs index 917c5b910..cb66bb549 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/Inputs/DeliverRequestImportInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/Inputs/DeliverRequestImportInput.cs @@ -69,6 +69,11 @@ public class DeliverRequestImportInput : SfsStoreImportInputBase [Display(Name = "Mes发货计划号")] public string MesDeliveryPlan { get; set; } /// + /// Mes车牌号 + /// + [Display(Name = "Mes车牌号")] + public string MesTruckNumber { get; set; } + /// /// 底盘号 /// [Display(Name = "底盘号")] diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/IInjectionPlanRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/IInjectionPlanRequestAppService.cs index 601af38d5..dfb3a139d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/IInjectionPlanRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/IInjectionPlanRequestAppService.cs @@ -16,6 +16,7 @@ public interface IInjectionPlanRequestAppService /// Task> GetItemCategoryListAsync(); + Task CreateAndHandleAsync(InjectionPlanRequestEditInput input); Task> GetUnCompletedRequestAsync(List p_list); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/KittingIssueRequests/IKittingIssueRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/KittingIssueRequests/IKittingIssueRequestAppService.cs index bada4151d..d1a6e7350 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/KittingIssueRequests/IKittingIssueRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/KittingIssueRequests/IKittingIssueRequestAppService.cs @@ -11,7 +11,7 @@ public interface IKittingIssueRequestAppService { Task CreateAndHandleAsync(KittingIssueRequestEditInput input); - Task UpdateStatusCompletedAsync(string number); + Task UpdateStatusCompletedAsync(string number, string jobNumber); Task IsHasNewJobAsync(string requestNumber,List jobNumber); Task CreateImportExcelAsync(List inputs); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/SparePartIssueRequests/Inputs/SparePartIssueRequestImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/SparePartIssueRequests/Inputs/SparePartIssueRequestImportInput.cs index 6c362dae4..ac1f6ee0e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/SparePartIssueRequests/Inputs/SparePartIssueRequestImportInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/SparePartIssueRequests/Inputs/SparePartIssueRequestImportInput.cs @@ -13,18 +13,21 @@ public class SparePartIssueRequestImportInput : SfsStoreImportInputBase /// ERP料号 /// [Display(Name = "ERP料号")] + [Required(ErrorMessage = "{0}是必填项")] public string ItemCode { get; set; } /// /// 需求数量 /// [Display(Name = "需求数量")] + [Required(ErrorMessage = "{0}是必填项")] public decimal Qty { get; set; } /// /// 目标库位 /// [Display(Name = "目标库位")] + [Required(ErrorMessage = "{0}是必填项")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ToLocationCode { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs index 9bb0ff309..060ae62d9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs @@ -32,12 +32,21 @@ public interface IPurchaseReceiptRequestAppService string packingCode); /// - /// 修改请求状态 + /// 【获取】【收货记录详情】根据 物品 传入箱码的根箱码 /// - /// - /// + /// + /// /// - Task UpdatePurchaseReceiptRequestAsync(string number, + Task GetDetailByItemAndRootPackingAsync(string itemCode, + string packingCode); + + /// + /// 修改请求状态 + /// + /// + /// + /// + Task UpdatePurchaseReceiptRequestAsync(string number, EnumRequestStatus enumRequestStatus); /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ScrapRequests/Inputs/ScrapRequestImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ScrapRequests/Inputs/ScrapRequestImportInput.cs index 3c6af9b48..b6f47916a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ScrapRequests/Inputs/ScrapRequestImportInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ScrapRequests/Inputs/ScrapRequestImportInput.cs @@ -16,7 +16,7 @@ public class ScrapRequestImportInput : SfsStoreImportInputBase [ImporterHeader(Name = "报废类型")] [ExporterHeader(DisplayName = "报废类型")] [ValueMapping("线边报废", EnumTransSubType.Scrap_WIP)] - [ValueMapping("原料报废", EnumTransSubType.Scrap_Manual)] + //[ValueMapping("原料报废", EnumTransSubType.Scrap_Manual)] [ValueMapping("完工报废", EnumTransSubType.Scrap_Product)] public string Type { get; set; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/ITransferLibRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/ITransferLibRequestAppService.cs index 191365e01..d93c634b8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/ITransferLibRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/ITransferLibRequestAppService.cs @@ -18,6 +18,6 @@ public interface ITransferLibRequestAppService CancellationToken cancellationToken = default); Task CompleteByJobAsync(string requestNumber); - Task CancelByCallRequestNumberAsync(string callRequestNumber); + Task CancelByCallRequestNumberAsync(string callJobNumber); Task CompleteByCallRequestNumberAsync(string callRequestNumber); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferRequests/Inputs/TransferRequestImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferRequests/Inputs/TransferRequestImportInput.cs index 6a9be79c9..4ac172314 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferRequests/Inputs/TransferRequestImportInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferRequests/Inputs/TransferRequestImportInput.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using System.ComponentModel.DataAnnotations; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; @@ -73,7 +74,8 @@ public class TransferRequestImportInput : SfsStoreImportInputBase /// [Display(Name = "状态")] [Required(ErrorMessage = "{0}是必填项")] - public EnumInventoryStatus Status { get; set; } + [ValueMapping("合格", EnumInventoryStatus.OK)] + public string Status { get; set; } #region 回调服务相关 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InjectionPlanJobs/InjectionPlanJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InjectionPlanJobs/InjectionPlanJobAppService.cs index 5bd6066ae..1fc134ae3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InjectionPlanJobs/InjectionPlanJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InjectionPlanJobs/InjectionPlanJobAppService.cs @@ -64,7 +64,7 @@ public class InjectionPlanJobAppService } /// - /// 判断是不是在最底层 如果不是则把状态变更为等待 并把库移推荐的From和To赋值 + /// 判断是不是在最底层 如果不是则把状态变更为待库移 并把库移推荐的From和To赋值 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs index 7d8fc7e2d..37bd73e5b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs @@ -217,7 +217,6 @@ public class InspectJobAppService { throw new UserFriendlyException($"根据PackingCode={input.FromPackingCode}取InspectDetail表为空!"); } - //插入目标箱 var newDetail = CommonHelper.CloneObj(detail); newDetail.SetId(GuidGenerator.Create()); @@ -226,6 +225,8 @@ public class InspectJobAppService newDetail.InspectQty = input.ToQty; newDetail.GoodQty = input.ToQty; //newDetail.CreationTime = CommonHelper.CurTime; + decimal maxPoLine = job.Details.Max(itm => itm.PoLine.TryToDecimalZero()); + newDetail.PoLine = (maxPoLine + 1).ToString(); //行号自增 job.Details.Add(newDetail); //修改源箱 detail.ReceiveQty = input.FromQty - input.ToQty; 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 e9e264da5..625c6c6d7 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 @@ -235,7 +235,9 @@ public class AssembleIssueJobAppService issueJobDetail.HandledToQty += issueJobDetailDto.HandledToQty; issueJobDetail.HandledFromQty += issueJobDetailDto.HandledFromQty; assembleIssueJob.Details = new EditableList { issueJobDetail }; - + assembleIssueJob.CompleteUserId = _currentUser.Id; + assembleIssueJob.CompleteUserName = _currentUser.Name; + assembleIssueJob.CompleteTime = DateTime.Now; if (assembleIssueJob.EnumIssueSendType == EnumIssueSendType.BoxQtyType) //按箱叫料 因为任务只有1箱 所以可以直接完成 { if (issueJobDetailDto.RecommendToPackingCode != issueJobDetailDto.HandledToPackingCode) @@ -562,7 +564,7 @@ public class AssembleIssueJobAppService } /// - /// 判断是不是在最底层 如果不是则把状态变更为等待 并把库移推荐的From和To赋值 + /// 判断是不是在最底层 如果不是则把状态变更为待库移 并把库移推荐的From和To赋值 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs index 0f796ca16..c9f82ca58 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs @@ -249,7 +249,9 @@ public class CoatingIssueJobAppService issueJobDetail.HandledToQty += issueJobDetailDto.HandledToQty; issueJobDetail.HandledFromQty += issueJobDetailDto.HandledFromQty; coatingIssueJob.Details = new EditableList { issueJobDetail }; - + coatingIssueJob.CompleteUserId = _currentUser.Id; + coatingIssueJob.CompleteUserName = _currentUser.Name; + coatingIssueJob.CompleteTime = DateTime.Now; if (coatingIssueJob.EnumIssueSendType == EnumIssueSendType.BoxQtyType) //按箱叫料 因为任务只有1箱 所以可以直接完成 { if (issueJobDetailDto.RecommendToPackingCode != issueJobDetailDto.HandledToPackingCode) @@ -557,7 +559,7 @@ public class CoatingIssueJobAppService } /// - /// 判断是不是在最底层 如果不是则把状态变更为等待 并把库移推荐的From和To赋值 + /// 判断是不是在最底层 如果不是则把状态变更为待库移 并把库移推荐的From和To赋值 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs index 7edfa7635..4ee1530b1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs @@ -227,7 +227,9 @@ public class InjectionIssueJobAppService issueJobDetail.HandledToQty += issueJobDetailDto.HandledToQty; issueJobDetail.HandledFromQty += issueJobDetailDto.HandledFromQty; injectionIssueJob.Details = new EditableList { issueJobDetail }; - + injectionIssueJob.CompleteUserId = _currentUser.Id; + injectionIssueJob.CompleteUserName = _currentUser.Name; + injectionIssueJob.CompleteTime = DateTime.Now; if (injectionIssueJob.EnumIssueSendType == EnumIssueSendType.BoxQtyType) //按箱叫料 因为任务只有1箱 所以可以直接完成 { if (issueJobDetailDto.RecommendToPackingCode != issueJobDetailDto.HandledToPackingCode) @@ -510,7 +512,7 @@ public class InjectionIssueJobAppService } /// - /// 判断是不是在最底层 如果不是则把状态变更为等待 并把库移推荐的From和To赋值 + /// 判断是不是在最底层 如果不是则把状态变更为待库移 并把库移推荐的From和To赋值 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs index d3ee9c10d..21627669b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs @@ -182,6 +182,8 @@ public class IssueJobAppService newDetail.HandledPackingCode = detail.HandledPackingCode.HasValue() ? input.ToPackingCode : null; //源实际实际箱码有值,则新记录实际箱码有值 newDetail.HandledQty = detail.HandledQty > 0 ? input.ToQty : 0; //newDetail.CreationTime = CommonHelper.CurTime; + //decimal maxPoLine = job.Details.Max(itm => itm.PoLine.TryToDecimalZero()); + //newDetail.PoLine = (maxPoLine + 1).ToString(); //行号自增 job.Details.Add(newDetail); //修改源箱 detail.RecommendQty = input.FromQty - input.ToQty; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs index 1dcea8e63..cbb97cbaf 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs @@ -226,7 +226,9 @@ public class KittingIssueJobAppService issueJobDetail.HandledToQty += issueJobDetailDto.HandledToQty; issueJobDetail.HandledFromQty += issueJobDetailDto.HandledFromQty; kittingIssueJob.Details = new EditableList { issueJobDetail }; - + kittingIssueJob.CompleteUserId = _currentUser.Id; + kittingIssueJob.CompleteUserName = _currentUser.Name; + kittingIssueJob.CompleteTime = DateTime.Now; if (kittingIssueJob.EnumIssueSendType == EnumIssueSendType.BoxQtyType) //按箱叫料 因为任务只有1箱 所以可以直接完成 { if (issueJobDetailDto.RecommendToPackingCode != issueJobDetailDto.HandledToPackingCode) @@ -271,7 +273,7 @@ public class KittingIssueJobAppService await _expectOutAppService.RemoveByNumberAsync(kittingIssueJob.Number).ConfigureAwait(false); - await KittingIssueRequestAppService.UpdateStatusCompletedAsync(kittingIssueJob.KittingRequestNumber) + await KittingIssueRequestAppService.UpdateStatusCompletedAsync(kittingIssueJob.KittingRequestNumber, kittingIssueJob.Number) .ConfigureAwait(false); await _transferLibRequestAppService.CancelByCallRequestNumberAsync(kittingIssueJob.KittingRequestNumber) .ConfigureAwait(false); @@ -507,7 +509,7 @@ public class KittingIssueJobAppService } /// - /// 判断是不是在最底层 如果不是则把状态变更为等待 并把库移推荐的From和To赋值 + /// 判断是不是在最底层 如果不是则把状态变更为待库移 并把库移推荐的From和To赋值 /// /// /// @@ -620,7 +622,7 @@ public class KittingIssueJobAppService //await _expectOutAppService.RemoveByNumberAsync(kittingIssueJob.Number).ConfigureAwait(false); - await KittingIssueRequestAppService.UpdateStatusCompletedAsync(kittingIssueJob.KittingRequestNumber) + await KittingIssueRequestAppService.UpdateStatusCompletedAsync(kittingIssueJob.KittingRequestNumber,kittingIssueJob.Number) .ConfigureAwait(false); await Task.CompletedTask.ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs index 140635d3e..a3e9b1b2f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs @@ -219,7 +219,9 @@ public class SparePartIssueJobAppService issueJobDetail.HandledToQty += issueJobDetailDto.HandledToQty; issueJobDetail.HandledFromQty += issueJobDetailDto.HandledFromQty; sparePartIssueJob.Details = new EditableList { issueJobDetail }; - + sparePartIssueJob.CompleteUserId = _currentUser.Id; + sparePartIssueJob.CompleteUserName = _currentUser.Name; + sparePartIssueJob.CompleteTime = DateTime.Now; if (sparePartIssueJob.EnumIssueSendType == EnumIssueSendType.BoxQtyType) //按箱叫料 因为任务只有1箱 所以可以直接完成 { if (issueJobDetailDto.RecommendToPackingCode != issueJobDetailDto.HandledToPackingCode) @@ -491,7 +493,7 @@ public class SparePartIssueJobAppService } /// - /// 判断是不是在最底层 如果不是则把状态变更为等待 并把库移推荐的From和To赋值 + /// 判断是不是在最底层 如果不是则把状态变更为待库移 并把库移推荐的From和To赋值 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs index e63bb5d0e..2cab78db8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs @@ -253,6 +253,8 @@ public class PurchaseReceiptJobAppService : newDetail.HandledQty = detail.HandledQty > 0 ? input.ToQty : 0; //newDetail.CreationTime = CommonHelper.CurTime; newDetail.PurchaseReceiptInspectStatus = EnumPurchaseReceiptInspect.INSP; //俊城沟通,改成 未扫描 + decimal maxPoLine = job.Details.Max(itm => itm.PoLine.TryToDecimalZero()); + newDetail.PoLine = (maxPoLine + 1).ToString(); //行号自增 job.Details.Add(newDetail); //修改源箱 detail.RecommendQty = input.FromQty - input.ToQty; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InventoryInitialNotes/InventoryInitialNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InventoryInitialNotes/InventoryInitialNoteAppService.cs index bbcb5d6be..fe2416939 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InventoryInitialNotes/InventoryInitialNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InventoryInitialNotes/InventoryInitialNoteAppService.cs @@ -61,6 +61,10 @@ public class InventoryInitialNoteAppService : request.ActiveDate = DateTime.Now; foreach (var detail in request.Details) { + if (string.IsNullOrEmpty(detail.PackingCode)) + { + detail.PackingCode = ""; + } var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); CheckItemBasic(itemBasicDto, detail.ItemCode); detail.ItemDesc1 = itemBasicDto.Desc1; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAppService.cs index d8632cf2a..e9a98ff40 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAppService.cs @@ -118,8 +118,15 @@ public class PurchaseReceiptNoteAppService : public virtual async Task> GetDetailListByNoReceiptAsync(Guid id) { var entity = await _repository.FindAsync(p => p.Id == id).ConfigureAwait(false); - return ObjectMapper.Map, List>(entity.Details + + var purchaseReceiptNoteDetailDTOS= ObjectMapper.Map, List>(entity.Details .Where(p => p.PurchaseReceiptInspectStatus == EnumPurchaseReceiptInspect.NORECEIPT).ToList()); + foreach(var item in purchaseReceiptNoteDetailDTOS) + { + item.Qty = item.RecommendQty - item.HandledQty; + } + + return purchaseReceiptNoteDetailDTOS; } /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs index 2146cf2d2..c4d6b30fe 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs @@ -72,6 +72,14 @@ IItemBasicAppService itemBasicAppService) { throw new UserFriendlyException($"同一发货类型、发货时间、客户的存在相同零件号!"); } + if(request.DeliverRequestType== EnumDeliverRequestType.FIS) + { + request.DeliverPlanNumber = request.Details.First().MesDeliveryNo; + } + else if (request.DeliverRequestType == EnumDeliverRequestType.Normal) + { + request.DeliverPlanNumber = request.Details.First().MesDeliveryPlan; + } foreach (var detail in request.Details) { var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/InjectionPlanRequests/InjectionPlanRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/InjectionPlanRequests/InjectionPlanRequestAppService.cs index 876d6017b..dc0c2b592 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/InjectionPlanRequests/InjectionPlanRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/InjectionPlanRequests/InjectionPlanRequestAppService.cs @@ -5,7 +5,10 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.Domain.Repositories; +using Win_in.Sfs.Basedata.Application; using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Basedata.Domain; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -30,7 +33,8 @@ public class InjectionPlanRequestAppService : SfsStoreRequestAppServiceBase CreateAsync(InjectionPlanRequestEditInput input) + [HttpPost("create-and-handle")] + public async Task CreateAndHandleAsync(InjectionPlanRequestEditInput input) { foreach (var item in input.Details) { @@ -67,53 +75,56 @@ public class InjectionPlanRequestAppService : SfsStoreRequestAppServiceBase p.PartCode == detailInput.ItemCode && p.LocationCode == detailInput.ToLocationCode).ConfigureAwait(false); + + detailInput.ProdLine = productionLineDto.Code; detailInput.ToLocationArea = toLocationDto.AreaCode; detailInput.ToLocationGroup = toLocationDto.LocationGroupCode; detailInput.ToWarehouseCode = toLocationDto.WarehouseCode; - detailInput.ProdLine = detailInput.ToLocationCode; - detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode; + detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode; detailInput.ItemDesc1 = itemBasicDto.Desc1; detailInput.ItemDesc2 = itemBasicDto.Desc2; detailInput.ItemName = itemBasicDto.Name; - - var itemContainerDto = await _itemContainerAppService.GetListByItemCodeAsync(detailInput.ItemCode) - .ConfigureAwait(false); - if (itemContainerDto.Count > 0) - { - detailInput.Uom = itemContainerDto[0].BasicUom; - detailInput.Qty = itemContainerDto[0].Qty; - detailInput.StdPackQty = itemBasicDto.StdPackQty; - } - else - { - detailInput.Uom = itemBasicDto.BasicUom; - detailInput.StdPackQty = itemBasicDto.StdPackQty; - detailInput.Qty = itemBasicDto.StdPackQty; - } - - detailInput.Status = EnumStatus.Open; - - //因为是刚创建的 所以发料数一定是0 + detailInput.StdPackQty = itemBasicDto.StdPackQty; + + //var itemContainerDto = await _itemContainerAppService.GetByItemCodeAsync(detailInput.ItemCode).ConfigureAwait(false); + + //if (itemContainerDto != null) + //{ + // detailInput.Uom = itemContainerDto.BasicUom; + // detailInput.Qty = itemContainerDto.Qty; + // detailInput.BoxQty = itemContainerDto.Qty; + // detailInput.StdPackQty = itemBasicDto.StdPackQty; + //} + //else + //{ + // throw new UserFriendlyException($"ERP料号【{detailInput.ItemCode}】未配置收容数"); + //} + + detailInput.Status = EnumStatus.Open; detailInput.IssuedQty = 0; + detailInput.RecommendType = EnumRecommendType.None; } await SetRequestAutoPropertiesAsync(input).ConfigureAwait(false); - var entity = ObjectMapper.Map(input); - - var result = await _injectionRequestManager.CreateByNumberAsync(entity).ConfigureAwait(false); + var entity = ObjectMapper.Map(input); + var coatingIssueRequestDto = await _coatingIssueRequestAppService.CreateAndHandleAsync(entity).ConfigureAwait(false); - var dto = ObjectMapper.Map(result); - - return dto; + return coatingIssueRequestDto; } /// @@ -131,17 +142,7 @@ public class InjectionPlanRequestAppService : SfsStoreRequestAppServiceBase CreateAndHandleAsync(InjectionPlanRequestEditInput input) - { - var injectionRequestDto = await CreateAsync(input).ConfigureAwait(false); - - await HandleAsync(injectionRequestDto.Id).ConfigureAwait(false); - - return injectionRequestDto; - } + } /// /// 获取物品类别列表 @@ -210,5 +211,13 @@ public class InjectionPlanRequestAppService : SfsStoreRequestAppServiceBase() + ; + + CreateMap() + ; + CreateMap() .ReverseMap(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/AssembleIssueRequests/AssembleIssueRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/AssembleIssueRequests/AssembleIssueRequestAppService.cs index 971031b3b..ed7876029 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/AssembleIssueRequests/AssembleIssueRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/AssembleIssueRequests/AssembleIssueRequestAppService.cs @@ -188,7 +188,7 @@ public class AssembleIssueRequestAppService : SfsStoreRequestAppServiceBase p.JobStatus == EnumJobStatus.Open || p.JobStatus == EnumJobStatus.Doing || - p.JobStatus == EnumJobStatus.Partial)) + p.JobStatus == EnumJobStatus.Partial||p.JobStatus== EnumJobStatus.Wait)) { return; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/CoatingIssueRequests/CoatingIssueRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/CoatingIssueRequests/CoatingIssueRequestAppService.cs index 714651fd8..2bfd6d037 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/CoatingIssueRequests/CoatingIssueRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/CoatingIssueRequests/CoatingIssueRequestAppService.cs @@ -188,7 +188,7 @@ public class CoatingIssueRequestAppService : SfsStoreRequestAppServiceBase p.JobStatus == EnumJobStatus.Open || p.JobStatus == EnumJobStatus.Doing || - p.JobStatus == EnumJobStatus.Partial)) + p.JobStatus == EnumJobStatus.Partial|| p.JobStatus== EnumJobStatus.Wait)) { return; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/InjectionIssueRequests/InjectionIssueRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/InjectionIssueRequests/InjectionIssueRequestAppService.cs index d5736b7ba..51efdbeae 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/InjectionIssueRequests/InjectionIssueRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/InjectionIssueRequests/InjectionIssueRequestAppService.cs @@ -188,7 +188,7 @@ public class InjectionIssueRequestAppService : SfsStoreRequestAppServiceBase p.JobStatus == EnumJobStatus.Open || p.JobStatus == EnumJobStatus.Doing || - p.JobStatus == EnumJobStatus.Partial)) + p.JobStatus == EnumJobStatus.Partial|| p.JobStatus== EnumJobStatus.Wait)) { return; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/KittingIssueRequests/KittingIssueRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/KittingIssueRequests/KittingIssueRequestAppService.cs index 9b062b596..f34043c7a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/KittingIssueRequests/KittingIssueRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/KittingIssueRequests/KittingIssueRequestAppService.cs @@ -179,11 +179,11 @@ public class KittingIssueRequestAppService : SfsStoreRequestAppServiceBase p.Number == number).ConfigureAwait(false); - await UpdateKittingIssueRequestDetailQtyAsync(kittingIssueRequest, new EditableList()) + await UpdateKittingIssueRequestDetailQtyAsync(kittingIssueRequest, jobNumber, new EditableList()) .ConfigureAwait(false); var kittingIssueJobDtos = await _kittingIssueJobAppService.GetByRequestNumberAsync(kittingIssueRequest.Number) @@ -191,7 +191,7 @@ public class KittingIssueRequestAppService : SfsStoreRequestAppServiceBase p.JobStatus == EnumJobStatus.Open || p.JobStatus == EnumJobStatus.Doing || - p.JobStatus == EnumJobStatus.Partial)) + p.JobStatus == EnumJobStatus.Partial||p.JobStatus== EnumJobStatus.Wait)) { return; } @@ -281,7 +281,7 @@ public class KittingIssueRequestAppService : SfsStoreRequestAppServiceBase /// /// - private async Task UpdateKittingIssueRequestDetailQtyAsync(KittingIssueRequest kittingIssueRequest, + private async Task UpdateKittingIssueRequestDetailQtyAsync(KittingIssueRequest kittingIssueRequest,string jobNumber, List addKittingIssueJobDtos) { //原有任务 @@ -322,7 +322,7 @@ public class KittingIssueRequestAppService : SfsStoreRequestAppServiceBase p.JobStatus == EnumJobStatus.Open || p.JobStatus == EnumJobStatus.Doing || - p.JobStatus == EnumJobStatus.Partial)) + p.JobStatus == EnumJobStatus.Partial|| p.JobStatus== EnumJobStatus.Wait)) { return; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs index 9a9df2444..37ac275c1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs @@ -30,16 +30,20 @@ public class PurchaseReceiptRequestAppService : { private readonly IPurchaseReceiptRequestManager _purchaseReceiptRequestManager; + private readonly ISplitPackingRecAppService _splitPackingRecAppService; + + public PurchaseReceiptRequestAppService( IPurchaseReceiptRequestRepository repository, - IPurchaseReceiptRequestManager purchaseReceiptRequestManager - ) : base(repository, purchaseReceiptRequestManager) + IPurchaseReceiptRequestManager purchaseReceiptRequestManager, + ISplitPackingRecAppService splitPackingRecAppService) : base(repository, purchaseReceiptRequestManager) { _purchaseReceiptRequestManager = purchaseReceiptRequestManager; base.CreatePolicyName = PurchaseReceiptRequestPermissions.Create; base.UpdatePolicyName = PurchaseReceiptRequestPermissions.Update; base.DeletePolicyName = PurchaseReceiptRequestPermissions.Delete; + _splitPackingRecAppService = splitPackingRecAppService; } #region 东阳使用 @@ -88,6 +92,39 @@ public class PurchaseReceiptRequestAppService : } } + /// + /// 【获取】【收货记录详情】根据 物品 传入箱码的根箱码 + /// + /// + /// + /// + [HttpGet("detail-by-item-and-rootpacking")] + public virtual async Task GetDetailByItemAndRootPackingAsync(string itemCode, + string packingCode) + { + var topObj = await _splitPackingRecAppService.GetTopPackingCode(packingCode).ConfigureAwait(false); + if (topObj == null || string.IsNullOrEmpty(topObj.ToTopPackingCode)) + { + throw new UserFriendlyException($"根据箱码{packingCode}到拆箱记录表中没有取到顶级箱码!"); + } + + var entitysList = (await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode && y.PackingCode == topObj.ToTopPackingCode), true).ConfigureAwait(false)); + + if (entitysList != null && entitysList.Any()) + { + var entity = entitysList.FirstOrDefault(); + + var detail = entity.Details.FirstOrDefault(y => y.ItemCode == itemCode && y.PackingCode == topObj.ToTopPackingCode); + + var dto = ObjectMapper.Map(detail); + + return dto; + } + else + { + throw new UserFriendlyException("未在到货通知中找到该箱码信息"); + } + } #endregion @@ -190,6 +227,8 @@ public class PurchaseReceiptRequestAppService : newDetail.PackingCode = input.ToPackingCode; newDetail.Qty = input.ToQty; //newDetail.CreationTime = CommonHelper.CurTime; + decimal maxPoLine = request.Details.Max(itm => itm.PoLine.TryToDecimalZero()); + newDetail.PoLine = (maxPoLine + 1).ToString(); //行号自增 request.Details.Add(newDetail); //修改源箱 detail.Qty = input.FromQty - input.ToQty; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestAppService.cs index 456fb114a..93267adb9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestAppService.cs @@ -313,10 +313,10 @@ public class TransferLibRequestAppService : SfsStoreRequestAppServiceBase #endregion - [HttpPost("Cancel-By-CallRequestNumber")] - public async Task CancelByCallRequestNumberAsync(string callRequestNumber) + [HttpPost("Cancel-By-CallJobNumber")] + public async Task CancelByCallRequestNumberAsync(string callJobNumber) { - var list=await _repository.GetListAsync(p=>p.CallRequestNumber==callRequestNumber).ConfigureAwait(false); + var list=await _repository.GetListAsync(p=>p.CallJobNumber== callJobNumber).ConfigureAwait(false); foreach (var request in list) { await CancelAsync(request.Id).ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs index 547f89df8..eb36c9763 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs @@ -32,6 +32,9 @@ public enum EnumExchangeDataType //回收料调整 Item_Transform = 28, //半成品上架 - SemiPutaway = 29, - + SemiPutaway = 29, + /// + /// 客户退货 + /// + CustomerReturn = 30, } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/DeliverJobs/DeliverJob.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/DeliverJobs/DeliverJob.cs index d2bcfcdff..6b12186c6 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/DeliverJobs/DeliverJob.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/DeliverJobs/DeliverJob.cs @@ -41,6 +41,10 @@ public class DeliverJob : SfsJobAggregateRootBase /// [IgnoreUpdate] public string DeliverPlanNumber { get; set; } + /// + /// Mes车牌号 + /// + public string MesTruckNumber { get; set; } /// /// 任务明细 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/DeliverNotes/DeliverNote.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/DeliverNotes/DeliverNote.cs index 6a60d8f74..4745cf029 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/DeliverNotes/DeliverNote.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/DeliverNotes/DeliverNote.cs @@ -60,7 +60,10 @@ public class DeliverNote : SfsStoreAggregateRootBase, IHasJob /// [Display(Name = "打印次数")] public int CountPrint { get; set; } - + /// + /// Mes车牌号 + /// + public string MesTruckNumber { get; set; } /// /// 明细列表 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/DeliverRequests/DeliverRequest.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/DeliverRequests/DeliverRequest.cs index a7d5cd8d1..e722611d3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/DeliverRequests/DeliverRequest.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/DeliverRequests/DeliverRequest.cs @@ -20,7 +20,6 @@ public class DeliverRequest : SfsStoreRequestAggregateRootBase /// 发货计划单号 /// - [IgnoreUpdate] public string DeliverPlanNumber { get; set; } /// @@ -39,6 +38,10 @@ public class DeliverRequest : SfsStoreRequestAggregateRootBase public EnumDeliverRequestType DeliverRequestType { get; set; } + /// + /// Mes车牌号 + /// + public string MesTruckNumber { get; set; } /// /// 任务明细 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/DeliverJobs/DeliverJobDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/DeliverJobs/DeliverJobDbContextModelCreatingExtensions.cs index 7c20cec54..17e1ccf96 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/DeliverJobs/DeliverJobDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/DeliverJobs/DeliverJobDbContextModelCreatingExtensions.cs @@ -24,6 +24,7 @@ public static class DeliverJobDbContextModelCreatingExtensions b.Property(q => q.DeliverRequestNumber).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.CustomerCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.CustomerAddressCode).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.MesTruckNumber).HasMaxLength(SfsPropertyConst.CodeLength); //Relations b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); //Indexes diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/DeliverNotes/DeliverNoteDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/DeliverNotes/DeliverNoteDbContextModelCreatingExtensions.cs index 5d71253f9..cb2807abb 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/DeliverNotes/DeliverNoteDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/DeliverNotes/DeliverNoteDbContextModelCreatingExtensions.cs @@ -22,7 +22,7 @@ public static class DeliverNoteDbContextModelCreatingExtensions b.Property(q => q.CustomerCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.CustomerAddressCode).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.DeliverRequestType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); - + b.Property(q => q.MesTruckNumber).HasMaxLength(SfsPropertyConst.CodeLength); //Relations b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/DeliverRequests/DeliverRequestDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/DeliverRequests/DeliverRequestDbContextModelCreatingExtensions.cs index b6530b9ff..97fe98634 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/DeliverRequests/DeliverRequestDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/DeliverRequests/DeliverRequestDbContextModelCreatingExtensions.cs @@ -24,7 +24,7 @@ public static class DeliverRequestDbContextModelCreatingExtensions b.Property(q => q.DeliverRequestType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); b.Property(q => q.DeliverPlanNumber).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.RequestStatus).IsRequired().HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); - + b.Property(q => q.MesTruckNumber).HasMaxLength(SfsPropertyConst.CodeLength); //Relations b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/CustomerProductionReturnNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/CustomerProductionReturnNoteAutoMapperProfile.cs index eaa70bea5..8e479aad1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/CustomerProductionReturnNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/CustomerProductionReturnNoteAutoMapperProfile.cs @@ -43,6 +43,12 @@ public partial class StoreEventAutoMapperProfile : Profile CreateMap() .ReverseMap(); CreateMap(); + + CreateMap() + .ForMember(x => x.Customer, y => y.MapFrom(d => d.CustomerCode)) + ; + + CreateMap(); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ThirdLocationRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ThirdLocationRequestAutoMapperProfile.cs index 7d5596c11..e11dbb928 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ThirdLocationRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ThirdLocationRequestAutoMapperProfile.cs @@ -97,6 +97,9 @@ public partial class StoreEventAutoMapperProfile : Profile .Ignore(x => x.HandledSupplierBatch) .Ignore(x => x.RecommendFromLocationCode) .Ignore(x => x.RecommendLot) + + .Ignore(x => x.PositionCode) + .Ignore(x => x.RecommendType) .IgnoreIHasRecommendAndHandledFrom(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CustomerProductionReturnNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CustomerProductionReturnNoteEventHandler.cs new file mode 100644 index 000000000..b2d8cae6c --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CustomerProductionReturnNoteEventHandler.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.EventBus; +using Volo.Abp.Uow; +using Win_in.Sfs.Shared.Event; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Event.DataExchanges; + +public class CustomerProductionReturnNoteEventHandler + : StoreDataExchangeEventHandlerBase + , ILocalEventHandler> + , ILocalEventHandler>> + +{ + private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.CustomerReturn; + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + await AddExchangeDataAsync(entity).ConfigureAwait(false); + } + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entities = eventData.Entity; + await AddExchangeDataAsync(entities).ConfigureAwait(false); + } + + protected override async Task AddExchangeDataAsync(List entities) + { + var dtos = ObjectMapper.Map, List>(entities); + var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, dtos).ConfigureAwait(false); + await AddManyAsync(exchangeData).ConfigureAwait(false); + } + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/AssembleIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/AssembleIssueNoteEventHandler.cs index 841238749..bfe440962 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/AssembleIssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/AssembleIssueNoteEventHandler.cs @@ -24,15 +24,15 @@ public class AssembleIssueNoteEventHandler [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { - var entity = eventData.Entity; - await AddExchangeDataAsync(entity).ConfigureAwait(false); + //var entity = eventData.Entity; + //await AddExchangeDataAsync(entity).ConfigureAwait(false); } [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) { - var entities = eventData.Entity; - await AddExchangeDataAsync(entities).ConfigureAwait(false); + //var entities = eventData.Entity; + //await AddExchangeDataAsync(entities).ConfigureAwait(false); } protected override async Task AddExchangeDataAsync(List entities) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/CoatingIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/CoatingIssueNoteEventHandler.cs index 698184507..498316eb2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/CoatingIssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/CoatingIssueNoteEventHandler.cs @@ -24,15 +24,15 @@ public class CoatingIssueNoteEventHandler [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { - var entity = eventData.Entity; - await AddExchangeDataAsync(entity).ConfigureAwait(false); + //var entity = eventData.Entity; + //await AddExchangeDataAsync(entity).ConfigureAwait(false); } [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) { - var entities = eventData.Entity; - await AddExchangeDataAsync(entities).ConfigureAwait(false); + //var entities = eventData.Entity; + //await AddExchangeDataAsync(entities).ConfigureAwait(false); } protected override async Task AddExchangeDataAsync(List entities) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/InjectionIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/InjectionIssueNoteEventHandler.cs index 022d1d360..ca8cbca9d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/InjectionIssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/InjectionIssueNoteEventHandler.cs @@ -24,15 +24,15 @@ public class InjectionIssueNoteEventHandler [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { - var entity = eventData.Entity; - await AddExchangeDataAsync(entity).ConfigureAwait(false); + //var entity = eventData.Entity; + //await AddExchangeDataAsync(entity).ConfigureAwait(false); } [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) { - var entities = eventData.Entity; - await AddExchangeDataAsync(entities).ConfigureAwait(false); + //var entities = eventData.Entity; + //await AddExchangeDataAsync(entities).ConfigureAwait(false); } protected override async Task AddExchangeDataAsync(List entities) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/SparePartIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/SparePartIssueNoteEventHandler.cs index bc03a1ed9..ffdbd21dc 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/SparePartIssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/Issue/SparePartIssueNoteEventHandler.cs @@ -24,15 +24,15 @@ public class SparePartIssueNoteEventHandler [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { - var entity = eventData.Entity; - await AddExchangeDataAsync(entity).ConfigureAwait(false); + //var entity = eventData.Entity; + //await AddExchangeDataAsync(entity).ConfigureAwait(false); } [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) { - var entities = eventData.Entity; - await AddExchangeDataAsync(entities).ConfigureAwait(false); + //var entities = eventData.Entity; + //await AddExchangeDataAsync(entities).ConfigureAwait(false); } protected override async Task AddExchangeDataAsync(List entities) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PurchaseReturnNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PurchaseReturnNoteEventHandler.cs index 5446353da..8c3a164bb 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PurchaseReturnNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PurchaseReturnNoteEventHandler.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using Volo.Abp.EventBus; using Volo.Abp.Uow; +using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -16,7 +17,11 @@ public class PurchaseReturnNoteEventHandler , ILocalEventHandler>> { private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.PurchaseReturn; - + private readonly ISplitPackingRecAppService _splitPackingRecAppService; + public PurchaseReturnNoteEventHandler(ISplitPackingRecAppService splitPackingRecAppService) + { + _splitPackingRecAppService = splitPackingRecAppService; + } [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { @@ -37,6 +42,12 @@ public class PurchaseReturnNoteEventHandler foreach (var detail in dtos.SelectMany(dto => dto.Details)) { await detail.TrySetLocationAsync(LocationAclService, detail.LocationCode).ConfigureAwait(false); + var packingCode=await _splitPackingRecAppService.GetTopPackingCode(detail.PackingCode).ConfigureAwait(false); + detail.Remark = string.Empty; + if (!string.IsNullOrEmpty(packingCode?.FromTopPackingCode) &&detail.PackingCode!= packingCode?.FromTopPackingCode) + { + detail.Remark=packingCode.FromTopPackingCode; + } } //2023-12-6上架前退货不传入接口 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PutawayNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PutawayNoteEventHandler.cs index d0369abea..7ae2b3117 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PutawayNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PutawayNoteEventHandler.cs @@ -2,8 +2,10 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.VisualBasic; +using Org.BouncyCastle.Crypto.Prng.Drbg; using Volo.Abp.EventBus; using Volo.Abp.Uow; +using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -17,7 +19,11 @@ public class PutawayNoteEventHandler , ILocalEventHandler>> { private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.Putaway; - + private readonly ISplitPackingRecAppService _splitPackingRecAppService; + public PutawayNoteEventHandler(ISplitPackingRecAppService splitPackingRecAppService) + { + _splitPackingRecAppService=splitPackingRecAppService; + } [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { @@ -41,7 +47,16 @@ public class PutawayNoteEventHandler } //采购上架 - var putaway_Purchase = entities.Where(p => p.Type == EnumPutawayType.PurchasePutaway).ToList(); + var putaway_Purchase = dtos.Where(p => p.Type == EnumPutawayType.PurchasePutaway).ToList(); + foreach (var item in putaway_Purchase.SelectMany(dto => dto.Details)) + { + var packingCode = await _splitPackingRecAppService.GetTopPackingCode(item.ToPackingCode).ConfigureAwait(false); + item.Remark = string.Empty; + if (!string.IsNullOrEmpty(packingCode?.FromTopPackingCode) && item.ToPackingCode != packingCode?.FromTopPackingCode) + { + item.Remark = packingCode.FromTopPackingCode; + } + } if (putaway_Purchase.Count > 0) { var exchangeData_Purchase = @@ -56,10 +71,10 @@ public class PutawayNoteEventHandler } //半成品上架 - var putaway_Semi_temp = entities.Where(p => p.Type == EnumPutawayType.SemiPutaway).ToList(); + var putaway_Semi_temp = dtos.Where(p => p.Type == EnumPutawayType.SemiPutaway).ToList(); foreach (var putawayNoteTemp in putaway_Semi_temp) { - var putawayNoteDetails= new List(); + var putawayNoteDetails= new List(); foreach (var putawayNoteDetail_temp in putawayNoteTemp.Details) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionPlanJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionPlanJobEventHandler.cs index 18713e89c..62a3a90bd 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionPlanJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionPlanJobEventHandler.cs @@ -202,7 +202,7 @@ public class InjectionPlanJobEventHandler : } /// - /// 判断是不是在最底层 如果不是则把状态变更为等待 + /// 判断是不是在最底层 如果不是则把状态变更为待库移 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/AssembleIssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/AssembleIssueJobEventHandler.cs index c2ac70396..5e75579cd 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/AssembleIssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/AssembleIssueJobEventHandler.cs @@ -214,7 +214,7 @@ public class AssembleIssueJobEventHandler : } /// - /// 判断是不是在最底层 如果不是则把状态变更为等待 + /// 判断是不是在最底层 如果不是则把状态变更为待库移 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/CoatingIssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/CoatingIssueJobEventHandler.cs index 7a445f6db..2d209e177 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/CoatingIssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/CoatingIssueJobEventHandler.cs @@ -214,7 +214,7 @@ public class CoatingIssueJobEventHandler : } /// - /// 判断是不是在最底层 如果不是则把状态变更为等待 + /// 判断是不是在最底层 如果不是则把状态变更为待库移 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/InjectionIssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/InjectionIssueJobEventHandler.cs index b6ccf84ca..2bf12c343 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/InjectionIssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/InjectionIssueJobEventHandler.cs @@ -213,7 +213,7 @@ public class InjectionIssueJobEventHandler : } /// - /// 判断是不是在最底层 如果不是则把状态变更为等待 + /// 判断是不是在最底层 如果不是则把状态变更为待库移 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/KittingIssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/KittingIssueJobEventHandler.cs index b2f17565f..8cd66b5d1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/KittingIssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/KittingIssueJobEventHandler.cs @@ -213,7 +213,7 @@ public class KittingIssueJobEventHandler : } /// - /// 判断是不是在最底层 如果不是则把状态变更为等待 + /// 判断是不是在最底层 如果不是则把状态变更为待库移 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/SparePartIssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/SparePartIssueJobEventHandler.cs index b46ef749b..5a3086456 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/SparePartIssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/SparePartIssueJobEventHandler.cs @@ -213,7 +213,7 @@ public class SparePartIssueJobEventHandler : } /// - /// 判断是不是在最底层 如果不是则把状态变更为等待 + /// 判断是不是在最底层 如果不是则把状态变更为待库移 /// /// ///