From c32f52af6e4b76bcfca43edfa77add3c4a8a0581 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Sat, 7 Oct 2023 13:41:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=BC=E5=BC=8F=E5=8D=95?= =?UTF-8?q?=E6=AF=94=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskManagePlat/TaskDraftCompareService.cs | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskDraftCompareService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskDraftCompareService.cs index 070eb71b..24cef730 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskDraftCompareService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskDraftCompareService.cs @@ -17,6 +17,7 @@ using Myshipping.Application.Service; using Myshipping.Core; using Myshipping.Core.Entity; using Myshipping.Core.Service; +using NPOI.SS.Formula.Functions; using Org.BouncyCastle.Asn1.X9; using System; using System.Collections.Generic; @@ -44,6 +45,7 @@ namespace Myshipping.Application private readonly SqlSugarRepository _bookingOrderContaRepository; private readonly SqlSugarRepository _bookingFileRepository; private readonly SqlSugarRepository _sysUserRepository; + private readonly IBookingOrderService _bookingOrderService; const string CONST_DRAFT_FILE_CODE = "draft"; const string CONST_DRAFT_FILE_NAME = "格式单"; @@ -51,7 +53,7 @@ namespace Myshipping.Application public TaskDraftCompareService(ISysCacheService cache, ILogger logger, SqlSugarRepository bookingOrderRepository, SqlSugarRepository bookingOrderContaRepository, - SqlSugarRepository bookingFileRepository, SqlSugarRepository sysUserRepository) + SqlSugarRepository bookingFileRepository, SqlSugarRepository sysUserRepository, IBookingOrderService bookingOrderService) { _cache = cache; _logger = logger; @@ -60,6 +62,7 @@ namespace Myshipping.Application _bookingOrderContaRepository = bookingOrderContaRepository; _bookingFileRepository = bookingFileRepository; _sysUserRepository = sysUserRepository; + _bookingOrderService = bookingOrderService; } #region 执行邮件Draft比对 @@ -226,7 +229,7 @@ namespace Myshipping.Application var entity = _bookingOrderRepository.AsQueryable().Filter(null, true) .First(a => a.Id == bookingOrder.Id && !a.IsDeleted && a.TenantId == long.Parse(model.Main.TenantId)); - entity.LstDraftCompareRlt = compareResult.extra2.Any(a => a.IsDiff) ? "DIFF" : ""; + entity.LstDraftCompareRlt = compareResult.extra2.Any(a => a.IsDiff) ? "DIFF" : "NO DIFF"; entity.LstDraftCompareDate = nowDate; //更新订舱相关 @@ -234,9 +237,14 @@ namespace Myshipping.Application { it.LstDraftCompareDate, it.LstDraftCompareRlt - }).ExecuteCommandAsync(); + if (entity.LstDraftCompareRlt == "NO DIFF") + { + //推送状态 HDGSD-核对格式单 + await _bookingOrderService.SetGoodsStatusPush("HDGSD", bookingOrder.Id, true); + } + //如果确认文件读取成功 var bookFilePath = await FileAttachHelper.MoveFile(bookingOrder.Id.ToString(), fileFullName, batchNo); @@ -773,7 +781,7 @@ namespace Myshipping.Application var entity = _bookingOrderRepository.AsQueryable().Filter(null, true) .First(a => a.Id == bookingOrder.Id && !a.IsDeleted && a.TenantId == long.Parse(model.Main.TenantId)); - entity.LstDraftCompareRlt = compareResult.extra2.Any(a => a.IsDiff) ? "DIFF" : ""; + entity.LstDraftCompareRlt = compareResult.extra2.Any(a => a.IsDiff) ? "DIFF" : "NO DIFF"; entity.LstDraftCompareDate = nowDate; //更新订舱相关 @@ -784,6 +792,12 @@ namespace Myshipping.Application }).ExecuteCommandAsync(); + if (entity.LstDraftCompareRlt == "NO DIFF") + { + //推送状态 HDGSD-核对格式单 + await _bookingOrderService.SetGoodsStatusPush("HDGSD", bookingOrder.Id, true); + } + //如果确认文件读取成功 var bookFilePath = await FileAttachHelper.MoveFile(bookingOrder.Id.ToString(), fileFullName, batchNo);