|
|
@@ -1,5 +1,6 @@
|
|
|
package com.cyksj.service.relation.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.date.BetweenFormater;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
@@ -17,6 +18,7 @@ import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
|
|
|
import com.cyksj.common.util.Jsons;
|
|
|
import com.cyksj.common.util.StringUtil;
|
|
|
+import com.cyksj.common.util.TicketCodeCommonUtil;
|
|
|
import com.cyksj.enums.GatewayApiCode;
|
|
|
import com.cyksj.mapper.*;
|
|
|
import com.cyksj.mapper.sys.SysEmailMapper;
|
|
|
@@ -29,8 +31,8 @@ import com.cyksj.service.groups.GroupsFuncService;
|
|
|
import com.cyksj.service.mail.CuiQiuMailService;
|
|
|
import com.cyksj.service.mail.MailService;
|
|
|
import com.cyksj.service.mange.coupon.CouponCommonService;
|
|
|
+import com.cyksj.service.midjourney.MidjourneyAccountService;
|
|
|
import com.cyksj.service.relation.GroupRelationFrontService;
|
|
|
-import com.cyksj.service.shop.YhShopFrontService;
|
|
|
import com.cyksj.service.user.UserBindRelationService;
|
|
|
import com.cyksj.service.user.UserLoginRecordService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
@@ -83,7 +85,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
|
|
|
private final OrderDonMapper orderDonMapper;
|
|
|
|
|
|
- private final YhShopFrontService yhShopFrontService;
|
|
|
+ private final GroupsRelationExpiryNotifyRecordMapper groupsRelationExpiryNotifyRecordMapper;
|
|
|
|
|
|
private final HttpServletRequest request;
|
|
|
|
|
|
@@ -107,6 +109,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
|
|
|
private final UserCertRecordMapper userCertRecordMapper;
|
|
|
|
|
|
+ private final MidjourneyAccountService midjourneyAccountService;
|
|
|
+
|
|
|
//脆球邮箱后缀
|
|
|
private final static String CUI_QIU_EMAIL_SUFFIX = "@kindvd.com";
|
|
|
private final UpgradePackageMapper upgradePackageMapper;
|
|
|
@@ -247,6 +251,20 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
Integer codeNum = getUserCodeNumBySkuId(ticket.getUserId(), ticket.getSkuId(), isHasVerifyCode);
|
|
|
ticket.setCodeNum(codeNum);
|
|
|
}
|
|
|
+ if (ticket.getGoodsId() == 26l) {
|
|
|
+ MidjourneyUserView search = beanSearcher.searchFirst(MidjourneyUserView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
+ .field(MidjourneyUserView::getUserId, ticket.getUserId()).field(MidjourneyUserView::getRelationId, ticket.getRelationId())
|
|
|
+ .onlySelect(MidjourneyUserView::getMjFastNum, MidjourneyUserView::getMjRelaxNum)
|
|
|
+ .build());
|
|
|
+ if (search == null) {
|
|
|
+ MidjourneyUser midjourneyUser = midjourneyAccountService.getMidjourneyUserToken(ticket.getUserId(), ticket.getRelationId());
|
|
|
+ ticket.setMjUserFastNum(midjourneyUser.getMjFastNum());
|
|
|
+ ticket.setMjUserRelaxNum(midjourneyUser.getMjRelaxNum());
|
|
|
+ } else {
|
|
|
+ ticket.setMjUserFastNum(search.getMjFastNum());
|
|
|
+ ticket.setMjUserRelaxNum(search.getMjRelaxNum());
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
userLoginRecordService.saveUserLoginDayRecord(userId);
|
|
|
return list;
|
|
|
@@ -465,8 +483,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
if (StrUtil.hasEmpty(account, password)) {
|
|
|
throw BusinessRuntimeException.getInstance("您的车票账号密码异常,请联系客服...");
|
|
|
}
|
|
|
- if (renewalView.getGoodsId() == 33l && renewalView.getAccount().contains(CUI_QIU_EMAIL_SUFFIX)) {
|
|
|
- return cuiQiuMailService.getVerifyCode(renewalView.getAccount());
|
|
|
+ if (renewalView.getAccount().contains(CUI_QIU_EMAIL_SUFFIX)) {
|
|
|
+ return cuiQiuMailService.getVerifyCode(renewalView.getAccount(), renewalView.getGoodsId());
|
|
|
}
|
|
|
//获取邮箱密码
|
|
|
SysEmail sysEmail = sysEmailMapper.selectOne(Wrappers.lambdaQuery(SysEmail.class)
|
|
|
@@ -653,7 +671,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
List<RenewalView> list = beanSearcher.searchAll(RenewalView.class, builder
|
|
|
.field(RenewalView::getUserId, 0).op(Operator.GreaterThan)
|
|
|
.field(RenewalView::getUserId, userIds).op(Operator.InList)
|
|
|
- .field("condition", String.format("(gr.expiry_time is null or gr.expiry_time > '%s')", now))
|
|
|
+ .field(RenewalView::getExpiryTime, now).op(Operator.GreaterThan)
|
|
|
.field(RenewalView::getStatus, List.of("validity", "overdue", "outside")).op(Operator.InList)
|
|
|
.orderBy(RenewalView::getExpiryTime).asc()
|
|
|
.onlySelect(RenewalView::getMonths, RenewalView::getExpiryTime, RenewalView::getRelationId, RenewalView::getAccount, RenewalView::getGoodsId, RenewalView::getTitle, RenewalView::getLogo, RenewalView::getImg, RenewalView::getGroupId, RenewalView::getSkuId, RenewalView::getSpecVal, RenewalView::getGoodsStatus, RenewalView::getSkuStatus)
|
|
|
@@ -685,6 +703,9 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
return false;
|
|
|
}).collect(Collectors.toList());
|
|
|
redisService.setNx(RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getNameFormat(thisDate, userId), userId, RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getTimeout());
|
|
|
+ if (CollUtil.isNotEmpty(expiryTickets)) {
|
|
|
+ groupsRelationExpiryNotifyRecordMapper.batchInsert(userId, expiryTickets);
|
|
|
+ }
|
|
|
return expiryTickets;
|
|
|
}
|
|
|
|
|
|
@@ -712,19 +733,14 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
throw BusinessRuntimeException.getInstance("查询失败,请检查是否发送了登陆码..");
|
|
|
}
|
|
|
}
|
|
|
- //迪士尼
|
|
|
- if (goodsId == 3) {
|
|
|
- int index = body.indexOf("otp_code");
|
|
|
- if (index == -1) {
|
|
|
- index = body.indexOf(" 15 ");
|
|
|
- }
|
|
|
- code = StrUtil.subWithLength(body, index, 215);
|
|
|
+ if (StrUtil.isEmpty(code)) {
|
|
|
+ code = TicketCodeCommonUtil.getTicketCodeStr(body, goodsId);
|
|
|
}
|
|
|
- //PS
|
|
|
+ int length = 4;
|
|
|
if (goodsId == 33l) {
|
|
|
- code = StrUtil.subWithLength(body, body.indexOf("ADOBE"), 215);
|
|
|
+ length = 6;
|
|
|
}
|
|
|
- code = StringUtil.getVerifyCodePattern(code);
|
|
|
+ code = StringUtil.getVerifyCodePattern(code, length);
|
|
|
if (!Validator.isNumber(code)) {
|
|
|
log.error("获取账号验证码失败:{}", StrUtil.subSufByLength(code, 512));
|
|
|
throw BusinessRuntimeException.getInstance("获取验证码失败,请重新获取..");
|