From 9a112b559a21ca3d3053fb97b604b4708cd20ad9 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Mon, 18 Dec 2023 16:20:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=80=E5=87=BA=E6=97=B6?= =?UTF-8?q?=E6=9C=BA=E8=A1=A8=EF=BC=8C=E5=AE=8C=E6=88=90=E6=8A=95=E8=B5=84?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E9=A1=B5=E9=9D=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProfitDistributionServiceImpl.java | 28 ++++-- .../ProfitManagementServiceImpl.java | 10 +- .../service/serviceImpl/TopicServiceImpl.java | 4 + .../tea/ClassScoreServiceImpl.java | 91 +++++++++++-------- 4 files changed, 87 insertions(+), 46 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java index 7fe50d7..23ae5dc 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java @@ -1,10 +1,8 @@ package com.sztzjy.fund_investment.service.serviceImpl; -import com.sztzjy.fund_investment.entity.ExitTime; -import com.sztzjy.fund_investment.entity.Fundraising; -import com.sztzjy.fund_investment.entity.ProfitDistribution; -import com.sztzjy.fund_investment.entity.ProfitDistributionExample; +import com.sztzjy.fund_investment.entity.*; import com.sztzjy.fund_investment.mapper.ExitTimeMapper; +import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper; import com.sztzjy.fund_investment.mapper.ProfitDistributionMapper; import com.sztzjy.fund_investment.service.ISysFundraisingService; import com.sztzjy.fund_investment.service.PerformanceScoreService; @@ -16,6 +14,7 @@ import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.Date; import java.util.List; /** @@ -32,8 +31,8 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService private ExitTimeMapper exitTimeMapper; @Autowired private PerformanceScoreService performanceScoreService; - - + @Autowired + private PerformanceScoreMapper performanceScoreMapper; /* 收益分配计算提交 * @author xcj * @Date 2023/12/11 @@ -231,6 +230,10 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService twoRightOwnFunds.compareTo(userRemainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0) { performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } + PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId); + performanceScore.setProfitDistributionTime(new Date()); + performanceScoreMapper.updateByPrimaryKey(performanceScore); + return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } else if (type == 2) { //2:自有资金/优先级LP/劣后级LP if (profitDistribution.getUserRemainingEarningsSubordinatedLp() == null || profitDistribution.getUserRoundSubordinatedLp() == null) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请填写劣后级LP分配金额!"); @@ -303,6 +306,10 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 && userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) { performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } + PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId); + performanceScore.setProfitDistributionTime(new Date()); + performanceScoreMapper.updateByPrimaryKey(performanceScore); + return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } else if (type == 3) { //3:银行借款/自有资金/优先级LP if (profitDistribution.getUserRoundBankLoan() == null) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请填写银行借款分配金额!"); @@ -372,6 +379,10 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService rightBankLoan.compareTo(userRoundBankLoan) == 0) { performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } + PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId); + performanceScore.setProfitDistributionTime(new Date()); + performanceScoreMapper.updateByPrimaryKey(performanceScore); + return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } else { //4:银行借款/优先级LP/劣后级LP/自有资金 if (profitDistribution.getUserRemainingEarningsSubordinatedLp() == null || profitDistribution.getUserRoundSubordinatedLp() == null) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请填写劣后级LP分配金额!"); @@ -470,8 +481,11 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) { performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } + PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId); + performanceScore.setProfitDistributionTime(new Date()); + performanceScoreMapper.updateByPrimaryKey(performanceScore); + return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } - return null; } diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitManagementServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitManagementServiceImpl.java index 159f8bb..0db1ed8 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitManagementServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitManagementServiceImpl.java @@ -1,9 +1,11 @@ package com.sztzjy.fund_investment.service.serviceImpl; import com.sztzjy.fund_investment.entity.ExitTime; +import com.sztzjy.fund_investment.entity.PerformanceScore; import com.sztzjy.fund_investment.entity.ProfitManagement; import com.sztzjy.fund_investment.entity.ProfitManagementExample; import com.sztzjy.fund_investment.mapper.ExitTimeMapper; +import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper; import com.sztzjy.fund_investment.mapper.ProfitManagementMapper; import com.sztzjy.fund_investment.service.PerformanceScoreService; import com.sztzjy.fund_investment.service.ProfitManagementService; @@ -14,6 +16,7 @@ import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.Date; import java.util.List; /** @@ -28,7 +31,8 @@ public class ProfitManagementServiceImpl implements ProfitManagementService { private PerformanceScoreService performanceScoreService; @Autowired private ExitTimeMapper exitTimeMapper; - + @Autowired + private PerformanceScoreMapper performanceScoreMapper; /* 折线图 * @author xcj @@ -142,6 +146,10 @@ public class ProfitManagementServiceImpl implements ProfitManagementService { } else { performanceScoreService.calculateScoreByModule("profitManagementMarketValueExitScore", 3, flowId); } + //标记页面完成时间 + PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId); + performanceScore.setProfitManagementTime(new Date()); + performanceScoreMapper.updateByPrimaryKey(performanceScore); return null; } } diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/TopicServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/TopicServiceImpl.java index c4602af..5dcb228 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/TopicServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/TopicServiceImpl.java @@ -235,9 +235,13 @@ public class TopicServiceImpl implements TopicService { performanceScoreService.calculateScoreByModule("projectValuationScore", score, flowId); } if (module.equals(Constant.IPOBK)) { + performanceScore.setIpoTime(new Date()); + performanceScoreMapper.updateByPrimaryKey(performanceScore); performanceScoreService.calculateScoreByModule("ipoListedSectorScore", score, flowId); } if (module.equals(Constant.IPOTJ)) { + performanceScore.setIpoTime(new Date()); + performanceScoreMapper.updateByPrimaryKey(performanceScore); performanceScoreService.calculateScoreByModule("ipoListedConditionScore", score, flowId); } return new ResultEntity<>(list); diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java index 6f79328..205c35f 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java @@ -438,10 +438,7 @@ public class ClassScoreServiceImpl implements ClassScoreService { } - /* 实训成绩展示 - * @author xcj - * @Date 2023/11/29 - */ +// 实训成绩 @Override public PerformanceTrainingScoreDto getStuTrainingScore(String flowId) { PerformanceScoreExample example = new PerformanceScoreExample(); @@ -453,43 +450,61 @@ public class ClassScoreServiceImpl implements ClassScoreService { PerformanceScore performanceScore = performanceScores.get(0); PerformanceTrainingScoreDto performanceTrainingScoreDto = new PerformanceTrainingScoreDto(); performanceTrainingScoreDto.setFlowId(performanceScore.getFlowId()); - performanceTrainingScoreDto.setPracticalCognitionScore(performanceScore.getPracticalCognitionScore()); - performanceTrainingScoreDto.setKnowledgeAssessmentScore(performanceScore.getKnowledgeAssessmentScore()); - performanceTrainingScoreDto.setFundraisingScore(performanceScore.getFundraisingScore()); - performanceTrainingScoreDto.setProjectSearchScore(performanceScore.getProjectSearchScore().add(performanceScore.getProjectSearchReportScore())); - performanceTrainingScoreDto.setProjectDueDiligenceScore(performanceScore.getProjectDueDiligenceScore() - .add(performanceScore.getProjectDueDiligenceFinanceReportScore() - .add(performanceScore.getProjectDueDiligenceBusinessReportScore() - .add(performanceScore.getProjectValuationEstimationRiskScore())))); - - performanceTrainingScoreDto.setProjectValuationScore(performanceScore.getProjectValuationRelativeScore() - .add(performanceScore.getProjectValuationScore() - .add(performanceScore.getProjectValuationAbsoluteScore() - .add(performanceScore.getProjectUseValuationAbsoluteScore() - .add(performanceScore.getProjectUseValuationRelativeScore()))))); - performanceTrainingScoreDto.setInvestmentSigningScore(performanceScore.getInvestmentSigningVlauationReportScore() - .add(performanceScore.getInvestmentSigningDiligenceReportScore() - .add(performanceScore.getInvestmentSigningInvestScore() - .add(performanceScore.getInvestmentSigningScore())))); - - performanceTrainingScoreDto.setIpoScore(performanceScore.getIpoFlowScore().add(performanceScore.getIpoListedConditionScore() - .add(performanceScore.getIpoListedSectorScore()))); - - performanceTrainingScoreDto.setPricingIssuanceScore(performanceScore.getNewPricingIssuanceScore() - .add(performanceScore.getPricingIssuanceConfirmScore().add(performanceScore.getInitPricingIssuanceScore() - .add(performanceScore.getPricingIssuanceEnteringScore())))); - - performanceTrainingScoreDto.setProfitManagementScore(performanceScore.getProfitManagementMarketValueScore() - .add(performanceScore.getProfitManagementFundScore() - .add(performanceScore.getProfitManagementFundExitScore() - .add(performanceScore.getProfitManagementMarketValueExitScore())))); - - performanceTrainingScoreDto.setProfitDistributionScore(performanceScore.getProfitDistributionScore()); - performanceTrainingScoreDto.setInvestmentReportScore(performanceScore.getInvestmentReportScore().add(performanceScore.getExperienceScore())); - performanceTrainingScoreDto.setTotalScore(performanceScore.getTotalScore()); + + performanceTrainingScoreDto.setPracticalCognitionScore(Optional.ofNullable(performanceScore.getPracticalCognitionScore()).orElse(BigDecimal.ZERO)); + performanceTrainingScoreDto.setKnowledgeAssessmentScore(Optional.ofNullable(performanceScore.getKnowledgeAssessmentScore()).orElse(BigDecimal.ZERO)); + performanceTrainingScoreDto.setFundraisingScore(Optional.ofNullable(performanceScore.getFundraisingScore()).orElse(BigDecimal.ZERO)); + performanceTrainingScoreDto.setProjectSearchScore(Optional.ofNullable(performanceScore.getProjectSearchScore()).map(score -> score.add(Optional.ofNullable(performanceScore.getProjectSearchReportScore()).orElse(BigDecimal.ZERO))).orElse(BigDecimal.ZERO)); + performanceTrainingScoreDto.setProjectDueDiligenceScore( + Optional.ofNullable(performanceScore.getProjectDueDiligenceScore()).map(score -> + score.add(Optional.ofNullable(performanceScore.getProjectDueDiligenceFinanceReportScore()).orElse(BigDecimal.ZERO)) + .add(Optional.ofNullable(performanceScore.getProjectDueDiligenceBusinessReportScore()).orElse(BigDecimal.ZERO)) + .add(Optional.ofNullable(performanceScore.getProjectValuationEstimationRiskScore()).orElse(BigDecimal.ZERO)) + ).orElse(BigDecimal.ZERO) + ); + performanceTrainingScoreDto.setProjectValuationScore( + Optional.ofNullable(performanceScore.getProjectValuationRelativeScore()).orElse(BigDecimal.ZERO) + .add(Optional.ofNullable(performanceScore.getProjectValuationScore()).orElse(BigDecimal.ZERO)) + .add(Optional.ofNullable(performanceScore.getProjectValuationAbsoluteScore()).orElse(BigDecimal.ZERO)) + .add(Optional.ofNullable(performanceScore.getProjectUseValuationAbsoluteScore()).orElse(BigDecimal.ZERO)) + .add(Optional.ofNullable(performanceScore.getProjectUseValuationRelativeScore()).orElse(BigDecimal.ZERO)) + ); + + performanceTrainingScoreDto.setInvestmentSigningScore( + Optional.ofNullable(performanceScore.getInvestmentSigningVlauationReportScore()).orElse(BigDecimal.ZERO) + .add(Optional.ofNullable(performanceScore.getInvestmentSigningDiligenceReportScore()).orElse(BigDecimal.ZERO)) + .add(Optional.ofNullable(performanceScore.getInvestmentSigningInvestScore()).orElse(BigDecimal.ZERO)) + .add(Optional.ofNullable(performanceScore.getInvestmentSigningScore()).orElse(BigDecimal.ZERO)) + ); + + performanceTrainingScoreDto.setIpoScore( + Optional.ofNullable(performanceScore.getIpoFlowScore()).orElse(BigDecimal.ZERO) + .add(Optional.ofNullable(performanceScore.getIpoListedConditionScore()).orElse(BigDecimal.ZERO)) + .add(Optional.ofNullable(performanceScore.getIpoListedSectorScore()).orElse(BigDecimal.ZERO)) + ); + + performanceTrainingScoreDto.setPricingIssuanceScore( + Optional.ofNullable(performanceScore.getNewPricingIssuanceScore()).orElse(BigDecimal.ZERO) + .add(Optional.ofNullable(performanceScore.getPricingIssuanceConfirmScore()).orElse(BigDecimal.ZERO)) + .add(Optional.ofNullable(performanceScore.getInitPricingIssuanceScore()).orElse(BigDecimal.ZERO)) + .add(Optional.ofNullable(performanceScore.getPricingIssuanceEnteringScore()).orElse(BigDecimal.ZERO)) + ); + + performanceTrainingScoreDto.setProfitManagementScore( + Optional.ofNullable(performanceScore.getProfitManagementMarketValueScore()).orElse(BigDecimal.ZERO) + .add(Optional.ofNullable(performanceScore.getProfitManagementFundScore()).orElse(BigDecimal.ZERO)) + .add(Optional.ofNullable(performanceScore.getProfitManagementFundExitScore()).orElse(BigDecimal.ZERO)) + .add(Optional.ofNullable(performanceScore.getProfitManagementMarketValueExitScore()).orElse(BigDecimal.ZERO)) + ); + + performanceTrainingScoreDto.setProfitDistributionScore(Optional.ofNullable(performanceScore.getProfitDistributionScore()).orElse(BigDecimal.ZERO)); + performanceTrainingScoreDto.setInvestmentReportScore(Optional.ofNullable(performanceScore.getInvestmentReportScore()).orElse(BigDecimal.ZERO).add(Optional.ofNullable(performanceScore.getExperienceScore()).orElse(BigDecimal.ZERO))); + performanceTrainingScoreDto.setTotalScore(Optional.ofNullable(performanceScore.getTotalScore()).orElse(BigDecimal.ZERO)); + return performanceTrainingScoreDto; } + /* 实训成绩页面展示五个结论及分数 * @author xcj * @Date 2023/11/30