| | |
| | | queryWrapperActivityReceiveRecord.eq("member_id",memberId); |
| | | queryWrapperActivityReceiveRecord.eq("sub_id",subId); |
| | | ActivityReceiveRecord activityReceiveRecord = activityReceiveRecordDao.selectOne(queryWrapperActivityReceiveRecord); |
| | | Date receiveTime = activityReceiveRecord.getReceiveTime(); |
| | | Date invalidTime = activityReceiveRecord.getInvalidTime(); |
| | | Date date = new Date(); |
| | | if(receiveTime.getTime() - date.getTime() < 0) { |
| | | return Result.fail(MessageSourceUtils.getString("activity_service_0002")); |
| | | if(ObjectUtil.isNotEmpty(invalidTime.getTime())) { |
| | | if(invalidTime.getTime() - date.getTime() < 0) { |
| | | return Result.fail(MessageSourceUtils.getString("activity_service_0002")); |
| | | } |
| | | } |
| | | //验证当前活动是否结束 |
| | | ActivityMain activityMain = activityMainDao.selectById(activityReceiveRecord.getMainId()); |
| | | Date endTime = activityMain.getEndTime(); |
| | | if(endTime.getTime() - date.getTime() < 0) { |
| | | return Result.fail(MessageSourceUtils.getString("activity_service_0004")); |
| | | } |
| | | // Date endTime = activityMain.getEndTime(); |
| | | // if(endTime.getTime() - date.getTime() < 0) { |
| | | // return Result.fail(MessageSourceUtils.getString("activity_service_0004")); |
| | | // } |
| | | |
| | | //处于失效状态 |
| | | Integer receiveState = activityReceiveRecord.getReceiveState(); |
| | |
| | | |
| | | //获取对应的规则编码 |
| | | ActivitySub activitySub = activitySubDao.selectById(subId); |
| | | String code = activitySub.getCode(); |
| | | //获取当前人的累计爆仓金额 |
| | | BigDecimal burstUsdt = contractOrderDao.getBurstUsdtByMemberId(memberId); |
| | | //判断是否满足领取条件 |
| | | if(ActivitySub.CODE_TWO.equals(code)) { |
| | | if(ActivitySub.CODE_TWO_BIG_DECIMAL.compareTo(burstUsdt) > 0) { |
| | | return Result.fail(MessageSourceUtils.getString("activity_service_0005")); |
| | | } |
| | | if(ActivitySub.CODE_ONE != activitySub.getCode()) { |
| | | if(activitySub.getBurstAmount().compareTo(burstUsdt) > 0) { |
| | | return Result.fail(MessageSourceUtils.getString("activity_service_0005")); |
| | | } |
| | | } |
| | | if(ActivitySub.CODE_THREE.equals(code)) { |
| | | if(ActivitySub.CODE_THREE_BIG_DECIMAL.compareTo(burstUsdt) > 0) { |
| | | return Result.fail(MessageSourceUtils.getString("activity_service_0005")); |
| | | } |
| | | } |
| | | if(ActivitySub.CODE_FOUR.equals(code)) { |
| | | if(ActivitySub.CODE_FOUR_BIG_DECIMAL.compareTo(burstUsdt) > 0) { |
| | | return Result.fail(MessageSourceUtils.getString("activity_service_0005")); |
| | | } |
| | | } |
| | | if(ActivitySub.CODE_FIVE.equals(code)) { |
| | | if(ActivitySub.CODE_FIVE_BIG_DECIMAL.compareTo(burstUsdt) > 0) { |
| | | return Result.fail(MessageSourceUtils.getString("activity_service_0005")); |
| | | } |
| | | } |
| | | |
| | | Long mainId = activitySub.getMainId(); |
| | | BigDecimal amount = activitySub.getAmount(); |
| | | /** |