修改格式单比对

optimize
jianghaiqing 1 year ago
parent 52a8930a20
commit c32f52af6e

@ -17,6 +17,7 @@ using Myshipping.Application.Service;
using Myshipping.Core; using Myshipping.Core;
using Myshipping.Core.Entity; using Myshipping.Core.Entity;
using Myshipping.Core.Service; using Myshipping.Core.Service;
using NPOI.SS.Formula.Functions;
using Org.BouncyCastle.Asn1.X9; using Org.BouncyCastle.Asn1.X9;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -44,6 +45,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingCtn> _bookingOrderContaRepository; private readonly SqlSugarRepository<BookingCtn> _bookingOrderContaRepository;
private readonly SqlSugarRepository<BookingFile> _bookingFileRepository; private readonly SqlSugarRepository<BookingFile> _bookingFileRepository;
private readonly SqlSugarRepository<SysUser> _sysUserRepository; private readonly SqlSugarRepository<SysUser> _sysUserRepository;
private readonly IBookingOrderService _bookingOrderService;
const string CONST_DRAFT_FILE_CODE = "draft"; const string CONST_DRAFT_FILE_CODE = "draft";
const string CONST_DRAFT_FILE_NAME = "格式单"; const string CONST_DRAFT_FILE_NAME = "格式单";
@ -51,7 +53,7 @@ namespace Myshipping.Application
public TaskDraftCompareService(ISysCacheService cache, ILogger<TaskDraftCompareService> logger, public TaskDraftCompareService(ISysCacheService cache, ILogger<TaskDraftCompareService> logger,
SqlSugarRepository<BookingOrder> bookingOrderRepository, SqlSugarRepository<BookingCtn> bookingOrderContaRepository, SqlSugarRepository<BookingOrder> bookingOrderRepository, SqlSugarRepository<BookingCtn> bookingOrderContaRepository,
SqlSugarRepository<BookingFile> bookingFileRepository, SqlSugarRepository<SysUser> sysUserRepository) SqlSugarRepository<BookingFile> bookingFileRepository, SqlSugarRepository<SysUser> sysUserRepository, IBookingOrderService bookingOrderService)
{ {
_cache = cache; _cache = cache;
_logger = logger; _logger = logger;
@ -60,6 +62,7 @@ namespace Myshipping.Application
_bookingOrderContaRepository = bookingOrderContaRepository; _bookingOrderContaRepository = bookingOrderContaRepository;
_bookingFileRepository = bookingFileRepository; _bookingFileRepository = bookingFileRepository;
_sysUserRepository = sysUserRepository; _sysUserRepository = sysUserRepository;
_bookingOrderService = bookingOrderService;
} }
#region 执行邮件Draft比对 #region 执行邮件Draft比对
@ -226,7 +229,7 @@ namespace Myshipping.Application
var entity = _bookingOrderRepository.AsQueryable().Filter(null, true) var entity = _bookingOrderRepository.AsQueryable().Filter(null, true)
.First(a => a.Id == bookingOrder.Id && !a.IsDeleted && a.TenantId == long.Parse(model.Main.TenantId)); .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; entity.LstDraftCompareDate = nowDate;
//更新订舱相关 //更新订舱相关
@ -234,9 +237,14 @@ namespace Myshipping.Application
{ {
it.LstDraftCompareDate, it.LstDraftCompareDate,
it.LstDraftCompareRlt it.LstDraftCompareRlt
}).ExecuteCommandAsync(); }).ExecuteCommandAsync();
if (entity.LstDraftCompareRlt == "NO DIFF")
{
//推送状态 HDGSD-核对格式单
await _bookingOrderService.SetGoodsStatusPush("HDGSD", bookingOrder.Id, true);
}
//如果确认文件读取成功 //如果确认文件读取成功
var bookFilePath = await FileAttachHelper.MoveFile(bookingOrder.Id.ToString(), fileFullName, batchNo); var bookFilePath = await FileAttachHelper.MoveFile(bookingOrder.Id.ToString(), fileFullName, batchNo);
@ -773,7 +781,7 @@ namespace Myshipping.Application
var entity = _bookingOrderRepository.AsQueryable().Filter(null, true) var entity = _bookingOrderRepository.AsQueryable().Filter(null, true)
.First(a => a.Id == bookingOrder.Id && !a.IsDeleted && a.TenantId == long.Parse(model.Main.TenantId)); .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; entity.LstDraftCompareDate = nowDate;
//更新订舱相关 //更新订舱相关
@ -784,6 +792,12 @@ namespace Myshipping.Application
}).ExecuteCommandAsync(); }).ExecuteCommandAsync();
if (entity.LstDraftCompareRlt == "NO DIFF")
{
//推送状态 HDGSD-核对格式单
await _bookingOrderService.SetGoodsStatusPush("HDGSD", bookingOrder.Id, true);
}
//如果确认文件读取成功 //如果确认文件读取成功
var bookFilePath = await FileAttachHelper.MoveFile(bookingOrder.Id.ToString(), fileFullName, batchNo); var bookFilePath = await FileAttachHelper.MoveFile(bookingOrder.Id.ToString(), fileFullName, batchNo);

Loading…
Cancel
Save