Commit f9b85d0d15aa8830ee959ccb07eb02fa783c008b
1 parent
c31a8f68
运管处路单上传BUG修改
Showing
1 changed file
with
22 additions
and
1 deletions
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| @@ -404,6 +404,27 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -404,6 +404,27 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 404 | } | 404 | } |
| 405 | 405 | ||
| 406 | /** | 406 | /** |
| 407 | + * 上传路单 xml来自文件 | ||
| 408 | + * @return 上传成功标识 | ||
| 409 | + */ | ||
| 410 | + public String setLDFile(){ | ||
| 411 | + String result = "failure"; | ||
| 412 | + try { | ||
| 413 | + String tmp = readXmlFromFile("E:/ld.txt"); | ||
| 414 | + Results rss = ssop.setLD(userNameOther, passwordOther, tmp); | ||
| 415 | + if(rss.isSuccess()){ | ||
| 416 | + result = "success"; | ||
| 417 | + } | ||
| 418 | + } catch (Exception e) { | ||
| 419 | + logger.error("setLD:",e); | ||
| 420 | + e.printStackTrace(); | ||
| 421 | + }finally{ | ||
| 422 | + | ||
| 423 | + } | ||
| 424 | + return result; | ||
| 425 | + } | ||
| 426 | + | ||
| 427 | + /** | ||
| 407 | * 从文件中读取xml | 428 | * 从文件中读取xml |
| 408 | * @param fileName 例:D:/test.txt | 429 | * @param fileName 例:D:/test.txt |
| 409 | * @return | 430 | * @return |
| @@ -1184,6 +1205,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -1184,6 +1205,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 1184 | private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(String lineCode,String direction,String stationCode){ | 1205 | private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(String lineCode,String direction,String stationCode){ |
| 1185 | Integer number = 0; | 1206 | Integer number = 0; |
| 1186 | number = BasicData.stationName2YgcNumber.get(lineCode+"_"+direction+"_"+stationCode); | 1207 | number = BasicData.stationName2YgcNumber.get(lineCode+"_"+direction+"_"+stationCode); |
| 1187 | - return number; | 1208 | + return number == null ? 0 : number; |
| 1188 | } | 1209 | } |
| 1189 | } | 1210 | } |