作者 朱兆平

航班日期格式化

@@ -9,38 +9,10 @@ @@ -9,38 +9,10 @@
9 * 文件读取 9 * 文件读取
10 * 航空报文解析 10 * 航空报文解析
11 11
  12 +* rabbitMQ工具类
12 13
13 - [ZCZC  
14 - QD HKGVICX  
15 - .CGOFD1E 261934  
16 - FSU/6  
17 - 043-85718776HKGCGO/T1K11.0  
18 - DLV/26JUN1934/CGO/T1K11.0  
19 -  
20 -  
21 - =  
22 - NNNN] 14 +* POI-excel-word工具类
23 15
24 - [ZCZC  
25 - QD HKGVICX  
26 - .CGOFD1E 261917  
27 - FSU/12  
28 - 160-08065536CGOMAA/T4K762.0  
29 - FOH/26JUN1917/CGO/T4K762.0/AGILITY LOGISTICS SHANGHAI LIMITED  
30 - /MC5.93DGMC  
31 -  
32 -  
33 - =  
34 - NNNN]  
35 - [ZCZC  
36 - QD CHACSRU  
37 - .CGOFD1E 261815  
38 - FSU/8  
39 - 580-20731631CGOORD/T43K6798.0  
40 - DEP/5X173/26JUN/CGOICN/T43K6798.0/A1811/E1910  
41 -  
42 -  
43 - =  
44 - NNNN] 16 +* bean-map互转工具类
45 17
46   18  
@@ -9,6 +9,7 @@ import java.time.format.DateTimeFormatter; @@ -9,6 +9,7 @@ import java.time.format.DateTimeFormatter;
9 import java.time.format.DateTimeParseException; 9 import java.time.format.DateTimeParseException;
10 import java.util.Calendar; 10 import java.util.Calendar;
11 import java.util.Date; 11 import java.util.Date;
  12 +import java.util.Locale;
12 13
13 14
14 /** 15 /**
@@ -540,4 +541,23 @@ public final class DateUtil { @@ -540,4 +541,23 @@ public final class DateUtil {
540 541
541 return time; 542 return time;
542 } 543 }
  544 +
  545 + /**
  546 + * 格式化航班日期类型
  547 + * @param dateStr
  548 + * @return
  549 + * @throws ParseException
  550 + */
  551 + public static Date dateFormatFlight(String dateStr) throws ParseException{
  552 + SimpleDateFormat sdf = new SimpleDateFormat("ddMMMyyyy", Locale.ENGLISH);
  553 + try {
  554 + Date date = sdf.parse(dateStr);
  555 + System.out.println(date);
  556 + return date;
  557 + } catch (ParseException e) {
  558 + // TODO Auto-generated catch block
  559 + e.printStackTrace();
  560 + }
  561 + return null;
  562 + }
543 } 563 }
@@ -20,6 +20,16 @@ public class XMLXPath { @@ -20,6 +20,16 @@ public class XMLXPath {
20 } 20 }
21 21
22 } 22 }
  23 + public static String getSingleValueByNodePath(Node document,String path){
  24 + Node node = document.selectSingleNode(path);
  25 + if (node!=null){
  26 + String nodeValue = node.getStringValue();
  27 + return nodeValue;
  28 + }else {
  29 + return null;
  30 + }
  31 +
  32 + }
23 public static List<Node> getPathValues(Document document,String path){ 33 public static List<Node> getPathValues(Document document,String path){
24 List<Node> nodes= document.selectNodes(path); 34 List<Node> nodes= document.selectNodes(path);
25 return nodes; 35 return nodes;