Procházet zdrojové kódy

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

release_toaliyun_real
gongbiao před 7 roky
rodič
revize
916774a0bd
1 změnil soubory, kde provedl 20 přidání a 9 odebrání
  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 Zobrazit soubor

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


import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.iformall.common.ErrorCode; import com.iformall.common.ErrorCode;
@@ -222,18 +223,28 @@ public class WxBillAllServiceImpl implements WxBillAllService {
@Override @Override
public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillAll wxBillAll) { 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)); .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) { 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) { private int updateBillOtherDeposit(Map<String, Object> bill) {


Načítá se…
Zrušit
Uložit