作者 朱兆平

修复ffm报文解析航班航段目的站适配"/5X"被识别成目的站的BUG

@@ -1359,11 +1359,22 @@ namespace CustomsCargoSystem.ExchangeDataStorageService @@ -1359,11 +1359,22 @@ namespace CustomsCargoSystem.ExchangeDataStorageService
1359 for (int num2 = i - 1; num2 > 0; num2--) 1359 for (int num2 = i - 1; num2 > 0; num2--)
1360 { 1360 {
1361 string text8 = list[num2].Trim(); 1361 string text8 = list[num2].Trim();
  1362 + //change by mrz
  1363 + //航班多航段目的站判断修复
1362 if (!string.IsNullOrEmpty(text8) && text8.Length >= 3 && text8.Length <= 40 && (text8.Length == 3 || text8.Substring(0, 3) == "CGO")) 1364 if (!string.IsNullOrEmpty(text8) && text8.Length >= 3 && text8.Length <= 40 && (text8.Length == 3 || text8.Substring(0, 3) == "CGO"))
1363 { 1365 {
  1366 + //取前三个字符 判断是否是航站代码,排查掉/0X 这种字符的
  1367 + string destinationstation_str = text8.Substring(0, 3);
  1368 + string destnation_pattern = "^[A-Z]{3}$";
  1369 + if (Regex.IsMatch(destinationstation_str, destnation_pattern))
  1370 + {
  1371 + //找到就跳出,没找到继续往上找
1364 destinationstation = text8.Substring(0, 3); 1372 destinationstation = text8.Substring(0, 3);
1365 break; 1373 break;
1366 } 1374 }
  1375 +
  1376 +
  1377 + }
1367 } 1378 }
1368 int num3 = 0; 1379 int num3 = 0;
1369 text = text2.Substring(0, 12); 1380 text = text2.Substring(0, 12);