|
|
|
@@ -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; |
|
|
|
@@ -27,6 +28,7 @@ import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author gongbiao |
|
|
|
@@ -220,6 +222,28 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
@Override |
|
|
|
public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillAll wxBillAll) { |
|
|
|
|
|
|
|
Map<Long, List<WxBillAllVo>> collect = wxBillAllMapper.list(wxBillAll).parallelStream() |
|
|
|
.collect(Collectors.groupingBy(WxBillAllVo::getMerchantId)); |
|
|
|
Set<Map.Entry<Long, List<WxBillAllVo>>> entries = collect.entrySet(); |
|
|
|
List<WxBillAllVo> datalist = new ArrayList<>(); |
|
|
|
for (Map.Entry<Long, List<WxBillAllVo>> entry : entries) { |
|
|
|
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(datalist, null, "账单数据", WxBillAllVo.class, "账单数据.xlsx", response); |
|
|
|
} |
|
|
|
|
|
|
|
private int updateBillOtherDeposit(Map<String, Object> bill) { |
|
|
|
|