|
|
@@ -2,6 +2,7 @@ package com.jzg.quotation.renbaonew.crawler.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.jzg.commons.entity.quote.vo.AccidentalDrivingVo;
|
|
|
import com.jzg.commons.entity.quote.vo.CarInfoVo;
|
|
|
import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
|
|
|
import com.jzg.commons.entity.quote.vo.QuoteVo;
|
|
|
@@ -498,7 +499,12 @@ public class RenBaoNewCrawlerRequestBuilder {
|
|
|
request.setOcrList(idList);
|
|
|
|
|
|
// 驾意险处理 - 构建 prpCunion(如果没有驾意险则设置为null)
|
|
|
- List<Map<String, Object>> prpCunion = buildPrpCunion(quoteVo, carInfo, gscomCode, headers, username);
|
|
|
+ List<Map<String, Object>> prpCunion = buildPrpCunion(
|
|
|
+ quoteVo, carInfo, gscomCode, comCodeDes,
|
|
|
+ handler1Code, handler1CodeUni, handler1CodeDes,
|
|
|
+ handlerCode, handlerCodeUni, handlerCodeDes,
|
|
|
+ businessNature, agentCode, agentName,
|
|
|
+ carChecker, carCheckerTranslate, headers, loginInfo.getUserCode());
|
|
|
if (prpCunion != null && !prpCunion.isEmpty()) {
|
|
|
request.setPrpCunion(prpCunion);
|
|
|
}
|
|
|
@@ -922,27 +928,42 @@ public class RenBaoNewCrawlerRequestBuilder {
|
|
|
* @param quoteVo 报价请求VO,包含险种列表
|
|
|
* @param carInfo 车辆信息,用于获取座位数(EBS需要)
|
|
|
* @param comCode 归属部门代码
|
|
|
+ * @param comCodeDes 归属部门名称
|
|
|
+ * @param handler1Code 归属人账号
|
|
|
+ * @param handler1CodeUni 归属人统一工号
|
|
|
+ * @param handler1CodeDes 归属人名称
|
|
|
+ * @param handlerCode 经办人账号
|
|
|
+ * @param handlerCodeUni 经办人统一工号
|
|
|
+ * @param handlerCodeDes 经办人名称
|
|
|
+ * @param businessNature 业务性质
|
|
|
+ * @param agentCode 渠道代码
|
|
|
+ * @param agentName 渠道名称
|
|
|
+ * @param serviceManager 服务经理代码
|
|
|
+ * @param serviceManagerDes 服务经理名称
|
|
|
* @param headers 请求头
|
|
|
- * @param username 用户名
|
|
|
+ * @param userCode 当前登录账号
|
|
|
* @return 非车险列表,为空表示不需要投保非车险
|
|
|
*/
|
|
|
- private List<Map<String, Object>> buildPrpCunion(QuoteVo quoteVo, CarInfoVo carInfo,
|
|
|
- String comCode, HttpHeaders headers, String username) {
|
|
|
+ private List<Map<String, Object>> buildPrpCunion(
|
|
|
+ QuoteVo quoteVo, CarInfoVo carInfo, String comCode, String comCodeDes,
|
|
|
+ String handler1Code, String handler1CodeUni, String handler1CodeDes,
|
|
|
+ String handlerCode, String handlerCodeUni, String handlerCodeDes,
|
|
|
+ String businessNature, String agentCode, String agentName,
|
|
|
+ String serviceManager, String serviceManagerDes,
|
|
|
+ HttpHeaders headers, String userCode) {
|
|
|
+ List<AccidentalDrivingVo> accidentalDrivings = quoteVo.getAccidentalDrivings();
|
|
|
List<Map<String, Object>> prpCunion = new ArrayList<>();
|
|
|
|
|
|
- // 获取驾意险列表(从 quoteVo 中的 kindInfoVo 中筛选驾意险险种)
|
|
|
- List<Map<String, Object>> kindMapList = convertKindInfoToMapList(quoteVo.getKindInfoVo());
|
|
|
- if (kindMapList == null || kindMapList.isEmpty()) {
|
|
|
+ // 获取驾意险列表
|
|
|
+ if(accidentalDrivings == null || accidentalDrivings.isEmpty()){
|
|
|
return prpCunion;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- for (Map<String, Object> kindMap : kindMapList) {
|
|
|
- if (kindMap == null) {
|
|
|
+ for (AccidentalDrivingVo accidentalDriving : quoteVo.getAccidentalDrivings()) {
|
|
|
+ if (accidentalDriving == null) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- String kindCode = getStringValue(kindMap, "kindCode");
|
|
|
+ String kindCode = accidentalDriving.getProductCode();
|
|
|
if (kindCode == null || kindCode.isEmpty()) {
|
|
|
continue;
|
|
|
}
|
|
|
@@ -985,11 +1006,31 @@ public class RenBaoNewCrawlerRequestBuilder {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- // 构建驾意险项
|
|
|
+ // 构建驾意险项,字段与Python版本Cunion保持一致
|
|
|
Map<String, Object> unionItem = new HashMap<>();
|
|
|
+ unionItem.put("uCalculation", 1);
|
|
|
+ unionItem.put("uProposalNo", "");
|
|
|
unionItem.put("uRiskPlanCode", rideRiskCode);
|
|
|
unionItem.put("uRiskCode", unionRiskCode);
|
|
|
unionItem.put("uRiskPlanInfo", uPlanInfos);
|
|
|
+ unionItem.put("uUserCode", userCode);
|
|
|
+ unionItem.put("comCodeDes", comCodeDes);
|
|
|
+ unionItem.put("comCode", comCode);
|
|
|
+ unionItem.put("handler1Code", handler1Code);
|
|
|
+ unionItem.put("handler1code_uni", handler1CodeUni);
|
|
|
+ unionItem.put("handler1CodeDes", handler1CodeDes);
|
|
|
+ unionItem.put("handlerCode", handlerCode);
|
|
|
+ unionItem.put("handlercode_uni", handlerCodeUni);
|
|
|
+ unionItem.put("handlerCodeDes", handlerCodeDes);
|
|
|
+ unionItem.put("businessNature", businessNature);
|
|
|
+ unionItem.put("agentCode", agentCode);
|
|
|
+ unionItem.put("agentName", agentName);
|
|
|
+ unionItem.put("makeCom", comCode);
|
|
|
+ unionItem.put("makeComDes", comCodeDes);
|
|
|
+ unionItem.put("serviceManager", serviceManager);
|
|
|
+ unionItem.put("serviceManagerDes", serviceManagerDes);
|
|
|
+ unionItem.put("isAccredit", "1");
|
|
|
+ unionItem.put("policyType", "1");
|
|
|
|
|
|
// EAD(驾意险)数量固定为1,EBS(乘客意外险)数量为座位数
|
|
|
if ("EAD".equals(unionRiskCode)) {
|
|
|
@@ -998,7 +1039,6 @@ public class RenBaoNewCrawlerRequestBuilder {
|
|
|
int seatCount = carInfo.getSeatCount() != null ? Integer.parseInt(carInfo.getSeatCount()) : 5;
|
|
|
unionItem.put("uNumPer", seatCount);
|
|
|
}
|
|
|
-
|
|
|
prpCunion.add(unionItem);
|
|
|
log.info("Added union risk item: {}, count: {}", unionRiskCode, unionItem.get("uNumPer"));
|
|
|
}
|
|
|
@@ -1073,7 +1113,7 @@ public class RenBaoNewCrawlerRequestBuilder {
|
|
|
if (response == null) {
|
|
|
return false;
|
|
|
}
|
|
|
- String status = (String) response.get("status");
|
|
|
+ String status = response.get("status").toString();
|
|
|
String message = (String) response.get("message");
|
|
|
return "0".equals(status) && "Success".equals(message);
|
|
|
}
|
|
|
@@ -3680,6 +3720,18 @@ public class RenBaoNewCrawlerRequestBuilder {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // 驾意险处理
|
|
|
+ List<Map<String, Object>> unionRMsgVoList = data.getUnionRMsgVoList();
|
|
|
+ if(!unionRMsgVoList.isEmpty()){
|
|
|
+ List<Map<String, Object>> newPrpCunion =new ArrayList<>();
|
|
|
+ for(Map<String, Object> map :unionRMsgVoList){
|
|
|
+ Map m = new HashMap<>();
|
|
|
+ m.put("uProposalNo",map.get("uProposalNo"));
|
|
|
+ newPrpCunion.add(m);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setPrpCunion(newPrpCunion);
|
|
|
+ }
|
|
|
|
|
|
prpCmain.put("sumPrem", sumPrem);
|
|
|
prpCmain.put("sumPremTotal", sumPrem);
|