diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml index 9d9a8fb4..e75e1233 100644 --- a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml +++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml @@ -3712,6 +3712,15 @@ + + + 打印日志 + + + + + + 即时库存-服务 diff --git a/src/WMS.Web.Domain/Services/InStockTaskService.cs b/src/WMS.Web.Domain/Services/InStockTaskService.cs index c75f7230..eea90b3d 100644 --- a/src/WMS.Web.Domain/Services/InStockTaskService.cs +++ b/src/WMS.Web.Domain/Services/InStockTaskService.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using WMS.Web.Core; using WMS.Web.Core.Dto; using WMS.Web.Core.Dto.Erp; using WMS.Web.Core.Dto.InStockTask; @@ -163,7 +164,6 @@ namespace WMS.Web.Domain.Services if (!erp_result.IsSuccess) return Result.ReFailure(erp_result.Message, erp_result.Status); var erp_list = erp_result.Data; - _logger.LogInformation("分步式调入条数:" + erp_list.ToList().Count); return await this.SysnData(erp_list.ToList(), isTransaction); } @@ -183,14 +183,12 @@ namespace WMS.Web.Domain.Services return Result.ReFailure(erp_result_ass.Message, erp_result_ass.Status); var erp_list_ass = erp_result_ass.Data; erp_list.AddRange(erp_list_ass); - _logger.LogInformation("组装(成品入库)条数:" + erp_list_ass.Count); //1.1.获取金蝶数据:拆卸子件入库订单数据 var erp_result_disass = await _erpService.BillQueryForAssembledApp_Disassembly(billNos); if (!erp_result_disass.IsSuccess) return Result.ReFailure(erp_result_disass.Message, erp_result_disass.Status); var erp_list_disass = erp_result_disass.Data; erp_list.AddRange(erp_list_disass); - _logger.LogInformation("拆卸(子件入库)条数:" + erp_list_disass.Count); return await this.SysnData(erp_list, isTransaction); } @@ -263,6 +261,9 @@ namespace WMS.Web.Domain.Services /// public async Task SysnData(List erp_list, bool isTransaction) { + var totalCount = erp_list.Count; + var totalUpdateCount = 0; + var totalAddCount = 0; //1.通过单据编号找到wms系统现有的任务单;并修改 var erp_remove_billNo = new List(); var SourceBillNo_list = erp_list.GroupBy(x => x.BillNo).Select(x => x.Key).ToList(); @@ -298,6 +299,8 @@ namespace WMS.Web.Domain.Services item.AccruedQty = erp_data.Qty; item.FactoryPrice = erp_data.FactoryPrice; item.DeliveredQty = erp_data.DeliveredQty> item.DeliveredQty? erp_data.DeliveredQty: item.DeliveredQty; + //打印日志:需要的修改条数 + totalUpdateCount++; erp_remove_billNo.Add(data.SourceBillNo); } } @@ -315,12 +318,12 @@ namespace WMS.Web.Domain.Services { erp_list.RemoveAll(x => x.BillNo == item); } + //打印日志:需要的添加条数 + totalAddCount = erp_list.Count; } - if (erp_list.GroupBy(x => x.Type).Select(x => x.Key).FirstOrDefault() == (int)InstockType.Assembled) - _logger.LogInformation("组装拆卸单新增条数:" + erp_list.Count); - if (erp_list.GroupBy(x => x.Type).Select(x => x.Key).FirstOrDefault() == (int)InstockType.StktransferInst) - _logger.LogInformation("分步式调入新增条数:" + erp_list.Count); + //打印日志 + this.LogInfomation((InstockType)erp_list.GroupBy(x => x.Type).Select(x => x.Key).FirstOrDefault(), totalCount, totalUpdateCount, totalAddCount); //3.wms任务单的来源单据编号不存在于erp中,那么就新增 if (erp_list.Count != 0) @@ -368,5 +371,17 @@ namespace WMS.Web.Domain.Services return Result.ReSuccess(); } + + /// + /// 打印日志 + /// + /// + /// + /// + /// + public void LogInfomation(InstockType type, int totalCount,int updateCount,int addCount) + { + _logger.LogInformation($"《{type.GetRemark()}总条数:" + totalCount+",修改条数:"+updateCount+",新增条数:"+addCount+"》"); + } } }