根据船期更新订舱:除和川外添加启运港条件

master
zhangxiaofeng 4 months ago
parent 7a6140f9dd
commit 5a5ae77e4f

@ -14,6 +14,7 @@ using Myshipping.Core.Service;
using Myshipping.Core.Entity; using Myshipping.Core.Entity;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Furion;
namespace Myshipping.Application namespace Myshipping.Application
{ {
@ -158,15 +159,19 @@ namespace Myshipping.Application
&& !string.IsNullOrEmpty(old.Voyno) && !string.IsNullOrEmpty(old.Voyno)
&& !string.IsNullOrEmpty(old.CARRIERID)) && !string.IsNullOrEmpty(old.CARRIERID))
{ {
var order = await _order.AsQueryable() var query = _order.AsQueryable()
.Filter(null, true) .Filter(null, true)
.Where(x => x.TenantId == UserManager.TENANT_ID .Where(x => x.TenantId == UserManager.TENANT_ID
&& x.IsDeleted == false && x.IsDeleted == false
&& x.VESSEL == old.Vessel && x.VESSEL == old.Vessel
&& x.VOYNO == old.Voyno && x.VOYNO == old.Voyno
&& x.CARRIERID == old.CARRIERID) && x.CARRIERID == old.CARRIERID);
.WhereIF(!string.IsNullOrEmpty(old.PortLoadingId), x => x.PORTLOADID == old.PortLoadingId) if (App.Configuration["RunType"] != CommonConst.RUN_TYPE_HECHUAN)
.ToListAsync(); {
query.WhereIF(!string.IsNullOrEmpty(old.PortLoadingId), x => x.PORTLOADID == old.PortLoadingId);
}
var order = await query.ToListAsync();
bool issend = false; bool issend = false;
if (order != null) if (order != null)
{ {

@ -1845,18 +1845,40 @@ namespace Myshipping.Application
UpdatedTime = DateTime.Now UpdatedTime = DateTime.Now
}); });
var orderList = await _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID #region 扣费相关
&& x.IsDeleted == false
&& x.VESSEL == item.Vessel
&& x.VOYNO == item.Voyno).ToListAsync();
//当前租户配置为实际开船后扣费 //当前租户配置为实际开船后扣费
var paraVal = _tenantParamValue.AsQueryable().Filter(null, true).First(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "BOOKING_FEE_METHOD"); var paraVal = _tenantParamValue.AsQueryable().Filter(null, true).First(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "BOOKING_FEE_METHOD");
//有实际开船,扣费 //有实际开船,扣费
if (paraVal != null && paraVal.ItemCode == "ATD" && item.ATD.HasValue) if (paraVal != null && paraVal.ItemCode == "ATD" && item.ATD.HasValue)
{ {
feeIdList.AddRange(orderList.Where(x => !feeIdList.Contains(x.Id)).Select(x => x.Id)); var orderIdList = await _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID
&& x.IsDeleted == false
&& x.VESSEL == item.Vessel
&& x.VOYNO == item.Voyno).Select(x => x.Id).ToListAsync();
feeIdList.AddRange(orderIdList.Where(x => !feeIdList.Contains(x)));
} }
#endregion
// 118订舱系统2024.7.19修改:同一船名航次,启运港不同,船期也会不同;更新订舱时需要判断启运港
// 钉钉审批单号202407121821000478565
var query = _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID
&& x.IsDeleted == false
&& x.VESSEL == item.Vessel
&& x.VOYNO == item.Voyno);
if (App.Configuration["RunType"] != CommonConst.RUN_TYPE_HECHUAN)
{
query.Where(x => string.IsNullOrEmpty(x.PORTLOADID));
}
List<BookingOrder> orderList = await query.Select(x => new BookingOrder
{
Id = x.Id,
StartETA = x.StartETA,
YgtETD = x.YgtETD,
ATD = x.ATD,
StartATA = x.StartATA,
}).ToListAsync();
bool issend = false; bool issend = false;
//批量变更业务数据 //批量变更业务数据
@ -1896,10 +1918,14 @@ namespace Myshipping.Application
{ {
issend = true; issend = true;
await update.Value.Where(b => b.Id == order.Id).ExecuteCommandAsync(); await update.Value.Where(b => b.Id == order.Id).ExecuteCommandAsync();
await _bookingorderservice.SaveLog(newOrder.Value, order, "回推船期"); await _bookingorderservice.SaveLog(newOrder.Value, order, "回推船期", new List<string>()
{
nameof(BookingOrder.StartATA),
nameof(BookingOrder.StartETA),
nameof(BookingOrder.YgtETD),
nameof(BookingOrder.ATD),
});
} }
} }
if (issend) if (issend)
{ {

Loading…
Cancel
Save