Browse Source

日志

master
qian 4 months ago
parent
commit
293d84d5c3
  1. 15
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs
  2. 12
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbReceiptDetailRepository.cs
  3. 24
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbReceiptRepository.cs

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

@ -13,6 +13,7 @@ using Volo.Abp.Uow;
using Volo.Abp.Validation;
using Win_in.Sfs.Scp.v1.Domain;
using Volo.Abp.TenantManagement;
using Microsoft.IdentityModel.Logging;
namespace Win_in.Sfs.Scp.WebApi
{
@ -107,12 +108,23 @@ namespace Win_in.Sfs.Scp.WebApi
/*flag = */
await _tbReceiptRepository.GetCountAsync(ObjectMapper.Map<Receipt, TB_RECEIVE_QAD>(entity));
await UpsertTbReceiptAndTbReceiptDetailAsync(entity, tenant.Id/*, flag*/);
await CurrentUnitOfWork.SaveChangesAsync();
}
}
}
catch (Exception ex)
{
var qad = ObjectMapper.Map<Receipt, TB_RECEIVE_QAD>(entity);
LogHelper.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 = " +
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
);
var baseEx = ex.GetBaseException();
entity.ErrorCode = 1;
entity.ErrorMessage = baseEx.Message;
@ -149,6 +161,7 @@ namespace Win_in.Sfs.Scp.WebApi
tbReceiveDetail.TenantId = tenantId;
//根据传入数据新增或修改SCP数据
await _tbReceiptDetailRepository.UpsertAsync(tbReceiveDetail);
await CurrentUnitOfWork.SaveChangesAsync();
}
}
}

12
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbReceiptDetailRepository.cs

@ -1,5 +1,6 @@
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Logging;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Win_in.Sfs.Scp.v1.Domain;
@ -22,6 +23,11 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
if (current == null)
{
ret = await InsertAsync(tbReceiptDetail);
LogHelper.LogInformation("TB_RECEIVE_QAD不存在!Site = " + tbReceiptDetail.Site + " ErpRecvBillNum = " +
tbReceiptDetail.ErpRecvBillNum + " PoLine = " + tbReceiptDetail.PoLine + " BillType = " + tbReceiptDetail.BillType + " CreateTime = " + tbReceiptDetail.CreateTime +
" State = " + tbReceiptDetail.State +" qty = "+ tbReceiptDetail.Qty + " DockCode = " + tbReceiptDetail.DockCode + " Batch =" +tbReceiptDetail.Batch +
" VendBatch = " + tbReceiptDetail.VendBatch + " Remark ="+ tbReceiptDetail.Remark + " PoUnit= " + tbReceiptDetail.PoUnit + " Rate ="+ tbReceiptDetail.Rate
);
}
else
{
@ -42,7 +48,11 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
current.LocUnit = tbReceiptDetail.LocUnit;
current.Rate = tbReceiptDetail.Rate;
current.Extend3 = tbReceiptDetail.Extend3;
LogHelper.LogInformation("TB_RECEIVE_QAD存在!Site = " + tbReceiptDetail.Site + " ErpRecvBillNum = " +
tbReceiptDetail.ErpRecvBillNum + " PoLine = " + tbReceiptDetail.PoLine + " BillType = " + tbReceiptDetail.BillType + " CreateTime = " + tbReceiptDetail.CreateTime +
" State = " + tbReceiptDetail.State + " qty = " + tbReceiptDetail.Qty + " DockCode = " + tbReceiptDetail.DockCode + " Batch =" + tbReceiptDetail.Batch +
" VendBatch = " + tbReceiptDetail.VendBatch + " Remark =" + tbReceiptDetail.Remark + " PoUnit= " + tbReceiptDetail.PoUnit + " Rate =" + tbReceiptDetail.Rate
);
ret = await UpdateAsync(current);
}

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

@ -4,6 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Logging;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.ObjectExtending;
using Win_in.Sfs.Scp.v1.Domain;
namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
@ -22,6 +23,10 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
&& p.ErpRecvBillNum == tbReceipt.ErpRecvBillNum);
if (current == null)
{
LogHelper.LogInformation("TB_RECEIVE_QAD不存在!Site = " + tbReceipt.Site + " ErpRecvBillNum = " +
tbReceipt.ErpRecvBillNum + " AsnBillNum = " + tbReceipt.AsnBillNum + " BillType = " + tbReceipt.BillType + " CreateTime = " + tbReceipt.CreateTime +
" State = " + tbReceipt.State
);
ret = await InsertAsync(tbReceipt);
}
else
@ -34,10 +39,13 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
current.Remark = tbReceipt.Remark;
current.State = tbReceipt.State;
current.BillType = tbReceipt.BillType;
LogHelper.LogInformation("TB_RECEIVE_QAD存在!Site = " + tbReceipt.Site + " ErpRecvBillNum = " +
tbReceipt.ErpRecvBillNum + " AsnBillNum = " + tbReceipt.AsnBillNum + " BillType = " + tbReceipt.BillType + " CreateTime = " + tbReceipt.CreateTime +
" State = " + tbReceipt.State
);
ret = await UpdateAsync(current);
}
return ret;
}
public async Task<bool> GetCountAsync(TB_RECEIVE_QAD tbReceipt)
@ -54,10 +62,18 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
Console.WriteLine("TB_RECEIVE_QAD存在!Site = " + tbReceipt.Site + " ErpRecvBillNum = " +
tbReceipt.ErpRecvBillNum + " AsnBillNum = " + tbReceipt.AsnBillNum + " BillType = " + tbReceipt.BillType + " CreateTime = " + tbReceipt.CreateTime);
LogHelper.LogInformation("TB_RECEIVE_QAD存在!Site = " + tbReceipt.Site + " ErpRecvBillNum = " +
tbReceipt.ErpRecvBillNum + " AsnBillNum = " + tbReceipt.AsnBillNum + " BillType = " + tbReceipt.BillType + " CreateTime = " + tbReceipt.CreateTime);
tbReceipt.ErpRecvBillNum + " AsnBillNum = " + tbReceipt.AsnBillNum + " BillType = " + tbReceipt.BillType + " CreateTime = " + tbReceipt.CreateTime +
" State = " + tbReceipt.State
);
}
else
{
LogHelper.LogInformation("TB_RECEIVE_QAD不存在!Site = " + tbReceipt.Site + " ErpRecvBillNum = " +
tbReceipt.ErpRecvBillNum + " AsnBillNum = " + tbReceipt.AsnBillNum + " BillType = " + tbReceipt.BillType + " CreateTime = " + tbReceipt.CreateTime+
" State = "+ tbReceipt.State
);
}
return flag;
}

Loading…
Cancel
Save