|
|
@ -29,6 +29,8 @@ import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
|
|
import com.yxt.anrui.base.api.basemodelconfig.BaseModelConfig; |
|
|
|
import com.yxt.anrui.base.api.basemodelconfig.BaseModelConfigFeign; |
|
|
|
import com.yxt.anrui.base.api.basemodelconfig.BaseModelConfigSelectVo; |
|
|
|
import com.yxt.anrui.base.api.basetrailer.BaseTrailer; |
|
|
@ -38,14 +40,17 @@ import com.yxt.anrui.base.api.basetrailermodel.BaseTrailerModelDetailsVo; |
|
|
|
import com.yxt.anrui.base.api.basetrailermodel.BaseTrailerModelFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehicle.BaseVehicle; |
|
|
|
import com.yxt.anrui.base.api.basevehicle.BaseVehicleFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehiclemodel.BaseVehicleModel; |
|
|
|
import com.yxt.anrui.base.api.basevehiclemodel.BaseVehicleModelFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehiclestate.BaseVehicleStateDto; |
|
|
|
import com.yxt.anrui.base.api.basevehiclestate.BaseVehicleStateEnum; |
|
|
|
import com.yxt.anrui.base.api.basevehiclestate.BaseVehicleStateFeign; |
|
|
|
import com.yxt.anrui.base.api.commoncontract.*; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositfictitious.BusDepositFictitiousDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositfictitious.BusDepositFictitiousFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrder; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrderFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderTopInfoVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.*; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderborrower.BusSalesOrderBorrowerDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderborrower.BusSalesOrderBorrowerFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderloancontract.BusSalesOrderLoancontract; |
|
|
@ -59,14 +64,18 @@ import com.yxt.anrui.buscenter.api.bussalesordermodel.BusSalesOrderModelFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderprice.BusSalesOrderPrice; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderprice.BusSalesOrderPriceFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderprice.app.AppBusSalesOrderPriceVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordertrailer.BusSalesOrderTrailerDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordertrailer.BusSalesOrderTrailerFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicle; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTemp; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempFeign; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempVo; |
|
|
|
import com.yxt.anrui.fin.api.finbillapplication.FinBillApplicationDetailsVo; |
|
|
|
import com.yxt.anrui.fin.api.finbillapplication.FinBillApplicationFeign; |
|
|
|
import com.yxt.anrui.fin.api.fincompanyinvoicing.FinCompanyInvoicingDetailsVo; |
|
|
|
import com.yxt.anrui.fin.api.fincompanyinvoicing.FinCompanyInvoicingFeign; |
|
|
|
import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailed.FinUncollectedReceivablesDetailedFeign; |
|
|
|
import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoice; |
|
|
|
import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
@ -101,6 +110,7 @@ import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
|
|
|
|
import org.apache.tomcat.util.threads.ThreadPoolExecutor; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@ -109,6 +119,7 @@ import java.io.InputStream; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.DecimalFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.*; |
|
|
|
|
|
|
|
import static cn.hutool.json.XMLTokener.entity; |
|
|
|
|
|
|
@ -161,9 +172,7 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
@Autowired |
|
|
|
private CrmCustomerTempFeign crmCustomerTempFeign; |
|
|
|
@Autowired |
|
|
|
private FinVehicleInvoiceFeign finVehicleInvoiceFeign; |
|
|
|
@Autowired |
|
|
|
private FinBillApplicationFeign finBillApplicationFeign; |
|
|
|
private BusSalesOrderTrailerFeign busSalesOrderTrailerFeign; |
|
|
|
@Autowired |
|
|
|
private LoanSolutionsService loanSolutionsService; |
|
|
|
@Autowired |
|
|
@ -182,6 +191,10 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
private FinCompanyInvoicingFeign finCompanyInvoicingFeign; |
|
|
|
@Autowired |
|
|
|
private ScmWarehouseFeign scmWarehouseFeign; |
|
|
|
@Autowired |
|
|
|
private BaseVehicleModelFeign baseVehicleModelFeign; |
|
|
|
@Autowired |
|
|
|
private FinUncollectedReceivablesDetailedFeign finUncollectedReceivablesDetailedFeign; |
|
|
|
|
|
|
|
public PagerVo<LoanHomevisitPrepVo> listPageVo(PagerQuery<LoanHomevisitPrepQuery> pq) { |
|
|
|
LoanHomevisitPrepQuery query = pq.getParams(); |
|
|
@ -456,19 +469,19 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
printConfirmDto.setSalesOrderVehicles(salesOrderVehicles); |
|
|
|
List<File> filesList = new ArrayList<>(); |
|
|
|
//贷款车辆买卖合同
|
|
|
|
List<String> dkclmmhts = dkclmmht(printConfirmDto, conSetUpKey); |
|
|
|
List<String> dkclmmhts = clmmContract(printConfirmDto, conSetUpKey); |
|
|
|
//生成车辆融资协议
|
|
|
|
List<String> clrzxyUrls = generateCLRZXY(printConfirmDto, conSetUpKey); |
|
|
|
/* List<String> clrzxyUrls = generateCLRZXY(printConfirmDto, conSetUpKey); |
|
|
|
//生成还款协议
|
|
|
|
List<String> hkxyUrls = hkxy(printConfirmDto, conSetUpKey); |
|
|
|
//代管车辆委托书
|
|
|
|
List<String> dgclwtsUrls = dgclwts(printConfirmDto, conSetUpKey); |
|
|
|
List<String> dgclwtsUrls = dgclwts(printConfirmDto, conSetUpKey);*/ |
|
|
|
//判断是否为高低开
|
|
|
|
BusSalesOrderPrice data = busSalesOrderFeign.selectByContractNoOne(printConfirmDto.getContractNo()).getData(); |
|
|
|
//查询金融方案
|
|
|
|
SolutionsDetailsVo solutionsDetailsVo = loanSolutionsService.selectDetails(busSalesOrder.getSid()).getData(); |
|
|
|
//判断是否为高低开,若是则生成开票申请书
|
|
|
|
List<String> kpsqsUrls = new ArrayList<>(); |
|
|
|
/*List<String> kpsqsUrls = new ArrayList<>(); |
|
|
|
if (!data.getSingleFinalPrice().equals(solutionsDetailsVo.getMainVehicleAmount())) { |
|
|
|
//开票申请书
|
|
|
|
kpsqsUrls = kpsqs(printConfirmDto, conSetUpKey); |
|
|
@ -495,14 +508,14 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
if ("0".equals(homeKcCust.getIsSecurity())) { |
|
|
|
//生成公司股东会对外担保决议
|
|
|
|
gsgddwdbjyUrls = gsgddwdbjy(printConfirmDto, conSetUpKey); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
if (dkclmmhts != null && dkclmmhts.size() > 0) { |
|
|
|
for (String dkclmmht : dkclmmhts) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + dkclmmht); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
if (clrzxyUrls != null && clrzxyUrls.size() > 0) { |
|
|
|
/*if (clrzxyUrls != null && clrzxyUrls.size() > 0) { |
|
|
|
for (String clrzxyUrl : clrzxyUrls) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + clrzxyUrl); |
|
|
|
filesList.add(file); |
|
|
@ -555,7 +568,7 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + gsgddwdbjyUrl); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
}*/ |
|
|
|
//合并pdf文件
|
|
|
|
if (filesList.size() > 0) { |
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
@ -1201,6 +1214,421 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
return urls; |
|
|
|
} |
|
|
|
|
|
|
|
public List<String> clmmContract(PrintConfirmDto dto, String conSetUpKey) { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
//查询销售订单的信息
|
|
|
|
ResultBean<AppOrderDetailsVo> resultBean = busSalesOrderFeign.getSaleOrderDetails(dto.getBusSid()); |
|
|
|
AppOrderDetailsVo appOrderDetailsVo = resultBean.getData(); |
|
|
|
//获取车辆信息
|
|
|
|
List<SalesOrderVehicle> salesOrderVehicles = dto.getSalesOrderVehicles(); |
|
|
|
//获取采购系统、分公司对应的开票信息
|
|
|
|
FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingFeign.getDetailsBySystem(appOrderDetailsVo.getPurchaseSystemSid()).getData(); |
|
|
|
//甲方
|
|
|
|
map.put("jf", finCompanyInvoicingDetailsVo.getName()); |
|
|
|
//乙方
|
|
|
|
map.put("yf", salesOrderVehicles.get(0).getBorrowName()); |
|
|
|
//获取贷款人信息
|
|
|
|
BusSalesOrderBorrowerDetailsVo busSalesOrderBorrowerDetailsVo = busSalesOrderBorrowerFeign.fetchDetailsBySid(salesOrderVehicles.get(0).getBorrowerSid()).getData(); |
|
|
|
//获取贷款人客户信息
|
|
|
|
CrmCustomerTemp crmCustomerTemp = crmCustomerTempFeign.fetchEntity(busSalesOrderBorrowerDetailsVo.getCustomSid()).getData(); |
|
|
|
//乙方身份证号
|
|
|
|
map.put("yfID", crmCustomerTemp.getIDNumber()); |
|
|
|
//地址
|
|
|
|
LoanHomevisitInvestigateCustomerDetailsVo loanHomevisitInvestigateCustomerDetailsVo = loanHomevisitInvestigateCustomerService.fetchByBorrowerSid(salesOrderVehicles.get(0).getBorrowerSid()); |
|
|
|
map.put("qdAddress", loanHomevisitInvestigateCustomerDetailsVo.getBorrowerDomAddress()); |
|
|
|
//电话
|
|
|
|
map.put("phone", crmCustomerTemp.getMobile()); |
|
|
|
//查询销售订单的车型信息
|
|
|
|
AppOrderModelInfoVo appOrderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
//根据车型sid查询车型的全称
|
|
|
|
BaseVehicleModel baseVehicleModel = baseVehicleModelFeign.fetchBySid(appOrderModelInfoVo.getModelSid()).getData(); |
|
|
|
BaseModelConfig baseModelConfig = baseModelConfigFeign.fetchBySid(appOrderModelInfoVo.getConfigSid()).getData(); |
|
|
|
String modelName = "车型:"; |
|
|
|
StringBuilder modeNameValue = new StringBuilder(); |
|
|
|
//车型名称(小名):系列+驱动+功能+空格+版本
|
|
|
|
if (StringUtils.isNotBlank(baseVehicleModel.getProductLineValue()) && !"-".equals(baseVehicleModel.getProductLineValue())) { |
|
|
|
modeNameValue.append(baseVehicleModel.getProductLineValue()); |
|
|
|
} |
|
|
|
//驱动
|
|
|
|
if (StringUtils.isNotBlank(baseVehicleModel.getDriveFormValue()) && !"-".equals(baseVehicleModel.getDriveFormValue())) { |
|
|
|
modeNameValue.append(baseVehicleModel.getDriveFormValue()); |
|
|
|
} |
|
|
|
//功能
|
|
|
|
if (StringUtils.isNotBlank(baseVehicleModel.getVehicleTypeValue()) && !"-".equals(baseVehicleModel.getVehicleTypeValue())) { |
|
|
|
modeNameValue.append(baseVehicleModel.getVehicleTypeValue()); |
|
|
|
} |
|
|
|
//版本
|
|
|
|
if (StringUtils.isNotBlank(baseVehicleModel.getVehicleVersionValue()) && !"-".equals(baseVehicleModel.getVehicleVersionValue())) { |
|
|
|
modeNameValue.append(baseVehicleModel.getVehicleVersionValue()); |
|
|
|
} |
|
|
|
modelName = modelName + modeNameValue.toString(); |
|
|
|
//车型全名称:发动机型号(空格)xxx马力+燃料+排放标准发动机、变速箱、缓速器、
|
|
|
|
// 后桥(若存在“桥”字样后不带“后桥”)、速比、轴距、悬架(若存在“悬架”字样后不带“悬架”)、
|
|
|
|
// 鞍座(若存在“鞍座”字样后不带“鞍座”)、燃料箱(若存在“油箱”字样后不带“燃料箱”)、轮胎(若存在“胎”字样后不带“轮胎”)、
|
|
|
|
// 轮毂材质、护轮罩。换行
|
|
|
|
//驾驶室+颜色驾驶室、导流罩、保险杠、后视镜、座椅、空调、独立热源、多媒体
|
|
|
|
StringBuilder modelAllName = new StringBuilder(); |
|
|
|
//发动机型号
|
|
|
|
if (StringUtils.isNotBlank(baseVehicleModel.getEngineTypeValue()) && !"-".equals(baseVehicleModel.getEngineTypeValue())) { |
|
|
|
modelAllName.append(baseVehicleModel.getEngineTypeValue()); |
|
|
|
} |
|
|
|
//马力
|
|
|
|
if (StringUtils.isNotBlank(baseVehicleModel.getPowerValue()) && !"-".equals(baseVehicleModel.getPowerValue())) { |
|
|
|
modelAllName.append(" ").append(baseVehicleModel.getPowerValue()).append("马力"); |
|
|
|
} |
|
|
|
//燃料
|
|
|
|
if (StringUtils.isNotBlank(baseVehicleModel.getFuelTypeValue()) && !"-".equals(baseVehicleModel.getFuelTypeValue())) { |
|
|
|
modelAllName.append(baseVehicleModel.getFuelTypeValue()); |
|
|
|
} |
|
|
|
//排放标准
|
|
|
|
if (StringUtils.isNotBlank(baseVehicleModel.getEmissionStandardValue()) && !"-".equals(baseVehicleModel.getEmissionStandardValue())) { |
|
|
|
modelAllName.append(baseVehicleModel.getEmissionStandardValue()); |
|
|
|
} |
|
|
|
modelAllName.append("发动机"); |
|
|
|
//变速箱
|
|
|
|
if (StringUtils.isNotBlank(baseVehicleModel.getGearboxTypeValue()) && !"-".equals(baseVehicleModel.getGearboxTypeValue())) { |
|
|
|
modelAllName.append("、").append(baseVehicleModel.getGearboxTypeValue()).append("变速箱"); |
|
|
|
} |
|
|
|
//缓速器
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getSlowMachine()) && !"-".equals(baseModelConfig.getSlowMachine())) { |
|
|
|
modelAllName.append("、").append(baseModelConfig.getSlowMachine()); |
|
|
|
} |
|
|
|
//后桥
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getRearAxleValue()) && !"-".equals(baseModelConfig.getRearAxleValue())) { |
|
|
|
modelAllName.append("、").append(baseModelConfig.getRearAxleValue()); |
|
|
|
if (!baseModelConfig.getRearAxleValue().contains("桥")) { |
|
|
|
modelAllName.append("后桥"); |
|
|
|
} |
|
|
|
} |
|
|
|
//速比
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getRearAxleRatio()) && !"-".equals(baseModelConfig.getRearAxleRatio())) { |
|
|
|
modelAllName.append("、").append(baseModelConfig.getRearAxleRatio()).append("速比"); |
|
|
|
} |
|
|
|
//轴距
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getWheelbase()) && !"-".equals(baseModelConfig.getWheelbase())) { |
|
|
|
modelAllName.append("、").append(baseModelConfig.getWheelbase()).append("mm轴距"); |
|
|
|
} |
|
|
|
//悬架
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getSuspension()) && !"-".equals(baseModelConfig.getSuspension())) { |
|
|
|
modelAllName.append("、").append(baseModelConfig.getSuspension()); |
|
|
|
if (!baseModelConfig.getSuspension().contains("悬架")) { |
|
|
|
modelAllName.append("悬架"); |
|
|
|
} |
|
|
|
} |
|
|
|
//鞍座
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getSaddle()) && !"-".equals(baseModelConfig.getSaddle())) { |
|
|
|
modelAllName.append("、").append(baseModelConfig.getSaddle()); |
|
|
|
if (!baseModelConfig.getSaddle().contains("鞍座")) { |
|
|
|
modelAllName.append("鞍座"); |
|
|
|
} |
|
|
|
} |
|
|
|
//燃料箱
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getFuelTank()) && !"-".equals(baseModelConfig.getFuelTank())) { |
|
|
|
modelAllName.append("、").append(baseModelConfig.getFuelTank()); |
|
|
|
if (!baseModelConfig.getFuelTank().contains("油箱")) { |
|
|
|
modelAllName.append("燃料箱"); |
|
|
|
} |
|
|
|
} |
|
|
|
//轮胎
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getTireSize()) && !"-".equals(baseModelConfig.getTireSize())) { |
|
|
|
modelAllName.append("、").append(baseModelConfig.getTireSize()); |
|
|
|
if (!baseModelConfig.getTireSize().contains("胎")) { |
|
|
|
modelAllName.append("轮胎"); |
|
|
|
} |
|
|
|
} |
|
|
|
//轮毂材质
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getHubMaterial()) && !"-".equals(baseModelConfig.getHubMaterial())) { |
|
|
|
modelAllName.append("、").append(baseModelConfig.getHubMaterial()); |
|
|
|
} |
|
|
|
//护轮罩
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getTireCover()) && !"-".equals(baseModelConfig.getTireCover())) { |
|
|
|
modelAllName.append("、").append(baseModelConfig.getTireCover()); |
|
|
|
} |
|
|
|
StringBuilder modelAllName2 = new StringBuilder(); |
|
|
|
modelAllName2.append("\t").append(" "); |
|
|
|
//驾驶室
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getSpecification()) && !"-".equals(baseModelConfig.getSpecification())) { |
|
|
|
modelAllName2.append(baseModelConfig.getSpecification()); |
|
|
|
} |
|
|
|
//颜色
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getCarColor()) && !"-".equals(baseModelConfig.getCarColor())) { |
|
|
|
modelAllName2.append("/").append(baseModelConfig.getCarColor()).append("驾驶室"); |
|
|
|
} |
|
|
|
//导流罩
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getBaffleModel()) && !"-".equals(baseModelConfig.getBaffleModel())) { |
|
|
|
modelAllName2.append("、").append(baseModelConfig.getBaffleModel()); |
|
|
|
} |
|
|
|
//保险杠
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getBumper()) && !"-".equals(baseModelConfig.getBumper())) { |
|
|
|
modelAllName2.append("、").append(baseModelConfig.getBumper()); |
|
|
|
} |
|
|
|
//后视镜
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getRearViewMirror()) && !"-".equals(baseModelConfig.getRearViewMirror())) { |
|
|
|
modelAllName2.append("、").append(baseModelConfig.getRearViewMirror()); |
|
|
|
} |
|
|
|
//座椅
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getSeat()) && !"-".equals(baseModelConfig.getSeat())) { |
|
|
|
modelAllName2.append("、").append(baseModelConfig.getSeat()); |
|
|
|
if (!baseModelConfig.getSeat().contains("椅")) { |
|
|
|
modelAllName2.append("座椅"); |
|
|
|
} |
|
|
|
} |
|
|
|
//空调
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getAirConditioner()) && !"-".equals(baseModelConfig.getAirConditioner())) { |
|
|
|
modelAllName2.append("、").append(baseModelConfig.getAirConditioner()); |
|
|
|
} |
|
|
|
//独立热源
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getIndependentSources()) && !"-".equals(baseModelConfig.getIndependentSources())) { |
|
|
|
modelAllName2.append("、").append(baseModelConfig.getIndependentSources()); |
|
|
|
} |
|
|
|
//多媒体
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getMultimedia()) && !"-".equals(baseModelConfig.getMultimedia())) { |
|
|
|
modelAllName2.append("、").append(baseModelConfig.getMultimedia()); |
|
|
|
} |
|
|
|
//特殊配置说明
|
|
|
|
if (StringUtils.isNotBlank(appOrderModelInfoVo.getSpecialInstructions())) { |
|
|
|
modelAllName2.append("、").append("特殊配置说明:" + appOrderModelInfoVo.getSpecialInstructions()); |
|
|
|
|
|
|
|
} |
|
|
|
modelAllName2.append("。"); |
|
|
|
String modelConfig = "配置:" + modelAllName + "。"; |
|
|
|
//上装:外廓尺寸+颜色+上装名称、板材厚度、板材材质、篷布滑道、冷藏冷机、自卸液压盖板、底板加热、更多配置
|
|
|
|
if (appOrderDetailsVo.getTopInfo() != null) { |
|
|
|
AppOrderTopInfoVo topInfo = appOrderDetailsVo.getTopInfo(); |
|
|
|
String topName = appOrderDetailsVo.getTopMessage(); |
|
|
|
topName = "上装:制造尺寸与公告一致、" + topName + "。"; |
|
|
|
map.put("topName", topName); |
|
|
|
} |
|
|
|
map.put("modelConfigs", modelAllName2.toString()); |
|
|
|
map.put("modelName", modelName); |
|
|
|
map.put("modelConfig", modelConfig); |
|
|
|
if ("1".equals(appOrderDetailsVo.getIsInsurance())) { |
|
|
|
//保险说明
|
|
|
|
String insuranceInfo = "保险说明:" + appOrderDetailsVo.getInsuranceInfoMessage() + "。"; |
|
|
|
map.put("insuranceInfo", insuranceInfo); |
|
|
|
} |
|
|
|
//查询是否有公告型号
|
|
|
|
String publics = "公告型号:"; |
|
|
|
String publicModel = appOrderModelInfoVo.getPublicModel(); |
|
|
|
String publicModelSon = appOrderModelInfoVo.getPublicModelSon(); |
|
|
|
if (StringUtils.isNotBlank(publicModel)) { |
|
|
|
publics = publics + publicModel; |
|
|
|
map.put("publicModel", publics + "。"); |
|
|
|
if (StringUtils.isNotBlank(publicModelSon)) { |
|
|
|
map.put("publicModel", publics + "、" + publicModelSon + "。"); |
|
|
|
} |
|
|
|
} |
|
|
|
//查询销售订单价格信息
|
|
|
|
AppBusSalesOrderPriceVo appBusSalesOrderPriceVo = busSalesOrderPriceFeign.getPriceInfo(dto.getBusSid()).getData(); |
|
|
|
//车辆交付地点
|
|
|
|
if (StringUtils.isNotBlank(appBusSalesOrderPriceVo.getAddressKey())) { |
|
|
|
ScmWarehouseVo scmWarehouseVo = scmWarehouseFeign.fetchBySid(appBusSalesOrderPriceVo.getAddressKey()).getData(); |
|
|
|
if (StringUtils.isNotBlank(scmWarehouseVo.getCity()) && StringUtils.isNotBlank(scmWarehouseVo.getCounty())) { |
|
|
|
map.put("address", scmWarehouseVo.getCity() + scmWarehouseVo.getCounty()); |
|
|
|
} else { |
|
|
|
map.put("address", "暂无市、区/县"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
map.put("address", "暂无预计交付地点"); |
|
|
|
} |
|
|
|
//合同生成日期
|
|
|
|
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); |
|
|
|
List<String> urls = new ArrayList<>(); |
|
|
|
if (conSetUpKey.equals("001")) {//一车一合同
|
|
|
|
for (SalesOrderVehicle salesOrderVehicle : salesOrderVehicles) { |
|
|
|
//获取消贷合同信息
|
|
|
|
BusSalesOrderLoancontractDetailsVo busSalesOrderLoancontractDetailsVo = busSalesOrderLoancontractFeign.fetchDetailsBySid(salesOrderVehicle.getLoanContractSid()).getData(); |
|
|
|
//消贷合同编号
|
|
|
|
map.put("loanContractNo", busSalesOrderLoancontractDetailsVo.getLoanContractNo()); |
|
|
|
//单台成交价
|
|
|
|
String transactionPrice = appBusSalesOrderPriceVo.getTransactionPrice(); |
|
|
|
//车辆数量及单台成交价
|
|
|
|
String remarks = "数量:1台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
map.put("remarks", remarks); |
|
|
|
//车架号
|
|
|
|
map.put("vinNo", "车架号:" + salesOrderVehicle.getLinkNo()); |
|
|
|
// 挂车信息
|
|
|
|
List<BusSalesOrderTrailerDetailsVo> data = busSalesOrderTrailerFeign.fetchDetailsByOrderSid(dto.getBusSid()).getData(); |
|
|
|
if (data.size() == 1) { |
|
|
|
map.put("trailerName1", "挂车:外廓尺寸-长" + data.get(0).getAppearanceSizeLong() + "m," + data.get(0).getTrailerTypeValue() + "。"); |
|
|
|
map.put("trailerNumAndPrice1", "数量:" + data.get(0).getTrailerCount() + "台,单台成交价:" + data.get(0).getSingleFinalPrice() + "元。"); |
|
|
|
//单台主车对应挂车总价
|
|
|
|
BigDecimal gcPrice = data.get(0).getSingleFinalPrice().multiply(new BigDecimal(data.get(0).getTrailerCount())); |
|
|
|
//单台主车加挂车总价
|
|
|
|
BigDecimal zcPrice = new BigDecimal(appBusSalesOrderPriceVo.getTransactionPrice()).add(gcPrice); |
|
|
|
//主车总价
|
|
|
|
BigDecimal totalPrice = zcPrice.multiply(new BigDecimal(appBusSalesOrderPriceVo.getNumber())); |
|
|
|
//车价合计
|
|
|
|
map.put("totalPrice", totalPrice.toString()); |
|
|
|
//车价合计大写
|
|
|
|
String priceRemarks = ""; |
|
|
|
if (StringUtils.isNotBlank(totalPrice.toString())) { |
|
|
|
priceRemarks = TransformMoney.transform(TransformMoney.getDecimalStr(Double.valueOf(totalPrice.toString()).doubleValue())); |
|
|
|
} |
|
|
|
map.put("priceRemarks", priceRemarks); |
|
|
|
} else if (data.size() == 2) { |
|
|
|
map.put("trailerName1", "挂车1:外廓尺寸-长" + data.get(0).getAppearanceSizeLong() + "m," + data.get(0).getTrailerTypeValue() + "。"); |
|
|
|
map.put("trailerNumAndPrice1", "数量:" + data.get(0).getTrailerCount() + "台,单台成交价:" + data.get(0).getSingleFinalPrice() + "元。"); |
|
|
|
map.put("trailerName2", "挂车2:外廓尺寸-长" + data.get(1).getAppearanceSizeLong() + "m," + data.get(1).getTrailerTypeValue() + "。"); |
|
|
|
map.put("trailerNumAndPrice2", "数量:" + data.get(1).getTrailerCount() + "台,单台成交价:" + data.get(1).getSingleFinalPrice() + "元。"); |
|
|
|
//单台主车对应挂车1总价
|
|
|
|
BigDecimal gc1Price = data.get(0).getSingleFinalPrice().multiply(new BigDecimal(data.get(0).getTrailerCount())); |
|
|
|
//单台主车对应挂车2总价
|
|
|
|
BigDecimal gc2Price = data.get(1).getSingleFinalPrice().multiply(new BigDecimal(data.get(1).getTrailerCount())); |
|
|
|
//单台主车加挂车总价
|
|
|
|
BigDecimal zcPrice = new BigDecimal(appBusSalesOrderPriceVo.getTransactionPrice()).add(gc1Price).add(gc2Price); |
|
|
|
//主车总价
|
|
|
|
BigDecimal totalPrice = zcPrice.multiply(new BigDecimal(appBusSalesOrderPriceVo.getNumber())); |
|
|
|
//车价合计
|
|
|
|
map.put("totalPrice", totalPrice.toString()); |
|
|
|
//车价合计大写
|
|
|
|
String priceRemarks = ""; |
|
|
|
if (StringUtils.isNotBlank(totalPrice.toString())) { |
|
|
|
priceRemarks = TransformMoney.transform(TransformMoney.getDecimalStr(Double.valueOf(totalPrice.toString()).doubleValue())); |
|
|
|
} |
|
|
|
map.put("priceRemarks", priceRemarks); |
|
|
|
} else { |
|
|
|
//主车总价
|
|
|
|
BigDecimal totalPrice = new BigDecimal(appBusSalesOrderPriceVo.getTransactionPrice()).multiply(new BigDecimal(appBusSalesOrderPriceVo.getNumber())); |
|
|
|
//车价合计
|
|
|
|
map.put("totalPrice", totalPrice.toString()); |
|
|
|
//车价合计大写
|
|
|
|
String priceRemarks = ""; |
|
|
|
if (StringUtils.isNotBlank(totalPrice.toString())) { |
|
|
|
priceRemarks = TransformMoney.transform(TransformMoney.getDecimalStr(Double.valueOf(totalPrice.toString()).doubleValue())); |
|
|
|
} |
|
|
|
map.put("priceRemarks", priceRemarks); |
|
|
|
} |
|
|
|
//订金
|
|
|
|
BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleFeign.selectByNoAndVinSid(appOrderDetailsVo.getContractId(), salesOrderVehicle.getLinkSid()).getData(); |
|
|
|
String djTotal = finUncollectedReceivablesDetailedFeign.selectDjByBusVinSid(busSalesOrderVehicle.getSid()).getData(); |
|
|
|
map.put("depositTotal", djTotal); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + "clmmht" + ".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 + "clmmht" + 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("loanContractNo").toString() + "车辆买卖合同_" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
urls.add(pdfName); |
|
|
|
} |
|
|
|
} else if (conSetUpKey.equals("002")) {//一人一合同
|
|
|
|
//获取消贷合同信息
|
|
|
|
BusSalesOrderLoancontractDetailsVo busSalesOrderLoancontractDetailsVo = busSalesOrderLoancontractFeign.fetchDetailsBySid(salesOrderVehicles.get(0).getLoanContractSid()).getData(); |
|
|
|
//消贷合同编号
|
|
|
|
map.put("loanContractNo", busSalesOrderLoancontractDetailsVo.getLoanContractNo()); |
|
|
|
//车辆总数
|
|
|
|
BigDecimal num = new BigDecimal(salesOrderVehicles.size()); |
|
|
|
//单台成交价
|
|
|
|
String transactionPrice = appBusSalesOrderPriceVo.getTransactionPrice(); |
|
|
|
//车辆数量及单台成交价
|
|
|
|
String remarks = "数量:" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
map.put("remarks", remarks); |
|
|
|
//车架号
|
|
|
|
String vinNo = ""; |
|
|
|
//订金
|
|
|
|
BigDecimal djTotal = new BigDecimal("0"); |
|
|
|
for (SalesOrderVehicle salesOrderVehicle : salesOrderVehicles) { |
|
|
|
vinNo = vinNo + salesOrderVehicle.getLinkNo() + "、"; |
|
|
|
BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleFeign.selectByNoAndVinSid(appOrderDetailsVo.getContractId(), salesOrderVehicle.getLinkSid()).getData(); |
|
|
|
String dtdjTotal = finUncollectedReceivablesDetailedFeign.selectDjByBusVinSid(busSalesOrderVehicle.getSid()).getData(); |
|
|
|
djTotal = djTotal.add(new BigDecimal(dtdjTotal)); |
|
|
|
} |
|
|
|
map.put("vinNo", "车架号:" + vinNo.substring(0, vinNo.length() - 1)); |
|
|
|
map.put("depositTotal", djTotal.toString()); |
|
|
|
// 挂车信息
|
|
|
|
List<BusSalesOrderTrailerDetailsVo> data = busSalesOrderTrailerFeign.fetchDetailsByOrderSid(dto.getBusSid()).getData(); |
|
|
|
if (data.size() == 1) { |
|
|
|
map.put("trailerName1", "挂车:外廓尺寸-长" + data.get(0).getAppearanceSizeLong() + "m," + data.get(0).getTrailerTypeValue() + "。"); |
|
|
|
map.put("trailerNumAndPrice1", "数量:" + new BigDecimal(data.get(0).getTrailerCount()).multiply(num) + "台,单台成交价:" + data.get(0).getSingleFinalPrice() + "元。"); |
|
|
|
//单台主车对应挂车总价
|
|
|
|
BigDecimal gcPrice = data.get(0).getSingleFinalPrice().multiply(new BigDecimal(data.get(0).getTrailerCount())); |
|
|
|
//单台主车加挂车总价
|
|
|
|
BigDecimal zcPrice = new BigDecimal(appBusSalesOrderPriceVo.getTransactionPrice()).add(gcPrice); |
|
|
|
//单台主车总价
|
|
|
|
BigDecimal dtTotalPrice = zcPrice.multiply(new BigDecimal(appBusSalesOrderPriceVo.getNumber())); |
|
|
|
//总数合计
|
|
|
|
BigDecimal totalPrice = dtTotalPrice.multiply(num); |
|
|
|
//车价总数合计
|
|
|
|
map.put("totalPrice", totalPrice.toString()); |
|
|
|
//车价合计大写
|
|
|
|
String priceRemarks = ""; |
|
|
|
if (StringUtils.isNotBlank(totalPrice.toString())) { |
|
|
|
priceRemarks = TransformMoney.transform(TransformMoney.getDecimalStr(Double.valueOf(totalPrice.toString()).doubleValue())); |
|
|
|
} |
|
|
|
map.put("priceRemarks", priceRemarks); |
|
|
|
} else if (data.size() == 2) { |
|
|
|
map.put("trailerName1", "挂车1:外廓尺寸-长" + data.get(0).getAppearanceSizeLong() + "m," + data.get(0).getTrailerTypeValue() + "。"); |
|
|
|
map.put("trailerNumAndPrice1", "数量:" + new BigDecimal(data.get(0).getTrailerCount()).multiply(num) + "台,单台成交价:" + data.get(0).getSingleFinalPrice() + "元。"); |
|
|
|
map.put("trailerName2", "挂车2:外廓尺寸-长" + data.get(1).getAppearanceSizeLong() + "m," + data.get(1).getTrailerTypeValue() + "。"); |
|
|
|
map.put("trailerNumAndPrice2", "数量:" + new BigDecimal(data.get(1).getTrailerCount()).multiply(num) + "台,单台成交价:" + data.get(1).getSingleFinalPrice() + "元。"); |
|
|
|
//单台主车对应挂车1总价
|
|
|
|
BigDecimal gc1Price = data.get(0).getSingleFinalPrice().multiply(new BigDecimal(data.get(0).getTrailerCount())); |
|
|
|
//单台主车对应挂车2总价
|
|
|
|
BigDecimal gc2Price = data.get(1).getSingleFinalPrice().multiply(new BigDecimal(data.get(1).getTrailerCount())); |
|
|
|
//单台主车加挂车总价
|
|
|
|
BigDecimal zcPrice = new BigDecimal(appBusSalesOrderPriceVo.getTransactionPrice()).add(gc1Price).add(gc2Price); |
|
|
|
//单台主车总价
|
|
|
|
BigDecimal dtTotalPrice = zcPrice.multiply(new BigDecimal(appBusSalesOrderPriceVo.getNumber())); |
|
|
|
//总数合计
|
|
|
|
BigDecimal totalPrice = dtTotalPrice.multiply(num); |
|
|
|
//车价合计
|
|
|
|
map.put("totalPrice", totalPrice.toString()); |
|
|
|
//车价合计大写
|
|
|
|
String priceRemarks = ""; |
|
|
|
if (StringUtils.isNotBlank(totalPrice.toString())) { |
|
|
|
priceRemarks = TransformMoney.transform(TransformMoney.getDecimalStr(Double.valueOf(totalPrice.toString()).doubleValue())); |
|
|
|
} |
|
|
|
map.put("priceRemarks", priceRemarks); |
|
|
|
} else { |
|
|
|
//主车总价
|
|
|
|
BigDecimal dtTotalPrice = new BigDecimal(appBusSalesOrderPriceVo.getTransactionPrice()).multiply(new BigDecimal(appBusSalesOrderPriceVo.getNumber())); |
|
|
|
//总数合计
|
|
|
|
BigDecimal totalPrice = dtTotalPrice.multiply(num); |
|
|
|
//车价合计
|
|
|
|
map.put("totalPrice", totalPrice.toString()); |
|
|
|
//车价合计大写
|
|
|
|
String priceRemarks = ""; |
|
|
|
if (StringUtils.isNotBlank(totalPrice.toString())) { |
|
|
|
priceRemarks = TransformMoney.transform(TransformMoney.getDecimalStr(Double.valueOf(totalPrice.toString()).doubleValue())); |
|
|
|
} |
|
|
|
map.put("priceRemarks", priceRemarks); |
|
|
|
} |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + "clmmht" + ".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 + "clmmht" + 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("loanContractNo").toString() + "车辆买卖合同_" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
urls.add(pdfName); |
|
|
|
} |
|
|
|
return urls; |
|
|
|
} |
|
|
|
|
|
|
|
public List<String> generateCLRZXY(PrintConfirmDto printConfirmDto, String conSetUpKey) { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
List<SalesOrderVehicle> salesOrderVehicles = printConfirmDto.getSalesOrderVehicles(); |
|
|
|