Commit 851da92c87018da95e6273b8a773a0e5e824c139
1 parent
e73b4f61
上传线路接口修改
Showing
1 changed file
with
22 additions
and
5 deletions
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| ... | ... | @@ -15,6 +15,7 @@ import com.bsth.service.TrafficManageService; |
| 15 | 15 | import com.bsth.util.TimeUtils; |
| 16 | 16 | import com.bsth.util.db.DBUtils_MS; |
| 17 | 17 | import com.bsth.webService.trafficManage.geotool.services.InternalPortType; |
| 18 | +import com.bsth.webService.trafficManage.geotool.services.Internal; | |
| 18 | 19 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; |
| 19 | 20 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; |
| 20 | 21 | import org.apache.commons.lang.time.DateUtils; |
| ... | ... | @@ -25,10 +26,7 @@ import org.springframework.data.domain.Sort; |
| 25 | 26 | import org.springframework.data.domain.Sort.Direction; |
| 26 | 27 | import org.springframework.stereotype.Service; |
| 27 | 28 | |
| 28 | -import java.io.BufferedOutputStream; | |
| 29 | -import java.io.File; | |
| 30 | -import java.io.FileOutputStream; | |
| 31 | -import java.io.IOException; | |
| 29 | +import java.io.*; | |
| 32 | 30 | import java.sql.Connection; |
| 33 | 31 | import java.sql.PreparedStatement; |
| 34 | 32 | import java.sql.ResultSet; |
| ... | ... | @@ -188,6 +186,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 188 | 186 | sBuffer.append("</XLs>"); |
| 189 | 187 | System.out.println(sBuffer.toString()); |
| 190 | 188 | if(sBuffer.indexOf("<XL>") != -1){ |
| 189 | + portType = new Internal().getInternalHttpSoap11Endpoint(); | |
| 191 | 190 | String portResult = portType.setXL(userNameXl, passwordXl, sBuffer.toString()); |
| 192 | 191 | String portArray[] = portResult.split("\n"); |
| 193 | 192 | if(portArray.length >= 4){ |
| ... | ... | @@ -386,6 +385,24 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 386 | 385 | } |
| 387 | 386 | |
| 388 | 387 | /** |
| 388 | + * 从文件中读取xml | |
| 389 | + * @param fileName 例:D:/test.txt | |
| 390 | + * @return | |
| 391 | + * @throws Exception | |
| 392 | + */ | |
| 393 | + private String readXmlFromFile(String fileName) throws Exception { | |
| 394 | + StringBuffer sf = new StringBuffer(""); | |
| 395 | + File file = new File(fileName); | |
| 396 | + InputStreamReader reader = new InputStreamReader(new FileInputStream(file),"utf-8"); | |
| 397 | + BufferedReader bufferedReader = new BufferedReader(reader); | |
| 398 | + String lineTxt = ""; | |
| 399 | + while((lineTxt = bufferedReader.readLine()) != null){ | |
| 400 | + sf.append(lineTxt); | |
| 401 | + } | |
| 402 | + reader.close(); | |
| 403 | + return sf.toString().replaceAll("\t",""); | |
| 404 | + } | |
| 405 | + /** | |
| 389 | 406 | * 上传里程油耗 |
| 390 | 407 | * @return 上传成功标识 |
| 391 | 408 | */ |
| ... | ... | @@ -890,7 +907,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 890 | 907 | int nTotalMemory = ( int ) (currRuntime.totalMemory() / 1024 / 1024); |
| 891 | 908 | |
| 892 | 909 | System.out.println("zzz:"+nFreeMemory + "M/" + nTotalMemory +"M(free/total)"); |
| 893 | - | |
| 910 | + portType = new Internal().getInternalHttpSoap11Endpoint(); | |
| 894 | 911 | byte[] res = portType.downloadAllDataFile("down_pdgj", "down_pdgj123"); |
| 895 | 912 | String filePath = "E:\\ygc"; |
| 896 | 913 | BufferedOutputStream bos = null; | ... | ... |