Browse Source

[fix]修改TraceId类型魏string

调整验证方式NotEmpty to NotNull
master
贾荣国Home 3 years ago
parent
commit
6eec7cefd3
  1. 5
      WebApiService/NuGet.Config
  2. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDto.cs
  3. 8
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDtoValidator.cs
  4. 8
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/CreatePurchaseOrderDetailValidator.cs
  5. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderCreateDTO.cs
  6. 12
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderCreateDtoValidator.cs
  7. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDTO.cs
  8. 16
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDtoValidator.cs
  9. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDTO.cs
  10. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDtoValidator.cs
  11. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/UnplannedReceipts/UnplannedReceiptCreateDTO.cs
  12. 16
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/UnplannedReceipts/UnplannedReceiptCreateDtoValidator.cs
  13. 4
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityBase.cs
  14. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDtoBase.cs

5
WebApiService/NuGet.Config

@ -1,6 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="BlazoriseMyGet" value="https://www.myget.org/F/blazorise/api/v3/index.json" />
</packageSources>
</configuration>

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

@ -126,6 +126,6 @@ public class PartCreateDto : EntityDto,ICanTrace
/// </summary>
[XmlElement("traceId")]
[Display(Name = "跟踪编号")]
public Guid TraceId { get; set; }
public string TraceId { get; set; }
}

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

@ -11,10 +11,10 @@ public class PartCreateDtoValidator : AbstractValidator<PartCreateDto>
RuleFor(x => x.Desc1).MaximumLength(1024);
RuleFor(x => x.Desc2).MaximumLength(1024);
RuleFor(x => x.Status).MaximumLength(64).NotEmpty();
RuleFor(x => x.IsMakePart).NotEmpty();
RuleFor(x => x.IsBuyPart).NotEmpty();
RuleFor(x => x.Uom).MaximumLength(64).NotEmpty();
RuleFor(x => x.AbcClass).MaximumLength(64).NotEmpty();
RuleFor(x => x.IsMakePart).NotNull();
RuleFor(x => x.IsBuyPart).NotNull();
RuleFor(x => x.Uom).MaximumLength(64).NotNull();
RuleFor(x => x.AbcClass).MaximumLength(64).NotNull();
RuleFor(x => x.ProductLine).MaximumLength(64);
RuleFor(x => x.Type).MaximumLength(64);
RuleFor(x => x.Catalog).MaximumLength(64);

8
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/CreatePurchaseOrderDetailValidator.cs

@ -10,11 +10,11 @@ public class CreatePurchaseOrderDetailValidator : AbstractValidator<PurchaseOrde
RuleFor(q => q.PoLine).NotEmpty().MaximumLength(64);
RuleFor(q => q.PartCode).NotEmpty().MaximumLength(64);
RuleFor(q => q.Uom).NotEmpty().MaximumLength(64);
RuleFor(q => q.OrderQty).NotEmpty();
RuleFor(q => q.StdPackQty).NotEmpty();
RuleFor(q => q.OrderQty).NotNull();
RuleFor(q => q.StdPackQty).NotNull();
RuleFor(q => q.SupplierPackConvertRate);
RuleFor(q => q.IsConsignment).NotEmpty();
RuleFor(q => q.LineStatus).NotEmpty();
RuleFor(q => q.IsConsignment).NotNull();
RuleFor(q => q.LineStatus).NotNull();
RuleFor(q => q.Remark).MaximumLength(4096);
}

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderCreateDTO.cs

@ -124,5 +124,5 @@ public class PurchaseOrderCreateDTO : EntityDto,ICanTrace
[Display(Name = "跟踪编号")]
[XmlElement("traceId")]
public Guid TraceId { get; set; }
public string TraceId { get; set; }
}

12
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderCreateDtoValidator.cs

@ -9,12 +9,12 @@ public class PurchaseOrderCreateDtoValidator : AbstractValidator<PurchaseOrderCr
RuleFor(q => q.PoNumber).MaximumLength(64);
RuleFor(q => q.SupplierCode).NotEmpty().MaximumLength(64);
RuleFor(q => q.PoType).NotEmpty().MaximumLength(64);
RuleFor(q => q.Status).NotEmpty();
RuleFor(q => q.IsConsignment).NotEmpty();
RuleFor(q => q.OrderDate).NotEmpty();
RuleFor(q => q.DueDate).NotEmpty();
RuleFor(q => q.Version).NotEmpty().MaximumLength(64);
RuleFor(q => q.TaxRate).NotEmpty();
RuleFor(q => q.Status).NotNull();
RuleFor(q => q.IsConsignment).NotNull();
RuleFor(q => q.OrderDate).NotNull();
RuleFor(q => q.DueDate).NotNull();
RuleFor(q => q.Version).NotNull().MaximumLength(64);
RuleFor(q => q.TaxRate).NotNull();
RuleFor(q => q.Site).NotEmpty().MaximumLength(64);
RuleFor(q => q.Company).NotEmpty().MaximumLength(64);
RuleFor(q => q.ContactName).MaximumLength(64);

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDTO.cs

@ -151,5 +151,5 @@ public class ReceiptCreateDTO : EntityDto,ICanTrace
[XmlElement("traceId")]
[Display(Name = "跟踪编号")]
public Guid TraceId { get; set; }
public string TraceId { get; set; }
}

16
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDtoValidator.cs

@ -7,21 +7,21 @@ public class ReceiptCreateDtoValidator : AbstractValidator<ReceiptCreateDTO>
public ReceiptCreateDtoValidator()
{
RuleFor(q => q.RcNumber).NotEmpty().MaximumLength(64);
RuleFor(q => q.AsnNumber).NotEmpty().MaximumLength(64);
RuleFor(q => q.AsnNumber).MaximumLength(64);
RuleFor(q => q.PoNumber).MaximumLength(64);
RuleFor(q => q.SupplierCode).NotEmpty().MaximumLength(64);
RuleFor(q => q.RcType).NotEmpty().MaximumLength(64);
RuleFor(q => q.RcType).NotNull().MaximumLength(64);
RuleFor(q => q.Warehouse).MaximumLength(64);
RuleFor(q => q.Dock).MaximumLength(64);
RuleFor(q => q.ReceiveDate).NotEmpty();
RuleFor(q => q.ReceiveDate).NotNull();
RuleFor(q => q.ReceiveTime);
RuleFor(q => q.PoLine).MaximumLength(64);
RuleFor(q => q.PartCode).NotEmpty().MaximumLength(64);
RuleFor(q => q.Lot).NotEmpty().MaximumLength(64);
RuleFor(q => q.SupplierLot).NotEmpty();
RuleFor(q => q.Uom).NotEmpty().MaximumLength(64);
RuleFor(q => q.ReceiveQty).NotEmpty();
RuleFor(q => q.SupplierPackConvertRate).NotEmpty();
RuleFor(q => q.Lot).NotNull().MaximumLength(64);
RuleFor(q => q.SupplierLot).NotNull();
RuleFor(q => q.Uom).NotNull().MaximumLength(64);
RuleFor(q => q.ReceiveQty).NotNull();
RuleFor(q => q.SupplierPackConvertRate).NotNull();
RuleFor(q => q.Remark).MaximumLength(4096);
RuleFor(q => q.Site).NotEmpty().MaximumLength(64);
RuleFor(q => q.Company).NotEmpty().MaximumLength(64);

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDTO.cs

@ -130,6 +130,6 @@ public class SupplierCreateDTO : EntityDto,ICanTrace
[XmlElement("traceId")]
[Display(Name = "跟踪编号")]
public Guid TraceId { get; set; }
public string TraceId { get; set; }
}

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDtoValidator.cs

@ -20,7 +20,7 @@ public class SupplierCreateDtoValidator : AbstractValidator<SupplierCreateDTO>
RuleFor(x => x.ContactName).MaximumLength(64);
RuleFor(x => x.Bank).MaximumLength(64);
RuleFor(x => x.Currency).MaximumLength(64);
RuleFor(x => x.IsActive).NotEmpty();
RuleFor(x => x.IsActive).NotNull();
RuleFor(x => x.Company).MaximumLength(1024);
RuleFor(x => x.Remark).MaximumLength(4096);
}

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/UnplannedReceipts/UnplannedReceiptCreateDTO.cs

@ -118,5 +118,5 @@ public class UnplannedReceiptCreateDTO : EntityDto,ICanTrace
[XmlElement("traceId")]
[Display(Name = "跟踪编号")]
public Guid TraceId { get; set; }
public string TraceId { get; set; }
}

16
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/UnplannedReceipts/UnplannedReceiptCreateDtoValidator.cs

@ -6,16 +6,16 @@ public class UnplannedReceiptCreateDtoValidator : AbstractValidator<UnplannedRec
{
public UnplannedReceiptCreateDtoValidator()
{
RuleFor(q => q.TrNbr).NotEmpty();
RuleFor(q => q.TrType).NotEmpty().MaximumLength(8);
RuleFor(q => q.TrNbr).NotNull();
RuleFor(q => q.TrType).NotNull().MaximumLength(8);
RuleFor(q => q.Order).MaximumLength(64);
RuleFor(q => q.Location).NotEmpty().MaximumLength(8);
RuleFor(q => q.EffectiveDate).NotEmpty();
RuleFor(q => q.SystemDate).NotEmpty();
RuleFor(q => q.Location).NotNull().MaximumLength(8);
RuleFor(q => q.EffectiveDate).NotNull();
RuleFor(q => q.SystemDate).NotNull();
RuleFor(q => q.PartCode).NotEmpty().MaximumLength(18);
RuleFor(q => q.Lot).NotEmpty().MaximumLength(64);
RuleFor(q => q.Uom).NotEmpty().MaximumLength(8);
RuleFor(q => q.Qty).NotEmpty();
RuleFor(q => q.Lot).NotNull().MaximumLength(64);
RuleFor(q => q.Uom).NotNull().MaximumLength(8);
RuleFor(q => q.Qty).NotNull();
RuleFor(q => q.SoJob).MaximumLength(20);
RuleFor(q => q.Remark).MaximumLength(4096);
RuleFor(q => q.Site).NotEmpty().MaximumLength(8);

4
WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityBase.cs

@ -6,13 +6,13 @@ namespace Win_in.Sfs.Scp.WebApi.Domain.Shared
{
public class EntityBase<TKey> : CreationAuditedAggregateRoot<TKey>,ICanTrace, IHasErrorMessage
{
public Guid TraceId { get; set; }
public string TraceId { get; set; }
public int ErrorCode { get; set; }
public string ErrorMessage { get; set; }
}
public interface ICanTrace
{
Guid TraceId { get; set; }
string TraceId { get; set; }
}
}

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDtoBase.cs

@ -24,7 +24,7 @@ namespace Win_in.Sfs.Scp.WebApi.Domain.Shared
/// </summary>
[DataMember]
[Display(Name = "跟踪编号")]
public Guid TraceId { get; set; }
public string TraceId { get; set; }
[DataMember]
public int ErrorCode { get; set; }

Loading…
Cancel
Save