充放电一体机FGCD通信程序【二期初版】
whyclxw
2021-09-01 48b0d8bf2db9a5a0950946ad03544504633a86d0
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
62
63
64
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;        
    }
 
 
}