| | |
| | | for(int i=0;i<fbofile.files.length;i++) {
|
| | | //当前下载文件
|
| | | FBOFile file = fbofile.files[i];
|
| | | fbofile.file_downloadNum=i;//设置当前下载文件的索引
|
| | | if(now_download_state == DownLoadState_UserCancel) {
|
| | | file.setDownload_state(DownLoadState_UserCancel);
|
| | | file.setDownload_flag(DownloadFlag_Fail);
|
| | |
| | | }
|
| | | nowFbo = file;
|
| | | ReadTestData = true;
|
| | | fbofile.initDownLoadState();
|
| | | fbofile.initDownLoadState();//文件信息下载初始化
|
| | | file.setDownload_state(DownLoadState_ReadData);
|
| | | while(ReadTestData) {
|
| | | try {
|
| | |
| | |
|
| | | if(nowFbo.getDownload_state() == DownLoadState_ExportData) {
|
| | | //解析本地数据文件并导入数据库
|
| | | boolean flag = readFBOFileData(file,pool); |
| | | /*boolean flag = readFBOFileData(file,pool); |
| | | if(flag) {
|
| | | nowFbo.setDownload_state(DownLoadState_ExportSucc);
|
| | | }else {
|
| | | nowFbo.setDownload_state(DownLoadState_ExportFail);
|
| | | }
|
| | | }*/
|
| | | //开启新线程导入数据库
|
| | | FGCD_Export_Thread_SQL export_Thread=new FGCD_Export_Thread_SQL(pool, nowFbo, fbofile);
|
| | | new Thread(export_Thread).start();
|
| | | }
|
| | | System.out.println("nowFbo.getDownload_state():"+nowFbo.getDownload_state());
|
| | | if(nowFbo.getDownload_state() == DownLoadState_ExportFail
|
| | | || nowFbo.getDownload_state() == DownLoadState_ExportSucc) {
|
| | | ReadTestData = false;
|
| | | }
|
| | | file.setDownload_state(nowFbo.getDownload_state());
|
| | | /*file.setDownload_state(nowFbo.getDownload_state());
|
| | | updateDownLoadProgress(pool,fbofile); //更新当前下载进度
|
| | | */ |
| | | Thread.sleep(50);
|
| | | } catch(Exception e) {
|
| | | e.printStackTrace();
|
| | |
| | | }
|
| | | if(f.exists()) {
|
| | | //删除下载的FBO文件
|
| | | f.delete();
|
| | | //f.delete();
|
| | | }
|
| | | return flag;
|
| | | }
|