作者 朱兆平

落装改配回执BUG

... ... @@ -49,9 +49,10 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
#oracle
driver-class-name: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL
url: jdbc:oracle:thin:@10.50.3.69:1521:CGODB
# url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL
username: CGONMS
password: vmvnv1v2
password: 1q2w3e4r
#spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
# url: jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8
# username: root
... ... @@ -132,7 +133,7 @@ jwt:
#自定义配置
custom:
#进港放行回执读取目录
receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/20191104
receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例
#回执解析成功后的备份目录
receptBakDir: /Users/mrz/Downloads/rdp_temp/logs/success
#解析错误报文的备份目录
... ...
package com.tianbo.analysis.controller;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
... ... @@ -15,6 +16,7 @@ import java.util.UUID;
*/
@RestController
@RequestMapping("/Rmsg")
@Slf4j
public class RadioMsgController {
//备份目录
... ... @@ -60,14 +62,17 @@ public class RadioMsgController {
@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();
if (ffmmsg!=null){
ffmmsg = FFM_HEADER + ffmmsg;
ffmmsg = ffmmsg + FFM_FOOTER;
File file = new File(extRedioMsgDir+UUID.randomUUID()+".txt");
try {
FileUtils.writeStringToFile(file,ffmmsg,"UTF-8");
log.info("FFM报文导入成功");
return 1;
}catch (IOException e){
e.printStackTrace();
}
}
return 0;
}
... ... @@ -75,28 +80,34 @@ public class RadioMsgController {
@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();
if (ffmmsg!=null) {
ffmmsg = FWB_HEADER + ffmmsg;
ffmmsg = ffmmsg + FWB_FOOTER;
File file = new File(extRedioMsgDir + UUID.randomUUID() + ".txt");
try {
FileUtils.writeStringToFile(file, ffmmsg, "UTF-8");
log.info("FWB报文导入成功");
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();
if (ffmmsg!=null) {
ffmmsg = FHL_HEADER + ffmmsg;
ffmmsg = ffmmsg + FHL_FOOTER;
File file = new File(extRedioMsgDir + UUID.randomUUID() + ".txt");
try {
FileUtils.writeStringToFile(file, ffmmsg, "UTF-8");
log.info("FHL报文导入成功");
return 1;
} catch (IOException e) {
e.printStackTrace();
}
}
return 0;
}
... ...
... ... @@ -168,7 +168,7 @@
</insert>
<update id="updateRECEIPTION" parameterType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE" >
UPDATE MANIFESTLOAD
UPDATE MANIFESTLOSTCHANGE
SET
RECEIPTION= #{receiption,jdbcType=VARCHAR},
STATUS = #{status,jdbcType=VARCHAR}
... ... @@ -183,7 +183,7 @@
</update>
<select id="selectAutoIdByawbAawbH" parameterType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE" resultType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE">
SELECT ID
FROM MANIFESTLOAD
FROM MANIFESTLOSTCHANGE
WHERE
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
AND
... ...