/** 关注我的/我关注的用户列表 */ @SuppressWarnings("unchecked") @Override public DataGrid dataGridAccount(LvFollow lvFollow, PageHelper ph) { List<LvAccount> al = new ArrayList<LvAccount>(); DataGrid dg = dataGridByType(ph, lvFollow, lvFollowDao); List<TlvAccount> l = dg.getRows(); if (l != null && l.size() > 0) { String[] openIds = new String[l.size()]; int i = 0; for (TlvAccount t : l) { LvAccount a = new LvAccount(); MyBeanUtils.copyProperties(t, a, true); al.add(a); openIds[i++] = t.getOpenId().toString(); } HashMap<Integer, Integer> photoNums = lvAccountPhotoDao.getCountPhotoNum(openIds); for (LvAccount a : al) { Integer num = photoNums.get(a.getOpenId()); if (num != null) a.setPhotoNum(num); } } dg.setRows(al); return dg; }