Просмотр исходного кода

[卡订单][修改][导出数据]

release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
b3af53df67
5 измененных файлов: 95 добавлений и 10 удалений
  1. +27
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardPayController.java
  2. +16
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java
  3. +34
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxCardVo.java
  4. +5
    -8
      mallinkService/src/main/java/com/iformall/service/WxCardInfoService.java
  5. +13
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java

+ 27
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardPayController.java Просмотреть файл

@@ -175,4 +175,31 @@ public class WxCardPayController extends BaseController {
int remainShareAmount = wxCardSpendService.finishCard(tenantId, wxCardInfo.getId());
return new ResultData(remainShareAmount);
}

@ApiOperation("卡订单-导出数据")
@GetMapping("/exportCardOrder")
@SystemControllerLog(description = "卡订单-导出数据")
public void exportCardOrder(@ModelAttribute WxCardVo wxCardVo, HttpServletRequest request, HttpServletResponse response) {
logger.info("[" + getIpAddr() + "] cardPay/exportCardOrder");
if (wxCardVo == null) {
wxCardVo = new WxCardVo();
} else {
if (StringUtils.isBlank(wxCardVo.getOuPhone())) {
wxCardVo.setOuPhone(null);
}
}
wxCardVo.setTenantId(getTenantId());
if (StringUtils.isNotBlank(wxCardVo.getStatusStr())) {
String[] statusAttr = wxCardVo.getStatusStr().split(",");
List<Integer> tmpList = new ArrayList<Integer>();
for (String status : statusAttr) {
tmpList.add(Integer.valueOf(status));
}
if (!tmpList.isEmpty()) {
wxCardVo.setStatusS(tmpList);
}
}
wxCardInfoService.exportData(wxCardVo, request, response);
}

}

+ 16
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java Просмотреть файл

@@ -1,11 +1,13 @@
package com.iformall.domain.po;

import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;

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;

@@ -13,7 +15,8 @@ import java.util.List;
@Data
public class WxCardInfo implements Serializable {
private static final long serialVersionUID = 1L;

@Excel(name = "卡号", width = 20, orderNum = "1")
@Id
protected Long id; /**主键ID-与coupon_order_id一致*/
@@ -32,6 +35,16 @@ public class WxCardInfo implements Serializable {
private Integer amount;
@io.swagger.annotations.ApiModelProperty(value="购买总金额",name="saleAmount")
private Integer saleAmount;

public String getRemainingAmountStr() {
return new BigDecimal(remainingAmount == null ? 0 : remainingAmount).divide(new BigDecimal(100)).toPlainString();
}

@Excel(name = "余额(元)", width = 20, orderNum = "6")
@Transient
private String remainingAmountStr;


@io.swagger.annotations.ApiModelProperty(value="剩余面额",name="remainingAmount")
private Integer remainingAmount;
@io.swagger.annotations.ApiModelProperty(value="分账总手续费",name="serviceFeeAmount")
@@ -42,6 +55,8 @@ public class WxCardInfo implements Serializable {
private Integer remainingShareFeeAmount;
@io.swagger.annotations.ApiModelProperty(value="分账通道费差(购买时刻的通道费差,分账完结时使用)",name="rateAmount")
private Integer rateAmount;

@Excel(name = "购买时间 ", width = 20, orderNum = "9", format = "yyyy-MM-dd HH:mm:ss")
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
private Date createDate;
@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")


+ 34
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxCardVo.java Просмотреть файл

@@ -1,12 +1,14 @@
package com.iformall.domain.vo;


import cn.afterturn.easypoi.excel.annotation.Excel;
import com.iformall.domain.po.WxCardInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@@ -22,6 +24,8 @@ public class WxCardVo extends WxCardInfo {
private String coverPicture;
@io.swagger.annotations.ApiModelProperty(value="详情多图",name="detailPicture")
private String detailPicture;

@Excel(name = "卡名称", width = 20, orderNum = "4")
@io.swagger.annotations.ApiModelProperty(value="券名称",name="title")
private String title;
@io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle")
@@ -33,12 +37,39 @@ public class WxCardVo extends WxCardInfo {
@io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark")
private String remark;

public String getPriceStr() {
return new BigDecimal(price == null ? 0 : price).divide(new BigDecimal(100)).toPlainString();
}

@Excel(name = "面额(元)", width = 20, orderNum = "5")
@Transient
private String priceStr;


@io.swagger.annotations.ApiModelProperty(value = "面额", name = "price")
private Integer price;

public String getSalePriceStr() {
return new BigDecimal(salePrice == null ? 0 : salePrice).divide(new BigDecimal(100)).toPlainString();
}

@Excel(name = "售价(元)", width = 20, orderNum = "7")
@Transient
private String salePriceStr;

@io.swagger.annotations.ApiModelProperty(value = "购买金额", name = "salePrice")
private Integer salePrice;
@io.swagger.annotations.ApiModelProperty(value = "补贴类型", name = "subsidyType")
private Integer subsidyType;

public String getSubsidyNumStr() {
return new BigDecimal(subsidyNum == null ? 0 : subsidyNum).divide(new BigDecimal(100)).toPlainString();
}

@Excel(name = "补贴额(元)", width = 20, orderNum = "8")
@Transient
private String subsidyNumStr;

@io.swagger.annotations.ApiModelProperty(value = "补贴金额", name = "subsidyNum")
private Integer subsidyNum;

@@ -50,15 +81,18 @@ public class WxCardVo extends WxCardInfo {
@io.swagger.annotations.ApiModelProperty(value = "该订单对应券的实际过期时间 ", name = "expiredTime")
private Date expiredTime;

@Excel(name = "状态 ", width = 20, orderNum = "10", replace = {"使用中_4", "已过期_5", "已用完_6", "已线下退款_7"})
@io.swagger.annotations.ApiModelProperty(value = "状态", name = "status")
private Integer status;


@Excel(name = "购买人", width = 20, orderNum = "2")
@io.swagger.annotations.ApiModelProperty(value="购买人昵称",name="cnickName")
private String cnickName;
@io.swagger.annotations.ApiModelProperty(value="持有人昵称",name="onickName")
private String onickName;

@Excel(name = "电话", width = 20, orderNum = "3")
@io.swagger.annotations.ApiModelProperty(value="持有人绑定的手机号",name="ouPhone")
private String ouPhone;



+ 5
- 8
mallinkService/src/main/java/com/iformall/service/WxCardInfoService.java Просмотреть файл

@@ -4,7 +4,8 @@ import com.github.pagehelper.PageInfo;
import com.iformall.domain.po.WxCardInfo;
import com.iformall.domain.vo.WxCardVo;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public interface WxCardInfoService {

@@ -39,12 +40,8 @@ public interface WxCardInfoService {
* @param id
*/
void deleteById(Long id);


void exportData(WxCardVo wxCardVo, HttpServletRequest request, HttpServletResponse response);

}

+ 13
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java Просмотреть файл

@@ -2,14 +2,17 @@ package com.iformall.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.IdWorker;
import com.iformall.domain.po.WxCardInfo;
import com.iformall.domain.vo.WxCardVo;
import com.iformall.mapper.WxCardInfoMapper;
import com.iformall.service.ExcelService;
import com.iformall.service.WxCardInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iformall.common.IdWorker;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Service
@@ -18,6 +21,8 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
@Autowired
WxCardInfoMapper wxCardInfoMapper;

@Autowired
ExcelService excelService;

@Override
public PageInfo<WxCardVo> listAsPage(WxCardVo record, Integer pageIndex, Integer pageSize) {
@@ -45,4 +50,11 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
public void deleteById(Long id) {
wxCardInfoMapper.deleteByPrimaryKey(id);
}

@Override
public void exportData(WxCardVo wxCardVo, HttpServletRequest request, HttpServletResponse response) {
List<WxCardVo> list = wxCardInfoMapper.findVoList(wxCardVo);
excelService.exportExcel(list, null, "卡订单", WxCardVo.class, "卡订单.xlsx", response, false);

}
}

Загрузка…
Отмена
Сохранить