|
@@ -176,56 +176,9 @@ public class VideoDueDiligenceServiceImpl extends ServiceImpl<VideoDueDiligenceM
|
|
|
|
|
|
@Override
|
|
|
public VideoDueDiligence getVideoDueDiligence(Long supplierId) {
|
|
|
- VideoDueDiligence videoDueDiligence = lambdaQuery().eq(VideoDueDiligence::getcSupplierInfoId, supplierId).one();
|
|
|
- if (videoDueDiligence == null) {
|
|
|
- videoDueDiligence = new VideoDueDiligence();
|
|
|
- videoDueDiligence.setcSupplierInfoId(supplierId);
|
|
|
- }
|
|
|
+ SupplierApprovalSecond supplierApprovalSecond = supplierApprovalSecondService.lambdaQuery().eq(SupplierApprovalSecond::getcSupplierInfoId, supplierId).orderByDesc(SupplierApprovalSecond::getGmtCreate).list().get(0);
|
|
|
SupplierInfo supplierInfo = supplierInfoService.get(supplierId);
|
|
|
Enterprise enterprise = enterpriseService.getById(supplierInfo.getcEnterpriseId());
|
|
|
- if (supplierInfo.getGuaranteeEnterpriseId() != null) {
|
|
|
- enterprise = enterpriseService.getById(supplierInfo.getGuaranteeEnterpriseId());
|
|
|
- }
|
|
|
- videoDueDiligence.setEnterpriseName(enterprise.getCorporateName());
|
|
|
- videoDueDiligence.setSocialCreditCode(enterprise.getSocialCreditCode());
|
|
|
- // 股东信息 工商登记
|
|
|
- String pubStockUrl = pubStock + "?socialCreditCode=" + enterprise.getSocialCreditCode() + "&comprehensiveRiskInvestigationId=" + enterprise.getcComprehensiveRiskInvestigationId();
|
|
|
- ResponseJson forObject = restTemplate.getForObject(pubStockUrl, ResponseJson.class);
|
|
|
- JSONObject jsonObject = new JSONObject(forObject.getData());
|
|
|
- List<CRegStock> list = jsonObject.getBeanList("list", CRegStock.class);
|
|
|
- videoDueDiligence.setRegStocks(list);
|
|
|
- videoDueDiligence.setLegalRepresentative(enterprise.getLegalRepresentative());
|
|
|
- CreditInvestigationInfo creditInvestigationInfo = creditInvestigationInfoService.lambdaQuery()
|
|
|
- .eq(CreditInvestigationInfo::getcEnterpriseId, enterprise.getId())
|
|
|
- .eq(CreditInvestigationInfo::getName, enterprise.getLegalRepresentative())
|
|
|
- .eq(CreditInvestigationInfo::getType, "c_credit_investigation_info_type_1").one();
|
|
|
- int bornYear = Integer.valueOf(creditInvestigationInfo.getSocialCreditCode().substring(6, 10));
|
|
|
- int bornMon = Integer.valueOf(creditInvestigationInfo.getSocialCreditCode().substring(10, 12));
|
|
|
- int bornDay = Integer.valueOf(creditInvestigationInfo.getSocialCreditCode().substring(12, 14));
|
|
|
- Date date = new Date(bornYear-1900, bornMon, bornDay);
|
|
|
- int age = cn.hutool.core.date.DateUtil.age(date,new Date());
|
|
|
- videoDueDiligence.setAge(age);
|
|
|
- SupplierApprovalSecond supplierApprovalSecond = supplierApprovalSecondService.lambdaQuery().eq(SupplierApprovalSecond::getcSupplierInfoId, supplierId).orderByDesc(SupplierApprovalSecond::getGmtCreate).list().get(0);
|
|
|
- videoDueDiligence.setShareholderStandardScore(BigDecimal.ONE);
|
|
|
- videoDueDiligence.setShareholderMeasurementScore(supplierApprovalSecond.getShareholderScore());
|
|
|
- videoDueDiligence.setShareholderQuestion("法人是否为代持?股东是否为亲属?公司实控人是?");
|
|
|
- videoDueDiligence.setStartDate(enterprise.getStartSate());
|
|
|
- long year = DateUtil.betweenYear(enterprise.getStartSate(), new Date(), false);
|
|
|
- videoDueDiligence.setEstablishmentPeriod(year);
|
|
|
- videoDueDiligence.setLifeStandardScore(new BigDecimal("1.5"));
|
|
|
- videoDueDiligence.setLifeMeasurementScore(supplierApprovalSecond.getEstablishmentPeriodScore());
|
|
|
- videoDueDiligence.setLifeQuestion("实际从事该行业的年份?是否存在其他抬头公司进行业务经营?");
|
|
|
- videoDueDiligence.setRegisteredCapital(enterprise.getRegisteredCapital());
|
|
|
- videoDueDiligence.setCapitalStandardScore(new BigDecimal("1.5"));
|
|
|
- videoDueDiligence.setCapitalMeasurementScore(supplierApprovalSecond.getRegisteredCapitalScore());
|
|
|
- videoDueDiligence.setCapitalQuestion("公司实际运营资金多少?投入资金多少?");
|
|
|
- videoDueDiligence.setAddress(enterprise.getAddress());
|
|
|
- videoDueDiligence.setAddressStandardScore(new BigDecimal("1"));
|
|
|
- videoDueDiligence.setAddressMeasurementScore(supplierApprovalSecond.getRegisteredAddressScore());
|
|
|
- videoDueDiligence.setAddressQuestion("注册地址与实际经营地址是否不一致?");
|
|
|
- videoDueDiligence.setBusinessAddress(enterprise.getBusinessAddress());
|
|
|
- videoDueDiligence.setBusinessAddressQuestion("是否存在该项资料?是否可以补充上传?");
|
|
|
- //查询文件
|
|
|
CSupplierInfoHistory supplierInfoHistory = supplierInfoHistoryService.getById(supplierApprovalSecond.getcSupplierInfoHistoryId());
|
|
|
CEnterpriseHistory enterpriseHistory;
|
|
|
if (supplierInfoHistory.getGuaranteeEnterpriseHistoryId() != null) {
|
|
@@ -233,47 +186,116 @@ public class VideoDueDiligenceServiceImpl extends ServiceImpl<VideoDueDiligenceM
|
|
|
} else {
|
|
|
enterpriseHistory = enterpriseHistoryService.getById(supplierInfoHistory.getcEnterpriseHistoryId());
|
|
|
}
|
|
|
- List<FileStorageDO> rentalFiles = fileService.findByBusinessId(enterpriseHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_RENTAL_CONTRACT_HISTORY.getCode());
|
|
|
- List<FileStorageDO> waterFiles = fileService.findByBusinessId(enterpriseHistory.getId(), FileModuleDict.ChildEnum.WATER_ELECTRIICITY_FEES_HISTORY.getCode());
|
|
|
- List<FileStorageDO> officeFiles = fileService.findByBusinessId(enterpriseHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_OFFICE_ENVIRONMENT_HISTORY.getCode());
|
|
|
- videoDueDiligence.setRentalFiles(rentalFiles);
|
|
|
- videoDueDiligence.setWaterFiles(waterFiles);
|
|
|
- videoDueDiligence.setOfficeFiles(officeFiles);
|
|
|
- videoDueDiligence.setBusinessAddressStandardScore(new BigDecimal("3"));
|
|
|
- videoDueDiligence.setBusinessAddressMeasurementScore(supplierApprovalSecond.getBusinessAddressScore());
|
|
|
- //所属行业
|
|
|
- String getIndustryUrl = getIndustry + "?comprehensiveRiskInvestigationId=" + enterprise.getcComprehensiveRiskInvestigationId();
|
|
|
- String industry = restTemplate.getForObject(getIndustryUrl, String.class);
|
|
|
- videoDueDiligence.setIndustry(industry);
|
|
|
- //经营范围
|
|
|
- videoDueDiligence.setBusinessScope(supplierApprovalSecond.getScope());
|
|
|
- videoDueDiligence.setBusinessScopeStandardScore(new BigDecimal("1"));
|
|
|
- videoDueDiligence.setBusinessScopeMeasurementScore(supplierApprovalSecond.getBusinessScopeScore());
|
|
|
- //近一年股东或法人变更*次
|
|
|
- String getChangesUrl = getChanges + "?comprehensiveRiskInvestigationId=" + enterprise.getcComprehensiveRiskInvestigationId();
|
|
|
- Integer changes = restTemplate.getForObject(getChangesUrl, Integer.class);
|
|
|
- videoDueDiligence.setBasicChangeSize(changes);
|
|
|
- videoDueDiligence.setChangeStandardScore(new BigDecimal("1"));
|
|
|
- videoDueDiligence.setChangeMeasurementScore(supplierApprovalSecond.getBasicChangeScore());
|
|
|
- //关联企业
|
|
|
- List<CAssociatedEnterpriseInfoHistory> enterpriseInfoHistoryList = associatedEnterpriseInfoHistoryService.lambdaQuery().eq(CAssociatedEnterpriseInfoHistory::getcEnterpriseHistoryId, enterpriseHistory.getId()).list();
|
|
|
- videoDueDiligence.setEnterpriseInfoHistoryList(enterpriseInfoHistoryList);
|
|
|
- videoDueDiligence.setAssociatedEnterpriseQuestion("是否还有其他业务关联公司?关联公司业务分别是?");
|
|
|
- //人员信息
|
|
|
- List<CreditSituation> creditSituations = creditSituationService.lambdaQuery().eq(CreditSituation::getcSupplierInfoId, supplierId).list();
|
|
|
- creditSituations = creditSituations.stream().filter(r -> {
|
|
|
- CCreditInvestigationInfoHistory creditInvestigationInfoHistory = creditInvestigationInfoHistoryService.getById(r.getcCreditInvestigationInfoHistoryId());
|
|
|
- CEnterpriseHistory byId = enterpriseHistoryService.getById(creditInvestigationInfoHistory.getcEnterpriseHistoryId());
|
|
|
- CEnterpriseHistory serviceById = enterpriseHistoryService.getById(supplierApprovalSecond.getcEnterpriseHistoryId());
|
|
|
- return byId.getCorporateName().equals(serviceById.getCorporateName());
|
|
|
- }).collect(Collectors.toList());
|
|
|
- for (CreditSituation creditSituation : creditSituations) {
|
|
|
- CCreditInvestigationInfoHistory creditInvestigationInfoHistory = creditInvestigationInfoHistoryService.getById(creditSituation.getcCreditInvestigationInfoHistoryId());
|
|
|
- String name = dictionaryService.getByCode(creditInvestigationInfoHistory.getType()).getName();
|
|
|
- creditInvestigationInfoHistory.setTypeStr(name);
|
|
|
+ if (supplierInfo.getGuaranteeEnterpriseId() != null) {
|
|
|
+ enterprise = enterpriseService.getById(supplierInfo.getGuaranteeEnterpriseId());
|
|
|
+ }
|
|
|
+ VideoDueDiligence videoDueDiligence = lambdaQuery().eq(VideoDueDiligence::getcSupplierInfoId, supplierId).one();
|
|
|
+ if (videoDueDiligence == null) {
|
|
|
+ videoDueDiligence = new VideoDueDiligence();
|
|
|
+ videoDueDiligence.setcSupplierInfoId(supplierId);
|
|
|
+ videoDueDiligence.setShareholderQuestion("法人是否为代持?股东是否为亲属?公司实控人是?");
|
|
|
+ videoDueDiligence.setLifeQuestion("实际从事该行业的年份?是否存在其他抬头公司进行业务经营?");
|
|
|
+ videoDueDiligence.setCapitalQuestion("公司实际运营资金多少?投入资金多少?");
|
|
|
+ videoDueDiligence.setAddressQuestion("注册地址与实际经营地址是否不一致?");
|
|
|
+ videoDueDiligence.setAssociatedEnterpriseQuestion("是否还有其他业务关联公司?关联公司业务分别是?");
|
|
|
+ videoDueDiligence.setNegativeInformationQuestion(" 历史失信被执行情况详情?判决书;历史被执行情况详情?判决书;限制高消费情况详情;行政处罚情况说明;涉诉情况说明");
|
|
|
+ videoDueDiligence.setBusinessAddressQuestion("是否存在该项资料?是否可以补充上传?");
|
|
|
+ videoDueDiligence.setEnterpriseName(enterprise.getCorporateName());
|
|
|
+ videoDueDiligence.setSocialCreditCode(enterprise.getSocialCreditCode());
|
|
|
+ videoDueDiligence.setLegalRepresentative(enterprise.getLegalRepresentative());
|
|
|
+ CreditInvestigationInfo creditInvestigationInfo = creditInvestigationInfoService.lambdaQuery()
|
|
|
+ .eq(CreditInvestigationInfo::getcEnterpriseId, enterprise.getId())
|
|
|
+ .eq(CreditInvestigationInfo::getName, enterprise.getLegalRepresentative())
|
|
|
+ .eq(CreditInvestigationInfo::getType, "c_credit_investigation_info_type_1").one();
|
|
|
+ int bornYear = Integer.valueOf(creditInvestigationInfo.getSocialCreditCode().substring(6, 10));
|
|
|
+ int bornMon = Integer.valueOf(creditInvestigationInfo.getSocialCreditCode().substring(10, 12));
|
|
|
+ int bornDay = Integer.valueOf(creditInvestigationInfo.getSocialCreditCode().substring(12, 14));
|
|
|
+ Date date = new Date(bornYear-1900, bornMon, bornDay);
|
|
|
+ int age = cn.hutool.core.date.DateUtil.age(date,new Date());
|
|
|
+ videoDueDiligence.setAge(age);
|
|
|
+ videoDueDiligence.setShareholderStandardScore(BigDecimal.ONE);
|
|
|
+ videoDueDiligence.setShareholderMeasurementScore(supplierApprovalSecond.getShareholderScore());
|
|
|
+ videoDueDiligence.setStartDate(enterprise.getStartSate());
|
|
|
+ long year = DateUtil.betweenYear(enterprise.getStartSate(), new Date(), false);
|
|
|
+ videoDueDiligence.setEstablishmentPeriod(year);
|
|
|
+ videoDueDiligence.setLifeStandardScore(new BigDecimal("1.5"));
|
|
|
+ videoDueDiligence.setLifeMeasurementScore(supplierApprovalSecond.getEstablishmentPeriodScore());
|
|
|
+ videoDueDiligence.setRegisteredCapital(enterprise.getRegisteredCapital());
|
|
|
+ videoDueDiligence.setCapitalStandardScore(new BigDecimal("1.5"));
|
|
|
+ videoDueDiligence.setCapitalMeasurementScore(supplierApprovalSecond.getRegisteredCapitalScore());
|
|
|
+ videoDueDiligence.setAddress(enterprise.getAddress());
|
|
|
+ videoDueDiligence.setAddressStandardScore(new BigDecimal("1"));
|
|
|
+ videoDueDiligence.setAddressMeasurementScore(supplierApprovalSecond.getRegisteredAddressScore());
|
|
|
+ videoDueDiligence.setBusinessAddress(enterprise.getBusinessAddress());
|
|
|
+ videoDueDiligence.setBusinessAddressStandardScore(new BigDecimal("3"));
|
|
|
+ videoDueDiligence.setBusinessAddressMeasurementScore(supplierApprovalSecond.getBusinessAddressScore());
|
|
|
+ //所属行业
|
|
|
+ String getIndustryUrl = getIndustry + "?comprehensiveRiskInvestigationId=" + enterprise.getcComprehensiveRiskInvestigationId();
|
|
|
+ String industry = restTemplate.getForObject(getIndustryUrl, String.class);
|
|
|
+ videoDueDiligence.setIndustry(industry);
|
|
|
+ //经营范围
|
|
|
+ videoDueDiligence.setBusinessScope(supplierApprovalSecond.getScope());
|
|
|
+ videoDueDiligence.setBusinessScopeStandardScore(new BigDecimal("1"));
|
|
|
+ videoDueDiligence.setBusinessScopeMeasurementScore(supplierApprovalSecond.getBusinessScopeScore());
|
|
|
+ //近一年股东或法人变更*次
|
|
|
+ String getChangesUrl = getChanges + "?comprehensiveRiskInvestigationId=" + enterprise.getcComprehensiveRiskInvestigationId();
|
|
|
+ Integer changes = restTemplate.getForObject(getChangesUrl, Integer.class);
|
|
|
+ videoDueDiligence.setBasicChangeSize(changes);
|
|
|
+ videoDueDiligence.setChangeStandardScore(new BigDecimal("1"));
|
|
|
+ videoDueDiligence.setChangeMeasurementScore(supplierApprovalSecond.getBasicChangeScore());
|
|
|
+ //关联企业
|
|
|
+ List<CAssociatedEnterpriseInfoHistory> enterpriseInfoHistoryList = associatedEnterpriseInfoHistoryService.lambdaQuery().eq(CAssociatedEnterpriseInfoHistory::getcEnterpriseHistoryId, enterpriseHistory.getId()).list();
|
|
|
+ videoDueDiligence.setEnterpriseInfoHistoryList(enterpriseInfoHistoryList);
|
|
|
+ //人员信息
|
|
|
+ List<CreditSituation> creditSituations = creditSituationService.lambdaQuery().eq(CreditSituation::getcSupplierInfoId, supplierId).list();
|
|
|
+ creditSituations = creditSituations.stream().filter(r -> {
|
|
|
+ CCreditInvestigationInfoHistory creditInvestigationInfoHistory = creditInvestigationInfoHistoryService.getById(r.getcCreditInvestigationInfoHistoryId());
|
|
|
+ CEnterpriseHistory byId = enterpriseHistoryService.getById(creditInvestigationInfoHistory.getcEnterpriseHistoryId());
|
|
|
+ CEnterpriseHistory serviceById = enterpriseHistoryService.getById(supplierApprovalSecond.getcEnterpriseHistoryId());
|
|
|
+ return byId.getCorporateName().equals(serviceById.getCorporateName());
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ for (CreditSituation creditSituation : creditSituations) {
|
|
|
+ CCreditInvestigationInfoHistory creditInvestigationInfoHistory = creditInvestigationInfoHistoryService.getById(creditSituation.getcCreditInvestigationInfoHistoryId());
|
|
|
+ String name = dictionaryService.getByCode(creditInvestigationInfoHistory.getType()).getName();
|
|
|
+ creditInvestigationInfoHistory.setTypeStr(name);
|
|
|
+ //todo 填充征信报告
|
|
|
+ CreditInfo creditInfo = creditService.lambdaQuery().eq(CreditInfo::getCardNo, creditInvestigationInfoHistory.getSocialCreditCode()).one();
|
|
|
+ List<FileStorage> fileList = new ArrayList<>();
|
|
|
+ if (creditInfo != null) {
|
|
|
+ List<CreditDetail> creditDetails = creditDetailService.lambdaQuery()
|
|
|
+ .eq(CreditDetail::getCreditId,creditInfo.getId())
|
|
|
+ .isNotNull(CreditDetail::getCreditAddress)
|
|
|
+ .orderByDesc(CreditDetail::getGmtCreate).list();
|
|
|
+ if (CollectionUtil.isNotEmpty(creditDetails)) {
|
|
|
+ CreditDetail creditDetail = creditDetails.get(0);
|
|
|
+ if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
|
|
|
+ FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
|
|
|
+ fileList.add(creditDetailFiles);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ creditInvestigationInfoHistory.setCreditDetailFiles(fileList);
|
|
|
+ List<FileStorageDO> cardFiles = fileService.findByBusinessId(creditInvestigationInfoHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_IDCARD_FILES_HISTORY.getCode());
|
|
|
+ creditInvestigationInfoHistory.setCardFiles(cardFiles);
|
|
|
+ creditSituation.setQuestion("逾期详情?提供还款记录说明;逾期详情?提供还款记录说明;查询的原因是?小贷查询次数多少?查询后借到多少金额款项?什么性质的担保?为谁担保?历史失信被执行情况详情?判决书;历史被执行情况详情?判决书;限制高消费情况详情;详细解释诉讼案件以及提供判决书");
|
|
|
+ creditSituation.setCreditInvestigationInfoHistory(creditInvestigationInfoHistory);
|
|
|
+ }
|
|
|
+ videoDueDiligence.setCreditSituations(creditSituations);
|
|
|
+ //企业信誉
|
|
|
+ CorporateGoodwill corporateGoodwill = corporateGoodwillService.lambdaQuery()
|
|
|
+ .eq(CorporateGoodwill::getcSupplierInfoId, supplierId).eq(CorporateGoodwill::getcEnterpriseId, enterprise.getId()).one();
|
|
|
+ corporateGoodwill.setShiXin(corporateGoodwill.getShiXin() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setHistoryShiXin(corporateGoodwill.getHistoryShiXin() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setZhiXing(corporateGoodwill.getZhiXing() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setHistoryZhiXing(corporateGoodwill.getHistoryZhiXing() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setGaoXiao(corporateGoodwill.getGaoXiao() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setHistoryGaoXiao(corporateGoodwill.getHistoryGaoXiao() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setDocumnetBeiGao(corporateGoodwill.getDocumnetBeiGao() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setDocumnetYuanGao(corporateGoodwill.getDocumnetYuanGao() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setDocumentFinance(corporateGoodwill.getDocumentFinance() == 0 ? 0 : 1);
|
|
|
//todo 填充征信报告
|
|
|
- CreditInfo creditInfo = creditService.lambdaQuery().eq(CreditInfo::getCardNo, creditInvestigationInfoHistory.getSocialCreditCode()).one();
|
|
|
List<FileStorage> fileList = new ArrayList<>();
|
|
|
+ CreditInfo creditInfo = creditService.lambdaQuery().eq(CreditInfo::getCardNo, enterprise.getSocialCreditCode()).one();
|
|
|
if (creditInfo != null) {
|
|
|
List<CreditDetail> creditDetails = creditDetailService.lambdaQuery()
|
|
|
.eq(CreditDetail::getCreditId,creditInfo.getId())
|
|
@@ -287,45 +309,173 @@ public class VideoDueDiligenceServiceImpl extends ServiceImpl<VideoDueDiligenceM
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- creditInvestigationInfoHistory.setCreditDetailFiles(fileList);
|
|
|
- List<FileStorageDO> cardFiles = fileService.findByBusinessId(creditInvestigationInfoHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_IDCARD_FILES_HISTORY.getCode());
|
|
|
- creditInvestigationInfoHistory.setCardFiles(cardFiles);
|
|
|
- creditSituation.setQuestion("逾期详情?提供还款记录说明;逾期详情?提供还款记录说明;查询的原因是?小贷查询次数多少?查询后借到多少金额款项?什么性质的担保?为谁担保?历史失信被执行情况详情?判决书;历史被执行情况详情?判决书;限制高消费情况详情;详细解释诉讼案件以及提供判决书");
|
|
|
- creditSituation.setCreditInvestigationInfoHistory(creditInvestigationInfoHistory);
|
|
|
- }
|
|
|
- videoDueDiligence.setCreditSituations(creditSituations);
|
|
|
- //企业信誉
|
|
|
- CorporateGoodwill corporateGoodwill = corporateGoodwillService.lambdaQuery()
|
|
|
- .eq(CorporateGoodwill::getcSupplierInfoId, supplierId).eq(CorporateGoodwill::getcEnterpriseId, enterprise.getId()).one();
|
|
|
- corporateGoodwill.setShiXin(corporateGoodwill.getShiXin() == 0 ? 0 : 1);
|
|
|
- corporateGoodwill.setHistoryShiXin(corporateGoodwill.getHistoryShiXin() == 0 ? 0 : 1);
|
|
|
- corporateGoodwill.setZhiXing(corporateGoodwill.getZhiXing() == 0 ? 0 : 1);
|
|
|
- corporateGoodwill.setHistoryZhiXing(corporateGoodwill.getHistoryZhiXing() == 0 ? 0 : 1);
|
|
|
- corporateGoodwill.setGaoXiao(corporateGoodwill.getGaoXiao() == 0 ? 0 : 1);
|
|
|
- corporateGoodwill.setHistoryGaoXiao(corporateGoodwill.getHistoryGaoXiao() == 0 ? 0 : 1);
|
|
|
- corporateGoodwill.setDocumnetBeiGao(corporateGoodwill.getDocumnetBeiGao() == 0 ? 0 : 1);
|
|
|
- corporateGoodwill.setDocumnetYuanGao(corporateGoodwill.getDocumnetYuanGao() == 0 ? 0 : 1);
|
|
|
- corporateGoodwill.setDocumentFinance(corporateGoodwill.getDocumentFinance() == 0 ? 0 : 1);
|
|
|
- //todo 填充征信报告
|
|
|
- List<FileStorage> fileList = new ArrayList<>();
|
|
|
- CreditInfo creditInfo = creditService.lambdaQuery().eq(CreditInfo::getCardNo, enterprise.getSocialCreditCode()).one();
|
|
|
- if (creditInfo != null) {
|
|
|
- List<CreditDetail> creditDetails = creditDetailService.lambdaQuery()
|
|
|
- .eq(CreditDetail::getCreditId,creditInfo.getId())
|
|
|
- .isNotNull(CreditDetail::getCreditAddress)
|
|
|
- .orderByDesc(CreditDetail::getGmtCreate).list();
|
|
|
- if (CollectionUtil.isNotEmpty(creditDetails)) {
|
|
|
- CreditDetail creditDetail = creditDetails.get(0);
|
|
|
- if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
|
|
|
- FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
|
|
|
- fileList.add(creditDetailFiles);
|
|
|
+ corporateGoodwill.setCreditDetailFiles(fileList);
|
|
|
+ corporateGoodwill.setQuestion("有无其他融资渠道?融资缺口有多少?");
|
|
|
+ videoDueDiligence.setCorporateGoodwill(corporateGoodwill);
|
|
|
+ //企业财务
|
|
|
+ VideoDueDiligenceFinance videoDueDiligenceFinance = new VideoDueDiligenceFinance();
|
|
|
+ videoDueDiligenceFinance.setQuestion("是否有企业内账?企业真实年营业收入有多少?业务收入占比情况如何?毛利率约多少?对客户是如何筛选?");
|
|
|
+ videoDueDiligence.setVideoDueDiligenceFinance(videoDueDiligenceFinance);
|
|
|
+ //企业经营情况
|
|
|
+ VideoDueDiligenceOperations videoDueDiligenceOperations = new VideoDueDiligenceOperations();
|
|
|
+ videoDueDiligenceOperations.setQuestion("主营业务是?有无其他业务?合作的客户或者项目有哪些?年供应量大概多少?参与过项目有哪些?合作过的下游国企有哪些?有没有长期合作企业?本年度的项目有哪些?主要销售市场是?其他地区有没有业务如何入行?关系经验有哪些?有没有计划拓展的新领域?销售计划是什么?预计本年度营收收入、销售量多少?\n" +
|
|
|
+ "1.上游情况一般是从钢厂采购?供应商有没有区别?是钢厂的代理?上游合作商有哪些?如何选用供应商?还会采购其他货物吗?\n" + "2.下游情况招投标、签合同、下订单、送货、验收、对账、开票、付款流程介绍项目都有招标吗?与国企的往期合作情况 实际账期大概多久?付款方式是?");
|
|
|
+ videoDueDiligence.setVideoDueDiligenceOperations(videoDueDiligenceOperations);
|
|
|
+ }else {
|
|
|
+ List<FileStorage> addressFile = getFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_ADDRESS_FILE);
|
|
|
+ videoDueDiligence.setAddressFile(addressFile);
|
|
|
+ List<FileStorage> associatedEnterpriseFile = getFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_ASSOCIATED_ENTERPRISE_FILE);
|
|
|
+ videoDueDiligence.setAssociatedEnterpriseFile(associatedEnterpriseFile);
|
|
|
+ List<FileStorage> businessAddressFile = getFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_BUSINESS_ADDRESS_FILE);
|
|
|
+ videoDueDiligence.setBusinessAddressFile(businessAddressFile);
|
|
|
+ List<FileStorage> businessScopeFile = getFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_BUSINESS_SCOPE_FILE);
|
|
|
+ videoDueDiligence.setBusinessScopeFile(businessScopeFile);
|
|
|
+ List<FileStorage> capitalFiles = getFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_CAPITAL_FILE);
|
|
|
+ videoDueDiligence.setCapitalFile(capitalFiles);
|
|
|
+ List<FileStorage> changeFiles = getFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_CHANGE_FILE);
|
|
|
+ videoDueDiligence.setChangeFile(changeFiles);
|
|
|
+ List<FileStorage> industryFiles = getFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_INDUSTRY_FILE);
|
|
|
+ videoDueDiligence.setIndustryFile(industryFiles);
|
|
|
+ List<FileStorage> lifeFiles = getFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_LIFE_FILE);
|
|
|
+ videoDueDiligence.setLifeFile(lifeFiles);
|
|
|
+ List<FileStorage> negativeInformationFile = getFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_NEGATIVE_INFORMATION_FILE);
|
|
|
+ videoDueDiligence.setNegativeInformationFile(negativeInformationFile);
|
|
|
+ List<FileStorage> shareholderFiles = getFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_SHAREHOLDER_FILE);
|
|
|
+ videoDueDiligence.setShareholderFile(shareholderFiles);
|
|
|
+ //视频尽调企业人员
|
|
|
+ List<CreditSituation> creditSituations = creditSituationService.lambdaQuery().eq(CreditSituation::getcSupplierInfoId, supplierId).list();
|
|
|
+ List<VideoDueDiligenceShareholdersSituation> videoDueDiligenceShareholdersSituations = videoDueDiligenceShareholdersSituationService.lambdaQuery().eq(VideoDueDiligenceShareholdersSituation::getVideoDueDiligenceId, videoDueDiligence.getId()).list();
|
|
|
+ for (CreditSituation creditSituation : creditSituations) {
|
|
|
+ for (VideoDueDiligenceShareholdersSituation videoDueDiligenceShareholdersSituation : videoDueDiligenceShareholdersSituations) {
|
|
|
+ if (creditSituation.getcCreditInvestigationInfoHistoryId() == videoDueDiligenceShareholdersSituation.getcCreditInvestigationInfoHistoryId()) {
|
|
|
+ creditSituation.setOverdueAccounts(videoDueDiligenceShareholdersSituation.getOverdueAccounts());
|
|
|
+ creditSituation.setTotalOverdueAmountFix(videoDueDiligenceShareholdersSituation.getTotalOverdueAmountFix());
|
|
|
+ creditSituation.setOver90DaysOverdue(videoDueDiligenceShareholdersSituation.getOver90DaysOverdue());
|
|
|
+ creditSituation.setOverdueMonths(videoDueDiligenceShareholdersSituation.getOverdueMonths());
|
|
|
+ creditSituation.setNumberOfOverdueRepayments(videoDueDiligenceShareholdersSituation.getNumberOfOverdueRepayments());
|
|
|
+ creditSituation.setNumberOfLoanInquiries(videoDueDiligenceShareholdersSituation.getNumberOfLoanInquiries());
|
|
|
+ creditSituation.setRepaymentGuaranteeAmount(videoDueDiligenceShareholdersSituation.getRepaymentGuaranteeAmount());
|
|
|
+ creditSituation.setBadRecordsFix(videoDueDiligenceShareholdersSituation.getBadRecordsFix());
|
|
|
+ creditSituation.setRecordOfDishonestyExecutionFix(videoDueDiligenceShareholdersSituation.getRecordOfDishonestyExecutionFix());
|
|
|
+ creditSituation.setExecutedRecordFix(videoDueDiligenceShareholdersSituation.getExecutedRecordFix());
|
|
|
+ creditSituation.setStCountFix(videoDueDiligenceShareholdersSituation.getStCountFix());
|
|
|
+ creditSituation.setQuestion(videoDueDiligenceShareholdersSituation.getQuestion());
|
|
|
+ creditSituation.setFeedback(videoDueDiligenceShareholdersSituation.getFeedback());
|
|
|
+ List<FileStorage> files = getFiles(videoDueDiligenceShareholdersSituation.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_SHAREHOLDER_SITUATION_FILE);
|
|
|
+ creditSituation.setFiles(files);
|
|
|
+
|
|
|
+ CCreditInvestigationInfoHistory creditInvestigationInfoHistory = creditInvestigationInfoHistoryService.getById(creditSituation.getcCreditInvestigationInfoHistoryId());
|
|
|
+ String name = dictionaryService.getByCode(creditInvestigationInfoHistory.getType()).getName();
|
|
|
+ creditInvestigationInfoHistory.setTypeStr(name);
|
|
|
+ //todo 填充征信报告
|
|
|
+ CreditInfo creditInfo = creditService.lambdaQuery().eq(CreditInfo::getCardNo, creditInvestigationInfoHistory.getSocialCreditCode()).one();
|
|
|
+ List<FileStorage> fileList = new ArrayList<>();
|
|
|
+ if (creditInfo != null) {
|
|
|
+ List<CreditDetail> creditDetails = creditDetailService.lambdaQuery()
|
|
|
+ .eq(CreditDetail::getCreditId,creditInfo.getId())
|
|
|
+ .isNotNull(CreditDetail::getCreditAddress)
|
|
|
+ .orderByDesc(CreditDetail::getGmtCreate).list();
|
|
|
+ if (CollectionUtil.isNotEmpty(creditDetails)) {
|
|
|
+ CreditDetail creditDetail = creditDetails.get(0);
|
|
|
+ if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
|
|
|
+ FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
|
|
|
+ fileList.add(creditDetailFiles);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ creditInvestigationInfoHistory.setCreditDetailFiles(fileList);
|
|
|
+ List<FileStorageDO> cardFiles = fileService.findByBusinessId(creditInvestigationInfoHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_IDCARD_FILES_HISTORY.getCode());
|
|
|
+ creditInvestigationInfoHistory.setCardFiles(cardFiles);
|
|
|
+ creditSituation.setCreditInvestigationInfoHistory(creditInvestigationInfoHistory);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ videoDueDiligence.setCreditSituations(creditSituations);
|
|
|
+ videoDueDiligence.setVideoDueDiligenceShareholdersSituations(videoDueDiligenceShareholdersSituations);
|
|
|
+ //视频尽调企业信誉信息
|
|
|
+ VideoDueDiligenceCorporateGoodwill videoDueDiligenceCorporateGoodwill = videoDueDiligenceCorporateGoodwillService.lambdaQuery().eq(VideoDueDiligenceCorporateGoodwill::getVideoDueDiligenceId, videoDueDiligence.getId()).one();
|
|
|
+ //企业信誉
|
|
|
+ CorporateGoodwill corporateGoodwill = corporateGoodwillService.lambdaQuery()
|
|
|
+ .eq(CorporateGoodwill::getcSupplierInfoId, supplierId).eq(CorporateGoodwill::getcEnterpriseId, enterprise.getId()).one();
|
|
|
+ corporateGoodwill.setShiXin(corporateGoodwill.getShiXin() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setHistoryShiXin(corporateGoodwill.getHistoryShiXin() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setZhiXing(corporateGoodwill.getZhiXing() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setHistoryZhiXing(corporateGoodwill.getHistoryZhiXing() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setGaoXiao(corporateGoodwill.getGaoXiao() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setHistoryGaoXiao(corporateGoodwill.getHistoryGaoXiao() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setDocumnetBeiGao(corporateGoodwill.getDocumnetBeiGao() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setDocumnetYuanGao(corporateGoodwill.getDocumnetYuanGao() == 0 ? 0 : 1);
|
|
|
+ corporateGoodwill.setDocumentFinance(corporateGoodwill.getDocumentFinance() == 0 ? 0 : 1);
|
|
|
+
|
|
|
+ corporateGoodwill.setVideoConcernedAccountsWithOutstandingCreditScore(videoDueDiligenceCorporateGoodwill.getConcernedAccountsWithOutstandingCreditScore());
|
|
|
+ corporateGoodwill.setVideoOutstandingBalanceScore(videoDueDiligenceCorporateGoodwill.getOutstandingBalanceScore());
|
|
|
+ corporateGoodwill.setVideoRecoveredBalance(videoDueDiligenceCorporateGoodwill.getRecoveredBalance());
|
|
|
+ corporateGoodwill.setVideoOutstandingNonPerformingAccounts(videoDueDiligenceCorporateGoodwill.getOutstandingNonPerformingAccounts());
|
|
|
+ corporateGoodwill.setVideoOutstandingNonPerformingAccountsScore(videoDueDiligenceCorporateGoodwill.getOutstandingNonPerformingAccountsScore());
|
|
|
+ corporateGoodwill.setVideoOutstandingShortTermLoanBalance(videoDueDiligenceCorporateGoodwill.getOutstandingShortTermLoanBalance());
|
|
|
+ corporateGoodwill.setVideoUnclearFollowUpAccounts(videoDueDiligenceCorporateGoodwill.getUnclearFollowUpAccounts());
|
|
|
+ corporateGoodwill.setVideoRecoveredBalanceScore(videoDueDiligenceCorporateGoodwill.getRecoveredBalanceScore());
|
|
|
+
|
|
|
+
|
|
|
+ //todo 填充征信报告
|
|
|
+ List<FileStorage> fileList = new ArrayList<>();
|
|
|
+ CreditInfo creditInfo = creditService.lambdaQuery().eq(CreditInfo::getCardNo, enterprise.getSocialCreditCode()).one();
|
|
|
+ if (creditInfo != null) {
|
|
|
+ List<CreditDetail> creditDetails = creditDetailService.lambdaQuery()
|
|
|
+ .eq(CreditDetail::getCreditId,creditInfo.getId())
|
|
|
+ .isNotNull(CreditDetail::getCreditAddress)
|
|
|
+ .orderByDesc(CreditDetail::getGmtCreate).list();
|
|
|
+ if (CollectionUtil.isNotEmpty(creditDetails)) {
|
|
|
+ CreditDetail creditDetail = creditDetails.get(0);
|
|
|
+ if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
|
|
|
+ FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
|
|
|
+ fileList.add(creditDetailFiles);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ corporateGoodwill.setCreditDetailFiles(fileList);
|
|
|
+ videoDueDiligenceCorporateGoodwill.setCreditDetailFiles(fileList);
|
|
|
+ corporateGoodwill.setQuestion(videoDueDiligenceCorporateGoodwill.getQuestion());
|
|
|
+ corporateGoodwill.setFeedback(videoDueDiligenceCorporateGoodwill.getFeedback());
|
|
|
+
|
|
|
+ List<FileStorage> files = getFiles(videoDueDiligenceCorporateGoodwill.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_CORPORATE_GOODWILL_FILE);
|
|
|
+ corporateGoodwill.setFiles(files);
|
|
|
+ videoDueDiligenceCorporateGoodwill.setFiles(files);
|
|
|
+
|
|
|
+ videoDueDiligence.setVideoDueDiligenceCorporateGoodwill(videoDueDiligenceCorporateGoodwill);
|
|
|
+ videoDueDiligence.setCorporateGoodwill(corporateGoodwill);
|
|
|
+ //企业经营与财务
|
|
|
+ VideoDueDiligenceFinance videoDueDiligenceFinance = videoDueDiligenceFinanceService.lambdaQuery().eq(VideoDueDiligenceFinance::getVideoDueDiligenceId, videoDueDiligence.getId()).one();
|
|
|
+ videoDueDiligence.setMainBusinessIncomeFix(videoDueDiligenceFinance.getMainBusinessIncomeFix());
|
|
|
+ videoDueDiligence.setMainBusinessCostFix(videoDueDiligenceFinance.getMainBusinessCostFix());
|
|
|
+ videoDueDiligence.setMainBusinessProfitFix(videoDueDiligenceFinance.getMainBusinessProfitFix());
|
|
|
+ List<FileStorage> fileStorageList = getFiles(videoDueDiligenceFinance.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_FINANCE_FILE);
|
|
|
+ videoDueDiligenceFinance.setFiles(fileStorageList);
|
|
|
+ videoDueDiligence.setVideoDueDiligenceFinance(videoDueDiligenceFinance);
|
|
|
+ //企业经营情况
|
|
|
+ VideoDueDiligenceOperations videoDueDiligenceOperations = videoDueDiligenceOperationsService.lambdaQuery().eq(VideoDueDiligenceOperations::getVideoDueDiligenceId, videoDueDiligence.getId()).one();
|
|
|
+ List<FileStorage> fileStorages = getFiles(videoDueDiligenceOperations.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_OPERATIONS_FILE);
|
|
|
+ videoDueDiligenceOperations.setFiles(fileStorages);
|
|
|
+ videoDueDiligence.setVideoDueDiligenceOperations(videoDueDiligenceOperations);
|
|
|
+ //综合评估
|
|
|
+ VideoDueDiligenceComprehensiveEvaluation videoDueDiligenceComprehensiveEvaluation = videoDueDiligenceComprehensiveEvaluationService.lambdaQuery().eq(VideoDueDiligenceComprehensiveEvaluation::getVideoDueDiligenceId, videoDueDiligence.getId()).one();
|
|
|
+ videoDueDiligence.setVideoDueDiligenceComprehensiveEvaluation(videoDueDiligenceComprehensiveEvaluation);
|
|
|
}
|
|
|
- corporateGoodwill.setCreditDetailFiles(fileList);
|
|
|
- corporateGoodwill.setQuestion("有无其他融资渠道?融资缺口有多少?");
|
|
|
- videoDueDiligence.setCorporateGoodwill(corporateGoodwill);
|
|
|
- videoDueDiligence.setNegativeInformationQuestion(" 历史失信被执行情况详情?判决书;历史被执行情况详情?判决书;限制高消费情况详情;行政处罚情况说明;涉诉情况说明");
|
|
|
+ // 股东信息 工商登记
|
|
|
+ String pubStockUrl = pubStock + "?socialCreditCode=" + enterprise.getSocialCreditCode() + "&comprehensiveRiskInvestigationId=" + enterprise.getcComprehensiveRiskInvestigationId();
|
|
|
+ ResponseJson forObject = restTemplate.getForObject(pubStockUrl, ResponseJson.class);
|
|
|
+ JSONObject jsonObject = new JSONObject(forObject.getData());
|
|
|
+ List<CRegStock> list = jsonObject.getBeanList("list", CRegStock.class);
|
|
|
+ videoDueDiligence.setRegStocks(list);
|
|
|
+
|
|
|
+ //查询文件
|
|
|
+ List<FileStorageDO> rentalFiles = fileService.findByBusinessId(enterpriseHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_RENTAL_CONTRACT_HISTORY.getCode());
|
|
|
+ List<FileStorageDO> waterFiles = fileService.findByBusinessId(enterpriseHistory.getId(), FileModuleDict.ChildEnum.WATER_ELECTRIICITY_FEES_HISTORY.getCode());
|
|
|
+ List<FileStorageDO> officeFiles = fileService.findByBusinessId(enterpriseHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_OFFICE_ENVIRONMENT_HISTORY.getCode());
|
|
|
+ videoDueDiligence.setRentalFiles(rentalFiles);
|
|
|
+ videoDueDiligence.setWaterFiles(waterFiles);
|
|
|
+ videoDueDiligence.setOfficeFiles(officeFiles);
|
|
|
+
|
|
|
List<PrivateLending> privateLendings = privateLendingService.lambdaQuery().eq(PrivateLending::getcSupplierInfoId, supplierId).eq(PrivateLending::getcEnterpriseId, enterprise.getId()).list();
|
|
|
if(CollectionUtil.isNotEmpty(privateLendings)){
|
|
|
privateLendings.forEach(r->r.setVideoDueDiligencePrivateLending(0));
|
|
@@ -367,25 +517,6 @@ public class VideoDueDiligenceServiceImpl extends ServiceImpl<VideoDueDiligenceM
|
|
|
.build();
|
|
|
List<FileStorage> files = attachmentRefService.getFiles(attachmentDto);
|
|
|
videoDueDiligence.setFiles(files);
|
|
|
- //企业经营与财务
|
|
|
- List<FileStorageDO> enterpriseTaxReturnFiles = fileService.findByBusinessId(enterpriseHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_TAX_RETURN_HISTORY.getCode());
|
|
|
- List<CCorporateFinanceHistory> cCorporateFinanceHistories = corporateFinanceHistoryService.lambdaQuery().eq(CCorporateFinanceHistory::getcEnterpriseHistoryId, enterpriseHistory.getId()).list();
|
|
|
- for (CCorporateFinanceHistory cCorporateFinanceHistory : cCorporateFinanceHistories) {
|
|
|
- List<FileStorageDO> enterpriseFinancialStatementsFiles = fileService.findByBusinessId(cCorporateFinanceHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_FINANCIAL_STATEMENTS_HISTORY.getCode());
|
|
|
- cCorporateFinanceHistory.setFileStorageDO(enterpriseFinancialStatementsFiles.get(0));
|
|
|
- cCorporateFinanceHistory.setFileStorage(enterpriseFinancialStatementsFiles.get(0));
|
|
|
- }
|
|
|
- List<FileStorageDO> enterpriseAccountingReportFiles = fileService.findByBusinessId(enterpriseHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_ACCOUNTING_REPORT_HISTORY.getCode());
|
|
|
- videoDueDiligence.setEnterpriseTaxReturnFiles(enterpriseTaxReturnFiles);
|
|
|
- videoDueDiligence.setCorporateFinanceList(cCorporateFinanceHistories);
|
|
|
- videoDueDiligence.setEnterpriseAccountingReportFiles(enterpriseAccountingReportFiles);
|
|
|
- //企业财务
|
|
|
- VideoDueDiligenceFinance videoDueDiligenceFinance = new VideoDueDiligenceFinance();
|
|
|
- videoDueDiligence.setMainBusinessIncome(supplierApprovalSecond.getMainBusinessIncome());
|
|
|
- videoDueDiligence.setMainBusinessCost(supplierApprovalSecond.getMainBusinessCost());
|
|
|
- videoDueDiligence.setMainBusinessProfit(supplierApprovalSecond.getMainBusinessProfit());
|
|
|
- videoDueDiligenceFinance.setQuestion("是否有企业内账?企业真实年营业收入有多少?业务收入占比情况如何?毛利率约多少?对客户是如何筛选?");
|
|
|
- videoDueDiligence.setVideoDueDiligenceFinance(videoDueDiligenceFinance);
|
|
|
//上游采购单据
|
|
|
List<UpstreamProcurementDocuments> upstreamProcurementDocumentsList = upstreamProcurementDocumentsService.lambdaQuery().eq(UpstreamProcurementDocuments::getSupplierApprovalSecondId, supplierApprovalSecond.getId()).list();
|
|
|
if (CollectionUtil.isNotEmpty(upstreamProcurementDocumentsList)) {
|
|
@@ -405,65 +536,85 @@ public class VideoDueDiligenceServiceImpl extends ServiceImpl<VideoDueDiligenceM
|
|
|
salesDocumentsInfo.setStandardScore(new BigDecimal("1"));
|
|
|
}
|
|
|
}
|
|
|
+ //企业经营与财务
|
|
|
+ List<FileStorageDO> enterpriseTaxReturnFiles = fileService.findByBusinessId(enterpriseHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_TAX_RETURN_HISTORY.getCode());
|
|
|
+ List<CCorporateFinanceHistory> cCorporateFinanceHistories = corporateFinanceHistoryService.lambdaQuery().eq(CCorporateFinanceHistory::getcEnterpriseHistoryId, enterpriseHistory.getId()).list();
|
|
|
+ for (CCorporateFinanceHistory cCorporateFinanceHistory : cCorporateFinanceHistories) {
|
|
|
+ List<FileStorageDO> enterpriseFinancialStatementsFiles = fileService.findByBusinessId(cCorporateFinanceHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_FINANCIAL_STATEMENTS_HISTORY.getCode());
|
|
|
+ cCorporateFinanceHistory.setFileStorageDO(enterpriseFinancialStatementsFiles.get(0));
|
|
|
+ cCorporateFinanceHistory.setFileStorage(enterpriseFinancialStatementsFiles.get(0));
|
|
|
+ }
|
|
|
+ videoDueDiligence.setMainBusinessIncome(supplierApprovalSecond.getMainBusinessIncome());
|
|
|
+ videoDueDiligence.setMainBusinessCost(supplierApprovalSecond.getMainBusinessCost());
|
|
|
+ videoDueDiligence.setMainBusinessProfit(supplierApprovalSecond.getMainBusinessProfit());
|
|
|
+ List<FileStorageDO> enterpriseAccountingReportFiles = fileService.findByBusinessId(enterpriseHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_ACCOUNTING_REPORT_HISTORY.getCode());
|
|
|
+ videoDueDiligence.setEnterpriseTaxReturnFiles(enterpriseTaxReturnFiles);
|
|
|
+ videoDueDiligence.setCorporateFinanceList(cCorporateFinanceHistories);
|
|
|
+ videoDueDiligence.setEnterpriseAccountingReportFiles(enterpriseAccountingReportFiles);
|
|
|
videoDueDiligence.setSalesDocumentsInfoList(salesDocumentsInfoList);
|
|
|
- VideoDueDiligenceOperations videoDueDiligenceOperations = new VideoDueDiligenceOperations();
|
|
|
- videoDueDiligenceOperations.setQuestion("主营业务是?有无其他业务?合作的客户或者项目有哪些?年供应量大概多少?参与过项目有哪些?合作过的下游国企有哪些?有没有长期合作企业?本年度的项目有哪些?主要销售市场是?其他地区有没有业务如何入行?关系经验有哪些?有没有计划拓展的新领域?销售计划是什么?预计本年度营收收入、销售量多少?\n" +
|
|
|
- "1.上游情况一般是从钢厂采购?供应商有没有区别?是钢厂的代理?上游合作商有哪些?如何选用供应商?还会采购其他货物吗?\n" + "2.下游情况招投标、签合同、下订单、送货、验收、对账、开票、付款流程介绍项目都有招标吗?与国企的往期合作情况 实际账期大概多久?付款方式是?");
|
|
|
- videoDueDiligence.setVideoDueDiligenceOperations(videoDueDiligenceOperations);
|
|
|
-
|
|
|
return videoDueDiligence;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void videoDueDiligence(VideoDueDiligence videoDueDiligence) {
|
|
|
- //一键测算
|
|
|
- measurement(videoDueDiligence);
|
|
|
//保存视频尽调信息
|
|
|
- save(videoDueDiligence);
|
|
|
+ saveOrUpdate(videoDueDiligence);
|
|
|
//保存文件
|
|
|
List<Long> addressFileIds = videoDueDiligence.getAddressFileIds();
|
|
|
+ removeFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_ADDRESS_FILE);
|
|
|
if (CollectionUtil.isNotEmpty(addressFileIds)) {
|
|
|
saveFiles(addressFileIds, videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_ADDRESS_FILE);
|
|
|
}
|
|
|
List<Long> associatedEnterpriseFileIds = videoDueDiligence.getAssociatedEnterpriseFileIds();
|
|
|
+ removeFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_ASSOCIATED_ENTERPRISE_FILE);
|
|
|
if (CollectionUtil.isNotEmpty(associatedEnterpriseFileIds)) {
|
|
|
saveFiles(associatedEnterpriseFileIds, videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_ASSOCIATED_ENTERPRISE_FILE);
|
|
|
}
|
|
|
List<Long> businessAddressFileIds = videoDueDiligence.getBusinessAddressFileIds();
|
|
|
+ removeFiles( videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_BUSINESS_ADDRESS_FILE);
|
|
|
if (CollectionUtil.isNotEmpty(businessAddressFileIds)) {
|
|
|
saveFiles(businessAddressFileIds, videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_BUSINESS_ADDRESS_FILE);
|
|
|
}
|
|
|
List<Long> businessScopeFileIds = videoDueDiligence.getBusinessScopeFileIds();
|
|
|
+ removeFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_BUSINESS_SCOPE_FILE);
|
|
|
if (CollectionUtil.isNotEmpty(businessScopeFileIds)) {
|
|
|
saveFiles(businessScopeFileIds, videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_BUSINESS_SCOPE_FILE);
|
|
|
}
|
|
|
List<Long> capitalFileIds = videoDueDiligence.getCapitalFileIds();
|
|
|
+ removeFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_CAPITAL_FILE);
|
|
|
if (CollectionUtil.isNotEmpty(capitalFileIds)) {
|
|
|
saveFiles(capitalFileIds, videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_CAPITAL_FILE);
|
|
|
}
|
|
|
List<Long> changeFileIds = videoDueDiligence.getChangeFileIds();
|
|
|
+ removeFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_CHANGE_FILE);
|
|
|
if (CollectionUtil.isNotEmpty(changeFileIds)) {
|
|
|
saveFiles(changeFileIds, videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_CHANGE_FILE);
|
|
|
}
|
|
|
List<Long> industryFileIds = videoDueDiligence.getIndustryFileIds();
|
|
|
+ removeFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_INDUSTRY_FILE);
|
|
|
if (CollectionUtil.isNotEmpty(industryFileIds)) {
|
|
|
saveFiles(industryFileIds, videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_INDUSTRY_FILE);
|
|
|
}
|
|
|
List<Long> lifeFileIds = videoDueDiligence.getLifeFileIds();
|
|
|
+ removeFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_LIFE_FILE);
|
|
|
if (CollectionUtil.isNotEmpty(lifeFileIds)) {
|
|
|
saveFiles(lifeFileIds, videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_LIFE_FILE);
|
|
|
}
|
|
|
List<Long> negativeInformationFileIds = videoDueDiligence.getNegativeInformationFileIds();
|
|
|
+ removeFiles( videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_NEGATIVE_INFORMATION_FILE);
|
|
|
if (CollectionUtil.isNotEmpty(negativeInformationFileIds)) {
|
|
|
saveFiles(negativeInformationFileIds, videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_NEGATIVE_INFORMATION_FILE);
|
|
|
}
|
|
|
List<Long> shareholderFileIds = videoDueDiligence.getShareholderFileIds();
|
|
|
+ removeFiles(videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_SHAREHOLDER_FILE);
|
|
|
if (CollectionUtil.isNotEmpty(shareholderFileIds)) {
|
|
|
saveFiles(shareholderFileIds, videoDueDiligence.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_SHAREHOLDER_FILE);
|
|
|
}
|
|
|
//保存企业负责人情况
|
|
|
List<VideoDueDiligenceShareholdersSituation> videoDueDiligenceShareholdersSituations = videoDueDiligence.getVideoDueDiligenceShareholdersSituations();
|
|
|
+ videoDueDiligenceShareholdersSituationService.lambdaUpdate().eq(VideoDueDiligenceShareholdersSituation::getcSupplierInfoId,videoDueDiligence.getcSupplierInfoId())
|
|
|
+ .eq(VideoDueDiligenceShareholdersSituation::getVideoDueDiligenceId,videoDueDiligence.getId()).remove();
|
|
|
if (CollectionUtil.isNotEmpty(videoDueDiligenceShareholdersSituations)) {
|
|
|
for (VideoDueDiligenceShareholdersSituation videoDueDiligenceShareholdersSituation : videoDueDiligenceShareholdersSituations) {
|
|
|
videoDueDiligenceShareholdersSituation.setcSupplierInfoId(videoDueDiligence.getcSupplierInfoId());
|
|
@@ -475,6 +626,8 @@ public class VideoDueDiligenceServiceImpl extends ServiceImpl<VideoDueDiligenceM
|
|
|
}
|
|
|
}
|
|
|
//保存企业信誉信息
|
|
|
+ videoDueDiligenceCorporateGoodwillService.lambdaUpdate().eq(VideoDueDiligenceCorporateGoodwill::getcSupplierInfoId,videoDueDiligence.getcSupplierInfoId())
|
|
|
+ .eq(VideoDueDiligenceCorporateGoodwill::getVideoDueDiligenceId,videoDueDiligence.getId()).remove();
|
|
|
VideoDueDiligenceCorporateGoodwill videoDueDiligenceCorporateGoodwill = videoDueDiligence.getVideoDueDiligenceCorporateGoodwill();
|
|
|
videoDueDiligenceCorporateGoodwill.setcSupplierInfoId(videoDueDiligence.getcSupplierInfoId());
|
|
|
videoDueDiligenceCorporateGoodwill.setVideoDueDiligenceId(videoDueDiligence.getId());
|
|
@@ -525,6 +678,7 @@ public class VideoDueDiligenceServiceImpl extends ServiceImpl<VideoDueDiligenceM
|
|
|
}
|
|
|
}
|
|
|
//企业经财务
|
|
|
+ videoDueDiligenceFinanceService.lambdaUpdate().eq(VideoDueDiligenceFinance::getVideoDueDiligenceId,videoDueDiligence.getId()).remove();
|
|
|
VideoDueDiligenceFinance videoDueDiligenceFinance = videoDueDiligence.getVideoDueDiligenceFinance();
|
|
|
videoDueDiligenceFinance.setVideoDueDiligenceId(videoDueDiligence.getId());
|
|
|
videoDueDiligenceFinanceService.save(videoDueDiligenceFinance);
|
|
@@ -546,48 +700,53 @@ public class VideoDueDiligenceServiceImpl extends ServiceImpl<VideoDueDiligenceM
|
|
|
}
|
|
|
}
|
|
|
//企业经营情况
|
|
|
+ videoDueDiligenceOperationsService.lambdaUpdate().eq(VideoDueDiligenceOperations::getVideoDueDiligenceId,videoDueDiligence.getId()).remove();
|
|
|
VideoDueDiligenceOperations videoDueDiligenceOperations = videoDueDiligence.getVideoDueDiligenceOperations();
|
|
|
videoDueDiligenceOperations.setVideoDueDiligenceId(videoDueDiligence.getId());
|
|
|
videoDueDiligenceOperationsService.save(videoDueDiligenceOperations);
|
|
|
//保存文件
|
|
|
List<Long> videoDueDiligenceOperationsFileIds = videoDueDiligenceOperations.getFileIds();
|
|
|
saveFiles(videoDueDiligenceOperationsFileIds, videoDueDiligenceOperations.getId(), FileModuleDict.ChildEnum.VIDEO_DUE_DILIGENCE_OPERATIONS_FILE);
|
|
|
- //综合评估
|
|
|
- SupplierInfo supplierInfo = supplierInfoService.get(videoDueDiligence.getcSupplierInfoId());
|
|
|
- VideoDueDiligenceComprehensiveEvaluation videoDueDiligenceComprehensiveEvaluation = videoDueDiligence.getVideoDueDiligenceComprehensiveEvaluation();
|
|
|
- videoDueDiligenceComprehensiveEvaluation.setVideoDueDiligenceId(videoDueDiligence.getId());
|
|
|
- videoDueDiligenceComprehensiveEvaluation.setEvaluationOpinions(videoDueDiligence.getEvaluationOpinions());
|
|
|
- videoDueDiligenceComprehensiveEvaluationService.save(videoDueDiligenceComprehensiveEvaluation);
|
|
|
- supplierInfo.setScore(videoDueDiligenceComprehensiveEvaluation.getScore());
|
|
|
- supplierInfo.setAdmitted(videoDueDiligenceComprehensiveEvaluation.getAdmitted());
|
|
|
- supplierInfo.setCreditLimit(videoDueDiligenceComprehensiveEvaluation.getCreditLimit());
|
|
|
- supplierInfo.setRevenueRating(videoDueDiligenceComprehensiveEvaluation.getRevenueRating());
|
|
|
- if (videoDueDiligenceComprehensiveEvaluation.getAdmitted().equals(SupplierScoringModel.ADMITTED)) {
|
|
|
- supplierInfo.setStatusStr(SupplierStatusEnums.CREDIT_SUCCESS.getCode());
|
|
|
- } else {
|
|
|
- supplierInfo.setStatusStr(SupplierStatusEnums.VOTE.getCode());
|
|
|
- }
|
|
|
- supplierInfoService.updateById(supplierInfo);
|
|
|
- //完成流程
|
|
|
- String taskId = videoDueDiligence.getTaskId();
|
|
|
- Enterprise enterprise = enterpriseService.getById(supplierInfo.getcEnterpriseId());
|
|
|
- Map<String, Object> msgVariables = new HashMap<>();
|
|
|
- msgVariables.put(ConstantUtil.FLOWABLE_MSG_TITLE, "供应商名称:" + enterprise.getCorporateName());
|
|
|
- msgVariables.put(ConstantUtil.FLOWABLE_MSG_CONTENT,
|
|
|
- "供应商名称为“" + enterprise.getCorporateName() + "”的供应商已完成审核!"
|
|
|
- + ConstantUtil.FLOWABLE_MSG_ASSIGNEE);
|
|
|
- flowableService.completeMyTask(taskId, supplierInfo, null, null, videoDueDiligence.getId(), msgVariables, ConstantUtil.SUPPLIER_INFO);
|
|
|
+ if(videoDueDiligence.getVisible()){
|
|
|
+ //一键测算
|
|
|
+ measurement(videoDueDiligence);
|
|
|
+ //综合评估
|
|
|
+ SupplierInfo supplierInfo = supplierInfoService.get(videoDueDiligence.getcSupplierInfoId());
|
|
|
+ VideoDueDiligenceComprehensiveEvaluation videoDueDiligenceComprehensiveEvaluation = videoDueDiligence.getVideoDueDiligenceComprehensiveEvaluation();
|
|
|
+ videoDueDiligenceComprehensiveEvaluation.setVideoDueDiligenceId(videoDueDiligence.getId());
|
|
|
+ videoDueDiligenceComprehensiveEvaluation.setEvaluationOpinions(videoDueDiligence.getEvaluationOpinions());
|
|
|
+ videoDueDiligenceComprehensiveEvaluationService.save(videoDueDiligenceComprehensiveEvaluation);
|
|
|
+ supplierInfo.setScore(videoDueDiligenceComprehensiveEvaluation.getScore());
|
|
|
+ supplierInfo.setAdmitted(videoDueDiligenceComprehensiveEvaluation.getAdmitted());
|
|
|
+ supplierInfo.setCreditLimit(videoDueDiligenceComprehensiveEvaluation.getCreditLimit());
|
|
|
+ supplierInfo.setRevenueRating(videoDueDiligenceComprehensiveEvaluation.getRevenueRating());
|
|
|
+ if (videoDueDiligenceComprehensiveEvaluation.getAdmitted().equals(SupplierScoringModel.ADMITTED)) {
|
|
|
+ supplierInfo.setStatusStr(SupplierStatusEnums.CREDIT_SUCCESS.getCode());
|
|
|
+ } else {
|
|
|
+ supplierInfo.setStatusStr(SupplierStatusEnums.VOTE.getCode());
|
|
|
+ }
|
|
|
+ supplierInfoService.updateById(supplierInfo);
|
|
|
+ //完成流程
|
|
|
+ String taskId = videoDueDiligence.getTaskId();
|
|
|
+ Enterprise enterprise = enterpriseService.getById(supplierInfo.getcEnterpriseId());
|
|
|
+ Map<String, Object> msgVariables = new HashMap<>();
|
|
|
+ msgVariables.put(ConstantUtil.FLOWABLE_MSG_TITLE, "供应商名称:" + enterprise.getCorporateName());
|
|
|
+ msgVariables.put(ConstantUtil.FLOWABLE_MSG_CONTENT,
|
|
|
+ "供应商名称为“" + enterprise.getCorporateName() + "”的供应商已完成审核!"
|
|
|
+ + ConstantUtil.FLOWABLE_MSG_ASSIGNEE);
|
|
|
+ flowableService.completeMyTask(taskId, supplierInfo, null, null, videoDueDiligence.getId(), msgVariables, ConstantUtil.SUPPLIER_INFO);
|
|
|
|
|
|
- //判断是否开启授信决议
|
|
|
- List<ProjectInformation> projectInformations = projectInformationService.lambdaQuery().eq(ProjectInformation::getcSupplierInfoId, videoDueDiligence.getcSupplierInfoId()).list();
|
|
|
- if (CollectionUtil.isNotEmpty(projectInformations)) {
|
|
|
- for (ProjectInformation projectInformation : projectInformations) {
|
|
|
- if (projectInformation.getStatusStr().equals(ProjectAndEnterpriseStatusEnums.CREDIT_SUCCESS.getCode())) {
|
|
|
- ProjectCoreEnterprise projectCoreEnterprise = projectCoreEnterpriseService.lambdaQuery().eq(ProjectCoreEnterprise::getcProjectInformationId, projectInformation.getId()).one();
|
|
|
- if (projectCoreEnterprise.getStatusStr().equals(ProjectAndEnterpriseStatusEnums.CREDIT_SUCCESS.getCode())) {
|
|
|
- if (supplierInfo.getStatusStr().equals(SupplierStatusEnums.CREDIT_SUCCESS.getCode())) {
|
|
|
- //开启流程
|
|
|
- creditResolutionService.startProcess(projectInformation.getId());
|
|
|
+ //判断是否开启授信决议
|
|
|
+ List<ProjectInformation> projectInformations = projectInformationService.lambdaQuery().eq(ProjectInformation::getcSupplierInfoId, videoDueDiligence.getcSupplierInfoId()).list();
|
|
|
+ if (CollectionUtil.isNotEmpty(projectInformations)) {
|
|
|
+ for (ProjectInformation projectInformation : projectInformations) {
|
|
|
+ if (projectInformation.getStatusStr().equals(ProjectAndEnterpriseStatusEnums.CREDIT_SUCCESS.getCode())) {
|
|
|
+ ProjectCoreEnterprise projectCoreEnterprise = projectCoreEnterpriseService.lambdaQuery().eq(ProjectCoreEnterprise::getcProjectInformationId, projectInformation.getId()).one();
|
|
|
+ if (projectCoreEnterprise.getStatusStr().equals(ProjectAndEnterpriseStatusEnums.CREDIT_SUCCESS.getCode())) {
|
|
|
+ if (supplierInfo.getStatusStr().equals(SupplierStatusEnums.CREDIT_SUCCESS.getCode())) {
|
|
|
+ //开启流程
|
|
|
+ creditResolutionService.startProcess(projectInformation.getId());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -604,6 +763,13 @@ public class VideoDueDiligenceServiceImpl extends ServiceImpl<VideoDueDiligenceM
|
|
|
attachmentRefService.saveRef(fileIds, attachmentDto);
|
|
|
}
|
|
|
}
|
|
|
+ private void removeFiles(Long id, FileModuleDict.ChildEnum fileModuleDict) {
|
|
|
+ AttachmentDto attachmentDto = AttachmentDto.builder()
|
|
|
+ .setEntityId(id)
|
|
|
+ .setChildEnum(fileModuleDict)
|
|
|
+ .build();
|
|
|
+ attachmentRefService.removeRef(attachmentDto);
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public VideoDueDiligence getView(Long id) {
|