Browse Source

[fix]无法验证,无法捕获异常等BUG修复

master
贾荣国 3 years ago
parent
commit
d1f3c1cf1e
  1. 1
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/IPartAppService.cs
  2. 1
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/IPurchaseOrderAppService.cs
  3. 1
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/IReceiptAppService.cs
  4. 1
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/ISupplierAppService.cs
  5. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDTO.cs
  6. 1
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/UnplannedReceipts/IUnplannedReceiptAppService.cs
  7. 5
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/WebApiApplicationContractsModule.cs
  8. 3
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs
  9. 4
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs
  10. 4
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs
  11. 6
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs
  12. 4
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/UnplannedReceipts/UnplannedReceiptAppService.cs
  13. 1
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationModule.cs
  14. 7
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaVenderRepository.cs

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

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Validation;
namespace Win_in.Sfs.Scp.WebApi
{

1
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/PurchaseOrders/IPurchaseOrderAppService.cs

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Validation;
namespace Win_in.Sfs.Scp.WebApi
{

1
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/IReceiptAppService.cs

@ -2,6 +2,7 @@ using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Validation;
namespace Win_in.Sfs.Scp.WebApi
{

1
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/ISupplierAppService.cs

@ -2,6 +2,7 @@ using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Validation;
namespace Win_in.Sfs.Scp.WebApi
{

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

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Xml.Serialization;
using Volo.Abp.Application.Dtos;
@ -130,4 +131,5 @@ public class SupplierCreateDTO : EntityDto,ICanTrace
[Display(Name = "跟踪编号")]
public Guid TraceId { get; set; }
}

1
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/UnplannedReceipts/IUnplannedReceiptAppService.cs

@ -2,6 +2,7 @@ using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Validation;
namespace Win_in.Sfs.Scp.WebApi
{

5
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/WebApiApplicationContractsModule.cs

@ -27,5 +27,10 @@ namespace Win_in.Sfs.Scp.WebApi
{
WebApiDtoExtensions.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
}
}
}

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

@ -73,6 +73,7 @@ namespace Win_in.Sfs.Scp.WebApi
try
{
await UpsertTaPartAsync(entity);
await CurrentUnitOfWork.SaveChangesAsync();
}
catch (Exception ex)
{
@ -81,6 +82,8 @@ namespace Win_in.Sfs.Scp.WebApi
}
var ret = await _partRepository.InsertAsync(entity);
var dto = ObjectMapper.Map<Part, PartDTO>(ret);
return dto;
}

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

@ -65,7 +65,7 @@ namespace Win_in.Sfs.Scp.WebApi
/// <returns></returns>
[HttpPost]
[Route("")]
public async Task<PurchaseOrderDTO> CreateAsync(PurchaseOrderCreateDTO poCreateDTO)
public virtual async Task<PurchaseOrderDTO> CreateAsync(PurchaseOrderCreateDTO poCreateDTO)
{
var entity = ObjectMapper.Map<PurchaseOrderCreateDTO, PurchaseOrder>(poCreateDTO);
foreach (var detail in entity.Details)
@ -76,6 +76,8 @@ namespace Win_in.Sfs.Scp.WebApi
try
{
await UpsertTbPoAndTbPoDetailAsync(entity);
await CurrentUnitOfWork.SaveChangesAsync();
}
catch (Exception ex)
{

4
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs

@ -68,13 +68,15 @@ namespace Win_in.Sfs.Scp.WebApi
[HttpPost]
[Route("")]
public async Task<ReceiptDTO> CreateAsync(ReceiptCreateDTO receiptCreateDTO)
public virtual async Task<ReceiptDTO> CreateAsync(ReceiptCreateDTO receiptCreateDTO)
{
var entity = ObjectMapper.Map<ReceiptCreateDTO, Receipt>(receiptCreateDTO);
try
{
await UpsertTbReceiptAndTbReceiptDetailAsync(entity);
await CurrentUnitOfWork.SaveChangesAsync();
}
catch (Exception ex)
{

6
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs

@ -64,13 +64,15 @@ namespace Win_in.Sfs.Scp.WebApi
/// <returns>供应商DTO(Supplier DTO)</returns>
[HttpPost]
[Route("")]
public async Task<SupplierDTO> CreateAsync(SupplierCreateDTO supplierCreateDTO)
public virtual async Task<SupplierDTO> CreateAsync(SupplierCreateDTO supplierCreateDTO)
{
var entity = ObjectMapper.Map<SupplierCreateDTO, Supplier>(supplierCreateDTO);
try
{
await UpsertTaVenderAsync(entity);
UpsertTaVenderAsync(entity).Wait();
await CurrentUnitOfWork.SaveChangesAsync();
}
catch (Exception ex)
{

4
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/UnplannedReceipts/UnplannedReceiptAppService.cs

@ -67,13 +67,15 @@ namespace Win_in.Sfs.Scp.WebApi
/// <returns></returns>
[HttpPost]
[Route("")]
public async Task<UnplannedReceiptDTO> CreateAsync(UnplannedReceiptCreateDTO receiptCreateDTO)
public virtual async Task<UnplannedReceiptDTO> CreateAsync(UnplannedReceiptCreateDTO receiptCreateDTO)
{
var entity = ObjectMapper.Map<UnplannedReceiptCreateDTO, UnplannedReceipt>(receiptCreateDTO);
try
{
await UpsertTbReceiptAndTbReceiptDetailAsync(entity);
await CurrentUnitOfWork.SaveChangesAsync();
}
catch (Exception ex)
{

1
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationModule.cs

@ -7,7 +7,6 @@ using Volo.Abp.PermissionManagement;
using Volo.Abp.SettingManagement;
using Volo.Abp.TenantManagement;
using Win_in.Sfs.Scp.v1.Domain;
using Win_in.Sfs.Scp.v1.EntityFrameworkCore;
namespace Win_in.Sfs.Scp.WebApi

7
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaVenderRepository.cs

@ -1,4 +1,6 @@
using System.Threading.Tasks;
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
@ -18,6 +20,7 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
var dbSet = await GetDbSetAsync();
var current = await dbSet.FirstOrDefaultAsync(p => p.Site == taVender.Site
&& p.VendId == taVender.VendId);
if (current == null)
{
ret = await InsertAsync(taVender);
@ -42,6 +45,8 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
}
return ret;
}
}
}
Loading…
Cancel
Save