|
@@ -19,6 +19,7 @@ import com.ydtech.modules.order.entity.api.pingan.constants.unAutoProductDetail.
|
|
|
import com.ydtech.modules.order.entity.api.pingan.constants.unAutoProductList.UnAutoProductListResponseCodeEnum;
|
|
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.request.*;
|
|
|
import com.ydtech.modules.order.entity.api.pingan.response.*;
|
|
import com.ydtech.modules.order.entity.api.pingan.response.*;
|
|
|
|
|
+import com.ydtech.modules.order.entity.api.pingan.utils.PDFUtil;
|
|
|
import com.ydtech.modules.order.entity.api.pingan.utils.PinAnEnumUtils;
|
|
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.api.pingan.utils.UUIDUtils;
|
|
|
import com.ydtech.modules.order.entity.config.BoHaiConfigureParameters;
|
|
import com.ydtech.modules.order.entity.config.BoHaiConfigureParameters;
|
|
@@ -41,6 +42,7 @@ import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
@@ -424,12 +426,23 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
|
|
|
if(policyPdfResponse!=null){
|
|
if(policyPdfResponse!=null){
|
|
|
if(PolicyPdfResponseCodeEnum.POLICY_PDF_CODE_MSG_0.getCode().equals(policyPdfResponse.getResultCode())){
|
|
if(PolicyPdfResponseCodeEnum.POLICY_PDF_CODE_MSG_0.getCode().equals(policyPdfResponse.getResultCode())){
|
|
|
CrawlerPolicyPrintVo crawlerPolicyPrintVo =new CrawlerPolicyPrintVo();
|
|
CrawlerPolicyPrintVo crawlerPolicyPrintVo =new CrawlerPolicyPrintVo();
|
|
|
- if(Boolean.parseBoolean(policyPdfResponse.getPolicyPdf())){
|
|
|
|
|
- crawlerPolicyPrintVo.setJqxPolicyUrl(policyPdfResponse.getPolicyPdf());
|
|
|
|
|
- }else{
|
|
|
|
|
- crawlerPolicyPrintVo.setSyxPolicyUrl(policyPdfResponse.getPolicyPdf());
|
|
|
|
|
|
|
+ String policyPdfBase64Str = policyPdfResponse.getPolicyPdf();
|
|
|
|
|
+ //存储系统临时文件
|
|
|
|
|
+ String tempDir = System.getProperty("java.io.tmpdir");
|
|
|
|
|
+ StringBuffer filePath = new StringBuffer();
|
|
|
|
|
+ filePath.append(tempDir).append(File.separator).append(System.currentTimeMillis()).append(File.separator).append("source.pdf");
|
|
|
|
|
+ String targertPath=filePath.toString();
|
|
|
|
|
+ try{
|
|
|
|
|
+ PDFUtil.decryptFileByPassword(policyPdfBase64Str,targertPath,properties.getSelfPrivateKey());
|
|
|
|
|
+ if(Boolean.parseBoolean(policyPdfResponse.getPolicyPdf())){
|
|
|
|
|
+ crawlerPolicyPrintVo.setJqxPolicyUrl(targertPath);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ crawlerPolicyPrintVo.setSyxPolicyUrl(targertPath);
|
|
|
|
|
+ }
|
|
|
|
|
+ return HttpResult.ok(crawlerPolicyPrintVo);
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ return HttpResult.error("文件解密失败!!!");
|
|
|
}
|
|
}
|
|
|
- return HttpResult.ok(crawlerPolicyPrintVo);
|
|
|
|
|
}else{
|
|
}else{
|
|
|
return HttpResult.error(PinAnEnumUtils.getEnumValueByCode(PolicyPdfResponseCodeEnum.class,policyPdfResponse.getResultCode()));
|
|
return HttpResult.error(PinAnEnumUtils.getEnumValueByCode(PolicyPdfResponseCodeEnum.class,policyPdfResponse.getResultCode()));
|
|
|
}
|
|
}
|