|
@@ -152,7 +152,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
|
|
|
|
|
private final OrderDonRenewRecordMapper orderDonRenewRecordMapper;
|
|
private final OrderDonRenewRecordMapper orderDonRenewRecordMapper;
|
|
|
|
|
|
|
|
- private final UpgradeOrderDonMapper upgradeOrderDonMapper;
|
|
|
|
|
|
|
+ private final AccountMapper accountMapper;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public SearchResult<RenewalView> getMyTicket(long userId, Boolean isLoginPopularize, String customId, String account) {
|
|
public SearchResult<RenewalView> getMyTicket(long userId, Boolean isLoginPopularize, String customId, String account) {
|
|
@@ -496,23 +496,40 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String getAiVerifyCode(TicketLoginReq loginReq) throws Exception {
|
|
public String getAiVerifyCode(TicketLoginReq loginReq) throws Exception {
|
|
|
- Long userId = loginReq.getUserId();
|
|
|
|
|
- Long relationId = loginReq.getRelationId();
|
|
|
|
|
Integer type = loginReq.getType();
|
|
Integer type = loginReq.getType();
|
|
|
- Boolean sync = loginReq.getSync();
|
|
|
|
|
- List<Long> relationUserIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
|
|
- RenewalView renewalView = beanSearcher.searchFirst(RenewalView.class, MapUtils.builder().field(RenewalView::getUserId, relationUserIdList).op(Operator.InList)
|
|
|
|
|
- .field(RenewalView::getRelationId, relationId).build());
|
|
|
|
|
- if (renewalView == null) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("您的车票不存在...");
|
|
|
|
|
- }
|
|
|
|
|
- if (StrUtil.isEmpty(renewalView.getAccount())) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("车票未配置账号");
|
|
|
|
|
- }
|
|
|
|
|
- String account = renewalView.getAccount();
|
|
|
|
|
- String password = renewalView.getPassword();
|
|
|
|
|
- if (StrUtil.hasEmpty(account, password)) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("您的车票账号密码异常,请联系客服...");
|
|
|
|
|
|
|
+ RenewalView renewalView;
|
|
|
|
|
+ String account;
|
|
|
|
|
+ Long userId = 0l;
|
|
|
|
|
+ Long relationId = 0l;
|
|
|
|
|
+ if (loginReq.getMerchants()) {
|
|
|
|
|
+ renewalView = new RenewalView();
|
|
|
|
|
+ renewalView.setGoodsId(loginReq.getGoodsId());
|
|
|
|
|
+ renewalView.setAccount(loginReq.getAccount());
|
|
|
|
|
+ GroupsTrips groupsTrips = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
|
|
|
|
|
+ .eq(GroupsTrips::getAccountId, loginReq.getAccountId())
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ if (groupsTrips != null) {
|
|
|
|
|
+ renewalView.setSkuId(groupsTrips.getSkuId());
|
|
|
|
|
+ }
|
|
|
|
|
+ renewalView.setUserId(userId);
|
|
|
|
|
+ account = loginReq.getAccount();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ userId = loginReq.getUserId();
|
|
|
|
|
+ relationId = loginReq.getRelationId();
|
|
|
|
|
+ List<Long> relationUserIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
|
|
+ renewalView = beanSearcher.searchFirst(RenewalView.class, MapUtils.builder().field(RenewalView::getUserId, relationUserIdList).op(Operator.InList)
|
|
|
|
|
+ .field(RenewalView::getRelationId, relationId).build());
|
|
|
|
|
+ if (renewalView == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("您的车票不存在...");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StrUtil.isEmpty(renewalView.getAccount())) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("车票未配置账号");
|
|
|
|
|
+ }
|
|
|
|
|
+ account = renewalView.getAccount();
|
|
|
|
|
+ String password = renewalView.getPassword();
|
|
|
|
|
+ if (StrUtil.hasEmpty(account, password)) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("您的车票账号密码异常,请联系客服...");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (renewalView.getGoodsId() == 1l) {
|
|
if (renewalView.getGoodsId() == 1l) {
|
|
|
Integer linkType = loginReq.getLinkType();
|
|
Integer linkType = loginReq.getLinkType();
|
|
@@ -810,6 +827,18 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
@Override
|
|
@Override
|
|
|
public GroupsRelation ticketLogin(TicketLoginReq loginReq) {
|
|
public GroupsRelation ticketLogin(TicketLoginReq loginReq) {
|
|
|
String account = loginReq.getAccount();
|
|
String account = loginReq.getAccount();
|
|
|
|
|
+ if (loginReq.getMerchants()) {
|
|
|
|
|
+ Account dbAccount = accountMapper.selectOne(Wrappers.lambdaQuery(Account.class)
|
|
|
|
|
+ .eq(Account::getAccount, account)
|
|
|
|
|
+ .eq(Account::getGoodsId, Constant.YH_EMAIL_VERIFY_OUTSIDE_CODE_GIDS.get(0))
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ if (dbAccount == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("账号错误,请联系客服");
|
|
|
|
|
+ }
|
|
|
|
|
+ GroupsRelation relation = new GroupsRelation();
|
|
|
|
|
+ relation.setId(0l);
|
|
|
|
|
+ return relation;
|
|
|
|
|
+ }
|
|
|
String password = loginReq.getPassword();
|
|
String password = loginReq.getPassword();
|
|
|
Integer num = loginReq.getNum();
|
|
Integer num = loginReq.getNum();
|
|
|
Long goodsId = Optional.ofNullable(loginReq.getGoodsId()).orElse(1l);
|
|
Long goodsId = Optional.ofNullable(loginReq.getGoodsId()).orElse(1l);
|
|
@@ -827,20 +856,32 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
@Override
|
|
@Override
|
|
|
public String outsideTicketVerify(TicketLoginReq loginReq) {
|
|
public String outsideTicketVerify(TicketLoginReq loginReq) {
|
|
|
String account = loginReq.getAccount();
|
|
String account = loginReq.getAccount();
|
|
|
- String password = loginReq.getPassword();
|
|
|
|
|
- Integer num = loginReq.getNum();
|
|
|
|
|
- Long goodsId = Optional.ofNullable(loginReq.getGoodsId()).orElse(1l);
|
|
|
|
|
- GroupsRelation relation = groupsRelationMapper.selectRelationByAccountAndNum(account, password, goodsId, num);
|
|
|
|
|
- if (relation == null) {
|
|
|
|
|
- log.info("外部入口使用账号account:{},pwd:{},座位num:{}同步验证链接失败...", account, password, num);
|
|
|
|
|
- if (StrUtil.equals(loginReq.getLang(), Constant.EN_US)) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("This account is no longer valid");
|
|
|
|
|
|
|
+ if (loginReq.getMerchants()) {
|
|
|
|
|
+ Account dbAccount = accountMapper.selectOne(Wrappers.lambdaQuery(Account.class)
|
|
|
|
|
+ .eq(Account::getAccount, account)
|
|
|
|
|
+ .eq(Account::getGoodsId, Constant.YH_EMAIL_VERIFY_OUTSIDE_CODE_GIDS.get(0))
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ if (dbAccount == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("账号错误,请联系客服");
|
|
|
|
|
+ }
|
|
|
|
|
+ loginReq.setGoodsId(dbAccount.getGoodsId());
|
|
|
|
|
+ loginReq.setAccountId(dbAccount.getId());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ String password = loginReq.getPassword();
|
|
|
|
|
+ Integer num = loginReq.getNum();
|
|
|
|
|
+ Long goodsId = Optional.ofNullable(loginReq.getGoodsId()).orElse(1l);
|
|
|
|
|
+ GroupsRelation relation = groupsRelationMapper.selectRelationByAccountAndNum(account, password, goodsId, num);
|
|
|
|
|
+ if (relation == null) {
|
|
|
|
|
+ log.info("外部入口使用账号account:{},pwd:{},座位num:{}同步验证链接失败...", account, password, num);
|
|
|
|
|
+ if (StrUtil.equals(loginReq.getLang(), Constant.EN_US)) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("This account is no longer valid");
|
|
|
|
|
+ }
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("该账号已失效");
|
|
|
}
|
|
}
|
|
|
- throw BusinessRuntimeException.getInstance("该账号已失效");
|
|
|
|
|
|
|
+ loginReq.setUserId(relation.getUserId());
|
|
|
|
|
+ loginReq.setRelationId(relation.getId());
|
|
|
|
|
+ loginReq.setGoodsId(goodsId);
|
|
|
}
|
|
}
|
|
|
- loginReq.setUserId(relation.getUserId());
|
|
|
|
|
- loginReq.setRelationId(relation.getId());
|
|
|
|
|
- loginReq.setGoodsId(goodsId);
|
|
|
|
|
try {
|
|
try {
|
|
|
String aiVerifyCode = getAiVerifyCode(loginReq);
|
|
String aiVerifyCode = getAiVerifyCode(loginReq);
|
|
|
if (StrUtil.isEmpty(aiVerifyCode)) {
|
|
if (StrUtil.isEmpty(aiVerifyCode)) {
|