|
|
@@ -54,6 +54,7 @@ import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
|
import com.ydtech.utils.CalculateUtils;
|
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
@@ -289,11 +290,10 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
throw new SystemException("未选择协议不能报价");
|
|
|
}
|
|
|
Map<String, Object> map = quoteVo.getAccidentalDrivingVo();
|
|
|
- if(map!=null && map.get("2")!=null ){
|
|
|
- LinkedHashMap<String,Object> linkedMap = (LinkedHashMap<String,Object>) map.get("2");
|
|
|
+ if(map!=null && map.get("2")!=null){
|
|
|
+ List<InsDrivingIntentionInsuranceSonVo> zhlist = (List<InsDrivingIntentionInsuranceSonVo>) map.get("2");
|
|
|
int count =0;
|
|
|
- if(linkedMap!=null && linkedMap.size()>0){
|
|
|
- List<InsDrivingIntentionInsuranceSonVo> zhlist = (List<InsDrivingIntentionInsuranceSonVo>)linkedMap.get("2");
|
|
|
+ if(zhlist!=null && zhlist.size()>0){
|
|
|
for(InsDrivingIntentionInsuranceSonVo zhVo : zhlist ){
|
|
|
if("01".equals(zhVo.getCombineProductType())){
|
|
|
count++;
|
|
|
@@ -413,7 +413,6 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
quoteRespVo.setZhPremium(zhAmount);
|
|
|
// 报价险种放入保费
|
|
|
List<QuoteRiskRespVo> riskList1 = QuoteRiskRespVo.toQuoteRiskRespVoList(riskList, jqPremium, syPremium);
|
|
|
-
|
|
|
quoteRespVo.setRiskList(riskList1);
|
|
|
quoteRespVo.setJqPremium(jqPremium);
|
|
|
quoteRespVo.setSyPremium(syPremium);
|
|
|
@@ -427,8 +426,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
//订单号
|
|
|
quoteRespVo.setOrderno(yaQuoteInfoVo.getOrderNo());
|
|
|
quoteRespVo.setCoreModels(modelsDto.toCoreModelsVo());
|
|
|
- String orderId = yaQuoteInfoVo.getOrderNo();
|
|
|
- return responseOrder(response, quoteRespVo, ptlAgreementAttribution, orderId,userId,pinganApiLog,carConfirmResponse,quoteVo);
|
|
|
+ return responseOrder(response, quoteRespVo, ptlAgreementAttribution, carConfirmResponse,quoteVo);
|
|
|
}
|
|
|
/**
|
|
|
* @version
|
|
|
@@ -598,81 +596,20 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
public HttpResult<QuoteRespVo> responseOrder(QuoteResponse response,
|
|
|
PingAnQuoteRespVo quoteRespVo,
|
|
|
PtlAgreementAttribution ptlAgreementAttribution,
|
|
|
- String orderId,
|
|
|
- String userId,
|
|
|
- PinganApiLog pinganApiLog,
|
|
|
CarConfirmResponse carConfirmResponse,
|
|
|
PingAnQuoteVo<Map<String,Object>> quoteVo
|
|
|
|
|
|
) {
|
|
|
// 保存订单信息
|
|
|
InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
|
|
|
- //平安业务id
|
|
|
- String flowid = response.getFlowid();
|
|
|
- insAreaCompany.setReptxt(JSON.parseObject(JSON.toJSONString(response)));
|
|
|
+ //报价状态
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
- insAreaCompany.setInsOrderNo(flowid);
|
|
|
-
|
|
|
- Map<String, Object> map = quoteVo.getAccidentalDrivingVo();
|
|
|
- List<QuoteRequest.UnAutoListInfoDTO> unAutoListInfoList=new ArrayList<>();
|
|
|
- List<QuoteRequest.UnAutoListInfoDTO> xiaoWeiListInfoList=new ArrayList<>();
|
|
|
- List<QuoteRequest.CombinationInfoDTO> combinationInfoList=new ArrayList<>();
|
|
|
- if(map!=null && map.get("0")!=null ){
|
|
|
- LinkedHashMap<String,Object> linkedMap = (LinkedHashMap<String,Object>) map.get("0");
|
|
|
- if(linkedMap!=null && linkedMap.size()>0){
|
|
|
- InsDrivingIntentionInsuranceSonVo vo = BeanUtil.mapToBean(linkedMap, InsDrivingIntentionInsuranceSonVo.class, true);
|
|
|
- QuoteRequest.UnAutoListInfoDTO unAutoListInfoDTO =new QuoteRequest.UnAutoListInfoDTO(vo.getProductCode(),vo.getCode(),vo.getQuantity());
|
|
|
- unAutoListInfoList.add(unAutoListInfoDTO);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(map!=null && map.get("1")!=null ){
|
|
|
- LinkedHashMap<String,Object> linkedMap = (LinkedHashMap<String,Object>) map.get("1");
|
|
|
- if(linkedMap!=null && linkedMap.size()>0){
|
|
|
- InsDrivingIntentionInsuranceSonVo vo = BeanUtil.mapToBean(linkedMap, InsDrivingIntentionInsuranceSonVo.class, true);
|
|
|
- QuoteRequest.UnAutoListInfoDTO unAutoListInfoDTO =new QuoteRequest.UnAutoListInfoDTO(vo.getProductCode(),vo.getCode(),vo.getQuantity());
|
|
|
- unAutoListInfoList.add(unAutoListInfoDTO);
|
|
|
- }
|
|
|
- }
|
|
|
- if(map!=null && map.get("2")!=null ){
|
|
|
- LinkedHashMap<String,Object> linkedMap = (LinkedHashMap<String,Object>) map.get("2");
|
|
|
- if(linkedMap!=null && linkedMap.size()>0){
|
|
|
- List<InsDrivingIntentionInsuranceSonVo> zhlist = (List<InsDrivingIntentionInsuranceSonVo>)linkedMap.get("2");
|
|
|
- for(InsDrivingIntentionInsuranceSonVo zhVo : zhlist ){
|
|
|
- QuoteRequest.CombinationInfoDTO combinationInfo =new QuoteRequest.CombinationInfoDTO(zhVo.getProductCode(),zhVo.getCode(),zhVo.getQuantity(),zhVo.getCombineProductType());
|
|
|
- combinationInfoList.add(combinationInfo);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //赋值驾意险信息
|
|
|
- Map<String,Object> jyMap=new HashMap<>();
|
|
|
- Map<String,Object> xwMap=new HashMap<>();
|
|
|
- Map<String,Object> zhMap=new HashMap<>();
|
|
|
- if(unAutoListInfoList!=null && unAutoListInfoList.size()>0){
|
|
|
- jyMap.put("sumAmount",quoteRespVo.getCyPremium());
|
|
|
- jyMap.put("list",unAutoListInfoList);
|
|
|
- }
|
|
|
- if(xiaoWeiListInfoList!=null && xiaoWeiListInfoList.size()>0){
|
|
|
- xwMap.put("sumAmount",quoteRespVo.getXwPremium());
|
|
|
- xwMap.put("list",xiaoWeiListInfoList);
|
|
|
- }
|
|
|
- if(combinationInfoList!=null && combinationInfoList.size()>0){
|
|
|
- zhMap.put("sumAmount",quoteRespVo.getZhPremium());
|
|
|
- zhMap.put("list",combinationInfoList);
|
|
|
- }
|
|
|
-
|
|
|
- List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
|
|
|
- if(jyMap!=null && jyMap.size()>0){
|
|
|
- list.add(jyMap);
|
|
|
- }
|
|
|
- if(xwMap!=null && xwMap.size()>0){
|
|
|
- list.add(xwMap);
|
|
|
- }
|
|
|
- if(zhMap!=null && zhMap.size()>0){
|
|
|
- list.add(zhMap);
|
|
|
- }
|
|
|
- if(list!=null && list.size()>0){
|
|
|
- insAreaCompany.setAccidentInfo(JSON.parseArray(JSON.toJSONString(list)));
|
|
|
+ //流程id
|
|
|
+ insAreaCompany.setFlowid(response.getFlowid());
|
|
|
+ //获取驾意险列表
|
|
|
+ List<Map<String, Object>> yjList = new QuoteRequest().getJsonList(quoteVo.getAccidentalDrivingVo(), quoteRespVo.getCyPremium(), quoteRespVo.getXwPremium(), quoteRespVo.getZhPremium());
|
|
|
+ if(CollectionUtils.isNotEmpty(yjList)){
|
|
|
+ insAreaCompany.setAccidentInfo(JSON.parseArray(JSON.toJSONString(yjList)));
|
|
|
}
|
|
|
// 车船税
|
|
|
QuoteResponse.ForceQuoteResultDTO.TaxDTO tax = response.getForceQuoteResult().getTax();
|
|
|
@@ -680,7 +617,6 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
Double.parseDouble(tax.getDelayPayMoney()));
|
|
|
List<TaxArrears> taxArrearsList = Collections.singletonList(taxArrears);
|
|
|
insAreaCompany.setTaxArrears(JSON.parseArray(JSON.toJSONString(taxArrearsList)));
|
|
|
- insAreaCompany.setFlowid(flowid);
|
|
|
// centile 商业险评分 商业险出现次数
|
|
|
//商业出险次数
|
|
|
if(response.getBizQuoteResult()!=null && response.getBizQuoteResult().getClaimNumber()!=null){
|
|
|
@@ -693,7 +629,6 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
insAreaCompany.setSyRenewal("2".equals(carConfirmResponse.getBizRenewalType())?"1":carConfirmResponse.getBizRenewalType());
|
|
|
insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
|
|
|
quoteRespVo.setCompanyId(insAreaCompany.getId());
|
|
|
-
|
|
|
return HttpResult.ok("报价成功", quoteRespVo);
|
|
|
}
|
|
|
|
|
|
@@ -1882,16 +1817,19 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
if (documentStatusListResponse != null && "0".equals(documentStatusListResponse.getResultCode())) {
|
|
|
ArrayList<DocumentStatusListResponse.DocumentDTO> documentList = documentStatusListResponse.getDocumentList();
|
|
|
String status = "";
|
|
|
+ String policyNo ="";
|
|
|
if (documentList != null && documentList.size() > 0) {
|
|
|
Boolean flag = false;
|
|
|
for (DocumentStatusListResponse.DocumentDTO dto : documentList) {
|
|
|
status = dto.getStatus();
|
|
|
+ policyNo = dto.getPolicyNo();
|
|
|
if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(dto.getStatus())) {
|
|
|
flag = false;
|
|
|
}
|
|
|
}
|
|
|
+ insAreaCompany.setJqpolicyno(policyNo);
|
|
|
//已承保更新承保状态
|
|
|
- if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(status)) {
|
|
|
+ if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(status) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()) || "2".equals(insAreaCompany.getOrderstatus())) ) {
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
return HttpResult.ok("支付成功");
|