作者 朱兆平

在线报文导入

... ... @@ -141,6 +141,8 @@ custom:
transmitDir: /Users/mrz/Downloads/rdp_temp/logs/transmit
#匹配技术回执正则
delTechnologyReceptMatch: CN_MT(.*)_1P0_460470678920X_(.*).xml
#报文导入生成目录,这个地方目录结尾要带/
extRedioMsgDir: /Users/mrz/Downloads/rdp_temp/logs/transmit/
devops:
dir:
singlewindow-tcs-recept: D:\TCSSingleWindow\recive
... ...
package com.tianbo.analysis.controller;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.File;
import java.io.IOException;
import java.util.UUID;
/**
* 在线报文导入管理
*/
@RestController
@RequestMapping("/Rmsg")
public class RadioMsgController {
//备份目录
@Value("${custom.extRedioMsgDir}")
private String extRedioMsgDir;
private final static String FFM_HEADER = "<MSG>\n" +
"<META>\n" +
"<SNDR>TXD</SNDR>\n" +
"<DDTM>20200113050339</DDTM>\n" +
"<TYPE>IATA</TYPE>\n" +
"<STYP>FFM</STYP>\n" +
"<SEQN>95205940</SEQN>\n" +
"</META>\n" +
"<FFM>\n";
private final static String FFM_FOOTER = "\n</FFM>\n" +
"</MSG>";
private final static String FWB_HEADER="<MSG>\n" +
"<META>\n" +
"<SNDR>TXD</SNDR>\n" +
"<DDTM>20200113004608</DDTM>\n" +
"<TYPE>IATA</TYPE>\n" +
"<STYP>IFWB</STYP>\n" +
"<SEQN>95203026</SEQN>\n" +
"</META>\n" +
"<FWB>\n";
private final static String FWB_FOOTER="\n</FWB>\n" +
"</MSG>";
private final static String FHL_HEADER="<MSG>\n" +
"<META>\n" +
"<SNDR>TXD</SNDR>\n" +
"<DDTM>20200113003006</DDTM>\n" +
"<TYPE>IATA</TYPE>\n" +
"<STYP>IFHL</STYP>\n" +
"<SEQN>95202782</SEQN>\n" +
"</META>\n" +
"<FHL>\n";
private final static String FHL_FOOTER="\n</FHL>\n" +
"</MSG>";
@PostMapping("ffm")
public int extFFM(String ffmmsg){
ffmmsg = FFM_HEADER + ffmmsg;
ffmmsg = ffmmsg + FFM_FOOTER;
File file = new File(extRedioMsgDir+UUID.randomUUID()+".txt");
try {
FileUtils.writeStringToFile(file,ffmmsg,"UTF-8");
return 1;
}catch (IOException e){
e.printStackTrace();
}
return 0;
}
@PostMapping("fwb")
public int extFWB(String ffmmsg){
ffmmsg = FWB_HEADER + ffmmsg;
ffmmsg = ffmmsg + FWB_FOOTER;
File file = new File(extRedioMsgDir+UUID.randomUUID()+".txt");
try {
FileUtils.writeStringToFile(file,ffmmsg,"UTF-8");
return 1;
}catch (IOException e){
e.printStackTrace();
}
return 0;
}
@PostMapping("fhl")
public int extFHL(String ffmmsg){
ffmmsg = FHL_HEADER + ffmmsg;
ffmmsg = ffmmsg + FHL_FOOTER;
File file = new File(extRedioMsgDir+UUID.randomUUID()+".txt");
try {
FileUtils.writeStringToFile(file,ffmmsg,"UTF-8");
return 1;
}catch (IOException e){
e.printStackTrace();
}
return 0;
}
}
... ...
${AnsiColor.YELLOW}
##################*CETC-TIANBO*#########################
.::::.
.::::::::.
:::::::::::
..:::::::::::'
'::::::::::::'
.::::::::::
'::::::::::::::..
..::::::::::::.
``::::::::::::::::
::::``:::::::::' .:::.
::::' ':::::' .::::::::.
.::::' :::: .:::::::'::::.
.:::' ::::: .:::::::::' ':::::.
.::' :::::.:::::::::' ':::::.
.::' ::::::::::::::' ``::::.
...::: ::::::::::::' ``::.
```` ':. ':::::::::' ::::..
'.:::::' ':'````..
,----------------, ,---------,
,-----------------------, ," ,"|
," ,"| ," ," |
+-----------------------+ | ," ," |
| .-----------------. | | +---------+ |
| | | | | | -==----'| |
| | I LOVE DOS! | | | | | |
| | Bad command or | | |/----|`---= | |
| | C:\>_ | | | ,/|==== ooo | ;
| | | | | // |(((( [33]| ,"
| `-----------------' |," .;'| |(((( | ,"
+-----------------------+ ;; | | |,"
/_)______________(_/ //' | +---------+
___________________________/___ `,
/ oooooooooooooooo .o. oooo /, \,"-----------
/ ==ooooooooooooooo==.o. ooo= // ,`\--{)B ,"
/_==__==========__==_ooo__ooo=_/' /___________,"
#########################################################
... ...