KKSU
2024-04-18 879f78c45ef034969c5fa7a5876a57d0466c818c
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
@@ -236,11 +236,17 @@
    @Transactional(rollbackFor = Exception.class)
    public Long transfer(TransferDto transferDto) {
        DappMemberEntity member = LoginUserUtil.getAppUser();
        QueryWrapper<DappFundFlowEntity> objectQueryWrapper = new QueryWrapper<>();
        objectQueryWrapper.eq("type" ,FlowTypeEnum.ZHI_YA.getValue());
        objectQueryWrapper.eq("status" ,DappFundFlowEntity.WITHDRAW_STATUS_AGREE);
        objectQueryWrapper.eq("member_id" ,member.getId());
        List<DappFundFlowEntity> dappFundFlowEntities = dappFundFlowDao.selectList(objectQueryWrapper);
//        QueryWrapper<DappFundFlowEntity> objectQueryWrapper = new QueryWrapper<>();
//        objectQueryWrapper.eq("type" ,FlowTypeEnum.ZHI_YA.getValue());
//        objectQueryWrapper.eq("status" ,DappFundFlowEntity.WITHDRAW_STATUS_AGREE);
//        objectQueryWrapper.eq("member_id" ,member.getId());
//        List<DappFundFlowEntity> dappFundFlowEntities = dappFundFlowDao.selectList(objectQueryWrapper);
        List<DappFundFlowEntity> dappFundFlowEntities = dappFundFlowDao.selectAmountTotalByTypeAndMemberIdAndDateAndState(
                member.getId(),
                FlowTypeEnum.ZHI_YA.getValue(),
                DappFundFlowEntity.WITHDRAW_STATUS_AGREE,
                new Date());
        BigDecimal zhiyaAmount = new BigDecimal(redisUtils.getString(DataDicEnum.MEMBER_ZHIYA_AMOUNT.getValue()));
        Integer zhiyaTime = Integer.parseInt(redisUtils.getString(DataDicEnum.MEMBER_ZHIYA_TIME.getValue()));
@@ -275,9 +281,9 @@
//                    if (BigDecimal.ZERO.compareTo(gfaDays) >= 0) {
//                        throw new FebsException("今日暂停质押");
//                    }
//                    if (transferDto.getAmount().compareTo(gfaDays) > 0) {
//                        throw new FebsException("今日最多质押"+gfaDays);
//                    }
                    if (transferDto.getAmount().compareTo(zhiyaAmount) > 0) {
                        throw new FebsException("今日最多质押"+zhiyaAmount);
                    }
                } else {
                    throw new FebsException("暂停质押");
                }