|
|
@ -2052,6 +2052,27 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
printConfirmVo.setDownloadUrl(docPdfComponent.getPrefixTemplateUrl() + urlAll); |
|
|
|
list.add(printConfirmVo); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
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); |
|
|
|
} |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
//生成合同数据
|
|
|
|
//根据销售订单sid查询合同表中是否存在
|
|
|
@ -2143,100 +2164,6 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
commonAppendixService.insert(commonAppendix); |
|
|
|
} |
|
|
|
} |
|
|
|
//查询销售订单的单台订金与单台成交价是否相等,若不相等,则推送车款为成交价减去订金的,推送订金的为单台订金的
|
|
|
|
/* String singleFinalPrice = priceInfo.getSingleFinalPrice(); |
|
|
|
String deposit = depositInfo.getDeposit(); |
|
|
|
//单台成交价与单台订金相等
|
|
|
|
if (new BigDecimal(singleFinalPrice).compareTo(new BigDecimal(deposit)) != 0) {//推送车款
|
|
|
|
String money = new BigDecimal(singleFinalPrice).subtract(new BigDecimal(deposit)).toString(); |
|
|
|
List<VinListsVo> vinList = appOrderModelInfoVo.getVinListsVos(); |
|
|
|
for (int i = 0; i < vinList.size(); 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.setVinNo(vinList.get(i).getVinNo()); |
|
|
|
unCollectionDto.setCurrentReceivableMoney(money); |
|
|
|
unCollectionDto.setUserSid(dto.getUserSid()); |
|
|
|
unCollectionDto.setReveivableMoney(money); |
|
|
|
unCollectionDto.setBusVinSid(vinList.get(i).getSid()); |
|
|
|
unCollectionDto.setPayType(appOrderDetailsVo.getPayType()); |
|
|
|
unCollectionDto.setPayTypeKey(appOrderDetailsVo.getPayTypeKey()); |
|
|
|
unCollectionDto.setPurchaseSystemName(appOrderDetailsVo.getPurchaseSystemName()); |
|
|
|
unCollectionDto.setPurchaseSystemSid(appOrderDetailsVo.getPurchaseSystemSid()); |
|
|
|
finUncollectedDetailedFeign.saveUnCollection(unCollectionDto); |
|
|
|
} |
|
|
|
} |
|
|
|
//添加推送至款项确认的应收未收明细中
|
|
|
|
List<VinListsVo> vinList = appOrderModelInfoVo.getVinListsVos(); |
|
|
|
//更新销售订单的临时号
|
|
|
|
if("2".equals(appOrderDetailsVo.getPayTypeKey())){//贷款
|
|
|
|
for(int i = 0; i < vinList.size(); i++){ |
|
|
|
//销售订单中车辆表的sid
|
|
|
|
String salesOrderVinSid = vinList.get(i).getSid(); |
|
|
|
String temporaryNum = String.format("%02d", i + 1); |
|
|
|
String temporaryNo = commonContract.getContractNo()+temporaryNum; |
|
|
|
//更新临时号
|
|
|
|
ResultBean busSalesOrderResultBean = busSalesOrderVehicleFeign.updateTemporaryNo(salesOrderVinSid,temporaryNo); |
|
|
|
} |
|
|
|
} |
|
|
|
//查询是否是结转金额,如果是,则订金金额为补交金额/台数。若为现金则为单台订金
|
|
|
|
String key = depositInfo.getDepositTypeKey(); |
|
|
|
BigDecimal bigDecimalKeyAll = new BigDecimal("0"); |
|
|
|
if ("02".equals(key)) { |
|
|
|
String makeUpAll = depositInfo.getMakeUpDeposit(); |
|
|
|
if (makeUpAll != null) { |
|
|
|
bigDecimalKeyAll = bigDecimalKeyAll.add(new BigDecimal(makeUpAll).divide(new BigDecimal(num))); |
|
|
|
} |
|
|
|
} else { |
|
|
|
bigDecimalKeyAll = bigDecimalKeyAll.add(new BigDecimal(depositInfo.getDeposit())); |
|
|
|
} |
|
|
|
if (bigDecimalKeyAll.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
for (int i = 0; i < vinList.size(); 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.setVinNo(vinList.get(i).getVinNo()); |
|
|
|
unCollectionDto.setCurrentReceivableMoney(bigDecimalKeyAll.toString()); |
|
|
|
unCollectionDto.setUserSid(dto.getUserSid()); |
|
|
|
unCollectionDto.setReveivableMoney(depositInfo.getDeposit()); |
|
|
|
unCollectionDto.setBusVinSid(vinList.get(i).getSid()); |
|
|
|
unCollectionDto.setPayType(appOrderDetailsVo.getPayType()); |
|
|
|
unCollectionDto.setPayTypeKey(appOrderDetailsVo.getPayTypeKey()); |
|
|
|
unCollectionDto.setPurchaseSystemName(appOrderDetailsVo.getPurchaseSystemName()); |
|
|
|
unCollectionDto.setPurchaseSystemSid(appOrderDetailsVo.getPurchaseSystemSid()); |
|
|
|
finUncollectedDetailedFeign.saveUnCollection(unCollectionDto); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
return commonContract.getSid(); |
|
|
|
}); |
|
|
|
} else { |
|
|
@ -2276,9 +2203,9 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
|
|
|
|
baseMapper.updateById(commonContract); |
|
|
|
} |
|
|
|
if ("2".equals(appOrderDetailsVo.getPayTypeKey())) { |
|
|
|
/* if ("2".equals(appOrderDetailsVo.getPayTypeKey())) { |
|
|
|
return rb.setMsg("贷款合同附件请线下处理").setCode("1000001"); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
log.error("生成文件失败:==========================" + e.getMessage()); |
|
|
|