|
@@ -53,7 +53,10 @@ import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
-import java.util.*;
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+import java.util.Objects;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
import java.util.regex.Pattern;
|
|
@@ -113,7 +116,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
CrawlerBaseResponse response = insCrawlerOrderComponents.request(apiUrl, companyId, PtlCrawlerApiType.API_2.getDesc(),
|
|
CrawlerBaseResponse response = insCrawlerOrderComponents.request(apiUrl, companyId, PtlCrawlerApiType.API_2.getDesc(),
|
|
|
crawlerLoginRequest, CrawlerBaseResponse.class);
|
|
crawlerLoginRequest, CrawlerBaseResponse.class);
|
|
|
|
|
|
|
|
- AssertionUtils.isSucceed(response.getCode() == 200, insCompanyName + "登录用户名和密码不正确");
|
|
|
|
|
|
|
+ AssertionUtils.isSucceed(response.getCode() == 200, insCompanyName + ":" + response.getMessage());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -232,11 +235,11 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
insAreaCompanyAccidentalDriving.setRideRiskCode(one.getProjectCode());
|
|
insAreaCompanyAccidentalDriving.setRideRiskCode(one.getProjectCode());
|
|
|
insAreaCompanyAccidentalDriving.setQuantity(1);
|
|
insAreaCompanyAccidentalDriving.setQuantity(1);
|
|
|
insAreaCompanyAccidentalDriving.setCompanyId(t.getCompanyId());
|
|
insAreaCompanyAccidentalDriving.setCompanyId(t.getCompanyId());
|
|
|
- } else if(t.getAccidentalDrivingVo() != null && t.getCompanyId().equals("HBIC1000000")){
|
|
|
|
|
|
|
+ } else if (t.getAccidentalDrivingVo() != null && t.getCompanyId().equals("HBIC1000000")) {
|
|
|
JSONObject jsonObject = JSON.parseObject(t.getAccidentalDrivingVo()
|
|
JSONObject jsonObject = JSON.parseObject(t.getAccidentalDrivingVo()
|
|
|
.toString());
|
|
.toString());
|
|
|
Integer buynum = jsonObject.getInteger("buynum");
|
|
Integer buynum = jsonObject.getInteger("buynum");
|
|
|
- if(!quoteRespVo.getAccident().isEmpty()){
|
|
|
|
|
|
|
+ if (!quoteRespVo.getAccident().isEmpty()) {
|
|
|
BigDecimal price = new BigDecimal(response.getDrivingInsurances().get(0).getPrice());
|
|
BigDecimal price = new BigDecimal(response.getDrivingInsurances().get(0).getPrice());
|
|
|
BigDecimal total = price.multiply(BigDecimal.valueOf(buynum));
|
|
BigDecimal total = price.multiply(BigDecimal.valueOf(buynum));
|
|
|
BigDecimal rounded = total.setScale(2, RoundingMode.HALF_UP);
|
|
BigDecimal rounded = total.setScale(2, RoundingMode.HALF_UP);
|
|
@@ -841,8 +844,9 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
throw new SystemException(response.getMessage());
|
|
throw new SystemException(response.getMessage());
|
|
|
}
|
|
}
|
|
|
// 将返回参数放入redis
|
|
// 将返回参数放入redis
|
|
|
- redisTemplate.opsForValue().set(OrderCacheConstant.TS_ACCESS_TOKEN + attributionDto.getUsername(), JSON.toJSONString(response.getData()), OrderCacheConstant.TS_ACCESS_TOKEN_TIME,
|
|
|
|
|
- TimeUnit.SECONDS);
|
|
|
|
|
|
|
+ redisTemplate.opsForValue()
|
|
|
|
|
+ .set(OrderCacheConstant.TS_ACCESS_TOKEN + attributionDto.getUsername(), JSON.toJSONString(response.getData()), OrderCacheConstant.TS_ACCESS_TOKEN_TIME,
|
|
|
|
|
+ TimeUnit.SECONDS);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -885,10 +889,12 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
|
|
|
PtlAgreementAttributionDto attributionDto = new PtlAgreementAttributionDto();
|
|
PtlAgreementAttributionDto attributionDto = new PtlAgreementAttributionDto();
|
|
|
BeanUtils.copyProperties(attribution, attributionDto);
|
|
BeanUtils.copyProperties(attribution, attributionDto);
|
|
|
|
|
|
|
|
- List<PtlAttributionTemplateDto> attributionTemplateDtos = attribution.getFields().toJavaList(PtlAttributionTemplateDto.class);
|
|
|
|
|
|
|
+ List<PtlAttributionTemplateDto> attributionTemplateDtos = attribution.getFields()
|
|
|
|
|
+ .toJavaList(PtlAttributionTemplateDto.class);
|
|
|
attributionDto.setFields(attributionTemplateDtos);
|
|
attributionDto.setFields(attributionTemplateDtos);
|
|
|
String apiUrl = ptlCrawlerApiService.getByTemplateId(attribution.getTemplateId(), PtlCrawlerApiType.API_1);
|
|
String apiUrl = ptlCrawlerApiService.getByTemplateId(attribution.getTemplateId(), PtlCrawlerApiType.API_1);
|
|
|
- String token = redisTemplate.opsForValue().get(OrderCacheConstant.TS_ACCESS_TOKEN + attributionDto.getUsername());
|
|
|
|
|
|
|
+ String token = redisTemplate.opsForValue()
|
|
|
|
|
+ .get(OrderCacheConstant.TS_ACCESS_TOKEN + attributionDto.getUsername());
|
|
|
if (StringUtils.isNotBlank(token)) {
|
|
if (StringUtils.isNotBlank(token)) {
|
|
|
TsCrawlerLoginRequest request = JSON.parseObject(token).toJavaObject(TsCrawlerLoginRequest.class);
|
|
TsCrawlerLoginRequest request = JSON.parseObject(token).toJavaObject(TsCrawlerLoginRequest.class);
|
|
|
TsCrawlerLoginRequest tsRequest = new TsCrawlerLoginRequest(attributionDto, smscode, request);
|
|
TsCrawlerLoginRequest tsRequest = new TsCrawlerLoginRequest(attributionDto, smscode, request);
|