|
|
@ -31,6 +31,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.base.api.basemodelconfig.BaseModelConfigFeign; |
|
|
|
import com.yxt.anrui.base.api.basemodelconfig.BaseModelConfigSelectVo; |
|
|
|
import com.yxt.anrui.base.api.basetrailer.BaseTrailer; |
|
|
|
import com.yxt.anrui.base.api.basetrailer.BaseTrailerFeign; |
|
|
|
import com.yxt.anrui.base.api.basetrailermodel.BaseTrailerModel; |
|
|
|
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.basevehiclestate.BaseVehicleStateDto; |
|
|
@ -49,11 +54,14 @@ import com.yxt.anrui.buscenter.api.bussalesorderloancontract.BusSalesOrderLoanco |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderloancontract.BusSalesOrderLoancontractFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordermodel.BusSalesOrderModel; |
|
|
|
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.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.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.finvehicleinvoice.FinVehicleInvoice; |
|
|
@ -96,6 +104,8 @@ import java.io.InputStream; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
import static cn.hutool.json.XMLTokener.entity; |
|
|
|
|
|
|
|
/** |
|
|
|
* Project: anrui-riskcenter(家访准备) <br/> |
|
|
|
* File: LoanHomevisitPrepService.java <br/> |
|
|
@ -117,6 +127,10 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
@Autowired |
|
|
|
private BaseVehicleStateFeign baseVehicleStateFeign; |
|
|
|
@Autowired |
|
|
|
private BaseTrailerFeign baseTrailerFeign; |
|
|
|
@Autowired |
|
|
|
private BaseTrailerModelFeign baseTrailerModelFeign; |
|
|
|
@Autowired |
|
|
|
private BaseVehicleFeign baseVehicleFeign; |
|
|
|
@Autowired |
|
|
|
private BaseModelConfigFeign baseModelConfigFeign; |
|
|
@ -141,6 +155,8 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
@Autowired |
|
|
|
private FinVehicleInvoiceFeign finVehicleInvoiceFeign; |
|
|
|
@Autowired |
|
|
|
private FinBillApplicationFeign finBillApplicationFeign; |
|
|
|
@Autowired |
|
|
|
private LoanSolutionsService loanSolutionsService; |
|
|
|
@Autowired |
|
|
|
private LoanFinPolicyService loanFinPolicyService; |
|
|
@ -434,18 +450,32 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
List<String> hkxyUrls = hkxy(printConfirmDto, conSetUpKey); |
|
|
|
//代管车辆委托书
|
|
|
|
List<String> dgclwtsUrls = dgclwts(printConfirmDto, conSetUpKey); |
|
|
|
//开票申请书
|
|
|
|
List<String> kpsqsUrls = kpsqs(printConfirmDto, conSetUpKey); |
|
|
|
//生成车辆登记合同
|
|
|
|
List<String> cldjhtUrls = cldjContract(printConfirmDto, conSetUpKey); |
|
|
|
//判断是否为高低开
|
|
|
|
BusSalesOrderPrice data = busSalesOrderFeign.selectByContractNoOne(printConfirmDto.getContractNo()).getData(); |
|
|
|
FinBillApplicationDetailsVo finBillApplicationDetailsVo = finBillApplicationFeign.selectByCon(printConfirmDto.getContractNo()).getData(); |
|
|
|
//判断是否为高低开,若是则生成开票申请书
|
|
|
|
List<String> kpsqsUrls = new ArrayList<>(); |
|
|
|
if (!data.getSingleFinalPrice().equals(finBillApplicationDetailsVo.getOneBillMoney())){ |
|
|
|
//开票申请书
|
|
|
|
kpsqsUrls = kpsqs(printConfirmDto, conSetUpKey); |
|
|
|
} |
|
|
|
HomeKcCust homeKcCust = printConfirmDto.getHomeKcCust(); |
|
|
|
List<String> cldjhtUrls = new ArrayList<>(); |
|
|
|
if ("2".equals(homeKcCust.getVehRegis())){ |
|
|
|
//生成车辆登记合同
|
|
|
|
cldjhtUrls = cldjContract(printConfirmDto, conSetUpKey); |
|
|
|
} |
|
|
|
//接收车辆确认书
|
|
|
|
List<String> jsclqrsUrls = jsclqrs(printConfirmDto, conSetUpKey); |
|
|
|
//接收车辆委托书
|
|
|
|
List<String> jsclwtsUrls = jsclwts(printConfirmDto, conSetUpKey); |
|
|
|
//生成车辆及上装采购合同
|
|
|
|
List<String> cljszcghtUrls = cljszcght(printConfirmDto, conSetUpKey); |
|
|
|
//生成公司股东会对外担保决议
|
|
|
|
List<String> gsgddwdbjyUrls = gsgddwdbjy(printConfirmDto, conSetUpKey); |
|
|
|
List<String> gsgddwdbjyUrls = new ArrayList<>(); |
|
|
|
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); |
|
|
@ -532,9 +562,30 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
private List<String> jsclwts(PrintConfirmDto printConfirmDto, String conSetUpKey) { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
List<SalesOrderVehicle> salesOrderVehicles = printConfirmDto.getSalesOrderVehicles(); |
|
|
|
//委托人
|
|
|
|
map.put("wtr", salesOrderVehicles.get(0).getBorrowName()); |
|
|
|
//获取贷款人信息
|
|
|
|
BusSalesOrderBorrowerDetailsVo busSalesOrderBorrowerDetailsVo = busSalesOrderBorrowerFeign.fetchDetailsBySid(salesOrderVehicles.get(0).getBorrowerSid()).getData(); |
|
|
|
//获取贷款人客户信息
|
|
|
|
CrmCustomerTemp crmCustomerTemp = crmCustomerTempFeign.fetchEntity(busSalesOrderBorrowerDetailsVo.getCustomSid()).getData(); |
|
|
|
//证件号码
|
|
|
|
map.put("idNo1", crmCustomerTemp.getIDNumber()); |
|
|
|
//受托人
|
|
|
|
map.put("swtr", ""); |
|
|
|
//身份证号
|
|
|
|
map.put("idNo2", ""); |
|
|
|
BusSalesOrder busSalesOrder = busSalesOrderFeign.selectOrderByContractNo(printConfirmDto.getContractNo()).getData(); |
|
|
|
//获取采购系统、分公司对应的开票信息
|
|
|
|
FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(busSalesOrder.getUseOrgSid(), busSalesOrder.getPurchaseSystemSid()).getData(); |
|
|
|
//分公司(甲方)
|
|
|
|
map.put("jf", finCompanyInvoicingDetailsVo.getName()); |
|
|
|
List<String> urls = new ArrayList<>(); |
|
|
|
if ("001".equals(conSetUpKey)) { |
|
|
|
for (SalesOrderVehicle salesOrderVehicle : salesOrderVehicles) { |
|
|
|
//获取消贷合同信息
|
|
|
|
BusSalesOrderLoancontractDetailsVo busSalesOrderLoancontractDetailsVo = busSalesOrderLoancontractFeign.fetchDetailsBySid(salesOrderVehicle.getLoanContractSid()).getData(); |
|
|
|
//消贷合同编号
|
|
|
|
map.put("con", busSalesOrderLoancontractDetailsVo.getLoanContractNo()); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + "jsclwts" + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
@ -553,6 +604,10 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
urls.add(pdfName); |
|
|
|
} |
|
|
|
} else if ("002".equals(conSetUpKey)) { |
|
|
|
//获取消贷合同信息
|
|
|
|
BusSalesOrderLoancontractDetailsVo busSalesOrderLoancontractDetailsVo = busSalesOrderLoancontractFeign.fetchDetailsBySid(salesOrderVehicles.get(0).getLoanContractSid()).getData(); |
|
|
|
//消贷合同编号
|
|
|
|
map.put("con", busSalesOrderLoancontractDetailsVo.getLoanContractNo()); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + "jsclwts" + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
@ -790,28 +845,6 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(busSalesOrder.getUseOrgSid(), busSalesOrder.getPurchaseSystemSid()).getData(); |
|
|
|
//分公司(甲方)
|
|
|
|
map.put("jf", finCompanyInvoicingDetailsVo.getName()); |
|
|
|
//获取销售订单车型信息
|
|
|
|
BusSalesOrderModel busSalesOrderModel = busSalesOrderModelFeign.fetchByOrderSid(busSalesOrder.getSid()).getData(); |
|
|
|
//车型
|
|
|
|
map.put("modelName", busSalesOrderModel.getModelName()); |
|
|
|
//单价
|
|
|
|
String singleFinalPrice = busSalesOrderPriceFeign.getPriceByOrderSid(busSalesOrder.getSid()).getData(); |
|
|
|
//合同单价1
|
|
|
|
map.put("dj1", singleFinalPrice); |
|
|
|
//获取开票管理信息
|
|
|
|
FinVehicleInvoice finVehicleInvoice = finVehicleInvoiceFeign.selectByVinAndContractNo(salesOrderVehicles.get(0).getLinkSid(), printConfirmDto.getContractNo()).getData(); |
|
|
|
//开票金额1
|
|
|
|
map.put("kpje1", finVehicleInvoice.getInvoiceAmount()); |
|
|
|
//发票类型1
|
|
|
|
map.put("fplx1", "机动车统一销售发票"); |
|
|
|
//挂车
|
|
|
|
map.put("gcName", DateUtil.formatDate(new Date())); |
|
|
|
//合同单价2
|
|
|
|
map.put("dj2", DateUtil.formatDate(new Date())); |
|
|
|
//开票金额2
|
|
|
|
map.put("kpje2", DateUtil.formatDate(new Date())); |
|
|
|
//发票类型2
|
|
|
|
map.put("fplx2", "机动车统一销售发票"); |
|
|
|
//车辆落户单位
|
|
|
|
map.put("lhdw", DateUtil.formatDate(new Date())); |
|
|
|
//申请人
|
|
|
@ -823,10 +856,38 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
//日
|
|
|
|
map.put("d", new Date().getDate()); |
|
|
|
List<String> urls = new ArrayList<>(); |
|
|
|
Integer i = 1; |
|
|
|
if ("001".equals(conSetUpKey)) { |
|
|
|
for (SalesOrderVehicle salesOrderVehicle : salesOrderVehicles) { |
|
|
|
//数量1
|
|
|
|
map.put("num1", "1"); |
|
|
|
List<DownInvoAppForm> downInvoAppForms = new ArrayList<>(); |
|
|
|
DownInvoAppForm downInvoAppForm = new DownInvoAppForm(); |
|
|
|
downInvoAppForm.setId(i.toString()); |
|
|
|
i = i + 1; |
|
|
|
BusSalesOrderModel busSalesOrderModel = busSalesOrderModelFeign.fetchByOrderSid(salesOrderVehicle.getSalesOrderSid()).getData(); |
|
|
|
downInvoAppForm.setModelName(busSalesOrderModel.getModelName()); |
|
|
|
downInvoAppForm.setNum("1"); |
|
|
|
String dj = busSalesOrderPriceFeign.getPriceByOrderSid(salesOrderVehicle.getSalesOrderSid()).getData(); |
|
|
|
downInvoAppForm.setDj(dj); |
|
|
|
FinVehicleInvoice finVehicleInvoice = finVehicleInvoiceFeign.selectByVinAndContractNo(salesOrderVehicle.getLinkSid(), printConfirmDto.getContractNo()).getData(); |
|
|
|
downInvoAppForm.setKpje(finVehicleInvoice.getInvoiceAmount().toString()); |
|
|
|
downInvoAppForm.setFplx("机动车统一销售发票"); |
|
|
|
downInvoAppForms.add(downInvoAppForm); |
|
|
|
List<BaseTrailer> baseTrailers = baseTrailerFeign.getByVehSid(salesOrderVehicle.getLinkSid()).getData(); |
|
|
|
if (baseTrailers != null && baseTrailers.size() > 0){ |
|
|
|
for (BaseTrailer baseTrailer : baseTrailers) { |
|
|
|
DownInvoAppForm downInvoAppForm1 = new DownInvoAppForm(); |
|
|
|
downInvoAppForm1.setId(i.toString()); |
|
|
|
i = i + 1; |
|
|
|
BaseTrailerModelDetailsVo baseTrailerModelDetailsVo = baseTrailerModelFeign.fetchDetailsBySid(baseTrailer.getTrailerModelSid()).getData(); |
|
|
|
downInvoAppForm1.setModelName("外廓-长" + baseTrailerModelDetailsVo.getAppearanceSizeLong() + "(米)" + baseTrailerModelDetailsVo.getTrailerTypeValue()); |
|
|
|
downInvoAppForm1.setNum("1"); |
|
|
|
downInvoAppForm1.setDj(baseTrailer.getDealPrice().toString()); |
|
|
|
downInvoAppForm1.setKpje(baseTrailer.getOneBillMoney().toString()); |
|
|
|
downInvoAppForm1.setFplx("机动车统一销售发票"); |
|
|
|
downInvoAppForms.add(downInvoAppForm1); |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("list",downInvoAppForms); |
|
|
|
//获取消贷合同信息
|
|
|
|
BusSalesOrderLoancontractDetailsVo busSalesOrderLoancontractDetailsVo = busSalesOrderLoancontractFeign.fetchDetailsBySid(salesOrderVehicle.getLoanContractSid()).getData(); |
|
|
|
//消贷合同编号
|
|
|
@ -849,8 +910,37 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
urls.add(pdfName); |
|
|
|
} |
|
|
|
} else if ("002".equals(conSetUpKey)) { |
|
|
|
//数量1
|
|
|
|
map.put("num2", salesOrderVehicles.size()); |
|
|
|
List<DownInvoAppForm> downInvoAppForms = new ArrayList<>(); |
|
|
|
DownInvoAppForm downInvoAppForm = new DownInvoAppForm(); |
|
|
|
downInvoAppForm.setId(i.toString()); |
|
|
|
i = i + 1; |
|
|
|
BusSalesOrderModel busSalesOrderModel = busSalesOrderModelFeign.fetchByOrderSid(salesOrderVehicles.get(0).getSalesOrderSid()).getData(); |
|
|
|
downInvoAppForm.setModelName(busSalesOrderModel.getModelName()); |
|
|
|
downInvoAppForm.setNum(String.valueOf(salesOrderVehicles.size())); |
|
|
|
String dj = busSalesOrderPriceFeign.getPriceByOrderSid(salesOrderVehicles.get(0).getSalesOrderSid()).getData(); |
|
|
|
downInvoAppForm.setDj(dj); |
|
|
|
FinVehicleInvoice finVehicleInvoice = finVehicleInvoiceFeign.selectByVinAndContractNo(salesOrderVehicles.get(0).getLinkSid(), printConfirmDto.getContractNo()).getData(); |
|
|
|
downInvoAppForm.setKpje(finVehicleInvoice.getInvoiceAmount().toString()); |
|
|
|
downInvoAppForm.setFplx("机动车统一销售发票"); |
|
|
|
downInvoAppForms.add(downInvoAppForm); |
|
|
|
for (SalesOrderVehicle salesOrderVehicle : salesOrderVehicles) { |
|
|
|
List<BaseTrailer> baseTrailers = baseTrailerFeign.getByVehSid(salesOrderVehicle.getLinkSid()).getData(); |
|
|
|
if (baseTrailers != null && baseTrailers.size() > 0){ |
|
|
|
for (BaseTrailer baseTrailer : baseTrailers) { |
|
|
|
DownInvoAppForm downInvoAppForm1 = new DownInvoAppForm(); |
|
|
|
downInvoAppForm1.setId(i.toString()); |
|
|
|
i = i + 1; |
|
|
|
BaseTrailerModelDetailsVo baseTrailerModelDetailsVo = baseTrailerModelFeign.fetchDetailsBySid(baseTrailer.getTrailerModelSid()).getData(); |
|
|
|
downInvoAppForm1.setModelName("外廓-长" + baseTrailerModelDetailsVo.getAppearanceSizeLong() + "(米)" + baseTrailerModelDetailsVo.getTrailerTypeValue()); |
|
|
|
downInvoAppForm1.setNum("1"); |
|
|
|
downInvoAppForm1.setDj(baseTrailer.getDealPrice().toString()); |
|
|
|
downInvoAppForm1.setKpje(baseTrailer.getOneBillMoney().toString()); |
|
|
|
downInvoAppForm1.setFplx("机动车统一销售发票"); |
|
|
|
downInvoAppForms.add(downInvoAppForm1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("list",downInvoAppForms); |
|
|
|
//获取消贷合同信息
|
|
|
|
BusSalesOrderLoancontractDetailsVo busSalesOrderLoancontractDetailsVo = busSalesOrderLoancontractFeign.fetchDetailsBySid(salesOrderVehicles.get(0).getLoanContractSid()).getData(); |
|
|
|
//消贷合同编号
|
|
|
@ -1376,28 +1466,37 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
public List<String> cljszcght(PrintConfirmDto printConfirmDto, String conSetUpKey) { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
List<SalesOrderVehicle> salesOrderVehicles = printConfirmDto.getSalesOrderVehicles(); |
|
|
|
//获取销售订单信息
|
|
|
|
BusSalesOrder busSalesOrder = busSalesOrderFeign.selectOrderByContractNo(printConfirmDto.getContractNo()).getData(); |
|
|
|
//获取采购系统、分公司对应的开票信息
|
|
|
|
FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(busSalesOrder.getUseOrgSid(), busSalesOrder.getPurchaseSystemSid()).getData(); |
|
|
|
//甲方
|
|
|
|
map.put("partyA", printConfirmDto.getCreateOrgName()); |
|
|
|
map.put("jf", finCompanyInvoicingDetailsVo.getName()); |
|
|
|
//乙方
|
|
|
|
map.put("partyB", printConfirmDto.getCustomerName()); |
|
|
|
map.put("yf", salesOrderVehicles.get(0).getBorrowName()); |
|
|
|
//获取贷款人信息
|
|
|
|
BusSalesOrderBorrowerDetailsVo busSalesOrderBorrowerDetailsVo = busSalesOrderBorrowerFeign.fetchDetailsBySid(salesOrderVehicles.get(0).getBorrowerSid()).getData(); |
|
|
|
//获取贷款人客户信息
|
|
|
|
CrmCustomerTemp crmCustomerTemp = crmCustomerTempFeign.fetchEntity(busSalesOrderBorrowerDetailsVo.getCustomSid()).getData(); |
|
|
|
//乙方身份证号
|
|
|
|
CrmCustomerTemp crmCustomerTemp = crmCustomerTempFeign.fetchEntity(printConfirmDto.getCustomerSid()).getData(); |
|
|
|
map.put("idNo", crmCustomerTemp.getIDNumber()); |
|
|
|
//签订时间
|
|
|
|
map.put("date", ""); |
|
|
|
map.put("qdDate", DateUtil.formatDate(new Date())); |
|
|
|
//签订地点
|
|
|
|
List<FinVehicleInvoice> finVehicleInvoices = finVehicleInvoiceFeign.selectByContractNo(printConfirmDto.getContractNo()).getData(); |
|
|
|
if (finVehicleInvoices.size() > 0) { |
|
|
|
map.put("address", finVehicleInvoices.get(0).getAddress()); |
|
|
|
} else { |
|
|
|
map.put("address", ""); |
|
|
|
map.put("qddd", finCompanyInvoicingDetailsVo.getAddress()); |
|
|
|
//合同补充信息
|
|
|
|
HomeKcCust homeKcCust = printConfirmDto.getHomeKcCust(); |
|
|
|
if ("0".equals(homeKcCust.getIsCompBuy())){ |
|
|
|
//第一种
|
|
|
|
map.put("dyz", "☑"); |
|
|
|
//第二种
|
|
|
|
map.put("dez", "□"); |
|
|
|
}else if ("1".equals(homeKcCust.getIsCompBuy())){ |
|
|
|
//第一种
|
|
|
|
map.put("dyz", "□"); |
|
|
|
//第二种
|
|
|
|
map.put("dez", "☑"); |
|
|
|
} |
|
|
|
//第一种
|
|
|
|
map.put("dyz", "☑"); |
|
|
|
//合同编号
|
|
|
|
map.put("contractNo", printConfirmDto.getContractNo()); |
|
|
|
//第二种
|
|
|
|
map.put("dez", "□"); |
|
|
|
//查询销售订单的信息
|
|
|
|
ResultBean<AppOrderDetailsVo> resultBean = busSalesOrderFeign.getSaleOrderDetails(printConfirmDto.getBusSid()); |
|
|
|
AppOrderDetailsVo appOrderDetailsVo = resultBean.getData(); |
|
|
@ -1410,23 +1509,37 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
} |
|
|
|
List<String> urls = new ArrayList<>(); |
|
|
|
if ("001".equals(conSetUpKey)) { |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + "cljszcght" + ".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 + "cljszcght" + 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 = "车辆及上装采购合同" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
urls.add(pdfName); |
|
|
|
for (SalesOrderVehicle salesOrderVehicle : salesOrderVehicles) { |
|
|
|
//获取消贷合同信息
|
|
|
|
BusSalesOrderLoancontractDetailsVo busSalesOrderLoancontractDetailsVo = busSalesOrderLoancontractFeign.fetchDetailsBySid(salesOrderVehicle.getLoanContractSid()).getData(); |
|
|
|
//消贷合同编号
|
|
|
|
map.put("con", busSalesOrderLoancontractDetailsVo.getLoanContractNo()); |
|
|
|
//消贷合同编号
|
|
|
|
map.put("con1", busSalesOrderLoancontractDetailsVo.getLoanContractNo()); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + "cljszcght" + ".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 + "cljszcght" + 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 = "C" + map.get("con").toString() + "车辆及上装采购合同" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
urls.add(pdfName); |
|
|
|
} |
|
|
|
} else if ("002".equals(conSetUpKey)) { |
|
|
|
//获取消贷合同信息
|
|
|
|
BusSalesOrderLoancontractDetailsVo busSalesOrderLoancontractDetailsVo = busSalesOrderLoancontractFeign.fetchDetailsBySid(salesOrderVehicles.get(0).getLoanContractSid()).getData(); |
|
|
|
//消贷合同编号
|
|
|
|
map.put("con", busSalesOrderLoancontractDetailsVo.getLoanContractNo()); |
|
|
|
//消贷合同编号
|
|
|
|
map.put("con1", busSalesOrderLoancontractDetailsVo.getLoanContractNo()); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + "cljszcght" + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
@ -1440,7 +1553,7 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
//新生成的word路径
|
|
|
|
String wordPath = targetPath + typeName; |
|
|
|
//生成文件名
|
|
|
|
String pdfName = "车辆及上装采购合同" + dateStr + seconds + ".pdf"; |
|
|
|
String pdfName = "C" + map.get("con").toString() + "车辆及上装采购合同" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
urls.add(pdfName); |
|
|
|
} |
|
|
@ -1450,33 +1563,66 @@ public class LoanHomevisitPrepService extends MybatisBaseService<LoanHomevisitPr |
|
|
|
public List<String> gsgddwdbjy(PrintConfirmDto printConfirmDto, String conSetUpKey) { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
List<SalesOrderVehicle> salesOrderVehicles = printConfirmDto.getSalesOrderVehicles(); |
|
|
|
|
|
|
|
//时间
|
|
|
|
map.put("qdDate",DateUtil.formatDate(new Date())); |
|
|
|
//合同补充信息
|
|
|
|
HomeKcCust homeKcCust = printConfirmDto.getHomeKcCust(); |
|
|
|
//地点
|
|
|
|
map.put("qddd",homeKcCust.getAccCompName()); |
|
|
|
//获取销售订单信息
|
|
|
|
BusSalesOrder busSalesOrder = busSalesOrderFeign.selectOrderByContractNo(printConfirmDto.getContractNo()).getData(); |
|
|
|
//获取采购系统、分公司对应的开票信息
|
|
|
|
FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(busSalesOrder.getUseOrgSid(), busSalesOrder.getPurchaseSystemSid()).getData(); |
|
|
|
//甲方
|
|
|
|
map.put("jf", finCompanyInvoicingDetailsVo.getName()); |
|
|
|
//乙方
|
|
|
|
map.put("yf", salesOrderVehicles.get(0).getBorrowName()); |
|
|
|
//股东人数1
|
|
|
|
map.put("gdrs1",homeKcCust.getShareNum()); |
|
|
|
//股东人数2
|
|
|
|
map.put("gdrs2",homeKcCust.getShareNum()); |
|
|
|
//年
|
|
|
|
map.put("y", DateUtil.year(new Date())); |
|
|
|
//月
|
|
|
|
map.put("m", DateUtil.month(new Date()) + 1); |
|
|
|
//日
|
|
|
|
map.put("d", new Date().getDate()); |
|
|
|
List<String> urls = new ArrayList<>(); |
|
|
|
if ("001".equals(conSetUpKey)) { |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + "gsgddwdbjy" + ".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 + "gsgddwdbjy" + 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 = "公司股东会对外担保决议" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
urls.add(pdfName); |
|
|
|
for (SalesOrderVehicle salesOrderVehicle : salesOrderVehicles) { |
|
|
|
//获取消贷合同信息
|
|
|
|
BusSalesOrderLoancontractDetailsVo busSalesOrderLoancontractDetailsVo = busSalesOrderLoancontractFeign.fetchDetailsBySid(salesOrderVehicle.getLoanContractSid()).getData(); |
|
|
|
//消贷合同编号
|
|
|
|
map.put("con1", "H" + busSalesOrderLoancontractDetailsVo.getLoanContractNo() + "《还款协议》"); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + "gsgdhdwdbjy1" + ".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 + "gsgdhdwdbjy1" + 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 = "公司股东会对外担保决议" + dateStr + seconds + ".pdf"; |
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
urls.add(pdfName); |
|
|
|
} |
|
|
|
} else if ("002".equals(conSetUpKey)) { |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + "gsgddwdbjy" + ".ftl"); |
|
|
|
//获取消贷合同信息
|
|
|
|
BusSalesOrderLoancontractDetailsVo busSalesOrderLoancontractDetailsVo = busSalesOrderLoancontractFeign.fetchDetailsBySid(salesOrderVehicles.get(0).getLoanContractSid()).getData(); |
|
|
|
//消贷合同编号
|
|
|
|
map.put("con1", "H" + busSalesOrderLoancontractDetailsVo.getLoanContractNo() + "《还款协议》"); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + "gsgdhdwdbjy1" + ".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 + "gsgddwdbjy" + seconds + ".ftl"); |
|
|
|
File file = new File(targetPath + "gsgdhdwdbjy1" + seconds + ".ftl"); |
|
|
|
File dir = new File(targetPath); |
|
|
|
WordConvertUtils.inputStreamToFile(inputStream, file); |
|
|
|
WordConvertUtils.creatWord1(map, file, targetPath, typeName, dir); |
|
|
|