|
|
@ -63,6 +63,8 @@ import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderContractNoDto |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderModelInfoVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderPriceInfoVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.vin.VinListsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderborrower.BusSalesOrderBorrowerDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderborrower.BusSalesOrderBorrowerFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordermodel.BusSalesOrderModel; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderprice.BusSalesOrderPrice; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicle; |
|
|
@ -84,6 +86,7 @@ import com.yxt.anrui.fin.api.finbilltrailer.FinBillTrailerVo; |
|
|
|
import com.yxt.anrui.fin.api.finbillvehicle.FinBillVehicle; |
|
|
|
import com.yxt.anrui.fin.api.finbillvehicle.FinBillVehicleDto; |
|
|
|
import com.yxt.anrui.fin.api.finbillvehicle.FinBillVehicleVo; |
|
|
|
import com.yxt.anrui.fin.api.fincompanyinvoicing.FinCompanyInvoicing; |
|
|
|
import com.yxt.anrui.fin.api.fincompanyinvoicing.FinCompanyInvoicingDetailsVo; |
|
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardapply.FinFundsCarriedForwardApply; |
|
|
|
import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceDto; |
|
|
@ -131,6 +134,7 @@ import com.yxt.messagecenter.api.message.*; |
|
|
|
import com.yxt.messagecenter.api.messagelist.MessageList; |
|
|
|
import com.yxt.messagecenter.api.messagelist.MessageListFeign; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.poi.ss.formula.functions.T; |
|
|
|
import org.apache.tomcat.util.threads.ThreadPoolExecutor; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -145,6 +149,7 @@ import java.util.*; |
|
|
|
import java.util.concurrent.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import static java.util.Collections.singletonList; |
|
|
|
import static java.util.Comparator.comparing; |
|
|
|
|
|
|
|
/** |
|
|
@ -224,6 +229,8 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
@Autowired |
|
|
|
private LoanNoGuaranteeCreditReviewFeign loanNoGuaranteeCreditReviewFeign; |
|
|
|
@Autowired |
|
|
|
private BusSalesOrderBorrowerFeign busSalesOrderBorrowerFeign; |
|
|
|
@Autowired |
|
|
|
private FlowFeign flowFeign; |
|
|
|
@Autowired |
|
|
|
private BaseVehicleStateFeign baseVehicleStateFeign; |
|
|
@ -455,6 +462,78 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
record.setInvoicingUnit(invoicingDetailsVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
//贷款查询开票名称、开票类型
|
|
|
|
BusSalesOrder busSalesOrder = busSalesOrderFeign.fetchBySid(record.getBusSalesOrderSid()).getData(); |
|
|
|
SolutionsDetailsVo solutionsDetailsVo = loanSolutionsFeign.selectDetails(record.getBusSalesOrderSid()).getData(); |
|
|
|
BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleFeign.selectByNoAndVinSid(record.getContractId(), record.getVinSid()).getData(); |
|
|
|
if ("2".equals(record.getSaleTypeKey())){ |
|
|
|
if (StringUtils.isBlank(solutionsDetailsVo.getTypeKey())){//担保
|
|
|
|
String jfkcSid = loanHomevisitInvestigateFeign.selSaleOrderSidAndBorrSid(record.getBusSalesOrderSid(), busSalesOrderVehicle.getBorrowerSid()).getData(); |
|
|
|
LoanHomevisitInvestigateCustomerDetailsVo loanHomevisitInvestigateCustomerDetailsVo = loanHomevisitInvestigateCustomerFeign.selectByMainSid(jfkcSid).getData(); |
|
|
|
BusSalesOrderBorrowerDetailsVo busSalesOrderBorrowerDetailsVo = busSalesOrderBorrowerFeign.fetchDetailsBySid(loanHomevisitInvestigateCustomerDetailsVo.getBorrowerSid()).getData(); |
|
|
|
CrmCustomerTempVo crmCustomerTempVo = crmCustomerTempFeign.fetchSid(busSalesOrderBorrowerDetailsVo.getCustomSid()).getData(); |
|
|
|
record.setInvoiceTypeKey(busSalesOrder.getBillingTypeKey()); |
|
|
|
record.setInvoiceType(busSalesOrder.getBillingType()); |
|
|
|
if ("1".equals(loanHomevisitInvestigateCustomerDetailsVo.getVehRegis())){ |
|
|
|
record.setInvoiceName(loanHomevisitInvestigateCustomerDetailsVo.getBorrowerName()); |
|
|
|
record.setOpenTickSid(busSalesOrderBorrowerDetailsVo.getCustomSid()); |
|
|
|
record.setInvoiceInfo(crmCustomerTempVo.getIDNumber()); |
|
|
|
}else if ("2".equals(loanHomevisitInvestigateCustomerDetailsVo.getVehRegis())){ |
|
|
|
FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingService.selectInvoingByTaxpayerNo(loanHomevisitInvestigateCustomerDetailsVo.getAccCompRegistNum()).getData(); |
|
|
|
record.setInvoiceName(loanHomevisitInvestigateCustomerDetailsVo.getAccCompName()); |
|
|
|
record.setOpenTickSid(finCompanyInvoicingDetailsVo.getSid()); |
|
|
|
String openTickRemarks = ""; |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(openTickRemarks + finCompanyInvoicingDetailsVo.getTaxpayerNo())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getTaxpayerNo() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getAddress())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getAddress() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getPhone())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getPhone() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getBankName())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getBankName() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getBankAccount())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getBankAccount() + ";"; |
|
|
|
} |
|
|
|
record.setInvoiceInfo(openTickRemarks); |
|
|
|
} |
|
|
|
}else if ("01".equals(solutionsDetailsVo.getTypeKey())){//非担保
|
|
|
|
LoanNoGuaranteeCreditReviewDetailsVo loanNoGuaranteeCreditReviewDetailsVo = loanNoGuaranteeCreditReviewFeign.selByBorrSid(busSalesOrderVehicle.getBorrowerSid()).getData(); |
|
|
|
BusSalesOrderBorrowerDetailsVo busSalesOrderBorrowerDetailsVo = busSalesOrderBorrowerFeign.fetchDetailsBySid(busSalesOrderVehicle.getBorrowerSid()).getData(); |
|
|
|
CrmCustomerTempVo crmCustomerTempVo = crmCustomerTempFeign.fetchSid(busSalesOrderBorrowerDetailsVo.getCustomSid()).getData(); |
|
|
|
record.setInvoiceTypeKey(busSalesOrder.getBillingTypeKey()); |
|
|
|
record.setInvoiceType(busSalesOrder.getBillingType()); |
|
|
|
if ("1".equals(loanNoGuaranteeCreditReviewDetailsVo.getType())){ |
|
|
|
record.setInvoiceName(loanNoGuaranteeCreditReviewDetailsVo.getBorrowerName()); |
|
|
|
record.setOpenTickSid(busSalesOrderBorrowerDetailsVo.getCustomSid()); |
|
|
|
record.setInvoiceInfo(crmCustomerTempVo.getIDNumber()); |
|
|
|
}else if ("2".equals(loanNoGuaranteeCreditReviewDetailsVo.getType())){ |
|
|
|
FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingService.selectInvoingByName(loanNoGuaranteeCreditReviewDetailsVo.getAffiliatedCompany()).getData(); |
|
|
|
record.setInvoiceName(loanNoGuaranteeCreditReviewDetailsVo.getAffiliatedCompany()); |
|
|
|
record.setOpenTickSid(finCompanyInvoicingDetailsVo.getSid()); |
|
|
|
String openTickRemarks = ""; |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(openTickRemarks + finCompanyInvoicingDetailsVo.getTaxpayerNo())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getTaxpayerNo() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getAddress())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getAddress() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getPhone())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getPhone() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getBankName())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getBankName() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getBankAccount())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getBankAccount() + ";"; |
|
|
|
} |
|
|
|
record.setInvoiceInfo(openTickRemarks); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//主车合格证照片
|
|
|
|
BaseVehicleCertificateVo baseVehicleCertificateVo = baseVehicleCertificateFeign.selStateByVehicleSid(record.getVinSid()).getData(); |
|
|
|
if (baseVehicleCertificateVo != null) { |
|
|
@ -731,31 +810,43 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
} |
|
|
|
map.put("contractNo", busSalesOrder.getContractNo()); |
|
|
|
List<BillFileVo> list = new ArrayList<>(); |
|
|
|
|
|
|
|
//====================================主车开始
|
|
|
|
BillFileVo billFileVo = new BillFileVo(); |
|
|
|
if (busSalesOrderModel != null) { |
|
|
|
billFileVo.setCarName(busSalesOrderModel.getModelName()); |
|
|
|
billFileVo.setNum(String.valueOf(sameOpenTickSidList.size())); |
|
|
|
billFileVo.setPrice(busSalesOrderPrice.getSingleFinalPrice().toString()); |
|
|
|
} |
|
|
|
if (loanSolutions != null) { |
|
|
|
/* if (loanSolutions != null) { |
|
|
|
if (StringUtils.isNotBlank(loanSolutions.getMainVehicleAmount())) { |
|
|
|
billFileVo.setOpenPrice(loanSolutions.getMainVehicleAmount()); |
|
|
|
} |
|
|
|
} |
|
|
|
}*/ |
|
|
|
billFileVo.setOpenPrice(dto.getOneBillMoney()); |
|
|
|
billFileVo.setType(finBillVehicleDto.getBillTypeValue());//开票类型
|
|
|
|
list.add(billFileVo); |
|
|
|
|
|
|
|
List<String> vinNoString = new ArrayList<>(); |
|
|
|
List<FinBillTrailerDto> lllList = new ArrayList<>(); |
|
|
|
BillFileVo finalBillFileVo = billFileVo; |
|
|
|
sameOpenTickSidList.forEach(v -> { |
|
|
|
//车架号
|
|
|
|
BaseVehicle baseVehicle = baseMapper.selectVinNoByVinSid(v.getVehSid()); |
|
|
|
/* if(baseVehicle != null){ |
|
|
|
vinNoString.add(baseVehicle.getVinNo()); |
|
|
|
}*/ |
|
|
|
List<FinBillTrailerDto> finBillTrailers = dto.getFinBillTrailers(); |
|
|
|
finBillTrailers.removeAll(Collections.singleton(null)); |
|
|
|
finBillTrailers = finBillTrailers.stream().filter(vv -> vv.getVinNo().contains(v.getVinNo())).collect(Collectors.toList()); |
|
|
|
lllList.addAll(finBillTrailers); |
|
|
|
/* String vinNo = String.join(",",vinNoString); |
|
|
|
billFileVo.setVinNo(vinNo);*/ |
|
|
|
list.add(finalBillFileVo); |
|
|
|
}); |
|
|
|
|
|
|
|
//==========================主车结束
|
|
|
|
Map<String, Object> carNameMap = new HashMap<>(); |
|
|
|
if (!lllList.isEmpty()) { |
|
|
|
for (int i = 0; i < lllList.size(); i++) { |
|
|
|
List<String> trailerVinString = new ArrayList<>(); |
|
|
|
FinBillTrailerDto finBillTrailerDto = lllList.get(i); |
|
|
|
billFileVo = new BillFileVo(); |
|
|
|
BaseTrailer baseTrailer = baseMapper.selectByTrailerNo(finBillTrailerDto.getGcVinNo()); |
|
|
@ -763,36 +854,42 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
BaseTrailerModel baseTrailerModel = baseMapper.selectByModelSid(baseTrailer.getTrailerModelSid()); |
|
|
|
if (baseTrailerModel != null) { |
|
|
|
String carName = "外廓-" + Integer.parseInt(baseTrailerModel.getAppearanceSizeLong()) / 1000 + "米" + "\t" + baseTrailerModel.getTrailerTypeValue(); |
|
|
|
if (carNameMap.containsKey(carName)) { |
|
|
|
carNameMap.put(carName, Integer.parseInt(carNameMap.get(carName).toString()) + 1); |
|
|
|
/* if (carNameMap.containsKey(carName)) { |
|
|
|
carNameMap.put(carName, Arrays.asList(carNameMap.get(carName).toString()).add(baseTrailer.getVinNo())); |
|
|
|
continue; |
|
|
|
} else { |
|
|
|
billFileVo.setType(busSalesOrder.getBillingType()); |
|
|
|
if (loanSolutions != null) { |
|
|
|
if (StringUtils.isNotBlank(loanSolutions.getMainVehicleAmount())) { |
|
|
|
billFileVo.setOpenPrice(loanSolutions.getMainVehicleAmount()); |
|
|
|
} |
|
|
|
} |
|
|
|
billFileVo.setCarName(carName); |
|
|
|
if (busSalesOrderModel != null) { |
|
|
|
billFileVo.setPrice(busSalesOrderPrice.getSingleFinalPrice().toString()); |
|
|
|
} |
|
|
|
carNameMap.put(carName, 1); |
|
|
|
trailerVinString.add(baseTrailer.getVinNo()); |
|
|
|
carNameMap.put(carName,trailerVinString); |
|
|
|
list.add(billFileVo); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
billFileVo.setCarName(carName); |
|
|
|
billFileVo.setVinNo(baseTrailer.getVinNo()); |
|
|
|
billFileVo.setOpenPrice(finBillTrailerDto.getOneBillMoney()); |
|
|
|
billFileVo.setPrice(busSalesOrderPrice.getSingleFinalPrice().toString()); |
|
|
|
billFileVo.setType(finBillTrailerDto.getBillTypeValue()); |
|
|
|
list.add(billFileVo); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!list.isEmpty()) { |
|
|
|
/*if (!list.isEmpty()) { |
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
BillFileVo billFileVo1 = list.get(i); |
|
|
|
String carName = billFileVo1.getCarName(); |
|
|
|
if (carNameMap.containsKey(carName)) { |
|
|
|
billFileVo1.setNum(carNameMap.get(carName).toString()); |
|
|
|
List<String> ssList = castList(carNameMap.get(carName),String.class); |
|
|
|
String trailerVinNo = String.join(",",ssList); |
|
|
|
billFileVo1.setOpenPrice(Arrays.asList(carName.split("#")).get(1)); |
|
|
|
billFileVo1.setCarName(Arrays.asList(carName.split("#")).get(0)); |
|
|
|
billFileVo1.setVinNo(trailerVinNo); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}*/ |
|
|
|
map.put("list", list); |
|
|
|
map.put("name", finBillVehicleDto.getOpenTickName()); |
|
|
|
String date = DateUtil.today(); |
|
|
@ -803,7 +900,8 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
map.put("year", year); |
|
|
|
map.put("month", month); |
|
|
|
map.put("day", day); |
|
|
|
if (!"02".equals(finBillVehicleDto.getBillTypeKey())) { |
|
|
|
FinCompanyInvoicing finCompanyInvoicing = finCompanyInvoicingService.fetchBySid(openTickSid); |
|
|
|
if (!"02".equals(finBillVehicleDto.getBillTypeKey()) && finCompanyInvoicing != null) {//机动车
|
|
|
|
if (finCompanyInvoicingDetailsVo != null) { |
|
|
|
//生成车辆登记合同
|
|
|
|
if (busSalesOrder != null) { |
|
|
@ -831,45 +929,307 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (loanSolutions != null) { |
|
|
|
if (!dto.getOneBillMoney().equals(loanSolutions.getMainVehicleAmount())) { |
|
|
|
String remarks = ""; |
|
|
|
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); |
|
|
|
filemap.put("year", year); |
|
|
|
filemap.put("month", month); |
|
|
|
filemap.put("day", day); |
|
|
|
|
|
|
|
if("1".equals(busSalesOrder.getPayTypeKey())){ |
|
|
|
if (loanSolutions != null) { |
|
|
|
if (!dto.getOneBillMoney().equals(loanSolutions.getMainVehicleAmount())) { |
|
|
|
String remarks = ""; |
|
|
|
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); |
|
|
|
filemap.put("year", year); |
|
|
|
filemap.put("month", month); |
|
|
|
filemap.put("day", day); |
|
|
|
if (finCompanyInvoicingDetailsVo != null) { |
|
|
|
filemap.put("invoiceName", finCompanyInvoicingDetailsVo.getName());//开票名称
|
|
|
|
filemap.put("customerName", finCompanyInvoicingDetailsVo.getName());//乙方
|
|
|
|
filemap.put("invoiceNo", finCompanyInvoicingDetailsVo.getTaxpayerNo());//纳税人识别号
|
|
|
|
filemap.put("idNo", finCompanyInvoicingDetailsVo.getTaxpayerNo());//乙方证件号码
|
|
|
|
filemap.put("adds", finCompanyInvoicingDetailsVo.getAddress());//户籍地址
|
|
|
|
} else { |
|
|
|
CrmCustomerTemp crmCustomerTemp = baseMapper.selectByCustomerSid(dto.getOpenTickSid()); |
|
|
|
if (crmCustomerTemp != null) { |
|
|
|
filemap.put("invoiceName", crmCustomerTemp.getName());//开票名称
|
|
|
|
filemap.put("customerName", crmCustomerTemp.getName());//乙方
|
|
|
|
filemap.put("invoiceNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
filemap.put("idNo", crmCustomerTemp.getIDNumber());//乙方证件号码
|
|
|
|
filemap.put("adds", crmCustomerTemp.getCertificateAddress());//户籍地址
|
|
|
|
} |
|
|
|
} |
|
|
|
filemap.put("invoiceType", dto.getOpenTickTypeValue());//开票类型
|
|
|
|
remarks = "数量" + finBillVehicles.size() + "台,单台成交价: 元。"; |
|
|
|
filemap.put("remarks", remarks); |
|
|
|
filemap.put("busSid", busSalesOrder.getSid()); |
|
|
|
ResultBean<Map<String, Object>> mapResultBean = commonContractFeign.getModelMap(filemap); |
|
|
|
checkMap = mapResultBean.getData(); |
|
|
|
//生成新车空白合同
|
|
|
|
checkMap.put("totalPrice", ""); |
|
|
|
checkMap.put("priceRemarks", ""); |
|
|
|
checkMap.put("depositTotal", ""); |
|
|
|
checkMap.put("createOrgName", ""); |
|
|
|
checkMap.put("payTypeKey", busSalesOrder.getPayTypeKey()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
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()); |
|
|
|
|
|
|
|
if (!map.isEmpty()) { |
|
|
|
Future<String> future1 = pool.submit(() -> { |
|
|
|
return getInvoiceApplyFile(map); |
|
|
|
}); |
|
|
|
if (StringUtils.isNotBlank(future1.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future1.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!carMap.isEmpty()) { |
|
|
|
Future<String> future2 = pool.submit(() -> { |
|
|
|
return getCarFile(carMap); |
|
|
|
}); |
|
|
|
if (StringUtils.isNotBlank(future2.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future2.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
if("1".equals(busSalesOrder.getPayTypeKey())){ |
|
|
|
Map<String, Object> finalCheckMap = checkMap; |
|
|
|
if (!finalCheckMap.isEmpty()) { |
|
|
|
Future<String> future3 = pool.submit(() -> { |
|
|
|
return blackFile(finalCheckMap); |
|
|
|
}); |
|
|
|
if (StringUtils.isNotBlank(future3.get())) { |
|
|
|
File file = new File(docPdfComponent.getUploadTemplateUrl() + future3.get()); |
|
|
|
filesList.add(file); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
log.error("生成文件失败:==========================" + e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
if (filesList.size() > 0) { |
|
|
|
String typeName = contractNo + "开票附件.pdf"; |
|
|
|
try { |
|
|
|
File allFile = WordConvertUtils.mulFile2One(filesList, docPdfComponent.getUploadTemplateUrl() + typeName); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
System.out.println("-========" + docPdfComponent.getUploadTemplateUrl() + typeName); |
|
|
|
fileUrl = typeName; |
|
|
|
} |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(fileUrl)){ |
|
|
|
FinBillApplication finBillApplication = fetchBySid(dto.getSid()); |
|
|
|
finBillApplication.setFileUrl(fileUrl); |
|
|
|
baseMapper.updateById(finBillApplication); |
|
|
|
} |
|
|
|
return fileUrl; |
|
|
|
} |
|
|
|
|
|
|
|
public String getFileUrlNew(FinBillApplicationDto dto) { |
|
|
|
String fileUrl = ""; |
|
|
|
String contractNo = dto.getContractNo(); |
|
|
|
List<File> filesList = new ArrayList<>(); |
|
|
|
//根据合同号查询销售订单数据
|
|
|
|
BusSalesOrder busSalesOrder = baseMapper.selectByContract(contractNo); |
|
|
|
SolutionsDetailsVo loanSolutions = loanSolutionsFeign.selectDetailss(busSalesOrder.getSid()).getData(); |
|
|
|
if ("1".equals(busSalesOrder.getPayTypeKey())) {//全款
|
|
|
|
List<FinBillVehicleDto> finBillVehicles = dto.getFinBillVehicles(); |
|
|
|
BusSalesOrderModel busSalesOrderModel = baseMapper.selectByOrderSid(busSalesOrder.getSid()); |
|
|
|
BusSalesOrderPrice busSalesOrderPrice = baseMapper.selectByPrices(busSalesOrder.getSid()); |
|
|
|
//按开票名称sid分组
|
|
|
|
Map<String, List<FinBillVehicleDto>> groupedByOpenTickSid = finBillVehicles.stream() |
|
|
|
.collect(Collectors.groupingBy(FinBillVehicleDto::getOpenTickSid)); |
|
|
|
//遍历分组并组装每组的数据
|
|
|
|
groupedByOpenTickSid.forEach((openTickSid, sameOpenTickSidList) -> { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> carMap = new HashMap<>(); |
|
|
|
Map<String, Object> filemap = new HashMap<>(); |
|
|
|
Map<String, Object> checkMap = new HashMap<>(); |
|
|
|
FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingService.fetchDetailsVoBySid(openTickSid); |
|
|
|
if (!openTickSid.equals(busSalesOrder.getAffiliatedCompanySid())) { |
|
|
|
FinBillVehicleDto finBillVehicleDto = sameOpenTickSidList.get(0); |
|
|
|
//生成开票申请书
|
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getPurchaseSystemSid())) { |
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingService.getDetailsByUseOrgAndSystem(busSalesOrder.getUseOrgSid(), busSalesOrder.getPurchaseSystemSid()); |
|
|
|
if (invoicingDetailsVoResultBean.getData() != null) { |
|
|
|
map.put("createOrgName", invoicingDetailsVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("contractNo", busSalesOrder.getContractNo()); |
|
|
|
List<BillFileVo> list = new ArrayList<>(); |
|
|
|
//====================================主车开始
|
|
|
|
BillFileVo billFileVo = new BillFileVo(); |
|
|
|
if (busSalesOrderModel != null) { |
|
|
|
billFileVo.setCarName(busSalesOrderModel.getModelName()); |
|
|
|
billFileVo.setNum(String.valueOf(sameOpenTickSidList.size())); |
|
|
|
billFileVo.setPrice(busSalesOrderPrice.getSingleFinalPrice().toString()); |
|
|
|
} |
|
|
|
/* if (loanSolutions != null) { |
|
|
|
if (StringUtils.isNotBlank(loanSolutions.getMainVehicleAmount())) { |
|
|
|
billFileVo.setOpenPrice(loanSolutions.getMainVehicleAmount()); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
billFileVo.setOpenPrice(dto.getOneBillMoney()); |
|
|
|
billFileVo.setType(finBillVehicleDto.getBillTypeValue());//开票类型
|
|
|
|
List<String> vinNoString = new ArrayList<>(); |
|
|
|
List<FinBillTrailerDto> lllList = new ArrayList<>(); |
|
|
|
BillFileVo finalBillFileVo = billFileVo; |
|
|
|
sameOpenTickSidList.forEach(v -> { |
|
|
|
//车架号
|
|
|
|
BaseVehicle baseVehicle = baseMapper.selectVinNoByVinSid(v.getVehSid()); |
|
|
|
/* if(baseVehicle != null){ |
|
|
|
vinNoString.add(baseVehicle.getVinNo()); |
|
|
|
}*/ |
|
|
|
List<FinBillTrailerDto> finBillTrailers = dto.getFinBillTrailers(); |
|
|
|
finBillTrailers.removeAll(Collections.singleton(null)); |
|
|
|
finBillTrailers = finBillTrailers.stream().filter(vv -> vv.getVinNo().contains(v.getVinNo())).collect(Collectors.toList()); |
|
|
|
lllList.addAll(finBillTrailers); |
|
|
|
/* String vinNo = String.join(",",vinNoString); |
|
|
|
billFileVo.setVinNo(vinNo);*/ |
|
|
|
list.add(finalBillFileVo); |
|
|
|
}); |
|
|
|
|
|
|
|
//==========================主车结束
|
|
|
|
Map<String, Object> carNameMap = new HashMap<>(); |
|
|
|
if (!lllList.isEmpty()) { |
|
|
|
for (int i = 0; i < lllList.size(); i++) { |
|
|
|
List<String> trailerVinString = new ArrayList<>(); |
|
|
|
FinBillTrailerDto finBillTrailerDto = lllList.get(i); |
|
|
|
billFileVo = new BillFileVo(); |
|
|
|
BaseTrailer baseTrailer = baseMapper.selectByTrailerNo(finBillTrailerDto.getGcVinNo()); |
|
|
|
if (baseTrailer != null) { |
|
|
|
BaseTrailerModel baseTrailerModel = baseMapper.selectByModelSid(baseTrailer.getTrailerModelSid()); |
|
|
|
if (baseTrailerModel != null) { |
|
|
|
String carName = "外廓-" + Integer.parseInt(baseTrailerModel.getAppearanceSizeLong()) / 1000 + "米" + "\t" + baseTrailerModel.getTrailerTypeValue(); |
|
|
|
/* if (carNameMap.containsKey(carName)) { |
|
|
|
carNameMap.put(carName, Arrays.asList(carNameMap.get(carName).toString()).add(baseTrailer.getVinNo())); |
|
|
|
continue; |
|
|
|
} else { |
|
|
|
billFileVo.setType(busSalesOrder.getBillingType()); |
|
|
|
billFileVo.setCarName(carName); |
|
|
|
if (busSalesOrderModel != null) { |
|
|
|
billFileVo.setPrice(busSalesOrderPrice.getSingleFinalPrice().toString()); |
|
|
|
} |
|
|
|
trailerVinString.add(baseTrailer.getVinNo()); |
|
|
|
carNameMap.put(carName,trailerVinString); |
|
|
|
list.add(billFileVo); |
|
|
|
}*/ |
|
|
|
billFileVo.setCarName(carName); |
|
|
|
billFileVo.setVinNo(baseTrailer.getVinNo()); |
|
|
|
billFileVo.setOpenPrice(finBillTrailerDto.getOneBillMoney()); |
|
|
|
billFileVo.setPrice(busSalesOrderPrice.getSingleFinalPrice().toString()); |
|
|
|
billFileVo.setType(finBillTrailerDto.getBillTypeValue()); |
|
|
|
list.add(billFileVo); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/*if (!list.isEmpty()) { |
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
BillFileVo billFileVo1 = list.get(i); |
|
|
|
String carName = billFileVo1.getCarName(); |
|
|
|
if (carNameMap.containsKey(carName)) { |
|
|
|
List<String> ssList = castList(carNameMap.get(carName),String.class); |
|
|
|
String trailerVinNo = String.join(",",ssList); |
|
|
|
billFileVo1.setOpenPrice(Arrays.asList(carName.split("#")).get(1)); |
|
|
|
billFileVo1.setCarName(Arrays.asList(carName.split("#")).get(0)); |
|
|
|
billFileVo1.setVinNo(trailerVinNo); |
|
|
|
} |
|
|
|
} |
|
|
|
}*/ |
|
|
|
map.put("list", list); |
|
|
|
map.put("name", finBillVehicleDto.getOpenTickName()); |
|
|
|
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); |
|
|
|
FinCompanyInvoicing finCompanyInvoicing = finCompanyInvoicingService.fetchBySid(openTickSid); |
|
|
|
if (!"02".equals(finBillVehicleDto.getBillTypeKey()) && finCompanyInvoicing != null) {//机动车
|
|
|
|
if (finCompanyInvoicingDetailsVo != null) { |
|
|
|
filemap.put("invoiceName", finCompanyInvoicingDetailsVo.getName());//开票名称
|
|
|
|
filemap.put("customerName", finCompanyInvoicingDetailsVo.getName());//乙方
|
|
|
|
filemap.put("invoiceNo", finCompanyInvoicingDetailsVo.getTaxpayerNo());//纳税人识别号
|
|
|
|
filemap.put("idNo", finCompanyInvoicingDetailsVo.getTaxpayerNo());//乙方证件号码
|
|
|
|
filemap.put("adds", finCompanyInvoicingDetailsVo.getAddress());//户籍地址
|
|
|
|
} else { |
|
|
|
CrmCustomerTemp crmCustomerTemp = baseMapper.selectByCustomerSid(dto.getOpenTickSid()); |
|
|
|
if (crmCustomerTemp != null) { |
|
|
|
filemap.put("invoiceName", crmCustomerTemp.getName());//开票名称
|
|
|
|
filemap.put("customerName", crmCustomerTemp.getName());//乙方
|
|
|
|
filemap.put("invoiceNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
filemap.put("idNo", crmCustomerTemp.getIDNumber());//乙方证件号码
|
|
|
|
filemap.put("adds", crmCustomerTemp.getCertificateAddress());//户籍地址
|
|
|
|
//生成车辆登记合同
|
|
|
|
if (busSalesOrder != null) { |
|
|
|
carMap.put("Yf", busSalesOrder.getCustomerName()); |
|
|
|
carMap.put("invoiceName", finCompanyInvoicingDetailsVo.getName());//开票名称
|
|
|
|
} |
|
|
|
carMap.put("contractNo", "D" + map.get("contractNo")); |
|
|
|
if (StringUtils.isNotBlank(busSalesOrder.getPurchaseSystemSid())) { |
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingService.getDetailsByUseOrgAndSystem(busSalesOrder.getUseOrgSid(), busSalesOrder.getPurchaseSystemSid()); |
|
|
|
if (invoicingDetailsVoResultBean.getData() != null) { |
|
|
|
carMap.put("createOrgName", invoicingDetailsVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
carMap.put("date", date); |
|
|
|
List<CarContractListVo> carContractListVos = new ArrayList<>(); |
|
|
|
for (FinBillVehicleDto salesOrderVehicle : sameOpenTickSidList) { |
|
|
|
CarContractListVo carContractListVo = new CarContractListVo(); |
|
|
|
BaseVehicle baseVehicle = baseMapper.selectByVinSid(salesOrderVehicle.getVehSid()); |
|
|
|
carContractListVo.setBrand(baseVehicle.getModelName()); |
|
|
|
carContractListVo.setVinNo(baseVehicle.getVinNo()); |
|
|
|
carContractListVo.setEnginNo(baseVehicle.getEngineNo()); |
|
|
|
carContractListVos.add(carContractListVo); |
|
|
|
} |
|
|
|
carMap.put("carLists", carContractListVos); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if("1".equals(busSalesOrder.getPayTypeKey())){ |
|
|
|
if (loanSolutions != null) { |
|
|
|
if (!dto.getOneBillMoney().equals(loanSolutions.getMainVehicleAmount())) { |
|
|
|
String remarks = ""; |
|
|
|
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); |
|
|
|
filemap.put("year", year); |
|
|
|
filemap.put("month", month); |
|
|
|
filemap.put("day", day); |
|
|
|
if (finCompanyInvoicingDetailsVo != null) { |
|
|
|
filemap.put("invoiceName", finCompanyInvoicingDetailsVo.getName());//开票名称
|
|
|
|
filemap.put("customerName", finCompanyInvoicingDetailsVo.getName());//乙方
|
|
|
|
filemap.put("invoiceNo", finCompanyInvoicingDetailsVo.getTaxpayerNo());//纳税人识别号
|
|
|
|
filemap.put("idNo", finCompanyInvoicingDetailsVo.getTaxpayerNo());//乙方证件号码
|
|
|
|
filemap.put("adds", finCompanyInvoicingDetailsVo.getAddress());//户籍地址
|
|
|
|
} else { |
|
|
|
CrmCustomerTemp crmCustomerTemp = baseMapper.selectByCustomerSid(dto.getOpenTickSid()); |
|
|
|
if (crmCustomerTemp != null) { |
|
|
|
filemap.put("invoiceName", crmCustomerTemp.getName());//开票名称
|
|
|
|
filemap.put("customerName", crmCustomerTemp.getName());//乙方
|
|
|
|
filemap.put("invoiceNo", crmCustomerTemp.getIDNumber());//纳税人识别号
|
|
|
|
filemap.put("idNo", crmCustomerTemp.getIDNumber());//乙方证件号码
|
|
|
|
filemap.put("adds", crmCustomerTemp.getCertificateAddress());//户籍地址
|
|
|
|
} |
|
|
|
} |
|
|
|
filemap.put("invoiceType", dto.getOpenTickTypeValue());//开票类型
|
|
|
|
remarks = "数量" + finBillVehicles.size() + "台,单台成交价: 元。"; |
|
|
|
filemap.put("remarks", remarks); |
|
|
|
filemap.put("busSid", busSalesOrder.getSid()); |
|
|
|
ResultBean<Map<String, Object>> mapResultBean = commonContractFeign.getModelMap(filemap); |
|
|
|
checkMap = mapResultBean.getData(); |
|
|
|
//生成新车空白合同
|
|
|
|
checkMap.put("totalPrice", ""); |
|
|
|
checkMap.put("priceRemarks", ""); |
|
|
|
checkMap.put("depositTotal", ""); |
|
|
|
checkMap.put("createOrgName", ""); |
|
|
|
checkMap.put("payTypeKey", busSalesOrder.getPayTypeKey()); |
|
|
|
} |
|
|
|
filemap.put("invoiceType", dto.getOpenTickTypeValue());//开票类型
|
|
|
|
remarks = "数量" + finBillVehicles.size() + "台,单台成交价: 元。"; |
|
|
|
filemap.put("remarks", remarks); |
|
|
|
filemap.put("busSid", busSalesOrder.getSid()); |
|
|
|
ResultBean<Map<String, Object>> mapResultBean = commonContractFeign.getModelMap(filemap); |
|
|
|
checkMap = mapResultBean.getData(); |
|
|
|
//生成新车空白合同
|
|
|
|
checkMap.put("totalPrice", ""); |
|
|
|
checkMap.put("priceRemarks", ""); |
|
|
|
checkMap.put("depositTotal", ""); |
|
|
|
checkMap.put("createOrgName", ""); |
|
|
|
checkMap.put("payTypeKey", busSalesOrder.getPayTypeKey()); |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
@ -927,6 +1287,19 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
System.out.println("-========" + docPdfComponent.getUploadTemplateUrl() + typeName); |
|
|
|
fileUrl = typeName; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if(StringUtils.isNotBlank(loanSolutions.getTypeKey())){//非担保、生成开票申请书和车辆登记合同
|
|
|
|
/*LoanNoGuaranteeCreditReviewDetailsVo loanNoGuaranteeCreditReviewDetailsVo = loanNoGuaranteeCreditReviewFeign.selByBorrSid(busSalesOrderVehicle.getBorrowerSid()).getData(); |
|
|
|
record.setInvoiceTypeKey(busSalesOrder.getBillingTypeKey()); |
|
|
|
record.setInvoiceType(busSalesOrder.getBillingType()); |
|
|
|
if ("1".equals(loanNoGuaranteeCreditReviewDetailsVo.getType())){ |
|
|
|
record.setInvoiceName(loanNoGuaranteeCreditReviewDetailsVo.getBorrowerName()); |
|
|
|
}else if ("2".equals(loanNoGuaranteeCreditReviewDetailsVo.getType())){ |
|
|
|
record.setInvoiceName(loanNoGuaranteeCreditReviewDetailsVo.getAffiliatedCompany()); |
|
|
|
}*/ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(fileUrl)){ |
|
|
|
FinBillApplication finBillApplication = fetchBySid(dto.getSid()); |
|
|
@ -5141,8 +5514,6 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
oneBillMoney = new BigDecimal(solutionsDetailsVo.getMainVehicleAmount()); |
|
|
|
billApplicationIInfoVoss.setInvoiceMoney(oneBillMoney.toString()); |
|
|
|
billApplicationIInfoVoss.setInvoiceTotal(oneBillMoney.multiply(new BigDecimal(vins.size())).toString()); |
|
|
|
billApplicationIInfoVoss.setOpenTickTypeKey(busSalesOrder.getBillingTypeKey()); |
|
|
|
billApplicationIInfoVoss.setOpenTickTypeValue(busSalesOrder.getBillingType()); |
|
|
|
billApplicationIInfoVoss.setNoEditInvoiceTypeAndName(true); |
|
|
|
billApplicationIInfoVoss.setNoEditInvoiceMoney(true); |
|
|
|
}else { |
|
|
@ -5194,24 +5565,70 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
//贷款主车初始化开票名称、开票类型
|
|
|
|
BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleFeign.selectByNoAndVinSid(contractId, vins.get(i)).getData(); |
|
|
|
if ("2".equals(busSalesOrder.getPayTypeKey())){ |
|
|
|
if ("01".equals(busSalesOrder.getFinancePlan())){//担保
|
|
|
|
if (StringUtils.isBlank(solutionsDetailsVo.getTypeKey())){//担保
|
|
|
|
String jfkcSid = loanHomevisitInvestigateFeign.selSaleOrderSidAndBorrSid(busSalesOrder.getSid(), busSalesOrderVehicle.getBorrowerSid()).getData(); |
|
|
|
LoanHomevisitInvestigateCustomerDetailsVo loanHomevisitInvestigateCustomerDetailsVo = loanHomevisitInvestigateCustomerFeign.selectByMainSid(jfkcSid).getData(); |
|
|
|
BusSalesOrderBorrowerDetailsVo busSalesOrderBorrowerDetailsVo = busSalesOrderBorrowerFeign.fetchDetailsBySid(busSalesOrderVehicle.getBorrowerSid()).getData(); |
|
|
|
CrmCustomerTempVo crmCustomerTempVo = crmCustomerTempFeign.fetchSid(busSalesOrderBorrowerDetailsVo.getCustomSid()).getData(); |
|
|
|
vinListVos1.setInvoiceTypeKey(busSalesOrder.getBillingTypeKey()); |
|
|
|
vinListVos1.setInvoiceType(busSalesOrder.getBillingType()); |
|
|
|
if ("1".equals(loanHomevisitInvestigateCustomerDetailsVo.getVehRegis())){ |
|
|
|
vinListVos1.setInvoiceName(loanHomevisitInvestigateCustomerDetailsVo.getBorrowerName()); |
|
|
|
vinListVos1.setOpenTickSid(busSalesOrderBorrowerDetailsVo.getCustomSid()); |
|
|
|
vinListVos1.setInvoiceInfo(crmCustomerTempVo.getIDNumber()); |
|
|
|
}else if ("2".equals(loanHomevisitInvestigateCustomerDetailsVo.getVehRegis())){ |
|
|
|
FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingService.selectInvoingByTaxpayerNo(loanHomevisitInvestigateCustomerDetailsVo.getAccCompRegistNum()).getData(); |
|
|
|
vinListVos1.setInvoiceName(loanHomevisitInvestigateCustomerDetailsVo.getAccCompName()); |
|
|
|
vinListVos1.setOpenTickSid(finCompanyInvoicingDetailsVo.getSid()); |
|
|
|
String openTickRemarks = ""; |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(openTickRemarks + finCompanyInvoicingDetailsVo.getTaxpayerNo())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getTaxpayerNo() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getAddress())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getAddress() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getPhone())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getPhone() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getBankName())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getBankName() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getBankAccount())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getBankAccount() + ";"; |
|
|
|
} |
|
|
|
vinListVos1.setInvoiceInfo(openTickRemarks); |
|
|
|
} |
|
|
|
}else if ("02".equals(busSalesOrder.getFinancePlan())){//非担保
|
|
|
|
}else if ("01".equals(solutionsDetailsVo.getTypeKey())){//非担保
|
|
|
|
LoanNoGuaranteeCreditReviewDetailsVo loanNoGuaranteeCreditReviewDetailsVo = loanNoGuaranteeCreditReviewFeign.selByBorrSid(busSalesOrderVehicle.getBorrowerSid()).getData(); |
|
|
|
BusSalesOrderBorrowerDetailsVo busSalesOrderBorrowerDetailsVo = busSalesOrderBorrowerFeign.fetchDetailsBySid(busSalesOrderVehicle.getBorrowerSid()).getData(); |
|
|
|
CrmCustomerTempVo crmCustomerTempVo = crmCustomerTempFeign.fetchSid(busSalesOrderBorrowerDetailsVo.getCustomSid()).getData(); |
|
|
|
vinListVos1.setInvoiceTypeKey(busSalesOrder.getBillingTypeKey()); |
|
|
|
vinListVos1.setInvoiceType(busSalesOrder.getBillingType()); |
|
|
|
if ("1".equals(loanNoGuaranteeCreditReviewDetailsVo.getType())){ |
|
|
|
vinListVos1.setInvoiceName(loanNoGuaranteeCreditReviewDetailsVo.getBorrowerName()); |
|
|
|
vinListVos1.setOpenTickSid(busSalesOrderBorrowerDetailsVo.getCustomSid()); |
|
|
|
vinListVos1.setInvoiceInfo(crmCustomerTempVo.getIDNumber()); |
|
|
|
}else if ("2".equals(loanNoGuaranteeCreditReviewDetailsVo.getType())){ |
|
|
|
FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingService.selectInvoingByName(loanNoGuaranteeCreditReviewDetailsVo.getAffiliatedCompany()).getData(); |
|
|
|
vinListVos1.setInvoiceName(loanNoGuaranteeCreditReviewDetailsVo.getAffiliatedCompany()); |
|
|
|
vinListVos1.setOpenTickSid(finCompanyInvoicingDetailsVo.getSid()); |
|
|
|
String openTickRemarks = ""; |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(openTickRemarks + finCompanyInvoicingDetailsVo.getTaxpayerNo())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getTaxpayerNo() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getAddress())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getAddress() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getPhone())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getPhone() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getBankName())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getBankName() + ";"; |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getBankAccount())) { |
|
|
|
openTickRemarks = openTickRemarks + finCompanyInvoicingDetailsVo.getBankAccount() + ";"; |
|
|
|
} |
|
|
|
vinListVos1.setInvoiceInfo(openTickRemarks); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -5228,8 +5645,8 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
return rb.success().setData(finBillApplicationDetailsVo); |
|
|
|
} |
|
|
|
|
|
|
|
public void createContractNo(FinBillApplicationDto dto){ |
|
|
|
/*try { |
|
|
|
public String createContractNo(FinBillApplicationDto dto){ |
|
|
|
/* try { |
|
|
|
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
|
|
|
.setNameFormat("demo-pool-%d").build(); |
|
|
|
ExecutorService pool = new ThreadPoolExecutor(1, 2, |
|
|
@ -5237,10 +5654,34 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); |
|
|
|
Future future1 = pool.submit(() -> { |
|
|
|
String fileUrl = getFileUrl(dto); |
|
|
|
return fileUrl; |
|
|
|
}); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
log.error("生成文件失败:==========================" + e.getMessage()); |
|
|
|
}*/ |
|
|
|
// String fileUrl = getFileUrlNew(dto);
|
|
|
|
String fileUrl = ""; |
|
|
|
return fileUrl; |
|
|
|
} |
|
|
|
|
|
|
|
public List<String> castList(Object obj, Class<String> clazz){ |
|
|
|
List<String> result = new ArrayList<>(); |
|
|
|
if(obj instanceof List<?>){ |
|
|
|
for (Object o : (List<?>) obj){ |
|
|
|
result.add(clazz.cast(o)); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<DownloanVoUrl> saveInvoicedApplyInfoPdf(FinBillApplicationDto dto) { |
|
|
|
ResultBean<DownloanVoUrl> rb = ResultBean.fireFail(); |
|
|
|
DownloanVoUrl downloanVoUrl = new DownloanVoUrl(); |
|
|
|
ResultBean<String> resultBean = saveOrUpdateDto(dto); |
|
|
|
String contractNo = createContractNo(dto); |
|
|
|
downloanVoUrl.setAllDownloadUrl(docPdfComponent.getPrefixTemplateUrl()+contractNo); |
|
|
|
return rb.success().setData(downloanVoUrl); |
|
|
|
} |
|
|
|
} |