|
|
@ -72,6 +72,8 @@ import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
|
import com.yxt.anrui.portal.config.DictCommonType; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutions.LoanSolutionsFeign; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutions.app.SolutionsDetailsVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loantemplate.LoanTemplateFeign; |
|
|
|
import com.yxt.anrui.riskcenter.api.loantemplate.LoanTemplateQuotationQuery; |
|
|
|
import com.yxt.anrui.scm.api.scmwarehouse.ScmWarehouseFeign; |
|
|
@ -202,6 +204,8 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
private LoanTemplateFeign loanTemplateFeign; |
|
|
|
@Autowired |
|
|
|
private BaseDistributorService baseDistributorService; |
|
|
|
@Autowired |
|
|
|
private LoanSolutionsFeign loanSolutionsFeign; |
|
|
|
|
|
|
|
|
|
|
|
private QueryWrapper<CommonContract> createQueryWrapper(CommonContractQuery query) { |
|
|
@ -821,7 +825,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
String remarks = ""; |
|
|
|
CommonContract commonContract = baseMapper.selectByBusSidss(dto.getBusSid()); |
|
|
|
if (commonContract != null) { |
|
|
|
String date = DateUtil.format(commonContract.getCreateTime(), "yyyy-MM-dd"); |
|
|
|
String date = DateUtil.today(); |
|
|
|
List<String> dateString = Arrays.asList(date.split("-")); |
|
|
|
String year = dateString.get(0); |
|
|
|
String month = dateString.get(1); |
|
|
@ -836,24 +840,32 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
BaseDistributor baseDistributor = baseDistributorService.fetchBySid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (baseDistributor != null) { |
|
|
|
map.put("invoiceName", busSalesOrder.getAffiliatedCompany());//开票名称
|
|
|
|
map.put("invoiceName", baseDistributor.getDisName());//开票名称
|
|
|
|
map.put("invoiceNo", baseDistributor.getRegistNum());//纳税人识别号
|
|
|
|
} |
|
|
|
} |
|
|
|
map.put("invoiceType", busSalesOrder.getBillingType());//开票类型
|
|
|
|
}else{ |
|
|
|
if(StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())){ |
|
|
|
|
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
CrmCustomerTemp crmCustomerTemp = baseMapper.selectByCustomerSid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (crmCustomerTemp != null) { |
|
|
|
map.put("invoiceName", crmCustomerTemp.getName());//开票名称
|
|
|
|
map.put("invoiceNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
} |
|
|
|
} |
|
|
|
map.put("invoiceType", busSalesOrder.getBillingType());//开票类型
|
|
|
|
} |
|
|
|
//组装到文档相对应的字段中
|
|
|
|
if (StringUtils.isNotBlank(appOrderDetailsVo.getPurchaseSystemSid())) { |
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(appOrderDetailsVo.getUseOrgSid(), appOrderDetailsVo.getPurchaseSystemSid()); |
|
|
|
if (invoicingDetailsVoResultBean.getData() != null) { |
|
|
|
map.put("createOrgName", invoicingDetailsVoResultBean.getData().getName()); |
|
|
|
if (StringUtils.isNotBlank(dto.getCreateOrgName())) { |
|
|
|
map.put("createOrgName", dto.getCreateOrgName()); |
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(appOrderDetailsVo.getPurchaseSystemSid())) { |
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(appOrderDetailsVo.getUseOrgSid(), appOrderDetailsVo.getPurchaseSystemSid()); |
|
|
|
if (invoicingDetailsVoResultBean.getData() != null) { |
|
|
|
map.put("createOrgName", invoicingDetailsVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if ("现车".equals(appOrderDetailsVo.getOrderType())) { |
|
|
|
if ("1".equals(busSalesOrder.getType()) && (StringUtils.isBlank(busSalesOrder.getNowCarUnknownVinNum()) || "0".equals(busSalesOrder.getNowCarUnknownVinNum()))) { |
|
|
|
//获取模板
|
|
|
|
ftl = "existingvehicles"; |
|
|
|
if (stringList.size() > 0) { |
|
|
@ -927,7 +939,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
String remarks = ""; |
|
|
|
CommonContract commonContract = baseMapper.selectByBusSidss(dto.getBusSid()); |
|
|
|
if (commonContract != null) { |
|
|
|
String date = DateUtil.format(commonContract.getCreateTime(), "yyyy-MM-dd"); |
|
|
|
String date = DateUtil.today(); |
|
|
|
List<String> dateString = Arrays.asList(date.split("-")); |
|
|
|
String year = dateString.get(0); |
|
|
|
String month = dateString.get(1); |
|
|
@ -942,20 +954,32 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
BaseDistributor baseDistributor = baseDistributorService.fetchBySid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (baseDistributor != null) { |
|
|
|
map.put("invoiceName", busSalesOrder.getAffiliatedCompany());//开票名称
|
|
|
|
map.put("invoiceName", baseDistributor.getDisName());//开票名称
|
|
|
|
map.put("invoiceNo", baseDistributor.getRegistNum());//纳税人识别号
|
|
|
|
} |
|
|
|
} |
|
|
|
map.put("invoiceType", busSalesOrder.getBillingType());//开票类型
|
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
CrmCustomerTemp crmCustomerTemp = baseMapper.selectByCustomerSid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (crmCustomerTemp != null) { |
|
|
|
map.put("invoiceName", crmCustomerTemp.getName());//开票名称
|
|
|
|
map.put("invoiceNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
} |
|
|
|
} |
|
|
|
map.put("invoiceType", busSalesOrder.getBillingType());//开票类型
|
|
|
|
} |
|
|
|
//组装到文档相对应的字段中
|
|
|
|
if (StringUtils.isNotBlank(appOrderDetailsVo.getPurchaseSystemSid())) { |
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(appOrderDetailsVo.getUseOrgSid(), appOrderDetailsVo.getPurchaseSystemSid()); |
|
|
|
if (invoicingDetailsVoResultBean.getData() != null) { |
|
|
|
map.put("createOrgName", invoicingDetailsVoResultBean.getData().getName()); |
|
|
|
if (StringUtils.isNotBlank(dto.getCreateOrgName())) { |
|
|
|
map.put("createOrgName", dto.getCreateOrgName()); |
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(appOrderDetailsVo.getPurchaseSystemSid())) { |
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(appOrderDetailsVo.getUseOrgSid(), appOrderDetailsVo.getPurchaseSystemSid()); |
|
|
|
if (invoicingDetailsVoResultBean.getData() != null) { |
|
|
|
map.put("createOrgName", invoicingDetailsVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if ("现车".equals(appOrderDetailsVo.getOrderType())) { |
|
|
|
if ("1".equals(busSalesOrder.getType()) && (StringUtils.isBlank(busSalesOrder.getNowCarUnknownVinNum()) || "0".equals(busSalesOrder.getNowCarUnknownVinNum()))) { |
|
|
|
//获取模板
|
|
|
|
ftl = "existingvehicles"; |
|
|
|
if (stringList.size() > 0) { |
|
|
@ -1016,16 +1040,56 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
String num = priceInfo.getNumber(); |
|
|
|
String remarks = ""; |
|
|
|
String ftl = ""; |
|
|
|
CommonContract commonContract = baseMapper.selectByBusSidss(dto.getBusSid()); |
|
|
|
if (commonContract != null) { |
|
|
|
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); |
|
|
|
} |
|
|
|
BusSalesOrder busSalesOrder = baseMapper.selectByBusSids(dto.getBusSid()); |
|
|
|
if (busSalesOrder.getAffiliatedCompanyType() == 0) { |
|
|
|
//根据挂靠公司sid查询信息
|
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
BaseDistributor baseDistributor = baseDistributorService.fetchBySid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (baseDistributor != null) { |
|
|
|
map.put("invoiceName", baseDistributor.getDisName());//开票名称
|
|
|
|
map.put("customerName", baseDistributor.getDisName());//开票名称
|
|
|
|
map.put("invoiceNo", baseDistributor.getRegistNum());//纳税人识别号
|
|
|
|
map.put("idNo", baseDistributor.getRegistNum());//纳税人识别号
|
|
|
|
map.put("adds", baseDistributor.getRegistDetailAddress());//户籍地址
|
|
|
|
} |
|
|
|
} |
|
|
|
map.put("invoiceType", busSalesOrder.getBillingType());//开票类型
|
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
CrmCustomerTemp crmCustomerTemp = baseMapper.selectByCustomerSid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (crmCustomerTemp != null) { |
|
|
|
map.put("invoiceName", crmCustomerTemp.getName());//开票名称
|
|
|
|
map.put("customerName", crmCustomerTemp.getName());//开票名称
|
|
|
|
map.put("invoiceNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
map.put("idNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
map.put("adds", crmCustomerTemp.getCertificateAddress());//户籍地址
|
|
|
|
} |
|
|
|
} |
|
|
|
map.put("invoiceType", busSalesOrder.getBillingType());//开票类型
|
|
|
|
} |
|
|
|
map.put("createOrgName", ""); |
|
|
|
// 涉及高低开票的,需要打印两套合同,一套按照成交价打印(记账用),一套为价格空白的合同(开票用)
|
|
|
|
if ("1".equals(dto.getDiscountKey())) { |
|
|
|
// 现车
|
|
|
|
if ("现车".equals(appOrderDetailsVo.getOrderType())) { |
|
|
|
if ("1".equals(busSalesOrder.getType()) && (StringUtils.isBlank(busSalesOrder.getNowCarUnknownVinNum()) || "0".equals(busSalesOrder.getNowCarUnknownVinNum()))) { |
|
|
|
//获取模板
|
|
|
|
ftl = "existingvehicles_black"; |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。车架号:" + String.join("、", stringList); |
|
|
|
// remarks = "数量" + num + "台,单台成交价: 元。车架号:" + String.join("、", stringList);
|
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} else { |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} |
|
|
@ -1036,7 +1100,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} |
|
|
|
map.put("remarks", remarks); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl2/" + ftl + ".ftl"); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
@ -1066,16 +1130,56 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
String num = priceInfo.getNumber(); |
|
|
|
String remarks = ""; |
|
|
|
String ftl = ""; |
|
|
|
CommonContract commonContract = baseMapper.selectByBusSidss(dto.getBusSid()); |
|
|
|
if (commonContract != null) { |
|
|
|
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); |
|
|
|
} |
|
|
|
BusSalesOrder busSalesOrder = baseMapper.selectByBusSids(dto.getBusSid()); |
|
|
|
if (busSalesOrder.getAffiliatedCompanyType() == 0) { |
|
|
|
//根据挂靠公司sid查询信息
|
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
BaseDistributor baseDistributor = baseDistributorService.fetchBySid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (baseDistributor != null) { |
|
|
|
map.put("invoiceName", baseDistributor.getDisName());//开票名称
|
|
|
|
map.put("customerName", baseDistributor.getDisName());//开票名称
|
|
|
|
map.put("invoiceNo", baseDistributor.getRegistNum());//纳税人识别号
|
|
|
|
map.put("idNo", baseDistributor.getRegistNum());//纳税人识别号
|
|
|
|
map.put("adds", baseDistributor.getRegistDetailAddress());//户籍地址
|
|
|
|
} |
|
|
|
} |
|
|
|
map.put("invoiceType", busSalesOrder.getBillingType());//开票类型
|
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
CrmCustomerTemp crmCustomerTemp = baseMapper.selectByCustomerSid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (crmCustomerTemp != null) { |
|
|
|
map.put("invoiceName", crmCustomerTemp.getName());//开票名称
|
|
|
|
map.put("customerName", crmCustomerTemp.getName());//开票名称
|
|
|
|
map.put("invoiceNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
map.put("idNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
map.put("adds", crmCustomerTemp.getCertificateAddress());//户籍地址
|
|
|
|
} |
|
|
|
} |
|
|
|
map.put("invoiceType", busSalesOrder.getBillingType());//开票类型
|
|
|
|
} |
|
|
|
map.put("createOrgName", ""); |
|
|
|
// 涉及高低开票的,需要打印两套合同,一套按照成交价打印(记账用),一套为价格空白的合同(开票用)
|
|
|
|
if ("1".equals(dto.getDiscountKey())) { |
|
|
|
// 现车
|
|
|
|
if ("现车".equals(appOrderDetailsVo.getOrderType())) { |
|
|
|
if ("1".equals(busSalesOrder.getType()) && (StringUtils.isBlank(busSalesOrder.getNowCarUnknownVinNum()) || "0".equals(busSalesOrder.getNowCarUnknownVinNum()))) { |
|
|
|
//获取模板
|
|
|
|
ftl = "existingvehicles_black2"; |
|
|
|
ftl = "existingvehicles_black"; |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。车架号:" + String.join("、", stringList); |
|
|
|
// remarks = "数量" + num + "台,单台成交价: 元。车架号:" + String.join("、", stringList);
|
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} else { |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} |
|
|
@ -1086,7 +1190,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} |
|
|
|
map.put("remarks", remarks); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl2/" + ftl + ".ftl"); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
@ -1106,16 +1210,27 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
return url; |
|
|
|
} |
|
|
|
|
|
|
|
private String getReceiveCar(Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
private String getReceiveCar(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String url = ""; |
|
|
|
//查询销售订单的现车
|
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getVinList(); |
|
|
|
/*if (stringList.size() > 0) { |
|
|
|
map.put("vinNo", String.join(",", stringList)); |
|
|
|
}*/ |
|
|
|
ResultBean<CrmCustomerTempVo> crmResultBean = crmCustomerTempFeign.fetchSid(appOrderDetailsVo.getCustomerSid()); |
|
|
|
CrmCustomerTempVo crmCustomerTempVo = crmResultBean.getData(); |
|
|
|
String idNo = crmCustomerTempVo.getIDNumber(); |
|
|
|
map.put("customerName", appOrderDetailsVo.getName()); |
|
|
|
map.put("idNo", idNo); |
|
|
|
if (StringUtils.isNotBlank(dto.getCreateOrgName())) { |
|
|
|
map.put("createOrgName", dto.getCreateOrgName()); |
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(appOrderDetailsVo.getPurchaseSystemSid())) { |
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(appOrderDetailsVo.getUseOrgSid(), appOrderDetailsVo.getPurchaseSystemSid()); |
|
|
|
if (invoicingDetailsVoResultBean.getData() != null) { |
|
|
|
map.put("createOrgName", invoicingDetailsVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String ftl = "receiveCar"; |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl2/" + ftl + ".ftl"); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
@ -1237,10 +1352,39 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
|
|
|
|
private String getCarContract(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String url = ""; |
|
|
|
// map.put("createDate", DateUtil.today());
|
|
|
|
BusSalesOrder busSalesOrder = baseMapper.selectByBusSids(dto.getBusSid()); |
|
|
|
if (busSalesOrder != null) { |
|
|
|
map.put("Yf", busSalesOrder.getCustomerName()); |
|
|
|
if (busSalesOrder.getAffiliatedCompanyType() == 0) { |
|
|
|
//根据挂靠公司sid查询信息
|
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
BaseDistributor baseDistributor = baseDistributorService.fetchBySid(busSalesOrder.getAffiliatedCompanySid()); |
|
|
|
if (baseDistributor != null) { |
|
|
|
map.put("invoiceName", baseDistributor.getDisName());//开票名称
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("contractNo", "D" + map.get("contractNo")); |
|
|
|
if (StringUtils.isNotBlank(dto.getCreateOrgName())) { |
|
|
|
map.put("createOrgName", dto.getCreateOrgName()); |
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(appOrderDetailsVo.getPurchaseSystemSid())) { |
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(appOrderDetailsVo.getUseOrgSid(), appOrderDetailsVo.getPurchaseSystemSid()); |
|
|
|
if (invoicingDetailsVoResultBean.getData() != null) { |
|
|
|
map.put("createOrgName", invoicingDetailsVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
CommonContract commonContract = baseMapper.selectByBusSidss(dto.getBusSid()); |
|
|
|
if (commonContract != null) { |
|
|
|
String date =DateUtil.today(); |
|
|
|
map.put("date", date); |
|
|
|
} |
|
|
|
List<CarContractListVo> carContractListVos = new ArrayList<>(); |
|
|
|
if (dto != null) { |
|
|
|
List<SalesOrderVehicle> salesOrderVehicles = dto.getSalesOrderVehicles(); |
|
|
|
List<SalesOrderVehicle> salesOrderVehicles = baseMapper.selectByOrderSid(dto.getBusSid()); |
|
|
|
salesOrderVehicles.removeAll(Collections.singleton(null)); |
|
|
|
for (SalesOrderVehicle salesOrderVehicle : salesOrderVehicles) { |
|
|
|
CarContractListVo carContractListVo = new CarContractListVo(); |
|
|
|
BaseVehicle baseVehicle = baseVehicleService.fetchBySid(salesOrderVehicle.getLinkSid()); |
|
|
@ -1263,7 +1407,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
map.put("carLists", carContractListVos); |
|
|
|
} |
|
|
|
String ftl = "carContract"; |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl2/" + ftl + ".ftl"); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
|
//生成word文件名
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
@ -2080,12 +2224,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
String mobile = appOrderDetailsVo.getPhone(); |
|
|
|
//根据客户sid查询客户的身份证号
|
|
|
|
sid = appOrderDetailsVo.getCustomerSid(); |
|
|
|
ResultBean<CrmCustomerTempVo> crmResultBean = crmCustomerTempFeign.fetchSid(sid); |
|
|
|
if (!crmResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(crmResultBean.getMsg()); |
|
|
|
} |
|
|
|
CrmCustomerTempVo crmCustomerTempVo = crmResultBean.getData(); |
|
|
|
String idNo = crmCustomerTempVo.getIDNumber(); |
|
|
|
|
|
|
|
//查询销售订单的车型信息
|
|
|
|
AppOrderModelInfoVo appOrderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
//根据车型sid查询车型的全称
|
|
|
@ -2194,7 +2333,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
modelAllName.append("、").append(baseModelConfig.getTireCover()); |
|
|
|
} |
|
|
|
StringBuilder modelAllName2 = new StringBuilder(); |
|
|
|
modelAllName2.append("\t"); |
|
|
|
modelAllName2.append("\t\t"); |
|
|
|
//驾驶室
|
|
|
|
if (StringUtils.isNotBlank(baseModelConfig.getSpecification()) && !"-".equals(baseModelConfig.getSpecification())) { |
|
|
|
modelAllName2.append(baseModelConfig.getSpecification()); |
|
|
@ -2267,9 +2406,16 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
AppOrderDiscountListVo vv = discountList.get(iii); |
|
|
|
String discountName = vv.getDiscountName(); |
|
|
|
if (iii == discountList.size() - 1) { |
|
|
|
discountDetail = discountDetail + "价值" + vv.getPrice() + "元" + discountName + vv.getNumber() + "份(每份包含" + vv.getDiscountExplain() + ")。"; |
|
|
|
discountDetail = discountDetail + "价值" + vv.getPrice() + "元" + discountName + vv.getNumber() + "份"; |
|
|
|
if (StringUtils.isNotBlank(vv.getDiscountExplain())) { |
|
|
|
discountDetail = discountDetail + "(每份包含" + vv.getDiscountExplain() + ")。"; |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
discountDetail = discountDetail + "价值" + vv.getPrice() + "元" + discountName + vv.getNumber() + "份(每份包含" + vv.getDiscountExplain() + "),"; |
|
|
|
discountDetail = discountDetail + "价值" + vv.getPrice() + "元" + discountName + vv.getNumber() + "份"; |
|
|
|
if (StringUtils.isNotBlank(vv.getDiscountExplain())) { |
|
|
|
discountDetail = discountDetail + "(每份包含" + vv.getDiscountExplain() + "),"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("discountDetail", discountDetail); |
|
|
@ -2380,68 +2526,71 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
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> future2 = pool.submit(() -> { |
|
|
|
return genCarSaleContractBlank(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
Future<String> future2_2 = pool.submit(() -> { |
|
|
|
return genCarSaleContractBlank2(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
//接收车辆委托书
|
|
|
|
Future<String> future4 = pool.submit(() -> { |
|
|
|
return getReceiveCar(map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
String singleFinalPriceOne = priceInfo.getSingleFinalPrice(); |
|
|
|
String depositOne = depositInfo.getDeposit(); |
|
|
|
Future<String> future8 = null; |
|
|
|
if (!"02".equals(appOrderDetailsVo.getInvoiceType())) { |
|
|
|
future8 = pool.submit(() -> { |
|
|
|
return getCarContract(null, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
}*/ |
|
|
|
BusSalesOrder busSalesOrder = baseMapper.selectByBusSids(dto.getBusSid()); |
|
|
|
List<File> filesList = new ArrayList<>(); |
|
|
|
if (future1 != null) { |
|
|
|
if ("1".equals(busSalesOrder.getPayTypeKey())) {//全款
|
|
|
|
Future<String> future1 = pool.submit(() -> { |
|
|
|
return genCarSaleContract(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
Future<String> future1_2 = pool.submit(() -> { |
|
|
|
return genCarSaleContract2(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
Future<String> future2 = pool.submit(() -> { |
|
|
|
return genCarSaleContractBlank(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
Future<String> future2_2 = pool.submit(() -> { |
|
|
|
return genCarSaleContractBlank2(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
//接收车辆委托书
|
|
|
|
Future<String> future4 = pool.submit(() -> { |
|
|
|
return getReceiveCar(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
Future<String> future8 = null; |
|
|
|
if ("0".equals(dto.getDiscountKey())) { |
|
|
|
if (busSalesOrder.getAffiliatedCompanyType() == 0) { |
|
|
|
future8 = pool.submit(() -> { |
|
|
|
return getCarContract(dto, map, appOrderDetailsVo); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
/*if (future2 != null) { |
|
|
|
if (StringUtils.isNotBlank(future2.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future2.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
if (future2_2 != null) { |
|
|
|
if (StringUtils.isNotBlank(future2_2.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future2_2.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
//合并pdf文件
|
|
|
|
if (future8 != null) { |
|
|
|
if (StringUtils.isNotBlank(future8.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future8.get()); |
|
|
|
if (StringUtils.isNotBlank(future4.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future4.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(future4.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future4.get()); |
|
|
|
filesList.add(file); |
|
|
|
}*/ |
|
|
|
//合并pdf文件
|
|
|
|
if (future8 != null) { |
|
|
|
if (StringUtils.isNotBlank(future8.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future8.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
} else {//贷款
|
|
|
|
SolutionsDetailsVo loanSolutions = loanSolutionsFeign.selectDetailss(dto.getBusSid()).getData(); |
|
|
|
if (loanSolutions != null) { |
|
|
|
if (StringUtils.isBlank(loanSolutions.getTypeKey())) { |
|
|
|
//担保
|
|
|
|
} else { |
|
|
|
//非担保
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if ("2".equals(appOrderDetailsVo.getPayTypeKey())) { |
|
|
|
Future<String> future10 = pool.submit(() -> { |
|
|
|
return getRisk(appOrderDetailsVo, dto); |
|
|
|