|
|
@ -2,10 +2,12 @@ using Microsoft.AspNetCore.Authorization; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.ComponentModel.DataAnnotations; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
using Volo.Abp.Application.Dtos; |
|
|
|
using Volo.Abp.Application.Services; |
|
|
|
using Volo.Abp.Validation; |
|
|
|
using Win_in.Sfs.Scp.v1.Domain; |
|
|
|
|
|
|
|
namespace Win_in.Sfs.Scp.WebApi |
|
|
@ -102,7 +104,17 @@ namespace Win_in.Sfs.Scp.WebApi |
|
|
|
} |
|
|
|
var ret = await _purchaseOrderRepository.InsertAsync(entity); |
|
|
|
var dto = ObjectMapper.Map<PurchaseOrder, PurchaseOrderDTO>(ret); |
|
|
|
return dto.ErrorCode != 0 ? new BadRequestObjectResult(dto) : new OkObjectResult(dto); |
|
|
|
if (dto.ErrorCode != 0) |
|
|
|
{ |
|
|
|
throw new AbpValidationException(new List<ValidationResult> |
|
|
|
{ |
|
|
|
new(dto.ErrorMessage) |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
return new OkObjectResult(dto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private async Task UpsertTbPoAndTbPoDetailAsync(PurchaseOrder entity) |
|
|
|