Browse Source

[fix] 只取已发货的发货单

master
贾荣国 2 years ago
parent
commit
18f5c782c0
  1. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ScpV1AutoMapperProfile.cs
  2. 71
      WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.json
  3. 6
      WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json
  4. 2
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpDbContextModelCreatingExtensions.cs
  5. 4
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbAsnRepository.cs

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

@ -31,7 +31,7 @@ namespace Win_in.Sfs.Scp.WebApi
.ForMember(p => p.Site, p => p.MapFrom(q => q.Site)) .ForMember(p => p.Site, p => p.MapFrom(q => q.Site))
.ForMember(p => p.PartCode, p => p.MapFrom(q => q.Code)) .ForMember(p => p.PartCode, p => p.MapFrom(q => q.Code))
.ForMember(p => p.ErpPartCode, p => p.MapFrom(q => q.Code)) .ForMember(p => p.ErpPartCode, p => p.MapFrom(q => q.Code))
// .ForMember(p => p.PartDesc1, p => p.MapFrom(q => ""))//中文描述不要覆盖 .ForMember(p => p.PartDesc1, p => p.MapFrom(q => ""))//中文描述不要覆盖
.ForMember(p => p.PartDesc2, p => p.MapFrom(q => string.IsNullOrEmpty(q.Desc1) ? "" : q.Desc1)) .ForMember(p => p.PartDesc2, p => p.MapFrom(q => string.IsNullOrEmpty(q.Desc1) ? "" : q.Desc1))
.ForMember(p => p.ProjectId, p => p.MapFrom(q => q.ProductLine)) .ForMember(p => p.ProjectId, p => p.MapFrom(q => q.ProductLine))
.ForMember(p => p.Unit, p => p.MapFrom(q => q.Uom)) .ForMember(p => p.Unit, p => p.MapFrom(q => q.Uom))

71
WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.json

@ -1,13 +1,11 @@
{ {
"App": { "App": {
"SelfUrl": "https://scp.iacchina.net:9988", "SelfUrl": "https://scp.iacchina.net:9988",
"CorsOrigins": "https://scp.iacchina.net:9977,https://scp.iacchina.net:9988,https://localhost:9977,https://localhost:9988", "CorsOrigins": "https://scp.iacchina.net:9988",
"RedirectAllowedUrls": "https://scp.iacchina.net:9977,https://scp.iacchina.net:9988" "RedirectAllowedUrls": "https://scp.iacchina.net:9988"
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=127.0.0.1,13314;Database=Scp_WebApi;User ID=superadmin;Password=Microsoft@2021;connection timeout=600;", "Default": "Server=127.0.0.1,13314;Database=Scp_WebApi;User ID=superadmin;Password=Microsoft@2021;connection timeout=600;"
"WebApi": "Server=127.0.0.1,13314;Database=Scp_WebApi;User ID=superadmin;Password=Microsoft@2021;connection timeout=600;",
"V1Scp": "Server=127.0.0.1£º13314;Database=Scp_AC;User ID=sa;Password=Microsoft2008;connection timeout=600;"
}, },
"AuthServer": { "AuthServer": {
"Authority": "https://scp.iacchina.net:9988", "Authority": "https://scp.iacchina.net:9988",
@ -34,5 +32,68 @@
} }
} }
}, },
"Serilog": {
"Using": [ "Serilog.Sinks.File", "Serilog.Sinks.Async", "Serilog.Sinks.Console", "Serilog.Sinks.MSSqlServer" ],
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Information",
"Microsoft.EntityFrameworkCore": "Warning"
}
},
"WriteTo": [
{
"Name": "Async",
"Args": {
"configure": [
{
"Name": "File",
"Args": {
"path": "Logs\\log.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Information"
}
}
]
}
},
{
"Name": "Console",
"Args": {
"restrictedToMinimumLevel": "Debug",
"outputTemplate": "{Timestamp:HH:mm:ss.fff zzz} [{Level}] {Message} {NewLine}{Exception}"
}
},
{
"Name": "MSSqlServer",
"Args": {
"connectionString": "Server=127.0.0.1;Database=Scp_WebApi;User ID=sa;Password=Microsoft2008;connection timeout=600;",
"tableName": "AppLogs",
"autoCreateSqlTable": true
}
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ]
},
"AsnOptions": {
"Active": true,
"PeriodSeconds": 300,
"RetryTimes": 3,
"BatchSize": 100,
"MaxCount": 100,
"Receiver": "IACNA_ID",
"Sites": [
{
"Code": "T8",
"MinUid": 200
},
{
"Code": "T5",
"MinUid": 100
}
]
},
"AlwaysAllowAuthorization": false "AlwaysAllowAuthorization": false
} }

6
WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json

@ -1,8 +1,8 @@
{ {
"App": { "App": {
"SelfUrl": "https://localhost:9988", "SelfUrl": "https://localhost:9988",
"CorsOrigins": "https://localhost:9977,https://localhost:9988", "CorsOrigins": "https://localhost:9988",
"RedirectAllowedUrls": "https://localhost:9977,,https://localhost:9988" "RedirectAllowedUrls": "https://localhost:9988"
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=Scp_WebApi;User ID=sa;Password=Microsoft2008;connection timeout=600;" "Default": "Server=127.0.0.1;Database=Scp_WebApi;User ID=sa;Password=Microsoft2008;connection timeout=600;"
@ -96,5 +96,5 @@
} }
] ]
}, },
"AlwaysAllowAuthorization": false "AlwaysAllowAuthorization": true
} }

2
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpDbContextModelCreatingExtensions.cs

@ -47,7 +47,7 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
b.Property(q => q.Site).HasMaxLength(50).IsRequired(); b.Property(q => q.Site).HasMaxLength(50).IsRequired();
b.Property(q => q.PartCode).HasMaxLength(50).IsRequired(); b.Property(q => q.PartCode).HasMaxLength(50).IsRequired();
b.Property(q => q.ErpPartCode).HasMaxLength(50).IsRequired(); b.Property(q => q.ErpPartCode).HasMaxLength(50).IsRequired();
b.Property(q => q.PartDesc1).HasMaxLength(500); b.Property(q => q.PartDesc1).HasMaxLength(500).IsRequired();
b.Property(q => q.PartDesc2).HasMaxLength(500); b.Property(q => q.PartDesc2).HasMaxLength(500);
b.Property(q => q.ProjectId).HasMaxLength(50); b.Property(q => q.ProjectId).HasMaxLength(50);
b.Property(q => q.Unit).HasMaxLength(50).IsRequired(); b.Property(q => q.Unit).HasMaxLength(50).IsRequired();

4
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbAsnRepository.cs

@ -19,7 +19,9 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
{ {
var dbSet = await GetDbSetAsync(); var dbSet = await GetDbSetAsync();
var list = await dbSet var list = await dbSet
.Where(p =>p.Site==site && p.Id > uid) .Where(p =>p.Site==site
&& p.State == 3 //已发货
&& p.Id > uid)
.OrderBy(p => p.Id) .OrderBy(p => p.Id)
.Take(batchSize) .Take(batchSize)
.ToListAsync(); .ToListAsync();

Loading…
Cancel
Save