|  | @@ -402,11 +402,11 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
 | 
											
												
													
														|  |          List<VipCardRecord> vipCardRecordList = this.lambdaQuery()
 |  |          List<VipCardRecord> vipCardRecordList = this.lambdaQuery()
 | 
											
												
													
														|  |                  .eq(VipCardRecord::getClientType, addVipCardRecord.getClientType())
 |  |                  .eq(VipCardRecord::getClientType, addVipCardRecord.getClientType())
 | 
											
												
													
														|  |                  .eq(VipCardRecord::getUserId, addVipCardRecord.getUserId())
 |  |                  .eq(VipCardRecord::getUserId, addVipCardRecord.getUserId())
 | 
											
												
													
														|  | -//                .ge(VipCardRecord::getEndTime, new Date())
 |  | 
 | 
											
												
													
														|  | 
 |  | +                .ge(VipCardRecord::getEndTime, new Date())
 | 
											
												
													
														|  |                  .eq(VipCardRecord::getEfficientFlag, true)
 |  |                  .eq(VipCardRecord::getEfficientFlag, true)
 | 
											
												
													
														|  |                  .list()
 |  |                  .list()
 | 
											
												
													
														|  |                  .stream()
 |  |                  .stream()
 | 
											
												
													
														|  | -                .filter(n -> n.getEndTime() == null || n.getEndTime().after(new Date()))
 |  | 
 | 
											
												
													
														|  | 
 |  | +//                .filter(n -> n.getEndTime() == null || n.getEndTime().after(new Date()))
 | 
											
												
													
														|  |                  .sorted(Comparator.comparing(VipCardRecord::getStartTime))
 |  |                  .sorted(Comparator.comparing(VipCardRecord::getStartTime))
 | 
											
												
													
														|  |                  .collect(Collectors.toList());
 |  |                  .collect(Collectors.toList());
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -444,23 +444,36 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
 | 
											
												
													
														|  |              startTime = vipCardRecordList.stream().map(VipCardRecord::getEndTime).max(Date::compareTo).get();
 |  |              startTime = vipCardRecordList.stream().map(VipCardRecord::getEndTime).max(Date::compareTo).get();
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          if (addVipType.equals(EVipType.SVIP)) { //放到VIP的前面
 |  |          if (addVipType.equals(EVipType.SVIP)) { //放到VIP的前面
 | 
											
												
													
														|  | -            index = (int) vipCardRecordList.stream().filter(n -> EVipType.SVIP.equals(n.getVipType())).count();
 |  | 
 | 
											
												
													
														|  | -            if (index > 0) {
 |  | 
 | 
											
												
													
														|  | -                startTime = vipCardRecordList.stream().filter(n -> EVipType.SVIP.equals(n.getVipType())).map(VipCardRecord::getEndTime).max(Date::compareTo).get();
 |  | 
 | 
											
												
													
														|  | 
 |  | +            PeriodEnum period = addVipCardRecord.getType();
 | 
											
												
													
														|  | 
 |  | +            if (period.equals(PeriodEnum.PERPETUAL)) {
 | 
											
												
													
														|  | 
 |  | +                index = (int) vipCardRecordList.stream().filter(n -> EVipType.SVIP.equals(n.getVipType())).count();
 | 
											
												
													
														|  | 
 |  | +                if (index > 0) {
 | 
											
												
													
														|  | 
 |  | +                    startTime = vipCardRecordList.stream().filter(n -> EVipType.SVIP.equals(n.getVipType())).map(VipCardRecord::getEndTime).max(Date::compareTo).get();
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  | 
 |  | +            } else {
 | 
											
												
													
														|  | 
 |  | +                index = (int) vipCardRecordList.stream().filter(n -> EVipType.SVIP.equals(n.getVipType()) && !PeriodEnum.PERPETUAL.equals(n.getType())).count();
 | 
											
												
													
														|  | 
 |  | +                if (index > 0) {
 | 
											
												
													
														|  | 
 |  | +                    startTime = vipCardRecordList.stream().filter(n -> EVipType.SVIP.equals(n.getVipType()) && !PeriodEnum.PERPETUAL.equals(n.getType()))
 | 
											
												
													
														|  | 
 |  | +                            .map(VipCardRecord::getEndTime).max(Date::compareTo).get();
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          Date endDate = plusDate(startTime, addVipCardRecord.getType(), Long.valueOf(addVipCardRecord.getTimes()));
 |  |          Date endDate = plusDate(startTime, addVipCardRecord.getType(), Long.valueOf(addVipCardRecord.getTimes()));
 | 
											
												
													
														|  |          VipCardRecord newRecord = JSON.parseObject(JSON.toJSONString(addVipCardRecord), VipCardRecord.class);
 |  |          VipCardRecord newRecord = JSON.parseObject(JSON.toJSONString(addVipCardRecord), VipCardRecord.class);
 | 
											
												
													
														|  |          newRecord.setSourceType(SourceTypeEnum.BACKEND_GIVE);
 |  |          newRecord.setSourceType(SourceTypeEnum.BACKEND_GIVE);
 | 
											
												
													
														|  |          newRecord.setStatus(EVipRecordStatus.ADD);
 |  |          newRecord.setStatus(EVipRecordStatus.ADD);
 | 
											
												
													
														|  | -        newRecord.setStartTime(startTime);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (index > 0) {
 | 
											
												
													
														|  | 
 |  | +            newRecord.setStartTime(new Date(startTime.getTime() + 1000));
 | 
											
												
													
														|  | 
 |  | +        } else {
 | 
											
												
													
														|  | 
 |  | +            newRecord.setStartTime(startTime);
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  |          newRecord.setEndTime(endDate);
 |  |          newRecord.setEndTime(endDate);
 | 
											
												
													
														|  |          newRecord.setDisplayFlag(true);
 |  |          newRecord.setDisplayFlag(true);
 | 
											
												
													
														|  |          newRecord.setEfficientFlag(true);
 |  |          newRecord.setEfficientFlag(true);
 | 
											
												
													
														|  |          save(newRecord);
 |  |          save(newRecord);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          // 平移时间
 |  |          // 平移时间
 | 
											
												
													
														|  | -        long plusMills = endDate == null ? 0L : (endDate.getTime() - startTime.getTime());
 |  | 
 | 
											
												
													
														|  | 
 |  | +        long plusMills = endDate.getTime() - startTime.getTime();
 | 
											
												
													
														|  |          for (int i = 0; i < vipCardRecordList.size(); i++) {
 |  |          for (int i = 0; i < vipCardRecordList.size(); i++) {
 | 
											
												
													
														|  |              VipCardRecord vipCardRecord = vipCardRecordList.get(i);
 |  |              VipCardRecord vipCardRecord = vipCardRecordList.get(i);
 | 
											
												
													
														|  |              if (i >= index) {
 |  |              if (i >= index) {
 | 
											
										
											
												
													
														|  | @@ -468,8 +481,17 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
 | 
											
												
													
														|  |                  if (plusMills > 0L) {
 |  |                  if (plusMills > 0L) {
 | 
											
												
													
														|  |                      VipCardRecord addRecord = JSON.parseObject(JSON.toJSONString(vipCardRecord), VipCardRecord.class);
 |  |                      VipCardRecord addRecord = JSON.parseObject(JSON.toJSONString(vipCardRecord), VipCardRecord.class);
 | 
											
												
													
														|  |                      addRecord.setStatus(EVipRecordStatus.UPDATE);
 |  |                      addRecord.setStatus(EVipRecordStatus.UPDATE);
 | 
											
												
													
														|  | -                    addRecord.setStartTime(new Date(Math.max(vipCardRecord.getStartTime().getTime(), now.getTime()) + plusMills));
 |  | 
 | 
											
												
													
														|  | -                    addRecord.setEndTime(new Date(vipCardRecord.getEndTime().getTime() + plusMills));
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    long startTimeMills = Math.max(vipCardRecord.getStartTime().getTime(), now.getTime());
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                    Date startDate = new Date(startTimeMills + plusMills + 1000);
 | 
											
												
													
														|  | 
 |  | +                    Calendar instance = Calendar.getInstance();
 | 
											
												
													
														|  | 
 |  | +                    instance.setTime(startDate);
 | 
											
												
													
														|  | 
 |  | +                    instance.set(Calendar.SECOND, 0);
 | 
											
												
													
														|  | 
 |  | +                    instance.set(Calendar.MILLISECOND, 0);
 | 
											
												
													
														|  | 
 |  | +                    addRecord.setStartTime(instance.getTime());
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                    int days = (int) Math.ceil(plusMills * 1.0D / (24 * 60 * 60 * 1000));
 | 
											
												
													
														|  | 
 |  | +                    addRecord.setEndTime(plusDate(vipCardRecord.getEndTime(), PeriodEnum.DAY, days));
 | 
											
												
													
														|  |                      addRecord.setDisplayFlag(false);
 |  |                      addRecord.setDisplayFlag(false);
 | 
											
												
													
														|  |                      addRecord.setEfficientFlag(true);
 |  |                      addRecord.setEfficientFlag(true);
 | 
											
												
													
														|  |                      save(addRecord);
 |  |                      save(addRecord);
 | 
											
										
											
												
													
														|  | @@ -493,11 +515,19 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
 | 
											
												
													
														|  |                  .eq(VipCardRecord::getClientType, addVipCardRecord.getClientType())
 |  |                  .eq(VipCardRecord::getClientType, addVipCardRecord.getClientType())
 | 
											
												
													
														|  |                  .eq(VipCardRecord::getUserId, addVipCardRecord.getUserId())
 |  |                  .eq(VipCardRecord::getUserId, addVipCardRecord.getUserId())
 | 
											
												
													
														|  |                  .ge(VipCardRecord::getEndTime, new Date())
 |  |                  .ge(VipCardRecord::getEndTime, new Date())
 | 
											
												
													
														|  | -//                .eq(VipCardRecord::getDisplayFlag, false)
 |  | 
 | 
											
												
													
														|  |                  .eq(VipCardRecord::getEfficientFlag, true)
 |  |                  .eq(VipCardRecord::getEfficientFlag, true)
 | 
											
												
													
														|  | -                .list();
 |  | 
 | 
											
												
													
														|  | 
 |  | +                .list()
 | 
											
												
													
														|  | 
 |  | +                .stream()
 | 
											
												
													
														|  | 
 |  | +                .sorted(Comparator.comparing(VipCardRecord::getStartTime))
 | 
											
												
													
														|  | 
 |  | +                .collect(Collectors.toList());
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          // 当前类型的VIP
 |  |          // 当前类型的VIP
 | 
											
												
													
														|  | 
 |  | +        PeriodEnum period = addVipCardRecord.getType();
 | 
											
												
													
														|  | 
 |  | +        if (PeriodEnum.PERPETUAL.equals(period)) {
 | 
											
												
													
														|  | 
 |  | +            deductedSVipPerpetual(addVipCardRecord, vipCardRecordList);
 | 
											
												
													
														|  | 
 |  | +            return;
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          List<VipCardRecord> collect = vipCardRecordList.stream().filter(n -> n.getVipType().equals(addVipCardRecord.getVipType())).collect(Collectors.toList());
 |  |          List<VipCardRecord> collect = vipCardRecordList.stream().filter(n -> n.getVipType().equals(addVipCardRecord.getVipType())).collect(Collectors.toList());
 | 
											
												
													
														|  |          if (collect.isEmpty()) {
 |  |          if (collect.isEmpty()) {
 | 
											
												
													
														|  |              throw new BizException("剩余扣减数量不足");
 |  |              throw new BizException("剩余扣减数量不足");
 | 
											
										
											
												
													
														|  | @@ -511,7 +541,6 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          LocalDate maxEndTime = collect.stream().map(VipCardRecord::getEndTime).max(Comparator.naturalOrder()).get().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
 |  |          LocalDate maxEndTime = collect.stream().map(VipCardRecord::getEndTime).max(Comparator.naturalOrder()).get().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
 | 
											
												
													
														|  | -        PeriodEnum period = addVipCardRecord.getType();
 |  | 
 | 
											
												
													
														|  |          // 扣减后的开始时间
 |  |          // 扣减后的开始时间
 | 
											
												
													
														|  |          LocalDate deductedStartTime;
 |  |          LocalDate deductedStartTime;
 | 
											
												
													
														|  |          switch (period) {
 |  |          switch (period) {
 | 
											
										
											
												
													
														|  | @@ -532,7 +561,7 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
 | 
											
												
													
														|  |                  break;
 |  |                  break;
 | 
											
												
													
														|  |              case PERPETUAL:
 |  |              case PERPETUAL:
 | 
											
												
													
														|  |                  // 永久扣减
 |  |                  // 永久扣减
 | 
											
												
													
														|  | -                deductedPerpetual(addVipCardRecord, vipCardRecordList);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                deductedSVipPerpetual(addVipCardRecord, vipCardRecordList);
 | 
											
												
													
														|  |                  return;
 |  |                  return;
 | 
											
												
													
														|  |              default:
 |  |              default:
 | 
											
												
													
														|  |                  throw new BizException("不支持的扣减类型");
 |  |                  throw new BizException("不支持的扣减类型");
 | 
											
										
											
												
													
														|  | @@ -542,7 +571,7 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
 | 
											
												
													
														|  |          Date minStartTime = collect.stream().map(VipCardRecord::getStartTime).min(Comparator.naturalOrder()).get();
 |  |          Date minStartTime = collect.stream().map(VipCardRecord::getStartTime).min(Comparator.naturalOrder()).get();
 | 
											
												
													
														|  |          // 如果扣减的数量超过1天,则提示扣减数量不足
 |  |          // 如果扣减的数量超过1天,则提示扣减数量不足
 | 
											
												
													
														|  |          if (deductedStartDate.before(minStartTime)) {
 |  |          if (deductedStartDate.before(minStartTime)) {
 | 
											
												
													
														|  | -            double day = (minStartTime.getTime() - deductedStartDate.getTime()) * 1.0D / (24 * 60 * 60);
 |  | 
 | 
											
												
													
														|  | 
 |  | +            double day = (minStartTime.getTime() - deductedStartDate.getTime()) * 1.0D / (24 * 60 * 60 * 1000);
 | 
											
												
													
														|  |              if (day > 1.0D) {
 |  |              if (day > 1.0D) {
 | 
											
												
													
														|  |                  throw new BizException("剩余扣减数量不足");
 |  |                  throw new BizException("剩余扣减数量不足");
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
										
											
												
													
														|  | @@ -600,37 +629,48 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
 | 
											
												
													
														|  |          this.save(vipCardRecord);
 |  |          this.save(vipCardRecord);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -    // 扣减永久会员
 |  | 
 | 
											
												
													
														|  | -    private void deductedPerpetual(VipCardRecordWrapper.AddVipCardRecord addVipCardRecord, List<VipCardRecord> vipCardRecordList) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    // 扣减永久SVIP会员
 | 
											
												
													
														|  | 
 |  | +    private void deductedSVipPerpetual(VipCardRecordWrapper.AddVipCardRecord addVipCardRecord, List<VipCardRecord> vipCardRecordList) {
 | 
											
												
													
														|  | 
 |  | +        List<VipCardRecord> collect = vipCardRecordList.stream()
 | 
											
												
													
														|  | 
 |  | +                .filter(n -> n.getVipType().equals(addVipCardRecord.getVipType()) && n.getType().equals(PeriodEnum.PERPETUAL))
 | 
											
												
													
														|  | 
 |  | +                .collect(Collectors.toList());
 | 
											
												
													
														|  | 
 |  | +        if (collect.isEmpty()) {
 | 
											
												
													
														|  | 
 |  | +            throw new BizException("剩余扣减数量不足");
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        EVipType vipType = addVipCardRecord.getVipType();
 |  | 
 | 
											
												
													
														|  | 
 |  | +        // 最后一个非永久SVIP的结束时间
 | 
											
												
													
														|  | 
 |  | +        Date lastUnPereutalDate = new Date();
 | 
											
												
													
														|  |          long deductMills = 0L;
 |  |          long deductMills = 0L;
 | 
											
												
													
														|  | -        Date now = new Date();
 |  | 
 | 
											
												
													
														|  |          for (VipCardRecord vipCardRecord : vipCardRecordList) {
 |  |          for (VipCardRecord vipCardRecord : vipCardRecordList) {
 | 
											
												
													
														|  | -            Date startTime = vipCardRecord.getStartTime();
 |  | 
 | 
											
												
													
														|  | -            Date endTime = vipCardRecord.getEndTime();
 |  | 
 | 
											
												
													
														|  | 
 |  | +            if (EVipType.SVIP.equals(vipCardRecord.getVipType())) {
 | 
											
												
													
														|  | 
 |  | +                // 获取后续VIP向前平移的开始时间
 | 
											
												
													
														|  | 
 |  | +                if (!PeriodEnum.PERPETUAL.equals(vipCardRecord.getType())) {
 | 
											
												
													
														|  | 
 |  | +                    if (vipCardRecord.getEndTime().after(lastUnPereutalDate)) {
 | 
											
												
													
														|  | 
 |  | +                        lastUnPereutalDate = vipCardRecord.getEndTime();
 | 
											
												
													
														|  | 
 |  | +                    }
 | 
											
												
													
														|  | 
 |  | +                    continue;
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  | 
 |  | +                vipCardRecord.setEfficientFlag(false);
 | 
											
												
													
														|  | 
 |  | +                updateById(vipCardRecord);
 | 
											
												
													
														|  | 
 |  | +            } else {
 | 
											
												
													
														|  | 
 |  | +                deductMills += vipCardRecord.getStartTime().getTime() - lastUnPereutalDate.getTime();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                VipCardRecord newRecord = JSON.parseObject(JSON.toJSONString(vipCardRecord), VipCardRecord.class);
 | 
											
												
													
														|  | 
 |  | +                newRecord.setId(null);
 | 
											
												
													
														|  | 
 |  | +                newRecord.setDisplayFlag(false);
 | 
											
												
													
														|  | 
 |  | +                newRecord.setEfficientFlag(true);
 | 
											
												
													
														|  | 
 |  | +                newRecord.setStartTime(new Date(newRecord.getStartTime().getTime() - deductMills));
 | 
											
												
													
														|  | 
 |  | +                newRecord.setEndTime(new Date(newRecord.getEndTime().getTime() - deductMills));
 | 
											
												
													
														|  | 
 |  | +                save(newRecord);
 | 
											
												
													
														|  | 
 |  | +                Long refId = newRecord.getId();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -            if (vipCardRecord.getVipType().equals(vipType)) {
 |  | 
 | 
											
												
													
														|  | -                deductMills += endTime.getTime() - Math.max(startTime.getTime(), now.getTime());
 |  | 
 | 
											
												
													
														|  |                  VipCardRecord updateRecord = JSON.parseObject(JSON.toJSONString(vipCardRecord), VipCardRecord.class);
 |  |                  VipCardRecord updateRecord = JSON.parseObject(JSON.toJSONString(vipCardRecord), VipCardRecord.class);
 | 
											
												
													
														|  |                  updateRecord.setEfficientFlag(false);
 |  |                  updateRecord.setEfficientFlag(false);
 | 
											
												
													
														|  | 
 |  | +                updateRecord.setRefId(refId);
 | 
											
												
													
														|  |                  updateById(updateRecord);
 |  |                  updateById(updateRecord);
 | 
											
												
													
														|  | -            } else if (deductMills > 0L) {
 |  | 
 | 
											
												
													
														|  | -                    VipCardRecord newRecord = JSON.parseObject(JSON.toJSONString(vipCardRecord), VipCardRecord.class);
 |  | 
 | 
											
												
													
														|  | -                    newRecord.setId(null);
 |  | 
 | 
											
												
													
														|  | -                    newRecord.setDisplayFlag(false);
 |  | 
 | 
											
												
													
														|  | -                    newRecord.setEfficientFlag(true);
 |  | 
 | 
											
												
													
														|  | -                    newRecord.setStartTime(new Date(newRecord.getStartTime().getTime() - deductMills));
 |  | 
 | 
											
												
													
														|  | -                    newRecord.setEndTime(new Date(newRecord.getEndTime().getTime() - deductMills));
 |  | 
 | 
											
												
													
														|  | -                    save(newRecord);
 |  | 
 | 
											
												
													
														|  | -                    Long refId = newRecord.getId();
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                    VipCardRecord updateRecord = JSON.parseObject(JSON.toJSONString(vipCardRecord), VipCardRecord.class);
 |  | 
 | 
											
												
													
														|  | -                    updateRecord.setEfficientFlag(false);
 |  | 
 | 
											
												
													
														|  | -                    updateRecord.setRefId(refId);
 |  | 
 | 
											
												
													
														|  | -                    updateById(updateRecord);
 |  | 
 | 
											
												
													
														|  | -                }
 |  | 
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  |          VipCardRecord vipCardRecord = JSON.parseObject(JSON.toJSONString(addVipCardRecord), VipCardRecord.class);
 |  |          VipCardRecord vipCardRecord = JSON.parseObject(JSON.toJSONString(addVipCardRecord), VipCardRecord.class);
 | 
											
												
													
														|  |          vipCardRecord.setDisplayFlag(true);
 |  |          vipCardRecord.setDisplayFlag(true);
 | 
											
												
													
														|  |          vipCardRecord.setEfficientFlag(false);
 |  |          vipCardRecord.setEfficientFlag(false);
 | 
											
										
											
												
													
														|  | @@ -665,7 +705,9 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
 | 
											
												
													
														|  |                  end = localDateTimeMaxTime.plusYears(times);
 |  |                  end = localDateTimeMaxTime.plusYears(times);
 | 
											
												
													
														|  |                  break;
 |  |                  break;
 | 
											
												
													
														|  |              case PERPETUAL:
 |  |              case PERPETUAL:
 | 
											
												
													
														|  | -                return null;
 |  | 
 | 
											
												
													
														|  | 
 |  | +                // 永久默认给100年
 | 
											
												
													
														|  | 
 |  | +                end = localDateTimeMaxTime.plusYears(100);
 | 
											
												
													
														|  | 
 |  | +                break;
 | 
											
												
													
														|  |              default:
 |  |              default:
 | 
											
												
													
														|  |                  throw new BizException("不支持的扣减类型");
 |  |                  throw new BizException("不支持的扣减类型");
 | 
											
												
													
														|  |          }
 |  |          }
 |