|
|
@@ -1,30 +1,55 @@
|
|
|
package com.ydtech.modules.order.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.ydtech.config.properties.PingAnApiConfigurationProperties;
|
|
|
+import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
-import com.ydtech.modules.ins.model.vo.CarInfoVo;
|
|
|
-import com.ydtech.modules.ins.model.vo.QuoteRespVo;
|
|
|
+import com.ydtech.exception.SystemException;
|
|
|
+import com.ydtech.modules.ins.model.vo.*;
|
|
|
import com.ydtech.modules.order.components.ConfigureParametersComponents;
|
|
|
import com.ydtech.modules.order.components.pingan.PinganRequestApiComponents;
|
|
|
-import com.ydtech.modules.order.entity.api.pingan.request.CarConfirmRequest;
|
|
|
-import com.ydtech.modules.order.entity.api.pingan.request.IndexRequest;
|
|
|
-import com.ydtech.modules.order.entity.api.pingan.request.SearchPAVehicleListRequest;
|
|
|
-import com.ydtech.modules.order.entity.api.pingan.response.CarConfirmResponse;
|
|
|
-import com.ydtech.modules.order.entity.api.pingan.response.IndexResponse;
|
|
|
-import com.ydtech.modules.order.entity.api.pingan.response.SearchPAVehicleListResponse;
|
|
|
+import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
|
+import com.ydtech.modules.order.entity.TaxArrears;
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.constants.accept.AcceptResponseStatusCodeEnum;
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.constants.documentStatusList.DocumentStatusListResponseCodeEnum;
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.constants.index.IndexResposeCodeEnum;
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.constants.policyPdf.PolicyPdfResponseCodeEnum;
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.constants.scanCodeURL.ScanCodeURLResponseCodeEnum;
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.constants.unAutoProductDetail.UnAutoProductDetailResponseCodeEnum;
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.constants.unAutoProductList.UnAutoProductListResponseCodeEnum;
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.request.*;
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.response.*;
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.utils.PinAnEnumUtils;
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.utils.UUIDUtils;
|
|
|
+import com.ydtech.modules.order.entity.config.BoHaiConfigureParameters;
|
|
|
import com.ydtech.modules.order.entity.config.PingAnConfigureParameters;
|
|
|
import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
|
|
|
+import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
|
|
|
import com.ydtech.modules.order.entity.vo.bohai.BoHaiQuoteAccidentVo;
|
|
|
+import com.ydtech.modules.order.entity.vo.bohai.ProductDetailsQueryVo;
|
|
|
+import com.ydtech.modules.order.entity.vo.bohai.ProductQueryVo;
|
|
|
+import com.ydtech.modules.order.service.InsAreaCompanyService;
|
|
|
+import com.ydtech.modules.order.service.InsTaskImagesService;
|
|
|
import com.ydtech.modules.order.service.PingAnOrderApiService;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
|
|
|
import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
|
+import com.ydtech.utils.CalculateUtils;
|
|
|
+import com.ydtech.utils.StringUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.util.*;
|
|
|
|
|
|
+/**
|
|
|
+ * @version 平安接口相关api
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/4/1 15:19
|
|
|
+ * @Description:
|
|
|
+ */
|
|
|
@Service
|
|
|
@RequiredArgsConstructor
|
|
|
public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
@@ -35,7 +60,86 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
|
|
|
private final ConfigureParametersComponents configureParametersComponents;
|
|
|
|
|
|
+ private final InsAreaCompanyService insAreaCompanyService;
|
|
|
+
|
|
|
+ private final InsTaskImagesService insTaskImagesService;
|
|
|
+
|
|
|
+
|
|
|
+ private final PingAnApiConfigurationProperties properties;
|
|
|
+ /**
|
|
|
+ * @Description 获取财意险险种套餐列表 调用 4.4
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/4/1 14:33
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public HttpResult<Map<String,Object>> productQuery(ProductQueryVo productQueryVo) throws Exception {
|
|
|
+ // 账号信息
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(productQueryVo.getAgreementId());
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
+ PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
+
|
|
|
+
|
|
|
+ UnAutoProductListRequest unAutoProductListRequest = new UnAutoProductListRequest(parameters,productQueryVo);
|
|
|
+ UnAutoProductListResponse unAutoProductListResponse=null;
|
|
|
+ try{
|
|
|
+ unAutoProductListResponse= pinganRequestApiComponents.getUnAutoProductList(unAutoProductListRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ Map<String,Object> map=new HashMap<>();
|
|
|
+ if(unAutoProductListResponse!=null && UnAutoProductListResponseCodeEnum.UN_AUTO_PRODUCT_LIST_CODE_MSG_0.getCode().equals(unAutoProductListResponse.getResultCode())){
|
|
|
+ List<UnAutoProductListResponse.UnAutoListInfoDTO> unAutoListInfo = unAutoProductListResponse.getUnAutoListInfo();
|
|
|
+ List<UnAutoProductListResponse.UnAutoListInfoDTO> xiaoWeiListInfo = unAutoProductListResponse.getXiaoWeiListInfo();
|
|
|
+ map.put("unAutoListInfo",unAutoListInfo);
|
|
|
+ map.put("xiaoWeiListInfo",xiaoWeiListInfo);
|
|
|
+ return HttpResult.ok(map);
|
|
|
+ }
|
|
|
+ return HttpResult.error("接口失败");
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Description 获取财意险险种套餐责任信息 调用4.5
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/4/1 14:33
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public HttpResult<List<UnAutoProductDetailResponse.UnAutoProductDetailsDTO>> productDetailsQuery(ProductDetailsQueryVo productDetailsQueryVo) throws Exception {
|
|
|
+ // 账号信息
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(productDetailsQueryVo.getAgreementId());
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
+ PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
|
|
|
+ UnAutoProductDetailRequest unAutoProductDetailRequest = new UnAutoProductDetailRequest(parameters,productDetailsQueryVo);
|
|
|
+ UnAutoProductDetailResponse unAutoProductDetailResponse=null;
|
|
|
+ try{
|
|
|
+ unAutoProductDetailResponse= pinganRequestApiComponents.getUnAutoProductDetail(unAutoProductDetailRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(unAutoProductDetailResponse!=null && UnAutoProductDetailResponseCodeEnum.UN_AUTO_PRODUCT_DETAIL_CODE_MSG_0.getCode().equals(unAutoProductDetailResponse.getResultCode())){
|
|
|
+ List<UnAutoProductDetailResponse.UnAutoProductDetailsDTO> unAutoProductDetailsDTOList = unAutoProductDetailResponse.getUnAutoProductDetailsDTOList();
|
|
|
+ return HttpResult.ok(unAutoProductDetailsDTOList);
|
|
|
+ }
|
|
|
+ return HttpResult.error("接口失败");
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Description 报价 调用 3.1 4.1 、001、5.1
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/3/29 14:01
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
@Override
|
|
|
public HttpResult<QuoteRespVo> quote(BaseQuoteInfoVo quoteInfo, BaseQuoteVo<List<BoHaiQuoteAccidentVo>> quoteVo) throws Exception {
|
|
|
// 协议id获取配置实体
|
|
|
@@ -48,49 +152,618 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
// 车型查询
|
|
|
CarInfoVo carInfo = quoteInfo.getCarInfo();
|
|
|
|
|
|
- // 1. 标的信息
|
|
|
- IndexRequest indexRequest = new IndexRequest(parameters, carInfo);
|
|
|
- IndexResponse indexResponse = pinganRequestApiComponents.index(indexRequest);
|
|
|
- String flowid = indexResponse.getFlowid();
|
|
|
-
|
|
|
|
|
|
- // 2. 车型查询
|
|
|
- SearchPAVehicleListRequest searchPAVehicleListRequest = new SearchPAVehicleListRequest(parameters.getUserId(),
|
|
|
- carInfo.getModelcname(), flowid);
|
|
|
- SearchPAVehicleListResponse.ModelsDto modelsDto = pinganRequestApiComponents.searchPAVehicle(searchPAVehicleListRequest, carInfo);
|
|
|
+ try {
|
|
|
+ // 1. 标的信息
|
|
|
+ IndexRequest indexRequest = new IndexRequest(parameters, carInfo);
|
|
|
+ IndexResponse indexResponse = pinganRequestApiComponents.index(indexRequest);
|
|
|
+ // 此处返回的 flowid 4.1.续保确认 4.2.车辆信息确认 001 平安车型搜索接口 需要使用
|
|
|
+ String flowid = indexResponse.getFlowid();
|
|
|
|
|
|
- // 2. 车辆信息确认
|
|
|
- CarConfirmRequest carConfirmRequest = new CarConfirmRequest(parameters, quoteInfo, modelsDto);
|
|
|
- CarConfirmResponse carConfirmResponse = pinganRequestApiComponents.carConfirm(carConfirmRequest);
|
|
|
+ // 2. 车型查询
|
|
|
+ SearchPAVehicleListRequest searchPAVehicleListRequest = new SearchPAVehicleListRequest(parameters.getUserId(),
|
|
|
+ carInfo.getModelcname(), flowid);
|
|
|
+ SearchPAVehicleListResponse searchPAVehicleListResponse = pinganRequestApiComponents.searchPAVehicleList(searchPAVehicleListRequest);
|
|
|
+ SearchPAVehicleListResponse.ModelsDto modelsDto = pinganRequestApiComponents.searchPAVehicle(searchPAVehicleListResponse, carInfo);
|
|
|
|
|
|
+ // 3. 车辆信息确认
|
|
|
+ CarConfirmRequest carConfirmRequest = new CarConfirmRequest(parameters, quoteInfo, modelsDto,flowid);
|
|
|
+ CarConfirmResponse carConfirmResponse = pinganRequestApiComponents.carConfirm(carConfirmRequest);
|
|
|
|
|
|
+ //4.报价 使用车辆确认返回的流程id
|
|
|
+ QuoteRequest quoteRequest = new QuoteRequest(parameters, quoteInfo, modelsDto, carConfirmResponse.getFlowid(),"applyBiz",new QuoteRequest.BizQuoteDTO(),"applyForce","accommodationFlag", "applyUnAuto","applyXiaoWei",new ArrayList<QuoteRequest.UnAutoListInfoDTO>(),new ArrayList<QuoteRequest.UnAutoListInfoDTO>(),new ArrayList<QuoteRequest.Amount22XNYChargingPostListDTO>(), new ArrayList<QuoteRequest.Amount23XNYChargingPostListDTO>());
|
|
|
+ QuoteResponse quoteResponse=null;
|
|
|
+ try{
|
|
|
+ quoteResponse= pinganRequestApiComponents.quote(quoteRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(quoteResponse!=null){
|
|
|
+ //5.组装返回的报价信息
|
|
|
+ return getQuoteRespVo(quoteResponse, quoteInfo, ptlAgreementAttribution, modelsDto);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public HttpResult<Object> submitImage(String companyId) {
|
|
|
- return null;
|
|
|
+ public HttpResult<QuoteRespVo> getQuoteRespVo(QuoteResponse response,
|
|
|
+ BaseQuoteInfoVo yaQuoteInfoVo,
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution,
|
|
|
+ SearchPAVehicleListResponse.ModelsDto modelsDto) {
|
|
|
+
|
|
|
+ QuoteRespVo quoteRespVo = new QuoteRespVo();
|
|
|
+ // 交强险保费信息
|
|
|
+ QuoteResponse.ForceQuoteResultDTO forceQuoteResult = response.getForceQuoteResult();
|
|
|
+ //交强险保费
|
|
|
+ double jqPremium =0;
|
|
|
+ //车船税
|
|
|
+ double sumPayTax=0;
|
|
|
+ if (!ObjectUtils.isEmpty(forceQuoteResult)) {
|
|
|
+ //交+车船税总计
|
|
|
+ double totalPremium =Double.parseDouble(forceQuoteResult.getTotalPremium()==null?"0":forceQuoteResult.getTotalPremium()) ;
|
|
|
+ jqPremium = Double.parseDouble(forceQuoteResult.getForcePremium() == null ? "0" : forceQuoteResult.getForcePremium());
|
|
|
+ sumPayTax = Double.parseDouble(forceQuoteResult.getTaxPremium() == null ? "0" : forceQuoteResult.getTaxPremium());
|
|
|
+ quoteRespVo.setCiSumPermium(totalPremium);
|
|
|
+ quoteRespVo.setJqPremium(jqPremium);
|
|
|
+ //交强保单号
|
|
|
+ quoteRespVo.setJqApplyNo(forceQuoteResult.getQueryRequestCode());
|
|
|
+ }
|
|
|
+ QuoteResponse.QuoteDTO forceQuote = response.getForceQuote();
|
|
|
+ // 交强
|
|
|
+ quoteRespVo.setStartDateJq(forceQuote.getBeginDate());
|
|
|
+ quoteRespVo.setEndDateJq(forceQuote.getEndDate());
|
|
|
+ // 商业险
|
|
|
+ QuoteResponse.BizQuoteResultDTO bizQuoteResult = response.getBizQuoteResult();
|
|
|
+ //商业险险种
|
|
|
+ List<QuoteKindRespVo> kindList1 = new ArrayList<>();
|
|
|
+ //商业险保费
|
|
|
+ double syPremium =0;
|
|
|
+ if (!ObjectUtils.isEmpty(bizQuoteResult)) {
|
|
|
+ syPremium =Double.parseDouble(bizQuoteResult.getPremiumTotal()==null?"0":bizQuoteResult.getPremiumTotal()) ;;
|
|
|
+ //商业险保费
|
|
|
+ quoteRespVo.setSyPremium(syPremium);
|
|
|
+ //商业险保单号
|
|
|
+ quoteRespVo.setSyApplyNo(bizQuoteResult.getQueryRequestCode());
|
|
|
+ QuoteResponse.QuoteDTO bizQuote = response.getBizQuote();
|
|
|
+ // 交强
|
|
|
+ quoteRespVo.setStartDateJq(forceQuote.getBeginDate());
|
|
|
+ quoteRespVo.setEndDateJq(forceQuote.getEndDate());
|
|
|
+ // 商业 起保开始和结束时间
|
|
|
+ quoteRespVo.setStartDateSy(bizQuote.getBeginDate());
|
|
|
+ quoteRespVo.setEndDateSy(bizQuote.getEndDate());
|
|
|
+
|
|
|
+ // 商业险险种
|
|
|
+ List<QuoteResponse.ClauseCaseListDTO> clauseCaseList = bizQuoteResult.getClauseCaseList();
|
|
|
+ QuoteKindRespVo kind;
|
|
|
+ for (QuoteResponse.ClauseCaseListDTO clauseCaseListDTO: clauseCaseList) {
|
|
|
+ kind = new QuoteKindRespVo();
|
|
|
+ kind.setKindCode(clauseCaseListDTO.getProductCode());
|
|
|
+ kind.setKindName(clauseCaseListDTO.getProductName());
|
|
|
+ double amount = Double.parseDouble(clauseCaseListDTO.getAmount() == null ? "0" : clauseCaseListDTO.getAmount());
|
|
|
+ kind.setAmount(amount);
|
|
|
+ double count = Double.parseDouble(clauseCaseListDTO.getCount() == null ? "0" : clauseCaseListDTO.getCount());
|
|
|
+ kind.setUnitAmount(count);
|
|
|
+ //保费
|
|
|
+ kind.setCoveragePremium(amount*count);
|
|
|
+ kindList1.add(kind);
|
|
|
+ }
|
|
|
+ quoteRespVo.setKindList(kindList1);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 财意险保费
|
|
|
+ QuoteResponse.AhsUpcActualPremiumDTO ahsUpcActualPremium = response.getAhsUpcActualPremium();
|
|
|
+ // 小微险保费
|
|
|
+ QuoteResponse.XwActualPremiumDTO xwActualPremium = response.getXwActualPremium();
|
|
|
+ //小微险保费
|
|
|
+
|
|
|
+ List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
|
|
|
+ // 非车险
|
|
|
+ double jyPremium=0;
|
|
|
+ if (!ObjectUtils.isEmpty(ahsUpcActualPremium)) {
|
|
|
+ // 财意险总保费
|
|
|
+ double ahsUpcTotalPremium =Double.parseDouble(ahsUpcActualPremium.getAhsUpcTotalPremium()==null?"0":ahsUpcActualPremium.getAhsUpcTotalPremium()) ;;
|
|
|
+ jyPremium += ahsUpcTotalPremium;
|
|
|
+ }
|
|
|
+ if (!ObjectUtils.isEmpty(xwActualPremium)) {
|
|
|
+ double xwPremium =Double.parseDouble(xwActualPremium.getXwPremium()==null?"0":xwActualPremium.getXwPremium());
|
|
|
+ jyPremium += xwPremium;
|
|
|
+ }
|
|
|
+ // 报价险种放入保费
|
|
|
+ List<QuoteRiskRespVo> riskList1 = QuoteRiskRespVo.toQuoteRiskRespVoList(riskList, jqPremium, syPremium);
|
|
|
+
|
|
|
+ quoteRespVo.setRiskList(riskList1);
|
|
|
+ quoteRespVo.setJqPremium(jqPremium);
|
|
|
+ quoteRespVo.setSyPremium(syPremium);
|
|
|
+ quoteRespVo.setTaxAmount(sumPayTax);
|
|
|
+ quoteRespVo.setJyPremium(jyPremium);
|
|
|
+ quoteRespVo.setCiSumPermium(CalculateUtils.add(jqPremium, sumPayTax));//交强险和车船税合计
|
|
|
+ quoteRespVo.setSumPermium(CalculateUtils.add(jqPremium, syPremium, sumPayTax, jyPremium));//保费合计
|
|
|
+ quoteRespVo.setTotalAdjustRate(0);
|
|
|
+ quoteRespVo.setOrderno(yaQuoteInfoVo.getOrderNo()); //订单号
|
|
|
+ quoteRespVo.setCoreModels(modelsDto.toCoreModelsVo());
|
|
|
+ String orderId="";
|
|
|
+ //订单id???、
|
|
|
+ return responseOrder(response, quoteRespVo, ptlAgreementAttribution,orderId);
|
|
|
}
|
|
|
|
|
|
+ public HttpResult<QuoteRespVo> responseOrder(QuoteResponse response,
|
|
|
+ QuoteRespVo quoteRespVo,
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution,
|
|
|
+ String orderId) {
|
|
|
+ // 保存订单信息
|
|
|
+ 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=new HashMap<>();
|
|
|
+ QuoteResponse.AhsUpcActualPremiumDTO ahsUpcActualPremium = response.getAhsUpcActualPremium();
|
|
|
+ // 小微险保费
|
|
|
+ QuoteResponse.XwActualPremiumDTO xwActualPremium = response.getXwActualPremium();
|
|
|
+ map.put("xwActualPremium",xwActualPremium);
|
|
|
+ map.put("ahsUpcActualPremium",ahsUpcActualPremium);
|
|
|
+ // 驾意险 ???????
|
|
|
+ // insAreaCompany.setAccidentInfo(JSON.parseArray(JSON.toJSONString(map)));
|
|
|
+ // 车船税
|
|
|
+ QuoteResponse.ForceQuoteResultDTO.TaxDTO tax = response.getForceQuoteResult().getTax();
|
|
|
+ TaxArrears taxArrears = new TaxArrears("往年欠税", Double.parseDouble(tax.getLastYearPay()),
|
|
|
+ Double.parseDouble(tax.getDelayPayMoney()));
|
|
|
+ List<TaxArrears> taxArrearsList = Collections.singletonList(taxArrears);
|
|
|
+ insAreaCompany.setTaxArrears(JSON.parseArray(JSON.toJSONString(taxArrearsList)));
|
|
|
+ insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
|
|
|
+ quoteRespVo.setCompanyId(orderId);
|
|
|
+ return HttpResult.ok("报价成功", quoteRespVo);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Description 上传影像 上传文件 调用93
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/4/1 11:11
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
@Override
|
|
|
- public HttpResult<Object> audit(String companyId) {
|
|
|
- return null;
|
|
|
+ public HttpResult<Object> submitImage(String subOrderNo) {
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
|
+ // 账号信息
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
+ PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
+
|
|
|
+ List<InsTaskImagesBase64> insTaskImagesBase64s = insTaskImagesService.findByOrderNo(insAreaCompany.getOrderno(),
|
|
|
+ insAreaCompany.getId(), true);
|
|
|
+ if (insTaskImagesBase64s.isEmpty()) {
|
|
|
+ return HttpResult.error("影像集合为空");
|
|
|
+ }else{
|
|
|
+ List<UploadFilesRequest.DocListDTO> list=new ArrayList<>();
|
|
|
+ for (InsTaskImagesBase64 insTaskImagesBase64 : insTaskImagesBase64s) {
|
|
|
+ String docId= UUIDUtils.getOrderNum(properties.getClientId());
|
|
|
+ UploadFilesRequest.DocListDTO docListDTO = new UploadFilesRequest.DocListDTO(docId, "submitImage", insTaskImagesBase64.getImageType(), "submitImage" + insTaskImagesBase64.getImageType() + docId, insTaskImagesBase64.getFileName().split(".")[1],
|
|
|
+ null, subOrderNo, null, parameters.getUserId(), "openApi");
|
|
|
+ }
|
|
|
+ //调用文件上传
|
|
|
+ UploadFilesRequest uploadRequest=new UploadFilesRequest(list);
|
|
|
+
|
|
|
+ UploadFilesResponse uploadFilesResponse=null;
|
|
|
+ try{
|
|
|
+ uploadFilesResponse= pinganRequestApiComponents.uploadFiles(uploadRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(uploadFilesResponse!=null){
|
|
|
+ return HttpResult.ok(uploadFilesResponse.getResultCode());
|
|
|
+ }
|
|
|
+ return HttpResult.error("上传影像接口失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Description 提交核保 6.1 接口入参
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/4/1 11:12
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public HttpResult<Object> audit(String subOrderNo) {
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
|
+ // 账号信息
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
+ PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
+ BaseQuoteInfoVo quoteInfo=new BaseQuoteInfoVo();
|
|
|
+ String flowid="";
|
|
|
+ SearchPAVehicleListResponse.ModelsDto modelsDto =new SearchPAVehicleListResponse.ModelsDto();
|
|
|
+ //调用6.1 补充信息并核保
|
|
|
+ SubmitApplyRequest submitApplyRequest = new SubmitApplyRequest(parameters, quoteInfo, modelsDto,flowid);
|
|
|
+ SubmitApplyResponse submitApplyResponse=null;
|
|
|
+ try{
|
|
|
+ submitApplyResponse= pinganRequestApiComponents.submitApply(submitApplyRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(submitApplyResponse!=null){
|
|
|
+ return HttpResult.ok(submitApplyResponse.getResultCode());
|
|
|
+ }
|
|
|
+ return HttpResult.error("提交核保接口失败");
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @Description 获取保单pdf地址 调用 002
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/4/1 11:27
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public HttpResult<CrawlerPolicyPrintVo> getPolicyPrint(String subOrderNo) {
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
|
+ // 账号信息
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
+ PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
+ BaseQuoteVo<List<BoHaiQuoteAccidentVo>> quoteVo=new BaseQuoteVo<>();
|
|
|
+ //调用 电子保单pdf 001
|
|
|
+ PolicyPdfRequest policyPdfRequest = new PolicyPdfRequest(parameters,quoteVo,"checkNo","licenseNo","frameNo");
|
|
|
+ PolicyPdfResponse policyPdfResponse=null;
|
|
|
+ try{
|
|
|
+ policyPdfResponse= pinganRequestApiComponents.getPolicyPdf(policyPdfRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(policyPdfResponse!=null){
|
|
|
+ if(PolicyPdfResponseCodeEnum.POLICY_PDF_CODE_MSG_0.getCode().equals(policyPdfResponse.getResultCode())){
|
|
|
+ CrawlerPolicyPrintVo crawlerPolicyPrintVo =new CrawlerPolicyPrintVo();
|
|
|
+ if(Boolean.parseBoolean(policyPdfResponse.getPolicyPdf())){
|
|
|
+ crawlerPolicyPrintVo.setJqxPolicyUrl(policyPdfResponse.getPolicyPdf());
|
|
|
+ }else{
|
|
|
+ crawlerPolicyPrintVo.setSyxPolicyUrl(policyPdfResponse.getPolicyPdf());
|
|
|
+ }
|
|
|
+ return HttpResult.ok(crawlerPolicyPrintVo);
|
|
|
+ }else{
|
|
|
+ return HttpResult.error(PinAnEnumUtils.getEnumValueByCode(PolicyPdfResponseCodeEnum.class,policyPdfResponse.getResultCode()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return HttpResult.error("获取保单地址失败");
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Description 订单状态查询 调用承保接口 8.2
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/4/1 11:30
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public HttpResult<Object> getOrderDetail(String subOrderNo) {
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
|
+ //调用承保接口
|
|
|
+ String applyno = !StringUtils.isEmpty(insAreaCompany.getJqapplyno()) ? insAreaCompany.getJqapplyno() :
|
|
|
+ insAreaCompany.getSyapplyno();
|
|
|
+ AcceptRequest acceptRequest = new AcceptRequest(applyno);
|
|
|
+ AcceptResponse acceptResponse=null;
|
|
|
+ try{
|
|
|
+ acceptResponse= pinganRequestApiComponents.accept(acceptRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(acceptResponse!=null){
|
|
|
+ String status = acceptResponse.getDocumentList().get(0).getStatus();
|
|
|
+ if("0".equals(acceptResponse.getResultCode())){
|
|
|
+ //处理未承保状态的数据
|
|
|
+ if(AcceptResponseStatusCodeEnum.ACCEPT_CODE_STATUS_B3.equals(status)){
|
|
|
+ if(insAreaCompany.getPayDate()==null){
|
|
|
+ insAreaCompany.setPayDate(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
+ return HttpResult.ok("承保成功");
|
|
|
+ }else{
|
|
|
+ return HttpResult.ok(PinAnEnumUtils.getEnumValueByCode(AcceptResponseStatusCodeEnum.class,status));
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ return HttpResult.ok("承保失败");
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Description 核保状态查询 查询未缴费的状态订单通过调用支付的接口获取支付的链接信息 单证状态查询 9.1、 7.8
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/4/1 11:31
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
@Override
|
|
|
- public HttpResult<CrawlerPolicyPrintVo> getPolicyPrint(String companyId) {
|
|
|
- return null;
|
|
|
+ public HttpResult<Object> auditStatusQuery(String subOrderNo) {
|
|
|
+
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
|
+ //调用单证查询接口
|
|
|
+ String applyno = !StringUtils.isEmpty(insAreaCompany.getJqapplyno()) ? insAreaCompany.getJqapplyno() :
|
|
|
+ insAreaCompany.getSyapplyno();
|
|
|
+ // 账号信息
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
+ PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
+ DocumentStatusListRequest documentStatusListRequest=new DocumentStatusListRequest(subOrderNo,parameters);
|
|
|
+ DocumentStatusListResponse documentStatusListResponse=null;
|
|
|
+ try{
|
|
|
+ documentStatusListResponse= pinganRequestApiComponents.getDocumentStatusList(documentStatusListRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(documentStatusListResponse!=null) {
|
|
|
+ String status = documentStatusListResponse.getDocumentList().get(0).getStatus();
|
|
|
+ if(DocumentStatusListResponseCodeEnum.DOCUMENTSTATUSLIST_CODE_MSG_0.getCode().equals(documentStatusListResponse.getResultCode())){
|
|
|
+ //处理待缴费状态
|
|
|
+ if(AcceptResponseStatusCodeEnum.ACCEPT_CODE_STATUS_B2.equals(status)){
|
|
|
+ // 获取支付的链接 单证类型(01投保单02保单03批改申请单04批单05赔案号06报案号07通知单号)
|
|
|
+ ScanCodeURLRequest scanCodeURLRequest = new ScanCodeURLRequest(applyno,"02","68");
|
|
|
+ ScanCodeURLResponse scanCodeURLResponse=null;
|
|
|
+ try{
|
|
|
+ scanCodeURLResponse= pinganRequestApiComponents.getScanCodeURL(scanCodeURLRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ String payUrl = "";
|
|
|
+ //成功将支付的url链接赋值
|
|
|
+ if(scanCodeURLResponse!=null && ScanCodeURLResponseCodeEnum.SCAN_CODE_URL_CODE_MSG_Y.getCode().equals(scanCodeURLResponse.getResultCode())){
|
|
|
+ payUrl=scanCodeURLResponse.getScanCodeURLList().get(0).getScanCodeURL();
|
|
|
+ }else{
|
|
|
+ return HttpResult.error("二维码支付接口报错");
|
|
|
+ }
|
|
|
+ insAreaCompany.setPaymentLink(payUrl);
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
+ return HttpResult.ok("人工核保成功");
|
|
|
+ }else{
|
|
|
+ return HttpResult.ok(PinAnEnumUtils.getEnumValueByCode(DocumentStatusListResponseCodeEnum.class,status));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return HttpResult.error("人工核保失败");
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @Description 更新订单状态和支付时间
|
|
|
+ * @Author xingming
|
|
|
+ * @Date 2024/3/28 17:17
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void getOrderDetailNew(String subOrderNo) {
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
|
+ // 账号信息
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
+ BoHaiConfigureParameters parameters = configureParametersComponents.toEntity(BoHaiConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
|
|
|
+ //调用承保接口
|
|
|
+ String applyno = !StringUtils.isEmpty(insAreaCompany.getJqapplyno()) ? insAreaCompany.getJqapplyno() :
|
|
|
+ insAreaCompany.getSyapplyno();
|
|
|
+ AcceptRequest acceptRequest = new AcceptRequest(applyno);
|
|
|
+ AcceptResponse acceptResponse=null;
|
|
|
+ try{
|
|
|
+ acceptResponse= pinganRequestApiComponents.accept(acceptRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(acceptResponse!=null){
|
|
|
+ String status = acceptResponse.getDocumentList().get(0).getStatus();
|
|
|
+ if("0".equals(acceptResponse.getResultCode())){
|
|
|
+ //处理未承保状态的数据
|
|
|
+ if(AcceptResponseStatusCodeEnum.ACCEPT_CODE_STATUS_B3.equals(status)){
|
|
|
+ if(insAreaCompany.getPayDate()==null){
|
|
|
+ insAreaCompany.setPayDate(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Description 交管车辆验证码 4.3
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/4/1 16:05
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
@Override
|
|
|
- public HttpResult<Object> getOrderDetail(String companyId) {
|
|
|
- return null;
|
|
|
+ public HttpResult<Object> getDmvehicleInfo(BaseQuoteVo<List<BoHaiQuoteAccidentVo>> quoteVo,BaseQuoteInfoVo quoteInfo) {
|
|
|
+ // 协议id获取配置实体
|
|
|
+ String agreementId = quoteVo.getAgreementId();
|
|
|
+ // 账号信息
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(agreementId);
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
+ PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
+ try{
|
|
|
+ // 1. 标的信息
|
|
|
+ IndexRequest indexRequest = new IndexRequest(parameters, quoteInfo.getCarInfo());
|
|
|
+ IndexResponse indexResponse = pinganRequestApiComponents.index(indexRequest);
|
|
|
+ if(indexResponse!=null && IndexResposeCodeEnum.INDEX_CODE_MSG_0.getCode().equals(indexResponse.getResultCode())){
|
|
|
+ //调用 交管车辆验证码 4.3 传入标的接口返回的流程id
|
|
|
+ DmvehicleInfoRequst dmvehicleInfoRequst = new DmvehicleInfoRequst(parameters,indexResponse.getFlowid(),"frameNo","engineNo",null);
|
|
|
+ DmvehicleInfoResponse dmvehicleInfoResponse=null;
|
|
|
+ try{
|
|
|
+ dmvehicleInfoResponse= pinganRequestApiComponents.getDmvehicleInfo(dmvehicleInfoRequst);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(dmvehicleInfoResponse!=null){
|
|
|
+ return HttpResult.ok(dmvehicleInfoResponse.getResultCode());
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ return HttpResult.ok(PinAnEnumUtils.getEnumValueByCode(IndexResposeCodeEnum.class,indexResponse.getResultCode()));
|
|
|
+ }
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ return HttpResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ return HttpResult.error("获取交管车辆验证码失败");
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @Description 续保确认 4.1 需要先调用3.1返回流程id
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/4/1 16:23
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public HttpResult<Object> renewalConfirm(BaseQuoteVo<List<BoHaiQuoteAccidentVo>> quoteVo, BaseQuoteInfoVo quoteInfo) {
|
|
|
+ // 协议id获取配置实体
|
|
|
+ String agreementId = quoteVo.getAgreementId();
|
|
|
+ // 账号信息
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(agreementId);
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
+ PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
+ try{
|
|
|
+ // 1. 标的信息
|
|
|
+ IndexRequest indexRequest = new IndexRequest(parameters, quoteInfo.getCarInfo());
|
|
|
+ IndexResponse indexResponse = pinganRequestApiComponents.index(indexRequest);
|
|
|
+ if(indexResponse!=null && IndexResposeCodeEnum.INDEX_CODE_MSG_0.getCode().equals(indexResponse.getResultCode())){
|
|
|
+ //调用 续保确认 4.1 传入标的接口返回的流程id
|
|
|
+ RenewalConfirmRequest renewalConfirmRequest = new RenewalConfirmRequest(parameters,indexResponse.getFlowid(),"checkNo");
|
|
|
+ RenewalConfirmResponse renewalConfirmResponse=null;
|
|
|
+ try{
|
|
|
+ renewalConfirmResponse= pinganRequestApiComponents.renewalConfirm(renewalConfirmRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(renewalConfirmResponse!=null){
|
|
|
+ return HttpResult.ok(renewalConfirmResponse.getResultCode());
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ return HttpResult.ok(PinAnEnumUtils.getEnumValueByCode(IndexResposeCodeEnum.class,indexResponse.getResultCode()));
|
|
|
+ }
|
|
|
|
|
|
+ }catch (Exception e){
|
|
|
+ return HttpResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+ return HttpResult.error("续保确认失败");
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Description 服务类特约检索 5.2
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/4/1 16:30
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
@Override
|
|
|
- public HttpResult<Object> auditStatusQuery(String companyId) {
|
|
|
+ public HttpResult<Object> queryServiceContract(BaseQuoteVo<List<BoHaiQuoteAccidentVo>> quoteVo, BaseQuoteInfoVo quoteInfo) {
|
|
|
+ try{
|
|
|
+ //调用
|
|
|
+ ServiceContractRequest serviceContractRequest = new ServiceContractRequest(quoteVo.getCompanyId());
|
|
|
+ ServiceContractResponse serviceContractResponse=null;
|
|
|
+ try{
|
|
|
+ serviceContractResponse= pinganRequestApiComponents.queryServiceContract(serviceContractRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(serviceContractResponse!=null) {
|
|
|
+ return HttpResult.ok(serviceContractResponse.getResultCode());
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ return HttpResult.error(e.getMessage());
|
|
|
+ }
|
|
|
return null;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @Description 单证状态查询 9.1
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/4/1 16:31
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public HttpResult<Object> getDocumentStatusList(String subOrderNo,BaseQuoteVo<List<BoHaiQuoteAccidentVo>> quoteVo,BaseQuoteInfoVo quoteInfo) {
|
|
|
+
|
|
|
+ try{
|
|
|
+ //调用
|
|
|
+ // 协议id获取配置实体
|
|
|
+ String agreementId = quoteVo.getAgreementId();
|
|
|
+ // 账号信息
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(agreementId);
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
+ PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
+ DocumentStatusListRequest documentStatusListRequest=new DocumentStatusListRequest(subOrderNo,parameters);
|
|
|
+ DocumentStatusListResponse documentStatusListResponse=null;
|
|
|
+ try{
|
|
|
+ documentStatusListResponse= pinganRequestApiComponents.getDocumentStatusList(documentStatusListRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(documentStatusListResponse!=null) {
|
|
|
+ return HttpResult.ok(documentStatusListResponse.getResultCode());
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ return HttpResult.error(e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return HttpResult.error("单证状态查询失败");
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Description 撤销单证 9.2
|
|
|
+ * @Author hxl
|
|
|
+ * @Date 2024/4/1 16:31
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public HttpResult<Object> repealDocument(String subOrderNo,BaseQuoteVo<List<BoHaiQuoteAccidentVo>> quoteVo, BaseQuoteInfoVo quoteInfo) {
|
|
|
+ try{
|
|
|
+ //调用
|
|
|
+ // 协议id获取配置实体
|
|
|
+ String agreementId = quoteVo.getAgreementId();
|
|
|
+ // 账号信息
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(agreementId);
|
|
|
+ // 通过 协议id获取配置实体
|
|
|
+ PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
|
|
|
+ ptlAgreementAttribution);
|
|
|
+ RepealDocumentRequest repealDocumentRequest=new RepealDocumentRequest(subOrderNo,quoteVo,quoteInfo,"2");
|
|
|
+ RepealDocumentResponse repealDocumentResponse=null;
|
|
|
+ try{
|
|
|
+ repealDocumentResponse= pinganRequestApiComponents.repealDocument(repealDocumentRequest);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if(repealDocumentResponse!=null) {
|
|
|
+ return HttpResult.ok(repealDocumentResponse.getResultCode());
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ return HttpResult.error(e.getMessage());
|
|
|
+ }
|
|
|
|
|
|
+ return HttpResult.error("撤销单证失败");
|
|
|
+ }
|
|
|
|
|
|
}
|