解除限制
This commit is contained in:
@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.member.service.group.MemberGroupService;
|
||||
import cn.iocoder.yudao.module.member.service.holiday.HolidayService;
|
||||
import cn.iocoder.yudao.module.member.service.money.MoneyService;
|
||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
||||
import cn.iocoder.yudao.module.member.util.MemberConstants;
|
||||
import cn.iocoder.yudao.module.member.util.MemberTimeUtils;
|
||||
import com.sun.istack.NotNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -978,6 +979,9 @@ public class DeductionServiceImpl implements DeductionService {
|
||||
* 判断食堂扣款顺序(true - 微信,false - 现金)
|
||||
*/
|
||||
public boolean judge(Long userId) {
|
||||
if(!MemberConstants.LIMIT_SWITCH){
|
||||
return false;
|
||||
}
|
||||
//获取用户所在组分类
|
||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||
//查询今天是否假期
|
||||
@ -989,6 +993,9 @@ public class DeductionServiceImpl implements DeductionService {
|
||||
* 判断食堂扣款顺序(true - 微信,false - 现金)
|
||||
*/
|
||||
public boolean judge(Long userId, String time) {
|
||||
if(!MemberConstants.LIMIT_SWITCH){
|
||||
return false;
|
||||
}
|
||||
//获取用户所在组分类
|
||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||
//查询今天是否假期
|
||||
@ -1000,6 +1007,9 @@ public class DeductionServiceImpl implements DeductionService {
|
||||
* 判断购物付款顺序(true - 微信,false - 现金)
|
||||
*/
|
||||
public boolean judgeShopping(Long userId) {
|
||||
if(!MemberConstants.LIMIT_SWITCH){
|
||||
return false;
|
||||
}
|
||||
//获取用户所在组分类
|
||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||
return (types.contains(GroupTypeEnum.YCLH.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode()));
|
||||
@ -1010,6 +1020,9 @@ public class DeductionServiceImpl implements DeductionService {
|
||||
* 判断太空舱付款顺序(true - 微信,false - 现金)
|
||||
*/
|
||||
public boolean judgeSpace(Long userId) {
|
||||
if(!MemberConstants.LIMIT_SWITCH){
|
||||
return false;
|
||||
}
|
||||
//获取用户所在组分类
|
||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||
//查询今天是否假期
|
||||
@ -1026,6 +1039,9 @@ public class DeductionServiceImpl implements DeductionService {
|
||||
* 判断是否能提现(true - 不能,false - 能)
|
||||
*/
|
||||
public boolean judgeDraw(Long userId) {
|
||||
if(!MemberConstants.LIMIT_SWITCH){
|
||||
return false;
|
||||
}
|
||||
//获取用户所在组分类
|
||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||
return types.contains(GroupTypeEnum.YCLH.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode())
|
||||
@ -1033,5 +1049,6 @@ public class DeductionServiceImpl implements DeductionService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -394,16 +394,20 @@ public class DiningPlatesServiceImpl implements DiningPlatesService {
|
||||
public BigDecimal checkMoney(MemberUserDO memberUserDO,Long storeId,boolean isCard) {
|
||||
//获取所有现金
|
||||
BigDecimal cashAmount = memberUserDO.getCashAmount();
|
||||
//获取用户所在组分类
|
||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(memberUserDO.getId());
|
||||
//查询今天是否假期
|
||||
Boolean isHoliday = holidayService.checkHoliday();
|
||||
boolean typeHoliday = isHoliday && (types.contains(GroupTypeEnum.ADMINISTRATIVE.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode()));
|
||||
if(typeHoliday){
|
||||
cashAmount = BigDecimal.ZERO;
|
||||
|
||||
boolean typeHoliday = false;
|
||||
if(MemberConstants.LIMIT_SWITCH){
|
||||
//获取用户所在组分类
|
||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(memberUserDO.getId());
|
||||
//查询今天是否假期
|
||||
Boolean isHoliday = holidayService.checkHoliday();
|
||||
typeHoliday = isHoliday && (types.contains(GroupTypeEnum.ADMINISTRATIVE.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode()));
|
||||
if(typeHoliday){
|
||||
cashAmount = BigDecimal.ZERO;
|
||||
}
|
||||
}
|
||||
BigDecimal money = memberUserDO.getWxAmount().add(cashAmount);
|
||||
|
||||
BigDecimal money = memberUserDO.getWxAmount().add(cashAmount);
|
||||
BigDecimal compareMoney = carteenApi.getCarteenById(storeId).getBindMoney();
|
||||
if (money.compareTo(compareMoney) < 0) {
|
||||
if(typeHoliday){
|
||||
@ -412,8 +416,8 @@ public class DiningPlatesServiceImpl implements DiningPlatesService {
|
||||
throw exception(INSUFFICIENT_BALANCE);
|
||||
}
|
||||
|
||||
boolean applyToCard = isCard && memberUserDO.getReception() == 1;
|
||||
//餐盘个数验证
|
||||
boolean applyToCard = isCard && memberUserDO.getReception() == 1;
|
||||
StoreDiningPlatesDO byAmount = storeDiningPlatesService.getByAmount(money, storeId, applyToCard);
|
||||
if(byAmount != null){
|
||||
Integer checkNum = byAmount.getNum();
|
||||
|
@ -35,6 +35,7 @@ import cn.iocoder.yudao.module.member.service.storeorderdetail.StoreOrderDetailS
|
||||
import cn.iocoder.yudao.module.member.service.storerefund.StoreRefundService;
|
||||
import cn.iocoder.yudao.module.member.service.storeshoppingcart.StoreShoppingCartService;
|
||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
||||
import cn.iocoder.yudao.module.member.util.MemberConstants;
|
||||
import cn.iocoder.yudao.module.member.util.QRCodeWithJWTUtil;
|
||||
import cn.iocoder.yudao.module.system.api.cashregisterinfo.CashregisterinfoApi;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -665,14 +666,17 @@ public class StoreOrderServiceImpl implements StoreOrderService {
|
||||
}
|
||||
}
|
||||
|
||||
public void checkMoney(MemberUserDO user,BigDecimal totalMoney){
|
||||
public void checkMoney(MemberUserDO user, BigDecimal totalMoney) {
|
||||
//获取用户所在组分类
|
||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(user.getId());
|
||||
BigDecimal computeMoney = user.getMoney();
|
||||
if (types.contains(GroupTypeEnum.YCLH.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode())){
|
||||
computeMoney = user.getWxAmount();
|
||||
}
|
||||
if(computeMoney.compareTo(totalMoney) < 0){
|
||||
if (MemberConstants.LIMIT_SWITCH) {
|
||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(user.getId());
|
||||
if (types.contains(GroupTypeEnum.YCLH.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode())) {
|
||||
computeMoney = user.getWxAmount();
|
||||
}
|
||||
}
|
||||
|
||||
if (computeMoney.compareTo(totalMoney) < 0) {
|
||||
throw exception(AMOUNT_NOT_ENOUGH);
|
||||
}
|
||||
|
||||
|
@ -93,4 +93,9 @@ public class MemberConstants {
|
||||
* 社区门店ID
|
||||
*/
|
||||
public static final BigDecimal SANXIA_ROAD_COMMUNITY_BALANCE = new BigDecimal("16");
|
||||
|
||||
/**
|
||||
* 金额限制开关
|
||||
*/
|
||||
public static final boolean LIMIT_SWITCH = false;
|
||||
}
|
Reference in New Issue
Block a user