|
@ -2,15 +2,18 @@ |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
|
|
|
using System.ComponentModel.DataAnnotations; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using AutoMapper; |
|
|
using AutoMapper; |
|
|
using AutoMapper.Configuration; |
|
|
using AutoMapper.Configuration; |
|
|
|
|
|
using FluentValidation; |
|
|
using Volo.Abp.Application.Dtos; |
|
|
using Volo.Abp.Application.Dtos; |
|
|
using Volo.Abp.Application.Services; |
|
|
using Volo.Abp.Application.Services; |
|
|
using Volo.Abp.Domain.Repositories; |
|
|
using Volo.Abp.Domain.Repositories; |
|
|
using Volo.Abp.Uow; |
|
|
using Volo.Abp.Uow; |
|
|
using Win_in.Sfs.Scp.v1.Domain; |
|
|
using Win_in.Sfs.Scp.v1.Domain; |
|
|
using Microsoft.Extensions.Configuration; |
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
|
|
using Volo.Abp.Validation; |
|
|
using IConfiguration = Microsoft.Extensions.Configuration.IConfiguration; |
|
|
using IConfiguration = Microsoft.Extensions.Configuration.IConfiguration; |
|
|
|
|
|
|
|
|
namespace Win_in.Sfs.Scp.WebApi |
|
|
namespace Win_in.Sfs.Scp.WebApi |
|
@ -93,7 +96,17 @@ namespace Win_in.Sfs.Scp.WebApi |
|
|
|
|
|
|
|
|
var dto = ObjectMapper.Map<Part, PartDTO>(ret); |
|
|
var dto = ObjectMapper.Map<Part, PartDTO>(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 UpsertTaPartAsync(Part entity) |
|
|
private async Task UpsertTaPartAsync(Part entity) |
|
|