|
|
|
@ -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<BookingCtn> _bookingOrderContaRepository;
|
|
|
|
|
private readonly SqlSugarRepository<BookingFile> _bookingFileRepository;
|
|
|
|
|
private readonly SqlSugarRepository<SysUser> _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<TaskDraftCompareService> logger,
|
|
|
|
|
SqlSugarRepository<BookingOrder> bookingOrderRepository, SqlSugarRepository<BookingCtn> bookingOrderContaRepository,
|
|
|
|
|
SqlSugarRepository<BookingFile> bookingFileRepository, SqlSugarRepository<SysUser> sysUserRepository)
|
|
|
|
|
SqlSugarRepository<BookingFile> bookingFileRepository, SqlSugarRepository<SysUser> 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);
|
|
|
|
|
|
|
|
|
|