feat(CumemberLevel): 会员升级记录添加导出功能
This commit is contained in:
parent
a2e8c961bb
commit
caaae917f2
|
@ -1,15 +1,28 @@
|
||||||
package com.hzs.member.detail.controller.manage;
|
package com.hzs.member.detail.controller.manage;
|
||||||
|
|
||||||
|
import com.hzs.common.core.annotation.Log;
|
||||||
|
import com.hzs.common.core.enums.EOperationBusiness;
|
||||||
|
import com.hzs.common.core.enums.EOperationMethod;
|
||||||
|
import com.hzs.common.core.enums.EOperationModule;
|
||||||
|
import com.hzs.common.core.enums.EUpgradeType;
|
||||||
|
import com.hzs.common.core.utils.StringUtils;
|
||||||
import com.hzs.common.core.web.controller.BaseController;
|
import com.hzs.common.core.web.controller.BaseController;
|
||||||
import com.hzs.common.core.web.page.TableDataInfo;
|
import com.hzs.common.core.web.page.TableDataInfo;
|
||||||
import com.hzs.common.domain.member.detail.ext.CuMemberLevelExt;
|
import com.hzs.common.domain.member.detail.ext.CuMemberLevelExt;
|
||||||
import com.hzs.member.detail.param.CuMemberLevelParam;
|
import com.hzs.member.detail.param.CuMemberLevelParam;
|
||||||
import com.hzs.member.detail.service.ICuMemberLevelService;
|
import com.hzs.member.detail.service.ICuMemberLevelService;
|
||||||
|
import com.hzs.common.core.utils.poi.ExcelUtil;
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.hzs.member.detail.vo.CuMemberLevelUpVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.hzs.common.core.exception.ServiceException;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,4 +45,26 @@ public class CuMemberLevelController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出升级记录
|
||||||
|
**/
|
||||||
|
@Log(module = EOperationModule.MEMBER_LEVEL_UP_RECORD, business = EOperationBusiness.MEMBER_LEVEL_UP_RECORD, method = EOperationMethod.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, CuMemberLevelParam param) {
|
||||||
|
List<CuMemberLevelUpVO> resultList = new ArrayList<>();
|
||||||
|
List<CuMemberLevelExt> list = iCuMemberLevelService.listMemberLevelList(param);
|
||||||
|
|
||||||
|
if (StringUtils.isNotEmpty(list)) {
|
||||||
|
resultList = BeanUtil.copyToList(list, CuMemberLevelUpVO.class);
|
||||||
|
for (CuMemberLevelUpVO vo : resultList) {
|
||||||
|
vo.setUpTypeName(EUpgradeType.getEnumByValue(vo.getUpType()).getLabel());
|
||||||
|
}
|
||||||
|
ExcelUtil<CuMemberLevelUpVO> util = new ExcelUtil<>(CuMemberLevelUpVO.class);
|
||||||
|
|
||||||
|
util.exportExcel(response, resultList, "会员升级记录");
|
||||||
|
} else {
|
||||||
|
throw new ServiceException("没有数据");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.hzs.member.detail.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.hzs.common.core.annotation.Excel;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class CuMemberLevelUpVO {
|
||||||
|
/**
|
||||||
|
* 会员编号
|
||||||
|
*/
|
||||||
|
@Excel(name = "会员编号")
|
||||||
|
private String memberCode;
|
||||||
|
/**
|
||||||
|
* 会员姓名
|
||||||
|
*/
|
||||||
|
@Excel(name = "会员姓名")
|
||||||
|
private String memberName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 升级时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "升级时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date upgradeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旧等级
|
||||||
|
*/
|
||||||
|
@Excel(name = "旧等级")
|
||||||
|
private String gradeNameOld;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新等级
|
||||||
|
*/
|
||||||
|
@Excel(name = "新等级")
|
||||||
|
private String gradeNameNew;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 升级方式
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Integer upType;
|
||||||
|
|
||||||
|
@Excel(name = "升级方式")
|
||||||
|
private String upTypeName;
|
||||||
|
}
|
|
@ -491,7 +491,7 @@ public enum EOperationBusiness {
|
||||||
PRODUCT_DETAIL_QUERY_LIST("产品明细查询"),
|
PRODUCT_DETAIL_QUERY_LIST("产品明细查询"),
|
||||||
MONTHLY_JOB_LEVEL("月度职级名单查询"),
|
MONTHLY_JOB_LEVEL("月度职级名单查询"),
|
||||||
MEMBER_RISK_CONTROL("K值风控设置"),
|
MEMBER_RISK_CONTROL("K值风控设置"),
|
||||||
|
MEMBER_LEVEL_UP_RECORD("会员升级记录"),
|
||||||
//////////////////////////店铺系统/////////////////////////////
|
//////////////////////////店铺系统/////////////////////////////
|
||||||
SHOP_INFO("店铺"),
|
SHOP_INFO("店铺"),
|
||||||
;
|
;
|
||||||
|
|
|
@ -520,6 +520,7 @@ public enum EOperationModule {
|
||||||
|
|
||||||
MEMBER_RISK_CONTROL("K值风控设置"),
|
MEMBER_RISK_CONTROL("K值风控设置"),
|
||||||
|
|
||||||
|
MEMBER_LEVEL_UP_RECORD("会员升级记录"),
|
||||||
|
|
||||||
SUPPLIER_GOODS("供应商商品"),
|
SUPPLIER_GOODS("供应商商品"),
|
||||||
|
|
||||||
|
|
|
@ -17,27 +17,27 @@ public enum EUpgradeType {
|
||||||
/**
|
/**
|
||||||
* 1=自动升级 (奖衔),2=手动升级(等级奖衔),3=购买赠予(奖衔) 4=购买升级(等级前台报单、升级) 5=活动升级(等级)
|
* 1=自动升级 (奖衔),2=手动升级(等级奖衔),3=购买赠予(奖衔) 4=购买升级(等级前台报单、升级) 5=活动升级(等级)
|
||||||
*/
|
*/
|
||||||
AUTO_UPGRADE(1, "自动升级", 0,EnumsPrefixConstants.UPGRADE_TYPE + 1),
|
AUTO_UPGRADE(1, "自动升级", 0, EnumsPrefixConstants.UPGRADE_TYPE + 1),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手动升级
|
* 手动升级
|
||||||
*/
|
*/
|
||||||
MANUAL_UPGRADE(2, "手动升级",0, EnumsPrefixConstants.UPGRADE_TYPE + 2),
|
MANUAL_UPGRADE(2, "手动升级", 0, EnumsPrefixConstants.UPGRADE_TYPE + 2),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买赠予
|
* 购买赠予
|
||||||
*/
|
*/
|
||||||
PURCHASE_GIFT(3, "购买赠予", 0,EnumsPrefixConstants.UPGRADE_TYPE + 3),
|
PURCHASE_GIFT(3, "购买赠予", 0, EnumsPrefixConstants.UPGRADE_TYPE + 3),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买升级
|
* 购买升级
|
||||||
*/
|
*/
|
||||||
BUY_UPGRADE(4, "购买升级", 0,EnumsPrefixConstants.UPGRADE_TYPE + 4),
|
BUY_UPGRADE(4, "购买升级", 0, EnumsPrefixConstants.UPGRADE_TYPE + 4),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 活动升级
|
* 活动升级
|
||||||
*/
|
*/
|
||||||
ACTIVITY_UPGRADE(5, "活动升级", 0,EnumsPrefixConstants.UPGRADE_TYPE + 5),
|
ACTIVITY_UPGRADE(5, "活动升级", 0, EnumsPrefixConstants.UPGRADE_TYPE + 5),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -57,4 +57,19 @@ public enum EUpgradeType {
|
||||||
* 国际化翻译key值
|
* 国际化翻译key值
|
||||||
*/
|
*/
|
||||||
private final String key;
|
private final String key;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据枚举值查询枚举
|
||||||
|
*
|
||||||
|
* @param val 枚举值
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static EUpgradeType getEnumByValue(int val) {
|
||||||
|
for (EUpgradeType enums : EUpgradeType.values()) {
|
||||||
|
if (enums.getValue() == val) {
|
||||||
|
return enums;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AUTO_UPGRADE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue