Browse Source

[fix]零件ABC类修改为非必填,并设置默认值Z

master
贾荣国 2 years ago
parent
commit
679625fe29
  1. 22
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Agent/Win_in.Sfs.Scp.WebApi.Agent.csproj
  2. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDto.cs
  3. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDtoValidator.cs
  4. 1
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs
  5. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ScpV1AutoMapperProfile.cs
  6. 3
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationAutoMapperProfile.cs
  7. 26
      WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/WebApiHttpApiHostModule.cs
  8. 8
      WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Win_in.Sfs.Scp.WebApi.HttpApi.Host.csproj
  9. 1
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaPartRepository.cs

22
WebApiService/src/Win_in.Sfs.Scp.WebApi.Agent/Win_in.Sfs.Scp.WebApi.Agent.csproj

@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
</PropertyGroup> <AssemblyVersion>1.22.0621.1</AssemblyVersion>
<FileVersion>1.22.0621.1</FileVersion>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.*" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.*" />
@ -29,11 +31,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Win_in.Sfs.Scp.v1.Domain\Win_in.Sfs.Scp.v1.Domain.csproj" /> <ProjectReference Include="..\Win_in.Sfs.Scp.v1.Domain\Win_in.Sfs.Scp.v1.Domain.csproj" />
<ProjectReference Include="..\Win_in.Sfs.Scp.v1.EntityFrameworkCore\Win_in.Sfs.Scp.v1.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\Win_in.Sfs.Scp.v1.EntityFrameworkCore\Win_in.Sfs.Scp.v1.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\Win_in.Sfs.Scp.WebApi.Application\Win_in.Sfs.Scp.WebApi.Application.csproj" /> <ProjectReference Include="..\Win_in.Sfs.Scp.WebApi.Application\Win_in.Sfs.Scp.WebApi.Application.csproj" />
<ProjectReference Include="..\Win_in.Sfs.Scp.WebApi.Domain.Shared\Win_in.Sfs.Scp.WebApi.Domain.Shared.csproj" /> <ProjectReference Include="..\Win_in.Sfs.Scp.WebApi.Domain.Shared\Win_in.Sfs.Scp.WebApi.Domain.Shared.csproj" />
<ProjectReference Include="..\Win_in.Sfs.Scp.WebApi.EntityFrameworkCore\Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\Win_in.Sfs.Scp.WebApi.EntityFrameworkCore\Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.csproj" />
</ItemGroup> </ItemGroup>

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDto.cs

@ -71,7 +71,7 @@ public class PartCreateDto : EntityDto,ICanTrace
/// </summary> /// </summary>
[XmlElement("abcClass")] [XmlElement("abcClass")]
[Display(Name = "ABC类")] [Display(Name = "ABC类")]
public string AbcClass { get; set; } public string AbcClass { get; set; } = "Z";
/// <summary> /// <summary>
/// 产品类(Product Line) /// 产品类(Product Line)

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDtoValidator.cs

@ -15,7 +15,7 @@ public class PartCreateDtoValidator : AbstractValidator<PartCreateDto>
RuleFor(x => x.IsMakePart).NotNull(); RuleFor(x => x.IsMakePart).NotNull();
RuleFor(x => x.IsBuyPart).NotNull(); RuleFor(x => x.IsBuyPart).NotNull();
RuleFor(x => x.Uom).MaximumLength(64).NotNull(); RuleFor(x => x.Uom).MaximumLength(64).NotNull();
RuleFor(x => x.AbcClass).MaximumLength(64).NotNull(); RuleFor(x => x.AbcClass).MaximumLength(64);
RuleFor(x => x.ProductLine).MaximumLength(64); RuleFor(x => x.ProductLine).MaximumLength(64);
RuleFor(x => x.Type).MaximumLength(64); RuleFor(x => x.Type).MaximumLength(64);
RuleFor(x => x.Catalog).MaximumLength(64); RuleFor(x => x.Catalog).MaximumLength(64);

1
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs

@ -90,7 +90,6 @@ namespace Win_in.Sfs.Scp.WebApi
[Route("")] [Route("")]
public virtual async Task<ActionResult<PartDTO>> CreateAsync(PartCreateDto partCreateDTO) public virtual async Task<ActionResult<PartDTO>> CreateAsync(PartCreateDto partCreateDTO)
{ {
var entity = ObjectMapper.Map<PartCreateDto, Part>(partCreateDTO); var entity = ObjectMapper.Map<PartCreateDto, Part>(partCreateDTO);
try try

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ScpV1AutoMapperProfile.cs

@ -41,7 +41,7 @@ namespace Win_in.Sfs.Scp.WebApi
.ForMember(p => p.ValidityDays, p => p.MapFrom(q => 0))//默认值 .ForMember(p => p.ValidityDays, p => p.MapFrom(q => 0))//默认值
.ForMember(p => p.ReceivePort, p => p.MapFrom(q => q.Desc2))//默认值 .ForMember(p => p.ReceivePort, p => p.MapFrom(q => q.Desc2))//默认值
.ForMember(p => p.Qlevel, p => p.MapFrom(q => q.QLevel)) .ForMember(p => p.Qlevel, p => p.MapFrom(q => q.QLevel))
// .ForMember(p => p.PalletSize, p => p.MapFrom(q => ""))//默认值 .ForMember(p => p.PalletSize, p => p.MapFrom(q => q.AbcClass))//默认值
.ForMember(p => p.Remark, p => p.MapFrom(q => q.Version)) .ForMember(p => p.Remark, p => p.MapFrom(q => q.Version))
// .ForMember(p => p.Ischeck, p => p.MapFrom(q => false))//默认值 // .ForMember(p => p.Ischeck, p => p.MapFrom(q => false))//默认值
; ;

3
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationAutoMapperProfile.cs

@ -36,7 +36,8 @@ namespace Win_in.Sfs.Scp.WebApi
CreateMap<PartCreateDto, Part>() CreateMap<PartCreateDto, Part>()
.Ignore(p => p.Id) .Ignore(p => p.Id)
.Ignore(p => p.CreatorId) .Ignore(p => p.CreatorId)
.Ignore(p => p.CreationTime); .Ignore(p => p.CreationTime)
.ForMember(p=>p.AbcClass, p => p.MapFrom(q => string.IsNullOrEmpty(q.AbcClass) ? "Z" : q.AbcClass));
} }
/// <summary> /// <summary>

26
WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/WebApiHttpApiHostModule.cs

@ -44,20 +44,20 @@ using Volo.Abp.Data;
namespace Win_in.Sfs.Scp.WebApi namespace Win_in.Sfs.Scp.WebApi
{ {
[DependsOn( [DependsOn(
typeof(AbpAutofacModule), typeof(AbpAutofacModule)
typeof(AbpAspNetCoreMultiTenancyModule), , typeof(AbpAspNetCoreMultiTenancyModule)
typeof(AbpAspNetCoreMvcUiBasicThemeModule), , typeof(AbpAspNetCoreMvcUiBasicThemeModule)
typeof(AbpAspNetCoreAuthenticationJwtBearerModule), , typeof(AbpAspNetCoreAuthenticationJwtBearerModule)
typeof(AbpAccountWebIdentityServerModule), , typeof(AbpAccountWebIdentityServerModule)
typeof(AbpAspNetCoreSerilogModule), , typeof(AbpAspNetCoreSerilogModule)
typeof(AbpSwashbuckleModule), , typeof(AbpSwashbuckleModule)
typeof(AbpMultiTenancyModule), , typeof(AbpMultiTenancyModule)
typeof(AbpBackgroundWorkersModule) // , typeof(AbpBackgroundWorkersModule)
)] )]
[DependsOn( [DependsOn(
typeof(WebApiHttpApiModule), typeof(WebApiHttpApiModule)
typeof(WebApiApplicationModule), , typeof(WebApiApplicationModule)
typeof(WebApiEntityFrameworkCoreModule) , typeof(WebApiEntityFrameworkCoreModule)
)] )]
[DependsOn( [DependsOn(
typeof(V1ScpEntityFrameworkCoreModule) typeof(V1ScpEntityFrameworkCoreModule)
@ -292,7 +292,7 @@ namespace Win_in.Sfs.Scp.WebApi
public override void OnApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)
{ {
context.AddBackgroundWorker<AsnBackgroundWorker>(); // context.AddBackgroundWorker<AsnBackgroundWorker>();
var app = context.GetApplicationBuilder(); var app = context.GetApplicationBuilder();
var env = context.GetEnvironment(); var env = context.GetEnvironment();

8
WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Win_in.Sfs.Scp.WebApi.HttpApi.Host.csproj

@ -7,8 +7,8 @@
<RootNamespace>Win_in.Sfs.Scp.WebApi</RootNamespace> <RootNamespace>Win_in.Sfs.Scp.WebApi</RootNamespace>
<PreserveCompilationReferences>true</PreserveCompilationReferences> <PreserveCompilationReferences>true</PreserveCompilationReferences>
<UserSecretsId>Win_in.Sfs.Scp.WebApi-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId> <UserSecretsId>Win_in.Sfs.Scp.WebApi-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId>
<AssemblyVersion>1.22.0620.1</AssemblyVersion> <AssemblyVersion>1.22.0621.1</AssemblyVersion>
<FileVersion>1.22.0620.1</FileVersion> <FileVersion>1.22.0621.1</FileVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -31,9 +31,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="AsnBackgroundWorker\**" />
<Compile Remove="Logs\**" /> <Compile Remove="Logs\**" />
<Content Remove="AsnBackgroundWorker\**" />
<Content Remove="Logs\**" /> <Content Remove="Logs\**" />
<EmbeddedResource Remove="AsnBackgroundWorker\**" />
<EmbeddedResource Remove="Logs\**" /> <EmbeddedResource Remove="Logs\**" />
<None Remove="AsnBackgroundWorker\**" />
<None Remove="Logs\**" /> <None Remove="Logs\**" />
</ItemGroup> </ItemGroup>

1
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaPartRepository.cs

@ -36,6 +36,7 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
current.State = taPart.State; current.State = taPart.State;
current.Configuration = taPart.Configuration; current.Configuration = taPart.Configuration;
current.Qlevel = taPart.Qlevel; current.Qlevel = taPart.Qlevel;
current.PalletSize = taPart.PalletSize;
current.Remark = taPart.Remark; current.Remark = taPart.Remark;
ret = await UpdateAsync(current); ret = await UpdateAsync(current);

Loading…
Cancel
Save