Esempio n. 1
0
 @SuppressWarnings("unchecked")
 public Map<String, Map<String, BaseVo>> getThisCenterEverydayAddedCustomers(FzxDto fzx) {
   String yearMonthString = DateUtils.getCurYearMonthString();
   Map<String, Map<String, BaseVo>> result = new TreeMap<String, Map<String, BaseVo>>();
   List<String> days = DateUtils.getMonthDays(DateUtils.parseDate("yyyyMM", yearMonthString));
   for (String day : days) {
     result.put(day, new HashMap<String, BaseVo>());
     result.get(day).put(TmkUtilsBaseVo.CENTER_EVERYDAY_ADDED_CUSTOMERS, new BaseVo());
   }
   List<BaseVo> vs = tmkUtilsDao.getCenterAddInThisMonth(fzx, yearMonthString);
   for (BaseVo v : vs) {
     if (result.containsKey(v.getSTime())) {
       result.get(v.getSTime()).put(TmkUtilsBaseVo.CENTER_EVERYDAY_ADDED_CUSTOMERS, v);
     }
   }
   return result;
   // return (Map<String, Map<String, BaseVo>>) getObjectFromCache(
   // tmkUtilsListCache, fzx.getZdbm(),
   // TmkUtilsBaseVo.CENTER_EVERYDAY_ADDED_CUSTOMERS);
 }
Esempio n. 2
0
 /** 供缓存使用 */
 private void cacheCenterEverydayAddedCustomers(String yearMonthString) {
   List<Fzx> centers = fzxDao.getAllValid(true);
   for (Fzx center : centers) {
     Map<String, Map<String, BaseVo>> result = new TreeMap<String, Map<String, BaseVo>>();
     List<String> days = DateUtils.getMonthDays(DateUtils.parseDate("yyyyMM", yearMonthString));
     for (String day : days) {
       result.put(day, new HashMap<String, BaseVo>());
       result.get(day).put(TmkUtilsBaseVo.CENTER_EVERYDAY_ADDED_CUSTOMERS, new BaseVo());
     }
     List<BaseVo> vs = tmkUtilsDao.getCenterAddInThisMonth(center.getFzxDto(), yearMonthString);
     for (BaseVo v : vs) {
       if (result.containsKey(v.getSTime())) {
         result.get(v.getSTime()).put(TmkUtilsBaseVo.CENTER_EVERYDAY_ADDED_CUSTOMERS, v);
       }
     }
     putObjectInCache(
         tmkUtilsListCache,
         center.getId(),
         TmkUtilsBaseVo.CENTER_EVERYDAY_ADDED_CUSTOMERS,
         result);
   }
 }