|
|
@@ -8,6 +8,7 @@ import com.jzg.commons.constants.InsuranceRisk;
|
|
|
import com.jzg.commons.exception.SystemException;
|
|
|
import com.jzg.commons.util.AssertionUtils;
|
|
|
import com.jzg.commons.util.StringUtils;
|
|
|
+import com.jzg.quotation.commons.component.InsImagesUploadCacheComponent;
|
|
|
import com.jzg.quotation.commons.constant.enums.base.PolicyPrintType;
|
|
|
import com.jzg.quotation.commons.entity.vo.aggregated.InsuranceUploadImageVo;
|
|
|
import com.jzg.quotation.commons.entity.vo.aggregated.QuoteResultsVo;
|
|
|
@@ -39,7 +40,7 @@ import org.apache.commons.httpclient.methods.multipart.Part;
|
|
|
import org.apache.commons.httpclient.methods.multipart.StringPart;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.data.redis.core.RedisTemplate;
|
|
|
+import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
@@ -54,7 +55,7 @@ import static com.jzg.quotation.commons.constant.CacheConstant.GR_SPECIAL_AGREEM
|
|
|
import static com.jzg.quotation.commons.constant.CacheConstant.GR_SPECIAL_AGREEMENT_TIME;
|
|
|
|
|
|
/**
|
|
|
- * @description:
|
|
|
+ * description:
|
|
|
* @author: shenwd
|
|
|
* @date: 2025/3/14 09:58
|
|
|
**/
|
|
|
@@ -69,8 +70,9 @@ public class GuoRenApiRequestImpl implements GuoRenApiRequest {
|
|
|
|
|
|
private final GuoRenApiConfigurationProperties properties;
|
|
|
|
|
|
- private final RedisTemplate redisTemplate;
|
|
|
+ private final StringRedisTemplate redisTemplate;
|
|
|
|
|
|
+ private final InsImagesUploadCacheComponent insImagesUploadCacheComponent;
|
|
|
|
|
|
/**
|
|
|
* 报价
|
|
|
@@ -376,7 +378,7 @@ public class GuoRenApiRequestImpl implements GuoRenApiRequest {
|
|
|
*/
|
|
|
public List<GuoRenSpecialAgreementVo> getSpecialAgreements(OrderBase orderBase, GuoRenConfigureParameters parameters) {
|
|
|
// 获取协议配置信息
|
|
|
- String specialAgreementKey = GR_SPECIAL_AGREEMENT_KEY + orderBase.getOrdersNo();
|
|
|
+ String specialAgreementKey = GR_SPECIAL_AGREEMENT_KEY + orderBase.getOrdersNo();//现在用ordersNo替换agreementId
|
|
|
|
|
|
// 从缓存中获取数据
|
|
|
String info = (String) redisTemplate.opsForValue().get(specialAgreementKey);
|
|
|
@@ -410,9 +412,6 @@ public class GuoRenApiRequestImpl implements GuoRenApiRequest {
|
|
|
|
|
|
public PremiumResponse premiumQuery(QuoteVo quoteVo, CarPriceResponse.DataDTO carPriceQuery, VinQueryResponse.DataDTO vinQuery, Boolean isNoCar,
|
|
|
List<GuoRenSpecialAgreementVo> specialAgreements, String noCarPremium, String goodsCode) {
|
|
|
- //请求信息列表
|
|
|
- List<String> requestInfoList = new ArrayList<>();
|
|
|
- boolean boo;
|
|
|
//构造请求参数
|
|
|
PremiumRequest premiumRequest = PremiumRequest.buildQuoteParam(quoteVo, carPriceQuery, vinQuery, isNoCar, specialAgreements, noCarPremium, goodsCode);
|
|
|
PremiumResponse premiumResponse = guoRenRequestApiComponent.request(premiumRequest, PlatformInterfaceCode.API_IIRBT00004, PremiumResponse.class);
|
|
|
@@ -438,9 +437,10 @@ public class GuoRenApiRequestImpl implements GuoRenApiRequest {
|
|
|
formMap.put("fileGroup", "DZ");
|
|
|
|
|
|
List<InsuranceImageVo> imageVoList = insuranceUploadImageVo.getImageVoList();
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
+ Map<String, List<String>> map = new HashMap<>();
|
|
|
|
|
|
imageVoList.forEach(insuranceImageVo -> {
|
|
|
+ List<String> imageIds = new ArrayList<>();
|
|
|
for (InsuranceImageVo.ImageDTO imageDTO : insuranceImageVo.getImageBase64List()) {
|
|
|
String imageBase64Str = imageDTO.getImageBase64Str();
|
|
|
byte[] imageBytes = Base64.getDecoder().decode(imageBase64Str);
|
|
|
@@ -467,18 +467,18 @@ public class GuoRenApiRequestImpl implements GuoRenApiRequest {
|
|
|
if (StringUtils.toInt(jsonObject.get("resultCode")) != 0) {
|
|
|
throw new SystemException("国任,影像上传失败");
|
|
|
}
|
|
|
- map.put(insuranceImageVo.getImageCode(), imageDTO.getImageId());
|
|
|
-
|
|
|
+ imageIds.add(imageDTO.getImageId());
|
|
|
} catch (Exception e) {
|
|
|
logger.error("国任上传影像异常:{}", e.getMessage());
|
|
|
// 上传的影像存入redis
|
|
|
- //insImagesUploadCacheComponents.setUploadImageCache(insuranceUploadImageVo.getOrder().getOrdersNo(), map);
|
|
|
+ insImagesUploadCacheComponent.setUploadImageCache(insuranceUploadImageVo.getOrder().getInsuranceCompanyCode(), map);
|
|
|
throw new SystemException("国任,影像上传失败,类型:" + insuranceImageVo.getImageType());
|
|
|
}
|
|
|
}
|
|
|
+ map.put(insuranceImageVo.getImageCode(), imageIds);
|
|
|
});
|
|
|
|
|
|
- //insImagesUploadCacheComponents.setUploadImageCache(iac.getCompanyId(), map);
|
|
|
+ insImagesUploadCacheComponent.setUploadImageCache(insuranceUploadImageVo.getOrder().getInsuranceCompanyCode(), map);
|
|
|
}
|
|
|
|
|
|
}
|