From 852a96962ed3504b50fc9b9cdbbf8c0d1d728520 Mon Sep 17 00:00:00 2001 From: hanxuntao Date: Wed, 27 Nov 2024 10:50:16 +0800 Subject: [PATCH] 11 --- .../DAL/MsSeaeOrder/MsSeaeOrderDAL.cs | 75 +++++++++++++++++++ DSWeb/DSWeb.csproj.user | 2 +- 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/DSWeb/Areas/MvcShipping/DAL/MsSeaeOrder/MsSeaeOrderDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsSeaeOrder/MsSeaeOrderDAL.cs index 76952415..9c9e3839 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsSeaeOrder/MsSeaeOrderDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsSeaeOrder/MsSeaeOrderDAL.cs @@ -27,6 +27,9 @@ using DSWeb.Areas.MvcShipping.Helper; using DSWeb.Areas.CommMng.DAL; using System.Linq; using Newtonsoft.Json; +using DSWeb.MvcShipping.Models.MsOpSeaePre; +using DSWeb.MvcShipping.DAL.MsInfoClient; +using DSWeb.Areas.MvcShipping.Models.Message.VGM; namespace DSWeb.MvcShipping.DAL.MsSeaeOrderDAL { @@ -1577,6 +1580,78 @@ namespace DSWeb.MvcShipping.DAL.MsSeaeOrderDAL var filepath = ""; result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, MailSendName); } + if (headData.CARRIER == "CMA") { + + var predata = MsOpSeaePreDAL.MsOpSeaePreDAL.GetData("ORDNO='"+headData.ORDNO+"'"); + if (!string.IsNullOrEmpty(predata.ORDNO)) { + 审核通过时发送邮件2(headData, predata); + } + + + } + + + return result; + } + + + public static DBResult 审核通过时发送邮件2(MsSeaeOrder headData, MsOpSeaePre PreData) + { + var result = new DBResult(); + //向该业务的操作、该业务的录入人 发送邮件 + //对操作OP而言,如果ORDEROP_EMAIL当中有邮箱 则优先向这个邮箱发送邮件 + var mailtitle = "现舱售出:"+headData.MBLNO+"-"+headData.LANE; + + var Body = new StringBuilder(); + Body.Append(" "); + Body.Append("
原现舱信息:
提单号:" + PreData.MBLNO); + Body.Append("
航线:" + PreData.LANE); + Body.Append("
运费协议号:" + PreData.CONTRACTNO); + Body.Append("
目的地:" + PreData.PORTDISCHARGE); + Body.Append("
船期:" + PreData.ETD); + Body.Append("
船名航次:" + PreData.VESSEL + " " + PreData.VOYNO); + Body.Append("
箱型箱量:" + PreData.CNTRTOTAL); + Body.Append("
订舱代理:" + PreData.FORWARDER); + Body.Append("
业务人:" + headData.SALE); + Body.Append("
委托单位:" + PreData.CUSTOMERNAME); + Body.Append("
"); + + Body.Append("
更改后信息:
提单号:" + headData.MBLNO); + Body.Append("
航线:" + headData.LANE); + Body.Append("
运费协议号:" + headData.CONTRACTNO); + Body.Append("
目的地:" + headData.DESTINATION); + Body.Append("
船期:" + headData.ETD); + Body.Append("
船名航次:" + headData.VESSEL+" "+headData.VOYNO); + Body.Append("
箱型箱量:" + headData.CNTRTOTAL); + Body.Append("
订舱代理:" + headData.FORWARDER); + Body.Append("
业务人:" + headData.SALE); + Body.Append("
委托单位:" + headData.CUSTOMERNAME); + Body.Append(" "); + var mailto = ""; + + + void mailtoAdd(string mail) + { + if (mailto == "") + mailto = mail; + else + mailto = mailto + ";" + mail; + } + var carrier = MsInfoClientDAL.GetData("SHORTNAME='"+headData.CARRIER+"'"); + if (!string.IsNullOrEmpty(carrier.EMAIL)) { + mailtoAdd(carrier.EMAIL); + } + if (!string.IsNullOrEmpty(carrier.MSN)) + { + mailtoAdd(carrier.MSN); + } + + if (mailto != "") + { + var j = 0; + var filepath = ""; + result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, ""); + } return result; } diff --git a/DSWeb/DSWeb.csproj.user b/DSWeb/DSWeb.csproj.user index b93622d6..2ea1f905 100644 --- a/DSWeb/DSWeb.csproj.user +++ b/DSWeb/DSWeb.csproj.user @@ -4,7 +4,7 @@ ShowAllFiles D:\DONGSHENG7\DS7HHYT\DSWeb\Properties\PublishProfiles\FolderProfile.pubxml true - Release|Any CPU + Debug|Any CPU