package com.sunxung.factoring.service.project.impl;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sunxung.factoring.component.constance.ProjectCoreEnterpriseScoringModel;
import com.sunxung.factoring.component.constance.ProjectScoringModel;
import com.sunxung.factoring.component.enums.ProjectAndEnterpriseStatusEnums;
import com.sunxung.factoring.component.enums.SupplierStatusEnums;
import com.sunxung.factoring.component.util.*;
import com.sunxung.factoring.dict.impl.*;
import com.sunxung.factoring.entity.ResponseJson;
import com.sunxung.factoring.entity.entprise.Enterprise;
import com.sunxung.factoring.entity.project.*;
import com.sunxung.factoring.entity.project.vo.*;
import com.sunxung.factoring.entity.supplier.CEnterpriseHistory;
import com.sunxung.factoring.entity.supplier.CRegStock;
import com.sunxung.factoring.entity.supplier.SupplierInfo;
import com.sunxung.factoring.entity.sys.FileStorageDO;
import com.sunxung.factoring.mapper.project.ProjectCoreEnterpriseAuditMapper;
import com.sunxung.factoring.service.creditresolution.ICreditResolutionService;
import com.sunxung.factoring.service.entprise.IEnterpriseService;
import com.sunxung.factoring.service.project.*;
import com.sunxung.factoring.service.supplier.ICEnterpriseHistoryService;
import com.sunxung.factoring.service.supplier.ISupplierInfoService;
import com.sunxung.factoring.service.sys.FileService;
import com.sunxung.factoring.service.sys.flowable.FlowableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

/**
 * <p>
 * 项目核心企业审核 服务实现类
 * </p>
 *
 * @author liutao
 * @since 2023-12-15
 */
@Service("project_core_approval_addService")
public class ProjectCoreEnterpriseAuditServiceImpl extends ServiceImpl<ProjectCoreEnterpriseAuditMapper, ProjectCoreEnterpriseAudit> implements IProjectCoreEnterpriseAuditService {

    @Resource(name = "projectCoreEnterpriseService")
    private IProjectCoreEnterpriseService projectCoreEnterpriseService;

    @Resource(name = "SupplierInfoService")
    private ISupplierInfoService supplierInfoService;

    @Resource(name = "creditResolutionService")
    private ICreditResolutionService creditResolutionService;

    @Value("${sop.getProjectReviewInfoUrl}")
    private String getProjectReviewInfo;

    @Value("${sop.getChangesUrl}")
    private String getChanges;

    @Value("${sop.getProjectCoreEnterpriseScoreUrl}")
    private String getProjectCoreEnterpriseScore;

    @Autowired
    private RestTemplate restTemplate;

    @Autowired
    private ICEnterpriseHistoryService enterpriseHistoryService;

    @Autowired
    private IProjectCoreEnterprisePrivateLendingService projectCoreEnterprisePrivateLendingService;

    @Autowired
    private IProjectCoreEnterpriseEquityFreezeService projectCoreEnterpriseEquityFreezeService;

    @Autowired
    private IProjectCoreEnterpriseMajorAbnormalLitigationService projectCoreEnterpriseMajorAbnormalLitigationService;

    @Autowired
    private IProjectCoreEnterpriseSeriousIllegalityService projectCoreEnterpriseSeriousIllegalityService;

    @Autowired
    private IProjectCoreEnterpriseTaxOweNoticeService projectCoreEnterpriseTaxOweNoticeService;

    @Autowired
    private IProjectCoreEnterpriseTaxIllegalDataService projectCoreEnterpriseTaxIllegalDataService;

    @Autowired
    private IProjectCoreEnterpriseBlacklistService projectCoreEnterpriseBlacklistService;

    @Autowired
    private IProjectCoreEnterpriseExceptionDataService projectCoreEnterpriseExceptionDataService;

    @Autowired
    private IProjectCoreEnterpriseNewsService projectCoreEnterpriseNewsService;

    @Autowired
    private IProjectCoreEnterpriseComprehensiveEvaluationService projectCoreEnterpriseComprehensiveEvaluationService;

    @Resource(name = "projectInformationService")
    private IProjectInformationService projectInformationService;

    @Autowired
    private FlowableService flowableService;

    @Autowired
    private IEnterpriseCreditRatingService enterpriseCreditRatingService;

    @Autowired
    private IProjectCoreEnterpriseFileService projectCoreEnterpriseFileService;

    @Autowired
    private FileService fileService;

    @Autowired
    private IProjectCoreEnterpriseScoreService projectCoreEnterpriseScoreService;

    @Autowired
    private IEnterpriseService enterpriseService;

    @Override
    public ProjectCoreEnterpriseAudit getProjectCoreEnterpriseAuditInfo(Long id) {
        //核心企业信息
        ProjectCoreEnterprise projectCoreEnterprise = projectCoreEnterpriseService.get(id);
        //历史合作资料
        List<ProjectCoreEnterpriseFile> projectCoreEnterpriseFiles = projectCoreEnterpriseFileService.lambdaQuery().eq(ProjectCoreEnterpriseFile::getcProjectCoreEnterpriseId, projectCoreEnterprise.getId()).list();
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseFiles)) {
            for (ProjectCoreEnterpriseFile projectCoreEnterpriseFile : projectCoreEnterpriseFiles) {
                List<FileStorageDO> fileStorageDOS = fileService.findByBusinessId(projectCoreEnterpriseFile.getId(), FileModuleDict.ChildEnum.PROJECT_CORE_ENTERPRISE_FILE.getCode());
                projectCoreEnterpriseFile.setFileStorageDOS(fileStorageDOS);
            }
        }
        projectCoreEnterprise.setProjectCoreEnterpriseFiles(projectCoreEnterpriseFiles);
        ProjectCoreEnterpriseAudit projectCoreEnterpriseAudit = lambdaQuery().eq(ProjectCoreEnterpriseAudit::getcProjectCoreEnterpriseId, id).one();
        if(projectCoreEnterpriseAudit == null){
            projectCoreEnterpriseAudit = new ProjectCoreEnterpriseAudit();
            qcc(projectCoreEnterpriseAudit, projectCoreEnterprise);
        }else {
            //项目业主 企业信息需要用历史的   因为会变动
            CEnterpriseHistory enterprise = enterpriseHistoryService.getById(projectCoreEnterprise.getcEnterpriseHistoryId());
            projectCoreEnterprise.setEnterprise(enterprise);
            projectCoreEnterpriseAudit.setProjectCoreEnterprise(projectCoreEnterprise);
            //企查查
            String getProjectReviewInfoUrl = getProjectReviewInfo + "?comprehensiveRiskInvestigationId=" + enterprise.getcComprehensiveRiskInvestigationId();
            ResponseJson forObject = restTemplate.getForObject(getProjectReviewInfoUrl, ResponseJson.class);
            if (forObject != null) {
                JSONObject result = new JSONObject(forObject.getData());
                List<CRegStock> regStocks = result.getBeanList("cRegStocks", CRegStock.class);
                projectCoreEnterpriseAudit.setRegStocks(regStocks);
            }
            //民间借贷
            List<ProjectCoreEnterprisePrivateLending> projectCoreEnterprisePrivateLendings = projectCoreEnterprisePrivateLendingService.lambdaQuery().eq(ProjectCoreEnterprisePrivateLending::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
            List<CJudgmentDocuments> privateLendings = BeanUtilsProxy.copyPropertiesList(projectCoreEnterprisePrivateLendings, CJudgmentDocuments.class);
            projectCoreEnterpriseAudit.setPrivateLendings(privateLendings);
            projectCoreEnterpriseAudit.setProjectCoreEnterprisePrivateLendingList(projectCoreEnterprisePrivateLendings);
            //股权冻结
            List<ProjectCoreEnterpriseEquityFreeze> projectCoreEnterpriseEquityFreezes = projectCoreEnterpriseEquityFreezeService.lambdaQuery().eq(ProjectCoreEnterpriseEquityFreeze::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
            List<CEquityFreezeData> cEquityFreezeData = BeanUtilsProxy.copyPropertiesList(projectCoreEnterpriseEquityFreezes, CEquityFreezeData.class);
            projectCoreEnterpriseAudit.setEquityFreezeDataList(cEquityFreezeData);
            projectCoreEnterpriseAudit.setProjectCoreEnterpriseEquityFreezeList(projectCoreEnterpriseEquityFreezes);
            //重大异常诉讼
            List<ProjectCoreEnterpriseMajorAbnormalLitigation> projectCoreEnterpriseMajorAbnormalLitigations = projectCoreEnterpriseMajorAbnormalLitigationService.lambdaQuery().eq(ProjectCoreEnterpriseMajorAbnormalLitigation::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
            List<CJudgmentDocuments> cJudgmentDocuments = BeanUtilsProxy.copyPropertiesList(projectCoreEnterpriseMajorAbnormalLitigations, CJudgmentDocuments.class);
            projectCoreEnterpriseAudit.setMajorAnomalies(cJudgmentDocuments);
            projectCoreEnterpriseAudit.setProjectCoreEnterpriseMajorAbnormalLitigationList(projectCoreEnterpriseMajorAbnormalLitigations);
            //严重违法
            List<ProjectCoreEnterpriseSeriousIllegality> projectCoreEnterpriseSeriousIllegalities = projectCoreEnterpriseSeriousIllegalityService.lambdaQuery().eq(ProjectCoreEnterpriseSeriousIllegality::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
            List<CSeriousIllegalData> cSeriousIllegalData = BeanUtilsProxy.copyPropertiesList(projectCoreEnterpriseSeriousIllegalities, CSeriousIllegalData.class);
            projectCoreEnterpriseAudit.setSeriousIllegalData(cSeriousIllegalData);
            projectCoreEnterpriseAudit.setProjectCoreEnterpriseSeriousIllegalityList(projectCoreEnterpriseSeriousIllegalities);
            //欠税公告
            List<ProjectCoreEnterpriseTaxOweNotice> projectCoreEnterpriseTaxOweNotices = projectCoreEnterpriseTaxOweNoticeService.lambdaQuery().eq(ProjectCoreEnterpriseTaxOweNotice::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
            List<CTaxOweNoticeData> cTaxOweNoticeData = BeanUtilsProxy.copyPropertiesList(projectCoreEnterpriseTaxOweNotices, CTaxOweNoticeData.class);
            projectCoreEnterpriseAudit.setTaxOweNoticeData(cTaxOweNoticeData);
            projectCoreEnterpriseAudit.setProjectCoreEnterpriseTaxOweNoticeList(projectCoreEnterpriseTaxOweNotices);
            //税收违法
            List<ProjectCoreEnterpriseTaxIllegalData> projectCoreEnterpriseTaxIllegalData = projectCoreEnterpriseTaxIllegalDataService.lambdaQuery().eq(ProjectCoreEnterpriseTaxIllegalData::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
            List<CTaxIllegalData> cTaxIllegalData = BeanUtilsProxy.copyPropertiesList(projectCoreEnterpriseTaxIllegalData, CTaxIllegalData.class);
            projectCoreEnterpriseAudit.setTaxIllegalData(cTaxIllegalData);
            projectCoreEnterpriseAudit.setProjectCoreEnterpriseTaxIllegalDataList(projectCoreEnterpriseTaxIllegalData);
            //黑名单信息
            List<ProjectCoreEnterpriseBlacklist> projectCoreEnterpriseBlacklists = projectCoreEnterpriseBlacklistService.lambdaQuery().eq(ProjectCoreEnterpriseBlacklist::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
            List<CBlacklist> cBlacklists = BeanUtilsProxy.copyPropertiesList(projectCoreEnterpriseBlacklists, CBlacklist.class);
            projectCoreEnterpriseAudit.setBlacklists(cBlacklists);
            projectCoreEnterpriseAudit.setProjectCoreEnterpriseBlacklistList(projectCoreEnterpriseBlacklists);
            //其他经营异常
            List<ProjectCoreEnterpriseExceptionData> projectCoreEnterpriseExceptionData = projectCoreEnterpriseExceptionDataService.lambdaQuery().eq(ProjectCoreEnterpriseExceptionData::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
            List<CExceptionData> cExceptionData = BeanUtilsProxy.copyPropertiesList(projectCoreEnterpriseExceptionData, CExceptionData.class);
            projectCoreEnterpriseAudit.setExceptionData(cExceptionData);
            projectCoreEnterpriseAudit.setProjectCoreEnterpriseExceptionDataList(projectCoreEnterpriseExceptionData);
            //重大负面新闻舆情
            List<ProjectCoreEnterpriseNews> projectCoreEnterpriseNews = projectCoreEnterpriseNewsService.lambdaQuery().eq(ProjectCoreEnterpriseNews::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
            List<CNews> cNews = BeanUtilsProxy.copyPropertiesList(projectCoreEnterpriseNews, CNews.class);
            projectCoreEnterpriseAudit.setNews(cNews);
            projectCoreEnterpriseAudit.setProjectCoreEnterpriseNewsList(projectCoreEnterpriseNews);
            //一键测算
            ProjectCoreEnterpriseComprehensiveEvaluation projectCoreEnterpriseComprehensiveEvaluation = projectCoreEnterpriseComprehensiveEvaluationService.lambdaQuery().eq(ProjectCoreEnterpriseComprehensiveEvaluation::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).one();
            projectCoreEnterpriseAudit.setProjectCoreEnterpriseComprehensiveEvaluations(projectCoreEnterpriseComprehensiveEvaluation);
        }
        return projectCoreEnterpriseAudit;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void addProjectCoreEnterpriseAuditInfo(ProjectCoreEnterpriseAudit projectCoreEnterpriseAuditInfo) {
        //修改核心企业信息
        ProjectCoreEnterprise projectCoreEnterprise = projectCoreEnterpriseAuditInfo.getProjectCoreEnterprise();
        //历史合作资料
        projectCoreEnterpriseFileService.lambdaUpdate().eq(ProjectCoreEnterpriseFile::getcProjectCoreEnterpriseId, projectCoreEnterprise.getId()).remove();
        List<ProjectCoreEnterpriseFile> projectCoreEnterpriseFiles = projectCoreEnterprise.getProjectCoreEnterpriseFiles();
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseFiles)) {
            for (ProjectCoreEnterpriseFile projectCoreEnterpriseFile : projectCoreEnterpriseFiles) {
                projectCoreEnterpriseFile.setcProjectCoreEnterpriseId(projectCoreEnterprise.getId());
                projectCoreEnterpriseFileService.save(projectCoreEnterpriseFile);
                List<Long> fileIds = projectCoreEnterpriseFile.getFileIds();
                fileService.updateBusinessId(fileIds, projectCoreEnterpriseFile.getId());
            }
        }
        ProjectInformation projectInformation = projectInformationService.get(projectCoreEnterprise.getcProjectInformationId());
        CEnterpriseHistory cEnterpriseHistory = enterpriseHistoryService.getById(projectCoreEnterprise.getcEnterpriseHistoryId());
        //信用评级
        List<EnterpriseCreditRating> enterpriseCreditRatings = enterpriseCreditRatingService.lambdaQuery().eq(EnterpriseCreditRating::getName, cEnterpriseHistory.getCorporateName()).list();
        if (projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals("enterpriseNature_1")) {
            projectCoreEnterpriseAuditInfo.setCreditRating("事业单位");
        } else {
            if (CollectionUtil.isNotEmpty(enterpriseCreditRatings)) {
                projectCoreEnterpriseAuditInfo.setCreditRating(enterpriseCreditRatings.get(0).getLevel());
            } else {
                projectCoreEnterpriseAuditInfo.setCreditRating("暂无外部信用级别");
            }
        }
        projectCoreEnterpriseAuditInfo.setcProjectCoreEnterpriseId(projectCoreEnterprise.getId());
        saveOrUpdate(projectCoreEnterpriseAuditInfo);
        //民间借贷
        projectCoreEnterprisePrivateLendingService.lambdaUpdate().eq(ProjectCoreEnterprisePrivateLending::getProjectCoreEnterpriseAuditId,projectCoreEnterpriseAuditInfo.getId()).remove();
        List<ProjectCoreEnterprisePrivateLending> projectCoreEnterprisePrivateLendingList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterprisePrivateLendingList();
        if (CollectionUtil.isNotEmpty(projectCoreEnterprisePrivateLendingList)) {
            for (ProjectCoreEnterprisePrivateLending projectCoreEnterprisePrivateLending : projectCoreEnterprisePrivateLendingList) {
                projectCoreEnterprisePrivateLending.setProjectCoreEnterpriseAuditId(projectCoreEnterpriseAuditInfo.getId());
                projectCoreEnterprisePrivateLendingService.save(projectCoreEnterprisePrivateLending);
            }
        }
        //股权冻结
        projectCoreEnterpriseEquityFreezeService.lambdaUpdate().eq(ProjectCoreEnterpriseEquityFreeze::getProjectCoreEnterpriseAuditId,projectCoreEnterpriseAuditInfo.getId()).remove();
        List<ProjectCoreEnterpriseEquityFreeze> projectCoreEnterpriseEquityFreezeList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseEquityFreezeList();
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseEquityFreezeList)) {
            for (ProjectCoreEnterpriseEquityFreeze projectCoreEnterpriseEquityFreeze : projectCoreEnterpriseEquityFreezeList) {
                projectCoreEnterpriseEquityFreeze.setProjectCoreEnterpriseAuditId(projectCoreEnterpriseAuditInfo.getId());
                projectCoreEnterpriseEquityFreezeService.save(projectCoreEnterpriseEquityFreeze);
            }
        }
        //重大异常诉讼
        projectCoreEnterpriseMajorAbnormalLitigationService.lambdaUpdate().eq(ProjectCoreEnterpriseMajorAbnormalLitigation::getProjectCoreEnterpriseAuditId,projectCoreEnterpriseAuditInfo.getId()).remove();
        List<ProjectCoreEnterpriseMajorAbnormalLitigation> projectCoreEnterpriseMajorAbnormalLitigationList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseMajorAbnormalLitigationList();
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseMajorAbnormalLitigationList)) {
            for (ProjectCoreEnterpriseMajorAbnormalLitigation projectCoreEnterpriseMajorAbnormalLitigation : projectCoreEnterpriseMajorAbnormalLitigationList) {
                projectCoreEnterpriseMajorAbnormalLitigation.setProjectCoreEnterpriseAuditId(projectCoreEnterpriseAuditInfo.getId());
                projectCoreEnterpriseMajorAbnormalLitigationService.save(projectCoreEnterpriseMajorAbnormalLitigation);
            }
        }
        //严重违法
        projectCoreEnterpriseSeriousIllegalityService.lambdaUpdate().eq(ProjectCoreEnterpriseSeriousIllegality::getProjectCoreEnterpriseAuditId,projectCoreEnterpriseAuditInfo.getId()).remove();
        List<ProjectCoreEnterpriseSeriousIllegality> projectCoreEnterpriseSeriousIllegalityList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseSeriousIllegalityList();
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseSeriousIllegalityList)) {
            for (ProjectCoreEnterpriseSeriousIllegality projectCoreEnterpriseSeriousIllegality : projectCoreEnterpriseSeriousIllegalityList) {
                projectCoreEnterpriseSeriousIllegality.setProjectCoreEnterpriseAuditId(projectCoreEnterpriseAuditInfo.getId());
                projectCoreEnterpriseSeriousIllegalityService.save(projectCoreEnterpriseSeriousIllegality);
            }
        }
        //欠税公告
        projectCoreEnterpriseTaxOweNoticeService.lambdaUpdate().eq(ProjectCoreEnterpriseTaxOweNotice::getProjectCoreEnterpriseAuditId,projectCoreEnterpriseAuditInfo.getId()).remove();
        List<ProjectCoreEnterpriseTaxOweNotice> projectCoreEnterpriseTaxOweNoticeList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseTaxOweNoticeList();
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseTaxOweNoticeList)) {
            for (ProjectCoreEnterpriseTaxOweNotice projectCoreEnterpriseTaxOweNotice : projectCoreEnterpriseTaxOweNoticeList) {
                projectCoreEnterpriseTaxOweNotice.setProjectCoreEnterpriseAuditId(projectCoreEnterpriseAuditInfo.getId());
                projectCoreEnterpriseTaxOweNoticeService.save(projectCoreEnterpriseTaxOweNotice);
            }
        }
        //税收违法
        projectCoreEnterpriseTaxIllegalDataService.lambdaUpdate().eq(ProjectCoreEnterpriseTaxIllegalData::getProjectCoreEnterpriseAuditId,projectCoreEnterpriseAuditInfo.getId()).remove();
        List<ProjectCoreEnterpriseTaxIllegalData> projectCoreEnterpriseTaxIllegalDataList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseTaxIllegalDataList();
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseTaxIllegalDataList)) {
            for (ProjectCoreEnterpriseTaxIllegalData projectCoreEnterpriseTaxIllegalData : projectCoreEnterpriseTaxIllegalDataList) {
                projectCoreEnterpriseTaxIllegalData.setProjectCoreEnterpriseAuditId(projectCoreEnterpriseAuditInfo.getId());
                projectCoreEnterpriseTaxIllegalDataService.save(projectCoreEnterpriseTaxIllegalData);
            }
        }
        //黑名单信息
        projectCoreEnterpriseBlacklistService.lambdaUpdate().eq(ProjectCoreEnterpriseBlacklist::getProjectCoreEnterpriseAuditId,projectCoreEnterpriseAuditInfo.getId()).remove();
        List<ProjectCoreEnterpriseBlacklist> projectCoreEnterpriseBlacklistList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseBlacklistList();
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseBlacklistList)) {
            for (ProjectCoreEnterpriseBlacklist projectCoreEnterpriseBlacklist : projectCoreEnterpriseBlacklistList) {
                projectCoreEnterpriseBlacklist.setProjectCoreEnterpriseAuditId(projectCoreEnterpriseAuditInfo.getId());
                projectCoreEnterpriseBlacklistService.save(projectCoreEnterpriseBlacklist);
            }
        }
        //其他经营异常
        projectCoreEnterpriseExceptionDataService.lambdaUpdate().eq(ProjectCoreEnterpriseExceptionData::getProjectCoreEnterpriseAuditId,projectCoreEnterpriseAuditInfo.getId()).remove();
        List<ProjectCoreEnterpriseExceptionData> projectCoreEnterpriseExceptionDataList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseExceptionDataList();
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseExceptionDataList)) {
            for (ProjectCoreEnterpriseExceptionData projectCoreEnterpriseExceptionData : projectCoreEnterpriseExceptionDataList) {
                projectCoreEnterpriseExceptionData.setProjectCoreEnterpriseAuditId(projectCoreEnterpriseAuditInfo.getId());
                projectCoreEnterpriseExceptionDataService.save(projectCoreEnterpriseExceptionData);
            }
        }
        //重大负面新闻舆情
        projectCoreEnterpriseNewsService.lambdaUpdate().eq(ProjectCoreEnterpriseNews::getProjectCoreEnterpriseAuditId,projectCoreEnterpriseAuditInfo.getId()).remove();
        List<ProjectCoreEnterpriseNews> projectCoreEnterpriseNewsList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseNewsList();
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseNewsList)) {
            for (ProjectCoreEnterpriseNews projectCoreEnterpriseNews : projectCoreEnterpriseNewsList) {
                projectCoreEnterpriseNews.setProjectCoreEnterpriseAuditId(projectCoreEnterpriseAuditInfo.getId());
                projectCoreEnterpriseNewsService.save(projectCoreEnterpriseNews);
            }
        }
        projectCoreEnterpriseService.updateById(projectCoreEnterprise);
        if(projectCoreEnterpriseAuditInfo.getVisible() == 1){
            //一键测算
            projectCoreEnterpriseComprehensiveEvaluationService.lambdaUpdate().eq(ProjectCoreEnterpriseComprehensiveEvaluation::getProjectCoreEnterpriseAuditId,projectCoreEnterpriseAuditInfo.getId()).remove();
            ProjectCoreEnterpriseComprehensiveEvaluation projectCoreEnterpriseComprehensiveEvaluation = measurement(projectCoreEnterpriseAuditInfo.getId(), projectCoreEnterpriseAuditInfo);
            List<String> errors = projectCoreEnterpriseComprehensiveEvaluation.getErrors();
            if (CollectionUtil.isNotEmpty(errors)) {
                Enterprise enterprise = enterpriseService.getById(projectCoreEnterprise.getcEnterpriseId());
                String errorString = enterprise.getCorporateName() + "的企业不准入原因:" + errors.stream().collect(Collectors.joining(","));
                projectCoreEnterprise.setErrorsString(errorString);
            }
            projectCoreEnterpriseComprehensiveEvaluation.setProjectCoreEnterpriseAuditId(projectCoreEnterpriseAuditInfo.getId());
            projectCoreEnterpriseComprehensiveEvaluationService.save(projectCoreEnterpriseComprehensiveEvaluation);
            //流程处理
            Map<String, Object> msgVariables = new HashMap<>();
            msgVariables.put(ConstantUtil.FLOWABLE_MSG_TITLE, "核心企业名称：" + cEnterpriseHistory.getCorporateName());
            msgVariables.put(ConstantUtil.FLOWABLE_MSG_CONTENT,
                    "核心企业名称“" + cEnterpriseHistory.getCorporateName() + "”的核心企业已审核完成“"
                            + ConstantUtil.FLOWABLE_MSG_ASSIGNEE);
            flowableService.completeMyTask(projectCoreEnterpriseAuditInfo.getTaskId(), projectCoreEnterprise, null, null, projectCoreEnterpriseAuditInfo.getId(), msgVariables, ConstantUtil.PROJECT_CORE_ENTERPRISE);
            if (projectCoreEnterpriseComprehensiveEvaluation.getAdmitted().equals(ProjectCoreEnterpriseScoringModel.ADMITTED)) {
                projectCoreEnterprise.setStatusStr(ProjectAndEnterpriseStatusEnums.CREDIT_SUCCESS.getCode());
                if (projectInformation.getcEnterpriseId() == null) {
                    projectInformation.setStatusStr(ProjectAndEnterpriseStatusEnums.CREDIT_SUCCESS.getCode());
                    projectInformationService.updateById(projectInformation);
                }
            } else {
                projectCoreEnterprise.setStatusStr(ProjectAndEnterpriseStatusEnums.VOTE.getCode());
                if (projectInformation.getcEnterpriseId() == null) {
                    projectInformation.setStatusStr(ProjectAndEnterpriseStatusEnums.VOTE.getCode());
                    projectInformationService.updateById(projectInformation);
                }
            }
            projectCoreEnterpriseService.updateById(projectCoreEnterprise);
            //判断是否开启授信决议
            if (projectInformation.getStatusStr().equals(ProjectAndEnterpriseStatusEnums.CREDIT_SUCCESS.getCode())) {
                projectCoreEnterprise = projectCoreEnterpriseService.lambdaQuery().eq(ProjectCoreEnterprise::getcProjectInformationId, projectInformation.getId()).one();
                if (projectCoreEnterprise.getStatusStr().equals(ProjectAndEnterpriseStatusEnums.CREDIT_SUCCESS.getCode())) {
                    SupplierInfo supplierInfo = supplierInfoService.get(projectInformation.getcSupplierInfoId());
                    if (supplierInfo.getStatusStr().equals(SupplierStatusEnums.CREDIT_SUCCESS.getCode())) {
                        //开启流程
                        creditResolutionService.startProcess(projectInformation.getId());
                    }
                }
            }
        }
    }

    @Override
    public ProjectCoreEnterpriseComprehensiveEvaluation measurement(Long projectCoreEnterpriseAuditId, ProjectCoreEnterpriseAudit projectCoreEnterpriseAuditInfo) {
        ProjectCoreEnterpriseScore projectCoreEnterpriseScore = new ProjectCoreEnterpriseScore();
        ProjectCoreEnterprise projectCoreEnterprise = projectCoreEnterpriseAuditInfo.getProjectCoreEnterprise();
        CEnterpriseHistory enterprise = enterpriseHistoryService.getById(projectCoreEnterprise.getcEnterpriseHistoryId());
        //成立年限
        BigDecimal establishmentPeriodScore = BigDecimal.ZERO;
        if (projectCoreEnterprise.getCentralizedProcurementPlatform().equals(1)) {
            Date date = DateUtil.addYears(enterprise.getStartSate(), 2);
            if (date.compareTo(new Date()) < 1) {
                establishmentPeriodScore = ProjectCoreEnterpriseScoringModel.START_DATE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.START_DATE_STANDARD);
            }
        } else {
            Date date = DateUtil.addYears(enterprise.getStartSate(), 5);
            if (date.compareTo(new Date()) < 1) {
                establishmentPeriodScore = ProjectCoreEnterpriseScoringModel.START_DATE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.START_DATE_STANDARD);
            }
        }
        projectCoreEnterpriseScore.setEstablishmentPeriodScore(establishmentPeriodScore);
        //注册资本得分
        BigDecimal registeredCapitalScore = BigDecimal.ZERO;
        String registeredCapital = enterprise.getRegisteredCapital().replace("万元人民币", "");
        if (new BigDecimal(registeredCapital).compareTo(new BigDecimal("5000")) == 1 && new BigDecimal(registeredCapital).compareTo(new BigDecimal("100000")) < 1) {
            registeredCapitalScore = ProjectCoreEnterpriseScoringModel.REGISTERED_CAPITAL_RATIO.multiply(ProjectCoreEnterpriseScoringModel.REGISTERED_CAPITAL_STANDARD_ONE);
        } else if (new BigDecimal(registeredCapital).compareTo(new BigDecimal("100000")) == 1 && new BigDecimal(registeredCapital).compareTo(new BigDecimal("500000")) < 1) {
            registeredCapitalScore = ProjectCoreEnterpriseScoringModel.REGISTERED_CAPITAL_RATIO.multiply(ProjectCoreEnterpriseScoringModel.REGISTERED_CAPITAL_STANDARD_TWO);
        } else if (new BigDecimal(registeredCapital).compareTo(new BigDecimal("500000")) == 1) {
            registeredCapitalScore = ProjectCoreEnterpriseScoringModel.REGISTERED_CAPITAL_RATIO.multiply(ProjectCoreEnterpriseScoringModel.REGISTERED_CAPITAL_STANDARD_THREE);
        }
        projectCoreEnterpriseScore.setRegisteredCapitalScore(registeredCapitalScore);
        //经营地址得分
        BigDecimal businessAddressScore;
        String businessAddress = enterprise.getBusinessAddress();
        if (businessAddress.contains("黑龙江") || businessAddress.contains("辽宁") || businessAddress.contains("吉林")) {
            businessAddressScore = BigDecimal.ZERO;
        } else {
            businessAddressScore = ProjectCoreEnterpriseScoringModel.BUSINESS_ADDRESS_RATIO.multiply(ProjectCoreEnterpriseScoringModel.BUSINESS_ADDRESS_TANDARD);
        }
        projectCoreEnterpriseScore.setBusinessAddressScore(businessAddressScore);
        //企业性质得分
        BigDecimal enterpriseNatureScore = BigDecimal.ZERO;
        if (projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals(EnterpriseNatureDict.ChildEnum.ONE.getCode())) {
            enterpriseNatureScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_STANDARD_ONE);
        } else if (projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals(EnterpriseNatureDict.ChildEnum.TWO.getCode())) {
            enterpriseNatureScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_STANDARD_TWO);
        } else if (projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals(EnterpriseNatureDict.ChildEnum.THREE.getCode())) {
            enterpriseNatureScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_STANDARD_THREE);
        } else if (projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals(EnterpriseNatureDict.ChildEnum.FORE.getCode())) {
            enterpriseNatureScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_STANDARD_FORE);
        } else if (projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals(EnterpriseNatureDict.ChildEnum.FIVE.getCode())) {
            enterpriseNatureScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_STANDARD_FIVE);
        } else if (projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals(EnterpriseNatureDict.ChildEnum.SIX.getCode())) {
            enterpriseNatureScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_STANDARD_SIX);
        } else if (projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals(EnterpriseNatureDict.ChildEnum.SEVEN.getCode())) {
            enterpriseNatureScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ENTERPRISE_NATURE_STANDARD_SEVEN);
        } else if (projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals(EnterpriseNatureDict.ChildEnum.EIGHT.getCode())) {
            enterpriseNatureScore = BigDecimal.ZERO;
        }
        projectCoreEnterpriseScore.setEnterpriseNatureScore(enterpriseNatureScore);
        //控股比例得分
        BigDecimal holdingRatioScore = BigDecimal.ZERO;
        if (projectCoreEnterpriseAuditInfo.getHoldingRatio().equals(HoldingRatioDict.ChildEnum.ONE.getCode())) {
            holdingRatioScore = BigDecimal.ZERO;
        } else if (projectCoreEnterpriseAuditInfo.getHoldingRatio().equals(HoldingRatioDict.ChildEnum.TWO.getCode())) {
            holdingRatioScore = ProjectCoreEnterpriseScoringModel.HOLDING_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HOLDING_RATIO_STANDARD_TWO);
        } else if (projectCoreEnterpriseAuditInfo.getHoldingRatio().equals(HoldingRatioDict.ChildEnum.THREE.getCode())) {
            holdingRatioScore = ProjectCoreEnterpriseScoringModel.HOLDING_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HOLDING_RATIO_STANDARD_THREE);
        }
        projectCoreEnterpriseScore.setHoldingRatioScore(holdingRatioScore);
        //股权层级得分
        BigDecimal equityHierarchyScore = BigDecimal.ZERO;
        if (projectCoreEnterpriseAuditInfo.getEquityHierarchy().equals(EquityHierarchyDict.ChildEnum.ONE.getCode())) {
            if (projectCoreEnterpriseAuditInfo.getEquityHierarchyDetail().equals(EquityHierarchyDetailOneDict.ChildEnum.ONE.getCode())) {
                equityHierarchyScore = ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_RATIO.multiply(ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_STANDARD_ONE);
            } else if (projectCoreEnterpriseAuditInfo.getEquityHierarchyDetail().equals(EquityHierarchyDetailOneDict.ChildEnum.TWO.getCode())) {
                equityHierarchyScore = ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_RATIO.multiply(ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_STANDARD_TWO);
            } else if (projectCoreEnterpriseAuditInfo.getEquityHierarchyDetail().equals(EquityHierarchyDetailOneDict.ChildEnum.THREE.getCode())) {
                equityHierarchyScore = ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_RATIO.multiply(ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_STANDARD_THREE);
            } else if (projectCoreEnterpriseAuditInfo.getEquityHierarchyDetail().equals(EquityHierarchyDetailOneDict.ChildEnum.FORE.getCode())) {
                equityHierarchyScore = BigDecimal.ZERO;
            }
        } else if (projectCoreEnterpriseAuditInfo.getEquityHierarchy().equals(EquityHierarchyDict.ChildEnum.TWO.getCode())) {
            if (projectCoreEnterpriseAuditInfo.getEquityHierarchyDetail().equals(EquityHierarchyDetailTwoDict.ChildEnum.ONE.getCode())) {
                equityHierarchyScore = ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_RATIO.multiply(ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_STANDARD_FIVE);
            } else if (projectCoreEnterpriseAuditInfo.getEquityHierarchyDetail().equals(EquityHierarchyDetailTwoDict.ChildEnum.TWO.getCode())) {
                equityHierarchyScore = ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_RATIO.multiply(ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_STANDARD_SIX);
            } else if (projectCoreEnterpriseAuditInfo.getEquityHierarchyDetail().equals(EquityHierarchyDetailTwoDict.ChildEnum.THREE.getCode())) {
                equityHierarchyScore = ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_RATIO.multiply(ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_STANDARD_SEVEN);
            } else if (projectCoreEnterpriseAuditInfo.getEquityHierarchyDetail().equals(EquityHierarchyDetailTwoDict.ChildEnum.FORE.getCode())) {
                equityHierarchyScore = ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_RATIO.multiply(ProjectCoreEnterpriseScoringModel.EQUITY_HIERARCHY_STANDARD_EIGHT);
            } else if (projectCoreEnterpriseAuditInfo.getEquityHierarchyDetail().equals(EquityHierarchyDetailTwoDict.ChildEnum.FIVE.getCode())) {
                equityHierarchyScore = BigDecimal.ZERO;
            } else if (projectCoreEnterpriseAuditInfo.getEquityHierarchyDetail().equals(EquityHierarchyDetailTwoDict.ChildEnum.SIX.getCode())) {
                equityHierarchyScore = ProjectScoringModel.EQUITY_HIERARCHY_RATIO.multiply(ProjectScoringModel.EQUITY_HIERARCHY_STANDARD_TEN);
            }
        }
        projectCoreEnterpriseScore.setEquityHierarchyScore(equityHierarchyScore);
        //信用评级
        List<EnterpriseCreditRating> enterpriseCreditRatings = enterpriseCreditRatingService.lambdaQuery().eq(EnterpriseCreditRating::getName, enterprise.getCorporateName()).list();
        if (projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals("enterpriseNature_1")) {
            projectCoreEnterpriseAuditInfo.setCreditRating("事业单位");
        } else {
            if (CollectionUtil.isNotEmpty(enterpriseCreditRatings)) {
                projectCoreEnterpriseAuditInfo.setCreditRating(enterpriseCreditRatings.get(0).getLevel());
            } else {
                projectCoreEnterpriseAuditInfo.setCreditRating("暂无外部信用级别");
            }
        }
        BigDecimal creditRatingScore;
        if (projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals("事业单位")) {
            creditRatingScore = ProjectCoreEnterpriseScoringModel.CREDIT_RATING_RATIO.multiply(ProjectCoreEnterpriseScoringModel.CREDIT_RATING_STANDARD_ONE);
        } else if (projectCoreEnterpriseAuditInfo.getCreditRating().equals("AAA-") || projectCoreEnterpriseAuditInfo.getCreditRating().equals("AAA+") || projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals("AAA")) {
            creditRatingScore = ProjectCoreEnterpriseScoringModel.CREDIT_RATING_RATIO.multiply(ProjectCoreEnterpriseScoringModel.CREDIT_RATING_STANDARD_TWO);
        } else if (projectCoreEnterpriseAuditInfo.getCreditRating().equals("AA-") || projectCoreEnterpriseAuditInfo.getCreditRating().equals("AA+") || projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals("AA")) {
            creditRatingScore = ProjectCoreEnterpriseScoringModel.CREDIT_RATING_RATIO.multiply(ProjectCoreEnterpriseScoringModel.CREDIT_RATING_STANDARD_THREE);
        } else if (projectCoreEnterpriseAuditInfo.getCreditRating().equals("A-") || projectCoreEnterpriseAuditInfo.getCreditRating().equals("A+") || projectCoreEnterpriseAuditInfo.getEnterpriseNature().equals("A")) {
            creditRatingScore = ProjectCoreEnterpriseScoringModel.CREDIT_RATING_RATIO.multiply(ProjectCoreEnterpriseScoringModel.CREDIT_RATING_STANDARD_FORE);
        } else {
            creditRatingScore = ProjectCoreEnterpriseScoringModel.CREDIT_RATING_RATIO.multiply(ProjectCoreEnterpriseScoringModel.CREDIT_RATING_STANDARD_FIVE);
        }
        projectCoreEnterpriseScore.setCreditRatingScore(creditRatingScore);
        //企业基本变动信息
        String getChangesUrl = getChanges + "?comprehensiveRiskInvestigationId=" + enterprise.getcComprehensiveRiskInvestigationId();
        Integer changes = restTemplate.getForObject(getChangesUrl, Integer.class);
        projectCoreEnterpriseScore.setEnterpriseChange(changes);
        //企业基本变动信息得分
        BigDecimal enterpriseChangeScore = BigDecimal.ZERO;
        if (changes < 2) {
            enterpriseChangeScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.CHANGE_COUNT_STANDARD);
        }
        projectCoreEnterpriseScore.setEnterpriseChangeScore(enterpriseChangeScore);
        String getProjectCoreEnterpriseScoreUrl = getProjectCoreEnterpriseScore + "?comprehensiveRiskInvestigationId=" + enterprise.getcComprehensiveRiskInvestigationId() + "&dongjiangaoRiskId=" + enterprise.getcDongjiangaoRiskId();
        ResponseJson forObject = restTemplate.getForObject(getProjectCoreEnterpriseScoreUrl, ResponseJson.class);
        List<String> errors = new ArrayList();
        String admitted = ProjectCoreEnterpriseScoringModel.ADMITTED;
        if (forObject != null) {
            JSONObject jsonObject = new JSONObject(forObject.getData());
            //失信被执行信息 失信被执行信息得分
            Integer zhixing = jsonObject.getInt("zhixing");
            BigDecimal shiXinScore = BigDecimal.ZERO;
            if (zhixing > 0) {
                projectCoreEnterpriseScore.setShiXin(1);
            } else {
                shiXinScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.SHI_XIN_STANDARD);
                projectCoreEnterpriseScore.setShiXin(0);
            }
            projectCoreEnterpriseScore.setShiXinScore(shiXinScore);
            //限高消费情况（企业） 限高消费情况（企业）得分
            Integer stCount = jsonObject.getInt("stCount");
            BigDecimal stCountScore = BigDecimal.ZERO;
            if (stCount > 0) {
                projectCoreEnterpriseScore.setStCount(1);
            } else {
                projectCoreEnterpriseScore.setStCount(0);
                stCountScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ST_COUNT_STANDARD_ONE);
            }
            projectCoreEnterpriseScore.setStCountScore(stCountScore);
            //限高消费情况（法人）  限高消费情况（法人）得分
            Integer stCountPerson = jsonObject.getInt("stCountPerson");
            BigDecimal stCountPersonScore = BigDecimal.ZERO;
            if (stCountPerson > 0) {
                projectCoreEnterpriseScore.setStCountPerson(1);
            } else {
                projectCoreEnterpriseScore.setStCountPerson(0);
                stCountPersonScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ST_COUNT_STANDARD_TWO);
            }
            projectCoreEnterpriseScore.setStCountPersonScore(stCountPersonScore);
            //当前被执行金额  当前被执行金额得分
            BigDecimal zhixingAmount = jsonObject.getBigDecimal("zhixingAmount");
            projectCoreEnterpriseScore.setZhiXingAmount(zhixingAmount);
            BigDecimal zhiXingAmountScore = BigDecimal.ZERO;
            if (zhixingAmount.compareTo(new BigDecimal(enterprise.getRegisteredCapital().replace("万元人民币", "")).multiply(new BigDecimal("10000")).multiply(new BigDecimal("0.02"))) < 1) {
                zhiXingAmountScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ZHI_XING_STANDARD_ONE);
            }else if(zhixingAmount.compareTo(new BigDecimal(enterprise.getRegisteredCapital().replace("万元人民币", "")).multiply(new BigDecimal("10000")).multiply(new BigDecimal("0.02"))) == 1){
                admitted = ProjectCoreEnterpriseScoringModel.NOT_ADMITTED;
                errors.add("当前被执行金额不准入！");
            }
            projectCoreEnterpriseScore.setZhiXingAmountScore(zhiXingAmountScore);
            //当前被执行频率 当前被执行频率得分
            Long zhixingFrequent = jsonObject.getLong("zhixingFrequent");
            projectCoreEnterpriseScore.setZhiXingFrequent(zhixingFrequent);
            BigDecimal zhiXingFrequentScore = BigDecimal.ZERO;
            if (zhixingFrequent <= 5) {
                zhiXingFrequentScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ZHI_XING_STANDARD_TWO);
            }
            projectCoreEnterpriseScore.setZhiXingFrequentScore(zhiXingFrequentScore);
            //历史涉诉金额 历史涉诉金额得分
            BigDecimal historicalLitigationAmount = jsonObject.getBigDecimal("historicalLitigationAmount");
            projectCoreEnterpriseScore.setHistoricalLitigationAmount(historicalLitigationAmount);
            BigDecimal historicalLitigationAmountScore = BigDecimal.ZERO;
            if (historicalLitigationAmount.compareTo(new BigDecimal(enterprise.getRegisteredCapital().replace("万元人民币", "")).multiply(new BigDecimal("10000")).multiply(new BigDecimal("0.1"))) < 1) {
                historicalLitigationAmountScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.INVOLVING_STANDARD_ONE);
            }
            projectCoreEnterpriseScore.setHistoricalLitigationAmountScore(historicalLitigationAmountScore);
            //历史涉诉数量（近一年） 历史涉诉数量（近一年）得分
            Long historicalLitigationCount = jsonObject.getLong("historicalLitigationCount");
            projectCoreEnterpriseScore.setHistoricalLitigationCount(historicalLitigationCount);
            BigDecimal historicalLitigationCountScore = BigDecimal.ZERO;
            if (historicalLitigationCount <= 100) {
                historicalLitigationCountScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.INVOLVING_STANDARD_TWO);
            }
            projectCoreEnterpriseScore.setHistoricalLitigationCountScore(historicalLitigationCountScore);
            //金融机构被告案件 金融机构被告案件得分
            Long documentFinance = jsonObject.getLong("documentFinance");
            BigDecimal financialInstitutionScore = BigDecimal.ZERO;
            if (documentFinance > 0) {
                projectCoreEnterpriseScore.setFinancialInstitution(1);
            } else {
                projectCoreEnterpriseScore.setFinancialInstitution(0);
                financialInstitutionScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.INVOLVING_STANDARD_FORE);
            }
            projectCoreEnterpriseScore.setFinancialInstitutionScore(financialInstitutionScore);
            //行政处罚数量 行政处罚数量得分
            Long administrativePenaltyCount = jsonObject.getLong("administrativePenaltyCount");
            BigDecimal administrativePenaltyCountScore = BigDecimal.ZERO;
            projectCoreEnterpriseScore.setAdministrativePenaltyCount(administrativePenaltyCount);
            if (administrativePenaltyCount <= 3) {
                administrativePenaltyCountScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ADMINISTRATIVE_PENALTY_STANDARD_ONE);
            }
            projectCoreEnterpriseScore.setAdministrativePenaltyCountScore(administrativePenaltyCountScore);
            //行政处罚金额  行政处罚金额得分
            BigDecimal administrativePenaltyAmount = jsonObject.getBigDecimal("administrativePenaltyAmount");
            BigDecimal administrativePenaltyAmountScore = BigDecimal.ZERO;
            projectCoreEnterpriseScore.setAdministrativePenaltyAmount(administrativePenaltyAmount);
            if (administrativePenaltyAmount.compareTo(new BigDecimal("50")) < 1) {
                administrativePenaltyAmountScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ADMINISTRATIVE_PENALTY_STANDARD_TWO);
            }
            projectCoreEnterpriseScore.setAdministrativePenaltyAmountScore(administrativePenaltyAmountScore);
            //环保处罚金额 环保处罚金额得分
            BigDecimal envPunishmentAmount = jsonObject.getBigDecimal("envPunishmentAmount");
            projectCoreEnterpriseScore.setEnvironmentalPenaltiesAmount(envPunishmentAmount);
            BigDecimal environmentalPenaltiesAmountScore = BigDecimal.ZERO;
            if (envPunishmentAmount.compareTo(new BigDecimal("50")) < 1) {
                environmentalPenaltiesAmountScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ADMINISTRATIVE_PENALTY_STANDARD_THREE);
            }
            projectCoreEnterpriseScore.setEnvironmentalPenaltiesAmountScore(environmentalPenaltiesAmountScore);
        }
        //民间借贷被告记录  民间借贷被告记录得分
        projectCoreEnterpriseScore.setPrivateLending(0);
        BigDecimal privateLendingScore = BigDecimal.ZERO;
        List<ProjectCoreEnterprisePrivateLending> projectCoreEnterprisePrivateLendingList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterprisePrivateLendingList();
        if (CollectionUtil.isNotEmpty(projectCoreEnterprisePrivateLendingList)) {
            long count = projectCoreEnterprisePrivateLendingList.stream().filter(r -> r.getPrivateLending().equals(1)).count();
            if (count > 0) {
                projectCoreEnterpriseScore.setPrivateLending(1);
            } else {
                privateLendingScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.INVOLVING_STANDARD_THREE);
            }
        } else {
            privateLendingScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.INVOLVING_STANDARD_THREE);
        }
        projectCoreEnterpriseScore.setPrivateLendingScore(privateLendingScore);
        //股权冻结 股权冻结得分
        List<ProjectCoreEnterpriseEquityFreeze> projectCoreEnterpriseEquityFreezeList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseEquityFreezeList();
        projectCoreEnterpriseScore.setEquityFreeze(0);
        BigDecimal equityFreezeScore = BigDecimal.ZERO;
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseEquityFreezeList)) {
            long count = projectCoreEnterpriseEquityFreezeList.stream().filter(r -> r.getEquityFreeze().equals(1)).count();
            if (count > 0) {
                projectCoreEnterpriseScore.setEquityFreeze(1);
            } else {
                equityFreezeScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.INVOLVING_STANDARD_FIVE);
            }
        } else {
            equityFreezeScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.INVOLVING_STANDARD_FIVE);
        }
        projectCoreEnterpriseScore.setEquityFreezeScore(equityFreezeScore);
        //重大异常诉讼  重大异常诉讼得分
        List<ProjectCoreEnterpriseMajorAbnormalLitigation> projectCoreEnterpriseMajorAbnormalLitigationList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseMajorAbnormalLitigationList();
        BigDecimal majorAbnormalLitigationScore = BigDecimal.ZERO;
        projectCoreEnterpriseScore.setMajorAbnormalLitigation(0);
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseMajorAbnormalLitigationList)) {
            long count = projectCoreEnterpriseMajorAbnormalLitigationList.stream().filter(r -> r.getMajorAbnormalLitigation().equals(1)).count();
            if (count > 0) {
                projectCoreEnterpriseScore.setMajorAbnormalLitigation(1);
            } else {
                majorAbnormalLitigationScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.INVOLVING_STANDARD_SIX);
            }
        } else {
            majorAbnormalLitigationScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.INVOLVING_STANDARD_SIX);
        }
        projectCoreEnterpriseScore.setMajorAbnormalLitigationScore(majorAbnormalLitigationScore);
        //严重违法行为  严重违法行为得分
        List<ProjectCoreEnterpriseSeriousIllegality> projectCoreEnterpriseSeriousIllegalityList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseSeriousIllegalityList();
        BigDecimal seriousIllegalityScore = BigDecimal.ZERO;
        projectCoreEnterpriseScore.setSeriousIllegality(0);
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseSeriousIllegalityList)) {
            long count = projectCoreEnterpriseSeriousIllegalityList.stream().filter(r -> r.getSeriousIllegality().equals(1)).count();
            if (count > 0) {
                projectCoreEnterpriseScore.setSeriousIllegality(1);
            } else {
                seriousIllegalityScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.BUSINESS_ABNORMALITIES_STANDARD_ONE);
            }
        } else {
            seriousIllegalityScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.BUSINESS_ABNORMALITIES_STANDARD_ONE);
        }
        projectCoreEnterpriseScore.setSeriousIllegalityScore(seriousIllegalityScore);
        //欠税公告  欠税公告得分
        List<ProjectCoreEnterpriseTaxOweNotice> projectCoreEnterpriseTaxOweNoticeList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseTaxOweNoticeList();
        BigDecimal taxOweNoticeScore = BigDecimal.ZERO;
        projectCoreEnterpriseScore.setTaxOweNotice(0);
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseTaxOweNoticeList)) {
            long count = projectCoreEnterpriseTaxOweNoticeList.stream().filter(r -> r.getTaxOweNotice().equals(1)).count();
            if (count > 0) {
                projectCoreEnterpriseScore.setTaxOweNotice(1);
            } else {
                taxOweNoticeScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.BUSINESS_ABNORMALITIES_STANDARD_TWO);
            }
        } else {
            taxOweNoticeScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.BUSINESS_ABNORMALITIES_STANDARD_TWO);
        }
        projectCoreEnterpriseScore.setTaxOweNoticeScore(taxOweNoticeScore);
        //税收违法 税收违法得分
        List<ProjectCoreEnterpriseTaxIllegalData> projectCoreEnterpriseTaxIllegalDataList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseTaxIllegalDataList();
        BigDecimal taxIllegalScore = BigDecimal.ZERO;
        projectCoreEnterpriseScore.setTaxIllegal(0);
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseTaxIllegalDataList)) {
            long count = projectCoreEnterpriseTaxIllegalDataList.stream().filter(r -> r.getTaxIllegal().equals(1)).count();
            if (count > 0) {
                projectCoreEnterpriseScore.setTaxIllegal(1);
            } else {
                taxIllegalScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.BUSINESS_ABNORMALITIES_STANDARD_THREE);
            }
        } else {
            taxIllegalScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.BUSINESS_ABNORMALITIES_STANDARD_THREE);
        }
        projectCoreEnterpriseScore.setTaxIllegalScore(taxIllegalScore);
        //黑名单信息  黑名单信息得分
        List<ProjectCoreEnterpriseBlacklist> projectCoreEnterpriseBlacklistList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseBlacklistList();
        BigDecimal blacklistScore = BigDecimal.ZERO;
        projectCoreEnterpriseScore.setBlacklist(0);
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseBlacklistList)) {
            long count = projectCoreEnterpriseBlacklistList.stream().filter(r -> r.getBlacklist().equals(1)).count();
            if (count > 0) {
                projectCoreEnterpriseScore.setBlacklist(1);
            } else {
                blacklistScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.BUSINESS_ABNORMALITIES_STANDARD_FORE);
            }
        } else {
            blacklistScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.BUSINESS_ABNORMALITIES_STANDARD_FORE);
        }
        projectCoreEnterpriseScore.setBlacklistScore(blacklistScore);
        //其他经营异常 其他经营异常得分
        List<ProjectCoreEnterpriseExceptionData> projectCoreEnterpriseExceptionDataList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseExceptionDataList();
        BigDecimal exceptionScore = BigDecimal.ZERO;
        projectCoreEnterpriseScore.setException(0);
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseExceptionDataList)) {
            long count = projectCoreEnterpriseExceptionDataList.stream().filter(r -> r.getException().equals(1)).count();
            if (count > 0) {
                projectCoreEnterpriseScore.setException(1);
            } else {
                exceptionScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.BUSINESS_ABNORMALITIES_STANDARD_FIVE);
            }
        } else {
            exceptionScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.BUSINESS_ABNORMALITIES_STANDARD_FIVE);
        }
        projectCoreEnterpriseScore.setExceptionScore(exceptionScore);
        //重大负面新闻舆情 重大负面新闻舆情得分
        List<ProjectCoreEnterpriseNews> projectCoreEnterpriseNewsList = projectCoreEnterpriseAuditInfo.getProjectCoreEnterpriseNewsList();
        projectCoreEnterpriseScore.setNews(0);
        BigDecimal newsScore = BigDecimal.ZERO;
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseNewsList)) {
            long count = projectCoreEnterpriseNewsList.stream().filter(r -> r.getNews().equals(1)).count();
            if (count > 0) {
                projectCoreEnterpriseScore.setNews(1);
            } else {
                newsScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.NEWS_STANDARD_THREE);
            }
        } else {
            newsScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.NEWS_STANDARD_THREE);
        }
        projectCoreEnterpriseScore.setNewsScore(newsScore);
        if (projectCoreEnterprise.getHistoricalCooperation() == 1) {
            //历史合作时间得分
            BigDecimal historicalCooperationDurationScore = BigDecimal.ZERO;
            if (projectCoreEnterprise.getHistoricalCooperation().equals(1)) {
                if (projectCoreEnterprise.getHistoricalCooperationDuration().equals("c_core_enterprise_cooperation_time_1")) {
                    historicalCooperationDurationScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_A);
                } else if (projectCoreEnterprise.getHistoricalCooperationDuration().equals("c_core_enterprise_cooperation_time_2")) {
                    historicalCooperationDurationScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_B);
                } else if (projectCoreEnterprise.getHistoricalCooperationDuration().equals("c_core_enterprise_cooperation_time_3")) {
                    historicalCooperationDurationScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_C);
                }
            }
            projectCoreEnterpriseScore.setHistoricalCooperationDurationScore(historicalCooperationDurationScore);
            //历史合作规模得分
            BigDecimal historicalCooperationScaleScore = BigDecimal.ZERO;
            if (projectCoreEnterprise.getHistoricalCooperationScale().equals("c_core_enterprise_cooperation_scale_1")) {
                historicalCooperationScaleScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_D);
            } else if (projectCoreEnterprise.getHistoricalCooperationScale().equals("c_core_enterprise_cooperation_scale_2")) {
                historicalCooperationScaleScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_E);
            } else if (projectCoreEnterprise.getHistoricalCooperationScale().equals("c_core_enterprise_cooperation_scale_3")) {
                historicalCooperationScaleScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_F);
            }
            projectCoreEnterpriseScore.setHistoricalCooperationScaleScore(historicalCooperationScaleScore);
            //累计历史开票金额得分
            BigDecimal historicalCooperationInvoicingAmountScore = BigDecimal.ZERO;
            if (projectCoreEnterprise.getHistoricalCooperationInvoicingAmount().equals("c_core_enterprise_invoice_amount_1")) {
                historicalCooperationInvoicingAmountScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_J);
            } else if (projectCoreEnterprise.getHistoricalCooperationInvoicingAmount().equals("c_core_enterprise_invoice_amount_2")) {
                historicalCooperationInvoicingAmountScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_K);
            } else if (projectCoreEnterprise.getHistoricalCooperationInvoicingAmount().equals("c_core_enterprise_invoice_amount_3")) {
                historicalCooperationInvoicingAmountScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_L);
            }
            projectCoreEnterpriseScore.setHistoricalCooperationInvoicingAmountScore(historicalCooperationInvoicingAmountScore);
            //历史回款最长账期得分
            BigDecimal historicalCooperationMaximumAccountingPeriodScore = BigDecimal.ZERO;
            if (projectCoreEnterprise.getHistoricalCooperationMaximumAccountingPeriod().equals("c_core_enterprise_longest_accounting_period_1")) {
                historicalCooperationMaximumAccountingPeriodScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_M);
            } else if (projectCoreEnterprise.getHistoricalCooperationMaximumAccountingPeriod().equals("c_core_enterprise_longest_accounting_period_2")) {
                historicalCooperationMaximumAccountingPeriodScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_N);
            } else if (projectCoreEnterprise.getHistoricalCooperationMaximumAccountingPeriod().equals("c_core_enterprise_longest_accounting_period_3")) {
                historicalCooperationMaximumAccountingPeriodScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_O);
            } else if (projectCoreEnterprise.getHistoricalCooperationMaximumAccountingPeriod().equals("c_core_enterprise_longest_accounting_period_4")) {
                historicalCooperationMaximumAccountingPeriodScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_P);
            }
            projectCoreEnterpriseScore.setHistoricalCooperationMaximumAccountingPeriodScore(historicalCooperationMaximumAccountingPeriodScore);
            //历史合作项目数量得分
            BigDecimal historicalCooperationTimesScore = BigDecimal.ZERO;
            if (projectCoreEnterprise.getHistoricalCooperationTimes().equals("c_core_enterprise_cooperation_count_1")) {
                historicalCooperationTimesScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_G);
            } else if (projectCoreEnterprise.getHistoricalCooperationTimes().equals("c_core_enterprise_cooperation_count_2")) {
                historicalCooperationTimesScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_H);
            } else if (projectCoreEnterprise.getHistoricalCooperationTimes().equals("c_core_enterprise_cooperation_count_3")) {
                historicalCooperationTimesScore = ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_RATIO.multiply(ProjectCoreEnterpriseScoringModel.HISTORICAL_COOPERATION_STANDARD_I);
            }
            projectCoreEnterpriseScore.setHistoricalCooperationTimesScore(historicalCooperationTimesScore);
        } else {
            projectCoreEnterpriseScore.setHistoricalCooperationDurationScore(BigDecimal.ZERO);
            projectCoreEnterpriseScore.setHistoricalCooperationScaleScore(BigDecimal.ZERO);
            projectCoreEnterpriseScore.setHistoricalCooperationInvoicingAmountScore(BigDecimal.ZERO);
            projectCoreEnterpriseScore.setHistoricalCooperationMaximumAccountingPeriodScore(BigDecimal.ZERO);
            projectCoreEnterpriseScore.setHistoricalCooperationTimesScore(BigDecimal.ZERO);
        }
        BigDecimal fixedCredit = BigDecimal.ZERO;
        BigDecimal fixedCreditScore = BigDecimal.ZERO;
        BigDecimal specialQuota = BigDecimal.ZERO;
        BigDecimal specialQuotaScore = BigDecimal.ZERO;
        if (projectCoreEnterpriseScore.getEstablishmentPeriodScore().compareTo(BigDecimal.ZERO) == 0 || projectCoreEnterpriseScore.getRegisteredCapitalScore().compareTo(BigDecimal.ZERO) == 0
                || projectCoreEnterpriseScore.getEnterpriseNatureScore().compareTo(BigDecimal.ZERO) == 0 || projectCoreEnterpriseScore.getHoldingRatioScore().compareTo(BigDecimal.ZERO) == 0
                || projectCoreEnterpriseScore.getEquityHierarchyScore().compareTo(BigDecimal.ZERO) == 0 || projectCoreEnterpriseScore.getBusinessAddressScore().compareTo(BigDecimal.ZERO) == 0
                || projectCoreEnterpriseScore.getEnterpriseChangeScore().compareTo(BigDecimal.ZERO) == 0 || projectCoreEnterpriseScore.getShiXinScore().compareTo(BigDecimal.ZERO) == 0
                || projectCoreEnterpriseScore.getStCountScore().compareTo(BigDecimal.ZERO) == 0 || projectCoreEnterpriseScore.getStCountPersonScore().compareTo(BigDecimal.ZERO) == 0
                || projectCoreEnterpriseScore.getZhiXingAmountScore().compareTo(BigDecimal.ZERO) == 0 || projectCoreEnterpriseAuditInfo.getInvolvingLitigationAccess() == 0
                || projectCoreEnterpriseScore.getPrivateLendingScore().compareTo(BigDecimal.ZERO) == 0 || projectCoreEnterpriseScore.getFinancialInstitutionScore().compareTo(BigDecimal.ZERO) == 0
                || projectCoreEnterpriseScore.getEquityFreezeScore().compareTo(BigDecimal.ZERO) == 0 || projectCoreEnterpriseScore.getMajorAbnormalLitigationScore().compareTo(BigDecimal.ZERO) == 0
                || projectCoreEnterpriseScore.getSeriousIllegalityScore().compareTo(BigDecimal.ZERO) == 0 || projectCoreEnterpriseScore.getTaxOweNoticeScore().compareTo(BigDecimal.ZERO) == 0
                || projectCoreEnterpriseScore.getTaxIllegalScore().compareTo(BigDecimal.ZERO) == 0 || projectCoreEnterpriseScore.getBlacklistScore().compareTo(BigDecimal.ZERO) == 0
                || projectCoreEnterpriseScore.getExceptionScore().compareTo(BigDecimal.ZERO) == 0 || projectCoreEnterpriseAuditInfo.getAdministrativePenaltyAccess() == 0
                || projectCoreEnterpriseAuditInfo.getAdministrativePenaltyAmountAccess() == 0 || projectCoreEnterpriseAuditInfo.getEnvironmentalPenaltyAmountAccess() == 0) {
            if (projectCoreEnterpriseScore.getEstablishmentPeriodScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("成立年限不足！");
            }
            if (projectCoreEnterpriseScore.getRegisteredCapitalScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("注册资本不足！");
            }
            if (projectCoreEnterpriseScore.getEnterpriseNatureScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("企业性质不准入！");
            }
            if (projectCoreEnterpriseScore.getHoldingRatioScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("控股比例不准入！");
            }
            if (projectCoreEnterpriseScore.getEquityHierarchyScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("股权层级不准入！");
            }
            if (projectCoreEnterpriseScore.getBusinessAddressScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("经营地址不准入");
            }
            if (projectCoreEnterpriseScore.getEnterpriseChangeScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("企业基本变动信息不准入");
            }
            if (projectCoreEnterpriseScore.getShiXinScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("失信被执行信息不准入");
            }
            if (projectCoreEnterpriseScore.getStCountScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("限高消费情况（企业）不准入");
            }
            if (projectCoreEnterpriseScore.getStCountPersonScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("限高消费情况（法人）不准入");
            }
            if (projectCoreEnterpriseScore.getZhiXingAmountScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("当前被执行金额不准入");
            }
            if (projectCoreEnterpriseAuditInfo.getInvolvingLitigationAccess() == 0) {
                errors.add("历史涉诉数量（近一年）不准入");
            }
            if (projectCoreEnterpriseScore.getPrivateLendingScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("民间借贷被告记录不准入");
            }
            if (projectCoreEnterpriseScore.getFinancialInstitutionScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("金融机构被告案件不准入");
            }
            if (projectCoreEnterpriseScore.getEquityFreezeScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add(" 股权冻结不准入");
            }
            if (projectCoreEnterpriseScore.getMajorAbnormalLitigationScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("重大异常诉讼不准入");
            }
            if (projectCoreEnterpriseScore.getSeriousIllegalityScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("严重违法行为不准入");
            }
            if (projectCoreEnterpriseScore.getTaxOweNoticeScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("欠税公告不准入");
            }
            if (projectCoreEnterpriseScore.getTaxIllegalScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("税收违法不准入");
            }
            if (projectCoreEnterpriseScore.getBlacklistScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("黑名单信息不准入");
            }
            if (projectCoreEnterpriseScore.getExceptionScore().compareTo(BigDecimal.ZERO) == 0) {
                errors.add("其他经营异常不准入");
            }
            if (projectCoreEnterpriseAuditInfo.getAdministrativePenaltyAccess() == 0) {
                errors.add("行政处罚数量不准入");
            }
            if (projectCoreEnterpriseAuditInfo.getAdministrativePenaltyAmountAccess() == 0) {
                errors.add("行政处罚金额不准入");
            }
            if (projectCoreEnterpriseAuditInfo.getEnvironmentalPenaltyAmountAccess() == 0) {
                errors.add("环保处罚金额不准入");
            }
            admitted = ProjectCoreEnterpriseScoringModel.NOT_ADMITTED;
        } else {
            //固定额度  固定打分
            fixedCreditScore = fixedCreditScore.add(projectCoreEnterpriseScore.getEstablishmentPeriodScore()).add(projectCoreEnterpriseScore.getRegisteredCapitalScore())
                    .add(projectCoreEnterpriseScore.getBusinessAddressScore()).add(projectCoreEnterpriseScore.getEnterpriseNatureScore()).add(projectCoreEnterpriseScore.getHoldingRatioScore())
                    .add(projectCoreEnterpriseScore.getEquityHierarchyScore()).add(projectCoreEnterpriseScore.getCreditRatingScore()).add(projectCoreEnterpriseScore.getEnterpriseChangeScore())
                    .add(projectCoreEnterpriseScore.getShiXinScore()).add(projectCoreEnterpriseScore.getStCountScore()).add(projectCoreEnterpriseScore.getStCountPersonScore())
                    .add(projectCoreEnterpriseScore.getZhiXingAmountScore()).add(projectCoreEnterpriseScore.getZhiXingFrequentScore()).add(projectCoreEnterpriseScore.getHistoricalLitigationAmountScore())
                    .add(projectCoreEnterpriseScore.getHistoricalLitigationCountScore()).add(projectCoreEnterpriseScore.getPrivateLendingScore()).add(projectCoreEnterpriseScore.getFinancialInstitutionScore())
                    .add(projectCoreEnterpriseScore.getEquityFreezeScore()).add(projectCoreEnterpriseScore.getMajorAbnormalLitigationScore()).add(projectCoreEnterpriseScore.getSeriousIllegalityScore())
                    .add(projectCoreEnterpriseScore.getTaxOweNoticeScore()).add(projectCoreEnterpriseScore.getTaxIllegalScore()).add(projectCoreEnterpriseScore.getBlacklistScore())
                    .add(projectCoreEnterpriseScore.getExceptionScore()).add(projectCoreEnterpriseScore.getAdministrativePenaltyCountScore()).add(projectCoreEnterpriseScore.getAdministrativePenaltyAmountScore())
                    .add(projectCoreEnterpriseScore.getEnvironmentalPenaltiesAmountScore()).add(projectCoreEnterpriseScore.getNewsScore());
            if (fixedCreditScore.compareTo(new BigDecimal(60)) > -1 && fixedCreditScore.compareTo(new BigDecimal(65)) < 1) {
                fixedCredit = new BigDecimal("1000");
            } else if (fixedCreditScore.compareTo(new BigDecimal(65)) == 1 && fixedCreditScore.compareTo(new BigDecimal(70)) < 1) {
                fixedCredit = new BigDecimal("1250");
            } else if (fixedCreditScore.compareTo(new BigDecimal(70)) == 1 && fixedCreditScore.compareTo(new BigDecimal(75)) < 1) {
                fixedCredit = new BigDecimal("1500");
            } else if (fixedCreditScore.compareTo(new BigDecimal(75)) == 1 && fixedCreditScore.compareTo(new BigDecimal(80)) < 1) {
                fixedCredit = new BigDecimal("1750");
            } else if (fixedCreditScore.compareTo(new BigDecimal(80)) == 1 && fixedCreditScore.compareTo(new BigDecimal(85)) < 1) {
                fixedCredit = new BigDecimal("2000");
            } else if (fixedCreditScore.compareTo(new BigDecimal(85)) == 1 && fixedCreditScore.compareTo(new BigDecimal(90)) < 1) {
                fixedCredit = new BigDecimal("2250");
            } else if (fixedCreditScore.compareTo(new BigDecimal(90)) == 1 && fixedCreditScore.compareTo(new BigDecimal(95)) < 1) {
                fixedCredit = new BigDecimal("2500");
            } else if (fixedCreditScore.compareTo(new BigDecimal(95)) == 1 && fixedCreditScore.compareTo(new BigDecimal(100)) < 1) {
                fixedCredit = new BigDecimal("3000");
            } else {
                admitted = ProjectCoreEnterpriseScoringModel.NOT_ADMITTED;
                errors.add("固定得分为" + fixedCreditScore + ",不准入");
            }
            if (projectCoreEnterpriseAuditInfo.getInvolvingLitigationAccess() == 0 || projectCoreEnterpriseAuditInfo.getAdministrativePenaltyAccess() == 0
                    || projectCoreEnterpriseAuditInfo.getAdministrativePenaltyAmountAccess() == 0 || projectCoreEnterpriseAuditInfo.getEnvironmentalPenaltyAmountAccess() == 0) {
                if (projectCoreEnterpriseAuditInfo.getInvolvingLitigationAccess() == 0) {
                    errors.add("历史涉诉数量不准入");
                }
                if (projectCoreEnterpriseAuditInfo.getAdministrativePenaltyAccess() == 0) {
                    errors.add("行政处罚数量不准入");
                }
                if (projectCoreEnterpriseAuditInfo.getAdministrativePenaltyAmountAccess() == 0) {
                    errors.add("行政处罚金额不准入");
                }
                if (projectCoreEnterpriseAuditInfo.getEnvironmentalPenaltyAmountAccess() == 0) {
                    errors.add("环保处罚金额不准入");
                }
                admitted = ProjectCoreEnterpriseScoringModel.NOT_ADMITTED;
            }
            //专项额度  专项打分
            specialQuotaScore = specialQuotaScore.add(projectCoreEnterpriseScore.getHistoricalCooperationDurationScore()).add(projectCoreEnterpriseScore.getHistoricalCooperationScaleScore())
                    .add(projectCoreEnterpriseScore.getHistoricalCooperationInvoicingAmountScore()).add(projectCoreEnterpriseScore.getHistoricalCooperationMaximumAccountingPeriodScore())
                    .add(projectCoreEnterpriseScore.getHistoricalCooperationTimesScore());
            if (specialQuotaScore.compareTo(new BigDecimal("60")) > -1 && specialQuotaScore.compareTo(new BigDecimal("70")) < 1) {
                specialQuota = new BigDecimal("250");
            } else if (specialQuotaScore.compareTo(new BigDecimal("70")) == 1 && specialQuotaScore.compareTo(new BigDecimal("80")) < 1) {
                specialQuota = new BigDecimal("500");
            } else if (specialQuotaScore.compareTo(new BigDecimal("80")) == 1 && specialQuotaScore.compareTo(new BigDecimal("90")) < 1) {
                specialQuota = new BigDecimal("750");
            } else if (specialQuotaScore.compareTo(new BigDecimal("90")) == 1 && specialQuotaScore.compareTo(new BigDecimal("100")) < 1) {
                specialQuota = new BigDecimal("1000");
            }
        }
        if (projectCoreEnterpriseAuditInfo.getHoldingRatio().equals(HoldingRatioDict.ChildEnum.ONE.getCode())) {
            errors.add("控股比例不准入");
            admitted = ProjectCoreEnterpriseScoringModel.NOT_ADMITTED;
        }
        if (admitted.equals(ProjectCoreEnterpriseScoringModel.NOT_ADMITTED)) {
            fixedCredit = BigDecimal.ZERO;
            fixedCreditScore = BigDecimal.ZERO;
            specialQuota = BigDecimal.ZERO;
            specialQuotaScore = BigDecimal.ZERO;
        }
        //综合评估
        ProjectCoreEnterpriseComprehensiveEvaluation projectCoreEnterpriseComprehensiveEvaluations = new ProjectCoreEnterpriseComprehensiveEvaluation();
        projectCoreEnterpriseComprehensiveEvaluations.setFixedCredit(fixedCredit);
        projectCoreEnterpriseComprehensiveEvaluations.setFixedCreditScore(fixedCreditScore);
        projectCoreEnterpriseComprehensiveEvaluations.setSpecialQuota(specialQuota);
        projectCoreEnterpriseComprehensiveEvaluations.setSpecialQuotaScore(specialQuotaScore);
        projectCoreEnterpriseComprehensiveEvaluations.setCreditLimit(fixedCredit.add(specialQuota));
        projectCoreEnterpriseComprehensiveEvaluations.setAdmitted(admitted);
        projectCoreEnterpriseComprehensiveEvaluations.setErrors(errors);
        if (projectCoreEnterpriseAuditId != null) {
            projectCoreEnterpriseScore.setProjectCoreEnterpriseAuditId(projectCoreEnterpriseAuditId);
            projectCoreEnterpriseScoreService.save(projectCoreEnterpriseScore);
        }
        return projectCoreEnterpriseComprehensiveEvaluations;
    }

    @Override
    public ProjectCoreEnterpriseAudit getView(Long id) {
        ProjectCoreEnterpriseAudit projectCoreEnterpriseAudit = getById(id);
        ProjectCoreEnterprise projectCoreEnterprise = projectCoreEnterpriseService.get(projectCoreEnterpriseAudit.getcProjectCoreEnterpriseId());
        //历史合作资料
        List<ProjectCoreEnterpriseFile> projectCoreEnterpriseFiles = projectCoreEnterpriseFileService.lambdaQuery().eq(ProjectCoreEnterpriseFile::getcProjectCoreEnterpriseId, projectCoreEnterprise.getId()).list();
        if (CollectionUtil.isNotEmpty(projectCoreEnterpriseFiles)) {
            for (ProjectCoreEnterpriseFile projectCoreEnterpriseFile : projectCoreEnterpriseFiles) {
                List<FileStorageDO> fileStorageDOS = fileService.findByBusinessId(projectCoreEnterpriseFile.getId(), FileModuleDict.ChildEnum.PROJECT_CORE_ENTERPRISE_FILE.getCode());
                projectCoreEnterpriseFile.setFileStorageDOS(fileStorageDOS);
            }
        }
        projectCoreEnterprise.setProjectCoreEnterpriseFiles(projectCoreEnterpriseFiles);
        //项目业主 企业信息需要用历史的   因为会变动
        CEnterpriseHistory enterprise = enterpriseHistoryService.getById(projectCoreEnterprise.getcEnterpriseHistoryId());
        projectCoreEnterprise.setEnterprise(enterprise);
        projectCoreEnterpriseAudit.setProjectCoreEnterprise(projectCoreEnterprise);
        //企查查
        String getProjectReviewInfoUrl = getProjectReviewInfo + "?comprehensiveRiskInvestigationId=" + enterprise.getcComprehensiveRiskInvestigationId();
        ResponseJson forObject = restTemplate.getForObject(getProjectReviewInfoUrl, ResponseJson.class);
        if (forObject != null) {
            JSONObject result = new JSONObject(forObject.getData());
            List<CRegStock> regStocks = result.getBeanList("cRegStocks", CRegStock.class);
            projectCoreEnterpriseAudit.setRegStocks(regStocks);
        }
        //民间借贷
        List<ProjectCoreEnterprisePrivateLending> projectCoreEnterprisePrivateLendings = projectCoreEnterprisePrivateLendingService.lambdaQuery().eq(ProjectCoreEnterprisePrivateLending::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
        projectCoreEnterpriseAudit.setProjectCoreEnterprisePrivateLendingList(projectCoreEnterprisePrivateLendings);
        //股权冻结
        List<ProjectCoreEnterpriseEquityFreeze> projectCoreEnterpriseEquityFreezes = projectCoreEnterpriseEquityFreezeService.lambdaQuery().eq(ProjectCoreEnterpriseEquityFreeze::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
        projectCoreEnterpriseAudit.setProjectCoreEnterpriseEquityFreezeList(projectCoreEnterpriseEquityFreezes);
        //重大异常诉讼
        List<ProjectCoreEnterpriseMajorAbnormalLitigation> projectCoreEnterpriseMajorAbnormalLitigations = projectCoreEnterpriseMajorAbnormalLitigationService.lambdaQuery().eq(ProjectCoreEnterpriseMajorAbnormalLitigation::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
        projectCoreEnterpriseAudit.setProjectCoreEnterpriseMajorAbnormalLitigationList(projectCoreEnterpriseMajorAbnormalLitigations);
        //严重违法
        List<ProjectCoreEnterpriseSeriousIllegality> projectCoreEnterpriseSeriousIllegalities = projectCoreEnterpriseSeriousIllegalityService.lambdaQuery().eq(ProjectCoreEnterpriseSeriousIllegality::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
        projectCoreEnterpriseAudit.setProjectCoreEnterpriseSeriousIllegalityList(projectCoreEnterpriseSeriousIllegalities);
        //欠税公告
        List<ProjectCoreEnterpriseTaxOweNotice> projectCoreEnterpriseTaxOweNotices = projectCoreEnterpriseTaxOweNoticeService.lambdaQuery().eq(ProjectCoreEnterpriseTaxOweNotice::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
        projectCoreEnterpriseAudit.setProjectCoreEnterpriseTaxOweNoticeList(projectCoreEnterpriseTaxOweNotices);
        //税收违法
        List<ProjectCoreEnterpriseTaxIllegalData> projectCoreEnterpriseTaxIllegalData = projectCoreEnterpriseTaxIllegalDataService.lambdaQuery().eq(ProjectCoreEnterpriseTaxIllegalData::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
        projectCoreEnterpriseAudit.setProjectCoreEnterpriseTaxIllegalDataList(projectCoreEnterpriseTaxIllegalData);
        //黑名单信息
        List<ProjectCoreEnterpriseBlacklist> projectCoreEnterpriseBlacklists = projectCoreEnterpriseBlacklistService.lambdaQuery().eq(ProjectCoreEnterpriseBlacklist::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
        projectCoreEnterpriseAudit.setProjectCoreEnterpriseBlacklistList(projectCoreEnterpriseBlacklists);
        //其他经营异常
        List<ProjectCoreEnterpriseExceptionData> projectCoreEnterpriseExceptionData = projectCoreEnterpriseExceptionDataService.lambdaQuery().eq(ProjectCoreEnterpriseExceptionData::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
        projectCoreEnterpriseAudit.setProjectCoreEnterpriseExceptionDataList(projectCoreEnterpriseExceptionData);
        //重大负面新闻舆情
        List<ProjectCoreEnterpriseNews> projectCoreEnterpriseNews = projectCoreEnterpriseNewsService.lambdaQuery().eq(ProjectCoreEnterpriseNews::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).list();
        projectCoreEnterpriseAudit.setProjectCoreEnterpriseNewsList(projectCoreEnterpriseNews);
        //一键测算
        ProjectCoreEnterpriseComprehensiveEvaluation projectCoreEnterpriseComprehensiveEvaluation = projectCoreEnterpriseComprehensiveEvaluationService.lambdaQuery().eq(ProjectCoreEnterpriseComprehensiveEvaluation::getProjectCoreEnterpriseAuditId, projectCoreEnterpriseAudit.getId()).one();
        projectCoreEnterpriseAudit.setProjectCoreEnterpriseComprehensiveEvaluations(projectCoreEnterpriseComprehensiveEvaluation);
        return projectCoreEnterpriseAudit;
    }

    private void qcc(ProjectCoreEnterpriseAudit projectCoreEnterpriseAudit, ProjectCoreEnterprise projectCoreEnterprise) {
        //项目业主 企业信息需要用历史的   因为会变动
        CEnterpriseHistory enterprise = enterpriseHistoryService.getById(projectCoreEnterprise.getcEnterpriseHistoryId());
        projectCoreEnterprise.setEnterprise(enterprise);
        projectCoreEnterpriseAudit.setProjectCoreEnterprise(projectCoreEnterprise);
        //企查查
        String getProjectReviewInfoUrl = getProjectReviewInfo + "?comprehensiveRiskInvestigationId=" + enterprise.getcComprehensiveRiskInvestigationId();
        ResponseJson forObject = restTemplate.getForObject(getProjectReviewInfoUrl, ResponseJson.class);
        if (forObject != null) {
            JSONObject result = new JSONObject(forObject.getData());
            String entType = result.getStr("entType");
            if (StringUtil.isNotEmpty(entType) && entType.equals("4")) {
                projectCoreEnterpriseAudit.setEnterpriseNature("enterpriseNature_1");
            }
            List<CRegStock> regStocks = result.getBeanList("cRegStocks", CRegStock.class);
            projectCoreEnterpriseAudit.setRegStocks(regStocks);
            Long judgmentCount = result.getLong("judgmentCount");
            projectCoreEnterpriseAudit.setInvolvingLitigationAccessCcount(judgmentCount);
            Long adminPenaltyCount = result.getLong("adminPenaltyCount");
            projectCoreEnterpriseAudit.setAdministrativePenaltyAccessCcount(adminPenaltyCount);
            BigDecimal adminPenaltyAmount = result.getBigDecimal("adminPenaltyAmount");
            projectCoreEnterpriseAudit.setAdministrativePenaltyAmount(adminPenaltyAmount);
            BigDecimal envPunishmentAmount = result.getBigDecimal("envPunishmentAmount");
            projectCoreEnterpriseAudit.setEnvironmentalPenaltyAmount(envPunishmentAmount);
            List<CEquityFreezeData> equityFreezeDataList = result.getBeanList("equityFreezeDataList", CEquityFreezeData.class);
            projectCoreEnterpriseAudit.setEquityFreezeDataList(equityFreezeDataList);
            List<CJudgmentDocuments> privateLendings = result.getBeanList("privateLendings", CJudgmentDocuments.class);
            projectCoreEnterpriseAudit.setPrivateLendings(privateLendings);
            List<CJudgmentDocuments> majorAnomalies = result.getBeanList("majorAnomalies", CJudgmentDocuments.class);
            projectCoreEnterpriseAudit.setMajorAnomalies(majorAnomalies);
            List<CSeriousIllegalData> seriousIllegalData = result.getBeanList("seriousIllegalData", CSeriousIllegalData.class);
            projectCoreEnterpriseAudit.setSeriousIllegalData(seriousIllegalData);
            List<CTaxOweNoticeData> taxOweNoticeData = result.getBeanList("taxOweNoticeData", CTaxOweNoticeData.class);
            projectCoreEnterpriseAudit.setTaxOweNoticeData(taxOweNoticeData);
            List<CTaxIllegalData> taxIllegalData = result.getBeanList("taxIllegalData", CTaxIllegalData.class);
            projectCoreEnterpriseAudit.setTaxIllegalData(taxIllegalData);
            List<CBlacklist> blacklists = result.getBeanList("blacklists", CBlacklist.class);
            projectCoreEnterpriseAudit.setBlacklists(blacklists);
            List<CExceptionData> exceptionData = result.getBeanList("exceptionData", CExceptionData.class);
            projectCoreEnterpriseAudit.setExceptionData(exceptionData);
            List<CNews> news = result.getBeanList("news", CNews.class);
            projectCoreEnterpriseAudit.setNews(news);
        }
    }
}
