|
|
@ -773,7 +773,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
//获取模板
|
|
|
|
ftl = "existingvehicles"; |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getVinList(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "主车" + num + "台,单台成交价:" + transactionPrice + "元。车架号:" + String.join("、", stringList); |
|
|
|
} else { |
|
|
@ -816,7 +816,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
//获取模板
|
|
|
|
ftl = "existingvehicles"; |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getVinList(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "主车" + num + "台,单台成交价:" + transactionPrice + "元。车架号:" + String.join("、", stringList); |
|
|
|
} else { |
|
|
@ -894,7 +894,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
//获取模板
|
|
|
|
ftl = "existingvehicles_black"; |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getVinList(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "主车" + num + "台,单台成交价: 元。车架号:" + String.join("、", stringList); |
|
|
|
} else { |
|
|
@ -943,7 +943,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
//获取模板
|
|
|
|
ftl = "existingvehicles_black"; |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getVinList(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "主车" + num + "台,单台成交价: 元。车架号:" + String.join("、", stringList); |
|
|
|
} else { |
|
|
@ -1022,7 +1022,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
//查询销售订单的现车
|
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
AppOrderPriceInfoVo priceInfo = appOrderDetailsVo.getPriceInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getVinList(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
List<InvoicMessageContractVo> invoicMessageContractVos = new ArrayList<>(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
for (int i = 0; i < stringList.size(); i++) { |
|
|
@ -1775,115 +1775,119 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
String contractNo = getApplyCode(dto.getUserSid(), appOrderModelInfoVo.getModelSid()); |
|
|
|
map.put("contractNo", contractNo); |
|
|
|
String url = ""; |
|
|
|
PrintConfirmVo printConfirmVo = null; |
|
|
|
String urlAll = ""; |
|
|
|
try { |
|
|
|
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
|
|
|
.setNameFormat("demo-pool-%d").build(); |
|
|
|
ExecutorService pool = new ThreadPoolExecutor(2, 100, |
|
|
|
0L, TimeUnit.MILLISECONDS, |
|
|
|
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); |
|
|
|
/* Future<String> future1 = pool.submit(() -> { |
|
|
|
return genCarSaleContract(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
Future<String> future1_2 = pool.submit(() -> { |
|
|
|
return genCarSaleContract2(dto, map, appOrderDetailsVo); |
|
|
|
});*/ |
|
|
|
PrintConfirmVo printConfirmVo = null; |
|
|
|
String urlAll = ""; |
|
|
|
/* 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> 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); |
|
|
|
if("1".equals(appOrderDetailsVo.getPayTypeKey())){//全款
|
|
|
|
/* Future<String> future1 = pool.submit(() -> { |
|
|
|
return genCarSaleContract(dto, 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); |
|
|
|
Future<String> future1_2 = pool.submit(() -> { |
|
|
|
return genCarSaleContract2(dto, 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); |
|
|
|
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> 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); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (future1_2 != null) { |
|
|
|
if (StringUtils.isNotBlank(future1_2.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future1_2.get()); |
|
|
|
filesList.add(file); |
|
|
|
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); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (future2 != null) { |
|
|
|
if (StringUtils.isNotBlank(future2.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future2.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 (future2_2 != null) { |
|
|
|
if (StringUtils.isNotBlank(future2_2.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future2_2.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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//合并pdf文件
|
|
|
|
if (future8 != null) { |
|
|
|
if (StringUtils.isNotBlank(future8.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future8.get()); |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(future4.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future4.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(future4.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future4.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(future5.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future5.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
if (future6 != null) { |
|
|
|
if (StringUtils.isNotBlank(future6.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future6.get()); |
|
|
|
if (StringUtils.isNotBlank(future5.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future5.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()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(future7.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future7.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
|
|
|
|
if (filesList.size() > 0) { |
|
|
|
String typeName = ContractTemplateEnum.CONTRACTALL.getName() + "_" + DateUtil.format(new Date(), "yyyMMdd") + System.currentTimeMillis() + ".pdf"; |
|
|
|
File allFile = WordConvertUtils.mulFile2One(filesList, docPdfComponent.getUploadTemplateUrl() + typeName); |
|
|
|
System.out.println("-========" + docPdfComponent.getUploadTemplateUrl() + typeName); |
|
|
|
urlAll = typeName; |
|
|
|
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); |
|
|
|
}*/ |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(urlAll)) { |
|
|
|
printConfirmVo = new PrintConfirmVo(); |
|
|
|
printConfirmVo.setName(MessageFormat.format("《{0}》", ContractTemplateEnum.CONTRACTALL.getName())); |
|
|
|
printConfirmVo.setDownloadUrl(docPdfComponent.getPrefixTemplateUrl() + urlAll); |
|
|
|
list.add(printConfirmVo); |
|
|
|
}*/ |
|
|
|
//生成合同数据
|
|
|
|
//根据销售订单sid查询合同表中是否存在
|
|
|
|
CommonContractBuscenterVo commonContractBuscenterVo = baseMapper.selectByBusSid(dto.getBusSid()); |
|
|
@ -1973,7 +1977,6 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
//单台成交价与单台订金相等
|
|
|
|
if (new BigDecimal(singleFinalPrice).compareTo(new BigDecimal(deposit)) != 0) {//推送车款
|
|
|
|
String money = new BigDecimal(singleFinalPrice).subtract(new BigDecimal(deposit)).toString(); |
|
|
|
// if ("现车".equals(appOrderDetailsVo.getOrderType())) {
|
|
|
|
List<VinListsVo> vinList = appOrderModelInfoVo.getVinListsVos(); |
|
|
|
for (int i = 0; i < vinList.size(); i++) { |
|
|
|
UnCollectionDto unCollectionDto = new UnCollectionDto(); |
|
|
@ -2005,34 +2008,6 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
unCollectionDto.setPurchaseSystemSid(appOrderDetailsVo.getPurchaseSystemSid()); |
|
|
|
finUncollectedDetailedFeign.saveUnCollection(unCollectionDto); |
|
|
|
} |
|
|
|
/* } else { |
|
|
|
int qualiy = Integer.valueOf(appOrderModelInfoVo.getTotal()).intValue(); |
|
|
|
for (int i = 0; i < qualiy; i++) { |
|
|
|
UnCollectionDto unCollectionDto = new UnCollectionDto(); |
|
|
|
//合同sid
|
|
|
|
unCollectionDto.setContractSid(commonContract.getSid()); |
|
|
|
//合同编号
|
|
|
|
unCollectionDto.setContractNo(commonContract.getContractNo()); |
|
|
|
//客户名称
|
|
|
|
unCollectionDto.setCustomerName(appOrderDetailsVo.getName()); |
|
|
|
//客户sid
|
|
|
|
unCollectionDto.setCustomerSid(appOrderDetailsVo.getCustomerSid()); |
|
|
|
//客户类型
|
|
|
|
unCollectionDto.setCustomerClass(appOrderDetailsVo.getCustomerKey()); |
|
|
|
//客户类型
|
|
|
|
unCollectionDto.setCustomerClassKey(appOrderDetailsVo.getCustomerType()); |
|
|
|
//客户头像
|
|
|
|
unCollectionDto.setCustomerImage(appOrderDetailsVo.getCustomerImage()); |
|
|
|
unCollectionDto.setReceivablesName("车款"); |
|
|
|
unCollectionDto.setCustomerPhone(appOrderDetailsVo.getPhone()); |
|
|
|
unCollectionDto.setUseOrgSid(appOrderDetailsVo.getUseOrgSid()); |
|
|
|
unCollectionDto.setCurrentReceivableMoney(money); |
|
|
|
unCollectionDto.setUserSid(dto.getUserSid()); |
|
|
|
unCollectionDto.setReveivableMoney(money); |
|
|
|
finUncollectedDetailedFeign.saveUnCollection(unCollectionDto); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
} |
|
|
|
//添加推送至款项确认的应收未收明细中
|
|
|
|
List<VinListsVo> vinList = appOrderModelInfoVo.getVinListsVos(); |
|
|
@ -2079,7 +2054,6 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
unCollectionDto.setCustomerPhone(appOrderDetailsVo.getPhone()); |
|
|
|
unCollectionDto.setUseOrgSid(appOrderDetailsVo.getUseOrgSid()); |
|
|
|
unCollectionDto.setVinNo(vinList.get(i).getVinNo()); |
|
|
|
// unCollectionDto.setCurrentReceivableMoney(depositInfo.getDeposit());
|
|
|
|
unCollectionDto.setCurrentReceivableMoney(bigDecimalKeyAll.toString()); |
|
|
|
unCollectionDto.setUserSid(dto.getUserSid()); |
|
|
|
unCollectionDto.setReveivableMoney(depositInfo.getDeposit()); |
|
|
@ -2091,39 +2065,12 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
finUncollectedDetailedFeign.saveUnCollection(unCollectionDto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/*} else { |
|
|
|
int qualiy = Integer.valueOf(appOrderModelInfoVo.getTotal()).intValue(); |
|
|
|
for (int i = 0; i < qualiy; i++) { |
|
|
|
UnCollectionDto unCollectionDto = new UnCollectionDto(); |
|
|
|
//合同sid
|
|
|
|
unCollectionDto.setContractSid(commonContract.getSid()); |
|
|
|
//合同编号
|
|
|
|
unCollectionDto.setContractNo(commonContract.getContractNo()); |
|
|
|
//客户名称
|
|
|
|
unCollectionDto.setCustomerName(appOrderDetailsVo.getName()); |
|
|
|
//客户sid
|
|
|
|
unCollectionDto.setCustomerSid(appOrderDetailsVo.getCustomerSid()); |
|
|
|
//客户类型
|
|
|
|
unCollectionDto.setCustomerClass(appOrderDetailsVo.getCustomerKey()); |
|
|
|
//客户类型
|
|
|
|
unCollectionDto.setCustomerClassKey(appOrderDetailsVo.getCustomerType()); |
|
|
|
//客户头像
|
|
|
|
unCollectionDto.setCustomerImage(appOrderDetailsVo.getCustomerImage()); |
|
|
|
unCollectionDto.setReceivablesName("订金"); |
|
|
|
unCollectionDto.setCustomerPhone(appOrderDetailsVo.getPhone()); |
|
|
|
unCollectionDto.setUseOrgSid(appOrderDetailsVo.getUseOrgSid()); |
|
|
|
unCollectionDto.setCurrentReceivableMoney(depositInfo.getDeposit()); |
|
|
|
unCollectionDto.setUserSid(dto.getUserSid()); |
|
|
|
unCollectionDto.setReveivableMoney(depositInfo.getDeposit()); |
|
|
|
finUncollectedDetailedFeign.saveUnCollection(unCollectionDto); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
return commonContract.getSid(); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if("2".equals(appOrderDetailsVo.getPayTypeKey())){ |
|
|
|
return rb.setMsg("贷款合同附件请线下处理"); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
return rb.setMsg("生成文件失败"); |
|
|
|