//XuXuLeiJiSpendCoinLevelPerson.javaimport java.util.Date;import java.io.File;import java.util.List;import java.util.ArrayList;import java.util.Calendar;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.HashMap;import java.io.FileReader;import java.io.BufferedReader;import java.util.Iterator;public class XuXuLeiJiSpendCoinLevelPerson{ private static HashMapgetDateSpendLevelPerson(String date, Integer[] coinLevelArray) throws Exception{ String path = new String("/home/data/superhero_vietnam/spendlog/"); String fname = new String("spendlog_"+date); File filespend = new File(path+fname); if(filespend.isFile()){ BufferedReader br = new BufferedReader(new FileReader(filespend)); List linelist = new ArrayList (); String temp = null; HashMap hmuidcoin = new HashMap (); while((temp = br.readLine())!= null){ String[] line = temp.split("\t"); String uid = line[1]; int coin = Integer.parseInt(line[4]); if(hmuidcoin.containsKey(uid)){ hmuidcoin.put(uid, hmuidcoin.get(uid)+coin); }else{ hmuidcoin.put(uid, coin); } } Iterator itor = hmuidcoin.keySet().iterator(); HashMap coinLevelDict = new HashMap (); while(itor.hasNext()){ String uid = itor.next(); int coin = hmuidcoin.get(uid); for(int i=0;i =coinLevelArray[i]&&coin datelist = new ArrayList ();//(Arrays.asList("20160307")); datelist.add("20160307"); datelist.add("20160308"); Integer [] coinLevelArray = {1000,3000,5000,10000,15000,20000,30000,50000,80000,100000000}; for(String xx : datelist) getDateSpendLevelPerson(xx, coinLevelArray); }}