Merge branch 'master' into pay0408
This commit is contained in:
commit
1bbb17503f
|
|
@ -3,27 +3,27 @@ package com.bonus.canteen.core.account.constants;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public enum AccountStatusEnum {
|
||||
NORMAL(1, "正常"),
|
||||
DEACTIVATE(2, "停用");
|
||||
public enum AccStatusEnum {
|
||||
NORMAL(0, "正常"),
|
||||
DEACTIVATE(1, "停用");
|
||||
|
||||
private final Integer key;
|
||||
private final String desc;
|
||||
|
||||
private static final Map<Integer, AccountStatusEnum> ENUM_MAP = Arrays.stream(values())
|
||||
.collect(Collectors.toMap(AccountStatusEnum::getKey, e -> e));
|
||||
private static final Map<Integer, AccStatusEnum> ENUM_MAP = Arrays.stream(values())
|
||||
.collect(Collectors.toMap(AccStatusEnum::getKey, e -> e));
|
||||
|
||||
private AccountStatusEnum(Integer key, String desc) {
|
||||
private AccStatusEnum(Integer key, String desc) {
|
||||
this.key = key;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static String getDesc(Integer key) {
|
||||
AccountStatusEnum enumValue = ENUM_MAP.get(key);
|
||||
AccStatusEnum enumValue = ENUM_MAP.get(key);
|
||||
return enumValue != null ? enumValue.getDesc() : "";
|
||||
}
|
||||
|
||||
public static AccountStatusEnum getEnum(Integer key) {
|
||||
public static AccStatusEnum getEnum(Integer key) {
|
||||
return ENUM_MAP.get(key);
|
||||
}
|
||||
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
package com.bonus.canteen.core.account.enums;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public enum AccStatusEnum {
|
||||
NORMAL(1, "正常"),
|
||||
DEACTIVATE(2, "停用"),
|
||||
CANCEL(3, "注销"),
|
||||
OVERDUE(4, "过期");
|
||||
|
||||
private final Integer key;
|
||||
private final String desc;
|
||||
|
||||
private AccStatusEnum(Integer key, String desc) {
|
||||
this.key = key;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static String getDesc(Integer key) {
|
||||
AccStatusEnum[] var1 = values();
|
||||
int var2 = var1.length;
|
||||
|
||||
for(int var3 = 0; var3 < var2; ++var3) {
|
||||
AccStatusEnum temp = var1[var3];
|
||||
if (temp.getKey().equals(key)) {
|
||||
return temp.getDesc();
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public static AccStatusEnum getEnum(Integer key) {
|
||||
AccStatusEnum[] var1 = values();
|
||||
int var2 = var1.length;
|
||||
|
||||
for(int var3 = 0; var3 < var2; ++var3) {
|
||||
AccStatusEnum temp = var1[var3];
|
||||
if (temp.getKey().equals(key)) {
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<Integer> sendMqStatus() {
|
||||
return Arrays.asList(DEACTIVATE.getKey(), OVERDUE.getKey());
|
||||
}
|
||||
|
||||
public static List<Integer> accStatusForAppWork() {
|
||||
return ListUtil.toList(new Integer[]{NORMAL.getKey(), DEACTIVATE.getKey(), OVERDUE.getKey()});
|
||||
}
|
||||
|
||||
public static boolean ifNotAllowRechargeRepeal(Integer key) {
|
||||
return ListUtil.toList(new Integer[]{CANCEL.getKey()}).contains(key);
|
||||
}
|
||||
|
||||
public Integer getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package com.bonus.canteen.core.account.enums;
|
||||
|
||||
public enum AccWalletIdEnum {
|
||||
WALLET(1, "个人钱包"),
|
||||
SUBSIDY(2, "补贴钱包");
|
||||
//LUCK_MONEY(4, "红包");
|
||||
|
||||
private final Integer key;
|
||||
private final String desc;
|
||||
|
||||
private AccWalletIdEnum(Integer key, String desc) {
|
||||
this.key = key;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bonus.canteen.core.account.mq;
|
||||
|
||||
import com.bonus.canteen.core.account.constants.AccountStatusEnum;
|
||||
import com.bonus.canteen.core.account.constants.AccStatusEnum;
|
||||
import com.bonus.canteen.core.account.domain.bo.AccStatusChange;
|
||||
import com.bonus.canteen.core.common.utils.TenantContextHolder;
|
||||
import com.bonus.common.core.constant.SecurityConstants;
|
||||
|
|
@ -31,7 +31,7 @@ public class AccMqSender {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!AccountStatusEnum.DEACTIVATE.getKey().equals(accStatus)) {
|
||||
if (!AccStatusEnum.DEACTIVATE.getKey().equals(accStatus)) {
|
||||
log.warn("账户状态不在允许范围内,无法发送MQ。accStatus: {}", accStatus);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
package com.bonus.canteen.core.account.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
|
|
@ -15,7 +12,7 @@ import cn.hutool.core.util.NumberUtil;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.bonus.canteen.core.account.constants.AccWalletIdEnum;
|
||||
import com.bonus.canteen.core.account.constants.AccountStatusEnum;
|
||||
import com.bonus.canteen.core.account.constants.AccStatusEnum;
|
||||
import com.bonus.canteen.core.account.domain.*;
|
||||
import com.bonus.canteen.core.account.domain.param.AccountBalanceEditParam;
|
||||
import com.bonus.canteen.core.account.domain.param.AccountEnableDisableParam;
|
||||
|
|
@ -29,16 +26,12 @@ import com.bonus.canteen.core.account.service.IAccWalletInfoService;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.bonus.canteen.core.account.domain.AccInfoVo;
|
||||
import com.bonus.canteen.core.account.domain.AccWalletInfo;
|
||||
import com.bonus.canteen.core.account.domain.WalletBalanceVO;
|
||||
import com.bonus.canteen.core.account.enums.AccStatusEnum;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.houqin.constant.LeCodeUseSceneEnum;
|
||||
import com.bonus.common.houqin.constant.SourceTypeEnum;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
|
|
@ -46,7 +39,6 @@ import com.bonus.system.api.domain.SysUser;
|
|||
import com.bonus.common.houqin.utils.SM4EncryptUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
|
@ -55,8 +47,6 @@ import org.springframework.stereotype.Service;
|
|||
import com.bonus.canteen.core.account.mapper.AccInfoMapper;
|
||||
import com.bonus.canteen.core.account.service.IAccInfoService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue