hanxuntao 6 months ago
parent 0ee31a7549
commit d7e10604c7

@ -295,7 +295,9 @@
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\WinSCP.5.21.5\build\WinSCP.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\WinSCP.5.21.5\build\WinSCP.targets'))" />
<Error Condition="!Exists('packages\Microsoft.NETFramework.ReferenceAssemblies.net45.1.0.3\build\Microsoft.NETFramework.ReferenceAssemblies.net45.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.NETFramework.ReferenceAssemblies.net45.1.0.3\build\Microsoft.NETFramework.ReferenceAssemblies.net45.targets'))" />
</Target>
<Import Project="packages\Microsoft.NETFramework.ReferenceAssemblies.net45.1.0.3\build\Microsoft.NETFramework.ReferenceAssemblies.net45.targets" Condition="Exists('packages\Microsoft.NETFramework.ReferenceAssemblies.net45.1.0.3\build\Microsoft.NETFramework.ReferenceAssemblies.net45.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

@ -510,7 +510,7 @@ namespace MailAnalyzeTools
// isok = AnalyzeVCMailBusiness(edimai);
//}
if (edimai.F_03_YJZT.IndexOf("Verify Copy of Bill of Lading") > 0 && edimai.F_14_hasAttachment == 1)
if ((edimai.F_03_YJZT.IndexOf("Verify Copy of Bill of Lading") > 0||(edimai.F_03_YJZT.IndexOf("of Bill of Lading") > 0&& edimai.F_03_YJZT.IndexOf("Verify Copy") > 0 && edimai.F_03_YJZT.IndexOf("Maersk :") >=0) )&& edimai.F_14_hasAttachment == 1)
{
isok = AnalyzeVCMailBusiness(edimai);
}
@ -555,7 +555,7 @@ namespace MailAnalyzeTools
//{
// isok = AnalyzeSeawayMailBusiness(edimai);
//}
else if ((edimai.F_03_YJZT.IndexOf("Waybill of Bill of Lading") >= 0))//seaway bill
else if (((edimai.F_03_YJZT.IndexOf("Waybill of Bill of Lading") >= 0)) || (edimai.F_03_YJZT.Replace("\n", "").Replace("\r", "").IndexOf("Maersk : Waybill of Bill of Lading") >= 0) || (edimai.F_03_YJZT.Replace("\n", "").Replace("\r", "").IndexOf("Maersk : of Bill of Lading") >= 0))//seaway bill
{
isok = AnalyzeSeawayMailBusiness(edimai);
}
@ -939,14 +939,21 @@ namespace MailAnalyzeTools
for (int q = 0; q < textArr.Length; q++)
{
if (textArr[q].Trim() == "") continue;
textArr[q] = textArr[q].Replace("SEC.MANIF.DOCUMENT", "THC ORIGIN");
if (textArr[q].IndexOf("=====") > 0)
{
textArr[q] = textArr[q].Substring(0, textArr[q].IndexOf("====="));
}
var regstr = @"(\w+[\s-/\.]?)+\.?\s+\d+\.\d{2}\s\w+\s+\d+\.?\d*\s\w+\s+\d+\.\d+\s\w+";
try
{
// var matches = new Regex(@"(\w+[\s-/\.]?)+\.?\s+\d+\.\d{2}\s\w+\s+\d+\.?\d*\s\w+\s+\d+\.\d+\s\w+").Matches(textArr[q]);
var matches = Matchs(new Regex(regstr), textArr[q], 2000);
var matches = new Regex(@"(\w+[\s-/\.]?)+\.?\s+\d+\.\d{2}\s\w+\s+\d+\.?\d*\s\w+\s+\d+\.\d+\s\w+").Matches(textArr[q]);
for (int p = 0; p < matches.Count; p++)
for (int p = 0; p < matches.Count; p++)
{
TCH_Fee_edi model = new TCH_Fee_edi();
model.F_05BH = optsk.F_19SEABH;//关联 F_19SEABH
@ -1010,6 +1017,14 @@ namespace MailAnalyzeTools
}
}
}
catch (Exception ex)
{
LogHelper.WriteLog("INVOICE数据保存出错2:", ex.Message);
}
}
}
@ -1138,6 +1153,39 @@ namespace MailAnalyzeTools
Object,
Else
}
public static MatchCollection Matchs(Regex regex, string input, int OutTimeMilliseconds)
{
MatchCollection mc = null;
AutoResetEvent are = new AutoResetEvent(false);
Thread t = new Thread(delegate ()
{
mc = regex.Matches(input);
//注意,在这里一定要把所有的匹配项遍历一次,不然的话当在此方法外遍历的话.也可能会出现等待情况
foreach (System.Text.RegularExpressions.Match m in mc) { }
are.Set();
});
t.Start();
Wait(t, TimeSpan.FromMilliseconds(OutTimeMilliseconds), are, null);
return mc;
}
private static void Wait(Thread t, TimeSpan OutTime, WaitHandle are, WaitHandle cancelEvent)
{
WaitHandle[] ares;
if (cancelEvent == null)
ares = new WaitHandle[] { are
};
else
ares = new WaitHandle[] { are, cancelEvent
};
int index = WaitHandle.WaitAny(ares, OutTime);
if ((index != 0) && t.IsAlive)//如果不是执行完成的信号,并且,线程还在执行,那么,结束这个线程
{
t.Abort();
t = null;
}
}
private static ModelType GetModelType(Type modelType)
{
if (modelType.IsEnum)//值类型
@ -1528,7 +1576,12 @@ SELECT '{9}' as [任务编号],null as [上级任务号], '{7}' as [任务类型
//业务编号
optsk.F_19SEABH = tbltmp.Rows[0]["编号"].ToString();
var updatesql_Set2 = "delete from t_op_seae_msc where 编号='"+ optsk.F_19SEABH + "' insert into t_op_seae_msc (编号,状态) VALUES('" + optsk.F_19SEABH + "','" + STATUS + "')";
//var updatesql_Set2 = "delete from t_op_seae_msc where 编号='"+ optsk.F_19SEABH + "' insert into t_op_seae_msc (编号,状态,更新时间) VALUES('" + optsk.F_19SEABH + "','" + STATUS + "',GETDATE())";
var updatesql_Set2 = "if (select bsno from t_op_seae_msc where 编号='" + optsk.F_19SEABH + "') is null insert into t_op_seae_msc (编号,状态,更新时间) VALUES('" + optsk.F_19SEABH + "','" + STATUS + "',GETDATE()) "
+" else update t_op_seae_msc set 状态='"+STATUS+"',更新时间=GETDATE() WHERE 编号='"+ optsk.F_19SEABH + "'";
DbHelperSQL.ExecuteSql(updatesql_Set2);
LocStatus = tbltmp.Rows[0]["MSC状态"] == DBNull.Value ? "" : tbltmp.Rows[0]["MSC状态"].ToString();
if (STATUS.IndexOf("Pending") >= 0)

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="HtmlAgilityPack" version="1.11.43" targetFramework="net45" />
<package id="Microsoft.NETFramework.ReferenceAssemblies.net45" version="1.0.3" targetFramework="net45" developmentDependency="true" />
<package id="NPOI" version="2.5.6" targetFramework="net45" />
<package id="Portable.BouncyCastle" version="1.8.9" targetFramework="net45" />
<package id="SharpZipLib" version="1.3.3" targetFramework="net45" />

Loading…
Cancel
Save