| | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | List<ApiMallProductNftVo> list = this.baseMapper.selectByState(ProductEnum.PRODUCT_NFT_OPEN.getValue()); |
| | | if(CollUtil.isNotEmpty(list)){ |
| | | for(ApiMallProductNftVo apiMallProductNftVo : list){ |
| | | if(nowTime.compareTo(startTime) < 0){ |
| | | apiMallProductNftVo.setYuYueState(1); |
| | | } |
| | | if(nowTime.compareTo(startTime) >= 0 && nowTime.compareTo(endTime) <= 0){ |
| | | apiMallProductNftVo.setYuYueState(2); |
| | | } |
| | | if(nowTime.compareTo(endTime) > 0){ |
| | | apiMallProductNftVo.setYuYueState(3); |
| | | } |
| | | apiMallProductNftVo.setYuYueState(2); |
| | | // if(nowTime.compareTo(startTime) < 0){ |
| | | // apiMallProductNftVo.setYuYueState(1); |
| | | // } |
| | | // if(nowTime.compareTo(startTime) >= 0 && nowTime.compareTo(endTime) <= 0){ |
| | | // apiMallProductNftVo.setYuYueState(2); |
| | | // } |
| | | // if(nowTime.compareTo(endTime) > 0){ |
| | | // apiMallProductNftVo.setYuYueState(3); |
| | | // } |
| | | } |
| | | } |
| | | return list; |
| | |
| | | throw new FebsException("用户已冻结"); |
| | | } |
| | | |
| | | DateTime nowTime = DateUtil.parseTime(DateUtil.formatTime(DateUtil.date())); |
| | | DataDictionaryCustom startTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.YU_YUE_START_TIME.getType(), |
| | | DataDictionaryEnum.YU_YUE_START_TIME.getCode() |
| | | ); |
| | | DateTime startTime = DateUtil.parseTime(startTimeDic.getValue()); |
| | | DataDictionaryCustom endTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.YU_YUE_END_TIME.getType(), |
| | | DataDictionaryEnum.YU_YUE_END_TIME.getCode() |
| | | ); |
| | | DateTime endTime = DateUtil.parseTime(endTimeDic.getValue()); |
| | | if(!(nowTime.compareTo(startTime) >= 0 && nowTime.compareTo(endTime) <= 0)){ |
| | | throw new FebsException("预约未开始"); |
| | | } |
| | | // DateTime nowTime = DateUtil.parseTime(DateUtil.formatTime(DateUtil.date())); |
| | | // DataDictionaryCustom startTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | // DataDictionaryEnum.YU_YUE_START_TIME.getType(), |
| | | // DataDictionaryEnum.YU_YUE_START_TIME.getCode() |
| | | // ); |
| | | // DateTime startTime = DateUtil.parseTime(startTimeDic.getValue()); |
| | | // DataDictionaryCustom endTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | // DataDictionaryEnum.YU_YUE_END_TIME.getType(), |
| | | // DataDictionaryEnum.YU_YUE_END_TIME.getCode() |
| | | // ); |
| | | // DateTime endTime = DateUtil.parseTime(endTimeDic.getValue()); |
| | | // if(!(nowTime.compareTo(startTime) >= 0 && nowTime.compareTo(endTime) <= 0)){ |
| | | // throw new FebsException("预约未开始"); |
| | | // } |
| | | if(!tradePassword.equals(mallMember.getTradePassword())){ |
| | | throw new FebsException("请输入正确的交易密码"); |
| | | } |
| | |
| | | if(ObjectUtil.isNotEmpty(mallProductBuy)){ |
| | | throw new FebsException("不可重复预约"); |
| | | } |
| | | QueryWrapper<MallProductBuy> mallProductBuyDone = new QueryWrapper<>(); |
| | | mallProductBuyDone.like("CREATED_TIME", DateUtil.today()); |
| | | mallProductBuyDone.eq("member_id",memberId); |
| | | Integer selectCount = mallProductBuyMapper.selectCount(mallProductBuyDone); |
| | | if(0 < selectCount){ |
| | | throw new FebsException("每日预约一次"); |
| | | } |
| | | |
| | | BigDecimal priceToken = mallProductNft.getPriceToken(); |
| | | MallMemberAmount mallMemberAmount = mallMemberAmountMapper.selectByMemberId(memberId); |