|
|
@@ -23,6 +23,7 @@ import com.ydtech.modules.esm.model.*;
|
|
|
import com.ydtech.modules.esm.service.*;
|
|
|
import com.ydtech.modules.ins.dao.InsAlltrustRegionMapper;
|
|
|
import com.ydtech.modules.ins.model.InsApiLog;
|
|
|
+import com.ydtech.modules.ins.model.InsOrder;
|
|
|
import com.ydtech.modules.ins.model.vo.CarInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.QuoteRespVo;
|
|
|
@@ -56,11 +57,14 @@ import com.ydtech.modules.order.entity.InsOrders;
|
|
|
import com.ydtech.modules.order.entity.vo.*;
|
|
|
import com.ydtech.modules.order.service.InsAreaCompanyService;
|
|
|
import com.ydtech.modules.order.service.InsOrdersService;
|
|
|
+import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
|
import com.ydtech.utils.*;
|
|
|
+import com.ydtech.utils.baidu.FileUtil;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -98,6 +102,13 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
List<String> requestInfoList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
+ @Value("${upload.file.path}")
|
|
|
+ private String uploadFilePath;
|
|
|
+
|
|
|
+ @Value("${upload.file.url}")
|
|
|
+ private String showFileUrl;
|
|
|
+
|
|
|
+
|
|
|
@Autowired
|
|
|
private YcBuildData ycBuildData;
|
|
|
@Autowired
|
|
|
@@ -885,10 +896,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
HttpResult httpResult = new HttpResult();
|
|
|
try {
|
|
|
InsAreaCompany iac = insAreaCompanyService.getById(policyPrintVo.getCompanyId());
|
|
|
-// InsOrder order = insOrderService.selectByPk(orderno);
|
|
|
- if (iac == null) {
|
|
|
- return HttpResult.error("报价订单不存在");
|
|
|
- }
|
|
|
+ AssertionUtils.isEmpty(iac,"报价订单不存在");
|
|
|
+ InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
|
|
|
// 获取协议配置信息
|
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
|
|
|
@@ -913,15 +922,25 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
|
|
|
if (pResp.getHead().getResponseCompleteMessageStatus().getMessageStatusCode().equals("E0000")) {
|
|
|
Map m = new HashMap();
|
|
|
+
|
|
|
+ String bzInsUrl = StringUtils.isNotEmpty(pResp.getPolicyBZUrl())?pResp.getPolicyBZUrl().replaceAll(";pkid", "&pkid"):"";
|
|
|
+ String licensePlate = order.getLicenseno();
|
|
|
+ String jqFlagUrl = gainCarInsPolicy(bzInsUrl,licensePlate + "-交强险标志.pdf");
|
|
|
if (policyPrintVo.getType().equals("1")) {
|
|
|
- m.put("jqFlagUrl", pResp.getPolicyBZUrl());
|
|
|
+ m.put("jqFlagUrl", jqFlagUrl);
|
|
|
m.put("jqUrl", "");
|
|
|
m.put("syUrl", "");
|
|
|
}
|
|
|
if (policyPrintVo.getType().equals("2")) {
|
|
|
- m.put("jqFlagUrl", pResp.getPolicyBZUrl().replaceAll(";pkid", "&pkid"));
|
|
|
- m.put("jqUrl", pResp.getJqpolicyUrl().replaceAll(";pkid", "&pkid"));
|
|
|
- m.put("syUrl", pResp.getSypolicyUrl().replaceAll(";pkid", "&pkid"));
|
|
|
+ String jqInsUrl = StringUtils.isNotEmpty(pResp.getJqpolicyUrl())?pResp.getJqpolicyUrl().replaceAll(";pkid", "&pkid"):"";
|
|
|
+ String syInsUrl = StringUtils.isNotEmpty(pResp.getSypolicyUrl())?pResp.getSypolicyUrl().replaceAll(";pkid", "&pkid"):"";
|
|
|
+
|
|
|
+ String jqUrl = gainCarInsPolicy(jqInsUrl,licensePlate + "-交强险保单.pdf");
|
|
|
+ String syUrl = gainCarInsPolicy(syInsUrl,licensePlate + "-商业险保单.pdf");
|
|
|
+
|
|
|
+ m.put("jqFlagUrl", jqFlagUrl);
|
|
|
+ m.put("jqUrl", jqUrl);
|
|
|
+ m.put("syUrl", syUrl);
|
|
|
|
|
|
}
|
|
|
// httpResult.setData(m);
|
|
|
@@ -1971,4 +1990,16 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取车险保单
|
|
|
+ *
|
|
|
+ * @author: lig
|
|
|
+ * @date: 2023年09月21日 0021
|
|
|
+ */
|
|
|
+ public String gainCarInsPolicy(String url,String fileName){
|
|
|
+ String dir = "carInsPolicy/";
|
|
|
+ return FileUtil.netUrlToFile(url,dir,fileName,uploadFilePath,showFileUrl);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|