optimize
wet 1 year ago
parent e454a0d2cc
commit 7ca2026770

@ -12,6 +12,7 @@ using System.Collections.Generic;
using System;
using Myshipping.Core.Service;
using Myshipping.Core.Entity;
using Microsoft.Extensions.Logging;
namespace Myshipping.Application
{
@ -25,12 +26,14 @@ namespace Myshipping.Application
private readonly ISysCacheService _sysCacheService;
private readonly IBookingOrderService _bookingorderservice;
private readonly SqlSugarRepository<BookingOrder> _order;
public BookingVesselInfoService(SqlSugarRepository<DjyVesselInfo> rep, SqlSugarRepository<BookingOrder> order,ISysCacheService sysCacheService,IBookingOrderService bookingorderservice)
private readonly ILogger<DataSyncService> _logger;
public BookingVesselInfoService(SqlSugarRepository<DjyVesselInfo> rep, ILogger<DataSyncService> logger, SqlSugarRepository<BookingOrder> order,ISysCacheService sysCacheService,IBookingOrderService bookingorderservice)
{
_sysCacheService = sysCacheService;
_rep = rep;
_order = order;
_bookingorderservice = bookingorderservice;
this._logger = logger;
}
///// <summary>
///// 获取列表
@ -123,10 +126,11 @@ namespace Myshipping.Application
if ((dto.ETA != null || dto.ETD != null || dto.ATD != null) && !string.IsNullOrEmpty(dto.Vessel) && !string.IsNullOrEmpty(dto.Voyno)&&!string.IsNullOrEmpty(dto.CARRIERID))
{
var order=await _order.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false && x.VESSEL == dto.Vessel && x.VOYNO == dto.Voyno
&&x.CARRIERID==dto.CARRIERID&&x.CARRIER==dto.CARRIER).ToListAsync();
&&x.CARRIERID==dto.CARRIERID).ToListAsync();
bool issend = false;
if (order != null)
{
_logger.LogInformation("手动更新船期:" + order.ToJsonString());
foreach (var it in order)
{
bool flag = false;
@ -141,7 +145,7 @@ namespace Myshipping.Application
it.YgtETD = dto.YgtETD;
}
if (it.ATD != dto.ATD && it.ATD == null)
if (it.ATD != dto.ATD&&dto.ATD!=null)
{
flag = true;

Loading…
Cancel
Save