From b97c116b90668883871e81e4447a37916620b7b1 Mon Sep 17 00:00:00 2001 From: qian Date: Tue, 6 Aug 2024 11:05:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E6=89=93=E5=8D=B0=E4=B8=8D=E6=94=B9?= =?UTF-8?q?=E5=8F=98=E5=8E=9F=E6=9C=89=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Receipts/ReceiptAppService.cs | 13 +++++++------ .../Repositories/TbReceiptRepository.cs | 6 ++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs index 36f66d8..9e943c5 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs +++ b/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(entity)); - await UpsertTbReceiptAndTbReceiptDetailAsync(entity, tenant.Id, flag); + /*flag = */ + await _tbReceiptRepository.GetCountAsync(ObjectMapper.Map(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(entity); var tbReceiveDetail = ObjectMapper.Map(entity); tbReceipt.TenantId = tenantId; - if (flag) - { + //if (flag) + //{ //根据传入数据新增或修改SCP数据 await _tbReceiptRepository.UpsertAsync(tbReceipt); - } + //} tbReceiveDetail.TenantId = tenantId; //根据传入数据新增或修改SCP数据 await _tbReceiptDetailRepository.UpsertAsync(tbReceiveDetail); diff --git a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbReceiptRepository.cs b/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbReceiptRepository.cs index 91e14a5..ad97212 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbReceiptRepository.cs +++ b/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;