Commit 0a59ef59e7806848c5007f8ec307ffb9d6c2cae7
1 parent
9a65026d
LGF
Showing
2 changed files
with
8 additions
and
1 deletions
src/main/java/com/bsth/controller/DownloadController.java
| @@ -20,6 +20,7 @@ import org.springframework.http.ResponseEntity; | @@ -20,6 +20,7 @@ import org.springframework.http.ResponseEntity; | ||
| 20 | import org.springframework.stereotype.Component; | 20 | import org.springframework.stereotype.Component; |
| 21 | import org.springframework.web.bind.annotation.RequestMapping; | 21 | import org.springframework.web.bind.annotation.RequestMapping; |
| 22 | 22 | ||
| 23 | +import com.google.protobuf.UnknownFieldSet.Field; | ||
| 23 | import com.mysql.fabric.Response; | 24 | import com.mysql.fabric.Response; |
| 24 | 25 | ||
| 25 | /** | 26 | /** |
| @@ -74,13 +75,14 @@ public class DownloadController | @@ -74,13 +75,14 @@ public class DownloadController | ||
| 74 | os.write(buffer);// 输出文件 | 75 | os.write(buffer);// 输出文件 |
| 75 | os.flush(); | 76 | os.flush(); |
| 76 | os.close(); | 77 | os.close(); |
| 78 | + file.delete(); | ||
| 77 | } | 79 | } |
| 78 | 80 | ||
| 79 | @RequestMapping("downloadList") | 81 | @RequestMapping("downloadList") |
| 80 | public void downloadList(HttpServletResponse response,String fileName) | 82 | public void downloadList(HttpServletResponse response,String fileName) |
| 81 | throws IOException { | 83 | throws IOException { |
| 82 | // String fileNames=URLDecoder.decode(fileName,"UTF-8"); | 84 | // String fileNames=URLDecoder.decode(fileName,"UTF-8"); |
| 83 | - fileName =fileName + ".zip"; | 85 | + fileName = fileName + ".zip"; |
| 84 | String moudelPath = this.getClass().getResource("/").getPath()+ "static/pages/forms/export/"+fileName; | 86 | String moudelPath = this.getClass().getResource("/").getPath()+ "static/pages/forms/export/"+fileName; |
| 85 | File file = new File(moudelPath);// path是根据日志路径和文件名拼接出来的 | 87 | File file = new File(moudelPath);// path是根据日志路径和文件名拼接出来的 |
| 86 | // String filename = file.getName();// 获取日志文件名称 | 88 | // String filename = file.getName();// 获取日志文件名称 |
| @@ -96,5 +98,6 @@ public class DownloadController | @@ -96,5 +98,6 @@ public class DownloadController | ||
| 96 | os.write(buffer);// 输出文件 | 98 | os.write(buffer);// 输出文件 |
| 97 | os.flush(); | 99 | os.flush(); |
| 98 | os.close(); | 100 | os.close(); |
| 101 | + file.delete(); | ||
| 99 | } | 102 | } |
| 100 | } | 103 | } |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| @@ -344,6 +344,8 @@ public class ScheduleRealInfo { | @@ -344,6 +344,8 @@ public class ScheduleRealInfo { | ||
| 344 | } | 344 | } |
| 345 | 345 | ||
| 346 | public String getsGh() { | 346 | public String getsGh() { |
| 347 | + if(sGh == null) | ||
| 348 | + return ""; | ||
| 347 | return sGh; | 349 | return sGh; |
| 348 | } | 350 | } |
| 349 | 351 | ||
| @@ -352,6 +354,8 @@ public class ScheduleRealInfo { | @@ -352,6 +354,8 @@ public class ScheduleRealInfo { | ||
| 352 | } | 354 | } |
| 353 | 355 | ||
| 354 | public String getsName() { | 356 | public String getsName() { |
| 357 | + if(sGh == null) | ||
| 358 | + return ""; | ||
| 355 | return sName; | 359 | return sName; |
| 356 | } | 360 | } |
| 357 | 361 |