修改货物运输计划已变更任务

master
jianghaiqing 6 months ago
parent f2d49379b6
commit a057b4a717

@ -15,6 +15,16 @@ namespace Myshipping.Application.Entity.TaskManagePlat
[Description("货物运输计划已变更明细")] [Description("货物运输计划已变更明细")]
public class TaskTransPlanHasChangeDetailInfo : TaskManageDbEntity public class TaskTransPlanHasChangeDetailInfo : TaskManageDbEntity
{ {
/// <summary>
/// 父主键
/// </summary>
public string P_ID { get; set; }
/// <summary>
/// 顺序号
/// </summary>
public int SORT_NO { get; set; }
/// <summary> /// <summary>
/// 计划方式 FROM-出运计划 TO-到达计划 /// 计划方式 FROM-出运计划 TO-到达计划
/// </summary> /// </summary>
@ -69,5 +79,25 @@ namespace Myshipping.Application.Entity.TaskManagePlat
/// 船旗 /// 船旗
/// </summary> /// </summary>
public string SHIP_FLAG { get; set; } public string SHIP_FLAG { get; set; }
/// <summary>
/// ETA(预计到港时间)
/// </summary>
public Nullable<DateTime> ETA { get; set; }
/// <summary>
/// ETD(预计离港时间)
/// </summary>
public Nullable<DateTime> ETD { get; set; }
/// <summary>
/// 集装箱号
/// </summary>
public string CONTA_NO { get; set; }
/// <summary>
/// 是否已弃用 true-已弃用 false-正使用
/// </summary>
public bool IS_REMOVED { get; set; }
} }
} }

@ -181,5 +181,10 @@ namespace Myshipping.Application
/// </summary> /// </summary>
[Description("装货港未提箱")] [Description("装货港未提箱")]
POL_CTN_NOT_PICKUP, POL_CTN_NOT_PICKUP,
/// <summary>
/// 运输计划已变更
/// </summary>
[Description("运输计划已变更")]
TRNAS_PLAN_HAS_CHANGE,
} }
} }

@ -200,5 +200,10 @@ namespace Myshipping.Application
/// </summary> /// </summary>
[Description("航线截止时间调整")] [Description("航线截止时间调整")]
ROUTE_CUT_CHANGE, ROUTE_CUT_CHANGE,
/// <summary>
/// 运输计划已变更
/// </summary>
[Description("运输计划已变更")]
TRNAS_PLAN_HAS_CHANGE,
} }
} }

@ -1224,6 +1224,27 @@ namespace Myshipping.Application
.Map(dest => dest.TruckName, src => src.TRUCK_NAME??"") .Map(dest => dest.TruckName, src => src.TRUCK_NAME??"")
.Map(dest => dest.CustomerName, src => src.CUSTOMER_NAME??"") .Map(dest => dest.CustomerName, src => src.CUSTOMER_NAME??"")
.Map(dest => dest.NeedArriveTime, src => src.NeedArriveTime); .Map(dest => dest.NeedArriveTime, src => src.NeedArriveTime);
config.ForType<TaskManageOrderTransportPlanHasChangeInfo, TaskTransPlanHasChangeInfo>()
.Map(dest => dest.BOOKING_NO, src => src.BookingNo)
.Map(dest => dest.MBL_NO, src => src.BillNo)
.Map(dest => dest.ORIG_MBL_NO, src => src.OrigBillNo)
.Map(dest => dest.CARRIER, src => src.Carrier)
.Map(dest => dest.CHANGE_REASON, src => src.ChangeReasonNotes)
.Map(dest => dest.PORTLOAD, src => src.PortLoad)
.Map(dest => dest.PORTLOAD_COUNTRY, src => src.PortLoadCountry)
.Map(dest => dest.PORTLOAD_TERMINAL, src => src.PortLoadTerminal)
.Map(dest => dest.PORTDISCHARGE, src => src.PortDischarge)
.Map(dest => dest.PORTDISCHARGE_COUNTRY, src => src.PortDischargeCountry)
.Map(dest => dest.PORTDISCHARGE_TERMINAL, src => src.PortDischargeTerminal)
.Map(dest => dest.VESSEL, src => src.Vessel)
.Map(dest => dest.VOYNO, src => src.Voyno)
.Map(dest => dest.SHIP_FLAG, src => src.ShipFlag)
.Map(dest => dest.ETD, src => src.ETD)
.Map(dest => dest.ETA, src => src.ETA);
} }
} }
} }

@ -254,5 +254,10 @@ namespace Myshipping.Application
/// 船舶相关截止时间的通知 /// 船舶相关截止时间的通知
/// </summary> /// </summary>
public TaskManageOrderRouteChangeAdvisoryInfo RouteChangeAdvisoryInfo { get; set; } public TaskManageOrderRouteChangeAdvisoryInfo RouteChangeAdvisoryInfo { get; set; }
/// <summary>
/// 货物运输计划已变更
/// </summary>
public TaskManageOrderTransportPlanHasChangeInfo TransportPlanHasChangeInfo { get; set; }
} }
} }

@ -0,0 +1,218 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 您的货物运输计划已变更
/// </summary>
public class TaskManageOrderTransportPlanHasChangeInfo
{
/// <summary>
/// 订舱编号
/// </summary>
public string BookingNo { get; set; }
/// <summary>
/// 提单号码
/// </summary>
public string BillNo { get; set; }
/// <summary>
/// 派生自原单号
/// </summary>
public string OrigBillNo { get; set; }
/// <summary>
/// 集装箱号列表
/// </summary>
public List<string> ContaNoList { get; set; }
/// <summary>
/// 船公司代码
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 变更原因
/// </summary>
public string ChangeReasonNotes { get; set; }
/// <summary>
/// 装货港
/// </summary>
public string PortLoad { get; set; }
/// <summary>
/// 装货港国家
/// </summary>
public string PortLoadCountry { get; set; }
/// <summary>
/// 装货港码头
/// </summary>
public string PortLoadTerminal { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string PortDischarge { get; set; }
/// <summary>
/// 卸货港国家
/// </summary>
public string PortDischargeCountry { get; set; }
/// <summary>
/// 卸货港码头
/// </summary>
public string PortDischargeTerminal { get; set; }
/// <summary>
/// ETD
/// </summary>
public Nullable<DateTime> ETD { get; set; }
/// <summary>
/// ETA
/// </summary>
public Nullable<DateTime> ETA { get; set; }
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 航次
/// </summary>
public string Voyno { get; set; }
/// <summary>
/// 船旗
/// </summary>
public string ShipFlag { get; set; }
/// <summary>
/// 出运计划
/// </summary>
public TaskManageOrderTransportPlanHasChangeDetailInfo From { get; set; }
/// <summary>
/// 到达计划
/// </summary>
public TaskManageOrderTransportPlanHasChangeDetailInfo To { get; set; }
}
/// <summary>
/// 您的货物运输计划已变更明细
/// </summary>
public class TaskManageOrderTransportPlanHasChangeDetailInfo
{
/// <summary>
/// 港口变更明细
/// </summary>
public List<TaskManageOrderTransPlanHasChangePortInfo> portList { get; set; }
/// <summary>
/// 日期变更明细ETD或者ATD
/// </summary>
public List<TaskManageOrderTransPlanHasChangeDateInfo> dateList { get; set; }
/// <summary>
/// 船名航次变更
/// </summary>
public List<TaskManageOrderTransPlanHasChangeVesselInfo> vesselList { get; set; }
}
/// <summary>
/// 您的货物运输计划已变更-港口
/// </summary>
public class TaskManageOrderTransPlanHasChangePortInfo
{
/// <summary>
/// 顺序号
/// </summary>
public int Indx { get; set; }
/// <summary>
/// 港口名
/// </summary>
public string PortName { get; set; }
/// <summary>
/// 国家
/// </summary>
public string CountryCode { get; set; }
/// <summary>
/// 码头
/// </summary>
public string TerminalName { get; set; }
/// <summary>
/// 是否被作废掉了
/// </summary>
public bool IsRemoved { get; set; } = false;
}
/// <summary>
/// 您的货物运输计划已变更-日期
/// </summary>
public class TaskManageOrderTransPlanHasChangeDateInfo
{
/// <summary>
/// 顺序号
/// </summary>
public int Indx { get; set; }
/// <summary>
/// 提取日期文本
/// </summary>
public string OrigDateTxt { get; set; }
/// <summary>
/// 日期
/// </summary>
public DateTime DateVal { get; set; }
/// <summary>
/// 是否被作废掉了
/// </summary>
public bool IsRemoved { get; set; } = false;
}
/// <summary>
/// 您的货物运输计划已变更-船名航次
/// </summary>
public class TaskManageOrderTransPlanHasChangeVesselInfo
{
/// <summary>
/// 顺序号
/// </summary>
public int Indx { get; set; }
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 航次
/// </summary>
public string Voyno { get; set; }
/// <summary>
/// 船旗
/// </summary>
public string Flag { get; set; }
/// <summary>
/// 是否被作废掉了
/// </summary>
public bool IsRemoved { get; set; } = false;
}
}

@ -127,6 +127,8 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<TaskRouteChangeAdvisoryInfo> _taskRouteChangeAdvisoryInfoRepository; private readonly SqlSugarRepository<TaskRouteChangeAdvisoryInfo> _taskRouteChangeAdvisoryInfoRepository;
private readonly SqlSugarRepository<TaskRouteChangeAdvisoryDetailInfo> _taskRouteChangeAdvisoryDetailInfoRepository; private readonly SqlSugarRepository<TaskRouteChangeAdvisoryDetailInfo> _taskRouteChangeAdvisoryDetailInfoRepository;
private readonly SqlSugarRepository<TaskTransPlanHasChangeInfo> _taskTransPlanHasChangeInfoRepository;
private readonly SqlSugarRepository<TaskTransPlanHasChangeDetailInfo> _taskTransPlanHasChangeDetailInfoRepository;
private readonly IDjyWebsiteAccountConfigService _webAccountConfig; private readonly IDjyWebsiteAccountConfigService _webAccountConfig;
private readonly ISysCacheService _cache; private readonly ISysCacheService _cache;
@ -193,6 +195,8 @@ namespace Myshipping.Application
SqlSugarRepository<TaskCautionNoticeDetailInfo> taskCautionNoticeDetailInfoRepository, SqlSugarRepository<TaskCautionNoticeDetailInfo> taskCautionNoticeDetailInfoRepository,
SqlSugarRepository<TaskRouteChangeAdvisoryInfo> taskRouteChangeAdvisoryInfoRepository, SqlSugarRepository<TaskRouteChangeAdvisoryInfo> taskRouteChangeAdvisoryInfoRepository,
SqlSugarRepository<TaskRouteChangeAdvisoryDetailInfo> taskRouteChangeAdvisoryDetailInfoRepository, SqlSugarRepository<TaskRouteChangeAdvisoryDetailInfo> taskRouteChangeAdvisoryDetailInfoRepository,
SqlSugarRepository<TaskTransPlanHasChangeInfo> taskTransPlanHasChangeInfoRepository,
SqlSugarRepository<TaskTransPlanHasChangeDetailInfo> taskTransPlanHasChangeDetailInfoRepository,
INamedServiceProvider<IBookingOrderService> namedBookingOrderServiceProvider, INamedServiceProvider<IBookingOrderService> namedBookingOrderServiceProvider,
IDjyWebsiteAccountConfigService webAccountConfig, IDjyWebsiteAccountConfigService webAccountConfig,
ISysCacheService cache, ISysCacheService cache,
@ -264,6 +268,9 @@ namespace Myshipping.Application
_taskRouteChangeAdvisoryInfoRepository = taskRouteChangeAdvisoryInfoRepository; _taskRouteChangeAdvisoryInfoRepository = taskRouteChangeAdvisoryInfoRepository;
_taskRouteChangeAdvisoryDetailInfoRepository = taskRouteChangeAdvisoryDetailInfoRepository; _taskRouteChangeAdvisoryDetailInfoRepository = taskRouteChangeAdvisoryDetailInfoRepository;
_taskTransPlanHasChangeInfoRepository = taskTransPlanHasChangeInfoRepository;
_taskTransPlanHasChangeDetailInfoRepository = taskTransPlanHasChangeDetailInfoRepository;
} }
#region 创建任务 #region 创建任务
@ -1552,6 +1559,248 @@ namespace Myshipping.Application
} }
#endregion #endregion
#region 货物运输计划已变更
if (info.Main.TaskType == TaskBaseTypeEnum.TRNAS_PLAN_HAS_CHANGE)
{
TaskTransPlanHasChangeInfo taskTransPlanHasChangeInfo = info.Main.TransportPlanHasChangeInfo.Adapt<TaskTransPlanHasChangeInfo>();
taskTransPlanHasChangeInfo.PK_ID = IDGen.NextID().ToString();
taskTransPlanHasChangeInfo.TASK_ID = taskInfo.PK_ID;
taskTransPlanHasChangeInfo.CreatedTime = taskInfo.CreatedTime;
taskTransPlanHasChangeInfo.UpdatedTime = taskInfo.CreatedTime;
taskTransPlanHasChangeInfo.CreatedUserId = taskInfo.CreatedUserId;
taskTransPlanHasChangeInfo.CreatedUserName = taskInfo.CreatedUserName;
taskTransPlanHasChangeInfo.TenantId = taskInfo.TenantId;
taskTransPlanHasChangeInfo.TenantName = taskInfo.TenantName;
await _taskTransPlanHasChangeInfoRepository.InsertAsync(taskTransPlanHasChangeInfo);
if(info.Main.TransportPlanHasChangeInfo.From != null)
{
if(info.Main.TransportPlanHasChangeInfo.From.portList != null
&& info.Main.TransportPlanHasChangeInfo.From.portList.Count > 0)
{
info.Main.TransportPlanHasChangeInfo.From.portList.ForEach(p => {
TaskTransPlanHasChangeDetailInfo detailInfo = new TaskTransPlanHasChangeDetailInfo {
PORTLOAD = p.PortName,
PORTLOAD_COUNTRY = p.CountryCode,
PORTLOAD_TERMINAL = p.TerminalName,
SORT_NO = p.Indx,
IS_REMOVED = p.IsRemoved
};
detailInfo.PK_ID = IDGen.NextID().ToString();
detailInfo.P_ID = taskTransPlanHasChangeInfo.PK_ID;
detailInfo.PLAN_TYPE = "FROM";
detailInfo.COLUMN_TYPE = "PORT";
detailInfo.CreatedTime = taskInfo.CreatedTime;
detailInfo.UpdatedTime = taskInfo.CreatedTime;
detailInfo.CreatedUserId = taskInfo.CreatedUserId;
detailInfo.CreatedUserName = taskInfo.CreatedUserName;
detailInfo.TenantId = taskInfo.TenantId;
detailInfo.TenantName = taskInfo.TenantName;
_taskTransPlanHasChangeDetailInfoRepository.Insert(detailInfo);
});
}
if (info.Main.TransportPlanHasChangeInfo.From.dateList != null
&& info.Main.TransportPlanHasChangeInfo.From.dateList.Count > 0)
{
info.Main.TransportPlanHasChangeInfo.From.dateList.ForEach(p => {
TaskTransPlanHasChangeDetailInfo detailInfo = new TaskTransPlanHasChangeDetailInfo
{
ETD = p.DateVal,
SORT_NO = p.Indx,
IS_REMOVED = p.IsRemoved
};
detailInfo.PK_ID = IDGen.NextID().ToString();
detailInfo.P_ID = taskTransPlanHasChangeInfo.PK_ID;
detailInfo.PLAN_TYPE = "FROM";
detailInfo.COLUMN_TYPE = "EATD";
detailInfo.CreatedTime = taskInfo.CreatedTime;
detailInfo.UpdatedTime = taskInfo.CreatedTime;
detailInfo.CreatedUserId = taskInfo.CreatedUserId;
detailInfo.CreatedUserName = taskInfo.CreatedUserName;
detailInfo.TenantId = taskInfo.TenantId;
detailInfo.TenantName = taskInfo.TenantName;
_taskTransPlanHasChangeDetailInfoRepository.Insert(detailInfo);
});
}
if (info.Main.TransportPlanHasChangeInfo.From.vesselList != null
&& info.Main.TransportPlanHasChangeInfo.From.vesselList.Count > 0)
{
info.Main.TransportPlanHasChangeInfo.From.vesselList.ForEach(p => {
TaskTransPlanHasChangeDetailInfo detailInfo = new TaskTransPlanHasChangeDetailInfo
{
VESSEL = p.Vessel,
VOYNO = p.Voyno,
SHIP_FLAG = p.Flag,
SORT_NO = p.Indx,
IS_REMOVED = p.IsRemoved
};
detailInfo.PK_ID = IDGen.NextID().ToString();
detailInfo.P_ID = taskTransPlanHasChangeInfo.PK_ID;
detailInfo.PLAN_TYPE = "FROM";
detailInfo.COLUMN_TYPE = "VESSEL";
detailInfo.CreatedTime = taskInfo.CreatedTime;
detailInfo.UpdatedTime = taskInfo.CreatedTime;
detailInfo.CreatedUserId = taskInfo.CreatedUserId;
detailInfo.CreatedUserName = taskInfo.CreatedUserName;
detailInfo.TenantId = taskInfo.TenantId;
detailInfo.TenantName = taskInfo.TenantName;
_taskTransPlanHasChangeDetailInfoRepository.Insert(detailInfo);
});
}
}
if (info.Main.TransportPlanHasChangeInfo.To != null)
{
if (info.Main.TransportPlanHasChangeInfo.To.portList != null
&& info.Main.TransportPlanHasChangeInfo.To.portList.Count > 0)
{
info.Main.TransportPlanHasChangeInfo.To.portList.ForEach(p => {
TaskTransPlanHasChangeDetailInfo detailInfo = new TaskTransPlanHasChangeDetailInfo
{
PORTDISCHARGE = p.PortName,
PORTDISCHARGE_COUNTRY = p.CountryCode,
PORTDISCHARGE_TERMINAL = p.TerminalName,
SORT_NO = p.Indx,
IS_REMOVED = p.IsRemoved
};
detailInfo.PK_ID = IDGen.NextID().ToString();
detailInfo.P_ID = taskTransPlanHasChangeInfo.PK_ID;
detailInfo.PLAN_TYPE = "TO";
detailInfo.COLUMN_TYPE = "PORT";
detailInfo.CreatedTime = taskInfo.CreatedTime;
detailInfo.UpdatedTime = taskInfo.CreatedTime;
detailInfo.CreatedUserId = taskInfo.CreatedUserId;
detailInfo.CreatedUserName = taskInfo.CreatedUserName;
detailInfo.TenantId = taskInfo.TenantId;
detailInfo.TenantName = taskInfo.TenantName;
_taskTransPlanHasChangeDetailInfoRepository.Insert(detailInfo);
});
}
if (info.Main.TransportPlanHasChangeInfo.To.dateList != null
&& info.Main.TransportPlanHasChangeInfo.To.dateList.Count > 0)
{
info.Main.TransportPlanHasChangeInfo.To.dateList.ForEach(p => {
TaskTransPlanHasChangeDetailInfo detailInfo = new TaskTransPlanHasChangeDetailInfo
{
ETA = p.DateVal,
SORT_NO = p.Indx,
IS_REMOVED = p.IsRemoved
};
detailInfo.PK_ID = IDGen.NextID().ToString();
detailInfo.P_ID = taskTransPlanHasChangeInfo.PK_ID;
detailInfo.PLAN_TYPE = "TO";
detailInfo.COLUMN_TYPE = "EATD";
detailInfo.CreatedTime = taskInfo.CreatedTime;
detailInfo.UpdatedTime = taskInfo.CreatedTime;
detailInfo.CreatedUserId = taskInfo.CreatedUserId;
detailInfo.CreatedUserName = taskInfo.CreatedUserName;
detailInfo.TenantId = taskInfo.TenantId;
detailInfo.TenantName = taskInfo.TenantName;
_taskTransPlanHasChangeDetailInfoRepository.Insert(detailInfo);
});
}
if (info.Main.TransportPlanHasChangeInfo.To.vesselList != null
&& info.Main.TransportPlanHasChangeInfo.To.vesselList.Count > 0)
{
info.Main.TransportPlanHasChangeInfo.To.vesselList.ForEach(p => {
TaskTransPlanHasChangeDetailInfo detailInfo = new TaskTransPlanHasChangeDetailInfo
{
VESSEL = p.Vessel,
VOYNO = p.Voyno,
SHIP_FLAG = p.Flag,
SORT_NO = p.Indx,
IS_REMOVED = p.IsRemoved
};
detailInfo.PK_ID = IDGen.NextID().ToString();
detailInfo.P_ID = taskTransPlanHasChangeInfo.PK_ID;
detailInfo.PLAN_TYPE = "TO";
detailInfo.COLUMN_TYPE = "VESSEL";
detailInfo.CreatedTime = taskInfo.CreatedTime;
detailInfo.UpdatedTime = taskInfo.CreatedTime;
detailInfo.CreatedUserId = taskInfo.CreatedUserId;
detailInfo.CreatedUserName = taskInfo.CreatedUserName;
detailInfo.TenantId = taskInfo.TenantId;
detailInfo.TenantName = taskInfo.TenantName;
_taskTransPlanHasChangeDetailInfoRepository.Insert(detailInfo);
});
}
}
if (info.Main.TransportPlanHasChangeInfo.ContaNoList != null && info.Main.TransportPlanHasChangeInfo.ContaNoList.Count > 0)
{
info.Main.TransportPlanHasChangeInfo.ContaNoList.ForEach(p =>
{
TaskTransPlanHasChangeDetailInfo detailInfo = new TaskTransPlanHasChangeDetailInfo
{
CONTA_NO = p,
};
detailInfo.PK_ID = IDGen.NextID().ToString();
detailInfo.P_ID = taskTransPlanHasChangeInfo.PK_ID;
detailInfo.COLUMN_TYPE = "CTN";
detailInfo.CreatedTime = taskInfo.CreatedTime;
detailInfo.UpdatedTime = taskInfo.CreatedTime;
detailInfo.CreatedUserId = taskInfo.CreatedUserId;
detailInfo.CreatedUserName = taskInfo.CreatedUserName;
detailInfo.TenantId = taskInfo.TenantId;
detailInfo.TenantName = taskInfo.TenantName;
_taskTransPlanHasChangeDetailInfoRepository.Insert(detailInfo);
});
}
}
#endregion
if (info.Main.SerialMsgInfo != null) if (info.Main.SerialMsgInfo != null)
{ {
var storeInfo = new TaskStoreMsgInfo var storeInfo = new TaskStoreMsgInfo

Loading…
Cancel
Save