Commit 9a3b3e7428bbf94fa5e90a646775bcddf2138e50

Authored by zlz
1 parent 4c817fe2

运管处路单上传BUG修改

src/main/java/com/bsth/service/traffic/impl/YgcBasicDataServiceImpl.java
... ... @@ -68,7 +68,7 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
68 68 String flag = "failure";
69 69 try {
70 70 // 调用接口下载基础数据
71   - if(download(userName, DigestUtils.md5Hex(passWord), saveFile)){
  71 + if(download(userName, passWord, saveFile)){
72 72 // 读取基础数据zip
73 73 StringBuffer sb = readZipFile(saveFile);
74 74 // 解析xml
... ... @@ -99,10 +99,11 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
99 99 * @param saveFile
100 100 * @return
101 101 */
102   - private boolean download(String userName, String password, String saveFile)
  102 + public boolean download(String userName, String password, String saveFile)
103 103 {
104 104 try
105 105 {
  106 + password = DigestUtils.md5Hex(password);
106 107 OMElement data = buildDownloadEnvelope(userName, password);
107 108 ServiceClient sender = new ServiceClient();
108 109 Options options = sender.getOptions();
... ... @@ -123,6 +124,12 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
123 124 while ((read = is.read(buffer)) != -1) {
124 125 imageOutStream.write(buffer, 0, read);
125 126 }
  127 + if(is != null){
  128 + is.close();
  129 + }
  130 + if(imageOutStream != null){
  131 + imageOutStream.close();
  132 + }
126 133 return true;
127 134 } catch (Exception e) {
128 135 e.printStackTrace();
... ...