Ver a proveniência

[账单列表][修改[导出数据]

release_toaliyun_real
gongbiao há 7 anos
ascendente
cometimento
916774a0bd
1 ficheiros alterados com 20 adições e 9 eliminações
  1. +20
    -9
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java

+ 20
- 9
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Ver ficheiro

@@ -1,5 +1,6 @@
package com.iformall.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ErrorCode;
@@ -222,18 +223,28 @@ public class WxBillAllServiceImpl implements WxBillAllService {
@Override
public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillAll wxBillAll) {

Map<Long, List<WxBillAllVo>> billMapList = wxBillAllMapper.list(wxBillAll)
.parallelStream()
Map<Long, List<WxBillAllVo>> collect = wxBillAllMapper.list(wxBillAll).parallelStream()
.collect(Collectors.groupingBy(WxBillAllVo::getMerchantId));

List<WxBillAllVo> list = new ArrayList<>();

Set<Map.Entry<Long, List<WxBillAllVo>>> entries = billMapList.entrySet();
Set<Map.Entry<Long, List<WxBillAllVo>>> entries = collect.entrySet();
List<WxBillAllVo> datalist = new ArrayList<>();
for (Map.Entry<Long, List<WxBillAllVo>> entry : entries) {
list.addAll(entry.getValue());
List<WxBillAllVo> list = entry.getValue();
for (WxBillAllVo wxBillAllVo : list) {
String shopNumber = wxBillAllVo.getShopNumber();
if (StringUtils.isEmpty(shopNumber)) {
String shopInfo = wxBillAllVo.getShopInfo();
if (StringUtils.isNotEmpty(shopInfo) && !shopInfo.equals("[]")) {
JSONObject jsonObject = JSONObject.parseObject(shopInfo);
StringBuffer sb = new StringBuffer();
Set<Map.Entry<String, Object>> sets = jsonObject.entrySet();
sets.forEach(x -> sb.append(x.getKey()).append(","));
wxBillAllVo.setShopNumber(sb.deleteCharAt(sb.length() - 1).toString());
}
}
datalist.add(wxBillAllVo);
}
}

excelService.exportExcel(list, null, "账单数据", WxBillAllVo.class, "账单数据.xlsx", response);
excelService.exportExcel(datalist, null, "账单数据", WxBillAllVo.class, "账单数据.xlsx", response);
}

private int updateBillOtherDeposit(Map<String, Object> bill) {


Carregando…
Cancelar
Guardar