From e9b9d793f962bef4db66c39ea8892c1090bcb808 Mon Sep 17 00:00:00 2001 From: whb <17803890193@163.com> Date: Sun, 28 Apr 2024 08:38:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91=E5=AE=8C=E6=88=90=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/StuRateServiceImpl.java | 109 ++++++++++++++++-- 1 file changed, 97 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/sztzjy/digital_credit/service/impl/StuRateServiceImpl.java b/src/main/java/com/sztzjy/digital_credit/service/impl/StuRateServiceImpl.java index 735c3d6..3b5e5c1 100644 --- a/src/main/java/com/sztzjy/digital_credit/service/impl/StuRateServiceImpl.java +++ b/src/main/java/com/sztzjy/digital_credit/service/impl/StuRateServiceImpl.java @@ -14,6 +14,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -452,14 +453,18 @@ public class StuRateServiceImpl implements StuRateService { @Override public Boolean completionStatusOfEnterprise(String userId) { + ArrayList arrayList = new ArrayList<>(); + StuBaseInfoExample stuBaseInfoExample = new StuBaseInfoExample(); stuBaseInfoExample.createCriteria().andUserIdEqualTo(userId); List stuBaseInfoList = baseInfoMapper.selectByExample(stuBaseInfoExample); if (!stuBaseInfoList.isEmpty()){ if (stuBaseInfoList.get(0).getSubState() != 1) { - return false; + arrayList.add(0); } + }else { + arrayList.add(0); } @@ -467,58 +472,138 @@ public class StuRateServiceImpl implements StuRateService { stuCreditEnhanceMeasureExample.createCriteria().andUserIdEqualTo(userId); List creditEnhanceMeasureList = creditEnhanceMeasureMapper.selectByExample(stuCreditEnhanceMeasureExample); if (creditEnhanceMeasureList.isEmpty()){ - return false; + arrayList.add(0); } StuCreditRecordsExample stuCreditRecordsExample = new StuCreditRecordsExample(); stuCreditRecordsExample.createCriteria().andUserIdEqualTo(userId); - creditRecordsMapper.deleteByExample(stuCreditRecordsExample); + List stuCreditRecordsList = creditRecordsMapper.selectByExample(stuCreditRecordsExample); + if (!stuCreditRecordsList.isEmpty()){ + if (stuBaseInfoList.get(0).getSubState() != 1) { + arrayList.add(0); + } + + }else { + arrayList.add(0); + } StuDuPontAnalysisExample stuDuPontAnalysisExample = new StuDuPontAnalysisExample(); stuDuPontAnalysisExample.createCriteria().andUserIdEqualTo(userId); - duPontAnalysisMapper.deleteByExample(stuDuPontAnalysisExample); + List duPontAnalysisList = duPontAnalysisMapper.selectByExample(stuDuPontAnalysisExample); + if (!duPontAnalysisList.isEmpty()){ + if (duPontAnalysisList.get(0).getSubState() != 1) { + arrayList.add(0); + } + }else { + arrayList.add(0); + } StuGrowthAbilityExample stuGrowthAbilityExample = new StuGrowthAbilityExample(); stuGrowthAbilityExample.createCriteria().andUserIdEqualTo(userId); - growthAbilityMapper.deleteByExample(stuGrowthAbilityExample); + List growthAbilityList = growthAbilityMapper.selectByExample(stuGrowthAbilityExample); + if (!growthAbilityList.isEmpty()){ + if (growthAbilityList.get(0).getSubState() != 1) { + arrayList.add(0); + } + + }else { + arrayList.add(0); + } StuOperatingCapacityExample stuOperatingCapacityExample = new StuOperatingCapacityExample(); stuOperatingCapacityExample.createCriteria().andUserIdEqualTo(userId); - operatingCapacityMapper.deleteByExample(stuOperatingCapacityExample); + List operatingCapacityList = operatingCapacityMapper.selectByExample(stuOperatingCapacityExample); + if (!operatingCapacityList.isEmpty()){ + if (operatingCapacityList.get(0).getSubState() != 1) { + arrayList.add(0); + } + }else { + arrayList.add(0); + } StuOperationAssetAnalysisModuleExample stuOperationAssetAnalysisModuleExample = new StuOperationAssetAnalysisModuleExample(); stuOperationAssetAnalysisModuleExample.createCriteria().andUserIdEqualTo(userId); - operationAssetAnalysisModuleMapper.deleteByExample(stuOperationAssetAnalysisModuleExample); + List operationAssetAnalysisModuleList = operationAssetAnalysisModuleMapper.selectByExample(stuOperationAssetAnalysisModuleExample); + if (!operationAssetAnalysisModuleList.isEmpty()){ + if (operationAssetAnalysisModuleList.get(0).getSubState() != 1) { + arrayList.add(0); + } + }else { + arrayList.add(0); + } StuProfitAbilityExample stuProfitAbilityExample = new StuProfitAbilityExample(); stuProfitAbilityExample.createCriteria().andUserIdEqualTo(userId); - profitAbilityMapper.deleteByExample(stuProfitAbilityExample); + List profitAbilityList = profitAbilityMapper.selectByExample(stuProfitAbilityExample); + if (!profitAbilityList.isEmpty()){ + if (profitAbilityList.get(0).getSubState() != 1) { + arrayList.add(0); + } + }else { + arrayList.add(0); + } + StuRatingModelExample ratingModelExample = new StuRatingModelExample(); ratingModelExample.createCriteria().andUserIdEqualTo(userId); - ratingModelMapper.deleteByExample(ratingModelExample); + List stuRatingModelList = ratingModelMapper.selectByExample(ratingModelExample); + if (!stuRatingModelList.isEmpty()){ + if (stuRatingModelList.get(0).getSubState() != 1) { + arrayList.add(0); + } + }else { + arrayList.add(0); + } StuRatingResultExample stuRatingResultExample = new StuRatingResultExample(); stuRatingResultExample.createCriteria().andUserIdEqualTo(userId); - ratingResultMapper.deleteByExample(stuRatingResultExample); + List ratingResultList = ratingResultMapper.selectByExample(stuRatingResultExample); + if (!ratingResultList.isEmpty()){ + if (ratingResultList.get(0).getSubState() != 1) { + arrayList.add(0); + } + }else { + arrayList.add(0); + } StuScoreModuleExample stuScoreModuleExample = new StuScoreModuleExample(); stuScoreModuleExample.createCriteria().andUserIdEqualTo(userId); - scoreModuleMapper.deleteByExample(stuScoreModuleExample); + List scoreModuleList = scoreModuleMapper.selectByExample(stuScoreModuleExample); + if (!scoreModuleList.isEmpty()){ + if (scoreModuleList.get(0).getSubState() != 1) { + arrayList.add(0); + } + }else { + arrayList.add(0); + } StuSolvencyExample stuSolvencyExample = new StuSolvencyExample(); stuSolvencyExample.createCriteria().andUserIdEqualTo(userId); - solvencyMapper.deleteByExample(stuSolvencyExample); + List stuSolvencyList = solvencyMapper.selectByExample(stuSolvencyExample); + if (!stuSolvencyList.isEmpty()){ + if (stuSolvencyList.get(0).getSubState() != 1) { + arrayList.add(0); + } + }else { + arrayList.add(0); + } + for (Integer integer : arrayList) { + if (integer == 0) + { + return false; + } + } + return true; }