Browse Source

只打印不改变原有逻辑

master
qian 4 months ago
parent
commit
b97c116b90
  1. 13
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs
  2. 6
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbReceiptRepository.cs

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

@ -104,8 +104,9 @@ namespace Win_in.Sfs.Scp.WebApi
{
Validator.CheckSupplierCode(_taVenderRepository, entity.Site, entity.SupplierCode);
flag = await _tbReceiptRepository.GetCountAsync(ObjectMapper.Map<Receipt, TB_RECEIVE_QAD>(entity));
await UpsertTbReceiptAndTbReceiptDetailAsync(entity, tenant.Id, flag);
/*flag = */
await _tbReceiptRepository.GetCountAsync(ObjectMapper.Map<Receipt, TB_RECEIVE_QAD>(entity));
await UpsertTbReceiptAndTbReceiptDetailAsync(entity, tenant.Id/*, flag*/);
await CurrentUnitOfWork.SaveChangesAsync();
}
}
@ -134,17 +135,17 @@ namespace Win_in.Sfs.Scp.WebApi
}
}
private async Task UpsertTbReceiptAndTbReceiptDetailAsync(Receipt entity, Guid tenantId,bool flag)
private async Task UpsertTbReceiptAndTbReceiptDetailAsync(Receipt entity, Guid tenantId/*,bool flag*/)
{
//使用AutoMapper执行类型转换
var tbReceipt = ObjectMapper.Map<Receipt, TB_RECEIVE_QAD>(entity);
var tbReceiveDetail = ObjectMapper.Map<Receipt, TB_RECEIVE_DETAIL_QAD>(entity);
tbReceipt.TenantId = tenantId;
if (flag)
{
//if (flag)
//{
//根据传入数据新增或修改SCP数据
await _tbReceiptRepository.UpsertAsync(tbReceipt);
}
//}
tbReceiveDetail.TenantId = tenantId;
//根据传入数据新增或修改SCP数据
await _tbReceiptDetailRepository.UpsertAsync(tbReceiveDetail);

6
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbReceiptRepository.cs

@ -50,8 +50,10 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
if (count>0)
{
flag = false;
Console.WriteLine("TB_RECEIVE_QAD存在!Site = " + tbReceipt.Site + " ErpRecvBillNum = " + tbReceipt.ErpRecvBillNum);
Console.WriteLine("TB_RECEIVE_QAD存在!Site = " + tbReceipt.Site + " ErpRecvBillNum = " +
tbReceipt.ErpRecvBillNum + " AsnBillNum = " + tbReceipt.AsnBillNum + " BillType = " + tbReceipt.BillType + " CreateTime = " + tbReceipt.CreateTime);
}
return flag;

Loading…
Cancel
Save