|
|
@ -1120,6 +1120,184 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
return url; |
|
|
|
} |
|
|
|
|
|
|
|
private String getDaiContractBlank(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String url = ""; |
|
|
|
map.put("totalPrice", ""); |
|
|
|
map.put("priceRemarks", ""); |
|
|
|
map.put("depositTotal", ""); |
|
|
|
AppOrderPriceInfoVo priceInfo = appOrderDetailsVo.getPriceInfo(); |
|
|
|
//查询台数
|
|
|
|
String num = priceInfo.getNumber(); |
|
|
|
String remarks = ""; |
|
|
|
String ftl = ""; |
|
|
|
CommonContract commonContract = baseMapper.selectByBusSidss(dto.getBusSid()); |
|
|
|
if (commonContract != null) { |
|
|
|
String date = DateUtil.today(); |
|
|
|
List<String> dateString = Arrays.asList(date.split("-")); |
|
|
|
String year = dateString.get(0); |
|
|
|
String month = dateString.get(1); |
|
|
|
String day = dateString.get(2); |
|
|
|
map.put("year", year); |
|
|
|
map.put("month", month); |
|
|
|
map.put("day", day); |
|
|
|
} |
|
|
|
BusSalesOrder busSalesOrder = baseMapper.selectByBusSids(dto.getBusSid()); |
|
|
|
if (busSalesOrder.getAffiliatedCompanyType() == 0) { |
|
|
|
//根据挂靠公司sid查询信息
|
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
BaseDistributor baseDistributor = baseDistributorService.fetchBySid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (baseDistributor != null) { |
|
|
|
map.put("invoiceName", baseDistributor.getDisName());//开票名称
|
|
|
|
map.put("customerName", baseDistributor.getDisName());//开票名称
|
|
|
|
map.put("invoiceNo", baseDistributor.getRegistNum());//纳税人识别号
|
|
|
|
map.put("idNo", baseDistributor.getRegistNum());//纳税人识别号
|
|
|
|
map.put("adds", baseDistributor.getRegistDetailAddress());//户籍地址
|
|
|
|
} |
|
|
|
} |
|
|
|
map.put("invoiceType", busSalesOrder.getBillingType());//开票类型
|
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
CrmCustomerTemp crmCustomerTemp = baseMapper.selectByCustomerSid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (crmCustomerTemp != null) { |
|
|
|
map.put("invoiceName", crmCustomerTemp.getName());//开票名称
|
|
|
|
map.put("customerName", crmCustomerTemp.getName());//开票名称
|
|
|
|
map.put("invoiceNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
map.put("idNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
map.put("adds", crmCustomerTemp.getCertificateAddress());//户籍地址
|
|
|
|
} |
|
|
|
} |
|
|
|
map.put("invoiceType", busSalesOrder.getBillingType());//开票类型
|
|
|
|
} |
|
|
|
map.put("createOrgName", ""); |
|
|
|
// 涉及高低开票的,需要打印两套合同,一套按照成交价打印(记账用),一套为价格空白的合同(开票用)
|
|
|
|
if ("1".equals(dto.getDiscountKey())) { |
|
|
|
// 现车
|
|
|
|
if ("1".equals(busSalesOrder.getType()) && (StringUtils.isBlank(busSalesOrder.getNowCarUnknownVinNum()) || "0".equals(busSalesOrder.getNowCarUnknownVinNum()))) { |
|
|
|
//获取模板
|
|
|
|
ftl = "dai_existingvehicles_black"; |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} else { |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} |
|
|
|
} else { |
|
|
|
map.put("dayOne", ""); |
|
|
|
// 订车获取模板
|
|
|
|
ftl = "dai_orderacar_black"; |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} |
|
|
|
map.put("remarks", remarks); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
|
long seconds = System.currentTimeMillis(); |
|
|
|
String typeName = dateStr + seconds + ".doc"; |
|
|
|
File file = new File(targetPath + ftl + seconds + ".ftl"); |
|
|
|
File dir = new File(targetPath); |
|
|
|
WordConvertUtils.inputStreamToFile(inputStream, file); |
|
|
|
WordConvertUtils.creatWord1(map, file, targetPath, typeName, dir); |
|
|
|
//新生成的word路径
|
|
|
|
String wordPath = targetPath + typeName; |
|
|
|
//生成合同文件名
|
|
|
|
String pdfName = map.get("contractNo").toString() + "贷款新车买卖空白合同_" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
url = pdfName; |
|
|
|
} |
|
|
|
return url; |
|
|
|
} |
|
|
|
|
|
|
|
private String getDaiContractBlank2(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String url = ""; |
|
|
|
map.put("totalPrice", ""); |
|
|
|
map.put("priceRemarks", ""); |
|
|
|
map.put("depositTotal", ""); |
|
|
|
AppOrderPriceInfoVo priceInfo = appOrderDetailsVo.getPriceInfo(); |
|
|
|
//查询台数
|
|
|
|
String num = priceInfo.getNumber(); |
|
|
|
String remarks = ""; |
|
|
|
String ftl = ""; |
|
|
|
CommonContract commonContract = baseMapper.selectByBusSidss(dto.getBusSid()); |
|
|
|
if (commonContract != null) { |
|
|
|
String date = DateUtil.today(); |
|
|
|
List<String> dateString = Arrays.asList(date.split("-")); |
|
|
|
String year = dateString.get(0); |
|
|
|
String month = dateString.get(1); |
|
|
|
String day = dateString.get(2); |
|
|
|
map.put("year", year); |
|
|
|
map.put("month", month); |
|
|
|
map.put("day", day); |
|
|
|
} |
|
|
|
BusSalesOrder busSalesOrder = baseMapper.selectByBusSids(dto.getBusSid()); |
|
|
|
if (busSalesOrder.getAffiliatedCompanyType() == 0) { |
|
|
|
//根据挂靠公司sid查询信息
|
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
BaseDistributor baseDistributor = baseDistributorService.fetchBySid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (baseDistributor != null) { |
|
|
|
map.put("invoiceName", baseDistributor.getDisName());//开票名称
|
|
|
|
map.put("customerName", baseDistributor.getDisName());//开票名称
|
|
|
|
map.put("invoiceNo", baseDistributor.getRegistNum());//纳税人识别号
|
|
|
|
map.put("idNo", baseDistributor.getRegistNum());//纳税人识别号
|
|
|
|
map.put("adds", baseDistributor.getRegistDetailAddress());//户籍地址
|
|
|
|
} |
|
|
|
} |
|
|
|
map.put("invoiceType", busSalesOrder.getBillingType());//开票类型
|
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
CrmCustomerTemp crmCustomerTemp = baseMapper.selectByCustomerSid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (crmCustomerTemp != null) { |
|
|
|
map.put("invoiceName", crmCustomerTemp.getName());//开票名称
|
|
|
|
map.put("customerName", crmCustomerTemp.getName());//开票名称
|
|
|
|
map.put("invoiceNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
map.put("idNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
map.put("adds", crmCustomerTemp.getCertificateAddress());//户籍地址
|
|
|
|
} |
|
|
|
} |
|
|
|
map.put("invoiceType", busSalesOrder.getBillingType());//开票类型
|
|
|
|
} |
|
|
|
map.put("createOrgName", ""); |
|
|
|
// 涉及高低开票的,需要打印两套合同,一套按照成交价打印(记账用),一套为价格空白的合同(开票用)
|
|
|
|
if ("1".equals(dto.getDiscountKey())) { |
|
|
|
// 现车
|
|
|
|
if ("1".equals(busSalesOrder.getType()) && (StringUtils.isBlank(busSalesOrder.getNowCarUnknownVinNum()) || "0".equals(busSalesOrder.getNowCarUnknownVinNum()))) { |
|
|
|
//获取模板
|
|
|
|
ftl = "dai_existingvehicles_black"; |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} else { |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} |
|
|
|
} else { |
|
|
|
map.put("dayOne", ""); |
|
|
|
// 订车获取模板
|
|
|
|
ftl = "dai_orderacar_black"; |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} |
|
|
|
map.put("remarks", remarks); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
|
long seconds = System.currentTimeMillis(); |
|
|
|
String typeName = dateStr + seconds + ".doc"; |
|
|
|
File file = new File(targetPath + ftl + seconds + ".ftl"); |
|
|
|
File dir = new File(targetPath); |
|
|
|
WordConvertUtils.inputStreamToFile(inputStream, file); |
|
|
|
WordConvertUtils.creatWord1(map, file, targetPath, typeName, dir); |
|
|
|
//新生成的word路径
|
|
|
|
String wordPath = targetPath + typeName; |
|
|
|
//生成合同文件名
|
|
|
|
String pdfName = map.get("contractNo").toString() + "贷款新车买卖空白合同2_" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
url = pdfName; |
|
|
|
} |
|
|
|
return url; |
|
|
|
} |
|
|
|
|
|
|
|
private String genCarSaleContractBlank2(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String url = ""; |
|
|
|
map.put("totalPrice", ""); |
|
|
@ -1378,7 +1556,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
} |
|
|
|
CommonContract commonContract = baseMapper.selectByBusSidss(dto.getBusSid()); |
|
|
|
if (commonContract != null) { |
|
|
|
String date =DateUtil.today(); |
|
|
|
String date = DateUtil.today(); |
|
|
|
map.put("date", date); |
|
|
|
} |
|
|
|
List<CarContractListVo> carContractListVos = new ArrayList<>(); |
|
|
@ -1426,6 +1604,192 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
return url; |
|
|
|
} |
|
|
|
|
|
|
|
private String getDaiXContract(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String ftl = ""; |
|
|
|
AppOrderPriceInfoVo priceInfo = appOrderDetailsVo.getPriceInfo(); |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
//车架号集合
|
|
|
|
List<String> stringList = new ArrayList<>(); |
|
|
|
//查询台数
|
|
|
|
String num = ""; |
|
|
|
if (StringUtils.isNotBlank(dto.getBorrowerSid())) { |
|
|
|
List<BusSalesOrderVehicle> busSalesOrderVehicles = busSalesOrderVehicleFeign.selectListByOrderSidAndDkrSid(dto.getBusSid(), dto.getBorrowerSid()).getData(); |
|
|
|
num = String.valueOf(busSalesOrderVehicles.size()); |
|
|
|
for (BusSalesOrderVehicle busSalesOrderVehicle : busSalesOrderVehicles) { |
|
|
|
stringList.add(busSalesOrderVehicle.getLinkNo().substring(busSalesOrderVehicle.getLinkNo().length() - 8)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
num = priceInfo.getNumber(); |
|
|
|
stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
} |
|
|
|
//单台成交价
|
|
|
|
String transactionPrice = priceInfo.getSingleFinalPrice(); |
|
|
|
String remarks = ""; |
|
|
|
CommonContract commonContract = baseMapper.selectByBusSidss(dto.getBusSid()); |
|
|
|
if (commonContract != null) { |
|
|
|
String date = DateUtil.today(); |
|
|
|
List<String> dateString = Arrays.asList(date.split("-")); |
|
|
|
String year = dateString.get(0); |
|
|
|
String month = dateString.get(1); |
|
|
|
String day = dateString.get(2); |
|
|
|
map.put("year", year); |
|
|
|
map.put("month", month); |
|
|
|
map.put("day", day); |
|
|
|
} |
|
|
|
BusSalesOrder busSalesOrder = baseMapper.selectByBusSids(dto.getBusSid()); |
|
|
|
if (StringUtils.isNotBlank(dto.getCreateOrgName())) { |
|
|
|
map.put("createOrgName", dto.getCreateOrgName()); |
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(appOrderDetailsVo.getPurchaseSystemSid())) { |
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(appOrderDetailsVo.getUseOrgSid(), appOrderDetailsVo.getPurchaseSystemSid()); |
|
|
|
if (invoicingDetailsVoResultBean.getData() != null) { |
|
|
|
map.put("createOrgName", invoicingDetailsVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if ("1".equals(busSalesOrder.getType()) && (StringUtils.isBlank(busSalesOrder.getNowCarUnknownVinNum()) || "0".equals(busSalesOrder.getNowCarUnknownVinNum()))) { |
|
|
|
//获取模板
|
|
|
|
ftl = "dai_existingvehicles"; |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
} else { |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
} |
|
|
|
} else { |
|
|
|
map.put("dayOne", appOrderDetailsVo.getDepositInfo().getPayDepositDays()); |
|
|
|
//获取模板
|
|
|
|
ftl = "dai_orderacar"; |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
} |
|
|
|
map.put("remarks", remarks); |
|
|
|
//车价合计
|
|
|
|
String totalPrice = new BigDecimal(priceInfo.getSingleFinalPrice()).multiply(new BigDecimal(num)).toString(); |
|
|
|
map.put("totalPrice", totalPrice); |
|
|
|
//车价合计大写
|
|
|
|
String priceRemarks = ""; |
|
|
|
if (StringUtils.isNotBlank(totalPrice)) { |
|
|
|
priceRemarks = TransformMoney.transform(TransformMoney.getDecimalStr(Double.valueOf(totalPrice).doubleValue())); |
|
|
|
} |
|
|
|
map.put("priceRemarks", priceRemarks); |
|
|
|
//订金合计
|
|
|
|
AppOrderDepositInfoVo depositInfo = appOrderDetailsVo.getDepositInfo(); |
|
|
|
String depositTotal = new BigDecimal(depositInfo.getDeposit()).multiply(new BigDecimal(num)).toString(); |
|
|
|
if ("0".equals(depositTotal)) { |
|
|
|
map.put("depositTotal", "/"); |
|
|
|
} else { |
|
|
|
map.put("depositTotal", depositTotal); |
|
|
|
} |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
|
long seconds = System.currentTimeMillis(); |
|
|
|
String typeName = dateStr + seconds + ".doc"; |
|
|
|
File file = new File(targetPath + ftl + seconds + ".ftl"); |
|
|
|
File dir = new File(targetPath); |
|
|
|
WordConvertUtils.inputStreamToFile(inputStream, file); |
|
|
|
WordConvertUtils.creatWord1(map, file, targetPath, typeName, dir); |
|
|
|
//新生成的word路径
|
|
|
|
String wordPath = targetPath + typeName; |
|
|
|
//生成文件名
|
|
|
|
String pdfName = map.get("contractNo").toString() + "贷款新车买卖合同_" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
return pdfName; |
|
|
|
} |
|
|
|
|
|
|
|
private String getDaiXContract2(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String ftl = ""; |
|
|
|
AppOrderPriceInfoVo priceInfo = appOrderDetailsVo.getPriceInfo(); |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
//车架号集合
|
|
|
|
List<String> stringList = new ArrayList<>(); |
|
|
|
//查询台数
|
|
|
|
String num = ""; |
|
|
|
if (StringUtils.isNotBlank(dto.getBorrowerSid())) { |
|
|
|
List<BusSalesOrderVehicle> busSalesOrderVehicles = busSalesOrderVehicleFeign.selectListByOrderSidAndDkrSid(dto.getBusSid(), dto.getBorrowerSid()).getData(); |
|
|
|
num = String.valueOf(busSalesOrderVehicles.size()); |
|
|
|
for (BusSalesOrderVehicle busSalesOrderVehicle : busSalesOrderVehicles) { |
|
|
|
stringList.add(busSalesOrderVehicle.getLinkNo().substring(busSalesOrderVehicle.getLinkNo().length() - 8)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
num = priceInfo.getNumber(); |
|
|
|
stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
} |
|
|
|
//单台成交价
|
|
|
|
String transactionPrice = priceInfo.getSingleFinalPrice(); |
|
|
|
String remarks = ""; |
|
|
|
CommonContract commonContract = baseMapper.selectByBusSidss(dto.getBusSid()); |
|
|
|
if (commonContract != null) { |
|
|
|
String date = DateUtil.today(); |
|
|
|
List<String> dateString = Arrays.asList(date.split("-")); |
|
|
|
String year = dateString.get(0); |
|
|
|
String month = dateString.get(1); |
|
|
|
String day = dateString.get(2); |
|
|
|
map.put("year", year); |
|
|
|
map.put("month", month); |
|
|
|
map.put("day", day); |
|
|
|
} |
|
|
|
BusSalesOrder busSalesOrder = baseMapper.selectByBusSids(dto.getBusSid()); |
|
|
|
if (StringUtils.isNotBlank(dto.getCreateOrgName())) { |
|
|
|
map.put("createOrgName", dto.getCreateOrgName()); |
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(appOrderDetailsVo.getPurchaseSystemSid())) { |
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(appOrderDetailsVo.getUseOrgSid(), appOrderDetailsVo.getPurchaseSystemSid()); |
|
|
|
if (invoicingDetailsVoResultBean.getData() != null) { |
|
|
|
map.put("createOrgName", invoicingDetailsVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if ("1".equals(busSalesOrder.getType()) && (StringUtils.isBlank(busSalesOrder.getNowCarUnknownVinNum()) || "0".equals(busSalesOrder.getNowCarUnknownVinNum()))) { |
|
|
|
//获取模板
|
|
|
|
ftl = "dai_existingvehicles"; |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
} else { |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
} |
|
|
|
} else { |
|
|
|
map.put("dayOne", appOrderDetailsVo.getDepositInfo().getPayDepositDays()); |
|
|
|
//获取模板
|
|
|
|
ftl = "dai_orderacar"; |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
} |
|
|
|
map.put("remarks", remarks); |
|
|
|
//车价合计
|
|
|
|
String totalPrice = new BigDecimal(priceInfo.getSingleFinalPrice()).multiply(new BigDecimal(num)).toString(); |
|
|
|
map.put("totalPrice", totalPrice); |
|
|
|
//车价合计大写
|
|
|
|
String priceRemarks = ""; |
|
|
|
if (StringUtils.isNotBlank(totalPrice)) { |
|
|
|
priceRemarks = TransformMoney.transform(TransformMoney.getDecimalStr(Double.valueOf(totalPrice).doubleValue())); |
|
|
|
} |
|
|
|
map.put("priceRemarks", priceRemarks); |
|
|
|
//订金合计
|
|
|
|
AppOrderDepositInfoVo depositInfo = appOrderDetailsVo.getDepositInfo(); |
|
|
|
String depositTotal = new BigDecimal(depositInfo.getDeposit()).multiply(new BigDecimal(num)).toString(); |
|
|
|
if ("0".equals(depositTotal)) { |
|
|
|
map.put("depositTotal", "/"); |
|
|
|
} else { |
|
|
|
map.put("depositTotal", depositTotal); |
|
|
|
} |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
|
long seconds = System.currentTimeMillis(); |
|
|
|
String typeName = dateStr + seconds + ".doc"; |
|
|
|
File file = new File(targetPath + ftl + seconds + ".ftl"); |
|
|
|
File dir = new File(targetPath); |
|
|
|
WordConvertUtils.inputStreamToFile(inputStream, file); |
|
|
|
WordConvertUtils.creatWord1(map, file, targetPath, typeName, dir); |
|
|
|
//新生成的word路径
|
|
|
|
String wordPath = targetPath + typeName; |
|
|
|
//生成文件名
|
|
|
|
String pdfName = map.get("contractNo").toString() + "贷款新车买卖合同2_" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
return pdfName; |
|
|
|
} |
|
|
|
|
|
|
|
private String getRisk(AppOrderDetailsVo appOrderDetailsVo, PrintConfirmDto dto) { |
|
|
|
LoanTemplateQuotationQuery loanTemplateQuotationQuery = new LoanTemplateQuotationQuery(); |
|
|
|
loanTemplateQuotationQuery.setSalesOrderSid(appOrderDetailsVo.getBusSalesOrderSid()); |
|
|
@ -2581,14 +2945,60 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
} |
|
|
|
} |
|
|
|
} else {//贷款
|
|
|
|
Future<String> future1 = pool.submit(() -> { |
|
|
|
return getDaiXContract(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
Future<String> future1_2 = pool.submit(() -> { |
|
|
|
return getDaiXContract2(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
Future<String> future2 = null; |
|
|
|
Future<String> future2_2 = null; |
|
|
|
Future<String> future4 = null; |
|
|
|
SolutionsDetailsVo loanSolutions = loanSolutionsFeign.selectDetailss(dto.getBusSid()).getData(); |
|
|
|
if (loanSolutions != null) { |
|
|
|
if (StringUtils.isBlank(loanSolutions.getTypeKey())) { |
|
|
|
//担保
|
|
|
|
} else { |
|
|
|
//非担保
|
|
|
|
future2 = pool.submit(() -> { |
|
|
|
return getDaiContractBlank(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
future2_2 = pool.submit(() -> { |
|
|
|
return getDaiContractBlank2(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
//接收车辆委托书
|
|
|
|
future4 = pool.submit(() -> { |
|
|
|
return getReceiveCar(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(future1.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future1.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
if(future4 != null){ |
|
|
|
if (StringUtils.isNotBlank(future4.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future4.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
if ("2".equals(appOrderDetailsVo.getPayTypeKey())) { |
|
|
|