现金提现
This commit is contained in:
@ -73,6 +73,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode DEVICE_WARN_NOT_EXISTS = new ErrorCode(1_004_013_011, "订单明细不存在");
|
ErrorCode DEVICE_WARN_NOT_EXISTS = new ErrorCode(1_004_013_011, "订单明细不存在");
|
||||||
ErrorCode DISH_STATISTICS_NOT_EXISTS = new ErrorCode(1_004_013_012, "订单明细不存在");
|
ErrorCode DISH_STATISTICS_NOT_EXISTS = new ErrorCode(1_004_013_012, "订单明细不存在");
|
||||||
ErrorCode CASH_AMOUNT_NOT_ENOUGH = new ErrorCode(1_004_013_002, "现金充值余额不足");
|
ErrorCode CASH_AMOUNT_NOT_ENOUGH = new ErrorCode(1_004_013_002, "现金充值余额不足");
|
||||||
|
ErrorCode CASH_AMOUNT_NOT_ALLOW = new ErrorCode(1_004_013_003, "不允许提现");
|
||||||
|
|
||||||
ErrorCode DINING_PLATES_NOT_EXISTS = new ErrorCode(1_004_099_000, "餐盘不存在");
|
ErrorCode DINING_PLATES_NOT_EXISTS = new ErrorCode(1_004_099_000, "餐盘不存在");
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ import java.time.LocalDateTime;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.CASH_AMOUNT_NOT_ALLOW;
|
||||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.CASH_AMOUNT_NOT_ENOUGH;
|
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.CASH_AMOUNT_NOT_ENOUGH;
|
||||||
import static cn.iocoder.yudao.module.member.service.amount.LockManager.getUserLock;
|
import static cn.iocoder.yudao.module.member.service.amount.LockManager.getUserLock;
|
||||||
|
|
||||||
@ -210,6 +211,10 @@ public class DeductionServiceImpl implements DeductionService {
|
|||||||
BigDecimal newMoney;
|
BigDecimal newMoney;
|
||||||
String name;
|
String name;
|
||||||
|
|
||||||
|
if(judgeDraw(userId)){
|
||||||
|
throw exception(CASH_AMOUNT_NOT_ALLOW);
|
||||||
|
}
|
||||||
|
|
||||||
synchronized (getUserLock(userId)) {
|
synchronized (getUserLock(userId)) {
|
||||||
MemberUserDO user = userService.getUser(userId);
|
MemberUserDO user = userService.getUser(userId);
|
||||||
if (user.getCashAmount().compareTo(BigDecimal.ZERO) < 1
|
if (user.getCashAmount().compareTo(BigDecimal.ZERO) < 1
|
||||||
@ -638,7 +643,9 @@ public class DeductionServiceImpl implements DeductionService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断食堂扣款顺序(true - 微信,false - 现金)
|
/**
|
||||||
|
* 判断食堂扣款顺序(true - 微信,false - 现金)
|
||||||
|
*/
|
||||||
public boolean judge(Long userId) {
|
public boolean judge(Long userId) {
|
||||||
//获取用户所在组分类
|
//获取用户所在组分类
|
||||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||||
@ -647,7 +654,9 @@ public class DeductionServiceImpl implements DeductionService {
|
|||||||
return isHoliday && (types.contains(GroupTypeEnum.ADMINISTRATIVE.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode()));
|
return isHoliday && (types.contains(GroupTypeEnum.ADMINISTRATIVE.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断食堂扣款顺序(true - 微信,false - 现金)
|
/**
|
||||||
|
* 判断食堂扣款顺序(true - 微信,false - 现金)
|
||||||
|
*/
|
||||||
public boolean judge(Long userId, String time) {
|
public boolean judge(Long userId, String time) {
|
||||||
//获取用户所在组分类
|
//获取用户所在组分类
|
||||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||||
@ -656,7 +665,9 @@ public class DeductionServiceImpl implements DeductionService {
|
|||||||
return isHoliday && (types.contains(GroupTypeEnum.ADMINISTRATIVE.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode()));
|
return isHoliday && (types.contains(GroupTypeEnum.ADMINISTRATIVE.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断购物付款顺序(true - 微信,false - 现金)
|
/**
|
||||||
|
* 判断购物付款顺序(true - 微信,false - 现金)
|
||||||
|
*/
|
||||||
public boolean judgeShopping(Long userId) {
|
public boolean judgeShopping(Long userId) {
|
||||||
//获取用户所在组分类
|
//获取用户所在组分类
|
||||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||||
@ -664,7 +675,9 @@ public class DeductionServiceImpl implements DeductionService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断太空舱付款顺序(true - 微信,false - 现金)
|
/**
|
||||||
|
* 判断太空舱付款顺序(true - 微信,false - 现金)
|
||||||
|
*/
|
||||||
public boolean judgeSpace(Long userId) {
|
public boolean judgeSpace(Long userId) {
|
||||||
//获取用户所在组分类
|
//获取用户所在组分类
|
||||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||||
@ -675,10 +688,19 @@ public class DeductionServiceImpl implements DeductionService {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//行政服务中心只允许工作日
|
//行政服务中心只允许工作日
|
||||||
if (isHoliday && types.contains(GroupTypeEnum.ADMINISTRATIVE.getCode())) {
|
return isHoliday && types.contains(GroupTypeEnum.ADMINISTRATIVE.getCode());
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否能提现(true - 不能,false - 能)
|
||||||
|
*/
|
||||||
|
public boolean judgeDraw(Long userId) {
|
||||||
|
//获取用户所在组分类
|
||||||
|
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||||
|
return types.contains(GroupTypeEnum.YCLH.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode())
|
||||||
|
|| types.contains(GroupTypeEnum.ADMINISTRATIVE.getCode()) || types.contains(GroupTypeEnum.OTHER.getCode());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user