From a97e24fa2bc8b6ecafebf40101774d8c4131f7d3 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Thu, 11 Apr 2024 13:50:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=8F=8D=E5=B0=84?= =?UTF-8?q?=E5=BA=93=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InjectionJobs/InjectionJobAppService.cs | 7 +++++++ .../Jobs/TransferLibJobs/TransferLibJobAppService.cs | 12 ++++++++++-- .../Jobs/InjectionJobEventHandler.cs | 7 +------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs index ca7c0baab..966ee52d1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs @@ -158,4 +158,11 @@ public class InjectionJobAppService { throw new NotImplementedException(); } + + [HttpPost("test")] + public virtual async Task Test() + { + Console.WriteLine("FuAZCZXVZXVXZVZ"); + await Task.CompletedTask; + } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs index 0767c0097..16fc0eacd 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs @@ -3,6 +3,7 @@ using System.Reflection; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -18,10 +19,12 @@ public class TransferLibJobAppService : SfsJobAppServiceBase, ITransferLibJobAppService { + private readonly IServiceProvider _serviceProvider; + public TransferLibJobAppService( - ITransferLibJobRepository repository, ITransferLibJobManager TransferLibJobManager - ) : base(repository, TransferLibJobManager) + ITransferLibJobRepository repository, ITransferLibJobManager TransferLibJobManager, IServiceProvider serviceProvider) : base(repository, TransferLibJobManager) { + _serviceProvider = serviceProvider; } /// @@ -32,6 +35,11 @@ public class TransferLibJobAppService /// public override async Task CompleteAsync(Guid id, TransferLibJobDTO dto) { + var str = "Win_in.Sfs.Wms.Store.Application.InjectionJobAppService"; + var implementation=_serviceProvider.GetService(Type.GetType("Win_in.Sfs.Wms.Store.Application.InjectionJobAppService")); + MethodInfo methodInfo=implementation.GetType().GetMethod("Test"); + methodInfo.Invoke(implementation, null); + string methodPrefix = "TransferLibJobAppService.CompleteAsync - "; if (dto.CallServerName.IsNullOrEmpty()) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionJobEventHandler.cs index 4ea37c26b..71bd14211 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionJobEventHandler.cs @@ -167,11 +167,6 @@ public class InjectionJobEventHandler : detailInput.FromLocationErpCode= detail.RecommendFromLocationErpCode; detailInput.FromWarehouseCode= detail.RecommendFromWarehouseCode; - detailInput.ToLocationCode = "YL1"; - detailInput.ToLocationErpCode = "YL1"; - detailInput.ToLocationGroup = "YL1"; - detailInput.ToLocationArea = "YL1"; - detailInput.FromLot = detail.RecommendLot; detailInput.ToLot=detail.RecommendLot; detailInput.Qty=detail.RecommendQty; @@ -179,7 +174,7 @@ public class InjectionJobEventHandler : detailInput.Uom=detail.Uom; detailInput.SupplierBatch = detail.RecommendSupplierBatch; - await _transferLibRequestAppService.CreateAsync(input); + await _transferLibRequestAppService.CreateAsync(input).ConfigureAwait(false); } } From 8f5d372050e8941686f51611a68e857732d54b80 Mon Sep 17 00:00:00 2001 From: zhaoxinyu <89237069@qq.com> Date: Thu, 11 Apr 2024 13:51:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9MES=E5=86=BB=E7=BB=93\?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomerItems/ICustomerItemAppService.cs | 5 +- .../CustomerItems/CustomerItemAppService.cs | 12 +++- .../Enums/Inventory/EnumTransSubType.cs | 7 +-- .../Enums/Inventory/EnumTransType.cs | 16 +++++ .../Enums/Store/Statuses/EnumRequestStatus.cs | 22 +++---- .../Store/Types/EnumInjectionModelType.cs | 35 +++++++++++ .../DTOs/CustomerProductionReturnNoteDTO.cs | 8 +++ .../CustomerProductionReturnNoteEditInput.cs | 8 +++ ...CustomerProductionReturnNoteImportInput.cs | 8 +++ .../Notes/MesNotes/DTOs/MesNoteDTO.cs | 3 +- .../Notes/MesNotes/Inputs/MesNoteEditInput.cs | 8 ++- .../DTOs/InjectioModelPlanDTO.cs | 17 +++++ .../Inputs/InjectioModelPlanEditInput.cs | 15 +++++ .../CustomerProductionReturnNoteAppService.cs | 62 +++++++++++++++++-- .../Notes/MesNotes/MesNoteAppService.cs | 36 +++++------ .../InjectioModelPlanAppService.cs | 13 +--- .../CustomerProductionReturnNote.cs | 8 +++ .../Notes/MesNotes/MesNote.cs | 5 +- .../InjectioModelPlans/InjectioModelPlan.cs | 13 ++++ ...urnNoteDbContextModelCreatingExtensions.cs | 2 + ...delPlanDbContextModelCreatingExtensions.cs | 3 + .../Transactions/MesNoteEventHandler.cs | 57 ++++++++--------- 22 files changed, 280 insertions(+), 83 deletions(-) create mode 100644 be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Types/EnumInjectionModelType.cs diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/CustomerItems/ICustomerItemAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/CustomerItems/ICustomerItemAppService.cs index edfc88258..ef35579a0 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/CustomerItems/ICustomerItemAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/CustomerItems/ICustomerItemAppService.cs @@ -1,3 +1,6 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Win_in.Sfs.Basedata.Domain; using Win_in.Sfs.Shared.Application.Contracts; namespace Win_in.Sfs.Basedata.Application.Contracts; @@ -7,5 +10,5 @@ public interface ICustomerItemAppService , ISfsUpsertAppService { - + Task> GetListByPartsAsync(List inputs); } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAppService.cs index fc5c14b67..ce6566077 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAppService.cs @@ -1,8 +1,11 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Linq.Dynamic.Core; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Volo.Abp.Caching; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Domain; @@ -36,7 +39,6 @@ public class CustomerItemAppService : SfsBaseDataAppServiceBase(input); @@ -48,4 +50,12 @@ public class CustomerItemAppService : SfsBaseDataAppServiceBase> GetListByPartsAsync(List inputs) + { + return await _repository.WithDetails().Where(p => inputs.Contains(p.ItemCode)).ToListAsync().ConfigureAwait(false); + } + + + } diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs index 1748f2fcf..d29f32c3a 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs @@ -214,12 +214,7 @@ public enum EnumTransSubType /// [Display(Name = "导入盘点计划")] ExcelInCountPlan = 6002, - [Display(Name = "MES冻结")] - MesFreeze = 10001, - [Display(Name = "MES解冻")] - MesUnFreeze = 10002, - [Display(Name = "MES不合格")] - MesUnQualified = 10003 + 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 567d76ef7..e3f777c6d 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 @@ -160,5 +160,21 @@ public enum EnumTransType + /// + /// MES冻结 + /// + [Display(Name = "Mes冻结")] + MesFreezed= 40, + + /// + /// MES冻结 + /// + [Display(Name = "Mes解冻")] + MesUnFreezed = 41, + + + + + } diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Statuses/EnumRequestStatus.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Statuses/EnumRequestStatus.cs index 397d7354c..24d08bde0 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Statuses/EnumRequestStatus.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Statuses/EnumRequestStatus.cs @@ -65,17 +65,17 @@ public enum EnumRequestStatus Partial = 9, - /// - /// 部分完成 - /// - [Display(Name = "已过时")] - Deprecated = 10, - - /// - /// 有更新 - /// - [Display(Name = "有更新")] - Updated = 10, + ///// + ///// 部分完成 + ///// + //[Display(Name = "已过时")] + //Deprecated = 11, + + ///// + ///// 有更新 + ///// + //[Display(Name = "有更新")] + //Updated = 10, diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Types/EnumInjectionModelType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Types/EnumInjectionModelType.cs new file mode 100644 index 000000000..46c97b927 --- /dev/null +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Types/EnumInjectionModelType.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; + +namespace Win_in.Sfs.Shared.Domain.Shared; + +public enum EnumInjectionModelStatus +{ + /// + /// 有更新 + /// + [Display(Name = "有更新")] + Updated = 10, + + + /// + /// 执行中 + /// + [Display(Name = "执行中")] + Handling = 5, +/// +/// 部分完成 +/// + [Display(Name = "已过时")] + Deprecated = 11, + /// + /// 已完成 + /// + [Display(Name = "已完成")] + Completed = 6, + + /// + /// 新增 + /// + [Display(Name = "新增")] + New = 1 +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/DTOs/CustomerProductionReturnNoteDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/DTOs/CustomerProductionReturnNoteDTO.cs index a2bdba696..eccb90065 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/DTOs/CustomerProductionReturnNoteDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/DTOs/CustomerProductionReturnNoteDTO.cs @@ -15,6 +15,14 @@ public class CustomerProductionReturnNoteDTO : SfsStoreDTOBase + ///客户编码 + /// + [Display(Name = "客户编码")] + public string CustomerCode { get; set; } + + /// /// 退料单号 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/Inputs/CustomerProductionReturnNoteEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/Inputs/CustomerProductionReturnNoteEditInput.cs index 55b2ebbfa..68d41a658 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/Inputs/CustomerProductionReturnNoteEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/Inputs/CustomerProductionReturnNoteEditInput.cs @@ -23,6 +23,14 @@ public class CustomerProductionReturnNoteEditInput : SfsStoreCreateOrUpdateInput [Display(Name = "退料时间")] public DateTime ReturnTime { get; set; } + + /// + ///客户编码 + /// + [Display(Name = "客户编码")] + public string CustomerCode { get; set; } + + /// /// 退料申请单号 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/Inputs/CustomerProductionReturnNoteImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/Inputs/CustomerProductionReturnNoteImportInput.cs index 7a307acb5..328f28171 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/Inputs/CustomerProductionReturnNoteImportInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/Inputs/CustomerProductionReturnNoteImportInput.cs @@ -26,6 +26,14 @@ public class CustomerProductionReturnNoteImportInput : SfsStoreImportInputBase [Display(Name = "退料单号")] public string ProductionReturnRequestNumber { get; set; } + + /// + ///客户编码 + /// + [Display(Name = "客户编码")] + public string CustomerCode { get; set; } + + /// /// 采购订单号 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/DTOs/MesNoteDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/DTOs/MesNoteDTO.cs index 24ca29a90..2279a842b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/DTOs/MesNoteDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/DTOs/MesNoteDTO.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -12,7 +13,7 @@ public class MesNoteDTO : SfsStoreDTOBase, IHasNumber public string JobNumber { get; set; } /// - /// 类型 + /// Mes类型(40-冻结、41-解冻 ) /// [Display(Name = "类型")] public string Type { get; set; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/Inputs/MesNoteEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/Inputs/MesNoteEditInput.cs index ee271489d..e853ee4cb 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/Inputs/MesNoteEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/Inputs/MesNoteEditInput.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared.Enums.Store.Types; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -28,7 +29,7 @@ public class MesNoteEditInput : SfsStoreCreateOrUpdateInputBase public string MesRequestNumber { get; set; } /// - /// 报废类型 + /// Mes类型(40-冻结、41-解冻 ) /// [Display(Name = "类型")] public string Type { get; set; } @@ -38,5 +39,10 @@ public class MesNoteEditInput : SfsStoreCreateOrUpdateInputBase /// [Display(Name = "明细列表")] public List Details { get; set; } + + + + + #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/InjectioModelPlans/DTOs/InjectioModelPlanDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/InjectioModelPlans/DTOs/InjectioModelPlanDTO.cs index a1ef41be7..0c404f3a1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/InjectioModelPlans/DTOs/InjectioModelPlanDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/InjectioModelPlans/DTOs/InjectioModelPlanDTO.cs @@ -2,6 +2,7 @@ using System; using System.ComponentModel.DataAnnotations; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -10,6 +11,22 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts; /// public class InjectioModelPlanDTO : SfsStoreRequestDTOBase, IHasNumber { + + + [ExporterHeader(DisplayName = "状态")] + public EnumInjectionModelStatus Status { get; set; } + + + [ExporterHeader(DisplayName = "版本号")] + /// + /// 版本号 + /// + public string Version { get; set; } + + + + + /// /// 车间 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/InjectioModelPlans/Inputs/InjectioModelPlanEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/InjectioModelPlans/Inputs/InjectioModelPlanEditInput.cs index b73556b51..5642d7c2f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/InjectioModelPlans/Inputs/InjectioModelPlanEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/InjectioModelPlans/Inputs/InjectioModelPlanEditInput.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -67,6 +69,19 @@ public class InjectioModelPlanEditInput : SfsStoreRequestCreateOrUpdateInputBase [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] public string Number { get; set; } + [Display(Name = "状态")] + public EnumInjectionModelStatus Status { get; set; } + + + [Display(Name = "版本号")] + /// + /// 版本号 + /// + public string Version { get; set; } + + + + /// /// 明细列表 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs index 18cd05414..3a3ea6b86 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs @@ -1,6 +1,10 @@ +using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Omu.ValueInjecter; +using Volo.Abp; +using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -20,11 +24,21 @@ public class CustomerProductionReturnNoteAppService : { private readonly ICustomerProductionReturnNoteManager _CustomerProductionReturnNoteManager; + + private readonly ICustomerItemAppService _customerItemAppService; + public CustomerProductionReturnNoteAppService( ICustomerProductionReturnNoteRepository repository , ICustomerProductionReturnNoteManager CustomerProductionReturnNoteManager + , ICustomerItemAppService customerItemAppService ) : base(repository) { + + + _customerItemAppService = customerItemAppService; + + + _CustomerProductionReturnNoteManager = CustomerProductionReturnNoteManager; } @@ -37,16 +51,56 @@ public class CustomerProductionReturnNoteAppService : //[Authorize(CustomerProductionReturnNotePermissions.Create)] public override async Task CreateAsync(CustomerProductionReturnNoteEditInput input) { - var entity = ObjectMapper.Map(input); + var entity = ObjectMapper.Map(input); + + + var parts= input.Details.Select(itm => itm.ItemCode).Distinct(); + + var custitmDetail = await _customerItemAppService.GetListByPartsAsync(parts.ToList()).ConfigureAwait(false); + + var checkPart= from itm in entity.Details.ToList() + join itm1 in custitmDetail + on itm.ItemCode equals itm1.ItemCode + into temp + from tm in temp.DefaultIfEmpty() + where tm == null + select itm; + + var partErr = checkPart.Select(x => x.ItemCode).Distinct().ToList(); + if (partErr.Count > 0) + { + throw new UserFriendlyException($"客户零件{string.Join(",",partErr)}不在零件关系表中,不能退货!"); + } + var checkCustomer= from itm in entity.Details.ToList() + join itm1 in custitmDetail + on itm.ItemCode equals itm1.ItemCode + select itm1; + + var custErr= checkCustomer.Select(x => x.CustomerCode).Distinct().ToList(); + if (custErr.Count > 1) + { + throw new UserFriendlyException($"提交客户退货零件{string.Join(",", custErr)}存在多个客户,不能退货!"); + } + if(entity.Details.Count>0) + { + entity.CustomerCode = checkCustomer.FirstOrDefault().CustomerCode; + } foreach (var itm in entity.Details) { - itm.FromLocationCode = "HOLD"; + itm.FromLocationCode = "OK"; itm.FromStatus = EnumInventoryStatus.OK; itm.ToStatus=EnumInventoryStatus.OK; + itm.FromLocationArea = "OK"; + itm.FromLocationErpCode= "OK"; + itm.FromLot = "NONE"; + itm.FromPackingCode = "NONE"; + itm.FromWarehouseCode = "OK"; + itm.FromLocationGroup = "OK"; + itm.FromContainerCode = "OK"; + itm.ToContainerCode =string.IsNullOrEmpty(itm.ToContainerCode)? "OK": itm.ToContainerCode; + itm.ToWarehouseCode= string.IsNullOrEmpty(itm.ToWarehouseCode)? "OK": itm.ToContainerCode; } - - await _CustomerProductionReturnNoteManager.CreateAsync(entity).ConfigureAwait(false); var dto = ObjectMapper.Map(entity); return dto; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/MesNotes/MesNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/MesNotes/MesNoteAppService.cs index 66fcf43a8..6761b6b39 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/MesNotes/MesNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/MesNotes/MesNoteAppService.cs @@ -83,24 +83,24 @@ public class MesNoteAppService : #region 添加校验 - //RecommendBalanceRequestInput rInput = new RecommendBalanceRequestInput(); - //rInput.ItemCode = detail.ItemCode; - //rInput.Locations = new List() { detail.FromLocationCode }; - //rInput.Qty = detail.Qty; - //rInput.Statuses = new List { EnumInventoryStatus.OK }; - //var balanceLst = await _balanceAppService.GetRecommendBalancesByLocationsAsync(rInput).ConfigureAwait(false); - //var first = balanceLst.FirstOrDefault(); - //if (first != null) - //{ - // if (detail.Qty <= first.Qty) - // { - // throw new UserFriendlyException($"库存数量不足"); - // } - //} - //else - //{ - // throw new UserFriendlyException($"库存数量不足"); - //} + RecommendBalanceRequestInput rInput = new RecommendBalanceRequestInput(); + rInput.ItemCode = detail.ItemCode; + rInput.Locations = new List() { detail.FromLocationCode }; + rInput.Qty = detail.Qty; + rInput.Statuses = new List { EnumInventoryStatus.OK }; + var balanceLst = await _balanceAppService.GetRecommendBalancesByLocationsAsync(rInput).ConfigureAwait(false); + var first = balanceLst.FirstOrDefault(); + if (first != null) + { + if (detail.Qty <= first.Qty) + { + throw new UserFriendlyException($"库存数量不足"); + } + } + else + { + throw new UserFriendlyException($"库存数量不足"); + } #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/InjectioModelPlans/InjectioModelPlanAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/InjectioModelPlans/InjectioModelPlanAppService.cs index 60b7e77a5..0301212a3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/InjectioModelPlans/InjectioModelPlanAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/InjectioModelPlans/InjectioModelPlanAppService.cs @@ -29,24 +29,17 @@ public class InjectioModelPlanAppService : { private readonly IBomAppService _bomAppService; private readonly IInjectioModelPlanManager _InjectioModelPlanManager; - //private readonly IWorkShopAppService _workShopApp; -/* private readonly IProductionLineAppService _productionLineApp*/ - //private readonly ITeamAppService _teamApp; - //private readonly IShiftAppService _shiftApp; + public InjectioModelPlanAppService(IInjectioModelPlanRepository repository, IInjectioModelPlanManager InjectioModelPlanManager , IWorkShopAppService workShopApp , IBomAppService bomAppService , IProductionLineAppService productionLineApp - //, ITeamAppService teamApp - //, IShiftAppService shiftApp + ) : base(repository, InjectioModelPlanManager) { - //_workShopApp = workShopApp; - //_productionLineApp = productionLineApp; - //_teamApp = teamApp; - //_shiftApp = shiftApp; + _InjectioModelPlanManager = InjectioModelPlanManager; _bomAppService=bomAppService; base.CreatePolicyName = InjectioModelPlanPermissions.Create; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNote.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNote.cs index fccb34c56..19dc19e07 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNote.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNote.cs @@ -20,6 +20,14 @@ public class CustomerProductionReturnNote : SfsStoreAggregateRootBase public string ProductionReturnRequestNumber { get; set; } + + /// + ///客户编码 + /// + public string CustomerCode { get; set; } + + + /// /// 退料时间 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/MesNotes/MesNote.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/MesNotes/MesNote.cs index 8f08e2041..646af7ad9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/MesNotes/MesNote.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/MesNotes/MesNote.cs @@ -1,11 +1,12 @@ using System.Collections.Generic; using Win_in.Sfs.Shared.Domain.Entities; +using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared.Enums.Store.Types; namespace Win_in.Sfs.Wms.Store.Domain; /// -/// 报废记录 +/// MES冻结记录 /// public class MesNote : SfsStoreAggregateRootBase, IHasJobNumber { @@ -22,7 +23,7 @@ public class MesNote : SfsStoreAggregateRootBase, IHasJobNumber public string MesRequestNumber { get; set; } /// - /// Mes类型 + /// Mes类型(40-冻结、41-解冻 ) /// [IgnoreUpdate] public string Type { get; set; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/InjectioModelPlans/InjectioModelPlan.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/InjectioModelPlans/InjectioModelPlan.cs index 2cdbb99ae..a90b9a1c7 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/InjectioModelPlans/InjectioModelPlan.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/InjectioModelPlans/InjectioModelPlan.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; using Win_in.Sfs.Shared.Domain.Entities; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Domain; @@ -41,6 +42,18 @@ public class InjectioModelPlan : SfsStoreRequestAggregateRootBase public DateTime PlanTime { get; set; } + /// + /// 版本号 + /// + public string Version { get; set; } + + /// + /// 状态 + /// + public EnumInjectionModelStatus Status { get; set; } + + + /// /// 明细列表 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteDbContextModelCreatingExtensions.cs index 889790ab7..c1837a8a2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteDbContextModelCreatingExtensions.cs @@ -20,6 +20,8 @@ public static class CustomerProductionReturnNoteDbContextModelCreatingExtensions b.ConfigureSfsStoreBase(); //Properties b.Property(q => q.JobNumber).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.CustomerCode).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.ProductionReturnRequestNumber).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/Plans/InjectioModelPlans/InjectioModelPlanDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Plans/InjectioModelPlans/InjectioModelPlanDbContextModelCreatingExtensions.cs index ec79d5edd..5fe030413 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Plans/InjectioModelPlans/InjectioModelPlanDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Plans/InjectioModelPlans/InjectioModelPlanDbContextModelCreatingExtensions.cs @@ -26,6 +26,9 @@ public static class InjectioModelPlanDbContextModelCreatingExtensions b.Property(q => q.PlanDate).IsRequired(); b.Property(q => q.PlanTime).IsRequired(); + + b.Property(q => q.Version).HasMaxLength(SfsPropertyConst.NameLength); + b.Property(q => q.RequestStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); //Relations diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/MesNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/MesNoteEventHandler.cs index 52ef2f6a6..ec09b362f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/MesNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/MesNoteEventHandler.cs @@ -19,7 +19,9 @@ public class MesNoteEventHandler , ILocalEventHandler>> { - private const EnumTransType TransType = EnumTransType.Scrap; + //private const EnumTransType FreezedTransType = EnumTransType.MesFreezed; + + //private const EnumTransType UnFreezedTransType = EnumTransType.MesUnFreezed; [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) @@ -52,9 +54,6 @@ public class MesNoteEventHandler //else //{ - - - var transferLogs = new List(); foreach (var MesNote in MesNotes) @@ -63,24 +62,26 @@ public class MesNoteEventHandler } await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); - var transactions = new List(); - foreach (var MesNote in MesNotes) - { - transactions.AddRange(BuildTransactions(MesNote)); - } + //var transactions = new List(); + //foreach (var MesNote in MesNotes) + //{ + // transactions.AddRange(BuildTransactions(MesNote)); + //} - await TransactionAppService.AddManyAsync(transactions).ConfigureAwait(false); + //await TransactionAppService.AddManyAsync(transactions).ConfigureAwait(false); //} } private List BuildTransferLogs(MesNote MesNote) { + var transferLogs = new List(); foreach (var detail in MesNote.Details.Where(detail => detail.Qty != 0)) { + var transferLog = ObjectMapper.Map(detail); - transferLog.TransType = TransType; - transferLog.TransSubType = Enum.Parse(MesNote.Type); + transferLog.TransType = Enum.Parse(MesNote.Type); ; + transferLog.TransSubType = EnumTransSubType.None; transferLog.Worker = MesNote.Worker; transferLog.DocNumber = MesNote.Number; transferLog.JobNumber = MesNote.JobNumber; @@ -90,24 +91,24 @@ public class MesNoteEventHandler return transferLogs; } - private List BuildTransactions(MesNote deliverNote) - { - var transactions = new List(); + //private List BuildTransactions(MesNote deliverNote) + //{ + // var transactions = new List(); - foreach (var detail in deliverNote.Details) - { - var transaction = ObjectMapper.Map(detail); - transaction.TransType = TransType; - transaction.TransInOut = EnumTransInOut.Out; - transaction.Worker = deliverNote.Worker; - transaction.DocNumber = deliverNote.Number; - transaction.JobNumber = deliverNote.JobNumber; - - transactions.Add(transaction); - } + // foreach (var detail in deliverNote.Details) + // { + // var transaction = ObjectMapper.Map(detail); + // transaction.TransType = deliverNote.Type; + // transaction.TransInOut = EnumTransInOut.Out; + // transaction.Worker = deliverNote.Worker; + // transaction.DocNumber = deliverNote.Number; + // transaction.JobNumber = deliverNote.JobNumber; - return transactions; - } + // transactions.Add(transaction); + // } + + // return transactions; + //} #endregion }