这个标题大概只有我自己看得懂…
Anyway,本来就是给自己做笔记的…
因为公司前端和后端显示的list有分离,为了不影响前端显示,特意做了一步骚操作。
Map<String, String> balTypeMap = this.metaService.findMeta(SysMetaEnum.billTypeMbr, false).stream().collect(Collectors.toMap(Meta::getMetaValue, Meta::getMetaText));
Map<String, String> payWayMap = this.metaService.findMeta(MbrMetaEnum.payWay, false).stream().collect(Collectors.toMap(Meta::getMetaValue, Meta::getMetaText));
for(Map<String, Object> listMap : list) {
listMap.put("balType", balTypeMap.get(ObjectUtils.toString(listMap.get("balType"))));
listMap.put("payWay", payWayMap.get(ObjectUtils.toString(listMap.get("payWay"))));
listMap.put("billWay", payWayMap.get(ObjectUtils.toString(listMap.get("billWay"))));
}
this.exportXLS(response, list,
new String[]{"balType", "busCode", "balCode", "payDt", "payWay","payMny", "payBy", "billFlag",
"failMsg", "billBalCode","billDt","billMny","billWay","creBy","creDt","orgBalCode",""},
new String[]{"业务类型", "业务编号", "商家编号", "业务时间","业务方式", "业务金额", "业务操作人", "对账结果",
"失败原因", "支付交易号", "交易时间","交易金额","交易方式","对账人","对账时间","原始商家编号","原始平台编号"});
以上针对原来的list是List<Map<String, Object>>类型的,如果是domain类封装的,就不用这么做了。