充放电一体机FGCD通信程序【二期初版】
whyclxw
2021-09-03 fd38ca665f1139baa74206c6e08b49f06db4e441
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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 nowFbo =null;
    private Logger logger = null;
    public int battgroupid=0;
    public FGCD_TestFBOFile fbofile=null;
    public int file_downloadNum=0;
    
 
    public FGCD_Export_Thread_SQL(MysqlConnPool m_ConnPool, FBOFile nowFbo,int battgroupid,int file_downloadNum) {
        super();
        this.m_ConnPool = m_ConnPool;
        this.nowFbo = nowFbo;
        this.battgroupid=battgroupid;
        //this.fbofile=fbofile;
        this.file_downloadNum=file_downloadNum;
        this.logger = LogManager.getLogger(this);
    }
 
 
 
    @Override
    public void run() {
        //System.out.println("Ï߳̿ªÆô"+new Date());
        //file.setDownload_state(FGCD_TestDataDownLoad.DownLoadState_ExportData);
        readFBOFileData(nowFbo,m_ConnPool);
    }
    /**
     *     ½âÎöFBOÎļþ
     * @param file
     * @param pool
     */
     private void readFBOFileData(FBOFile nowFbo,MysqlConnPool pool) {
         File file = new File(nowFbo.filename);
         if(nowFbo.test_timelong > 0) {
             FboData.checkFboFileByOneSql(m_ConnPool,file,battgroupid,file_downloadNum);
         }
         if(file.exists()) {
            //ɾ³ýÏÂÔØµÄFBOÎļþ
             file.delete();
         }    
    }
 
 
}