Browse Source

[fix]BUG修复

master
贾荣国Home 3 years ago
parent
commit
a6de815cbe
  1. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderCreateDTO.cs
  2. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderCreateDtoValidator.cs
  3. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/PurchaseOrderDTO.cs
  4. 6
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs
  5. 7
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ScpV1AutoMapperProfile.cs
  6. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/PurchaseOrders/PurchaseOrder.cs
  7. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/UnplannedReceipts/UnplannedReceipt.cs
  8. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/DbContext/WebApiDbContextModelCreatingExtensions.cs

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

@ -69,7 +69,7 @@ public class PurchaseOrderCreateDTO : EntityDto,ICanTrace
/// </summary>
[XmlElement("taxRate")]
[Display(Name = "税率(TaxRate)")]
public decimal TaxRate { set; get; }
public decimal? TaxRate { set; get; }
/// <summary>
/// 版本(version)

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

@ -14,7 +14,7 @@ public class PurchaseOrderCreateDtoValidator : AbstractValidator<PurchaseOrderCr
RuleFor(q => q.OrderDate).NotNull();
RuleFor(q => q.DueDate).NotNull();
RuleFor(q => q.Version).MaximumLength(64).NotNull();
RuleFor(q => q.TaxRate).NotNull();
RuleFor(q => q.TaxRate);
RuleFor(q => q.Site).MaximumLength(64).NotEmpty();
RuleFor(q => q.Company).MaximumLength(64).NotEmpty();
RuleFor(q => q.ContactName).MaximumLength(64);

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

@ -71,7 +71,7 @@ namespace Win_in.Sfs.Scp.WebApi
/// </summary>
[DataMember,XmlElement("taxRate")]
[Display(Name = "税率(TaxRate)")]
public decimal TaxRate { set; get; }
public decimal? TaxRate { set; get; }
/// <summary>
/// 版本(version)

6
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs

@ -75,6 +75,12 @@ namespace Win_in.Sfs.Scp.WebApi
public virtual async Task<PurchaseOrderDTO> CreateAsync(PurchaseOrderCreateDTO poCreateDTO)
{
var entity = ObjectMapper.Map<PurchaseOrderCreateDTO, PurchaseOrder>(poCreateDTO);
if (entity.PoType == "0")
{
entity.PoType = "1";
}
foreach (var detail in entity.Details)
{
detail.SetId(GuidGenerator);

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

@ -241,8 +241,9 @@ namespace Win_in.Sfs.Scp.WebApi
.ForMember(p => p.GUID, p => p.MapFrom(q => Guid.NewGuid()))//默认值
// .ForMember(p => p.OperName, p => p.MapFrom(q => ""))//默认值
.ForMember(p => p.BillType, p => p.MapFrom(q => string.IsNullOrWhiteSpace(q.TrType) ? 0 : 1))//0:收货 1:退货
//.ForMember(p => p.BillType, p => p.MapFrom(q => string.IsNullOrWhiteSpace(q.TrType) ? 0 : 1))//0:收货 1:退货
.ForMember(p => p.BillType, p => p.MapFrom(q=>0))
// .ForMember(p => p.Tax, p => p.MapFrom(q => 0))//默认值
;
@ -264,7 +265,9 @@ namespace Win_in.Sfs.Scp.WebApi
// .ForMember(p => p.IsDeleted, p => p.MapFrom(q => false))//默认值
.ForMember(p => p.GUID, p => p.MapFrom(q => Guid.NewGuid()))//默认值
.ForMember(p => p.BillType, p => p.MapFrom(q => string.IsNullOrWhiteSpace(q.TrType) ? 0 : 1))//0:收货 1:退货
//.ForMember(p => p.BillType, p => p.MapFrom(q => string.IsNullOrWhiteSpace(q.TrType) ? 0 : 1))//0:收货 1:退货
.ForMember(p => p.BillType, p => p.MapFrom(q => 0))
// .ForMember(p => p.VendBatch, p => p.MapFrom(q => ""))//默认值
.ForMember(p => p.PoUnit, p => p.MapFrom(q => q.Uom))

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/PurchaseOrders/PurchaseOrder.cs

@ -66,7 +66,7 @@ namespace Win_in.Sfs.Scp.WebApi
/// 税率(TaxRate)
/// </summary>
[Display(Name = "税率(TaxRate)")]
public decimal TaxRate { set; get; }
public decimal? TaxRate { set; get; }
/// <summary>
/// 联系人(ContactName)

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/UnplannedReceipts/UnplannedReceipt.cs

@ -6,7 +6,7 @@ using Win_in.Sfs.Scp.WebApi.Domain.Shared;
namespace Win_in.Sfs.Scp.WebApi
{
/// <summary>
/// 收货单与退货单明细(Receipt)
/// 计划外入库单(UnplannedReceipt)
/// </summary>
public class UnplannedReceipt : EntityBase<Guid>
{

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/DbContext/WebApiDbContextModelCreatingExtensions.cs

@ -206,7 +206,7 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore
b.Property(q => q.OrderDate).IsRequired();
b.Property(q => q.DueDate).IsRequired();
b.Property(q => q.Version).IsRequired().HasMaxLength(64);
b.Property(q => q.TaxRate).IsRequired().HasPrecision(18, 6);
b.Property(q => q.TaxRate).HasPrecision(18, 6);
b.Property(q => q.Site).IsRequired().HasMaxLength(64);
b.Property(q => q.Company).IsRequired().HasMaxLength(64);
b.Property(q => q.ContactName).HasMaxLength(64);

Loading…
Cancel
Save