Browse Source

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

release_toaliyun_real
gongbiao 7 years ago
parent
commit
6a8ab4b5fb
2 changed files with 4 additions and 32 deletions
  1. +4
    -4
      mallinkService/src/main/java/com/iformall/domain/vo/WxBillAllVo.java
  2. +0
    -28
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java

+ 4
- 4
mallinkService/src/main/java/com/iformall/domain/vo/WxBillAllVo.java View File

@@ -17,13 +17,13 @@ public class WxBillAllVo {


private Long shopId; private Long shopId;


//@Excel(name="商铺号",width = 20,orderNum = "1")
@Excel(name = "商铺号", width = 20, orderNum = "1")
private String shopNumber; private String shopNumber;


//@Excel(name="商户名称",width = 20,orderNum = "2")
@Excel(name = "商户名称", width = 20, orderNum = "2")
private String merchantName; private String merchantName;


//@Excel(name="商铺类型",width = 20,orderNum = "3", replace = {"店铺_1","多经点位_2"})
@Excel(name = "商铺类型", width = 20, orderNum = "3", replace = {"店铺_1", "多经点位_2"})
private Integer rentShopType; private Integer rentShopType;


@Excel(name="费用类型",width = 20,orderNum = "4") @Excel(name="费用类型",width = 20,orderNum = "4")
@@ -44,7 +44,7 @@ public class WxBillAllVo {
@Excel(name="逾期天数",width = 20,orderNum = "9") @Excel(name="逾期天数",width = 20,orderNum = "9")
private Integer expiredDay; private Integer expiredDay;


@Excel(name="账单状态",width = 20,orderNum = "10", replace = {"欠缴_1","待缴_2","已结清_3","未到期_4","已退还_5","失效_6"})
@Excel(name = "账单状态", width = 20, orderNum = "10", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6", "_7"})
private Integer status; private Integer status;


private Integer billTypeValue; private Integer billTypeValue;


+ 0
- 28
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java View File

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


import cn.afterturn.easypoi.excel.entity.ExportParams;
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;
@@ -28,7 +27,6 @@ import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;


/** /**
* @author gongbiao * @author gongbiao
@@ -222,32 +220,6 @@ 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()
.collect(Collectors.groupingBy(WxBillAllVo::getMerchantId));

List<Map<String, Object>> list = new ArrayList<>();

Iterator<Map.Entry<Long, List<WxBillAllVo>>> entries = billMapList.entrySet().iterator();
while (entries.hasNext()) {
Map.Entry<Long, List<WxBillAllVo>> entry = entries.next();
Map<String,Object> map = new HashMap<>();
ExportParams deptExportParams = new ExportParams();
WxBillAllVo first = ((List<WxBillAllVo>)(entry.getValue())).get(0);
deptExportParams.setSheetName(first.getMerchantName());
deptExportParams.setTitle(first.getMerchantName()
+ " ("
+ EnumRentShopType.getEnum((Integer)first.getRentShopType()).getMessage()
+ "-"+first.getShopNumber()
+ ")");
//deptExportParams.setSecondTitle();
map.put("title", deptExportParams);
map.put("entity", WxBillAllVo.class);
map.put("data", entry.getValue());
list.add(map);
}

excelService.exportExcel(list, "账单数据.xls", response);
} }


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


Loading…
Cancel
Save