黑马程序员技术交流社区

标题: 求教javaee大神,一个问题,我这里报错一直找不到错误在..... [打印本页]

作者: 你媚你魅你    时间: 2015-3-19 10:35
标题: 求教javaee大神,一个问题,我这里报错一直找不到错误在.....
public class TrackGpsByLineCarGZL_AppendSchedule {

    private List<File> fileListIn = new ArrayList<File>();

    private static final DecimalFormat DF_DOUBLE = new DecimalFormat("##0.00###");
   
    private List linelist=new ArrayList();
    private HashMap allLine=new HashMap();
    public String IN_DIR = "";
    public String OUT_FILE = "E:\\调度追加\\";
    String str = "";
   
    private final String IN_ENCODE = "GBK";
    private final String OUT_ENCODE = "GBK";
    public static String getRandomFileName() {  
              
        SimpleDateFormat simpleDateFormat;  
  
        simpleDateFormat = new SimpleDateFormat("yyyyMMdd");  
  
        Date date = new Date();  
  
        String str = simpleDateFormat.format(date);  
  
        System.out.println(str);
        return str;// 当前时间  
      
    }  
    public TrackGpsByLineCarGZL_AppendSchedule()
    {
     
    }
    public static final Comparator<File> SortByFileNameAsc = new Comparator<File>() {
        public int compare(File f1, File f2) {
            return f1.getName().compareTo(f2.getName());
        }
    };
   
    public void execute() {
        try {
            Collections.sort(fileListIn, SortByFileNameAsc);
            int count=0;
            for (File file : fileListIn) {
                if (file.getName().equals(".svn"))
                    continue;
                executeAll(file);
                count++;
                if(count%100==0)
                {

                    outAllLineA();
                }
            }
            outAllLineA();
        } catch (Exception ex) {
            System.out.println("zyw" + ex.toString());
        }
    }
    public void outAllLineA()
    {
        String temStrG = "";
           
                File Schedule=new File("e:\\调度\\"+str+".csv");
        ArrayList list=new ArrayList();
            try {
            BufferedReader brIn = new BufferedReader(new InputStreamReader(
                    new FileInputStream(Schedule), IN_ENCODE));
             while ((temStrG = brIn.readLine()) != null) {
                        boolean isneedLine=false;
                        String [] line=temStrG.split("\\,");
                        if(allLine.containsKey(line[2]))
                        {
                                temStrG+=allLine.get(line[2]);
                        }
                        list.add(temStrG);
                    }
            brIn.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
            ArrayList list2=new ArrayList();
           
           
            OperatorFile.writeFileList(OUT_FILE, "大调度2015-"+str+"_追加上传车辆.csv", list,OUT_ENCODE);
            //OperatorFile.writeFileList(OUT_FILE,  "JCDB_8613436741030_PS20140303.txt", list,OUT_ENCODE);
        allLine.clear();
    }
   
    public void executeAll(File fileIn) {
        String temStrG = "";
        try {
            BufferedReader brIn = new BufferedReader(new InputStreamReader(
                    new FileInputStream(fileIn), IN_ENCODE));
            //
            
            while ((temStrG = brIn.readLine()) != null) {
                        boolean isneedLine=false;
                        String [] line=temStrG.split("\\,");
                        if(!allLine.containsKey(line[1]))
                                allLine.put(line[1], ","+line[0]);
                    }
            brIn.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println(fileIn.getName()+"---------OK");

    }
    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        TrackGpsByLineCarGZL_AppendSchedule obj=new TrackGpsByLineCarGZL_AppendSchedule();
        obj.execute();
    }

}
作者: 你媚你魅你    时间: 2015-3-19 10:36
我的业务需求就是输出的E盘一个文件,文件名字必须是**今天的实时日期**.**这样的格式
作者: 你媚你魅你    时间: 2015-3-19 10:41
:L没人么。

作者: 你媚你魅你    时间: 2015-3-19 10:54
:L,。,。,。,。,。,




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2