diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardPayController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardPayController.java index 4401a14de..02e6162a4 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardPayController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardPayController.java @@ -202,4 +202,28 @@ public class WxCardPayController extends BaseController { wxCardInfoService.exportData(wxCardVo, request, response); } + @ApiOperation("卡消费订单-导出数据") + @GetMapping("exportCardSpend") + @SystemControllerLog(description = "卡消费订单-导出数据") + public void exportCardSpend(@ModelAttribute WxCardSpendVo wxCardSpendVo, HttpServletRequest request, HttpServletResponse response) { + String ipStr = getIpAddr(); + logger.info("cardPay/exportCardSpend: " + ipStr); + if (wxCardSpendVo == null) { + wxCardSpendVo = new WxCardSpendVo(); + } + wxCardSpendVo.setTenantId(getTenantId()); + if (StringUtils.isNotBlank(wxCardSpendVo.getPayStatusStr())) { + String[] statusAttr = wxCardSpendVo.getPayStatusStr().split(","); + List tmpList = new ArrayList(); + for (String status : statusAttr) { + tmpList.add(Integer.valueOf(status)); + } + if (!tmpList.isEmpty()) { + wxCardSpendVo.setPayStatusS(tmpList); + } + } + wxCardSpendService.exportData(wxCardSpendVo, request, response); + + } + } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java index d98599d0b..3fde4db8d 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java @@ -1,15 +1,15 @@ package com.iformall.domain.po; import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.models.auth.In; import lombok.Data; -import javax.persistence.*; -import java.math.BigDecimal; -import java.util.*; -import javax.persistence.Transient; -import java.util.List; + import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Transient; import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; @Table(name = "wx_card_spend") @Data @@ -17,7 +17,6 @@ public class WxCardSpend implements Serializable { private static final long serialVersionUID = 1L; @Id - @Excel(name="交易编号",width = 20,orderNum = "1") protected Long id; @Transient @@ -33,6 +32,8 @@ public class WxCardSpend implements Serializable { private Long ownerId; @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") private Long merchantId; + + @Excel(name = "订单号", width = 20, orderNum = "5") @io.swagger.annotations.ApiModelProperty(value="订单账号",name="orderId") private Long orderId; @io.swagger.annotations.ApiModelProperty(value="ip地址",name="ip") @@ -43,6 +44,7 @@ public class WxCardSpend implements Serializable { private Integer payment; @io.swagger.annotations.ApiModelProperty(value="实收金额(不包含通道费)",name="realPayment") private Integer realPayment; + @io.swagger.annotations.ApiModelProperty(value="卡剩余总金额",name="cardRemainAmount") private Integer cardRemainAmount; @io.swagger.annotations.ApiModelProperty(value="卡支付前总金额",name="cardBeforeAmount") @@ -58,20 +60,20 @@ public class WxCardSpend implements Serializable { @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") private Date updateDate; - @Excel(name="补贴状态",width = 20,orderNum = "10",replace = { "未支付_0", "已分账_1","已人工分账_2"}) + @Excel(name = "支付状态", width = 20, orderNum = "11", replace = {"未支付_0", "已分账_1", "已人工分账_2"}) @io.swagger.annotations.ApiModelProperty(value="支付状态(0:未分帐, 1:已分账, 2:已人工分账)",name="payStatus") private Integer payStatus; @Transient - @Excel(name="消费金额",width = 20,orderNum = "7") + @Excel(name = "消费金额(元)", width = 20, orderNum = "7") private String deductionAmountStr; @Transient - @Excel(name="收款金额",width = 20,orderNum = "8") + @Excel(name = "应付金额(元)", width = 20, orderNum = "9") private String paymentStr; @Transient - @Excel(name="收款实际金额",width = 20,orderNum = "9") + @Excel(name = "实付金额(扣除手续费/元)", width = 20, orderNum = "8") private String realPaymentStr; @@ -98,6 +100,14 @@ public class WxCardSpend implements Serializable { @Transient private Integer subBusinessId; + public String getCardRemainAmountStr() { + return new BigDecimal(cardRemainAmount == null ? 0 : cardRemainAmount).divide(new BigDecimal(100)).toPlainString(); + } + + @Transient + @Excel(name = "卡余额(元) ", width = 20, orderNum = "10") + private String cardRemainAmountStr; + public String getDeductionAmountStr() { if(getDeductionAmount()!=null) { deductionAmountStr = new BigDecimal(getDeductionAmount()).divide(new BigDecimal(100)).toString(); diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCardSpendVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCardSpendVo.java index d7cbb770e..c687c4c64 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCardSpendVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCardSpendVo.java @@ -6,9 +6,6 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -import javax.persistence.Transient; -import java.util.Date; - @Data @ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) @@ -16,11 +13,11 @@ public class WxCardSpendVo extends WxCardSpend { /**卡信息*/ @io.swagger.annotations.ApiModelProperty(value="卡券名称",name="title") - @Excel(name="卡名",width = 20,orderNum = "4") + @Excel(name = "卡名称", width = 20, orderNum = "3") private String title; @io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName") - @Excel(name="商户",width = 20,orderNum = "5") + @Excel(name = "消费商户", width = 20, orderNum = "4") private String merchantName; @io.swagger.annotations.ApiModelProperty(value="补贴额(包含通道费)",name="subsidy") @@ -30,12 +27,12 @@ public class WxCardSpendVo extends WxCardSpend { @io.swagger.annotations.ApiModelProperty(value="补贴状态(0:未补贴, 1:已补贴)",name="status") private Integer status; - @Excel(name="消费者",width = 20,orderNum = "2") + @Excel(name = "消费者", width = 20, orderNum = "1") @io.swagger.annotations.ApiModelProperty(value="持有人昵称",name="onickName") private String onickName; - @Excel(name="手机号",width = 20,orderNum = "3") + @Excel(name = "手机", width = 20, orderNum = "2") @io.swagger.annotations.ApiModelProperty(value="持有人绑定的手机号",name="ouPhone") private String ouPhone; diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java index 38beb5808..45dc1c9a4 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java @@ -536,7 +536,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { @Override public void exportData(WxCardSpendVo wxCardSpendVo, HttpServletRequest request, HttpServletResponse response) { List list = wxCardSpendMapper.findCardSpendVoList(wxCardSpendVo); - excelService.exportExcel(list, null, "消费记录", WxCardSpendVo.class, "消费记录.xlsx", response, false); + excelService.exportExcel(list, null, "卡消费记录", WxCardSpendVo.class, "卡消费记录.xlsx", response, false); } }