| | |
| | | }
|
| | | return (test_record_count+1);
|
| | | }
|
| | |
|
| | | //手动停止时,如果没有导入完,删除记录
|
| | | public static void delete_UserCancel(MysqlConnPool pool,int BattGoupId,int max_test_record_count) {
|
| | | ArrayList<String> sql_strs = new ArrayList<>();
|
| | | String sql_str_inf = "delete from "+Sql_Mysql.Tb_FboTestData_Inf_Table+" where test_record_count="+max_test_record_count;
|
| | | sql_strs.add(sql_str_inf);
|
| | | String sql_str_id = " delete from "+Sql_Mysql.Tb_FboTestData_Table+BattGoupId+" where test_record_count="+max_test_record_count;
|
| | | sql_strs.add(sql_str_id);
|
| | | Sql_Mysql sql = new Sql_Mysql(pool);
|
| | | sql.makeManualCommit(sql_strs);
|
| | | sql.close_con();
|
| | | } |
| | | //文件导入进度修改
|
| | | public static void updateFBOGressByOneSql(MysqlConnPool pool,int file_sum,int file_block,int battgroupid,int file_downloadNum) {
|
| | | //System.out.println("file_downloadNum:"+file_downloadNum);
|
| | |
| | | nowFbo = fbofile.files[i];
|
| | | int file_downloadNum=i;//设置当前下载文件的索引
|
| | | if(now_download_state == DownLoadState_DownLoadCancel) {
|
| | | nowFbo.setDownload_state(DownLoadState_DownLoadCancel);
|
| | | nowFbo.setDownload_flag(DownloadFlag_Fail);
|
| | | fbofile.files[i].setDownload_state(DownLoadState_DownLoadCancel);
|
| | | fbofile.files[i].setDownload_flag(DownloadFlag_Fail);
|
| | | |
| | | FGCD_Task_Thread_SQL.updateFgcd_Filedownload_TableCmdByDevId(pool,fbofile,file_downloadNum);
|
| | | continue;
|
| | | }
|
| | | if(nowFbo.download_flag != DownloadFlag_Start) {
|
| | |
| | | now_download_state = FGCD_ComBase.CMD_DownLoadFBDFile_Over;
|
| | | fbofile.setStop_reason(FialReason_UserCancel);
|
| | | //手动终止下载命令
|
| | | nowFbo.setDownload_flag(DownloadFlag_Fail);
|
| | | nowFbo.setDownload_state(DownLoadState_DownLoadCancel);
|
| | | fbofile.files[file_downloadNum].setDownload_flag(DownloadFlag_Fail);
|
| | | fbofile.files[file_downloadNum].setDownload_state(DownLoadState_DownLoadCancel);
|
| | | fbofile.op_cmd = FGCD_ComBase.CMD_DownLoadFBDFile_Over_ACK;
|
| | | FGCD_Task_Thread_SQL.updateFgcd_Filedownload_TableCmdByDevId(pool, fbofile,file_downloadNum);
|
| | | continue;
|
| | |
| | | int nowFbo_download_state=FGCD_Task_Thread_SQL.quereyDownLoadState_UserCancel(m_ConnPool,battgroupid);
|
| | | if(nowFbo_download_state==FGCD_ComBase.CMD_DownLoadFBDFile_Over) {
|
| | | sucess=false;
|
| | | FGCD_Task_Thread_SQL.delete_UserCancel(m_ConnPool,battgroupid,max_test_record_count);
|
| | | break;
|
| | | }
|
| | | FboDataType mType = new FboDataType();
|
| | |
| | | sucess=sucess&bl;
|
| | | file_block=record_num*(data_inf.BattSum*2 + 32)+256;
|
| | | FGCD_Task_Thread_SQL.updateFBOGressByOneSql(m_ConnPool,file_sum,file_block,battgroupid,file_downloadNum);//插入文件的进度
|
| | | System.err.println("总数:"+file_sum+" 导入数据:"+file_block);
|
| | | //System.err.println("总数:"+file_sum+" 导入数据:"+file_block);
|
| | | record_num++;
|
| | | }
|
| | | }
|