|
|
@@ -424,18 +424,29 @@ public class ZhongAnCrawlerRequestImpl implements ZhongAnCrawlerRequest {
|
|
|
ZhongAnCrawlerQueryAccommodationRequest queryAccommodationRequest = new ZhongAnCrawlerQueryAccommodationRequest(zhongAnCrawlerOrder.getQuoteId(), parameters);
|
|
|
ZhongAnCrawlerQueryAccommodationResponse queryAccommodationResponse = zhongAnCrawlerRequestComponent.queryAccommodation(queryAccommodationRequest, headers);
|
|
|
boolean queryAccommodation = queryAccommodationResponse.getSuccess();
|
|
|
+ Map<String, String> fileMap = new HashMap<>();
|
|
|
for (InsuranceImageVo insuranceImageVo : insuranceUploadImageVo.getImageVoList()) {
|
|
|
//C01行驶证正面,C02车主身份证正面,D01行驶证反面 D02 车主身份证反面
|
|
|
switch (insuranceImageVo.getImageCode()) {
|
|
|
case "C01" -> {
|
|
|
String imageType = "6";
|
|
|
InsuranceImageVo.ImageDTO imageDTO = insuranceImageVo.getImageBase64List().get(0);
|
|
|
- extracted(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
+ if (!queryAccommodation) {
|
|
|
+ extracted(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
+ } else {
|
|
|
+ ZhongAnCrawlerAccommodationUploadResponse accommodationUpload = accommodationUpload(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
+ fileMap.put("6", accommodationUpload.getValue().getDatas().getAttachment());
|
|
|
+ }
|
|
|
}
|
|
|
case "C02" -> {
|
|
|
String imageType = "4";
|
|
|
InsuranceImageVo.ImageDTO imageDTO = insuranceImageVo.getImageBase64List().get(0);
|
|
|
- extracted(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
+ if (!queryAccommodation) {
|
|
|
+ extracted(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
+ } else {
|
|
|
+ ZhongAnCrawlerAccommodationUploadResponse accommodationUploadResponse = accommodationUpload(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
+ fileMap.put("4", accommodationUploadResponse.getValue().getDatas().getAttachment());
|
|
|
+ }
|
|
|
}
|
|
|
case "D01" -> {
|
|
|
String imageType = "7";
|
|
|
@@ -443,7 +454,8 @@ public class ZhongAnCrawlerRequestImpl implements ZhongAnCrawlerRequest {
|
|
|
if (!queryAccommodation) {
|
|
|
extracted(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
} else {
|
|
|
- accommodationUpload(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
+ ZhongAnCrawlerAccommodationUploadResponse accommodationUploadResponse = accommodationUpload(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
+ fileMap.put("7", accommodationUploadResponse.getValue().getDatas().getAttachment());
|
|
|
}
|
|
|
}
|
|
|
case "D02" -> {
|
|
|
@@ -452,7 +464,8 @@ public class ZhongAnCrawlerRequestImpl implements ZhongAnCrawlerRequest {
|
|
|
if (!queryAccommodation) {
|
|
|
extracted(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
} else {
|
|
|
- accommodationUpload(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
+ ZhongAnCrawlerAccommodationUploadResponse accommodationUploadResponse = accommodationUpload(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
+ fileMap.put("3", accommodationUploadResponse.getValue().getDatas().getAttachment());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -460,11 +473,21 @@ public class ZhongAnCrawlerRequestImpl implements ZhongAnCrawlerRequest {
|
|
|
String imageType = "99";
|
|
|
List<InsuranceImageVo.ImageDTO> imageBase64List = insuranceImageVo.getImageBase64List();
|
|
|
for (InsuranceImageVo.ImageDTO imageDTO : imageBase64List) {
|
|
|
- accommodationUpload(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
+ ZhongAnCrawlerAccommodationUploadResponse accommodationUploadResponse = accommodationUpload(parameters, headers, zhongAnCrawlerOrder, imageType, imageDTO);
|
|
|
+ fileMap.put("99", accommodationUploadResponse.getValue().getDatas().getAttachment());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ }
|
|
|
+ if (queryAccommodation) {
|
|
|
+ fileMap.put("version","2");
|
|
|
+ Long id = queryAccommodationResponse.getValue().getDatas().getAccommodation().getId();
|
|
|
+ String identityNo = queryAccommodationResponse.getValue().getDatas().getAccommodation().getIdentityNo();
|
|
|
+ ZhongAnCrawlerApplyAccommodationRequest applyAccommodationRequest = new ZhongAnCrawlerApplyAccommodationRequest(id, zhongAnCrawlerOrder.getQuoteId(), identityNo, zhongAnCrawlerOrder.getOrderNo(), fileMap, parameters);
|
|
|
+ ZhongAnCrawlerApplyAccommodationResponse applyAccommodationResponse = zhongAnCrawlerRequestComponent.applyAccommodation(applyAccommodationRequest, headers);
|
|
|
+ if (applyAccommodationResponse.getSuccess()) {
|
|
|
+ log.info("通融提交成功");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -494,12 +517,13 @@ public class ZhongAnCrawlerRequestImpl implements ZhongAnCrawlerRequest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void accommodationUpload (ZhongAnCrawlerConfigureParameters parameters, HttpHeaders headers, ZhongAnCrawlerOrder zhongAnCrawlerOrder, String imageType, InsuranceImageVo.ImageDTO imageDTO) {
|
|
|
+ private ZhongAnCrawlerAccommodationUploadResponse accommodationUpload (ZhongAnCrawlerConfigureParameters parameters, HttpHeaders headers, ZhongAnCrawlerOrder zhongAnCrawlerOrder, String imageType, InsuranceImageVo.ImageDTO imageDTO) {
|
|
|
ZhongAnCrawlerAccommodationUploadRequest accommodationUploadRequest = new ZhongAnCrawlerAccommodationUploadRequest(imageType, imageDTO, zhongAnCrawlerOrder.getOrderNo(), parameters);
|
|
|
ZhongAnCrawlerAccommodationUploadResponse accommodationUploadResponse = zhongAnCrawlerRequestComponent.accommodationUpload(accommodationUploadRequest, headers);
|
|
|
if (accommodationUploadResponse.getSuccess()) {
|
|
|
log.info("影像" + imageType + ":上传成功");
|
|
|
}
|
|
|
+ return accommodationUploadResponse;
|
|
|
}
|
|
|
|
|
|
public byte[] convert(String filePath) throws IOException {
|