You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
545 lines
25 KiB
545 lines
25 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Volo.Abp.Application.Services;
|
|
using Volo.Abp.Validation;
|
|
using Win_in.Sfs.Basedata.Application.Contracts;
|
|
using Win_in.Sfs.Shared.Domain.Shared;
|
|
using Win_in.Sfs.Wms.DataExchange.Application.Contracts.Iac.Qad;
|
|
using Win_in.Sfs.Wms.DataExchange.Domain.Iac.Qad;
|
|
using Win_in.Sfs.Wms.Store.Application.Contracts;
|
|
|
|
namespace Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad;
|
|
|
|
/// <summary>
|
|
/// QAD收货单(prh_hist)
|
|
/// </summary>
|
|
//[Authorize(IncomingToWmsPermissions.Default)]
|
|
[Microsoft.AspNetCore.Components.Route($"{DataExchangeConsts.RouteRoot}prh-hist")]
|
|
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.WmsWebApi)]
|
|
public class PrhHistAppService : ApplicationService, IPrhHistAppService
|
|
{
|
|
private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteAppService;
|
|
|
|
private readonly IPurchaseReturnNoteAppService _purchaseReturnNoteAppService;
|
|
private readonly IPrhHistRepository _prhHistRepository;
|
|
|
|
private readonly IConfiguration _configuration;
|
|
|
|
private readonly IItemBasicAppService _itemBasicAppService;
|
|
|
|
public PrhHistAppService(
|
|
IPurchaseReceiptNoteAppService purchaseReceiptNoteAppService,
|
|
IPurchaseReturnNoteAppService purchaseReturnNoteAppService,
|
|
IItemBasicAppService itemBasicAppService,
|
|
IPrhHistRepository prhHistRepository,
|
|
IConfiguration configuration
|
|
)
|
|
{
|
|
_purchaseReceiptNoteAppService = purchaseReceiptNoteAppService;
|
|
_purchaseReturnNoteAppService = purchaseReturnNoteAppService;
|
|
_prhHistRepository = prhHistRepository;
|
|
_configuration = configuration;
|
|
_itemBasicAppService = itemBasicAppService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 采购收货单(Receipt)和退货单(Return)
|
|
/// </summary>
|
|
/// <param name="input">QAD采购收货单(Receipt)</param>
|
|
/// <returns></returns>
|
|
[HttpPost("")]
|
|
[Volo.Abp.Uow.UnitOfWork(isTransactional: false)]
|
|
public virtual async Task<ActionResult<PrhHistDto>> AddAsync(PrhHistInput input)
|
|
{
|
|
|
|
var entityObj = ObjectMapper.Map<PrhHistInput, PrhHist>(input);
|
|
try
|
|
{
|
|
//调用业务接口前,先做业务数据校验
|
|
//数据格式校验使用ABP提供的校验模块(Application.Contract.XXXInputValidator),不需要在这里实现
|
|
Validator.CheckSite(_configuration, entityObj.Site);
|
|
Validator.CheckCompany(_configuration, entityObj.Company);
|
|
|
|
//获取零件的基本信息
|
|
ItemBasicDTO itemBasic = await _itemBasicAppService.GetByCodeAsync(input.Part).ConfigureAwait(false);
|
|
|
|
string poNumber = entityObj.PoNumber; //收货单号
|
|
|
|
int line = entityObj.Line; //line
|
|
|
|
#region 特殊转换
|
|
|
|
if (entityObj.ReceiveType == "") //收货单
|
|
{
|
|
//获取之前的收货单在不在,在就获取之前的收货单
|
|
|
|
try
|
|
{
|
|
var existNote = await _purchaseReceiptNoteAppService.GetByNumberAsync(poNumber).ConfigureAwait(false);
|
|
|
|
if (existNote != null)
|
|
{
|
|
//在的话就添加或者更新明细
|
|
|
|
var existNoteDetail = existNote.Details.FirstOrDefault(p => p.PoLine == line.ToString()
|
|
&& p.PoLine == line.ToString()
|
|
&& p.PackingCode == entityObj.PackageNumber
|
|
&& p.ItemCode == entityObj.Part
|
|
&& p.Lot == entityObj.Lot);
|
|
|
|
//如果明细存在的话就认为当前数据重复了,不做处理。数量问题暂认为不会出现
|
|
if (existNoteDetail != null)
|
|
{
|
|
#region 跟WMS不错处理,直接在DataExchange中记录错误
|
|
//跟WMS不错处理,直接在DataExchange中记录错误
|
|
|
|
entityObj.ErrorCode = 9;
|
|
entityObj.ErrorMessage = $"该明细已经在WMS收货单中存在,收货单号为{poNumber},行{line.ToString()},箱码{entityObj.PackageNumber},零件号{entityObj.Part},批次{entityObj.Lot}";
|
|
|
|
//existNoteDetail.PoNumber = entityObj.PoNumber;
|
|
//existNoteDetail.PoLine = entityObj.Line.ToString();
|
|
//existNoteDetail.PackingCode = entityObj.PackageNumber;
|
|
////palletNumber 托盘标签号 Pallet Number
|
|
//existNoteDetail.ContainerCode = entityObj.PalletNumber;
|
|
//existNoteDetail.Item = new Shared.Domain.Item();
|
|
//existNoteDetail.Item =new Item(itemBasic.Id, itemBasic.Name, itemBasic.Desc1, itemBasic.Desc2);
|
|
|
|
////part 零件号 Truck license plate number
|
|
//existNoteDetail.ItemCode = entityObj.Part;
|
|
////lot 批次 lot
|
|
//existNoteDetail.Lot = entityObj.Lot;
|
|
|
|
//var expireDate = DateTime.Now.AddDays(365);
|
|
////vendorLot 供应商批次 Vendor lot
|
|
//existNoteDetail.Batch = new Shared.Domain.Batch();
|
|
|
|
//if (itemBasic.ValidityUnit == EnumValidityUnit.Day)
|
|
//{
|
|
// expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity);
|
|
//}
|
|
//else if (itemBasic.ValidityUnit == EnumValidityUnit.WeeK)
|
|
//{
|
|
// expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity * 7);
|
|
//}
|
|
//else if (itemBasic.ValidityUnit == EnumValidityUnit.Month)
|
|
//{
|
|
// expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity * 30);
|
|
//}
|
|
//existNoteDetail.Batch = new Batch(entityObj.VendorLot, entityObj.ProductionDate, expireDate);
|
|
|
|
//existNoteDetail.Qty = new Shared.Domain.UomQty();
|
|
//existNoteDetail.Qty = new UomQty(entityObj.Um, entityObj.Qty);
|
|
|
|
////暂时不设置
|
|
////detailInput.StdPack = itemBasic.StdPack;
|
|
//existNoteDetail.Remark = entityObj.Remark;
|
|
////dock 收货口 Dock
|
|
//existNoteDetail.LocationCode = entityObj.Dock;
|
|
////whse 仓库 Warehouse
|
|
//existNoteDetail.WarehouseCode = entityObj.Whse;
|
|
#endregion
|
|
}
|
|
|
|
//如果之前的明细已经存在就更新明细没有进直接add明细
|
|
else
|
|
{
|
|
#region 创建 PurchaseReceiptNoteDetailInput
|
|
//PurchaseReceiptNoteDetailDTO
|
|
PurchaseReceiptNoteDetailDTO detailInput = new PurchaseReceiptNoteDetailDTO();
|
|
detailInput.MasterID = existNote.Id;
|
|
|
|
detailInput.Number = existNote.Number;
|
|
|
|
detailInput.PoNumber = entityObj.PoNumber;
|
|
detailInput.PoLine = entityObj.Line.ToString();
|
|
detailInput.PackingCode = entityObj.PackageNumber;
|
|
//palletNumber 托盘标签号 Pallet Number
|
|
detailInput.ContainerCode = entityObj.PalletNumber;
|
|
detailInput.ItemName = itemBasic.Name;
|
|
detailInput.ItemDesc1 = itemBasic.Desc1;
|
|
detailInput.ItemDesc2 = itemBasic.Desc2;
|
|
|
|
//part 零件号 Truck license plate number
|
|
detailInput.ItemCode = entityObj.Part;
|
|
//lot 批次 lot
|
|
detailInput.Lot = entityObj.Lot;
|
|
|
|
var expireDate = DateTime.Now.AddDays(365);
|
|
//vendorLot 供应商批次 Vendor lot
|
|
|
|
if (itemBasic.ValidityUnit == EnumValidityUnit.Day)
|
|
{
|
|
expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity);
|
|
}
|
|
else if (itemBasic.ValidityUnit == EnumValidityUnit.WeeK)
|
|
{
|
|
expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity * 7);
|
|
}
|
|
else if (itemBasic.ValidityUnit == EnumValidityUnit.Month)
|
|
{
|
|
expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity * 30);
|
|
}
|
|
|
|
detailInput.SupplierBatch = entityObj.VendorLot;
|
|
detailInput.ProduceDate = entityObj.ProductionDate;
|
|
detailInput.ExpireDate = expireDate;
|
|
|
|
detailInput.Uom = entityObj.Um;
|
|
detailInput.Qty = entityObj.Qty;
|
|
|
|
//暂时不设置
|
|
//detailInput.StdPack = itemBasic.StdPack;
|
|
detailInput.Remark = entityObj.Remark;
|
|
//dock 收货口 Dock
|
|
detailInput.LocationCode = entityObj.LocationCode;
|
|
detailInput.Status = entityObj.Status;
|
|
|
|
#endregion
|
|
await _purchaseReceiptNoteAppService.AddDetailListAsync(existNote.Id, new List<PurchaseReceiptNoteDetailDTO>() { detailInput }).ConfigureAwait(false);
|
|
}
|
|
|
|
//更新这个收货单
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
// else
|
|
//{
|
|
#region 创建PurchaseReceiptNoteCreateInput
|
|
//如果之前的收货单不存在,就创建主表信息
|
|
PurchaseReceiptNoteEditInput noteInput = new PurchaseReceiptNoteEditInput();
|
|
|
|
// 到货单号receiveNumber 收货单 Receive number
|
|
noteInput.PurchaseReceiptRequestNumber = entityObj.ReceiveNumber;
|
|
|
|
// 发货单号
|
|
noteInput.AsnNumber = entityObj.AsnNumber;
|
|
|
|
// 要货计划单号 要货需求 request number
|
|
noteInput.RpNumber = entityObj.Request; ;
|
|
|
|
// 订单号
|
|
noteInput.PoNumber = entityObj.PoNumber; ;
|
|
|
|
// 供应商代码
|
|
noteInput.SupplierCode = entityObj.Vendor;
|
|
|
|
// 收货时间 收货时间 Receive date
|
|
noteInput.ReceiveTime = entityObj.ReceiveDate;
|
|
|
|
// 任务代码(wms自己的)
|
|
//noteInput.JobNumber =entityObj.Line;
|
|
|
|
// 类型
|
|
noteInput.Type = EnumPurchaseReceiptNoteType.GeneralReceipt;
|
|
|
|
// 状态
|
|
noteInput.Status = EnumPurchaseReceiptNoteStatus.Complete;
|
|
|
|
// 操作员 采购员 buyer
|
|
noteInput.Worker = entityObj.Buyer;
|
|
|
|
//// 单据号(WMS 自己的单号)
|
|
//noteInput.Number { get; protected set; }
|
|
|
|
// 公司 company 公司 Company code
|
|
noteInput.Number = entityObj.ReceiveNumber;
|
|
noteInput.JobNumber = "";
|
|
noteInput.Remark = "";
|
|
|
|
#endregion
|
|
|
|
#region 创建 PurchaseReceiptNoteDetailInput
|
|
//PurchaseReceiptNoteDetailInput
|
|
PurchaseReceiptNoteDetailInput detailInput = new PurchaseReceiptNoteDetailInput();
|
|
|
|
detailInput.PoNumber = entityObj.PoNumber;
|
|
detailInput.PoLine = entityObj.Line.ToString();
|
|
detailInput.PackingCode = entityObj.PackageNumber;
|
|
//palletNumber 托盘标签号 Pallet Number
|
|
detailInput.ContainerCode = entityObj.PalletNumber;
|
|
detailInput.ItemName = itemBasic.Name;
|
|
detailInput.ItemDesc1 = itemBasic.Desc1;
|
|
detailInput.ItemDesc2 = itemBasic.Desc2;
|
|
|
|
//part 零件号 Truck license plate number
|
|
detailInput.ItemCode = entityObj.Part;
|
|
//lot 批次 lot
|
|
detailInput.Lot = entityObj.Lot;
|
|
|
|
var expireDate = DateTime.Now.AddDays(365);
|
|
//vendorLot 供应商批次 Vendor lot
|
|
|
|
if (itemBasic.ValidityUnit == EnumValidityUnit.Day)
|
|
{
|
|
expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity);
|
|
}
|
|
else if (itemBasic.ValidityUnit == EnumValidityUnit.WeeK)
|
|
{
|
|
expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity * 7);
|
|
}
|
|
else if (itemBasic.ValidityUnit == EnumValidityUnit.Month)
|
|
{
|
|
expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity * 30);
|
|
}
|
|
detailInput.SupplierBatch = entityObj.VendorLot;
|
|
detailInput.ProduceDate = entityObj.ProductionDate;
|
|
detailInput.ExpireDate = expireDate;
|
|
|
|
detailInput.Uom = entityObj.Um;
|
|
detailInput.Qty = entityObj.Qty;
|
|
|
|
//暂时不设置
|
|
//detailInput.StdPack = itemBasic.StdPack;
|
|
detailInput.Remark = entityObj.Remark;
|
|
//dock 收货口 Dock
|
|
detailInput.LocationCode = entityObj.LocationCode;
|
|
detailInput.Status = entityObj.Status;
|
|
|
|
noteInput.Details = new List<PurchaseReceiptNoteDetailInput>();
|
|
noteInput.Details.Add(detailInput);
|
|
|
|
#endregion
|
|
|
|
//做对应的插入
|
|
var noteDto = await _purchaseReceiptNoteAppService.CreateAsync(noteInput).ConfigureAwait(false);
|
|
//}
|
|
}
|
|
|
|
}
|
|
|
|
else if (entityObj.ReceiveType == "R") //退货单
|
|
{
|
|
try
|
|
{
|
|
|
|
// 获取之前的收货单在不在,在就获取之前的收货单
|
|
|
|
var existNote = await _purchaseReturnNoteAppService.GetByNumberAsync(poNumber).ConfigureAwait(false);
|
|
|
|
if (existNote != null)
|
|
{
|
|
//在的话就添加或者更新明细
|
|
|
|
var existNoteDetail = existNote.Details.FirstOrDefault(p => p.PoLine == line.ToString()
|
|
&& p.PoLine == line.ToString()
|
|
&& p.PackingCode == entityObj.PackageNumber
|
|
&& p.ItemCode == entityObj.Part
|
|
&& p.Lot == entityObj.Lot);
|
|
|
|
//如果明细存在的话就认为当前数据重复了,不做处理。数量问题暂认为不会出现
|
|
if (existNoteDetail != null)
|
|
{
|
|
#region 跟WMS不错处理,直接在DataExchange中记录错误
|
|
//跟WMS不错处理,直接在DataExchange中记录错误
|
|
|
|
entityObj.ErrorCode = 9;
|
|
entityObj.ErrorMessage = $"该明细已经在WMS退货单中存在,单号为{poNumber},行{line.ToString()},箱码{entityObj.PackageNumber},零件号{entityObj.Part},批次{entityObj.Lot}";
|
|
|
|
#endregion
|
|
}
|
|
|
|
//如果之前的明细已经存在就更新明细没有进直接add明细
|
|
else
|
|
{
|
|
#region 创建 PurchaseReturnNoteDetailInput
|
|
//PurchaseReturnNoteDetailDTO
|
|
PurchaseReturnNoteDetailDTO detailInput = new PurchaseReturnNoteDetailDTO();
|
|
detailInput.MasterID = existNote.Id;
|
|
|
|
detailInput.Number = existNote.Number;
|
|
|
|
detailInput.PoNumber = entityObj.PoNumber;
|
|
detailInput.PoLine = entityObj.Line.ToString();
|
|
detailInput.PackingCode = entityObj.PackageNumber;
|
|
//palletNumber 托盘标签号 Pallet Number
|
|
detailInput.ContainerCode = entityObj.PalletNumber;
|
|
detailInput.ItemName = itemBasic.Name;
|
|
detailInput.ItemDesc1 = itemBasic.Desc1;
|
|
detailInput.ItemDesc2 = itemBasic.Desc2;
|
|
|
|
//part 零件号 Truck license plate number
|
|
detailInput.ItemCode = entityObj.Part;
|
|
//lot 批次 lot
|
|
detailInput.Lot = entityObj.Lot;
|
|
|
|
var expireDate = DateTime.Now.AddDays(365);
|
|
//vendorLot 供应商批次 Vendor lot
|
|
|
|
if (itemBasic.ValidityUnit == EnumValidityUnit.Day)
|
|
{
|
|
expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity);
|
|
}
|
|
else if (itemBasic.ValidityUnit == EnumValidityUnit.WeeK)
|
|
{
|
|
expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity * 7);
|
|
}
|
|
else if (itemBasic.ValidityUnit == EnumValidityUnit.Month)
|
|
{
|
|
expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity * 30);
|
|
}
|
|
detailInput.SupplierBatch = entityObj.VendorLot;
|
|
detailInput.ProduceDate = entityObj.ProductionDate;
|
|
detailInput.ExpireDate = expireDate;
|
|
|
|
detailInput.Uom = entityObj.Um;
|
|
detailInput.Qty = entityObj.Qty;
|
|
|
|
//暂时不设置
|
|
//detailInput.StdPack = itemBasic.StdPack;
|
|
detailInput.Remark = entityObj.Remark;
|
|
detailInput.LocationCode = entityObj.LocationCode;
|
|
detailInput.Status = entityObj.Status;
|
|
|
|
#endregion
|
|
await _purchaseReturnNoteAppService.AddDetailListAsync(existNote.Id, new List<PurchaseReturnNoteDetailDTO>() { detailInput }).ConfigureAwait(false);
|
|
}
|
|
|
|
//更新这个收货单
|
|
}
|
|
|
|
}
|
|
catch (Exception)
|
|
|
|
{
|
|
#region 创建PurchaseReceiptNoteCreateInput
|
|
//如果之前的收货单不存在,就创建主表信息
|
|
PurchaseReturnNoteEditInput noteInput = new PurchaseReturnNoteEditInput();
|
|
|
|
// 到货单号receiveNumber 收货单 Receive number
|
|
//noteInput.PurchaseReceiptRequestNumber = entityObj.ReceiveNumber;
|
|
|
|
// 发货单号
|
|
noteInput.AsnNumber = entityObj.AsnNumber;
|
|
|
|
// 要货计划单号 要货需求 request number
|
|
//noteInput.RpNumber = entityObj.Request; ;
|
|
|
|
// 订单号
|
|
noteInput.PoNumber = entityObj.PoNumber; ;
|
|
|
|
// 供应商代码
|
|
noteInput.SupplierCode = entityObj.Vendor;
|
|
|
|
// 收货时间 收货时间 Receive date
|
|
//noteInput.ReceiveTime = entityObj.ReceiveDate;
|
|
|
|
// 任务代码(wms自己的)
|
|
//noteInput.JobNumber =entityObj.Line;
|
|
|
|
// 类型
|
|
//noteInput.Type = EnumPurchaseReturnNoteType.GeneralReceipt;
|
|
|
|
// 状态
|
|
noteInput.ReturnTime = Clock.Now;
|
|
noteInput.Status = EnumPurchaseReturnNoteStatus.Complete;
|
|
|
|
// 操作员 采购员 buyer
|
|
noteInput.Worker = entityObj.Buyer;
|
|
|
|
//// 单据号(WMS 自己的单号)
|
|
//noteInput.Number { get; protected set; }
|
|
|
|
// 公司 company 公司 Company code
|
|
noteInput.Number = entityObj.ReceiveNumber;
|
|
noteInput.JobNumber = "";
|
|
noteInput.Remark = "";
|
|
#endregion
|
|
|
|
#region 创建 PurchaseReturnNoteDetailInput
|
|
//PurchaseReturnNoteDetailInput
|
|
PurchaseReturnNoteDetailInput detailInput = new PurchaseReturnNoteDetailInput();
|
|
|
|
detailInput.PoNumber = entityObj.PoNumber;
|
|
detailInput.PoLine = entityObj.Line.ToString();
|
|
detailInput.PackingCode = entityObj.PackageNumber;
|
|
//palletNumber 托盘标签号 Pallet Number
|
|
detailInput.ContainerCode = entityObj.PalletNumber;
|
|
detailInput.ItemName = itemBasic.Name;
|
|
detailInput.ItemDesc1 = itemBasic.Desc1;
|
|
detailInput.ItemDesc2 = itemBasic.Desc2;
|
|
|
|
//part 零件号 Truck license plate number
|
|
detailInput.ItemCode = entityObj.Part;
|
|
//lot 批次 lot
|
|
detailInput.Lot = entityObj.Lot;
|
|
|
|
var expireDate = DateTime.Now.AddDays(365);
|
|
//vendorLot 供应商批次 Vendor lot
|
|
|
|
if (itemBasic.ValidityUnit == EnumValidityUnit.Day)
|
|
{
|
|
expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity);
|
|
}
|
|
else if (itemBasic.ValidityUnit == EnumValidityUnit.WeeK)
|
|
{
|
|
expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity * 7);
|
|
}
|
|
else if (itemBasic.ValidityUnit == EnumValidityUnit.Month)
|
|
{
|
|
expireDate = entityObj.ProductionDate.AddDays(itemBasic.Validity * 30);
|
|
}
|
|
detailInput.SupplierBatch = entityObj.VendorLot;
|
|
detailInput.ProduceDate = entityObj.ProductionDate;
|
|
detailInput.ExpireDate = expireDate;
|
|
|
|
detailInput.Uom = entityObj.Um;
|
|
detailInput.Qty = entityObj.Qty;
|
|
|
|
//暂时不设置
|
|
//detailInput.StdPack = itemBasic.StdPack;
|
|
detailInput.Remark = entityObj.Remark;
|
|
//dock 收货口 Dock
|
|
detailInput.LocationCode = entityObj.LocationCode;
|
|
detailInput.Status = entityObj.Status;
|
|
|
|
noteInput.Details = new List<PurchaseReturnNoteDetailInput>();
|
|
noteInput.Details.Add(detailInput);
|
|
|
|
#endregion
|
|
|
|
//做对应的插入
|
|
await _purchaseReturnNoteAppService.CreateAsync(noteInput).ConfigureAwait(false);
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
catch (AbpValidationException ex)
|
|
{
|
|
var baseEx = string.Join(";", ex.ValidationErrors);
|
|
entityObj.ErrorCode = 1;
|
|
entityObj.ErrorMessage = baseEx;
|
|
}
|
|
|
|
catch (Exception ex)
|
|
{
|
|
var baseEx = ex.GetBaseException();
|
|
entityObj.ErrorCode = 1;
|
|
entityObj.ErrorMessage = baseEx.Message;
|
|
}
|
|
var ret = await _prhHistRepository.InsertAsync(entityObj, true).ConfigureAwait(false);
|
|
|
|
var dto = ObjectMapper.Map<PrhHist, PrhHistDto>(entityObj);
|
|
dto.CreationTime = Clock.Now;
|
|
if (dto.ErrorCode != 0)
|
|
{
|
|
throw new AbpValidationException(new List<ValidationResult>
|
|
{
|
|
new(dto.ErrorMessage)
|
|
});
|
|
}
|
|
else
|
|
{
|
|
return new OkObjectResult(dto);
|
|
}
|
|
}
|
|
|
|
}
|
|
|