use of com.kendy.excel.ExportMembersExcel in project financial by greatkendy123.
the class MoneyService method exportMemberExcel.
/**
*********************** 导出人员表Excel ***********************************
*/
public static void exportMemberExcel() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String title = "名单登记表-德扑圈" + sdf.format(new Date());
log.info("导出人员表Excel:" + title);
String[] rowsName = new String[] { "玩家ID", "股东", "团队", "游戏名字", "额度" };
List<Object[]> dataList = new ArrayList<Object[]>();
Object[] objs = null;
Map<String, Player> memberMap = DataConstans.membersMap;
String pId;
Player player;
for (Map.Entry<String, Player> entry : memberMap.entrySet()) {
pId = entry.getKey();
player = entry.getValue();
objs = new Object[rowsName.length];
objs[0] = pId;
objs[1] = player.getGudong();
objs[2] = player.getTeamName();
objs[3] = player.getPlayerName();
objs[4] = player.getEdu();
dataList.add(objs);
}
String out = "D:/" + title;
ExportMembersExcel ex = new ExportMembersExcel(title, rowsName, dataList, out);
try {
ex.export();
log.info("导出人员表Excel成功");
} catch (Exception e) {
ErrorUtil.err("导出人员表Excel失败", e);
}
}
use of com.kendy.excel.ExportMembersExcel in project financial by greatkendy123.
the class MoneyService method exportSSJEAction.
/**
*********************** 导出实时金额Excel ***********************************
*/
public static void exportSSJEAction(TableView<CurrentMoneyInfo> tableCurrentMoneyInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String title = "实时金额表" + sdf.format(new Date());
log.info("导出实时金额表Excel:" + title);
String[] rowsName = new String[] { "总和", "玩家ID", "名字", "实时金额", "额度" };
List<Object[]> dataList = new ArrayList<Object[]>();
Object[] objs = null;
ObservableList<CurrentMoneyInfo> currentInfoList = tableCurrentMoneyInfo.getItems();
for (CurrentMoneyInfo info : currentInfoList) {
objs = new Object[rowsName.length];
objs[0] = info.getCmSuperIdSum();
objs[1] = info.getWanjiaId();
objs[2] = info.getMingzi();
objs[3] = info.getShishiJine();
objs[4] = info.getCmiEdu();
// objs[4] = info.getWanjiaId();
dataList.add(objs);
}
String out = "D:/" + title;
ExportMembersExcel ex = new ExportMembersExcel(title, rowsName, dataList, out);
try {
ex.export();
log.debug("导出实时金额表Excel成功");
} catch (Exception e) {
ErrorUtil.err("导出实时金额表Excel失败", e);
}
}
use of com.kendy.excel.ExportMembersExcel in project financial by greatkendy123.
the class MoneyService method exportCombineIDAction.
/**
*********************** 导出合并ID列表 ***********************************
*/
public static void exportCombineIDAction() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String title = "数据库中的合并ID表" + sdf.format(new Date());
String[] rowsName = new String[] { "父ID", "子ID列表(请用#隔开)" };
List<Object[]> dataList = new ArrayList<Object[]>();
Object[] objs = null;
Map<String, Set<String>> combineIdMap = DBUtil.getCombineData();
if (combineIdMap == null || combineIdMap.size() == 0) {
ShowUtil.show("数据库中无合并ID数据");
return;
}
StringBuffer sb = new StringBuffer();
for (Map.Entry<String, Set<String>> entry : combineIdMap.entrySet()) {
String parentId = entry.getKey();
Set<String> subIdSet = entry.getValue();
sb.delete(0, sb.length());
for (String subId : subIdSet) {
sb.append(subId).append("#");
}
String subIdString = sb.substring(0, sb.lastIndexOf("#"));
objs = new Object[rowsName.length];
if (!StringUtil.isBlank(parentId) && !StringUtil.isBlank(subIdString)) {
objs[0] = parentId;
objs[1] = subIdString;
dataList.add(objs);
}
}
String out = "D:/" + title;
ExportMembersExcel ex = new ExportMembersExcel(title, rowsName, dataList, out);
try {
ex.export();
log.info("导出合并ID表Excel成功");
} catch (Exception e) {
ErrorUtil.err("导出合并ID表Excel失败", e);
}
}
Aggregations