|
|
@@ -37,14 +37,12 @@ import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
|
|
|
import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
|
|
|
import com.ydtech.modules.order.entity.po.InsTaskImages;
|
|
|
import com.ydtech.modules.order.entity.po.InsUploadFiles;
|
|
|
+import com.ydtech.modules.order.entity.po.PinganShUploafile;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
import com.ydtech.modules.order.entity.vo.InsDrivingIntentionInsuranceVo;
|
|
|
import com.ydtech.modules.order.entity.vo.SpecialAuditVo;
|
|
|
import com.ydtech.modules.order.entity.vo.bohai.ProductDetailsQueryVo;
|
|
|
-import com.ydtech.modules.order.entity.vo.pingan.InsDrivingIntentionInsuranceSonVo;
|
|
|
-import com.ydtech.modules.order.entity.vo.pingan.PingAnQuoteVo;
|
|
|
-import com.ydtech.modules.order.entity.vo.pingan.RenewalConfirmVo;
|
|
|
-import com.ydtech.modules.order.entity.vo.pingan.StorefrontQueryVo;
|
|
|
+import com.ydtech.modules.order.entity.vo.pingan.*;
|
|
|
import com.ydtech.modules.order.service.*;
|
|
|
import com.ydtech.modules.order.utils.MD5Util;
|
|
|
import com.ydtech.modules.order.utils.PingAnUpLoadUtils;
|
|
|
@@ -67,6 +65,8 @@ import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
/**
|
|
|
* @version 平安接口相关api
|
|
|
* @author: hxl
|
|
|
@@ -111,6 +111,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
|
|
|
private final QrCodeGenerator qrCodeGenerator;
|
|
|
|
|
|
+ private final PinganShUploafileService pinganShUploafileService;
|
|
|
+
|
|
|
/**
|
|
|
* @Description 获取财意险险种套餐列表 调用 4.4
|
|
|
* @Author hxl
|
|
|
@@ -585,9 +587,11 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
String fileName = file.getName();
|
|
|
String documentName = fileName.split("\\.")[0];
|
|
|
String documentFormat = fileName.split("\\.")[1];
|
|
|
- boolean upLoadFileFlag = PingAnUpLoadUtils.getUpLoadFile(properties.getHost(), properties.getBucket(), properties.getAk(), properties.getSk(), file, key);
|
|
|
- if(!upLoadFileFlag){
|
|
|
- throw new SystemException("上传影像文件失败");
|
|
|
+ if(StringUtils.isBlank(insUploadImagesDto.getPinganKey())){
|
|
|
+ boolean upLoadFileFlag = PingAnUpLoadUtils.getUpLoadFile(properties.getHost(), properties.getBucket(), properties.getAk(), properties.getSk(), file, key);
|
|
|
+ if(!upLoadFileFlag){
|
|
|
+ throw new SystemException("上传影像文件失败");
|
|
|
+ }
|
|
|
}
|
|
|
UploadFilesRequest.DocListDTO docListDTO = new UploadFilesRequest.DocListDTO(key, documentClass, documentType, documentName,documentFormat ,
|
|
|
null);
|
|
|
@@ -645,9 +649,9 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
//商业特约
|
|
|
List<SubmitApplyRequest.BizSpecialPromiseListDTO> forceSpecialPromiseList=new ArrayList<SubmitApplyRequest.BizSpecialPromiseListDTO>();
|
|
|
//UploadFilesResponse uploadFilesResponse = getUploadResponseByParam(insAreaCompany,pinganApiLog,parameters.getUserId());
|
|
|
- // if (uploadFilesResponse != null & !"0".equals(uploadFilesResponse.getResultCode()) ) {
|
|
|
+ // if (uploadFilesResponse != null & !"0".equals(uploadFilesResponse.getResultCode()) ) {
|
|
|
// throw new SystemException(uploadFilesResponse.getResultMessage());
|
|
|
- // }
|
|
|
+ // }
|
|
|
//调用6.1 补充信息并核保
|
|
|
SubmitApplyRequest submitApplyRequest = new SubmitApplyRequest(parameters,flowid, "true",insOrders,null,null,null);
|
|
|
SubmitApplyResponse submitApplyResponse = null;
|
|
|
@@ -656,112 +660,298 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
} catch (Exception e) {
|
|
|
throw new SystemException(e.getMessage());
|
|
|
}
|
|
|
+ Map<String,Map<String,String>> docListMap=new HashMap<String,Map<String,String>>();
|
|
|
+ List<InsUploadImagesDto> imgList = insTaskImagesMapper.getByOrderNoInsUploadImagesDtoList(insAreaCompany.getOrderno());
|
|
|
+ List<SubmitApplyRequest.DocListDTO> list = new ArrayList<>();
|
|
|
+ for (InsUploadImagesDto insUploadImagesDto : imgList) {
|
|
|
+ InsUploadFiles fiels = insUploadFilesService.getById(insUploadImagesDto.getImageId());
|
|
|
+ String key="";
|
|
|
+ File file =new File(fiels.getFilePath());
|
|
|
+ PingAnDocumentClassEnum fileEnum = PingAnDocumentClassEnum.getCode(insUploadImagesDto.getImageType());
|
|
|
+ String documentClass=fileEnum.getDocument();
|
|
|
+ String documentType=fileEnum.getDocumentType();
|
|
|
+ String fileName = file.getName();
|
|
|
+ String documentName = fileName.split("\\.")[0];
|
|
|
+ String documentFormat = fileName.split("\\.")[1];
|
|
|
+ if(StringUtils.isBlank(insUploadImagesDto.getPinganKey())){
|
|
|
+ key=parameters.getUserId()+"-"+new SimpleDateFormat("yyyyMMddhhmmss").format(new Date())+"-"+UUID.randomUUID();
|
|
|
+ boolean upLoadFileFlag = PingAnUpLoadUtils.getUpLoadFile(properties.getHost(), properties.getBucket(), properties.getAk(), properties.getSk(), file, key);
|
|
|
+ if(!upLoadFileFlag){
|
|
|
+ throw new SystemException("上传影像文件失败");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ key=insUploadImagesDto.getPinganKey();
|
|
|
+ }
|
|
|
+ if(!docListMap.containsKey(documentClass)){
|
|
|
+ Map<String,String> docMap =new HashMap<String,String>();
|
|
|
+ docMap.put(documentType,fileEnum.getDesc());
|
|
|
+ docListMap.put(fileEnum.getDocument(),docMap);
|
|
|
+ }else{
|
|
|
+ Map<String,String> docMap =docListMap.get(documentClass);
|
|
|
+ docMap.put(documentType,fileEnum.getDesc());
|
|
|
+ docListMap.put(fileEnum.getDocument(),docMap);
|
|
|
+ }
|
|
|
+ SubmitApplyRequest.DocListDTO docListDTO = new SubmitApplyRequest.DocListDTO(key, documentClass, documentType, documentName,documentFormat);
|
|
|
+ list.add(docListDTO);
|
|
|
+ }
|
|
|
if (submitApplyResponse != null) {
|
|
|
- // 事中资料 15 时上传资料
|
|
|
- if("15".equals(submitApplyResponse.getResultCode())){
|
|
|
- submitApplyRequest.setDocList(null);
|
|
|
- try {
|
|
|
- submitApplyResponse = pinganRequestApiComponents.submitApply(submitApplyRequest,pinganApiLog);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new SystemException(e.getMessage());
|
|
|
+ //验证上传图片信息
|
|
|
+ List<SubmitApplyResponse.BizMissFileDTO> bizMissFilelist = submitApplyResponse.getBizMissFilelist();
|
|
|
+ List<SubmitApplyResponse.BizMissFileDTO> forceMissFilelist = submitApplyResponse.getForceMissFilelist();
|
|
|
+
|
|
|
+ //商业险上传文件缺失集合
|
|
|
+ String msg="";
|
|
|
+ if(bizMissFilelist!=null && bizMissFilelist.size()>0){
|
|
|
+ for(SubmitApplyResponse.BizMissFileDTO dto : bizMissFilelist){
|
|
|
+ //验证文件是否上传
|
|
|
+ msg+=checkDocList(docListMap,dto,"1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //交强
|
|
|
+ if(forceMissFilelist!=null && forceMissFilelist.size()>0){
|
|
|
+ for(SubmitApplyResponse.BizMissFileDTO dto : forceMissFilelist){
|
|
|
+ //验证文件是否上传
|
|
|
+ msg+=checkDocList(docListMap,dto,"1");
|
|
|
}
|
|
|
}
|
|
|
+ if(StringUtils.isNotBlank(msg)){
|
|
|
+ throw new SystemException(msg);
|
|
|
+ }
|
|
|
+
|
|
|
+ //商业险上传文件缺失集合保存
|
|
|
+ List<PinganShUploafile> shDocList = getSHDocList(bizMissFilelist, forceMissFilelist, insAreaCompany.getId());
|
|
|
+ // 事中资料 15 时上传资料 5 为验证
|
|
|
+ if("15".equals(submitApplyResponse.getResultCode()) || "5".equals(submitApplyResponse.getResultCode()) ){
|
|
|
+ /**
|
|
|
+ //更新为待核保状态
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
+ insAreaCompanyService.updateById(insAreaCompany);
|
|
|
+ //获取上传的事中资料
|
|
|
+ submitApplyRequest.setDocList(!list.isEmpty() ?list:null);
|
|
|
+ pinganApiLog.setId(null);
|
|
|
+ try {
|
|
|
+ submitApplyResponse = pinganRequestApiComponents.submitApply(submitApplyRequest,pinganApiLog);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ **/
|
|
|
+ }
|
|
|
//核保成功
|
|
|
- if("0".equals(submitApplyResponse.getResultCode())) {
|
|
|
- //查询核保状态
|
|
|
- String bizApplyNo = submitApplyResponse.getBizApplyNo()==null?"":submitApplyResponse.getBizApplyNo();
|
|
|
- String forceApplyNo = submitApplyResponse.getForceApplyNo()==null?"":submitApplyResponse.getForceApplyNo();
|
|
|
+ if("0".equals(submitApplyResponse.getResultCode()) || (submitApplyResponse.getResultMessage().contains("商业险核保结果:申请投保完成!; 交强险核保结果:申请投保完成!"))) {
|
|
|
+ //保存事后上传资料
|
|
|
+ if(shDocList!=null && shDocList.size()>0){
|
|
|
+ pinganShUploafileService.saveBatch(shDocList);
|
|
|
+ }
|
|
|
+ String bizApplyNo = submitApplyResponse.getBizApplyNo()==null?"": submitApplyResponse.getBizApplyNo();
|
|
|
+ String forceApplyNo = submitApplyResponse.getForceApplyNo()==null?"": submitApplyResponse.getForceApplyNo();
|
|
|
List<SubmitApplyResponse.AccidentApplyPolicyNoDTO> accidentApplyPolicyNoList = submitApplyResponse.getAccidentApplyPolicyNoList();
|
|
|
String accidentApplyNo =null;
|
|
|
if(accidentApplyPolicyNoList!=null && accidentApplyPolicyNoList.size()>0){
|
|
|
SubmitApplyResponse.AccidentApplyPolicyNoDTO accidentApplyPolicyNoDTO = accidentApplyPolicyNoList.get(0);
|
|
|
accidentApplyNo = accidentApplyPolicyNoDTO.getPolicyAppNumber();
|
|
|
}
|
|
|
- List<String> list = new ArrayList<String>();
|
|
|
- if (StringUtils.isNotBlank(bizApplyNo)) {
|
|
|
- list.add(bizApplyNo);
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(forceApplyNo)) {
|
|
|
- list.add(forceApplyNo);
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(accidentApplyNo)) {
|
|
|
- // list.add(accidentApplyNo);
|
|
|
- }
|
|
|
- pinganApiLog.setId(null);
|
|
|
- DocumentStatusListRequest documentStatusListRequest = new DocumentStatusListRequest(list, parameters);
|
|
|
- DocumentStatusListResponse documentStatusListResponse = null;
|
|
|
- try {
|
|
|
- documentStatusListResponse = pinganRequestApiComponents.getDocumentStatusList(documentStatusListRequest,pinganApiLog);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new SystemException(e.getMessage());
|
|
|
+ submitApplyRequest.setDocList(!list.isEmpty() ?list:null);
|
|
|
+ //查询核保状态
|
|
|
+ return getObjectHttpResult(submitApplyResponse, pinganApiLog, parameters, insAreaCompany,forceApplyNo,bizApplyNo,accidentApplyNo);
|
|
|
+ }else{
|
|
|
+ Map<String, String> map = getNoByStr(submitApplyResponse.getResultMessage());
|
|
|
+ if(map!=null && map.size()>0) {
|
|
|
+ return getObjectHttpResult(submitApplyResponse, pinganApiLog, parameters, insAreaCompany,map.get("jqpolicyno"),map.get("sypolicyno"),map.get("application"));
|
|
|
}
|
|
|
- if (documentStatusListResponse != null && "0".equals(documentStatusListResponse.getResultCode())) {
|
|
|
- ArrayList<DocumentStatusListResponse.DocumentDTO> documentList = documentStatusListResponse.getDocumentList();
|
|
|
- if (documentList != null && documentList.size() > 0) {
|
|
|
- Boolean jqflag = false;
|
|
|
- Boolean sqflag = false;
|
|
|
- Boolean fcflag = false;
|
|
|
- String jyPlicyNo=null;
|
|
|
- //B2 为 未缴费
|
|
|
- for (DocumentStatusListResponse.DocumentDTO dto : documentList) {
|
|
|
- if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(bizApplyNo) && bizApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
|
|
|
- sqflag = true;
|
|
|
- }
|
|
|
- if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(forceApplyNo) && forceApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
|
|
|
- jqflag = true;
|
|
|
- }
|
|
|
- List<DocumentStatusListResponse.DocumentDTO.UnAutoListInfoDTO> unAutoListInfo = dto.getUnAutoListInfo();
|
|
|
- String applyNo=null;
|
|
|
- String policyNo=null;
|
|
|
- if(unAutoListInfo!=null && unAutoListInfo.size()>0){
|
|
|
- applyNo = unAutoListInfo.get(0).getApplyNo();
|
|
|
- policyNo = unAutoListInfo.get(0).getPolicyNo();
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(accidentApplyNo) && accidentApplyNo.equals(applyNo == null ? "" : applyNo)) {
|
|
|
- fcflag = true;
|
|
|
- jyPlicyNo=policyNo;
|
|
|
- }
|
|
|
- if (OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(dto.getStatus()) && StringUtils.isNotBlank(policyNo)) {
|
|
|
- fcflag = true;
|
|
|
- }
|
|
|
- }
|
|
|
- if (jqflag) {
|
|
|
- insAreaCompany.setJqapplyno(forceApplyNo);
|
|
|
- }
|
|
|
- if(sqflag){
|
|
|
- insAreaCompany.setSyapplyno(bizApplyNo);
|
|
|
- }
|
|
|
- if(fcflag){
|
|
|
- List<Map<String,String>> jyList =new ArrayList<Map<String,String>>();
|
|
|
- Map<String,String> map =new HashMap<String,String>();
|
|
|
- //投保单号
|
|
|
- map.put("application",accidentApplyNo);
|
|
|
- map.put("policy","");
|
|
|
- jyList.add(map);
|
|
|
- JSONArray objects = JSON.parseArray(JSON.toJSONString(jyList));
|
|
|
- insAreaCompany.setCrossInsurance(objects);
|
|
|
+ throw new SystemException(submitApplyResponse.getResultMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return HttpResult.error("提交核保接口失败");
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/8/16 18:00
|
|
|
+ * @Description: 获取事后资料上传文件
|
|
|
+ */
|
|
|
+ private List<PinganShUploafile> getSHDocList(List<SubmitApplyResponse.BizMissFileDTO> bizMissFilelist, List<SubmitApplyResponse.BizMissFileDTO> forceMissFilelist, String subOrderNo) {
|
|
|
+ List<PinganShUploafile> list = new ArrayList<>();
|
|
|
+ if(bizMissFilelist!=null && bizMissFilelist.size()>0){
|
|
|
+ for(SubmitApplyResponse.BizMissFileDTO dto:bizMissFilelist){
|
|
|
+ //文件大类
|
|
|
+ String documentClass = dto.getDocumentClass();
|
|
|
+ //文件大类名称
|
|
|
+ String documentClassName = dto.getDocumentClassName();
|
|
|
+ // 1. 其中1个 0 全部上传
|
|
|
+ String isAnyOne = dto.getIsAnyOne();
|
|
|
+ //子类集合
|
|
|
+ List<SubmitApplyResponse.BizMissFileDTO.DocTypeDTO> docTypeList = dto.getDocTypeList();
|
|
|
+ if(docTypeList!=null && docTypeList.size()>0) {
|
|
|
+ for (SubmitApplyResponse.BizMissFileDTO.DocTypeDTO vo : docTypeList) {
|
|
|
+ //验证核保时上传的资料
|
|
|
+ if ("0".equals(vo.getIsNeedDuringAudit())) {
|
|
|
+ PinganShUploafile entity = new PinganShUploafile(subOrderNo, documentClass, documentClassName, isAnyOne, vo.getDocumentType(), vo.getDocumentTypeName(), vo.getIsNeedDuringAudit(), "0", new Date());
|
|
|
+ list.add(entity);
|
|
|
}
|
|
|
- pinganApiLog.setId(null);
|
|
|
- //上传影像
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
|
|
|
- //说明核保成功,更新大订单和小订单的状态为1 更新为已核保待缴费
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
- insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
- UploadFilesResponse uploadFilesResponse = getUploadResponseByParam(insAreaCompany,pinganApiLog,parameters.getUserId());
|
|
|
- if (uploadFilesResponse != null & !"0".equals(uploadFilesResponse.getResultCode()) ) {
|
|
|
- throw new SystemException(uploadFilesResponse.getResultMessage());
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/8/16 16:23
|
|
|
+ * @Description: 验证上传的资料
|
|
|
+ * 1需要核保时上传,0是事后资料通过uploadFiles接口上传
|
|
|
+ */
|
|
|
+ private String checkDocList(Map<String,Map<String,String>> map, SubmitApplyResponse.BizMissFileDTO dto,String type) {
|
|
|
+ //文件大类
|
|
|
+ String documentClass = dto.getDocumentClass();
|
|
|
+ //文件大类名称
|
|
|
+ String documentClassName = dto.getDocumentClassName();
|
|
|
+ // 1. 其中1个 0 全部上传
|
|
|
+ String isAnyOne = dto.getIsAnyOne();
|
|
|
+ //子类集合
|
|
|
+ List<SubmitApplyResponse.BizMissFileDTO.DocTypeDTO> docTypeList = dto.getDocTypeList();
|
|
|
+ int count =0;
|
|
|
+ String msg="";
|
|
|
+ if(docTypeList!=null && docTypeList.size()>0){
|
|
|
+ if(map!=null && map.size()>0){
|
|
|
+ Map<String, String> docMap= map.get(documentClass);
|
|
|
+ if(docMap==null || docMap.size()==0){
|
|
|
+ msg+="(" +documentClassName +")";
|
|
|
+ for(SubmitApplyResponse.BizMissFileDTO.DocTypeDTO vo : docTypeList){
|
|
|
+ //验证核保时上传的资料
|
|
|
+ if(type.equals(vo.getIsNeedDuringAudit())){
|
|
|
+ msg+=vo.getDocumentTypeName()+"/";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ msg+="(" +documentClassName +")";
|
|
|
+ for(SubmitApplyResponse.BizMissFileDTO.DocTypeDTO vo : docTypeList){
|
|
|
+ //验证核保时上传的资料
|
|
|
+ if(type.equals(vo.getIsNeedDuringAudit())){
|
|
|
+ String val = docMap.get(vo.getDocumentType());
|
|
|
+ msg+=vo.getDocumentTypeName()+"/";
|
|
|
+ if(StringUtils.isNotBlank(val)){
|
|
|
+ count++;
|
|
|
+ }
|
|
|
}
|
|
|
- return HttpResult.ok("提交核保成功");
|
|
|
}
|
|
|
- } else {
|
|
|
- throw new SystemException(documentStatusListResponse.getResultMessage());
|
|
|
}
|
|
|
}else{
|
|
|
- throw new SystemException(submitApplyResponse.getResultMessage());
|
|
|
+ msg+="(" +documentClassName +")";
|
|
|
+ for(SubmitApplyResponse.BizMissFileDTO.DocTypeDTO vo : docTypeList){
|
|
|
+ //验证核保时上传的资料
|
|
|
+ if(type.equals(vo.getIsNeedDuringAudit())){
|
|
|
+ msg+=vo.getDocumentTypeName()+"/";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if("1".equals(isAnyOne) && count==0){
|
|
|
+ msg+="中必须上传一个,请确认!!";
|
|
|
+ }
|
|
|
+ if("0".equals(isAnyOne) && count!=docTypeList.size()){
|
|
|
+ msg+="中必须全部上传,请确认!!";
|
|
|
}
|
|
|
}
|
|
|
- return HttpResult.error("提交核保接口失败");
|
|
|
+ return msg;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/8/16 11:47
|
|
|
+ * @Description: 核保更新
|
|
|
+ */
|
|
|
+ private HttpResult<Object> getObjectHttpResult(SubmitApplyResponse submitApplyResponse, PinganApiLog pinganApiLog, PingAnConfigureParameters parameters, InsAreaCompany insAreaCompany,String forceApplyNo,String bizApplyNo,String accidentApplyNo) {
|
|
|
+
|
|
|
+ List<String> list = new ArrayList<String>();
|
|
|
+ if (StringUtils.isNotBlank(bizApplyNo)) {
|
|
|
+ list.add(bizApplyNo);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(forceApplyNo)) {
|
|
|
+ list.add(forceApplyNo);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(accidentApplyNo)) {
|
|
|
+ // list.add(accidentApplyNo);
|
|
|
+ }
|
|
|
+ pinganApiLog.setId(null);
|
|
|
+ DocumentStatusListRequest documentStatusListRequest = new DocumentStatusListRequest(list, parameters);
|
|
|
+ DocumentStatusListResponse documentStatusListResponse = null;
|
|
|
+ try {
|
|
|
+ documentStatusListResponse = pinganRequestApiComponents.getDocumentStatusList(documentStatusListRequest, pinganApiLog);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ if (documentStatusListResponse != null && "0".equals(documentStatusListResponse.getResultCode())) {
|
|
|
+ ArrayList<DocumentStatusListResponse.DocumentDTO> documentList = documentStatusListResponse.getDocumentList();
|
|
|
+ if (documentList != null && documentList.size() > 0) {
|
|
|
+ Boolean jqflag = false;
|
|
|
+ Boolean sqflag = false;
|
|
|
+ Boolean fcflag = false;
|
|
|
+ String jyPlicyNo=null;
|
|
|
+ String status="";
|
|
|
+ //B2 为 未缴费
|
|
|
+ for (DocumentStatusListResponse.DocumentDTO dto : documentList) {
|
|
|
+ status = dto.getStatus();
|
|
|
+ if (StringUtils.isNotBlank(bizApplyNo) && bizApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
|
|
|
+ sqflag = true;
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(forceApplyNo) && forceApplyNo.equals(dto.getApplyNo()==null?"":dto.getApplyNo())) {
|
|
|
+ jqflag = true;
|
|
|
+ }
|
|
|
+ List<DocumentStatusListResponse.DocumentDTO.UnAutoListInfoDTO> unAutoListInfo = dto.getUnAutoListInfo();
|
|
|
+ String applyNo=null;
|
|
|
+ String policyNo=null;
|
|
|
+ if(unAutoListInfo!=null && unAutoListInfo.size()>0){
|
|
|
+ applyNo = unAutoListInfo.get(0).getApplyNo();
|
|
|
+ policyNo = unAutoListInfo.get(0).getPolicyNo();
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(accidentApplyNo) && accidentApplyNo.equals(applyNo == null ? "" : applyNo)) {
|
|
|
+ fcflag = true;
|
|
|
+ jyPlicyNo=policyNo;
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(policyNo)) {
|
|
|
+ fcflag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (jqflag) {
|
|
|
+ insAreaCompany.setJqapplyno(forceApplyNo);
|
|
|
+ }
|
|
|
+ if(sqflag){
|
|
|
+ insAreaCompany.setSyapplyno(bizApplyNo);
|
|
|
+ }
|
|
|
+ if(fcflag){
|
|
|
+ List<Map<String,String>> jyList =new ArrayList<Map<String,String>>();
|
|
|
+ Map<String,String> map =new HashMap<String,String>();
|
|
|
+ //投保单号
|
|
|
+ map.put("application",accidentApplyNo);
|
|
|
+ map.put("policy","");
|
|
|
+ jyList.add(map);
|
|
|
+ JSONArray objects = JSON.parseArray(JSON.toJSONString(jyList));
|
|
|
+ insAreaCompany.setCrossInsurance(objects);
|
|
|
+ }
|
|
|
+ pinganApiLog.setId(null);
|
|
|
+ //更新狀態
|
|
|
+ if((OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status) || OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status)) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()))){
|
|
|
+ //说明核保成功,更新大订单和小订单的状态为2 更新为已核保待缴费
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
|
|
|
+ }else if((OrderStatusCodeEnum.ORDER_STATUS_CODE_BH.getCode().equals(status) || OrderStatusCodeEnum.ORDER_STATUS_CODE_BE.getCode().equals(status)
|
|
|
+ || OrderStatusCodeEnum.ORDER_STATUS_CODE_B1.getCode().equals(status) || OrderStatusCodeEnum.ORDER_STATUS_CODE_B6.getCode().equals(status) ) && ("0".equals(insAreaCompany.getOrderstatus()))){
|
|
|
+ // 待验车 BH 资料人工审核-BE B1 B6
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
+ }
|
|
|
+ insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
+ //UploadFilesResponse uploadFilesResponse = getUploadResponseByParam(insAreaCompany, pinganApiLog, parameters.getUserId());
|
|
|
+ //if (uploadFilesResponse != null & !"0".equals(uploadFilesResponse.getResultCode()) ) {
|
|
|
+ // throw new SystemException(uploadFilesResponse.getResultMessage());
|
|
|
+ // }
|
|
|
+ return HttpResult.ok("提交核保成功");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new SystemException(documentStatusListResponse.getResultMessage());
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @version
|
|
|
* @author: hxl
|
|
|
@@ -1014,8 +1204,6 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
|
//调用单证查询接口
|
|
|
- String applyno = !StringUtils.isEmpty(insAreaCompany.getJqapplyno()) ? insAreaCompany.getJqapplyno() :
|
|
|
- insAreaCompany.getSyapplyno();
|
|
|
// 账号信息
|
|
|
PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
|
|
|
// 通过 协议id获取配置实体
|
|
|
@@ -1389,8 +1577,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
insAreaCompany.setCrossInsurance(objects);
|
|
|
}
|
|
|
logger.info(documentStatusListResponse.toString()+"调用状态查询接口");
|
|
|
- if(OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()) )){
|
|
|
- //说明核保成功,更新大订单和小订单的状态为1 更新为已核保待缴费
|
|
|
+ if((OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status) || OrderStatusCodeEnum.ORDER_STATUS_CODE_B2.getCode().equals(status)) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()) )){
|
|
|
+ //说明核保成功,更新大订单和小订单的状态为1 更新为已核保待缴费 B6 自核
|
|
|
insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode() );
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
}else if(OrderStatusCodeEnum.ORDER_STATUS_CODE_B5.getCode().equals(status) && ("0".equals(insAreaCompany.getOrderstatus()) || "1".equals(insAreaCompany.getOrderstatus()) || "2".equals(insAreaCompany.getOrderstatus()))) {
|
|
|
@@ -1399,6 +1587,10 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
insAreaCompany.setPayDate(LocalDateTime.now());
|
|
|
insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
|
|
|
logger.info(insAreaCompany.toString()+"更新为承保状态!!!");
|
|
|
+ }else if(OrderStatusCodeEnum.ORDER_STATUS_CODE_BH.getCode().equals(status) || OrderStatusCodeEnum.ORDER_STATUS_CODE_BE.getCode().equals(status)
|
|
|
+ || OrderStatusCodeEnum.ORDER_STATUS_CODE_B1.getCode().equals(status) || OrderStatusCodeEnum.ORDER_STATUS_CODE_B6.getCode().equals(status)){
|
|
|
+ // 待验车 BH 资料人工审核-BE B1 B6
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
|
|
|
}
|
|
|
}
|
|
|
return HttpResult.ok(documentStatusListResponse);
|
|
|
@@ -2031,6 +2223,69 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
return HttpResult.error("支付失败");
|
|
|
}
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/8/16 19:45
|
|
|
+ * @Description: 事后补传资料
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public HttpResult<Object> additionalInformation(AdditionalInformation additionalInformation) {
|
|
|
+ String companyId = additionalInformation.getCompanyId();
|
|
|
+ if(StringUtils.isBlank(companyId)){
|
|
|
+ throw new SystemException("子订单id不能为空!!!");
|
|
|
+ }
|
|
|
+ List<String> imageList = additionalInformation.getImageList();
|
|
|
+ if(imageList ==null || imageList.size()==0){
|
|
|
+ throw new SystemException("补传资料不能为空!!!");
|
|
|
+ }
|
|
|
+ //通过子订单id查询需要补传的数据集合
|
|
|
+ LambdaQueryWrapper<PinganShUploafile> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(PinganShUploafile::getSubOrderNo, companyId);
|
|
|
+ queryWrapper.eq(PinganShUploafile::getStatus, "0");
|
|
|
+ List<PinganShUploafile> list = pinganShUploafileService.list(queryWrapper);
|
|
|
+ //判断前台数据是否包含所有的回传资料
|
|
|
+ String msg ="";
|
|
|
+ String errorMsg="";
|
|
|
+ if(list ==null || list.size()==0){
|
|
|
+ throw new SystemException("没有事后补传资料不必上传!!!");
|
|
|
+ }else{
|
|
|
+ msg ="需要补传资料为:";
|
|
|
+ //判断上传的资料是否包含需要补传的信息资料不包含提示信息
|
|
|
+ List<InsUploadImagesDto> imgList = insTaskImagesMapper.findByIds(imageList);
|
|
|
+
|
|
|
+ if(imgList!=null && imgList.size()>0){
|
|
|
+
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ for(InsUploadImagesDto dto :imgList){
|
|
|
+ PingAnDocumentClassEnum fileEnum = PingAnDocumentClassEnum.getCode(dto.getImageType());
|
|
|
+ String documentType = fileEnum.getDocumentType();
|
|
|
+ map.put(documentType,documentType);
|
|
|
+ }
|
|
|
+ for(PinganShUploafile dto :list){
|
|
|
+ String val = map.get(dto.getDocumentType());
|
|
|
+ if(StringUtils.isBlank(val)){
|
|
|
+ errorMsg+=dto.getDocumentClassName()+"-"+dto.getDocumentTypeName()+";";
|
|
|
+ }
|
|
|
+ msg+=dto.getDocumentClassName()+"-"+dto.getDocumentTypeName()+";";
|
|
|
+ }
|
|
|
+ errorMsg+="未上传";
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(errorMsg)){
|
|
|
+ throw new SystemException(msg+"("+errorMsg+")");
|
|
|
+ }else{
|
|
|
+ //将补传资料的数据更新为1
|
|
|
+ List<PinganShUploafile> newList = list.stream()
|
|
|
+ .map(item -> {
|
|
|
+ item.setStatus("1");
|
|
|
+ return item;
|
|
|
+ })
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ pinganShUploafileService.updateBatchById(newList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return HttpResult.ok("补传资料成功!!");
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* @version
|
|
|
@@ -2094,4 +2349,32 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/8/16 11:41
|
|
|
+ * @Description: 获取返回
|
|
|
+ */
|
|
|
+ public Map<String,String> getNoByStr(String msg){
|
|
|
+ Map<String,String> map=new HashMap<String,String>();
|
|
|
+ //本次已生成商业险投保单号:53301003900251463997, 交强险投保单号:53301003900251463998, 本次不能再投保
|
|
|
+ if(StringUtils.isNotBlank(msg) && msg.contains("本次不能再投保")){
|
|
|
+ String[] strs = msg.replaceAll("本次不能再投保", "").split(",");
|
|
|
+ if(strs!=null && strs.length>0){
|
|
|
+ for(String s :strs){
|
|
|
+ if(StringUtils.isNotBlank(s) && s.contains(":") && s.contains("商业险投保单号")){
|
|
|
+ map.put("sypolicyno",s.split(":")[1]);
|
|
|
+ }else if(StringUtils.isNotBlank(s) && s.contains(":") && s.contains("交强险投保单号")){
|
|
|
+ map.put("jqpolicyno",s.split(":")[1]);
|
|
|
+ }
|
|
|
+ else if(StringUtils.isNotBlank(s) && s.contains(":") && s.contains("意险投保单号")){
|
|
|
+ map.put("application",s.split(":")[1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|