|
|
@ -759,20 +759,15 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
return url; |
|
|
|
}*/ |
|
|
|
private String genCarSaleContract(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
// File file = null;
|
|
|
|
|
|
|
|
String ftl = ""; |
|
|
|
if ("现车".equals(appOrderDetailsVo.getOrderType())) { |
|
|
|
//获取模板
|
|
|
|
// file = new File(getClass().getClassLoader().getResource("ftl/existingvehicles.ftl").getFile());
|
|
|
|
ftl = "existingvehicles"; |
|
|
|
} else { |
|
|
|
//获取模板
|
|
|
|
ftl = "orderacar"; |
|
|
|
// file = new File(getClass().getClassLoader().getResource("ftl/orderacar.ftl").getFile());
|
|
|
|
} |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
|
// String dir = getClassLoader().getResource("ftl").getPath();
|
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
@ -785,7 +780,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
//新生成的word路径
|
|
|
|
String wordPath = targetPath + typeName; |
|
|
|
//生成文件名
|
|
|
|
String pdfName = "合同_" + dateStr + seconds + ".pdf"; |
|
|
|
String pdfName = "新车买卖合同_" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
return pdfName; |
|
|
|
} |
|
|
@ -822,7 +817,6 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
}*/ |
|
|
|
private String genCarSaleContractBlank(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String url = ""; |
|
|
|
// File file = null;
|
|
|
|
map.put("totalPrice", ""); |
|
|
|
map.put("priceRemarks", ""); |
|
|
|
map.put("depositTotal", ""); |
|
|
@ -833,13 +827,10 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
if ("现车".equals(appOrderDetailsVo.getOrderType())) { |
|
|
|
//获取模板
|
|
|
|
ftl = "existingvehicles_black"; |
|
|
|
// file = new File(getClass().getClassLoader().getResource("ftl/existingvehicles_black.ftl").getFile());
|
|
|
|
} else { |
|
|
|
// 订车获取模板
|
|
|
|
ftl = "orderacar_black"; |
|
|
|
// file = new File(getClass().getClassLoader().getResource("ftl/orderacar_black.ftl").getFile());
|
|
|
|
} |
|
|
|
// String dir = getClassLoader().getResource("ftl").getPath();
|
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
@ -853,14 +844,14 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
//新生成的word路径
|
|
|
|
String wordPath = targetPath + typeName; |
|
|
|
//生成合同文件名
|
|
|
|
String pdfName = "空白合同_" + dateStr + seconds + ".pdf"; |
|
|
|
String pdfName = "新车买卖空白合同_" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
url = pdfName; |
|
|
|
} |
|
|
|
return url; |
|
|
|
} |
|
|
|
|
|
|
|
private String getReceiveCar(Map<String, Object> map,AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
private String getReceiveCar(Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String url = ""; |
|
|
|
//查询销售订单的现车
|
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
@ -897,8 +888,16 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
*/ |
|
|
|
private String getInvoicMessage(Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String url = ""; |
|
|
|
//根据分公司sid查询分公司开票申请
|
|
|
|
String invoicName = ""; |
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingFeign.fetchDetailsByUseOrgSid(appOrderDetailsVo.getUseOrgSid()); |
|
|
|
if (invoicingDetailsVoResultBean.getData() != null) { |
|
|
|
map.put("createOrgName", invoicingDetailsVoResultBean.getData().getUseOrgName()); |
|
|
|
invoicName = invoicingDetailsVoResultBean.getData().getName(); |
|
|
|
} |
|
|
|
//查询销售订单的现车
|
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
AppOrderPriceInfoVo priceInfo = appOrderDetailsVo.getPriceInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getVinList(); |
|
|
|
List<InvoicMessageContractVo> invoicMessageContractVos = new ArrayList<>(); |
|
|
|
if (stringList.size() > 0) { |
|
|
@ -906,14 +905,11 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
InvoicMessageContractVo vo = new InvoicMessageContractVo(); |
|
|
|
vo.setVinNo(stringList.get(i)); |
|
|
|
vo.setType(appOrderDetailsVo.getInvoiceType()); |
|
|
|
vo.setInvoicMoney(priceInfo.getSingleFinalPrice()); |
|
|
|
vo.setInvoicName(invoicName); |
|
|
|
invoicMessageContractVos.add(vo); |
|
|
|
} |
|
|
|
} |
|
|
|
//根据分公司sid查询分公司开票申请
|
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingFeign.fetchDetailsByUseOrgSid(appOrderDetailsVo.getUseOrgSid()); |
|
|
|
if (invoicingDetailsVoResultBean.getData() != null) { |
|
|
|
map.put("createOrgName", invoicingDetailsVoResultBean.getData().getUseOrgName()); |
|
|
|
} |
|
|
|
map.put("invoicList", invoicMessageContractVos); |
|
|
|
String ftl = "invoicApply"; |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
@ -1648,7 +1644,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
} |
|
|
|
//接收车辆委托书
|
|
|
|
Future<String> future4 = pool.submit(() -> { |
|
|
|
return getReceiveCar(map,appOrderDetailsVo); |
|
|
|
return getReceiveCar(map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
Future<String> future5 = pool.submit(() -> { |
|
|
|
return getInvoicMessage(map, appOrderDetailsVo); |
|
|
@ -1666,15 +1662,15 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
return getMoneyFin(map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
Future<String> future8 = null; |
|
|
|
if(!"02".equals(appOrderDetailsVo.getInvoiceType())){ |
|
|
|
if (!"02".equals(appOrderDetailsVo.getInvoiceType())) { |
|
|
|
future8 = pool.submit(() -> { |
|
|
|
return getCarContract(map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
} |
|
|
|
List<File> filesList = new ArrayList<>(); |
|
|
|
//合并pdf文件
|
|
|
|
if(future8 != null){ |
|
|
|
if(StringUtils.isNotBlank(future8.get())){ |
|
|
|
if (future8 != null) { |
|
|
|
if (StringUtils.isNotBlank(future8.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future8.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|