|
|
@@ -7,9 +7,9 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
import cn.hutool.http.HttpResponse;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
-import com.cyksj.common.constant.Constant;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.util.Jsons;
|
|
|
+import com.cyksj.common.util.StringUtil;
|
|
|
import com.cyksj.common.util.TicketCodeCommonUtil;
|
|
|
import com.cyksj.mapper.CuiQiuEmailConfigMapper;
|
|
|
import com.cyksj.model.dto.CuiQiuEmailDetailDto;
|
|
|
@@ -26,7 +26,6 @@ import javax.annotation.PostConstruct;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 项目名: yhlxj2
|
|
|
@@ -78,7 +77,7 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
|
|
|
params.put("mail_id", mailId);
|
|
|
params.put("start_time", DateUtil.offsetDay(now, -1).toDateStr());
|
|
|
params.put("end_time", DateUtil.offsetDay(now, 1).toDateStr());
|
|
|
-// params.put("to", email);
|
|
|
+ params.put("to", email);
|
|
|
params.put("limit", 10);
|
|
|
|
|
|
HttpRequest post = HttpUtil.createPost(url);
|
|
|
@@ -90,29 +89,29 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
|
|
|
}
|
|
|
List<CuiQiuEmailDto> list = resultDto.getData().getList();
|
|
|
//获取邮箱对应的邮件
|
|
|
- list = list.stream().filter(emailInfo -> {
|
|
|
- CuiQiuEmailDto.CuiQiuUser from = emailInfo.getFrom().get(0);
|
|
|
- CuiQiuEmailDto.CuiQiuUser to = emailInfo.getTo().get(0);
|
|
|
- CuiQiuEmailDto.CuiQiuUser cuiQiuUser = emailInfo.getTo().get(0);
|
|
|
- if (StrUtil.equalsIgnoreCase(cuiQiuUser.getAddress(), email)) {
|
|
|
- String toEmail = to.getAddress();
|
|
|
- //通过直达邮件判断
|
|
|
- if (StrUtil.equals(toEmail, email) || StrUtil.equals(toEmail, relateEmail)) {
|
|
|
- //PS
|
|
|
- if (Constant.PS_GIDS.contains(goodsId) && from.getName().contains(Constant.PS_ADOBE)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- //Disney
|
|
|
- if (goodsId == Constant.DISNEY_GID && from.getName().contains(Constant.DISNEY)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- if (goodsId == Constant.NETFLIX_GID && from.getName().contains(Constant.NETFLIX)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }).collect(Collectors.toList());
|
|
|
+// list = list.stream().filter(emailInfo -> {
|
|
|
+// CuiQiuEmailDto.CuiQiuUser from = emailInfo.getFrom().get(0);
|
|
|
+// CuiQiuEmailDto.CuiQiuUser to = emailInfo.getTo().get(0);
|
|
|
+// CuiQiuEmailDto.CuiQiuUser cuiQiuUser = emailInfo.getTo().get(0);
|
|
|
+// if (StrUtil.equalsIgnoreCase(cuiQiuUser.getAddress(), email)) {
|
|
|
+// String toEmail = to.getAddress();
|
|
|
+// //通过直达邮件判断
|
|
|
+// if (StrUtil.equals(toEmail, email) || StrUtil.equals(toEmail, relateEmail)) {
|
|
|
+// //PS
|
|
|
+// if (Constant.PS_GIDS.contains(goodsId) && from.getName().contains(Constant.PS_ADOBE)) {
|
|
|
+// return true;
|
|
|
+// }
|
|
|
+// //Disney
|
|
|
+// if (goodsId == Constant.DISNEY_GID && from.getName().contains(Constant.DISNEY)) {
|
|
|
+// return true;
|
|
|
+// }
|
|
|
+// if (goodsId == Constant.NETFLIX_GID && from.getName().contains(Constant.NETFLIX)) {
|
|
|
+// return true;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return false;
|
|
|
+// }).collect(Collectors.toList());
|
|
|
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
for (CuiQiuEmailDto CuiQiuEmailDto : list) {
|
|
|
@@ -161,10 +160,15 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
|
|
|
if (StrUtil.isEmpty(code)) {
|
|
|
code = StrUtil.subAfter(body, "Enter this code to sign in", true);
|
|
|
}
|
|
|
+ if (StrUtil.isEmpty(code)) {
|
|
|
+ code = StrUtil.subAfter(body, "font-weight: 400; color: #232323; padding-top: 20px;", true);
|
|
|
+ }
|
|
|
}
|
|
|
if (StrUtil.isEmpty(code)) {
|
|
|
throw BusinessRuntimeException.getInstance("查询失败,请检查是否发送了登陆码..");
|
|
|
}
|
|
|
+ int length = 4;
|
|
|
+ return StringUtil.getVerifyCodePattern(code, length);
|
|
|
} else {
|
|
|
String urlPref;
|
|
|
String nfVerifyUrl;
|