作者 朱兆平

在线报文导入

@@ -141,6 +141,8 @@ custom: @@ -141,6 +141,8 @@ custom:
141 transmitDir: /Users/mrz/Downloads/rdp_temp/logs/transmit 141 transmitDir: /Users/mrz/Downloads/rdp_temp/logs/transmit
142 #匹配技术回执正则 142 #匹配技术回执正则
143 delTechnologyReceptMatch: CN_MT(.*)_1P0_460470678920X_(.*).xml 143 delTechnologyReceptMatch: CN_MT(.*)_1P0_460470678920X_(.*).xml
  144 + #报文导入生成目录,这个地方目录结尾要带/
  145 + extRedioMsgDir: /Users/mrz/Downloads/rdp_temp/logs/transmit/
144 devops: 146 devops:
145 dir: 147 dir:
146 singlewindow-tcs-recept: D:\TCSSingleWindow\recive 148 singlewindow-tcs-recept: D:\TCSSingleWindow\recive
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +import org.apache.commons.io.FileUtils;
  4 +import org.springframework.beans.factory.annotation.Value;
  5 +import org.springframework.web.bind.annotation.PostMapping;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RestController;
  8 +
  9 +import java.io.File;
  10 +import java.io.IOException;
  11 +import java.util.UUID;
  12 +
  13 +/**
  14 + * 在线报文导入管理
  15 + */
  16 +@RestController
  17 +@RequestMapping("/Rmsg")
  18 +public class RadioMsgController {
  19 +
  20 + //备份目录
  21 + @Value("${custom.extRedioMsgDir}")
  22 + private String extRedioMsgDir;
  23 +
  24 + private final static String FFM_HEADER = "<MSG>\n" +
  25 + "<META>\n" +
  26 + "<SNDR>TXD</SNDR>\n" +
  27 + "<DDTM>20200113050339</DDTM>\n" +
  28 + "<TYPE>IATA</TYPE>\n" +
  29 + "<STYP>FFM</STYP>\n" +
  30 + "<SEQN>95205940</SEQN>\n" +
  31 + "</META>\n" +
  32 + "<FFM>\n";
  33 +
  34 + private final static String FFM_FOOTER = "\n</FFM>\n" +
  35 + "</MSG>";
  36 +
  37 + private final static String FWB_HEADER="<MSG>\n" +
  38 + "<META>\n" +
  39 + "<SNDR>TXD</SNDR>\n" +
  40 + "<DDTM>20200113004608</DDTM>\n" +
  41 + "<TYPE>IATA</TYPE>\n" +
  42 + "<STYP>IFWB</STYP>\n" +
  43 + "<SEQN>95203026</SEQN>\n" +
  44 + "</META>\n" +
  45 + "<FWB>\n";
  46 + private final static String FWB_FOOTER="\n</FWB>\n" +
  47 + "</MSG>";
  48 +
  49 + private final static String FHL_HEADER="<MSG>\n" +
  50 + "<META>\n" +
  51 + "<SNDR>TXD</SNDR>\n" +
  52 + "<DDTM>20200113003006</DDTM>\n" +
  53 + "<TYPE>IATA</TYPE>\n" +
  54 + "<STYP>IFHL</STYP>\n" +
  55 + "<SEQN>95202782</SEQN>\n" +
  56 + "</META>\n" +
  57 + "<FHL>\n";
  58 + private final static String FHL_FOOTER="\n</FHL>\n" +
  59 + "</MSG>";
  60 +
  61 + @PostMapping("ffm")
  62 + public int extFFM(String ffmmsg){
  63 + ffmmsg = FFM_HEADER + ffmmsg;
  64 + ffmmsg = ffmmsg + FFM_FOOTER;
  65 + File file = new File(extRedioMsgDir+UUID.randomUUID()+".txt");
  66 + try {
  67 + FileUtils.writeStringToFile(file,ffmmsg,"UTF-8");
  68 + return 1;
  69 + }catch (IOException e){
  70 + e.printStackTrace();
  71 + }
  72 + return 0;
  73 + }
  74 +
  75 +
  76 + @PostMapping("fwb")
  77 + public int extFWB(String ffmmsg){
  78 + ffmmsg = FWB_HEADER + ffmmsg;
  79 + ffmmsg = ffmmsg + FWB_FOOTER;
  80 + File file = new File(extRedioMsgDir+UUID.randomUUID()+".txt");
  81 + try {
  82 + FileUtils.writeStringToFile(file,ffmmsg,"UTF-8");
  83 + return 1;
  84 + }catch (IOException e){
  85 + e.printStackTrace();
  86 + }
  87 + return 0;
  88 + }
  89 +
  90 + @PostMapping("fhl")
  91 + public int extFHL(String ffmmsg){
  92 + ffmmsg = FHL_HEADER + ffmmsg;
  93 + ffmmsg = ffmmsg + FHL_FOOTER;
  94 + File file = new File(extRedioMsgDir+UUID.randomUUID()+".txt");
  95 + try {
  96 + FileUtils.writeStringToFile(file,ffmmsg,"UTF-8");
  97 + return 1;
  98 + }catch (IOException e){
  99 + e.printStackTrace();
  100 + }
  101 + return 0;
  102 + }
  103 +}
1 ${AnsiColor.YELLOW} 1 ${AnsiColor.YELLOW}
2 ##################*CETC-TIANBO*######################### 2 ##################*CETC-TIANBO*#########################
3 3
4 - .::::.  
5 - .::::::::.  
6 - :::::::::::  
7 - ..:::::::::::'  
8 - '::::::::::::'  
9 - .::::::::::  
10 - '::::::::::::::..  
11 - ..::::::::::::.  
12 - ``::::::::::::::::  
13 - ::::``:::::::::' .:::.  
14 - ::::' ':::::' .::::::::.  
15 - .::::' :::: .:::::::'::::.  
16 - .:::' ::::: .:::::::::' ':::::.  
17 - .::' :::::.:::::::::' ':::::.  
18 - .::' ::::::::::::::' ``::::.  
19 - ...::: ::::::::::::' ``::.  
20 - ```` ':. ':::::::::' ::::..  
21 - '.:::::' ':'````.. 4 + ,----------------, ,---------,
  5 + ,-----------------------, ," ,"|
  6 + ," ,"| ," ," |
  7 + +-----------------------+ | ," ," |
  8 + | .-----------------. | | +---------+ |
  9 + | | | | | | -==----'| |
  10 + | | I LOVE DOS! | | | | | |
  11 + | | Bad command or | | |/----|`---= | |
  12 + | | C:\>_ | | | ,/|==== ooo | ;
  13 + | | | | | // |(((( [33]| ,"
  14 + | `-----------------' |," .;'| |(((( | ,"
  15 + +-----------------------+ ;; | | |,"
  16 + /_)______________(_/ //' | +---------+
  17 + ___________________________/___ `,
  18 + / oooooooooooooooo .o. oooo /, \,"-----------
  19 + / ==ooooooooooooooo==.o. ooo= // ,`\--{)B ,"
  20 + /_==__==========__==_ooo__ooo=_/' /___________,"
  21 +
  22 +
22 ######################################################### 23 #########################################################
23 24
24 25