cjy 3 months ago
commit 894e1aed26

@ -32,5 +32,15 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
public BookingGenerateDto generateModel { get; set; }
/// <summary>
/// 海运订舱详情
/// </summary>
public SeaExportRes orderInfo { get; set; }
/// <summary>
/// 是否订单引入
/// </summary>
public bool isOrderImport { get; set; }
}
}

@ -1455,7 +1455,7 @@ public class SeaExportRes
public int SplitOrMergeFlag { get; set; }
/// <summary>
/// 服务项目
///
/// </summary>
public string? ServiceItem { get; set; }
public long OrgId { get; set; }
}

@ -56,6 +56,7 @@ using DS.WMS.Core.TaskPlat.Entity;
using Microsoft.VisualBasic.FileIO;
using Microsoft.Extensions.Logging;
using AnyDiff.Extensions;
using DS.WMS.Core.Sys.Entity;
namespace DS.WMS.Core.Op.Method
{
@ -2672,6 +2673,40 @@ namespace DS.WMS.Core.Op.Method
var slotIdList = model.slots.Select(s => s.Id).ToList();
List<BookingSlotBase> latestSlotList = tenantDb.Queryable<BookingSlotBase>().Where(b => slotIdList.Contains(b.Id)).ToList();
//(订单引入现舱时)需要对订单数据进行比对(约号、启运港、目的港、船名航次和现舱的上述信息做比对,如果不一致终止并提示)
if (model.isOrderImport)
{
if (model.orderInfo == null)
{
return DataResult<string>.FailedData("当前引入现舱时,无法获取订单信息");
}
//比约号
if (!string.IsNullOrWhiteSpace(model.orderInfo.ContractNo) && latestSlotList.Any(a => !string.IsNullOrWhiteSpace(a.ContractNo) && !a.ContractNo.Equals(model.orderInfo.ContractNo)))
{
return DataResult<string>.FailedData($"引入校验失败,订单约号【{model.orderInfo.ContractNo}】 与舱位约号【{latestSlotList.FirstOrDefault(a => !string.IsNullOrWhiteSpace(a.ContractNo)).ContractNo}】 不一致");
}
//船名航次
if (!string.IsNullOrWhiteSpace(model.orderInfo.Vessel) && !string.IsNullOrWhiteSpace(model.orderInfo.Voyno) && latestSlotList.Any(a => $"{a.Vessel?.Trim()}/{a.Voyno?.Trim()}".Equals($"{model.orderInfo.Vessel?.Trim()}/{model.orderInfo.Voyno?.Trim()}")))
{
return DataResult<string>.FailedData($"引入校验失败,船名航次【{model.orderInfo.Vessel?.Trim()}/{model.orderInfo.Voyno?.Trim()}】 与舱位船名航次【{latestSlotList.FirstOrDefault().Vessel?.Trim()}/{latestSlotList.FirstOrDefault().Voyno?.Trim()}】 不一致");
}
//比对装货港
if (model.orderInfo.LoadPortId > 0 && latestSlotList.Any(a => a.PortLoadId.HasValue && a.PortLoadId.Value != model.orderInfo.LoadPortId))
{
return DataResult<string>.FailedData($"引入校验失败,订单装货港【{model.orderInfo.LoadPort}】 与舱位装货港【{latestSlotList.FirstOrDefault(a=>a.PortLoadId.HasValue).PortLoad}】 不一致");
}
//比对卸货港
if (model.orderInfo.DischargePortId > 0 && latestSlotList.Any(a => a.PortDischargeId.HasValue && a.PortDischargeId.Value != model.orderInfo.DischargePortId))
{
return DataResult<string>.FailedData($"引入校验失败,订单卸货港【{model.orderInfo.DischargePort}】 与舱位卸货港【{latestSlotList.FirstOrDefault(a => a.PortDischargeId.HasValue).PortDischarge}】 不一致");
}
}
foreach (var inSlotItem in model.slots)
{
var latestSlot = latestSlotList.First(b => b.Id == inSlotItem.Id);
@ -2772,6 +2807,8 @@ namespace DS.WMS.Core.Op.Method
file.LinkId = model.bookingOrderId;
tenantDb.Insertable<OpFile>(file).ExecuteCommand();
}
//推送计算舱位库存
_bookingSlotStockService.BookingSlotStock(new BookingSlotStockUpdateModel
{
BookingSlotType = latestSlot.BookingSlotType,
@ -4274,6 +4311,7 @@ namespace DS.WMS.Core.Op.Method
1
2
*/
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
if (model.seaExportId == 0)
{
@ -4314,13 +4352,97 @@ namespace DS.WMS.Core.Op.Method
generateDto.NewSubBlNo = orderInfo.HBLNO;
}
/*
1
2
3BC
4
5SHIPPER
*/
var slotId = model.slots.FirstOrDefault().Id;
var useToList = tenantDb.Queryable<BookingSlotUseTo>().Where(a => a.SlotId == slotId).ToList();
if (useToList.Count > 0)
{
//ASSIGN_FORWARDER-指定货
if (useToList.Any(b => b.UseTo.Equals(BookingSlotUseToEnum.ASSIGN_FORWARDER.ToString(), StringComparison.OrdinalIgnoreCase)))
{
var currUseTo = useToList.FirstOrDefault(b => b.UseTo.Equals(BookingSlotUseToEnum.ASSIGN_FORWARDER.ToString(), StringComparison.OrdinalIgnoreCase));
if (orderInfo.AgentId.HasValue && !currUseTo.UseToVal.Equals(orderInfo.AgentId.Value.ToString()))
{
throw new Exception($"舱位用途验证失败,指定货【{currUseTo.UseToValShow}】与订单的国外代理【{orderInfo.Agent}】不一致");
}
}
//GUEST_ONLY-专属客户
if (useToList.Any(b => b.UseTo.Equals(BookingSlotUseToEnum.GUEST_ONLY.ToString(), StringComparison.OrdinalIgnoreCase)))
{
var currUseTo = useToList.FirstOrDefault(b => b.UseTo.Equals(BookingSlotUseToEnum.GUEST_ONLY.ToString(), StringComparison.OrdinalIgnoreCase));
if (orderInfo.CustomerId > 0 && !currUseTo.UseToVal.Equals(orderInfo.CustomerId.ToString()))
{
throw new Exception($"舱位用途验证失败,专属客户【{currUseTo.UseToValShow}】与订单的委托单位【{orderInfo.CustomerName}】不一致");
}
}
//SALEER_ONLY-专属销售
if (useToList.Any(b => b.UseTo.Equals(BookingSlotUseToEnum.SALEER_ONLY.ToString(), StringComparison.OrdinalIgnoreCase)))
{
var currUseTo = useToList.FirstOrDefault(b => b.UseTo.Equals(BookingSlotUseToEnum.SALEER_ONLY.ToString(), StringComparison.OrdinalIgnoreCase));
if (orderInfo.SaleId > 0 && !currUseTo.UseToVal.Equals(orderInfo.SaleId.ToString()))
{
throw new Exception($"舱位用途验证失败,专属销售【{currUseTo.UseToValShow}】与订单的揽货人【{orderInfo.Sale}】不一致");
}
}
//COMPANY_ONLY-专属公司
if (useToList.Any(b => b.UseTo.Equals(BookingSlotUseToEnum.COMPANY_ONLY.ToString(), StringComparison.OrdinalIgnoreCase)))
{
var currUseTo = useToList.FirstOrDefault(b => b.UseTo.Equals(BookingSlotUseToEnum.COMPANY_ONLY.ToString(), StringComparison.OrdinalIgnoreCase));
if (orderInfo.OrgId > 0 && !currUseTo.UseToVal.Equals(orderInfo.OrgId.ToString()))
{
long useToVal = long.Parse(currUseTo.UseToVal);
var origList = db.Queryable<SysOrg>().Where(a => a.Status == StatusEnum.Enable && (orderInfo.OrgId == a.Id || useToVal == a.Id)).ToList();
throw new Exception($"舱位用途验证失败,专属公司【{origList.FirstOrDefault(a=>a.Id == useToVal)?.OrgName}】与订单的揽货人【{origList.FirstOrDefault(a=>a.Id == orderInfo.OrgId)?.OrgName}】不一致");
}
}
//GOODS-品名大类
if (useToList.Any(b => b.UseTo.Equals(BookingSlotUseToEnum.GOODS.ToString(), StringComparison.OrdinalIgnoreCase)))
{
var currUseTo = useToList.FirstOrDefault(b => b.UseTo.Equals(BookingSlotUseToEnum.GOODS.ToString(), StringComparison.OrdinalIgnoreCase));
if (orderInfo.GoodsId > 0 && !currUseTo.UseToVal.Equals(orderInfo.GoodsId.ToString()))
{
throw new Exception($"舱位用途验证失败,品名大类【{currUseTo.UseToValShow}】与订单的品名【{orderInfo.GoodsName}】不一致");
}
}
//HSCODE-品名大类
if (useToList.Any(b => b.UseTo.Equals(BookingSlotUseToEnum.HSCODE.ToString(), StringComparison.OrdinalIgnoreCase)))
{
var currUseTo = useToList.FirstOrDefault(b => b.UseTo.Equals(BookingSlotUseToEnum.HSCODE.ToString(), StringComparison.OrdinalIgnoreCase));
if (!currUseTo.UseToVal.Equals(orderInfo.HSCode))
{
throw new Exception($"舱位用途验证失败HSCODE【{currUseTo.UseToValShow}】与订单的HSCODE【{orderInfo.HSCode}】不一致");
}
}
}
return await ImportSlots(new ImportSlotsDto
{
slots = model.slots,
isCheck = false,
bookingOrderId = model.seaExportId,
generateModel = generateDto
generateModel = generateDto,
orderInfo = orderInfo,
isOrderImport = true
});
}
#endregion

@ -0,0 +1,66 @@
@* @model DS.WMS.Core.Op.Entity.MailTemplateModel<DS.WMS.Core.TaskPlat.Dtos.TaskPOLContainerNotPickUpShowDto> *@
@{
var item = Model.Primary;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title class="head-title">邮件模板</title>
</head>
<body style="margin: 0; padding: 0;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#EDF9F5" style="font-size: 12px;font-family: Arial;">
<tr>
<td height="30"></td>
</tr>
<tr>
<td>
<table class="out-table" border="0" cellpadding="8" cellspacing="0" width="800" bgcolor="#FFFFFF" align="center" style="font-size: 12px;font-family: Arial;">
<tr>
<td>
<p>尊敬的客户,</p>
</td>
</tr>
<tr>
<td>
<table class="base-table" border="1" cellpadding="8" cellspacing="0" width="100%" align="center" style="border-collapse: collapse;border-color: #ebeef5;font-size: 12px;font-family: Arial;">
<tr>
<td class="billno-label" width="120px;">船名/航次:</td>
<td class="billno-val">@item.Vessel/@item.Voyno</td>
</tr>
<tr>
<td class="billno-label" width="120px;">定舱号码:</td>
<td class="billno-val">@item.MBlNo</td>
</tr>
</table>
</td>
</tr>
<tr class="email-noreply">
<td>
<p class="dynamic-val"></p>
<p class="notice1-val">以上是贵司还未提柜记录的定舱现已接近截箱时间请参考如下信息操作否则您的订舱将在CY cut-off deadline取消</p>
<p class="notice1-val">A. 推下一航次,请&lt;在CY&nbsp;Closing&nbsp;-&nbsp;1&nbsp;天之前&gt;提交更改</p>
<p class="notice1-val">B. <font style="color: #4051f0; font-weight: 500;">已提柜,且于马士基网站未查询到柜号,<font style="background-color: #f1de2f; font-weight: 500;">请立即联系 @Model.Sender.DisplayName邮箱 @Model.Sender.MailAddress电话 @Model.Sender.Phone</font></font>告知柜号。若网站已有完整柜号且确认正常出运,请自行安排,无需再回复邮件,<font style="color: #f70f0f; font-weight: 500;">目前Maersk不接受未提供明确柜号而保留订舱的要求。</font></p>
<p class="notice1-val">
鉴于船舶配载方面的要求Maersk将在配载前将所有没有提柜记录以Maersk EDI记录为准的定舱视为无效定舱,并统一在取消,因此,<font style="background-color: #5bcef1; font-weight: 500;">友情提醒:请尽快提柜并告知柜号,以免产生不必要的工作和费用。</font>
如果上方的单号需要取消订舱, 或已经提交过取消操作, 无需回复邮件。
如有任何疑问,欢迎垂询我司操作。
</p>
<p class="notice2-val"><font style="color: #4051f0; font-weight: 500;">请不要回复此邮箱(自动发送邮箱无人处理邮件),如有疑问,</font><font style="background-color: #f1de2f; font-weight: 500;">请联系 @Model.Sender.DisplayName邮箱 @Model.Sender.MailAddress电话 @Model.Sender.Phone谢谢</font></p>
<p>顺祝</p>
<p>商祺</p>
<p class="notice-comp-val">@item.TenantCompanyName</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

@ -0,0 +1,66 @@
@* @model DS.WMS.Core.Op.Entity.MailTemplateModel<DS.WMS.Core.TaskPlat.Dtos.TaskPOLContainerNotPickUpShowDto> *@
@{
var item = Model.Primary;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title class="head-title">邮件模板</title>
</head>
<body style="margin: 0; padding: 0;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#EDF9F5" style="font-size: 12px;font-family: Arial;">
<tr>
<td height="30"></td>
</tr>
<tr>
<td>
<table class="out-table" border="0" cellpadding="8" cellspacing="0" width="800" bgcolor="#FFFFFF" align="center" style="font-size: 12px;font-family: Arial;">
<tr>
<td>
<p>尊敬的客户,</p>
</td>
</tr>
<tr>
<td>
<table class="base-table" border="1" cellpadding="8" cellspacing="0" width="100%" align="center" style="border-collapse: collapse;border-color: #ebeef5;font-size: 12px;font-family: Arial;">
<tr>
<td class="billno-label" width="120px;">船名/航次:</td>
<td class="billno-val">@item.Vessel/@item.Voyno</td>
</tr>
<tr>
<td class="billno-label" width="120px;">定舱号码:</td>
<td class="billno-val">@item.MBlNo</td>
</tr>
</table>
</td>
</tr>
<tr class="email-noreply">
<td>
<p class="dynamic-val"></p>
<p class="notice1-val">以上是贵司还未提柜记录的定舱现已接近截箱时间请参考如下信息操作否则您的订舱将在CY cut-off deadline取消</p>
<p class="notice1-val">A. 推下一航次,请&lt;在CY&nbsp;Closing&nbsp;-&nbsp;1&nbsp;天之前&gt;提交更改</p>
<p class="notice1-val">B. <font style="color: #4051f0; font-weight: 500;">已提柜,且于马士基网站未查询到柜号,<font style="background-color: #f1de2f; font-weight: 500;">请立即联系 @Model.Sender.DisplayName邮箱 @Model.Sender.MailAddress电话 @Model.Sender.Phone</font></font>告知柜号。若网站已有完整柜号且确认正常出运,请自行安排,无需再回复邮件,<font style="color: #f70f0f; font-weight: 500;">目前Maersk不接受未提供明确柜号而保留订舱的要求。</font></p>
<p class="notice1-val">
鉴于船舶配载方面的要求Maersk将在配载前将所有没有提柜记录以Maersk EDI记录为准的定舱视为无效定舱,并统一在取消,因此,<font style="background-color: #5bcef1; font-weight: 500;">友情提醒:请尽快提柜并告知柜号,以免产生不必要的工作和费用。</font>
如果上方的单号需要取消订舱, 或已经提交过取消操作, 无需回复邮件。
如有任何疑问,欢迎垂询我司操作。
</p>
<p class="notice2-val"><font style="color: #4051f0; font-weight: 500;">请不要回复此邮箱(自动发送邮箱无人处理邮件),如有疑问,</font><font style="background-color: #f1de2f; font-weight: 500;">请联系 @Model.Sender.DisplayName邮箱 @Model.Sender.MailAddress电话 @Model.Sender.Phone谢谢</font></p>
<p>顺祝</p>
<p>商祺</p>
<p class="notice-comp-val">@item.TenantCompanyName</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Loading…
Cancel
Save