diff --git a/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml b/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml index 4adc13526..ef3bc86af 100644 --- a/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml +++ b/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.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\BaseData\ + C:\发布\WMS FileSystem net6.0 6184eab9-b44b-42fc-8cd3-e36933a3dad5 false - + \ No newline at end of file diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs index 0cfdd9257..f8ac25b4b 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs @@ -41,8 +41,21 @@ public class IssueNoteController : AbpController p.ToPackingCode = string.Empty; if(p.PositionCode.Contains('W')) { - p.RecommendType = EnumRecommendType.PositionCode; + p.RecommendType = EnumRecommendType.W; } + else if(p.PositionCode.Contains('Q')) + { + p.RecommendType = EnumRecommendType.Q; + } + else if (p.PositionCode.Contains('K')) + { + p.RecommendType = EnumRecommendType.K; + } + else + { + p.RecommendType = EnumRecommendType.None; + } + }); await _issueNoteAppService.CreateAsync(input).ConfigureAwait(false); diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/DTOs/EquipmentAreaDTO.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/DTOs/EquipmentAreaDTO.cs index f1de16b9c..e76d96af3 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/DTOs/EquipmentAreaDTO.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/DTOs/EquipmentAreaDTO.cs @@ -11,11 +11,6 @@ using System.Collections.Generic; public class EquipmentAreaDTO : SfsBaseDataDTOBase, IHasCode { - - - - - /// /// 器具编号 /// diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/DTOs/EquipmentDTO.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/DTOs/EquipmentDTO.cs index 58c7c3c04..d6b8b07b6 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/DTOs/EquipmentDTO.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/DTOs/EquipmentDTO.cs @@ -7,7 +7,7 @@ namespace Win_in.Sfs.Basedata.Application.Contracts; using System; using System.Collections.Generic; -[Display(Name = "物品基本信息")] +[Display(Name = "器具基本信息")] public class EquipmentDTO : SfsBaseDataDTOBase, IHasCode { @@ -51,4 +51,11 @@ public class EquipmentDTO : SfsBaseDataDTOBase, IHasCode [Display(Name = "创建时间")] public DateTime CreatTime { get; set; } = DateTime.Now; + + /// + /// 标包数量 + /// + [Display(Name = "标包数")] + public decimal StdQty { get; set; } + } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentEditInput.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentEditInput.cs index aedd223cd..e76aa7b41 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentEditInput.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentEditInput.cs @@ -46,7 +46,11 @@ public class EquipmentEditInput : SfsBaseDataCreateOrUpdateInputBase [Display(Name = "创建时间")] public DateTime CreatTime { get; set; }=DateTime.Now; - + /// + /// 标包数量 + /// + [Display(Name = "标包数")] + public decimal StdQty { get; set; } //#region Base ///// diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentImportInput.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentImportInput.cs index 03373df2f..747bdef64 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentImportInput.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentImportInput.cs @@ -36,11 +36,6 @@ public class EquipmentImportInput : SfsBaseDataImportInputBase [Display(Name = "状态")] public int State { get; set; } = 0; /// - /// 备注 - /// - [Display(Name = "备注")] - public string Remark { get; set; } = string.Empty; - /// /// 创建人 /// [Display(Name = "创建人")] @@ -52,5 +47,13 @@ public class EquipmentImportInput : SfsBaseDataImportInputBase [Display(Name = "创建时间")] public DateTime CreatTime { get; set; } = DateTime.Now; + /// + /// 标包数量 + /// + [Display(Name = "标包数")] + public decimal StdQty { get; set; } + + + } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/BasedataApplicationAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/BasedataApplicationAutoMapperProfile.cs index 9f75a7fb0..1372ef60a 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/BasedataApplicationAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/BasedataApplicationAutoMapperProfile.cs @@ -52,5 +52,6 @@ public partial class BasedataApplicationAutoMapperProfile : Profile EquipmentAutoMapperProfile(); SplitPackingRecAutoMapperProfile(); KittingAutoMapperProfile(); + } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAppService.cs index 6ee10fea0..a93db8119 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAppService.cs @@ -1,11 +1,13 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.IO; using System.Linq; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; @@ -15,6 +17,8 @@ using Volo.Abp.Validation; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Domain; using Win_in.Sfs.Basedata.Domain.Shared; +using Win_in.Sfs.Shared.Application.Contracts; +using Win_in.Sfs.Shared.Application.Contracts.ExportAndImport; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; @@ -29,14 +33,17 @@ public class EquipmentAppService //private readonly ItemValidator _itemValidator; private readonly IEquipmentManager _manager; private new readonly IEquipmentRepository _repository; - + private readonly IExportImportService _importService; + public EquipmentAppService( IEquipmentRepository repository, IDistributedCache cache, + IExportImportService importService, // ItemValidator itemValidator, IEquipmentManager manager) : base(repository, cache) { + _importService=importService; _repository = repository; //_itemValidator = itemValidator; _manager = manager; @@ -52,7 +59,52 @@ public class EquipmentAppService { await Task.CompletedTask.ConfigureAwait(false); } + //public override async Task ImportAsync([FromForm] SfsImportRequestInput requestInput, [Required] IFormFile file) + //{ + // List errors = new List(); + // using var ms = new MemoryStream(); + // await file.OpenReadStream().CopyToAsync(ms).ConfigureAwait(false); + // var inputFileBytes = ms.GetAllBytes(); + // var dtos=_importService.Import(inputFileBytes).ToList(); + // var list=ObjectMapper.Map, List>(dtos); + + + + + + // foreach (var itm in list) + // { + // itm.SetId(GuidGenerator.Create()); + // itm.Code = string.Format("{0}{1}", "Q", itm.Code); + + // } + + + + + // ////var bytes = result.FileContents; + // ////result.FileContents = null; + + // ////HttpContextAccessor.HttpContext.Response.Headers.AccessControlExposeHeaders = "X-Response"; + // ////HttpContextAccessor.HttpContext.Response.Headers.Add("X-Response", + // //// JsonSerializer.Serialize(new { result.ExceptionMessage, result.FileName, result.FileCode, result })); + + // ////Console.WriteLine(@"导入错误信息:" + result.ExceptionMessage); + // ////var resultAction = new TestResult(bytes, ExportImportService.ContentType) { FileDownloadName = result.FileName }; + // ////resultAction.errorNum = result.ErrorNum; + // ////resultAction.successNum = resultAction.successNum; + // //return resultAction; + + + + + + + + + // // return base.ImportAsync(requestInput, file); + //} //protected ICategoryAppService _categoryApp => LazyServiceProvider.LazyGetRequiredService(); //protected IItemCategoryAppService _itemCategoryApp => LazyServiceProvider.LazyGetRequiredService(); @@ -227,10 +279,30 @@ public class EquipmentAppService public virtual async Task UpsertAsync(EquipmentEditInput input) { var entity = ObjectMapper.Map(input); + await _repository.UpsertAsync(entity).ConfigureAwait(false); } - + [HttpPost] + [Route("")] + public override async Task CreateAsync(EquipmentEditInput input) + { + var first= _repository.WithDetails().FirstOrDefault(p => p.Code == input.Code); + if (first == null) + { + var entity = ObjectMapper.Map(input); + entity.Code = string.Format("{0}{1}", "Q", entity.Code); + entity.Model = "Q"; + + await _repository.UpsertAsync(entity).ConfigureAwait(false); + var entity1=_repository.WithDetails().FirstOrDefault(p => p.Code == input.Code); + return ObjectMapper.Map(entity1); + } + else + { + throw new UserFriendlyException($"已存在器具编号{input.Code}!"); + } + } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAreaAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAreaAutoMapperProfile.cs index 34507c831..503434c56 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAreaAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAreaAutoMapperProfile.cs @@ -19,6 +19,7 @@ public partial class BasedataApplicationAutoMapperProfile : Profile .Ignore(x => x.Remark) .Ignore(x => x.ExtraProperties) .Ignore(x => x.ConcurrencyStamp) + ; //CreateMap() diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAutoMapperProfile.cs index fec39f919..0f2899506 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAutoMapperProfile.cs @@ -19,6 +19,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile .Ignore(x => x.Remark) .Ignore(x => x.ExtraProperties) .Ignore(x => x.ConcurrencyStamp) + .ForMember(p =>p.Code, p => p.MapFrom(q =>"Q" +q.Code)) + ; //CreateMap() diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAppService.cs index 81ebf359c..33ef8b711 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAppService.cs @@ -93,25 +93,31 @@ public class KittingAppService : SfsBaseDataWithCodeAppServiceBase UpdateAsync(Guid id, KittingEditInput input) { - var detailquery = _repository.WithDetails(); - var first = detailquery.FirstOrDefault(p => p.Id == id); - if (first.Code == input.Code) - { - throw new UserFriendlyException($"已存在编码:{input.Code}的Kitting箱"); - } - var query = from itm in input.Details - join itm1 in first.Details on itm.PartCode equals itm1.PartCode - select itm; - List errors = new List(); - foreach (var itm in query.ToList()) - { - errors.Add(itm.PartCode); - } - if(errors.Count > 0) - { - throw new UserFriendlyException($"零件号${string.Join(",", errors)}已存在"); - } - return base.UpdateAsync(id, input); + //var detailquery = _repository.WithDetails(); + //var first = detailquery.FirstOrDefault(p => p.Id == id); + //var ids=input.Details.Select(p => p.Id); + //first.Details.Where(p =>ids.Contains(p.Id)); + + + + return base.UpdateAsync(id, input); + + + + + + + //var entity = ObjectMapper.Map(input); + ////entity.SetId(id); + ////entity.Code = first.Code; + //await _repository.UpsertAsync(entity).ConfigureAwait(false); + //var firstEntity = detailquery.FirstOrDefault(p => p.Id == id); + + + + //return ObjectMapper.Map(first); + + } [HttpPost("update")] @@ -133,6 +139,8 @@ public class KittingAppService : SfsBaseDataWithCodeAppServiceBase(input); await _repository.UpsertAsync(entity).ConfigureAwait(false); + + } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCode/PositionCodeAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCode/PositionCodeAppService.cs index 8f6eccad5..48117759c 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCode/PositionCodeAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCode/PositionCodeAppService.cs @@ -1,6 +1,9 @@ +using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Caching; using Volo.Abp.Uow; @@ -51,18 +54,42 @@ public class PositionCodeAppService if(input.Code.Contains('W')) { - input.Type = EnumRecommendType.PositionCode; + input.Type = EnumRecommendType.W; + } + else if (input.Code.Contains('Q')) + { + input.Type = EnumRecommendType.Q; } else if(input.Code.Contains('K')) { - input.Type = EnumRecommendType.KittingCode; + input.Type = EnumRecommendType.K; } else { - input.Type = EnumRecommendType.WareCode; + input.Type = EnumRecommendType.None; } return await base.CreateAsync(input).ConfigureAwait(false); } + + /// + /// 用来重写 导入数据时可以加工数据 + /// + /// + /// + protected override async Task> ImportProcessingEntityAsync( + Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var positionCode in addList) + { + positionCode.Code = positionCode.Type + positionCode.Code; + positionCode.CreatorId= CurrentUser.Id; + } + + return dictionary; + } + } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCode/PositionCodeAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCode/PositionCodeAutoMapperProfile.cs index 7a21ce66d..b069821b0 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCode/PositionCodeAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCode/PositionCodeAutoMapperProfile.cs @@ -22,7 +22,7 @@ public partial class BasedataApplicationAutoMapperProfile : Profile CreateMap() .Ignore(x => x.ReportStatus) - .Ignore(x => x.ReportReason); + .Ignore(x => x.ReportReason); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Win_in.Sfs.Basedata.Domain.Shared.csproj b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Win_in.Sfs.Basedata.Domain.Shared.csproj index 3221d386c..9d201acdf 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Win_in.Sfs.Basedata.Domain.Shared.csproj +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Win_in.Sfs.Basedata.Domain.Shared.csproj @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ - + diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Equipments/Equipment.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Equipments/Equipment.cs index 97fa77973..6ee992529 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Equipments/Equipment.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Equipments/Equipment.cs @@ -33,9 +33,6 @@ public class Equipment : SfsBaseDataAggregateRootBase, IHasCode /// 状态 /// public int State { get; set; } - /// - /// 备注 - /// /// /// 创建人 @@ -47,6 +44,11 @@ public class Equipment : SfsBaseDataAggregateRootBase, IHasCode /// public DateTime CreatTime { get; set; } + /// + /// 标包数量 + /// + public decimal StdQty { get; set; } + diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/PositionCode/PositionCode.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/PositionCode/PositionCode.cs index 751e5561f..8c5028cdb 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/PositionCode/PositionCode.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/PositionCode/PositionCode.cs @@ -13,8 +13,7 @@ public class PositionCode : SfsBaseDataAggregateRootBase, IHasCode /// /// 位置代码 /// - [Display(Name = "位置代码")] - [IgnoreUpdate] + [Display(Name = "位置代码")] public string Code { get; set; } /// /// 物料号 diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Kittings/KittingDbContextModelCreatingExtensions.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Kittings/KittingDbContextModelCreatingExtensions.cs index c1f8ac6b8..8c4d1a813 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Kittings/KittingDbContextModelCreatingExtensions.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Kittings/KittingDbContextModelCreatingExtensions.cs @@ -43,7 +43,7 @@ public static class KittingDbContextModelCreatingExtensions b.Property(p => p.Desc1).HasMaxLength(SfsPropertyConst.DescLength); //Properties - b.Property(q => q.Desc2).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.Desc2).HasMaxLength(SfsPropertyConst.CodeLength); //Relations b.Property(q => q.MasterId).IsRequired(); //Indexes diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Kittings/KittingEfCoreRepository.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Kittings/KittingEfCoreRepository.cs index 6687685bd..f4dba107c 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Kittings/KittingEfCoreRepository.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Kittings/KittingEfCoreRepository.cs @@ -15,7 +15,7 @@ public class KittingEfCoreRepository : SfsBaseDataEfCoreRepositoryBase(); var detail=DbContext.Set(); @@ -72,7 +72,7 @@ public class KittingEfCoreRepository : SfsBaseDataEfCoreRepositoryBase public enum EnumRecommendType { + /// + /// 空枚举 + /// + None = 0, + /// /// 位置码 /// [Display(Name = "位置码")] - PositionCode = 1, + W = 1, /// /// 器具码 /// [Display(Name = "器具码")] - WareCode = 2, + Q = 2, /// /// Kitting箱码 /// [Display(Name = "Kitting箱码")] - KittingCode = 3, + K = 3 } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/DTOs/EquipmentRecordDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/DTOs/EquipmentRecordDTO.cs new file mode 100644 index 000000000..bba6be6c3 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/DTOs/EquipmentRecordDTO.cs @@ -0,0 +1,53 @@ +using System; +using System.ComponentModel; +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; +[Display(Name = "器具操作")] +public class EquipmentRecordDTO : SfsBasicDTOBase +{ + /// + /// 器具编码 + /// + [Display(Name = "器具编码")] + public string EqptCode { get; set; } + /// + /// 条码编号 + /// + [Display(Name = "条码编号")] + public string BarCode { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string PartCode { get; set; } + /// + /// 批次 + /// + [Display(Name = "批次")] + public string Batch { get; set; } + /// + /// 库位 + /// + [Display(Name = "库位")] + public string LocCode { get; set; } + /// + /// 数量 + /// + [Display(Name = "数量")] + public decimal Qty { get; set; } + /// + /// 状态 + /// + [Display(Name = "状态")] + public int State { get; set; } + /// + /// 记录类型 + /// + [Display(Name = "记录类型")] + public int Type { get; set; } + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/EquipmentRecordPermissions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/EquipmentRecordPermissions.cs new file mode 100644 index 000000000..5a8acb04a --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/EquipmentRecordPermissions.cs @@ -0,0 +1,22 @@ +using Volo.Abp.Authorization.Permissions; +using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Equipments; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public static class EquipmentRecordPermissions +{ + + public const string Default = StorePermissions.GroupName + "." + nameof(PurchaseOrder); + public const string Create = Default + "." + StorePermissions.CreateStr; + public const string Update = Default + "." + StorePermissions.UpdateStr; + public const string Delete = Default + "." + StorePermissions.DeleteStr; + + public static void AddEquipmentRecordPermission(this PermissionGroupDefinition permissionGroup) + { + var purchaseOrderPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(EquipmentRecord))); + purchaseOrderPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); + purchaseOrderPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); + purchaseOrderPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/IEquipmentRecordAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/IEquipmentRecordAppService.cs new file mode 100644 index 000000000..53043298c --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/IEquipmentRecordAppService.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Win_in.Sfs.Shared.Application.Contracts; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public interface IEquipmentRecordAppService + : + ISfsStoreMasterAppServiceBase, + ISfsCheckStatusAppService + , ISfsUpsertAppService +{ + + ///// + ///// 打开订单明细 + ///// + ///// + //Task OpenDetailAsync(Guid id, Guid detailId); + + ///// + ///// 关闭订单明细 + ///// + ///// + //Task CloseDetailAsync(Guid id, Guid detailId); + + ///// + ///// 更新订单明细 + ///// + ///// + ///// + ///// + //Task UpdateDetailsAsync(string number,List input); + + ///// + ///// 【批量创建】到货通知 (收货单) + ///// + ///// + ///// + //Task> CreateManyAsync(List inputs); + + //Task> GetListBySupplierCodeAsync(string supplierCode, string itemCode); + //Task> GetNoPoBillList(List poBillNo); + //Task CreateOrUpdateAsync(PurchaseOrderEditInput input); +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/Inputs/EquipmentRecordEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/Inputs/EquipmentRecordEditInput.cs new file mode 100644 index 000000000..de51993b0 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/Inputs/EquipmentRecordEditInput.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; +[Display(Name = "器具操作")] +public class EquipmentRecordEditInput + : SfsStoreCreateOrUpdateInputBase +{ + /// + /// 器具编码 + /// + [Display(Name = "器具编码")] + public string EqptCode { get; set; } + /// + /// 条码编号 + /// + [Display(Name = "条码编号")] + public string BarCode { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string PartCode { get; set; } + /// + /// 批次 + /// + [Display(Name = "批次")] + public string Batch { get; set; } + /// + /// 库位 + /// + [Display(Name = "库位")] + public string LocCode { get; set; } + /// + /// 数量 + /// + [Display(Name = "数量")] + public decimal Qty { get; set; } + /// + /// 状态 + /// + [Display(Name = "状态")] + public int State { get; set; } + /// + /// 记录类型 + /// + [Display(Name = "记录类型")] + public int Type { get; set; } + + +} + + diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/Inputs/EquipmentRecordImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/Inputs/EquipmentRecordImportInput.cs new file mode 100644 index 000000000..82901aeda --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Equipments/Inputs/EquipmentRecordImportInput.cs @@ -0,0 +1,53 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Application.Contracts; +using Win_in.Sfs.Shared.Application.Contracts.ExportAndImport; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +[Display(Name = "器具操作")] +public class EquipmentRecordImportInput : SfsStoreImportInputBase +{ + /// + /// 器具编码 + /// + [Display(Name = "器具编码")] + public string EqptCode { get; set; } + /// + /// 条码编号 + /// + [Display(Name = "条码编号")] + public string BarCode { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string PartCode { get; set; } + /// + /// 批次 + /// + [Display(Name = "批次")] + public string Batch { get; set; } + /// + /// 库位 + /// + [Display(Name = "库位")] + public string LocCode { get; set; } + /// + /// 数量 + /// + [Display(Name = "数量")] + public decimal Qty { get; set; } + /// + /// 状态 + /// + [Display(Name = "状态")] + public int State { get; set; } + /// + /// 记录类型 + /// + [Display(Name = "记录类型")] + public int Type { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/ProductRecyclePermissions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/ProductRecyclePermissions.cs new file mode 100644 index 000000000..ca438e6ff --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/ProductRecyclePermissions.cs @@ -0,0 +1,20 @@ +using Volo.Abp.Authorization.Permissions; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public static class ProductRecyclePermissions +{ + public const string Default = StorePermissions.GroupName + "." + nameof(ProductRecycleJob); + public const string Create = Default + "." + StorePermissions.CreateStr; + public const string Update = Default + "." + StorePermissions.UpdateStr; + public const string Delete = Default + "." + StorePermissions.DeleteStr; + + public static void AddProductRecycleJobPermission(this PermissionGroupDefinition permissionGroup) + { + var productRecycleJobPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(ProductRecycleJob))); + productRecycleJobPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); + productRecycleJobPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); + productRecycleJobPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj index a14d0abb2..7430f5c7e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj @@ -42,6 +42,8 @@ + + diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Equipments/EquipmentRecordAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Equipments/EquipmentRecordAppService.cs new file mode 100644 index 000000000..56a246d0c --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Equipments/EquipmentRecordAppService.cs @@ -0,0 +1,204 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Castle.Components.DictionaryAdapter; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Volo.Abp; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.ObjectMapping; +using Win_in.Sfs.Shared.Application; +using Win_in.Sfs.Shared.Application.Contracts; +using Win_in.Sfs.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Domain.Shared; +using Win_in.Sfs.Wms.Store.Equipments; + +namespace Win_in.Sfs.Wms.Store.Application; + +[Authorize] +[Route($"{StoreConsts.RootPath}EquipmentRecord")] +public class EquipmentRecordAppService + : SfsStoreAppServiceBase + , IEquipmentRecordAppService + +{ + private readonly IEquipmentRecordManager _manager; + private readonly IEquipmentRecordRepository _repository; + + public EquipmentRecordAppService( + IEquipmentRecordRepository repository, IEquipmentRecordManager manager + ):base(repository) + { + base.CreatePolicyName = EquipmentRecordPermissions.Create; + base.UpdatePolicyName = EquipmentRecordPermissions.Update; + base.DeletePolicyName = EquipmentRecordPermissions.Delete; + + _manager = manager; + _repository = repository; + } + /// + /// 没用 + /// + /// + /// + /// + /// + [HttpPost("addDetail")] + public Task AddDetailListAsync(Guid id, List list) + { + throw new NotImplementedException(); + } + /// + /// 没用 + /// + [HttpPost("check")] + public Task CheckStatusAsync(string number) + { + throw new NotImplementedException(); + } + /// + /// 没用 + /// + [HttpPost("getlist")] + public Task> GetDetailListAsync(Guid id, SfsStoreRequestInputBase requestInput) + { + throw new NotImplementedException(); + } + /// + /// 没用 + /// + [HttpPost("updateDetail")] + public Task UpdateDetailAsync(Guid id, Guid detailId, EquipmentRecordDTO updateDTO) + { + throw new NotImplementedException(); + } + /// + /// 没用 + /// + [HttpPost("upsertAsync")] + public Task UpsertAsync(EquipmentRecordEditInput input) + { + throw new NotImplementedException(); + } + /// + /// 没用 + /// + [HttpPost("withDetil")] + Task ISfsReadOnlyWithDetailsAppService.GetDetailAsync(Guid id, Guid detailId) + { + throw new NotImplementedException(); + } + + + + //[HttpGet("by-batchsize")] + //public virtual async Task> GetToBeProcessedListAsync(int batchSize) + //{ + // var entities = await _manager.GetToBeProcessedListAsync(batchSize).ConfigureAwait(false); + // var dtos = ObjectMapper.Map, List>(entities); + // return dtos; + //} + + //[HttpPost("re-send-by-id/{id}")] + //public virtual async Task ReSendByNumberAsync(Guid id) + //{ + // var EquipmentRecordOld = await _repository.GetAsync(id).ConfigureAwait(false); + // if (EquipmentRecordOld == null) + // { + // throw new UserFriendlyException($"未找到ID为【{id.ToString()}】的数据"); + // } + + // EquipmentRecordOld.Status = EnumEquipmentRecordStatus.Error; + + // var EquipmentRecordNew = new ExchangeData() + // { + // DataAction = exchangeDataOld.DataAction, + // DataContent = exchangeDataOld.DataContent, + // DataIdentityCode = exchangeDataOld.DataIdentityCode, + // DataType = exchangeDataOld.DataType, + // DestinationSystem = exchangeDataOld.DestinationSystem, + // EffectiveDate = exchangeDataOld.EffectiveDate, + // Remark = exchangeDataOld.Remark, + // SourceSystem = exchangeDataOld.SourceSystem, + // WriteTime = DateTime.Now, + // Writer = null, + // }; + // var entityNew= await _repository.InsertAsync(exchangeDataNew).ConfigureAwait(false); + + // exchangeDataOld.Remark = $"在【{DateTime.Now}】时,重新生成了新的接口数据:ID为【{entityNew.Id}】"; + // await _repository.UpdateAsync(exchangeDataOld).ConfigureAwait(false); + + // return new ExchangeDataDTO() { Id = entityNew.Id }; + //} + + //[HttpPost("by-batchsize-post")] + //public virtual async Task> GetToBeProcessedListPostAsync(int batchSize) + //{ + // var resultList=new List(); + + // var entities = await + // (await _repository.GetDbSetAsync().ConfigureAwait(false)) + // .Where(p => p.Status == EnumExchangeDataStatus.Unread) + // .OrderBy(p => p.TyrpNumber) + // .Take(batchSize) + // .ToListAsync().ConfigureAwait(false); + + // foreach (var entity in entities) + // { + // entity.Status = EnumExchangeDataStatus.Success; + // entity.ReadTime = Clock.Now; + // entity.Reader = "DataExchange.Agent"; + // resultList.Add(await _repository.UpdateAsync(entity).ConfigureAwait(false)); + // } + + // var dtos = ObjectMapper.Map, List>(resultList); + // return dtos; + //} + + //[HttpPost("by-batchsize-only-read")] + //public virtual async Task> GetToBeProcessedListOnlyReadAsync(int batchSize) + //{ + // var entities = await + // (await _repository.GetDbSetAsync().ConfigureAwait(false)) + // .Where(p => p.Status == EnumExchangeDataStatus.Unread) + // .OrderBy(p => p.TyrpNumber) + // .Take(batchSize) + // .ToListAsync().ConfigureAwait(false); + + // var dtos = ObjectMapper.Map, List>(entities); + // return dtos; + //} + + //[HttpPost("update-status-by-id-list")] + //public virtual async Task> UpdateStatusByIdListAsync(List list) + //{ + // List listExchangeDatas = new EditableList(); + // var resultList = new List(); + + // foreach (var id in list) + // { + // listExchangeDatas.Add(await _repository.GetAsync(id).ConfigureAwait(false)); + // } + + // listExchangeDatas.ForEach(p => + // { + // p.Status = EnumExchangeDataStatus.Success; + // p.ReadTime = Clock.Now; + // p.Reader = "DataExchange.Agent"; + // }); + + // foreach (var entity in listExchangeDatas) + // { + // resultList.Add(await _repository.UpdateAsync(entity).ConfigureAwait(false)); + // } + + // var dtos = ObjectMapper.Map, List>(resultList); + // return dtos; + //} +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Equipments/EquipmentRecordAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Equipments/EquipmentRecordAutoMapperProfile.cs new file mode 100644 index 000000000..bbffa0718 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Equipments/EquipmentRecordAutoMapperProfile.cs @@ -0,0 +1,43 @@ +using AutoMapper; +using Volo.Abp.AutoMapper; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Basedata.Domain; +using Win_in.Sfs.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Equipments; + +namespace Win_in.Sfs.Wms.Store.Application; + +public partial class StoreApplicationAutoMapperProfile : Profile +{ + private void EquipmentRecordAutoMapperProfile() + { + CreateMap() + .ReverseMap(); + // CreateMap() + // .IgnoreAuditedObjectProperties() + // .Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id) + // ; + // CreateMap() + // .IgnoreAuditedObjectProperties() + // .Ignore(x => x.Id) ; + // ; + + // CreateMap() + // .IgnoreAuditedObjectProperties() + // .Ignore(x => x.TenantId) + // //.Ignore(x => x.Remark) + // .Ignore(x => x.ExtraProperties) + // .Ignore(x => x.ConcurrencyStamp) + // ; + + // CreateMap() + // .Ignore(x => x.ReportStatus) + // .Ignore(x => x.ReportReason) + // ; + + // CreateMap() + //; + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs index 209abd419..64d689dbc 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs @@ -214,9 +214,21 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase + /// 器具编码 + /// + public string EqptCode { get; set; } + /// + /// 条码编号 + /// + public string BarCode { get; set; } + /// + /// 零件号 + /// + public string PartCode { get; set; } + /// + /// 批次 + /// + public string Batch { get; set; } + /// + /// 库位 + /// + public string LocCode { get; set; } + /// + /// 数量 + /// + public decimal Qty { get; set; } + /// + /// 状态 + /// + public int State { get; set; } + /// + /// 记录类型 + /// + public int Type { get; set;} + + + + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Equipments/EquipmentRecordDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Equipments/EquipmentRecordDetail.cs new file mode 100644 index 000000000..61a8ce19f --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Equipments/EquipmentRecordDetail.cs @@ -0,0 +1,112 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public class EquipmentRecordDetail : SfsStoreDetailWithQtyEntityBase +//, IHasSupplierPack +{ + ///// + ///// 订单行 + ///// + //public string PoLine { get; set; } + + ///// + ///// 供应商计量单位 + ///// + //public string SupplierPackUom { get; set; } + + ///// + ///// 供应商计量单位 + ///// + //public decimal SupplierPackQty { get; set; } + + ///// + ///// 转换率 + ///// + //public decimal ConvertRate { get; set; } + + ///// + ///// 是否寄存订单 + ///// + //public bool IsConsignment { get; set; } + + ///// + ///// 订单行状态 0:无效1:有效 + ///// + //public EnumOrderStatus LineStatus { get; set; } + + ///// + ///// ERP库位 + ///// + //public string LocationErpCode { get; set; } + + ///// + ///// 项目编号 + ///// + //public string ProjectCode { get; set; } + + ///// + ///// 已发货数量 + ///// + //public decimal ShippedQty { get; set; } + + ///// + ///// 已收货数量 + ///// + //public decimal ReceivedQty { get; set; } + + ///// + ///// 已退货数量 + ///// + //public decimal ReturnedQty { get; set; } + + ///// + ///// 已上架数量 + ///// + //public decimal PutAwayQty { get; set; } + + ///// + ///// 筹措员代码 + ///// + //[Display(Name = "明细-筹措员代码")] + //public string PlanUserCode { get; set; } + + ///// + ///// 生产批次 + ///// + //[Display(Name = "明细-生产批次")] + //public string Lot { get; set; } + + ///// + ///// 要求到货时间 + ///// + //[Display(Name = "明细-要求到货时间")] + //public DateTime PlanArriveDate { get; set; } + + ///// + ///// 明细-类型 暂定:备件是B 辅材是F 生产为空 + ///// + //[Display(Name = "明细-类型")] + //public string Ctype { get; set; } + + ///// + ///// 生产时间 + ///// + //[Display(Name = "明细-生产时间")] + //public DateTime ProduceDate { get; set; } + + ///// + ///// 过期时间 + ///// + //[Display(Name = "明细-过期时间")] + //public DateTime ExpireDate { get; set; } + + ///// + ///// 订单备注 + ///// + //[Display(Name = "明细-订单备注")] + //public string OrderRemark { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Equipments/EquipmentRecordManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Equipments/EquipmentRecordManager.cs new file mode 100644 index 000000000..2bdf03217 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Equipments/EquipmentRecordManager.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Domain.Services; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.Store.Equipments; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public class EquipmentRecordManager : DomainService, IEquipmentRecordManager +{ + private readonly IEquipmentRecordRepository _repository; + //private readonly IPurchaseReceiptNoteManager _purchaseReceiptNoteManager; + //private readonly ISupplierAppService _supplierApp; + //private readonly IWarehouseAppService _warehouseApp; + + public EquipmentRecordManager(IEquipmentRecordRepository repository + //, IPurchaseReceiptNoteManager purchaseReceiptNoteManager + //, ISupplierAppService supplierApp + // , IWarehouseAppService warehouseApp + ) + { + _repository = repository; + //_purchaseReceiptNoteManager = purchaseReceiptNoteManager; + // _supplierApp = supplierApp; + // _warehouseApp = warehouseApp; + } + /// + ///// 打开订单明细 + ///// + ///// + //public virtual async Task CheckIsCloseAsync(string number,string supplierCode, string itemCode) + //{ + // bool result = false; + // var entitys = await _repository.GetListAsync(p =>p.Number==number && p.Details.Any(y => y.ItemCode == itemCode&&y.LineStatus== EnumOrderStatus.Close) && p.SupplierCode == supplierCode, true).ConfigureAwait(false); + // if (entitys.Count!=0) result = true; + // return result; + //} + ///// + ///// 打开订单明细 + ///// + ///// + //public virtual async Task OpenDetailAsync(Guid id, Guid detailId) + //{ + // var entity = await Repository.GetAsync(id).ConfigureAwait(false); + // Check.NotNull(entity, EntityClassName); + // await entity.OpenDetailAsync(detailId).ConfigureAwait(false); + //} + + ///// + ///// 关闭订单明细 + ///// + ///// + //public virtual async Task CloseDetailAsync(Guid id, Guid detailId) + //{ + // var entity = await Repository.GetAsync(id).ConfigureAwait(false); + // Check.NotNull(entity, EntityClassName); + // await entity.CloseDetailAsync(detailId).ConfigureAwait(false); + //} + + //public override async Task CreateAsync(PurchaseOrder purchaseOrder) + //{ + // //接收到新的采购订单时,更新无PO收货单的PoNumber + // //await _purchaseReceiptNoteManager.AppendPoNumberAsync(purchaseOrder).ConfigureAwait(false); + // purchaseOrder.SetIdAndNumberWithDetails(GuidGenerator, purchaseOrder.Number); + // //不要用base.create 要不会把number覆盖 + // purchaseOrder = await Repository.InsertAsync(purchaseOrder).ConfigureAwait(false); + // await PublishCreatedAsync(purchaseOrder).ConfigureAwait(false); + // return purchaseOrder; + + //} + + ///// + ///// 执行导入 + ///// + //public virtual async Task ImportDataAsync(List mergeEntities, List deleteEntities = null) + //{ + // //if (deleteEntities != null && deleteEntities.Count > 0) + // //{ + // // await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false); + // //} + + // //foreach (var entity in mergeEntities) + // //{ + // // entity.SetIdAndNumberWithDetails(GuidGenerator, await GenerateNumberAsync(nameof(PurchaseOrder), entity.OrderDate).ConfigureAwait(false)); + // //} + + // //await _repository.BulkMergeAsync(mergeEntities).ConfigureAwait(false); + + // //var insertDetails = new List(); + + // //foreach (var item in mergeEntities) + // //{ + // // await SetDetailAsync(item.Details).ConfigureAwait(false); + + // // insertDetails.AddRange(item.Details); + // //} + + // // await _repository.BulkInsertAsync(insertDetails).ConfigureAwait(false); + + //} + + public Task ImportDataAsync(List entities, List deleteEntities = null) + { + throw new NotImplementedException(); + } + + private async Task SetDetailAsync(List details) + { + //foreach (var detail in details) + //{ + // var item = await ItemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + // Check.NotNull(item, "物品代码", $"物品 {detail.ItemCode} 不存在"); + + // if (item != null) + // { + // detail.ItemName = item.Name; + // detail.ItemDesc1 = item.Desc1; + // detail.ItemDesc2 = item.Desc2; + // } + //} + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Equipments/IEquipmentRecordManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Equipments/IEquipmentRecordManager.cs new file mode 100644 index 000000000..b3cfa93e3 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Equipments/IEquipmentRecordManager.cs @@ -0,0 +1,13 @@ +using System; +using System.Threading.Tasks; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Wms.Store.Equipments; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public interface IEquipmentRecordManager :IBulkImportService +{ + //Task OpenDetailAsync(Guid id, Guid detailId); + //Task CloseDetailAsync(Guid id, Guid detailId); + //Task CheckIsCloseAsync(string number, string supplierCode, string itemCode); +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Equipments/IEquipmentRecordRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Equipments/IEquipmentRecordRepository.cs new file mode 100644 index 000000000..07d9b3e91 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Equipments/IEquipmentRecordRepository.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Wms.Store.Equipments; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public interface IEquipmentRecordRepository : ISfsStoreRepositoryBase, ISfsBulkRepositoryBase +{ + Task UpsertAsync(EquipmentRecord newData); +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/IProductRecycleJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/IProductRecycleJobManager.cs new file mode 100644 index 000000000..1efc5bb08 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/IProductRecycleJobManager.cs @@ -0,0 +1,10 @@ +using System; +using System.Linq.Expressions; +using System.Threading.Tasks; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public interface IProductRecycleJobManager : IJobManager +{ + Task GetAsync(Expression> expression); +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/IProductRecycleJobRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/IProductRecycleJobRepository.cs new file mode 100644 index 000000000..3aeb5085e --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/IProductRecycleJobRepository.cs @@ -0,0 +1,6 @@ +namespace Win_in.Sfs.Wms.Store.Domain; + +public interface IProductRecycleJobRepository : ISfsJobRepositoryBase +{ + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleExtension.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleExtension.cs new file mode 100644 index 000000000..d57cac32a --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleExtension.cs @@ -0,0 +1,21 @@ +using Volo.Abp.Timing; +using Win_in.Sfs.Shared.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public static class ProductRecycleExtension +{ + public static ProductRecycleJob SetWorkGroup(this ProductRecycleJob job, string warehouseCode, string workGroupCode) + { + job.WorkGroupCode = workGroupCode; + job.WarehouseCode = warehouseCode; + return job; + } + + public static ProductRecycleJob SetPriority(this ProductRecycleJob job, IClock clock) + { + job.Priority = PriorityHelper.GetPriority(clock); + job.PriorityIncrement = 1; + return job; + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJob.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJob.cs new file mode 100644 index 000000000..99c3ebc7c --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJob.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Threading.Tasks; +using Win_in.Sfs.Shared.Domain.Entities; + +namespace Win_in.Sfs.Wms.Store.Domain; + +/// +/// 产品退拆任务 +/// +[Display(Name = "产品退拆任务")] +public class ProductRecycleJob : SfsJobAggregateRootBase +{ + /// + /// 车间 + /// + [Display(Name = "车间")] + public string Workshop { get; set; } + + /// + /// 班次 + /// + [Display(Name = "班次")] + public string Shift { get; set; } + + /// + /// 明细列表 + /// + [IgnoreUpdate] + public override List Details { get; set; } = new List(); + + /// + /// 设置任务明细的实际库位和实际数量 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public virtual async Task SetDetail(Guid id, string handledLocationCode, string handledLocationErpCode, string handledWarehouseCode, decimal handledQty, string handledSupplierBatch, DateTime handledArriveDate, DateTime handledProduceDate, DateTime handledExpireDate + , string handledContainerCode, string handledLot, string handledPackingCode) + { + var detail = GetDetail(id); + detail.HandledToLocationCode = handledLocationCode; + detail.HandledToLocationErpCode = handledLocationErpCode; + detail.HandledToWarehouseCode = handledWarehouseCode; + detail.HandledQty = handledQty; + detail.HandledSupplierBatch = handledSupplierBatch; + detail.HandledArriveDate = handledArriveDate; + detail.HandledProduceDate = handledProduceDate; + detail.HandledExpireDate = handledExpireDate; + detail.HandledContainerCode = handledContainerCode; + detail.HandledLot = handledLot; + detail.HandledPackingCode = handledPackingCode; + await Task.CompletedTask.ConfigureAwait(false); + } + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJobDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJobDetail.cs new file mode 100644 index 000000000..b8d8827f6 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJobDetail.cs @@ -0,0 +1,88 @@ +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Data; +using Win_in.Sfs.Shared.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public class ProductRecycleJobDetail : SfsJobRecommendToDetailEntityBase +{ + /// + /// Bom版本 + /// + public string BomVersion { get; set; } + + /// + /// 库位代码 + /// + public string LocationCode { get; set; } + + /// + /// 库区 + /// + public string LocationArea { get; set; } + + /// + /// 库位组 + /// + public string LocationGroup { get; set; } + + /// + /// ERP库位代码 + /// + public string LocationErpCode { get; set; } + + /// + /// 原料库位代码 + /// + public string RawLocationCode { get; set; } + + /// + /// 原料库区 + /// + public string RawLocationArea { get; set; } + + /// + /// 原料库位组 + /// + public string RawLocationGroup { get; set; } + + /// + /// 原料ERP库位 + /// + public string RawLocationErpCode { get; set; } + + /// + /// 原料仓库 + /// + public string RawWarehouseCode { get; set; } + + /// + /// 计量单位 + /// + [Display(Name = "计量单位")] + [MaxLength(SfsPropertyConst.CodeLength)] + public string Uom { get; set; } + + /// + /// 数量 + /// + [Display(Name = "数量")] + [Column(TypeName = "decimal(18,6)")] + public decimal Qty { get; set; } + + /// + /// 扩展属性 + /// + public ExtraPropertyDictionary ExtraProperties { get; } = new ExtraPropertyDictionary(); + + /// + /// 库存状态 + /// + public EnumInventoryStatus Status { get; set; } + + /// + /// 仓库代码 + /// + public string WarehouseCode { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJobManager.cs new file mode 100644 index 000000000..f6f8db851 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJobManager.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Win_in.Sfs.Wms.Store.Jobs.ProductRecycleJobs; +internal class ProductRecycleJobManager +{ +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Equipments/EquipmentRecordDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Equipments/EquipmentRecordDbContextModelCreatingExtensions.cs new file mode 100644 index 000000000..1457d74ad --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Equipments/EquipmentRecordDbContextModelCreatingExtensions.cs @@ -0,0 +1,76 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Modeling; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Equipments; + +namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; + +public static class EquipmentRecordDbContextModelCreatingExtensions +{ + public static void ConfigureEquipmentRecord(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + nameof(EquipmentRecord), options.Schema); + //Configure ABP properties + b.ConfigureByConvention(); + //Configure Sfs base properties + b.ConfigureSfsStoreBase(); + + b.Property(q => q.BarCode).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.Batch).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.EqptCode).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.LocCode).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.PartCode).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.Batch).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.Type).HasMaxLength(SfsPropertyConst.CodeLength); + + + + + //Properties + //b.Property(q => q.SupplierCode).HasMaxLength(SfsPropertyConst.NameLength); + //b.Property(q => q.PoType).HasMaxLength(SfsPropertyConst.NameLength); + //b.Property(q => q.OrderStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); + //b.Property(q => q.Version).HasMaxLength(SfsPropertyConst.NameLength); + //b.Property(q => q.IsConsignment).HasDefaultValue(false); + //b.Property(q => q.TaxRate).HasDefaultValue(0); + //b.Property(q => q.ContactName).HasMaxLength(SfsPropertyConst.NameLength); + //b.Property(q => q.ContactPhone).HasMaxLength(SfsPropertyConst.NameLength); + //b.Property(q => q.ContactEmail).HasMaxLength(SfsPropertyConst.NameLength); + + ////Relations + //b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); + + ////Indexes + //b.HasIndex(q => new { q.Number }).IsUnique(); + }); + + //builder.Entity(b => + //{ + // //Configure table & schema name + // b.ToTable(options.TablePrefix + nameof(PurchaseOrderDetail), options.Schema); + // //Configure ABP properties + // b.ConfigureByConvention(); + // //Configure Sfs base properties + // b.ConfigureSfsStoreBase(); + // //Configure Sfs store detail properties + // b.ConfigureSfsStoreDetailBase(); + + // //Properties + // b.Property(q => q.PoLine).HasMaxLength(SfsPropertyConst.CodeLength); + // b.Property(q => q.LineStatus).IsRequired().HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); + // b.Property(q => q.ConvertRate).HasDefaultValue(1); + // b.Property(q => q.IsConsignment).HasDefaultValue(false); + // b.Property(q => q.ProjectCode).HasMaxLength(SfsPropertyConst.CodeLength); + // b.Property(q => q.LocationErpCode).HasMaxLength(SfsPropertyConst.CodeLength); + + // //Relations + + // //Indexes + // b.HasIndex(q => new { q.ItemCode, q.Number, q.PoLine }).IsUnique(); + //}); + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Equipments/EquipmentRecordEfCoreRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Equipments/EquipmentRecordEfCoreRepository.cs new file mode 100644 index 000000000..25ab861ad --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Equipments/EquipmentRecordEfCoreRepository.cs @@ -0,0 +1,23 @@ +using System.Linq; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Equipments; + +namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; + +public class EquipmentRecordEfCoreRepository : SfsStoreEfCoreRepositoryBase, IEquipmentRecordRepository, ISfsBulkRepositoryBase +{ + public EquipmentRecordEfCoreRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + + public Task UpsertAsync(EquipmentRecord newData) + { + throw new System.NotImplementedException(); + } + + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs index 9a5dbfa35..12527670d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Equipments; namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; @@ -104,6 +105,7 @@ public class StoreDbContext : AbpDbContext, IStoreDbContext #endregion public DbSet ExchangeDatas { get; set; } + public DbSet EquipmentRecords { get; set; } public StoreDbContext(DbContextOptions options) : base(options) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs index a26ec5dc9..67eb52523 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs @@ -29,6 +29,11 @@ public static class StoreDbContextModelCreatingExtensions builder.ConfigureSaleOrder(options); builder.ConfigureWorkOrder(options); + builder.ConfigureEquipmentRecord(options); + + + + #endregion #region Plans diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs index 0a5316749..2b05879e9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs @@ -32,6 +32,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule context.Services.AddTransient(); context.Services.AddTransient(); context.Services.AddTransient(); + context.Services.AddTransient(); #endregion diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Win_in.Sfs.Wms.Store.EntityFrameworkCore.csproj b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Win_in.Sfs.Wms.Store.EntityFrameworkCore.csproj index ad144b5fb..cb0cd0733 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Win_in.Sfs.Wms.Store.EntityFrameworkCore.csproj +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Win_in.Sfs.Wms.Store.EntityFrameworkCore.csproj @@ -38,6 +38,7 @@ +