From 353d4b7c1e8990259d4cf2b53059e38160d685c8 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 11 Apr 2023 16:44:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=B4=A7=E7=BA=B8?= =?UTF-8?q?=E6=AF=94=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskShippingOrderCompareService.cs | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskShippingOrderCompareService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskShippingOrderCompareService.cs index 6b64b071..26be0dd7 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskShippingOrderCompareService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskShippingOrderCompareService.cs @@ -32,12 +32,16 @@ namespace Myshipping.Application private readonly SqlSugarRepository _bookingOrderRepository; private readonly SqlSugarRepository _bookingOrderContaRepository; - private readonly SqlSugarRepository _userRepository; + //private readonly SqlSugarRepository _userRepository; - public TaskShippingOrderCompareService(ISysCacheService cache, ILogger logger) + public TaskShippingOrderCompareService(ISysCacheService cache, ILogger logger, + SqlSugarRepository bookingOrderRepository, SqlSugarRepository bookingOrderContaRepository) { _cache = cache; _logger = logger; + + _bookingOrderRepository = bookingOrderRepository; + _bookingOrderContaRepository = bookingOrderContaRepository; } /// /// 执行下货纸比对 @@ -95,6 +99,9 @@ namespace Myshipping.Application var mainInfo = model.Adapt(); mainInfo.BusiPKId = model.Id.ToString(); + mainInfo.UserId = UserManager.UserId.ToString(); + mainInfo.UserName = UserManager.Name; + mainInfo.UserEmail = UserManager.Email; var contaList = await _bookingOrderContaRepository.AsQueryable().Where(x => x.BILLID == model.Id).ToListAsync(); @@ -111,7 +118,7 @@ namespace Myshipping.Application DateTime bDate = DateTime.Now; - var ruleResult = await ExcuteRulesEngine(msgModel); + var ruleResult = await ExcuteCompare(msgModel); DateTime eDate = DateTime.Now; TimeSpan ts = eDate.Subtract(bDate); @@ -123,9 +130,19 @@ namespace Myshipping.Application throw Oops.Oh($"订舱主键{bookingId}请求下货纸比对失败,返回为空"); result.succ = ruleResult.succ; + + if(ruleResult.total > 0 ) + { + result.msg = "比对完成,比对数据差异"; + } + + _logger.LogInformation("批次={no} 请求下货纸比对返回结果{msg}", batchNo, JSON.Serialize(ruleResult)); + /* result.msg = ruleResult.msg; result.extra = ruleResult.extra; result.extra2 = ruleResult.extra2; + */ + _logger.LogInformation("批次={no} 返回结果{msg}", batchNo, JSON.Serialize(result)); } @@ -168,10 +185,17 @@ namespace Myshipping.Application throw Oops.Oh($"以下主键信息 {noRecord} 检索失败或者已作废过"); } + List rltList = new List(); + list.ForEach(async entity => { - await InnerExcuteShippingOrderCompareAsync(entity.Id.ToString()); + var curRlt = await InnerExcuteShippingOrderCompareAsync(entity.Id.ToString()); + + rltList.Add(curRlt); }); + + result.succ = true; + result.msg = "比对完成"; } catch (Exception ex) { @@ -220,7 +244,7 @@ namespace Myshipping.Application /// /// [NonAction] - private async Task ExcuteRulesEngine(TaskMessageInfoDto info) + private async Task ExcuteCompare(TaskMessageInfoDto info) { TaskManageExcuteResultDto model = null; /*