|
@@ -3,6 +3,7 @@ package com.ydtech.modules.order.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
+import com.ydtech.constants.InsuranceEnum;
|
|
|
import com.ydtech.constants.enums.InsurKind;
|
|
import com.ydtech.constants.enums.InsurKind;
|
|
|
import com.ydtech.constants.enums.InsuranceOrderPdf;
|
|
import com.ydtech.constants.enums.InsuranceOrderPdf;
|
|
|
import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
@@ -22,7 +23,6 @@ import com.ydtech.modules.order.entity.crawler.constants.CrawlerVerifyPaymentCon
|
|
|
import com.ydtech.modules.order.entity.crawler.request.*;
|
|
import com.ydtech.modules.order.entity.crawler.request.*;
|
|
|
import com.ydtech.modules.order.entity.crawler.response.*;
|
|
import com.ydtech.modules.order.entity.crawler.response.*;
|
|
|
import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
|
|
import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
|
|
|
-import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
|
|
|
|
|
import com.ydtech.modules.order.entity.dto.ReadPdfUrlListDto;
|
|
import com.ydtech.modules.order.entity.dto.ReadPdfUrlListDto;
|
|
|
import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
|
|
import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
|
|
|
import com.ydtech.modules.order.entity.po.SysQuoteRecord;
|
|
import com.ydtech.modules.order.entity.po.SysQuoteRecord;
|
|
@@ -33,6 +33,7 @@ import com.ydtech.modules.protocol.entity.constants.PtlCrawlerApiType;
|
|
|
import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
|
|
import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
|
|
|
import com.ydtech.modules.protocol.entity.dto.PtlAttributionTemplateDto;
|
|
import com.ydtech.modules.protocol.entity.dto.PtlAttributionTemplateDto;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
|
|
|
|
|
+import com.ydtech.modules.protocol.entity.vo.PtlAgreementSaveVo;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
|
import com.ydtech.modules.protocol.service.PtlCrawlerApiService;
|
|
import com.ydtech.modules.protocol.service.PtlCrawlerApiService;
|
|
|
import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
@@ -58,8 +59,6 @@ import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
-import static com.ydtech.modules.order.constants.OrderCacheConstant.GR_SPECIAL_AGREEMENT_TIME;
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
@@ -846,6 +845,39 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
TimeUnit.SECONDS);
|
|
TimeUnit.SECONDS);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void sendcode(PtlAgreementAttributionDto attributionDto) {
|
|
|
|
|
+ String apiUrl = ptlCrawlerApiService.getByTemplateId(attributionDto.getTemplateId(), PtlCrawlerApiType.API_11);
|
|
|
|
|
+ TsCrawlerLoginRequest crawlerLoginRequest = new TsCrawlerLoginRequest(attributionDto);
|
|
|
|
|
+ TsCrawlerBaseResponse response = insCrawlerOrderComponents.request(apiUrl, InsuranceEnum.TSBX.getCode(), "获取验证码",
|
|
|
|
|
+ crawlerLoginRequest, TsCrawlerBaseResponse.class);
|
|
|
|
|
+ if (!response.getCode().equals(200)) {
|
|
|
|
|
+ throw new SystemException(response.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ // 将返回参数放入redis
|
|
|
|
|
+ redisTemplate.opsForValue().set(OrderCacheConstant.TS_ACCESS_TOKEN + attributionDto.getUsername(), JSON.toJSONString(response.getData()), OrderCacheConstant.TS_ACCESS_TOKEN_TIME,
|
|
|
|
|
+ TimeUnit.SECONDS);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void taishanLogin(PtlAgreementSaveVo agreement) {
|
|
|
|
|
+ // 获取协议的用户名密码
|
|
|
|
|
+
|
|
|
|
|
+ String apiUrl = ptlCrawlerApiService.getByTemplateId(agreement.getAttribution().getTemplateId(), PtlCrawlerApiType.API_1);
|
|
|
|
|
+ String token = redisTemplate.opsForValue().get(OrderCacheConstant.TS_ACCESS_TOKEN + agreement.getAttribution().getUsername());
|
|
|
|
|
+ if (StringUtils.isNotBlank(token)) {
|
|
|
|
|
+ TsCrawlerLoginRequest request = JSON.parseObject(token).toJavaObject(TsCrawlerLoginRequest.class);
|
|
|
|
|
+ TsCrawlerLoginRequest tsRequest = new TsCrawlerLoginRequest(agreement.getAttribution(), agreement.getAgreement().getSmsCode(), request);
|
|
|
|
|
+ TsCrawlerBaseResponse response = insCrawlerOrderComponents.request(apiUrl, agreement.getAgreement().getPartnerCompaniesId(), "登录",
|
|
|
|
|
+ tsRequest, TsCrawlerBaseResponse.class);
|
|
|
|
|
+ if (!response.getCode().equals(200)) {
|
|
|
|
|
+ throw new SystemException("泰山登录失败:" + response.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new SystemException("验证码已失效!请重新发送!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void taishanLogin(String agreementId, String smscode) {
|
|
public void taishanLogin(String agreementId, String smscode) {
|
|
|
// 获取协议的用户名密码
|
|
// 获取协议的用户名密码
|
|
@@ -868,6 +900,5 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
} else {
|
|
} else {
|
|
|
throw new SystemException("验证码已失效!请重新发送!");
|
|
throw new SystemException("验证码已失效!请重新发送!");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|