|
|
@@ -558,24 +558,18 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
@Override
|
|
|
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);
|
|
|
PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),subOrderNo,insAreaCompany.getAgreementId());
|
|
|
- InsOrders insOrders = insOrdersService.existOrder(insAreaCompany.getOrderno());
|
|
|
-
|
|
|
//图片
|
|
|
List<InsUploadImagesDto> imgList = insTaskImagesMapper.getByOrderNoInsUploadImagesDtoList(insAreaCompany.getOrderno());
|
|
|
|
|
|
- // List<InsTaskImagesBase64> insTaskImagesBase64s = insTaskImagesService.findByOrderNo(insOrders.getOrderno(),
|
|
|
- // insAreaCompany.getId(), true);
|
|
|
if (imgList.isEmpty()) {
|
|
|
return HttpResult.error("影像集合为空");
|
|
|
} else {
|
|
|
- List<InsTaskImages> listNew = new ArrayList<InsTaskImages>();
|
|
|
List<UploadFilesRequest.DocListDTO> list = new ArrayList<>();
|
|
|
// 获取当前项目的目录
|
|
|
File projectFile =new File(System.getProperty("user.dir"));
|
|
|
@@ -597,17 +591,17 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
String documentFormat = fileName.split("\\.")[1];
|
|
|
boolean upLoadFileFlag = PingAnUpLoadUtils.getUpLoadFile(properties.getHost(), properties.getBucket(), properties.getAk(), properties.getSk(), file, key);
|
|
|
if(!upLoadFileFlag){
|
|
|
- // throw new SystemException("上传影像文件失败");
|
|
|
+ throw new SystemException("上传影像文件失败");
|
|
|
}
|
|
|
UploadFilesRequest.DocListDTO docListDTO = new UploadFilesRequest.DocListDTO(key, documentClass, documentType, documentName,documentFormat ,
|
|
|
- null, insAreaCompany.getJqapplyno(),null, parameters.getUserId(), "openApi");
|
|
|
+ null);
|
|
|
list.add(docListDTO);
|
|
|
}
|
|
|
if(insTaskImages!=null && insTaskImages.size()>0){
|
|
|
boolean b = insTaskImagesService.updateBatchById(insTaskImages);
|
|
|
}
|
|
|
//调用文件上传
|
|
|
- UploadFilesRequest uploadRequest = new UploadFilesRequest(list);
|
|
|
+ UploadFilesRequest uploadRequest = new UploadFilesRequest(list,insAreaCompany.getJqapplyno(),null, parameters.getUserId(), "openApi");
|
|
|
|
|
|
UploadFilesResponse uploadFilesResponse = null;
|
|
|
try {
|
|
|
@@ -634,6 +628,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
public HttpResult<Object> audit(SpecialAuditVo<SubmitVerifyRequest.EngageListDTO> vo) {
|
|
|
String companyId = vo.getCompanyId();
|
|
|
List<SubmitVerifyRequest.EngageListDTO> engageList = vo.getEngageList();
|
|
|
+ //特约处理 暂时获取不到
|
|
|
if(engageList!=null && engageList.size()>0){
|
|
|
|
|
|
}
|
|
|
@@ -647,23 +642,16 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
String flowid = insAreaCompany.getFlowid();
|
|
|
InsOrders insOrders = insOrdersService.existOrder(insAreaCompany.getOrderno());
|
|
|
PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),companyId,insAreaCompany.getAgreementId());
|
|
|
- //组装上传的资料信息提交
|
|
|
- List<SubmitApplyRequest.DocListDTO> docList =new ArrayList<SubmitApplyRequest.DocListDTO>();
|
|
|
- //通过报价单号查询上传的影像
|
|
|
- LambdaQueryWrapper<InsTaskImages> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(InsTaskImages::getQuoteNo, insOrders.getQuoteno());
|
|
|
- List<InsTaskImages> insTaskImagesListAll = insTaskImagesService.list(queryWrapper);
|
|
|
- //组装平安影像
|
|
|
- for(InsTaskImages insTaskImages :insTaskImagesListAll){
|
|
|
- InsUploadFiles fiels = insUploadFilesService.getById(insTaskImages.getImageId());
|
|
|
- SubmitApplyRequest.DocListDTO dto=new SubmitApplyRequest.DocListDTO().getDocListDTOMsg(fiels,insTaskImages);
|
|
|
- docList.add(dto);
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
//交强特约
|
|
|
List<SubmitApplyRequest.BizSpecialPromiseListDTO> bizSpecialPromiseList=new ArrayList<SubmitApplyRequest.BizSpecialPromiseListDTO>();
|
|
|
//商业特约
|
|
|
List<SubmitApplyRequest.BizSpecialPromiseListDTO> forceSpecialPromiseList=new ArrayList<SubmitApplyRequest.BizSpecialPromiseListDTO>();
|
|
|
-
|
|
|
+ //UploadFilesResponse uploadFilesResponse = getUploadResponseByParam(insAreaCompany,pinganApiLog,parameters.getUserId());
|
|
|
+ // 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;
|
|
|
@@ -675,7 +663,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
if (submitApplyResponse != null) {
|
|
|
// 事中资料 15 时上传资料
|
|
|
if("15".equals(submitApplyResponse.getResultCode())){
|
|
|
- submitApplyRequest.setDocList(docList);
|
|
|
+ submitApplyRequest.setDocList(null);
|
|
|
try {
|
|
|
submitApplyResponse = pinganRequestApiComponents.submitApply(submitApplyRequest,pinganApiLog);
|
|
|
} catch (Exception e) {
|
|
|
@@ -757,9 +745,16 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
JSONArray objects = JSON.parseArray(JSON.toJSONString(jyList));
|
|
|
insAreaCompany.setCrossInsurance(objects);
|
|
|
}
|
|
|
+ pinganApiLog.setId(null);
|
|
|
+ //上传影像
|
|
|
+
|
|
|
//说明核保成功,更新大订单和小订单的状态为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());
|
|
|
+ }
|
|
|
return HttpResult.ok("提交核保成功");
|
|
|
}
|
|
|
} else {
|
|
|
@@ -771,7 +766,45 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
}
|
|
|
return HttpResult.error("提交核保接口失败");
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/8/14 8:52
|
|
|
+ * @Description: 上传文件
|
|
|
+ */
|
|
|
+ private UploadFilesResponse getUploadResponseByParam(InsAreaCompany insAreaCompany,PinganApiLog pinganApiLog,String userId){
|
|
|
+ //组装上传的资料信息提交
|
|
|
+ UploadFilesResponse uploadFilesResponse = null;
|
|
|
+ //通过报价单号查询上传的影像
|
|
|
+ List<InsUploadImagesDto> imgList = insTaskImagesMapper.getByOrderNoInsUploadImagesDtoList(insAreaCompany.getOrderno());
|
|
|
+ if (imgList.isEmpty()) {
|
|
|
+ throw new SystemException("影像集合为空");
|
|
|
+ } else {
|
|
|
+ List<UploadFilesRequest.DocListDTO> list = new ArrayList<>();
|
|
|
+ for (InsUploadImagesDto insUploadImagesDto : imgList) {
|
|
|
+ InsUploadFiles fiels = insUploadFilesService.getById(insUploadImagesDto.getImageId());
|
|
|
+ InsTaskImages imagevo = insTaskImagesService.getById(insUploadImagesDto.getId());
|
|
|
+ String key = imagevo.getPinganKey();
|
|
|
+ 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];
|
|
|
+ UploadFilesRequest.DocListDTO docListDTO = new UploadFilesRequest.DocListDTO(key, documentClass, documentType, documentName, documentFormat,null);
|
|
|
+ list.add(docListDTO);
|
|
|
+ }
|
|
|
+ //调用文件上传
|
|
|
+ UploadFilesRequest uploadRequest = new UploadFilesRequest(list,insAreaCompany.getJqapplyno(),insAreaCompany.getJqapplyno(),userId,"openApi");
|
|
|
+ try {
|
|
|
+ uploadFilesResponse = pinganRequestApiComponents.uploadFiles(uploadRequest, pinganApiLog);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return uploadFilesResponse;
|
|
|
+ }
|
|
|
/**
|
|
|
* @Description 获取保单pdf地址 调用 002
|
|
|
* @Author hxl
|
|
|
@@ -802,11 +835,10 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
//非车保单号
|
|
|
String application = null;
|
|
|
if(crossInsurance!=null && crossInsurance.size() > 0) {
|
|
|
- application = crossInsurance.getJSONObject(0).getString("application");
|
|
|
+ application = crossInsurance.getJSONObject(0).getString("policy");
|
|
|
}
|
|
|
CrawlerPolicyPrintVo crawlerPolicyPrintVo =new CrawlerPolicyPrintVo();
|
|
|
//交强
|
|
|
-
|
|
|
if(StringUtils.isNotBlank(jqpolicyno) ){
|
|
|
String fileName="_交强险保单";
|
|
|
String fileBZName="-交强险标志";
|
|
|
@@ -870,7 +902,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
String fileBZName="";
|
|
|
//驾意险
|
|
|
if(type==3){
|
|
|
- flag="true";
|
|
|
+ flag="true";
|
|
|
fileName="_非车险保单";
|
|
|
}else if(type==1){
|
|
|
//交强
|