|
|
@ -35,6 +35,8 @@ import com.yxt.anrui.buscenter.api.busdeliveredapply.BusDeliveredApply; |
|
|
|
import com.yxt.anrui.buscenter.api.busdeliveredapply.BusDeliveredApplyDetailQuery; |
|
|
|
import com.yxt.anrui.buscenter.api.busdeliveredapply.BusDeliveredApplyDetailVo; |
|
|
|
import com.yxt.anrui.buscenter.api.busdeliveredapply.BusDeliveredApplyFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.busdeliveredapplydetails.BusDeliveredApplyDetails; |
|
|
|
import com.yxt.anrui.buscenter.api.busdeliveredapplydetails.BusDeliveredApplyDetailsFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrder; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrderFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrderSourceLCVo; |
|
|
@ -68,6 +70,7 @@ import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutions.LoanSolutionsFeign; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutions.app.SolutionsDetailsVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutions.app.SolutionssVo; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.*; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
@ -128,6 +131,8 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
@Autowired |
|
|
|
private BusDeliveredApplyFeign busDeliveredApplyFeign; |
|
|
|
@Autowired |
|
|
|
private BusDeliveredApplyDetailsFeign busDeliveredApplyDetailsFeign; |
|
|
|
@Autowired |
|
|
|
private LoanSolutionsFeign loanSolutionsFeign; |
|
|
|
@Autowired |
|
|
|
private FinUncollectedReceivablesDetailedFeign finUncollectedReceivablesDetailedFeign; |
|
|
@ -2268,12 +2273,12 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
public ResultBean<BaseQuotationVo> selectQuotation(String sid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
BaseQuotationVo baseQuotationVo = new BaseQuotationVo(); |
|
|
|
//查询出库子表
|
|
|
|
BaseVehicleOut baseVehicleOut = fetchBySid(sid); |
|
|
|
//查询出库主表
|
|
|
|
BaseVehicleOutApply baseVehicleOutApply = baseVehicleOutApplyService.fetchBySid(baseVehicleOut.getMainSid()); |
|
|
|
//查询出库申请
|
|
|
|
BusDeliveredApply busDeliveredApply = busDeliveredApplyFeign.fetchBySid(sid).getData(); |
|
|
|
//查询出库申请车辆表
|
|
|
|
List<BusDeliveredApplyDetails> busDeliveredApplyDetails = busDeliveredApplyDetailsFeign.selectByApplySid(busDeliveredApply.getSid()).getData(); |
|
|
|
//根据合同号和车辆sid查询销售订单车辆信息
|
|
|
|
BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleFeign.selectByNoAndVinSid(baseVehicleOutApply.getContractNo(), baseVehicleOut.getVinSid()).getData(); |
|
|
|
BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleFeign.selectByNoAndVinSid(busDeliveredApply.getContractNo(), busDeliveredApplyDetails.get(0).getVinSid()).getData(); |
|
|
|
//查询销售订单信息
|
|
|
|
BusSalesOrder busSalesOrder = busSalesOrderFeign.selectOrderByContractNo(busSalesOrderVehicle.getSalesOrderSid()).getData(); |
|
|
|
//销售部门
|
|
|
@ -2287,7 +2292,7 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
//贷款人姓名
|
|
|
|
baseQuotationVo.setLoanBorrName(busSalesOrderLoancontractDetailsVo.getBorrowerName()); |
|
|
|
//车架号
|
|
|
|
baseQuotationVo.setVinNo(baseVehicleOut.getVinNo()); |
|
|
|
baseQuotationVo.setVinNo(busDeliveredApplyDetails.get(0).getVinNo()); |
|
|
|
//查询贷款人信息
|
|
|
|
BusSalesOrderBorrowerDetailsVo busSalesOrderBorrowerDetailsVo = busSalesOrderBorrowerFeign.fetchDetailsBySid(busSalesOrderLoancontractDetailsVo.getBorrowerSid()).getData(); |
|
|
|
//电话
|
|
|
@ -2303,7 +2308,7 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
//车型
|
|
|
|
baseQuotationVo.setModelName(busSalesOrderModel.getModelName()); |
|
|
|
//查询挂车信息
|
|
|
|
List<BaseTrailerVo> baseTrailerVos = baseTrailerService.fetchAllByVehSid(baseVehicleOut.getVinSid()); |
|
|
|
List<BaseTrailerVo> baseTrailerVos = baseTrailerService.fetchAllByVehSid(busDeliveredApplyDetails.get(0).getVinSid()); |
|
|
|
if (baseTrailerVos.size() == 1) { |
|
|
|
BaseTrailerVo baseTrailerVo = baseTrailerVos.get(0); |
|
|
|
//挂车车型
|
|
|
@ -2320,7 +2325,7 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
//采购单位 TODO
|
|
|
|
} |
|
|
|
//查询上装信息
|
|
|
|
BaseVehinstallDetailsVo baseVehinstallDetailsVo = baseVehinstallService.fetchByVinNoAndOrgSid(baseVehicleOut.getVinNo(), baseVehicleOutApply.getCreateOrgSid()); |
|
|
|
BaseVehinstallDetailsVo baseVehinstallDetailsVo = baseVehinstallService.fetchByVinNoAndOrgSid(busDeliveredApplyDetails.get(0).getVinNo(), busDeliveredApply.getUseOrgSid()); |
|
|
|
if (baseVehinstallDetailsVo != null) { |
|
|
|
BusSalesOrderMakeup busSalesOrderMakeup = busSalesOrderMakeupFeign.selectTop(baseVehinstallDetailsVo.getSid(), busSalesOrder.getSid()).getData(); |
|
|
|
if (busSalesOrderMakeup != null) { |
|
|
@ -2330,6 +2335,132 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
baseQuotationVo.setSzOnePurUnit(busSalesOrderMakeup.getRefitFactory()); |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
//备注
|
|
|
|
baseQuotationVo.setRemarks(busSalesOrder.getRemarks()); |
|
|
|
//查询金融方案
|
|
|
|
SolutionssVo solutionssVo = loanSolutionsFeign.selectDetails2(busSalesOrder.getSid()).getData(); |
|
|
|
//金融方案复制
|
|
|
|
BaseJRFAVo baseJRFAVo = new BaseJRFAVo(); |
|
|
|
BeanUtil.copyProperties(solutionssVo, baseJRFAVo); |
|
|
|
//融资项目
|
|
|
|
String financProject = ""; |
|
|
|
if (StringUtils.isNotBlank(solutionssVo.getMainVehicleAmount())) { |
|
|
|
financProject = financProject + "主车发票价" + solutionssVo.getMainVehicleAmount() + "元" + " "; |
|
|
|
} |
|
|
|
if (solutionssVo.isAccessoriesAmountCb()) { |
|
|
|
financProject = financProject + "配件" + solutionssVo.getAccessoriesAmount() + "元" + " "; |
|
|
|
} |
|
|
|
if (solutionssVo.isTrailerAmountCb()) { |
|
|
|
financProject = financProject + "挂车" + solutionssVo.getTrailerAmount() + "元" + " "; |
|
|
|
} |
|
|
|
if (solutionssVo.isPremiumCb()) { |
|
|
|
financProject = financProject + "保险" + solutionssVo.getPremium() + "元" + " "; |
|
|
|
} |
|
|
|
if (solutionssVo.isPurchaseTaxCb()) { |
|
|
|
financProject = financProject + "购置税" + solutionssVo.getPurchaseTax() + "元" + " "; |
|
|
|
} |
|
|
|
baseJRFAVo.setFinancProject(financProject); |
|
|
|
baseQuotationVo.setBaseJRFAVo(baseJRFAVo); |
|
|
|
return rb.success().setData(baseQuotationVo); |
|
|
|
} |
|
|
|
|
|
|
|
public PdfPath createjrbjdPdf(String sid) { |
|
|
|
BaseQuotationVo baseQuotationVo = selectQuotation(sid).getData(); |
|
|
|
BaseJRFAVo baseJRFAVo = baseQuotationVo.getBaseJRFAVo(); |
|
|
|
PdfPath pdfPath = new PdfPath(); |
|
|
|
Map<String, Object> dataMap = new HashMap<String, Object>(); |
|
|
|
dataMap.put("saleDeptName", baseQuotationVo.getSaleDeptName()); |
|
|
|
dataMap.put("staffName", baseQuotationVo.getStaffName()); |
|
|
|
dataMap.put("loanContractNo", baseQuotationVo.getLoanContractNo()); |
|
|
|
//客户信息
|
|
|
|
dataMap.put("loanBorrName", baseQuotationVo.getLoanBorrName()); |
|
|
|
dataMap.put("vinNo", baseQuotationVo.getVinNo()); |
|
|
|
dataMap.put("mobile", baseQuotationVo.getMobile()); |
|
|
|
dataMap.put("address", baseQuotationVo.getAddress()); |
|
|
|
dataMap.put("affiliatedCompany", baseQuotationVo.getAffiliatedCompany()); |
|
|
|
//车型及价格
|
|
|
|
dataMap.put("modelName", baseQuotationVo.getModelName()); |
|
|
|
dataMap.put("gcOneModel", baseQuotationVo.getGcOneModel()); |
|
|
|
dataMap.put("gcOnePurUnit", baseQuotationVo.getGcOnePurUnit()); |
|
|
|
dataMap.put("gcTwoModel", baseQuotationVo.getGcTwoModel()); |
|
|
|
dataMap.put("gcTwoPurUnit", baseQuotationVo.getGcTwoPurUnit()); |
|
|
|
dataMap.put("szOneName", baseQuotationVo.getSzOneName()); |
|
|
|
dataMap.put("szOnePurUnit", baseQuotationVo.getSzOnePurUnit()); |
|
|
|
dataMap.put("szTwoName", baseQuotationVo.getSzTwoName()); |
|
|
|
dataMap.put("szTwoPurUnit", baseQuotationVo.getSzTwoPurUnit()); |
|
|
|
dataMap.put("remarks", baseQuotationVo.getRemarks()); |
|
|
|
//金融方案
|
|
|
|
dataMap.put("isPack", baseJRFAVo.getIsPack()); |
|
|
|
dataMap.put("policyName", baseJRFAVo.getPolicyName()); |
|
|
|
dataMap.put("financProject", baseJRFAVo.getFinancProject()); |
|
|
|
dataMap.put("loanTotal", baseJRFAVo.getLoanTotal()); |
|
|
|
dataMap.put("sfbl", baseJRFAVo.getDownPayRatio()); |
|
|
|
dataMap.put("sfje", baseJRFAVo.getDownPayAmount()); |
|
|
|
dataMap.put("cpdkje", baseJRFAVo.getLoanAmount()); |
|
|
|
dataMap.put("cpqs", baseJRFAVo.getLoanPeriod()); |
|
|
|
dataMap.put("dkbzjbl", baseJRFAVo.getBondRatio()); |
|
|
|
dataMap.put("dkbzj", baseJRFAVo.getBondAmount()); |
|
|
|
dataMap.put("cjtx", baseJRFAVo.getFactoryDiscount()); |
|
|
|
dataMap.put("txyt", baseJRFAVo.getFactoryDiscountUse()); |
|
|
|
dataMap.put("nll", baseJRFAVo.getPolicyYearRatio()); |
|
|
|
dataMap.put("yhje", baseJRFAVo.getLoanPayMoney()); |
|
|
|
dataMap.put("lxze", baseJRFAVo.getLoanInterest()); |
|
|
|
dataMap.put("txdck", baseJRFAVo.getDiscountCar()); |
|
|
|
//其他融
|
|
|
|
dataMap.put("otherPolicyState", baseJRFAVo.isOtherPolicyState()); |
|
|
|
dataMap.put("otherPolicyName", baseJRFAVo.getOtherPolicyName()); |
|
|
|
dataMap.put("qtrdkje", baseJRFAVo.getOtherPolicyAmount()); |
|
|
|
dataMap.put("qtrqs", baseJRFAVo.getOtherPolicyPeriod()); |
|
|
|
dataMap.put("qtrnll", baseJRFAVo.getOtherPolicyYearRatio()); |
|
|
|
dataMap.put("qtryhje", baseJRFAVo.getOtherPolicyMonthlyRepay()); |
|
|
|
dataMap.put("otherPolicyInterest", baseJRFAVo.getOtherPolicyInterest()); |
|
|
|
//方案汇总
|
|
|
|
dataMap.put("loanDownPay", baseJRFAVo.getLoanDownPay()); |
|
|
|
dataMap.put("downPayAmountsRatio", baseJRFAVo.getDownPayAmountsRatio()); |
|
|
|
dataMap.put("loanAmountTotal", baseJRFAVo.getLoanAmountTotal()); |
|
|
|
dataMap.put("period", baseJRFAVo.getPeriod()); |
|
|
|
dataMap.put("monthlyRepay", baseJRFAVo.getMonthlyRepay()); |
|
|
|
dataMap.put("interest", baseJRFAVo.getInterest()); |
|
|
|
dataMap.put("returnTime", baseJRFAVo.getReturnTime()); |
|
|
|
//应收明细
|
|
|
|
dataMap.put("downPayAmounts", baseJRFAVo.getDownPayAmounts()); |
|
|
|
dataMap.put("bondAmounts", baseJRFAVo.getBondAmounts()); |
|
|
|
dataMap.put("depositPremium", baseJRFAVo.getDepositPremium()); |
|
|
|
dataMap.put("depositSettle", baseJRFAVo.getDepositSettle()); |
|
|
|
dataMap.put("serviceAmount", baseJRFAVo.getServiceAmount()); |
|
|
|
dataMap.put("proxyAccidentPremium", baseJRFAVo.getProxyAccidentPremium()); |
|
|
|
dataMap.put("registerAmount", baseJRFAVo.getRegisterAmount()); |
|
|
|
dataMap.put("operationAmount", baseJRFAVo.getOperationAmount()); |
|
|
|
dataMap.put("vehOtherPrice", baseJRFAVo.getVehOtherPrice()); |
|
|
|
dataMap.put("otherAmount", baseJRFAVo.getOtherAmount()); |
|
|
|
dataMap.put("otherAmountRemark", baseJRFAVo.getOtherAmountRemark()); |
|
|
|
dataMap.put("dealWay", baseJRFAVo.getDealWay()); |
|
|
|
dataMap.put("proxyTotal", baseJRFAVo.getProxyTotal()); |
|
|
|
dataMap.put("proxyPremium", baseJRFAVo.getProxyPremium()); |
|
|
|
dataMap.put("proxyPurchasetax", baseJRFAVo.getProxyPurchasetax()); |
|
|
|
dataMap.put("receivableTotal", baseJRFAVo.getReceivableTotal()); |
|
|
|
dataMap.put("offsetTotal", baseJRFAVo.getOffsetTotal()); |
|
|
|
dataMap.put("offsetPremium", baseJRFAVo.getOffsetPremium()); |
|
|
|
dataMap.put("offsetPurchasetax", baseJRFAVo.getOffsetPurchasetax()); |
|
|
|
dataMap.put("realTotal", baseJRFAVo.getRealTotal()); |
|
|
|
dataMap.put("vehTotalPrice", baseJRFAVo.getVehTotalPrice()); |
|
|
|
dataMap.put("nominalPrice", baseJRFAVo.getNominalPrice()); |
|
|
|
//获取模板
|
|
|
|
//模板路径
|
|
|
|
String sourcePath = "D:\\anrui\\upload\\template\\"; |
|
|
|
//生成word文件名
|
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
|
long seconds = System.currentTimeMillis(); |
|
|
|
String typeName = dateStr + seconds + ".doc"; |
|
|
|
//生成文件路径
|
|
|
|
String targetPath = sourcePath + dateStr; |
|
|
|
WordUtils.creatWord(dataMap, "jrbjd", sourcePath, targetPath, typeName); |
|
|
|
//新生成的word路径
|
|
|
|
String wordPath = targetPath + "\\" + typeName; |
|
|
|
//生成出门证文件名
|
|
|
|
String pdfName = "金融报价单_" + dateStr + seconds + ".pdf"; |
|
|
|
WordUtils.doc2pdf(wordPath, targetPath, pdfName, ""); |
|
|
|
pdfPath.setPdfPath("/template/" + dateStr + "/" + pdfName); |
|
|
|
return pdfPath; |
|
|
|
} |
|
|
|
} |
|
|
|