|
|
@ -47,6 +47,7 @@ import com.yxt.anrui.buscenter.api.busvehicleinformationhandover.BusVehicleInfor |
|
|
|
import com.yxt.anrui.crm.api.crmcustomer.CrmCustomerFeign; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomerfile.CrmCustomerFileFeign; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerFileDDto; |
|
|
|
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.finbillvehicle.FinBillVehicleFeign; |
|
|
@ -801,29 +802,56 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
private String genCarSaleContract(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 = priceInfo.getNumber(); |
|
|
|
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 = ""; |
|
|
|
if ("现车".equals(appOrderDetailsVo.getOrderType())) { |
|
|
|
//获取模板
|
|
|
|
ftl = "existingvehicles"; |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。车架号:" + String.join("、", stringList); |
|
|
|
} else { |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
} |
|
|
|
} else { |
|
|
|
map.put("dayOne", appOrderDetailsVo.getDepositInfo().getPayDepositDays()); |
|
|
|
map.put("dayOne", new BigDecimal(appOrderDetailsVo.getDepositInfo().getDeposit()).multiply(new BigDecimal(num)).toString()); |
|
|
|
//获取模板
|
|
|
|
ftl = "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(); |
|
|
@ -845,29 +873,56 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
private String genCarSaleContract2(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 = priceInfo.getNumber(); |
|
|
|
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 = ""; |
|
|
|
if ("现车".equals(appOrderDetailsVo.getOrderType())) { |
|
|
|
//获取模板
|
|
|
|
ftl = "existingvehicles2"; |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
ftl = "existingvehicles"; |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。车架号:" + String.join("、", stringList); |
|
|
|
} else { |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
} |
|
|
|
} else { |
|
|
|
map.put("dayOne", appOrderDetailsVo.getDepositInfo().getPayDepositDays()); |
|
|
|
map.put("dayOne", new BigDecimal(appOrderDetailsVo.getDepositInfo().getDeposit()).multiply(new BigDecimal(num)).toString()); |
|
|
|
//获取模板
|
|
|
|
ftl = "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(); |
|
|
@ -1617,6 +1672,319 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
return r; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<PrintConfirmVo>> xcmmContract(PrintConfirmDto dto) { |
|
|
|
ResultBean<List<PrintConfirmVo>> rb = ResultBean.fireFail(); |
|
|
|
List<PrintConfirmVo> list = new ArrayList<>(); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
//客户信息
|
|
|
|
CrmCustomerTemp crmCustomerTemp = crmCustomerTempFeign.fetchEntity(dto.getCustomerSid()).getData(); |
|
|
|
//查询销售订单的信息
|
|
|
|
ResultBean<AppOrderDetailsVo> resultBean = busSalesOrderFeign.getSaleOrderDetails(dto.getBusSid()); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
AppOrderDetailsVo appOrderDetailsVo = resultBean.getData(); |
|
|
|
//查询销售订单的车型信息
|
|
|
|
AppOrderModelInfoVo appOrderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
//根据车型sid查询车型的全称
|
|
|
|
BaseVehicleModel baseVehicleModel = baseVehicleModelService.fetchBySid(appOrderModelInfoVo.getModelSid()); |
|
|
|
BaseModelConfig baseModelConfig = baseModelConfigService.fetchBySid(appOrderModelInfoVo.getConfigSid()); |
|
|
|
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"); |
|
|
|
//驾驶室
|
|
|
|
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 + "。"; |
|
|
|
//只有为公司采购时才显示
|
|
|
|
if ("01".equals(topInfo.getBuyTypeKey())) { |
|
|
|
map.put("topName", topName); |
|
|
|
} |
|
|
|
} |
|
|
|
//优惠说明
|
|
|
|
String discountDetail = ""; |
|
|
|
if (StringUtils.isNotBlank(appOrderDetailsVo.getTotaldiscount())) { |
|
|
|
List<AppOrderDiscountListVo> discountList = appOrderDetailsVo.getDiscountList(); |
|
|
|
discountDetail = "优惠说明:赠送价值" + appOrderDetailsVo.getTotaldiscount() + "元优惠包。包括"; |
|
|
|
for (int iii = 0; iii < discountList.size(); iii++) { |
|
|
|
AppOrderDiscountListVo vv = discountList.get(iii); |
|
|
|
String discountName = vv.getDiscountName(); |
|
|
|
if (iii == discountList.size() - 1) { |
|
|
|
discountDetail = discountDetail + "价值" + vv.getPrice() + "元" + discountName + vv.getNumber() + "份(每份包含" + vv.getDiscountExplain() + ")。"; |
|
|
|
} else { |
|
|
|
discountDetail = discountDetail + "价值" + vv.getPrice() + "元" + discountName + vv.getNumber() + "份(每份包含" + vv.getDiscountExplain() + "),"; |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("discountDetail", discountDetail); |
|
|
|
} |
|
|
|
//交纳订金
|
|
|
|
AppOrderDepositInfoVo depositInfo = appOrderDetailsVo.getDepositInfo(); |
|
|
|
String depositTotal = depositInfo.getDepositTotal(); |
|
|
|
if ("02".equals(depositInfo.getDepositTypeKey())) { |
|
|
|
ResultBean<List<BusDepositFictitiousDetailsVo>> listResultBean = busDepositFictitiousFeign.detailsList(depositInfo.getSid()); |
|
|
|
List<BusDepositFictitiousDetailsVo> listResultBeanData = listResultBean.getData(); |
|
|
|
listResultBeanData.removeAll(Collections.singleton(null)); |
|
|
|
if (!listResultBeanData.isEmpty()) { |
|
|
|
String depositRemarks = "(其中"; |
|
|
|
for (int ii = 0; ii < listResultBeanData.size(); ii++) { |
|
|
|
BusDepositFictitiousDetailsVo v = listResultBeanData.get(ii); |
|
|
|
if (StringUtils.isNotBlank(v.getPayPath())) { |
|
|
|
depositRemarks = depositRemarks + v.getDraweeName() + "在"; |
|
|
|
} else { |
|
|
|
depositRemarks = depositRemarks + "乙方在"; |
|
|
|
} |
|
|
|
if (ii == listResultBeanData.size() - 1) { |
|
|
|
String b = v.getPaymentDate() + "转入甲方的" + v.getDeposit() + "元中的" + v.getPrice() + "元用于本次订金。"; |
|
|
|
depositRemarks = depositRemarks + b; |
|
|
|
} else { |
|
|
|
String b = v.getPaymentDate() + "转入甲方的" + v.getDeposit() + "元中的" + v.getPrice() + "元用于本次订金,"; |
|
|
|
depositRemarks = depositRemarks + b; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
depositRemarks = depositRemarks + ")"; |
|
|
|
map.put("depositRemarks", depositRemarks); |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("createOrgName", dto.getCreateOrgName()); |
|
|
|
map.put("modelConfigs", modelAllName2.toString()); |
|
|
|
map.put("customerName", dto.getCustomerName()); |
|
|
|
map.put("mobile", crmCustomerTemp.getMobile()); |
|
|
|
map.put("idNo", crmCustomerTemp.getIDNumber()); |
|
|
|
map.put("modelName", modelName); |
|
|
|
map.put("modelConfig", modelConfig); |
|
|
|
if ("1".equals(appOrderDetailsVo.getIsInsurance())) { |
|
|
|
//保险说明
|
|
|
|
String insuranceInfo = "保险说明:" + appOrderDetailsVo.getInsuranceInfoMessage() + "。"; |
|
|
|
map.put("insuranceInfo", insuranceInfo); |
|
|
|
} |
|
|
|
//车辆交付地点
|
|
|
|
//根据存放地点查询
|
|
|
|
String address = ""; |
|
|
|
AppOrderPriceInfoVo priceInfo = appOrderDetailsVo.getPriceInfo(); |
|
|
|
if (StringUtils.isNotBlank(priceInfo.getPlannedPickUpLocationKey())) { |
|
|
|
ScmWarehouseVo scmWarehouseVo = scmWarehouseFeign.fetchBySid(priceInfo.getPlannedPickUpLocationKey()).getData(); |
|
|
|
if (scmWarehouseVo != null) { |
|
|
|
address = scmWarehouseVo.getWarehouseAttribute(); |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("address", address); |
|
|
|
//查询是否有公告型号
|
|
|
|
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 + "。"); |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("contractNo", dto.getContractNo()); |
|
|
|
String url = ""; |
|
|
|
PrintConfirmVo printConfirmVo = null; |
|
|
|
String urlAll = ""; |
|
|
|
try { |
|
|
|
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
|
|
|
.setNameFormat("demo-pool-%d").build(); |
|
|
|
ExecutorService pool = new ThreadPoolExecutor(1, 2, |
|
|
|
1000, 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); |
|
|
|
}); |
|
|
|
Future<String> future8 = null; |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
//合并pdf文件
|
|
|
|
if (future8 != null) { |
|
|
|
if (StringUtils.isNotBlank(future8.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future8.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
if (filesList.size() > 0) { |
|
|
|
String typeName = appOrderDetailsVo.getPayType() + dto.getContractNo() + ".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() + dto.getContractNo())); |
|
|
|
printConfirmVo.setDownloadUrl(docPdfComponent.getPrefixTemplateUrl() + urlAll); |
|
|
|
list.add(printConfirmVo); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
log.error("生成文件失败:==========================" + e.getMessage()); |
|
|
|
return rb.setMsg("生成文件失败"); |
|
|
|
} |
|
|
|
return rb.success().setData(list); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<PrintConfirmVo>> printConfirm(PrintConfirmDto dto) { |
|
|
|
ResultBean<List<PrintConfirmVo>> rb = ResultBean.fireFail(); |
|
|
|
List<PrintConfirmVo> list = new ArrayList<>(); |
|
|
@ -2983,4 +3351,6 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
|
|
|
|
return rb.success().setData(records); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |