Browse Source

生成合同去掉全款贷款的区分

zhanglei
dimengzhe 1 year ago
parent
commit
e95296a77b
  1. 162
      anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/commoncontract/CommonContractService.java

162
anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/commoncontract/CommonContractService.java

@ -1950,115 +1950,83 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp
ExecutorService pool = new ThreadPoolExecutor(1, 2,
1000, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
if ("1".equals(appOrderDetailsVo.getPayTypeKey())) {//全款
Future<String> future1 = pool.submit(() -> {
return genCarSaleContract(dto, map, appOrderDetailsVo);
});
Future<String> future1_2 = pool.submit(() -> {
return genCarSaleContract2(dto, map, appOrderDetailsVo);
});
Future<String> future2 = pool.submit(() -> {
return genCarSaleContractBlank(dto, map, appOrderDetailsVo);
});
Future<String> future2_2 = pool.submit(() -> {
return genCarSaleContractBlank2(dto, map, appOrderDetailsVo);
});
//接收车辆委托书
Future<String> future4 = pool.submit(() -> {
return getReceiveCar(map, appOrderDetailsVo);
Future<String> future1 = pool.submit(() -> {
return genCarSaleContract(dto, map, appOrderDetailsVo);
});
Future<String> future1_2 = pool.submit(() -> {
return genCarSaleContract2(dto, map, appOrderDetailsVo);
});
Future<String> future2 = pool.submit(() -> {
return genCarSaleContractBlank(dto, map, appOrderDetailsVo);
});
Future<String> future2_2 = pool.submit(() -> {
return genCarSaleContractBlank2(dto, map, appOrderDetailsVo);
});
//接收车辆委托书
Future<String> future4 = pool.submit(() -> {
return getReceiveCar(map, appOrderDetailsVo);
});
String singleFinalPriceOne = priceInfo.getSingleFinalPrice();
String depositOne = depositInfo.getDeposit();
Future<String> future8 = null;
if (!"02".equals(appOrderDetailsVo.getInvoiceType())) {
future8 = pool.submit(() -> {
return getCarContract(map, appOrderDetailsVo);
});
/* Future<String> future5 = pool.submit(() -> {
return getInvoicMessage(map, appOrderDetailsVo);
});*/
String singleFinalPriceOne = priceInfo.getSingleFinalPrice();
String depositOne = depositInfo.getDeposit();
//单台成交价与单台订金相等
/* Future<String> future6 = null;
if (new BigDecimal(singleFinalPriceOne).compareTo(new BigDecimal(depositOne)) != 0) {
future6 = pool.submit(() -> {
return getCarFin(map, appOrderDetailsVo);
});
}
Future<String> future7 = pool.submit(() -> {
return getMoneyFin(map, appOrderDetailsVo);
});*/
Future<String> future8 = null;
if (!"02".equals(appOrderDetailsVo.getInvoiceType())) {
future8 = pool.submit(() -> {
return getCarContract(map, appOrderDetailsVo);
});
}
List<File> filesList = new ArrayList<>();
if (future1 != null) {
if (StringUtils.isNotBlank(future1.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future1.get());
filesList.add(file);
}
}
if (future1_2 != null) {
if (StringUtils.isNotBlank(future1_2.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future1_2.get());
filesList.add(file);
}
}
if (future2 != null) {
if (StringUtils.isNotBlank(future2.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future2.get());
filesList.add(file);
}
}
if (future2_2 != null) {
if (StringUtils.isNotBlank(future2_2.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future2_2.get());
filesList.add(file);
}
}
//合并pdf文件
if (future8 != null) {
if (StringUtils.isNotBlank(future8.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future8.get());
filesList.add(file);
}
}
List<File> filesList = new ArrayList<>();
if (future1 != null) {
if (StringUtils.isNotBlank(future1.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future1.get());
filesList.add(file);
}
if (StringUtils.isNotBlank(future4.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future4.get());
}
if (future1_2 != null) {
if (StringUtils.isNotBlank(future1_2.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future1_2.get());
filesList.add(file);
}
/*if (StringUtils.isNotBlank(future5.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future5.get());
}
if (future2 != null) {
if (StringUtils.isNotBlank(future2.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future2.get());
filesList.add(file);
}*/
/* if (future6 != null) {
if (StringUtils.isNotBlank(future6.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future6.get());
filesList.add(file);
}
}
if (StringUtils.isNotBlank(future7.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future7.get());
}
if (future2_2 != null) {
if (StringUtils.isNotBlank(future2_2.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future2_2.get());
filesList.add(file);
}*/
if (filesList.size() > 0) {
// String typeName = ContractTemplateEnum.CONTRACTALL.getName() + "_" + DateUtil.format(new Date(), "yyyMMdd") + System.currentTimeMillis() + ".pdf";
String typeName = appOrderDetailsVo.getPayType() + contractNo + ".pdf";
File allFile = WordConvertUtils.mulFile2One(filesList, docPdfComponent.getUploadTemplateUrl() + typeName);
System.out.println("-========" + docPdfComponent.getUploadTemplateUrl() + typeName);
urlAll = typeName;
}
if (StringUtils.isNotBlank(urlAll)) {
printConfirmVo = new PrintConfirmVo();
// printConfirmVo.setName(MessageFormat.format("《{0}》", ContractTemplateEnum.CONTRACTALL.getName()));
printConfirmVo.setName(MessageFormat.format("《{0}》", appOrderDetailsVo.getPayType() + contractNo));
printConfirmVo.setDownloadUrl(docPdfComponent.getPrefixTemplateUrl() + urlAll);
list.add(printConfirmVo);
}
//合并pdf文件
if (future8 != null) {
if (StringUtils.isNotBlank(future8.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future8.get());
filesList.add(file);
}
} else {
}
if (StringUtils.isNotBlank(future4.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future4.get());
filesList.add(file);
}
if (filesList.size() > 0) {
String typeName = appOrderDetailsVo.getPayType() + contractNo + ".pdf";
File allFile = WordConvertUtils.mulFile2One(filesList, docPdfComponent.getUploadTemplateUrl() + typeName);
System.out.println("-========" + docPdfComponent.getUploadTemplateUrl() + typeName);
urlAll = typeName;
}
if (StringUtils.isNotBlank(urlAll)) {
printConfirmVo = new PrintConfirmVo();
printConfirmVo.setName(MessageFormat.format("《{0}》", appOrderDetailsVo.getPayType() + contractNo));
printConfirmVo.setDownloadUrl(docPdfComponent.getPrefixTemplateUrl() + urlAll);
list.add(printConfirmVo);
}
if ("2".equals(appOrderDetailsVo.getPayTypeKey())) {
Future<String> future10 = pool.submit(() -> {
return getRisk(appOrderDetailsVo, dto);
});
List<File> filesList = new ArrayList<>();
if (StringUtils.isNotBlank(future10.get())) {
File file = new File(docPdfComponent.getUploadTemplateUrl() + future10.get());
filesList.add(file);

Loading…
Cancel
Save