|
|
@ -14,6 +14,7 @@ using Volo.Abp.Validation; |
|
|
|
using Win_in.Sfs.Scp.v1.Domain; |
|
|
|
using Volo.Abp.TenantManagement; |
|
|
|
using Microsoft.IdentityModel.Logging; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
|
|
|
|
namespace Win_in.Sfs.Scp.WebApi |
|
|
|
{ |
|
|
@ -98,15 +99,22 @@ namespace Win_in.Sfs.Scp.WebApi |
|
|
|
Validator.CheckSite(_tenantRepository, entity.Site); |
|
|
|
Validator.CheckSite(_tenantRepository, entity.Company); |
|
|
|
var tenant = await _tenantStore.FindAsync(entity.Site); |
|
|
|
//bool flag = true;
|
|
|
|
bool flag = true; |
|
|
|
using (CurrentTenant.Change(tenant.Id, tenant.Name)) |
|
|
|
{ |
|
|
|
using (_dataFilter.Disable<IMultiTenant>()) |
|
|
|
{ |
|
|
|
|
|
|
|
Validator.CheckSupplierCode(_taVenderRepository, entity.Site, entity.SupplierCode); |
|
|
|
/*flag = */ |
|
|
|
await _tbReceiptRepository.GetCountAsync(ObjectMapper.Map<Receipt, TB_RECEIVE_QAD>(entity)); |
|
|
|
flag =await _tbReceiptRepository.GetCountAsync(ObjectMapper.Map<Receipt, TB_RECEIVE_QAD>(entity)); |
|
|
|
if (!flag) |
|
|
|
{ |
|
|
|
var tbReceipt = ObjectMapper.Map<Receipt, TB_RECEIVE_QAD>(entity); |
|
|
|
Logger.LogInformation("TB_RECEIVE_QAD存在!Site = " + tbReceipt.Site + " ErpRecvBillNum = " + |
|
|
|
tbReceipt.ErpRecvBillNum + " AsnBillNum = " + tbReceipt.AsnBillNum + " BillType = " + tbReceipt.BillType + " CreateTime = " + tbReceipt.CreateTime + |
|
|
|
" State = " + tbReceipt.State |
|
|
|
); |
|
|
|
} |
|
|
|
await UpsertTbReceiptAndTbReceiptDetailAsync(entity, tenant.Id/*, flag*/); |
|
|
|
|
|
|
|
} |
|
|
@ -115,12 +123,13 @@ namespace Win_in.Sfs.Scp.WebApi |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
var qad = ObjectMapper.Map<Receipt, TB_RECEIVE_QAD>(entity); |
|
|
|
LogHelper.LogInformation("TB_RECEIVE_QAD!Site = " + qad.Site + " ErpRecvBillNum = " + |
|
|
|
|
|
|
|
Logger.LogInformation("TB_RECEIVE_QAD!Site = " + qad.Site + " ErpRecvBillNum = " + |
|
|
|
qad.ErpRecvBillNum + " AsnBillNum = " + qad.AsnBillNum + " BillType = " + qad.BillType + " CreateTime = " + qad.CreateTime + |
|
|
|
" State = " + qad.State |
|
|
|
); |
|
|
|
var detail_qad = ObjectMapper.Map<Receipt,TB_RECEIVE_DETAIL_QAD>(entity); |
|
|
|
LogHelper.LogInformation("TB_RECEIVE_DETAIL_QAD!Site = " + detail_qad.Site + " ErpRecvBillNum = " + |
|
|
|
Logger.LogInformation("TB_RECEIVE_DETAIL_QAD!Site = " + detail_qad.Site + " ErpRecvBillNum = " + |
|
|
|
detail_qad.ErpRecvBillNum + " PoLine = " + detail_qad.PoLine + " BillType = " + detail_qad.BillType + " CreateTime = " + detail_qad.CreateTime + |
|
|
|
" State = " + detail_qad.State + " qty = " + detail_qad.Qty + " DockCode = " + detail_qad.DockCode + " Batch =" + detail_qad.Batch + |
|
|
|
" VendBatch = " + detail_qad.VendBatch + " Remark =" + detail_qad.Remark + " PoUnit= " + detail_qad.PoUnit + " Rate =" + detail_qad.Rate |
|
|
|