作者 朱兆平

落装改配回执BUG

@@ -49,9 +49,10 @@ spring: @@ -49,9 +49,10 @@ spring:
49 type: com.alibaba.druid.pool.DruidDataSource 49 type: com.alibaba.druid.pool.DruidDataSource
50 #oracle 50 #oracle
51 driver-class-name: oracle.jdbc.OracleDriver 51 driver-class-name: oracle.jdbc.OracleDriver
52 - url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL 52 + url: jdbc:oracle:thin:@10.50.3.69:1521:CGODB
  53 +# url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL
53 username: CGONMS 54 username: CGONMS
54 - password: vmvnv1v2 55 + password: 1q2w3e4r
55 #spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码 56 #spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
56 # url: jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8 57 # url: jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8
57 # username: root 58 # username: root
@@ -132,7 +133,7 @@ jwt: @@ -132,7 +133,7 @@ jwt:
132 #自定义配置 133 #自定义配置
133 custom: 134 custom:
134 #进港放行回执读取目录 135 #进港放行回执读取目录
135 - receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/20191104 136 + receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例
136 #回执解析成功后的备份目录 137 #回执解析成功后的备份目录
137 receptBakDir: /Users/mrz/Downloads/rdp_temp/logs/success 138 receptBakDir: /Users/mrz/Downloads/rdp_temp/logs/success
138 #解析错误报文的备份目录 139 #解析错误报文的备份目录
1 package com.tianbo.analysis.controller; 1 package com.tianbo.analysis.controller;
2 2
  3 +import lombok.extern.slf4j.Slf4j;
3 import org.apache.commons.io.FileUtils; 4 import org.apache.commons.io.FileUtils;
4 import org.springframework.beans.factory.annotation.Value; 5 import org.springframework.beans.factory.annotation.Value;
5 import org.springframework.web.bind.annotation.PostMapping; 6 import org.springframework.web.bind.annotation.PostMapping;
@@ -15,6 +16,7 @@ import java.util.UUID; @@ -15,6 +16,7 @@ import java.util.UUID;
15 */ 16 */
16 @RestController 17 @RestController
17 @RequestMapping("/Rmsg") 18 @RequestMapping("/Rmsg")
  19 +@Slf4j
18 public class RadioMsgController { 20 public class RadioMsgController {
19 21
20 //备份目录 22 //备份目录
@@ -60,14 +62,17 @@ public class RadioMsgController { @@ -60,14 +62,17 @@ public class RadioMsgController {
60 62
61 @PostMapping("ffm") 63 @PostMapping("ffm")
62 public int extFFM(String ffmmsg){ 64 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(); 65 + if (ffmmsg!=null){
  66 + ffmmsg = FFM_HEADER + ffmmsg;
  67 + ffmmsg = ffmmsg + FFM_FOOTER;
  68 + File file = new File(extRedioMsgDir+UUID.randomUUID()+".txt");
  69 + try {
  70 + FileUtils.writeStringToFile(file,ffmmsg,"UTF-8");
  71 + log.info("FFM报文导入成功");
  72 + return 1;
  73 + }catch (IOException e){
  74 + e.printStackTrace();
  75 + }
71 } 76 }
72 return 0; 77 return 0;
73 } 78 }
@@ -75,28 +80,34 @@ public class RadioMsgController { @@ -75,28 +80,34 @@ public class RadioMsgController {
75 80
76 @PostMapping("fwb") 81 @PostMapping("fwb")
77 public int extFWB(String ffmmsg){ 82 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(); 83 + if (ffmmsg!=null) {
  84 + ffmmsg = FWB_HEADER + ffmmsg;
  85 + ffmmsg = ffmmsg + FWB_FOOTER;
  86 + File file = new File(extRedioMsgDir + UUID.randomUUID() + ".txt");
  87 + try {
  88 + FileUtils.writeStringToFile(file, ffmmsg, "UTF-8");
  89 + log.info("FWB报文导入成功");
  90 + return 1;
  91 + } catch (IOException e) {
  92 + e.printStackTrace();
  93 + }
86 } 94 }
87 return 0; 95 return 0;
88 } 96 }
89 97
90 @PostMapping("fhl") 98 @PostMapping("fhl")
91 public int extFHL(String ffmmsg){ 99 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 + if (ffmmsg!=null) {
  101 + ffmmsg = FHL_HEADER + ffmmsg;
  102 + ffmmsg = ffmmsg + FHL_FOOTER;
  103 + File file = new File(extRedioMsgDir + UUID.randomUUID() + ".txt");
  104 + try {
  105 + FileUtils.writeStringToFile(file, ffmmsg, "UTF-8");
  106 + log.info("FHL报文导入成功");
  107 + return 1;
  108 + } catch (IOException e) {
  109 + e.printStackTrace();
  110 + }
100 } 111 }
101 return 0; 112 return 0;
102 } 113 }
@@ -168,7 +168,7 @@ @@ -168,7 +168,7 @@
168 </insert> 168 </insert>
169 169
170 <update id="updateRECEIPTION" parameterType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE" > 170 <update id="updateRECEIPTION" parameterType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE" >
171 - UPDATE MANIFESTLOAD 171 + UPDATE MANIFESTLOSTCHANGE
172 SET 172 SET
173 RECEIPTION= #{receiption,jdbcType=VARCHAR}, 173 RECEIPTION= #{receiption,jdbcType=VARCHAR},
174 STATUS = #{status,jdbcType=VARCHAR} 174 STATUS = #{status,jdbcType=VARCHAR}
@@ -183,7 +183,7 @@ @@ -183,7 +183,7 @@
183 </update> 183 </update>
184 <select id="selectAutoIdByawbAawbH" parameterType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE" resultType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE"> 184 <select id="selectAutoIdByawbAawbH" parameterType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE" resultType="com.tianbo.analysis.model.MANIFESTLOSTCHANGE">
185 SELECT ID 185 SELECT ID
186 - FROM MANIFESTLOAD 186 + FROM MANIFESTLOSTCHANGE
187 WHERE 187 WHERE
188 WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR} 188 WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
189 AND 189 AND