package com.dev.fgcd.comm;
|
|
import java.io.File;
|
import java.util.ArrayList;
|
import java.util.Date;
|
|
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.Logger;
|
|
import com.battmonitor.sql.MysqlConnPool;
|
import com.dev.fgcd.data.FGCD_TestFBOFile;
|
import com.dev.fgcd.data.FGCD_TestFBOFile.FBOFile;
|
import com.dev.fgcd.fbo.FboData;
|
import com.dev.fgcd.fbo.FboDataInf;
|
import com.sybase.jdbc3.a.b.g;
|
|
public class FGCD_Export_Thread_SQL implements Runnable{
|
public MysqlConnPool m_ConnPool = null;
|
public FBOFile file =null;
|
private Logger logger = null;
|
public int battgroupid=0;
|
public FGCD_TestFBOFile fbofile=null;
|
|
|
public FGCD_Export_Thread_SQL(MysqlConnPool m_ConnPool, FBOFile file,FGCD_TestFBOFile fbofile) {
|
super();
|
this.m_ConnPool = m_ConnPool;
|
this.file = file;
|
//this.battgroupid=battgroupid;
|
this.fbofile=fbofile;
|
this.logger = LogManager.getLogger(this);
|
}
|
|
|
|
@Override
|
public void run() {
|
//System.out.println("Ï߳̿ªÆô"+new Date());
|
file.setDownload_state(FGCD_TestDataDownLoad.DownLoadState_ExportSucc);
|
readFBOFileData(file,m_ConnPool);
|
|
|
}
|
/**
|
* ½âÎöFBOÎļþ
|
* @param file
|
* @param pool
|
*/
|
private boolean readFBOFileData(FBOFile file,MysqlConnPool pool) {
|
boolean flag = false;
|
File f = new File(file.filename);
|
System.err.println(f.getName()+" "+f.length());
|
if(file.test_timelong > 0) {
|
flag=FboData.checkFboFileByOneSql(m_ConnPool,f,fbofile);
|
}
|
if(f.exists()) {
|
//ɾ³ýÏÂÔØµÄFBOÎļþ
|
f.delete();
|
}
|
return flag;
|
}
|
|
|
}
|