|
|
@@ -1957,6 +1957,35 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
return ticketRenewUpgradeView;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void netflixSubmitFrozen(ErrorNetflixChangeReq req) {
|
|
|
+ Long relationId = req.getRelationId();
|
|
|
+ Long userId = req.getUserId();
|
|
|
+ //校验奈飞账号状态
|
|
|
+ GroupsRelationView netflixRelationView = checkNetflixErrorStatus(relationId, userId);
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ Integer recoverCount = netflixUserAccountSubmitRecoverRecordMapper.selectCount(Wrappers.lambdaQuery(NetflixUserAccountSubmitRecoverRecord.class)
|
|
|
+ .eq(NetflixUserAccountSubmitRecoverRecord::getRelationId, relationId)
|
|
|
+ .in(NetflixUserAccountSubmitRecoverRecord::getUserId, userIdList)
|
|
|
+ .eq(NetflixUserAccountSubmitRecoverRecord::getStatus, 0));
|
|
|
+ if (recoverCount > 0) {
|
|
|
+ throw BusinessRuntimeException.getInstance("你已申请恢复账号,无法再申请冻结");
|
|
|
+ }
|
|
|
+ if (netflixRelationView.getIsFrozen()) {
|
|
|
+ throw BusinessRuntimeException.getInstance("你已申请冻结,无法再申请冻结");
|
|
|
+ }
|
|
|
+ Date expiryTime = netflixRelationView.getExpiryTime();
|
|
|
+ //保留天数
|
|
|
+ Long betweenDay = DateUtil.betweenDay(DateTime.now(), expiryTime, false) + 1;
|
|
|
+ groupsRelationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class)
|
|
|
+ .set(GroupsRelation::getIsFrozen, Boolean.TRUE)
|
|
|
+ //冻结2个月
|
|
|
+ .set(GroupsRelation::getUnfrozenTime, DateUtil.offsetMonth(DateTime.now(), 2))
|
|
|
+ .set(GroupsRelation::getReservedDays, betweenDay)
|
|
|
+ .eq(GroupsRelation::getId, netflixRelationView.getId())
|
|
|
+ .eq(GroupsRelation::getUserId, netflixRelationView.getUserId()));
|
|
|
+ }
|
|
|
+
|
|
|
private DistributePosterGoodsDetailView setGoodsPoster(RenewalView ticket, User user, List<Long> userIds) {
|
|
|
DistributePosterGoodsDetailView distributePosterGoodsDetailView = beanSearcher.searchFirst(DistributePosterGoodsDetailView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
.field(DistributePosterGoodsFrontView::getGoodsId, ticket.getGoodsId()).build());
|
|
|
@@ -2228,10 +2257,18 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
.field(GroupsRelationView::getId, relationId)
|
|
|
.field(GroupsRelationView::getUserId, userIdList).op(Operator.InList)
|
|
|
.field(GroupsRelationView::getGoodsId, Constant.NETFLIX_GID)
|
|
|
- .field(GroupsRelationView::getExpiryTime, DateTime.now()).op(Operator.GreaterThan)
|
|
|
.build());
|
|
|
if (netflixRelationView == null) {
|
|
|
- throw BusinessRuntimeException.getInstance("奈飞车票已过期");
|
|
|
+ if (netflixRelationView.getIsFrozen() && netflixRelationView.getUnfrozenTime().after(DateTime.now())) {
|
|
|
+ throw BusinessRuntimeException.getInstance("冻结未结束");
|
|
|
+ }
|
|
|
+ if (netflixRelationView.getIsFrozen()) {
|
|
|
+ //重新设置车票时长
|
|
|
+ netflixRelationView.setExpiryTime(DateUtil.offsetDay(DateTime.now(), netflixRelationView.getReservedDays()));
|
|
|
+ }
|
|
|
+ if (netflixRelationView.getExpiryTime().before(DateTime.now())) {
|
|
|
+ throw BusinessRuntimeException.getInstance("奈飞车票已过期");
|
|
|
+ }
|
|
|
}
|
|
|
netflixRelationView.setNfCheckId(netflixUseAccountStatusRecord.getId());
|
|
|
netflixRelationView.setNfOriOrderId(netflixUseAccountStatusRecord.getOrderId());
|