Commit 143bc191 authored by libin's avatar libin

Merge branch 'master-walletdetail' into dev

parents 01329464 dd4fb137
package com.github.wxiaoqi.security.admin.constant;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/10/12 14:27
*/
public enum WalletDetailTypeEnum {
/**
* 活动
*/
ACTIVITY(0, "活动奖励金"),
/**
* 佣金
*/
COMMISSION(1, "佣金"),
/**
* 会员充值
*/
MEMBER(2, "会员充值"),
/**
* 提现
*/
WITHDRAW(10, "提现"),
/**
* 转账
*/
TRANSFER(11, "转账"),
/**
* 购买
*/
BUY(12, "购买"),
/**
* 手续费
*/
SERVICE_CHARGE(13, "手续费");
private Integer code;
private String desc;
WalletDetailTypeEnum(Integer code, String desc) {
this.code = code;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
...@@ -47,4 +47,7 @@ public class WalletDetailPageVo { ...@@ -47,4 +47,7 @@ public class WalletDetailPageVo {
@ApiModelProperty(value = "操作时间", hidden = true ) @ApiModelProperty(value = "操作时间", hidden = true )
private Long crtTime; private Long crtTime;
@ApiModelProperty("描述")
private String desc;
} }
package com.github.wxiaoqi.security.admin.biz; package com.github.wxiaoqi.security.admin.biz;
import com.github.wxiaoqi.security.admin.constant.WalletDetailTypeEnum;
import com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO; import com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO;
import com.github.wxiaoqi.security.admin.dto.WalletDetailFindDTO; import com.github.wxiaoqi.security.admin.dto.WalletDetailFindDTO;
import com.github.wxiaoqi.security.admin.dto.WalletDetailListDTO; import com.github.wxiaoqi.security.admin.dto.WalletDetailListDTO;
...@@ -12,17 +13,15 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO; ...@@ -12,17 +13,15 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
import lombok.Data; import lombok.Data;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.Comparator; import java.util.function.Function;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -35,7 +34,9 @@ import java.util.stream.Collectors; ...@@ -35,7 +34,9 @@ import java.util.stream.Collectors;
@Transactional @Transactional
@Service @Service
@Data @Data
public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDetail> { public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDetail> implements InitializingBean {
private Map<Integer,WalletDetailTypeEnum> typeEnumMap;
public PageDataVO<WalletDetailPageVo> findWalletDetailPage(Integer userId,Integer pageNo,Integer pageSize){ public PageDataVO<WalletDetailPageVo> findWalletDetailPage(Integer userId,Integer pageNo,Integer pageSize){
...@@ -56,6 +57,7 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet ...@@ -56,6 +57,7 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
for (MyWalletDetail walletDetailPage : walletDetails) { for (MyWalletDetail walletDetailPage : walletDetails) {
walletDetail = new WalletDetailPageVo(); walletDetail = new WalletDetailPageVo();
BeanUtils.copyProperties(walletDetailPage,walletDetail); BeanUtils.copyProperties(walletDetailPage,walletDetail);
walletDetail.setDesc(typeEnumMap.get(walletDetail.getSource()).getDesc());
walletDetailPageVoList.add(walletDetail); walletDetailPageVoList.add(walletDetail);
} }
walletDetailPageVo.setTotalPage(walletDetailPageVoPageDataVO.getTotalPage()); walletDetailPageVo.setTotalPage(walletDetailPageVoPageDataVO.getTotalPage());
...@@ -101,4 +103,9 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet ...@@ -101,4 +103,9 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
Map<Integer, BigDecimal> userIdAndPersonalConsumptionMap = personalConsumptions.stream().collect(Collectors.toMap(PersonalConsumptionDTO::getUserId, PersonalConsumptionDTO::getTotalConsumption)); Map<Integer, BigDecimal> userIdAndPersonalConsumptionMap = personalConsumptions.stream().collect(Collectors.toMap(PersonalConsumptionDTO::getUserId, PersonalConsumptionDTO::getTotalConsumption));
return userIdAndPersonalConsumptionMap; return userIdAndPersonalConsumptionMap;
} }
@Override
public void afterPropertiesSet() throws Exception {
typeEnumMap = EnumSet.allOf(WalletDetailTypeEnum.class).stream().collect(Collectors.toMap(WalletDetailTypeEnum::getCode, Function.identity()));
}
} }
...@@ -67,7 +67,7 @@ public class AliYunSmsBiz { ...@@ -67,7 +67,7 @@ public class AliYunSmsBiz {
public static final String TEMPLATE_ID_CANCEL_E = "SMS_173345667"; public static final String TEMPLATE_ID_CANCEL_E = "SMS_173345667";
//租车押金退还 22 //租车押金退还 22
//public static final String TEMPLATE_ID_FINISH_A = "460772"; //public static final String TEMPLATE_ID_FINISH_A = "460772";
public static final String TEMPLATE_ID_FINISH_A = "SMS_173340710"; public static final String TEMPLATE_ID_FINISH_A = "SMS_175240587";
//违章押金退还 23 //违章押金退还 23
//public static final String TEMPLATE_ID_FINISH_B = "460773"; //public static final String TEMPLATE_ID_FINISH_B = "460773";
public static final String TEMPLATE_ID_FINISH_B = "SMS_173340712"; public static final String TEMPLATE_ID_FINISH_B = "SMS_173340712";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment