|
@@ -25,6 +25,7 @@ import com.cyksj.mapper.manage.distribute.UserPlatSkuDistributeRateMapper;
|
|
|
import com.cyksj.mapper.renew.RenewUpgradePackageMapper;
|
|
import com.cyksj.mapper.renew.RenewUpgradePackageMapper;
|
|
|
import com.cyksj.mapper.sys.SysEmailMapper;
|
|
import com.cyksj.mapper.sys.SysEmailMapper;
|
|
|
import com.cyksj.model.entity.*;
|
|
import com.cyksj.model.entity.*;
|
|
|
|
|
+import com.cyksj.model.manage.views.AccountView;
|
|
|
import com.cyksj.model.request.SpecialGoodsTicketReq;
|
|
import com.cyksj.model.request.SpecialGoodsTicketReq;
|
|
|
import com.cyksj.model.request.TicketLoginReq;
|
|
import com.cyksj.model.request.TicketLoginReq;
|
|
|
import com.cyksj.model.views.*;
|
|
import com.cyksj.model.views.*;
|
|
@@ -52,6 +53,7 @@ import com.ejlchina.searcher.util.MapUtils;
|
|
|
import com.github.rholder.retry.*;
|
|
import com.github.rholder.retry.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.springframework.dao.DuplicateKeyException;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
@@ -160,6 +162,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
|
|
|
|
|
private final GroupsRelationChangeService changeTickerRelation;
|
|
private final GroupsRelationChangeService changeTickerRelation;
|
|
|
|
|
|
|
|
|
|
+ private final NetflixTempAccountUserMapper netflixTempAccountUserMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public SearchResult<RenewalView> getMyTicket(long userId, Boolean isLoginPopularize, String customId, String account, String orderNo) {
|
|
public SearchResult<RenewalView> getMyTicket(long userId, Boolean isLoginPopularize, String customId, String account, String orderNo) {
|
|
|
User u = userMapper.selectById(userId);
|
|
User u = userMapper.selectById(userId);
|
|
@@ -1034,6 +1038,38 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public AccountView getTempAccount(long userId, Long relationId) {
|
|
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
|
|
+ RenewalView renewalView = beanSearcher.searchFirst(RenewalView.class, MapUtils.builder()
|
|
|
|
|
+ .field(RenewalView::getRelationId, relationId)
|
|
|
|
|
+ .field(RenewalView::getUserId, userIdList).op(Operator.InList)
|
|
|
|
|
+ .field(RenewalView::getExpiryTime, DateTime.now()).op(Operator.GreaterThan)
|
|
|
|
|
+ .build());
|
|
|
|
|
+ if (renewalView == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("车票不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ NetflixTempAccountUser netflixTempAccountUser = netflixTempAccountUserMapper.selectOne(Wrappers.lambdaQuery(NetflixTempAccountUser.class)
|
|
|
|
|
+ .eq(NetflixTempAccountUser::getRelationId, relationId)
|
|
|
|
|
+ .in(NetflixTempAccountUser::getUserId, userIdList)
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ AccountView accountView = new AccountView();
|
|
|
|
|
+ Account account;
|
|
|
|
|
+ if (netflixTempAccountUser == null) {
|
|
|
|
|
+ account = accountMapper.selectNetflixTempAccount();
|
|
|
|
|
+ netflixTempAccountUser = new NetflixTempAccountUser();
|
|
|
|
|
+ netflixTempAccountUser.setAccountId(account.getId());
|
|
|
|
|
+ netflixTempAccountUser.setRelationId(relationId);
|
|
|
|
|
+ netflixTempAccountUser.setUserId(renewalView.getUserId());
|
|
|
|
|
+ netflixTempAccountUserMapper.insert(netflixTempAccountUser);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ account = accountMapper.selectById(netflixTempAccountUser.getAccountId());
|
|
|
|
|
+ }
|
|
|
|
|
+ accountView.setAccount(account.getAccount());
|
|
|
|
|
+ accountView.setPassword(account.getPassword());
|
|
|
|
|
+ return accountView;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private DistributePosterGoodsDetailView setGoodsPoster(RenewalView ticket, User user, List<Long> userIds) {
|
|
private DistributePosterGoodsDetailView setGoodsPoster(RenewalView ticket, User user, List<Long> userIds) {
|
|
|
DistributePosterGoodsDetailView distributePosterGoodsDetailView = beanSearcher.searchFirst(DistributePosterGoodsDetailView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
DistributePosterGoodsDetailView distributePosterGoodsDetailView = beanSearcher.searchFirst(DistributePosterGoodsDetailView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
.field(DistributePosterGoodsFrontView::getGoodsId, ticket.getGoodsId()).build());
|
|
.field(DistributePosterGoodsFrontView::getGoodsId, ticket.getGoodsId()).build());
|