解除限制
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.holiday.HolidayService;
|
||||||
import cn.iocoder.yudao.module.member.service.money.MoneyService;
|
import cn.iocoder.yudao.module.member.service.money.MoneyService;
|
||||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
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 cn.iocoder.yudao.module.member.util.MemberTimeUtils;
|
||||||
import com.sun.istack.NotNull;
|
import com.sun.istack.NotNull;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -978,6 +979,9 @@ public class DeductionServiceImpl implements DeductionService {
|
|||||||
* 判断食堂扣款顺序(true - 微信,false - 现金)
|
* 判断食堂扣款顺序(true - 微信,false - 现金)
|
||||||
*/
|
*/
|
||||||
public boolean judge(Long userId) {
|
public boolean judge(Long userId) {
|
||||||
|
if(!MemberConstants.LIMIT_SWITCH){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
//获取用户所在组分类
|
//获取用户所在组分类
|
||||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||||
//查询今天是否假期
|
//查询今天是否假期
|
||||||
@ -989,6 +993,9 @@ public class DeductionServiceImpl implements DeductionService {
|
|||||||
* 判断食堂扣款顺序(true - 微信,false - 现金)
|
* 判断食堂扣款顺序(true - 微信,false - 现金)
|
||||||
*/
|
*/
|
||||||
public boolean judge(Long userId, String time) {
|
public boolean judge(Long userId, String time) {
|
||||||
|
if(!MemberConstants.LIMIT_SWITCH){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
//获取用户所在组分类
|
//获取用户所在组分类
|
||||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||||
//查询今天是否假期
|
//查询今天是否假期
|
||||||
@ -1000,6 +1007,9 @@ public class DeductionServiceImpl implements DeductionService {
|
|||||||
* 判断购物付款顺序(true - 微信,false - 现金)
|
* 判断购物付款顺序(true - 微信,false - 现金)
|
||||||
*/
|
*/
|
||||||
public boolean judgeShopping(Long userId) {
|
public boolean judgeShopping(Long userId) {
|
||||||
|
if(!MemberConstants.LIMIT_SWITCH){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
//获取用户所在组分类
|
//获取用户所在组分类
|
||||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||||
return (types.contains(GroupTypeEnum.YCLH.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode()));
|
return (types.contains(GroupTypeEnum.YCLH.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode()));
|
||||||
@ -1010,6 +1020,9 @@ public class DeductionServiceImpl implements DeductionService {
|
|||||||
* 判断太空舱付款顺序(true - 微信,false - 现金)
|
* 判断太空舱付款顺序(true - 微信,false - 现金)
|
||||||
*/
|
*/
|
||||||
public boolean judgeSpace(Long userId) {
|
public boolean judgeSpace(Long userId) {
|
||||||
|
if(!MemberConstants.LIMIT_SWITCH){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
//获取用户所在组分类
|
//获取用户所在组分类
|
||||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||||
//查询今天是否假期
|
//查询今天是否假期
|
||||||
@ -1026,6 +1039,9 @@ public class DeductionServiceImpl implements DeductionService {
|
|||||||
* 判断是否能提现(true - 不能,false - 能)
|
* 判断是否能提现(true - 不能,false - 能)
|
||||||
*/
|
*/
|
||||||
public boolean judgeDraw(Long userId) {
|
public boolean judgeDraw(Long userId) {
|
||||||
|
if(!MemberConstants.LIMIT_SWITCH){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
//获取用户所在组分类
|
//获取用户所在组分类
|
||||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
List<Integer> types = memberGroupService.getGroupTypeListByUserId(userId);
|
||||||
return types.contains(GroupTypeEnum.YCLH.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode())
|
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) {
|
public BigDecimal checkMoney(MemberUserDO memberUserDO,Long storeId,boolean isCard) {
|
||||||
//获取所有现金
|
//获取所有现金
|
||||||
BigDecimal cashAmount = memberUserDO.getCashAmount();
|
BigDecimal cashAmount = memberUserDO.getCashAmount();
|
||||||
//获取用户所在组分类
|
|
||||||
List<Integer> types = memberGroupService.getGroupTypeListByUserId(memberUserDO.getId());
|
boolean typeHoliday = false;
|
||||||
//查询今天是否假期
|
if(MemberConstants.LIMIT_SWITCH){
|
||||||
Boolean isHoliday = holidayService.checkHoliday();
|
//获取用户所在组分类
|
||||||
boolean typeHoliday = isHoliday && (types.contains(GroupTypeEnum.ADMINISTRATIVE.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode()));
|
List<Integer> types = memberGroupService.getGroupTypeListByUserId(memberUserDO.getId());
|
||||||
if(typeHoliday){
|
//查询今天是否假期
|
||||||
cashAmount = BigDecimal.ZERO;
|
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();
|
BigDecimal compareMoney = carteenApi.getCarteenById(storeId).getBindMoney();
|
||||||
if (money.compareTo(compareMoney) < 0) {
|
if (money.compareTo(compareMoney) < 0) {
|
||||||
if(typeHoliday){
|
if(typeHoliday){
|
||||||
@ -412,8 +416,8 @@ public class DiningPlatesServiceImpl implements DiningPlatesService {
|
|||||||
throw exception(INSUFFICIENT_BALANCE);
|
throw exception(INSUFFICIENT_BALANCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean applyToCard = isCard && memberUserDO.getReception() == 1;
|
|
||||||
//餐盘个数验证
|
//餐盘个数验证
|
||||||
|
boolean applyToCard = isCard && memberUserDO.getReception() == 1;
|
||||||
StoreDiningPlatesDO byAmount = storeDiningPlatesService.getByAmount(money, storeId, applyToCard);
|
StoreDiningPlatesDO byAmount = storeDiningPlatesService.getByAmount(money, storeId, applyToCard);
|
||||||
if(byAmount != null){
|
if(byAmount != null){
|
||||||
Integer checkNum = byAmount.getNum();
|
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.storerefund.StoreRefundService;
|
||||||
import cn.iocoder.yudao.module.member.service.storeshoppingcart.StoreShoppingCartService;
|
import cn.iocoder.yudao.module.member.service.storeshoppingcart.StoreShoppingCartService;
|
||||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
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.member.util.QRCodeWithJWTUtil;
|
||||||
import cn.iocoder.yudao.module.system.api.cashregisterinfo.CashregisterinfoApi;
|
import cn.iocoder.yudao.module.system.api.cashregisterinfo.CashregisterinfoApi;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
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();
|
BigDecimal computeMoney = user.getMoney();
|
||||||
if (types.contains(GroupTypeEnum.YCLH.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode())){
|
if (MemberConstants.LIMIT_SWITCH) {
|
||||||
computeMoney = user.getWxAmount();
|
List<Integer> types = memberGroupService.getGroupTypeListByUserId(user.getId());
|
||||||
}
|
if (types.contains(GroupTypeEnum.YCLH.getCode()) || types.contains(GroupTypeEnum.DISTRICT.getCode())) {
|
||||||
if(computeMoney.compareTo(totalMoney) < 0){
|
computeMoney = user.getWxAmount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (computeMoney.compareTo(totalMoney) < 0) {
|
||||||
throw exception(AMOUNT_NOT_ENOUGH);
|
throw exception(AMOUNT_NOT_ENOUGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,4 +93,9 @@ public class MemberConstants {
|
|||||||
* 社区门店ID
|
* 社区门店ID
|
||||||
*/
|
*/
|
||||||
public static final BigDecimal SANXIA_ROAD_COMMUNITY_BALANCE = new BigDecimal("16");
|
public static final BigDecimal SANXIA_ROAD_COMMUNITY_BALANCE = new BigDecimal("16");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 金额限制开关
|
||||||
|
*/
|
||||||
|
public static final boolean LIMIT_SWITCH = false;
|
||||||
}
|
}
|
@ -1,17 +1,17 @@
|
|||||||
package cn.iocoder.yudao.module.pay.dal.mysql.wxprofitsharing;
|
package cn.iocoder.yudao.module.pay.dal.mysql.wxprofitsharing;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.pay.controller.admin.wxprofitsharing.vo.WxProfitsharingPageReqVO;
|
||||||
import cn.iocoder.yudao.module.pay.dal.dataobject.refundlog.PayRefundLogDO;
|
import cn.iocoder.yudao.module.pay.dal.dataobject.refundlog.PayRefundLogDO;
|
||||||
import cn.iocoder.yudao.module.pay.dal.dataobject.wxprofitsharing.WxProfitsharingDO;
|
import cn.iocoder.yudao.module.pay.dal.dataobject.wxprofitsharing.WxProfitsharingDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import cn.iocoder.yudao.module.pay.controller.admin.wxprofitsharing.vo.*;
|
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信分账记录 Mapper
|
* 微信分账记录 Mapper
|
||||||
*
|
*
|
||||||
@ -41,7 +41,7 @@ public interface WxProfitsharingMapper extends BaseMapperX<WxProfitsharingDO> {
|
|||||||
@Select("select money from member_recharge_log where DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY) ")
|
@Select("select money from member_recharge_log where DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY) ")
|
||||||
BigDecimal getRechargeLog();
|
BigDecimal getRechargeLog();
|
||||||
|
|
||||||
@Select("select wx_amount from member_card where user_id = #{userId} order by create_time desc limit 1")
|
@Select("select wx_amount from member_user where id = #{userId} order by create_time desc limit 1")
|
||||||
BigDecimal getWxAmount(Long userId);
|
BigDecimal getWxAmount(Long userId);
|
||||||
|
|
||||||
@Select("select count(1) from member_dish_order where user_id = #{userId} and order_status = '0' and deleted = false")
|
@Select("select count(1) from member_dish_order where user_id = #{userId} and order_status = '0' and deleted = false")
|
||||||
|
@ -61,6 +61,17 @@ public class WxPubPayClient extends AbstractWxPayClient {
|
|||||||
.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(getOpenid(reqDTO)));
|
.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(getOpenid(reqDTO)));
|
||||||
//添加分账
|
//添加分账
|
||||||
// request.setSettleInfo(new WxPayUnifiedOrderV3Request.SettleInfo().setProfitSharing(true));
|
// request.setSettleInfo(new WxPayUnifiedOrderV3Request.SettleInfo().setProfitSharing(true));
|
||||||
|
//添加商店信息
|
||||||
|
// WxPayUnifiedOrderV3Request.StoreInfo storeInfo = new WxPayUnifiedOrderV3Request.StoreInfo();
|
||||||
|
// storeInfo.setId("1037");
|
||||||
|
// storeInfo.setName("中科未来城");
|
||||||
|
// storeInfo.setAreaCode("500115");
|
||||||
|
// storeInfo.setAddress("重庆长寿区");
|
||||||
|
// WxPayUnifiedOrderV3Request.SceneInfo sceneInfo = new WxPayUnifiedOrderV3Request.SceneInfo();
|
||||||
|
// sceneInfo.setPayerClientIp("113.249.15.42");
|
||||||
|
// sceneInfo.setStoreInfo(storeInfo);
|
||||||
|
// request.setSceneInfo(sceneInfo);
|
||||||
|
|
||||||
// 执行请求
|
// 执行请求
|
||||||
WxPayUnifiedOrderV3Result.JsapiResult response = client.createOrderV3(TradeTypeEnum.JSAPI, request);
|
WxPayUnifiedOrderV3Result.JsapiResult response = client.createOrderV3(TradeTypeEnum.JSAPI, request);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user