|
|
@@ -28,6 +28,7 @@ import com.cyksj.mapper.manage.distribute.UserPlatSkuDistributeRateMapper;
|
|
|
import com.cyksj.mapper.sys.SysEmailMapper;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.request.SpecialGoodsTicketReq;
|
|
|
+import com.cyksj.model.request.TicketLoginReq;
|
|
|
import com.cyksj.model.views.*;
|
|
|
import com.cyksj.redis.RedisService;
|
|
|
import com.cyksj.service.chatgpt.ChatGptAccountService;
|
|
|
@@ -515,7 +516,11 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String getAiVerifyCode(Long userId, Long relationId, Integer type, Boolean sync) throws Exception {
|
|
|
+ public String getAiVerifyCode(TicketLoginReq loginReq) throws Exception {
|
|
|
+ Long userId = loginReq.getUserId();
|
|
|
+ Long relationId = loginReq.getRelationId();
|
|
|
+ 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());
|
|
|
@@ -876,6 +881,48 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
return renewalView;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public GroupsRelation ticketLogin(TicketLoginReq loginReq) {
|
|
|
+ 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("Please enter the correct account information");
|
|
|
+ }
|
|
|
+ throw BusinessRuntimeException.getInstance("请输入正确的账号信息");
|
|
|
+ }
|
|
|
+ return relation;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String outsideTicketVerify(TicketLoginReq loginReq) {
|
|
|
+ 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");
|
|
|
+ }
|
|
|
+ throw BusinessRuntimeException.getInstance("该账号已失效");
|
|
|
+ }
|
|
|
+ loginReq.setUserId(relation.getUserId());
|
|
|
+ try {
|
|
|
+ return getAiVerifyCode(loginReq);
|
|
|
+ } catch (Exception e) {
|
|
|
+ if (StrUtil.equals(loginReq.getLang(), Constant.EN_US)) {
|
|
|
+ throw BusinessRuntimeException.getInstance("Please verify that the link was sent");
|
|
|
+ }
|
|
|
+ throw BusinessRuntimeException.getInstance("请校验链接是否已发送");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private DistributePosterGoodsDetailView setGoodsPoster(RenewalView ticket, User user) {
|
|
|
DistributePosterGoodsDetailView distributePosterGoodsDetailView = beanSearcher.searchFirst(DistributePosterGoodsDetailView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
.field(DistributePosterGoodsFrontView::getGoodsId, ticket.getGoodsId()).build());
|