@Override
public void exportFashionable(HttpServletResponse response, PlatformConsumeStaticsParam param) {
List<String> columnList = new ArrayList<>();
List<List<String>> dataList = new ArrayList<>();
List<String> data = null;
columnList.add("序号");
columnList.add("订单id");
columnList.add("用户id");
columnList.add("姓名");
columnList.add("产品");
columnList.add("分期期数");
columnList.add("总租金");
columnList.add("市场价");
columnList.add("商户ID");
columnList.add("商户名称");
columnList.add("分账流水号/分账类型/金额");
columnList.add("分账流水号/类型/金额(平台)");
columnList.add("分账时间");
columnList.add("分账前金额");
columnList.add("分账后金额");
columnList.add("支付流水单号");
columnList.add("支付金额");
columnList.add("创建时间");
columnList.add("支付完成时间");
BfqzUser user = new BfqzUser();
user.setReal(true);
List<BfqzUser> users = userService.listAll(user);
String uname = null;
List<FashionableInfo> fashionableInfos = accountFundBalanceMapper.exportPage(param);
List<FashionableVo> fashionableVos = switch2Fashionable(fashionableInfos);
for (FashionableVo info : fashionableVos) {
uname = "";
data = new ArrayList<>();
data.add(null == info.getOrderId() ? "" : info.getOrderId().toString());
data.add(null == info.getUserId() ? "" : info.getUserId().toString());
for (BfqzUser u : users) {
if (null != info.getUserId() && u.getId().longValue() == info.getUserId().longValue()) {
uname = (info.getUserName() + "(" + u.getAlipayLogonId() + ")");
break;
}
}
if (StringUtils.isNotBlank(uname)) {
data.add(uname);
} else {
data.add(info.getUserName());
}
data.add(null == info.getGoodsContent() ? "" : info.getGoodsContent());
data.add(null == info.getSplitNum() ? "" : info.getSplitNum().toString());
data.add(null == info.getPrice() ? "0" : info.getPrice().toString());
data.add(null == info.getMarketPrice() ? "0" : info.getMarketPrice().toString());
data.add(info.getCompanyId().toString());
data.add(info.getLabel());
data.add(null == info.getConpanyAccount() ? "" : info.getConpanyAccount());
data.add(null == info.getPlatformAccount() ? "" : info.getPlatformAccount());
data.add(info.getBalanceTime().toString().replace("T", " "));
data.add(null == info.getBeforeBalanceAmount() ? "0" : info.getBeforeBalanceAmount().toString());
data.add(null == info.getAfterBalanceAmount() ? "0" : info.getAfterBalanceAmount().toString());
data.add(info.getTradeNo());
data.add(null == info.getAmount() ? "0" : info.getAmount().toString());
data.add(info.getCreateDate().toString().replace("T", " "));
data.add(info.getPayTime().toString().replace("T", " "));
dataList.add(data);
}
ExcelUtil.exportExcel(response, param.getFileName(), columnList, dataList);
}