|
|
@@ -440,79 +440,72 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
throw new SystemException(premiumCalculationResponse.getHead().getErrorMessage());
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}else{
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- // 转保车处理
|
|
|
- String ciQuestion = premiumCalculationResponse.getCompRisk() != null
|
|
|
- ? premiumCalculationResponse.getCompRisk().getBasePart().getQuestion()
|
|
|
- : null;
|
|
|
- String biQuestion = premiumCalculationResponse.getCommRisk() != null
|
|
|
- ? premiumCalculationResponse.getCommRisk().getBasePart().getQuestion()
|
|
|
- : null;
|
|
|
- // 订单号
|
|
|
- if (ciQuestion != null || biQuestion != null) {
|
|
|
- String orderNumber = premiumCalculationResponse.getCompRisk() != null
|
|
|
- ? premiumCalculationResponse.getCompRisk().getFtrno().getOrderNumber()
|
|
|
- : premiumCalculationResponse.getCommRisk().getFtrno().getOrderNumber();
|
|
|
- Map<String, String> bodyMap = new HashMap<>();
|
|
|
- if (Objects.nonNull(ciQuestion)) {
|
|
|
- bodyMap.put("jqImage", ciQuestion);
|
|
|
- }
|
|
|
- if (Objects.nonNull(biQuestion)) {
|
|
|
- bodyMap.put("syImage", biQuestion);
|
|
|
- }
|
|
|
- String sendBody = JsonUtils.toJson(bodyMap);
|
|
|
- if (!"{}".equals(sendBody)) {
|
|
|
- String ocrStr = HttpUtil.sendPost("http://39.98.41.104:8088/getres", sendBody);
|
|
|
- CheckCodeResp resp = JSONUtil.toBean(ocrStr, CheckCodeResp.class);
|
|
|
- if(StringUtils.isNotEmpty(resp.getJqImageCode())){
|
|
|
- if(quoteInfoVo.getCiQuestionCode() != null && !quoteInfoVo.getCiQuestionCode().equals("")){
|
|
|
- resp.setJqImageCode(quoteInfoVo.getCiQuestionCode());
|
|
|
- }
|
|
|
- quoteVo.setRenewalCodeJq(resp.getJqImageCode().replace("0", "O"));
|
|
|
- }
|
|
|
- if(StringUtils.isNotEmpty(resp.getSyImageCode())){
|
|
|
- if(quoteInfoVo.getBiQuestionCode() != null && !quoteInfoVo.getBiQuestionCode().equals("")){
|
|
|
- resp.setSyImageCode(quoteInfoVo.getBiQuestionCode());
|
|
|
- }
|
|
|
- quoteVo.setRenewalCodeSy(resp.getSyImageCode().replace("0", "O"));
|
|
|
- }
|
|
|
- premiumCalculationRequest = new PremiumCalculationRequest(quoteInfoVo, carActualValue, parameters, vehicle, quoteVo, quoteInfoVo.getRiskList(), orderNumber);
|
|
|
- premiumCalculationResponse = chengTaiRequestApiComponent.premiumCalculation(premiumCalculationRequest);
|
|
|
- if(Objects.nonNull(ciQuestion)){
|
|
|
- if(Objects.isNull(premiumCalculationResponse.getCompRisk())){
|
|
|
- premiumCalculationResponse.setCompRisk(new PremiumCalculationResponse.compRisk());
|
|
|
- }
|
|
|
- if(Objects.isNull(premiumCalculationResponse.getCompRisk().getBasePart())){
|
|
|
- premiumCalculationResponse.getCompRisk().setBasePart(new PremiumCalculationResponse.compRisk.basePart());
|
|
|
- }
|
|
|
- premiumCalculationResponse.getCompRisk().getBasePart().setQuestion(ciQuestion);
|
|
|
- }
|
|
|
|
|
|
- if(Objects.nonNull(biQuestion)){
|
|
|
- if(Objects.isNull(premiumCalculationResponse.getCommRisk())){
|
|
|
- premiumCalculationResponse.setCommRisk(new PremiumCalculationResponse.commRisk());
|
|
|
+ // 转保车处理
|
|
|
+ String ciQuestion = premiumCalculationResponse.getCompRisk() != null
|
|
|
+ ? premiumCalculationResponse.getCompRisk().getBasePart().getQuestion()
|
|
|
+ : null;
|
|
|
+ String biQuestion = premiumCalculationResponse.getCommRisk() != null
|
|
|
+ ? premiumCalculationResponse.getCommRisk().getBasePart().getQuestion()
|
|
|
+ : null;
|
|
|
+ // 订单号
|
|
|
+ if (ciQuestion != null || biQuestion != null) {
|
|
|
+ String orderNumber = premiumCalculationResponse.getCompRisk() != null
|
|
|
+ ? premiumCalculationResponse.getCompRisk().getFtrno().getOrderNumber()
|
|
|
+ : premiumCalculationResponse.getCommRisk().getFtrno().getOrderNumber();
|
|
|
+ Map<String, String> bodyMap = new HashMap<>();
|
|
|
+ if (Objects.nonNull(ciQuestion)) {
|
|
|
+ bodyMap.put("jqImage", ciQuestion);
|
|
|
}
|
|
|
- if(Objects.isNull(premiumCalculationResponse.getCommRisk().getBasePart())){
|
|
|
- premiumCalculationResponse.getCommRisk().setBasePart(new PremiumCalculationResponse.commRisk.basePart());
|
|
|
+ if (Objects.nonNull(biQuestion)) {
|
|
|
+ bodyMap.put("syImage", biQuestion);
|
|
|
}
|
|
|
- premiumCalculationResponse.getCommRisk().getBasePart().setQuestion(biQuestion);
|
|
|
- }
|
|
|
+ String sendBody = JsonUtils.toJson(bodyMap);
|
|
|
+ if (!"{}".equals(sendBody)) {
|
|
|
+ String ocrStr = HttpUtil.sendPost("http://39.98.41.104:8088/getres", sendBody);
|
|
|
+ CheckCodeResp resp = JSONUtil.toBean(ocrStr, CheckCodeResp.class);
|
|
|
+ if(StringUtils.isNotEmpty(resp.getJqImageCode())){
|
|
|
+ if(quoteInfoVo.getCiQuestionCode() != null && !quoteInfoVo.getCiQuestionCode().equals("")){
|
|
|
+ resp.setJqImageCode(quoteInfoVo.getCiQuestionCode());
|
|
|
+ }
|
|
|
+ quoteVo.setRenewalCodeJq(resp.getJqImageCode().replace("0", "O"));
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(resp.getSyImageCode())){
|
|
|
+ if(quoteInfoVo.getBiQuestionCode() != null && !quoteInfoVo.getBiQuestionCode().equals("")){
|
|
|
+ resp.setSyImageCode(quoteInfoVo.getBiQuestionCode());
|
|
|
+ }
|
|
|
+ quoteVo.setRenewalCodeSy(resp.getSyImageCode().replace("0", "O"));
|
|
|
+ }
|
|
|
+ premiumCalculationRequest = new PremiumCalculationRequest(quoteInfoVo, carActualValue, parameters, vehicle, quoteVo, quoteInfoVo.getRiskList(), orderNumber);
|
|
|
+ premiumCalculationResponse = chengTaiRequestApiComponent.premiumCalculation(premiumCalculationRequest);
|
|
|
+ if(Objects.nonNull(ciQuestion)){
|
|
|
+ if(Objects.isNull(premiumCalculationResponse.getCompRisk())){
|
|
|
+ premiumCalculationResponse.setCompRisk(new PremiumCalculationResponse.compRisk());
|
|
|
+ }
|
|
|
+ if(Objects.isNull(premiumCalculationResponse.getCompRisk().getBasePart())){
|
|
|
+ premiumCalculationResponse.getCompRisk().setBasePart(new PremiumCalculationResponse.compRisk.basePart());
|
|
|
+ }
|
|
|
+ premiumCalculationResponse.getCompRisk().getBasePart().setQuestion(ciQuestion);
|
|
|
+ }
|
|
|
|
|
|
- maxQuoteNum--;
|
|
|
- SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(), quoteVo.getCompanyId(), quoteInfoVo.getCarInfo().getLicenseNo(),
|
|
|
- QuoteNumberConstant.QuoteAction.DATE_DEAL.getCode().toString(), QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
|
|
|
- sysQuoteRecords.add(sysQuoteRecord);
|
|
|
- if (maxQuoteNum <= 0) {
|
|
|
- sysQuoteRecordMapper.insertBatch(sysQuoteRecords);
|
|
|
- //刷新redis中的报价次数
|
|
|
- sysQuoteRedisService.refreshQuoteNum(quoteVo.getCompanyId(), quoteInfoVo.getUserid(), sysQuoteRecords);
|
|
|
- throw new SystemException("报价次数限制");
|
|
|
+ if(Objects.nonNull(biQuestion)){
|
|
|
+ if(Objects.isNull(premiumCalculationResponse.getCommRisk())){
|
|
|
+ premiumCalculationResponse.setCommRisk(new PremiumCalculationResponse.commRisk());
|
|
|
+ }
|
|
|
+ if(Objects.isNull(premiumCalculationResponse.getCommRisk().getBasePart())){
|
|
|
+ premiumCalculationResponse.getCommRisk().setBasePart(new PremiumCalculationResponse.commRisk.basePart());
|
|
|
+ }
|
|
|
+ premiumCalculationResponse.getCommRisk().getBasePart().setQuestion(biQuestion);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return premiumCalculationResponse;
|
|
|
}
|
|
|
|