新增退出时机表,完成投资报告页面接口

master
xiaoCJ 1 year ago
parent 6ce77a293d
commit 9a112b559a

@ -1,10 +1,8 @@
package com.sztzjy.fund_investment.service.serviceImpl; package com.sztzjy.fund_investment.service.serviceImpl;
import com.sztzjy.fund_investment.entity.ExitTime; import com.sztzjy.fund_investment.entity.*;
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.mapper.ExitTimeMapper; 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.mapper.ProfitDistributionMapper;
import com.sztzjy.fund_investment.service.ISysFundraisingService; import com.sztzjy.fund_investment.service.ISysFundraisingService;
import com.sztzjy.fund_investment.service.PerformanceScoreService; import com.sztzjy.fund_investment.service.PerformanceScoreService;
@ -16,6 +14,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -32,8 +31,8 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
private ExitTimeMapper exitTimeMapper; private ExitTimeMapper exitTimeMapper;
@Autowired @Autowired
private PerformanceScoreService performanceScoreService; private PerformanceScoreService performanceScoreService;
@Autowired
private PerformanceScoreMapper performanceScoreMapper;
/* /*
* @author xcj * @author xcj
* @Date 2023/12/11 * @Date 2023/12/11
@ -231,6 +230,10 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
twoRightOwnFunds.compareTo(userRemainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0) { twoRightOwnFunds.compareTo(userRemainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); 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 } else if (type == 2) { //2:自有资金/优先级LP/劣后级LP
if (profitDistribution.getUserRemainingEarningsSubordinatedLp() == null || profitDistribution.getUserRoundSubordinatedLp() == null) { if (profitDistribution.getUserRemainingEarningsSubordinatedLp() == null || profitDistribution.getUserRoundSubordinatedLp() == null) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请填写劣后级LP分配金额"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请填写劣后级LP分配金额");
@ -303,6 +306,10 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 && userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) { userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 && userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); 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 } else if (type == 3) { //3:银行借款/自有资金/优先级LP
if (profitDistribution.getUserRoundBankLoan() == null) { if (profitDistribution.getUserRoundBankLoan() == null) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请填写银行借款分配金额!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请填写银行借款分配金额!");
@ -372,6 +379,10 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
rightBankLoan.compareTo(userRoundBankLoan) == 0) { rightBankLoan.compareTo(userRoundBankLoan) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); 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/自有资金 } else { //4:银行借款/优先级LP/劣后级LP/自有资金
if (profitDistribution.getUserRemainingEarningsSubordinatedLp() == null || profitDistribution.getUserRoundSubordinatedLp() == null) { if (profitDistribution.getUserRemainingEarningsSubordinatedLp() == null || profitDistribution.getUserRoundSubordinatedLp() == null) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请填写劣后级LP分配金额"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请填写劣后级LP分配金额");
@ -470,8 +481,11 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) { userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
} }
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
performanceScore.setProfitDistributionTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
} }
return null;
} }

@ -1,9 +1,11 @@
package com.sztzjy.fund_investment.service.serviceImpl; package com.sztzjy.fund_investment.service.serviceImpl;
import com.sztzjy.fund_investment.entity.ExitTime; 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.ProfitManagement;
import com.sztzjy.fund_investment.entity.ProfitManagementExample; import com.sztzjy.fund_investment.entity.ProfitManagementExample;
import com.sztzjy.fund_investment.mapper.ExitTimeMapper; 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.mapper.ProfitManagementMapper;
import com.sztzjy.fund_investment.service.PerformanceScoreService; import com.sztzjy.fund_investment.service.PerformanceScoreService;
import com.sztzjy.fund_investment.service.ProfitManagementService; import com.sztzjy.fund_investment.service.ProfitManagementService;
@ -14,6 +16,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -28,7 +31,8 @@ public class ProfitManagementServiceImpl implements ProfitManagementService {
private PerformanceScoreService performanceScoreService; private PerformanceScoreService performanceScoreService;
@Autowired @Autowired
private ExitTimeMapper exitTimeMapper; private ExitTimeMapper exitTimeMapper;
@Autowired
private PerformanceScoreMapper performanceScoreMapper;
/* 线 /* 线
* @author xcj * @author xcj
@ -142,6 +146,10 @@ public class ProfitManagementServiceImpl implements ProfitManagementService {
} else { } else {
performanceScoreService.calculateScoreByModule("profitManagementMarketValueExitScore", 3, flowId); performanceScoreService.calculateScoreByModule("profitManagementMarketValueExitScore", 3, flowId);
} }
//标记页面完成时间
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
performanceScore.setProfitManagementTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return null; return null;
} }
} }

@ -235,9 +235,13 @@ public class TopicServiceImpl implements TopicService {
performanceScoreService.calculateScoreByModule("projectValuationScore", score, flowId); performanceScoreService.calculateScoreByModule("projectValuationScore", score, flowId);
} }
if (module.equals(Constant.IPOBK)) { if (module.equals(Constant.IPOBK)) {
performanceScore.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
performanceScoreService.calculateScoreByModule("ipoListedSectorScore", score, flowId); performanceScoreService.calculateScoreByModule("ipoListedSectorScore", score, flowId);
} }
if (module.equals(Constant.IPOTJ)) { if (module.equals(Constant.IPOTJ)) {
performanceScore.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
performanceScoreService.calculateScoreByModule("ipoListedConditionScore", score, flowId); performanceScoreService.calculateScoreByModule("ipoListedConditionScore", score, flowId);
} }
return new ResultEntity<>(list); return new ResultEntity<>(list);

@ -438,10 +438,7 @@ public class ClassScoreServiceImpl implements ClassScoreService {
} }
/* // 实训成绩
* @author xcj
* @Date 2023/11/29
*/
@Override @Override
public PerformanceTrainingScoreDto getStuTrainingScore(String flowId) { public PerformanceTrainingScoreDto getStuTrainingScore(String flowId) {
PerformanceScoreExample example = new PerformanceScoreExample(); PerformanceScoreExample example = new PerformanceScoreExample();
@ -453,43 +450,61 @@ public class ClassScoreServiceImpl implements ClassScoreService {
PerformanceScore performanceScore = performanceScores.get(0); PerformanceScore performanceScore = performanceScores.get(0);
PerformanceTrainingScoreDto performanceTrainingScoreDto = new PerformanceTrainingScoreDto(); PerformanceTrainingScoreDto performanceTrainingScoreDto = new PerformanceTrainingScoreDto();
performanceTrainingScoreDto.setFlowId(performanceScore.getFlowId()); performanceTrainingScoreDto.setFlowId(performanceScore.getFlowId());
performanceTrainingScoreDto.setPracticalCognitionScore(performanceScore.getPracticalCognitionScore());
performanceTrainingScoreDto.setKnowledgeAssessmentScore(performanceScore.getKnowledgeAssessmentScore()); performanceTrainingScoreDto.setPracticalCognitionScore(Optional.ofNullable(performanceScore.getPracticalCognitionScore()).orElse(BigDecimal.ZERO));
performanceTrainingScoreDto.setFundraisingScore(performanceScore.getFundraisingScore()); performanceTrainingScoreDto.setKnowledgeAssessmentScore(Optional.ofNullable(performanceScore.getKnowledgeAssessmentScore()).orElse(BigDecimal.ZERO));
performanceTrainingScoreDto.setProjectSearchScore(performanceScore.getProjectSearchScore().add(performanceScore.getProjectSearchReportScore())); performanceTrainingScoreDto.setFundraisingScore(Optional.ofNullable(performanceScore.getFundraisingScore()).orElse(BigDecimal.ZERO));
performanceTrainingScoreDto.setProjectDueDiligenceScore(performanceScore.getProjectDueDiligenceScore() performanceTrainingScoreDto.setProjectSearchScore(Optional.ofNullable(performanceScore.getProjectSearchScore()).map(score -> score.add(Optional.ofNullable(performanceScore.getProjectSearchReportScore()).orElse(BigDecimal.ZERO))).orElse(BigDecimal.ZERO));
.add(performanceScore.getProjectDueDiligenceFinanceReportScore() performanceTrainingScoreDto.setProjectDueDiligenceScore(
.add(performanceScore.getProjectDueDiligenceBusinessReportScore() Optional.ofNullable(performanceScore.getProjectDueDiligenceScore()).map(score ->
.add(performanceScore.getProjectValuationEstimationRiskScore())))); score.add(Optional.ofNullable(performanceScore.getProjectDueDiligenceFinanceReportScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getProjectDueDiligenceBusinessReportScore()).orElse(BigDecimal.ZERO))
performanceTrainingScoreDto.setProjectValuationScore(performanceScore.getProjectValuationRelativeScore() .add(Optional.ofNullable(performanceScore.getProjectValuationEstimationRiskScore()).orElse(BigDecimal.ZERO))
.add(performanceScore.getProjectValuationScore() ).orElse(BigDecimal.ZERO)
.add(performanceScore.getProjectValuationAbsoluteScore() );
.add(performanceScore.getProjectUseValuationAbsoluteScore() performanceTrainingScoreDto.setProjectValuationScore(
.add(performanceScore.getProjectUseValuationRelativeScore()))))); Optional.ofNullable(performanceScore.getProjectValuationRelativeScore()).orElse(BigDecimal.ZERO)
performanceTrainingScoreDto.setInvestmentSigningScore(performanceScore.getInvestmentSigningVlauationReportScore() .add(Optional.ofNullable(performanceScore.getProjectValuationScore()).orElse(BigDecimal.ZERO))
.add(performanceScore.getInvestmentSigningDiligenceReportScore() .add(Optional.ofNullable(performanceScore.getProjectValuationAbsoluteScore()).orElse(BigDecimal.ZERO))
.add(performanceScore.getInvestmentSigningInvestScore() .add(Optional.ofNullable(performanceScore.getProjectUseValuationAbsoluteScore()).orElse(BigDecimal.ZERO))
.add(performanceScore.getInvestmentSigningScore())))); .add(Optional.ofNullable(performanceScore.getProjectUseValuationRelativeScore()).orElse(BigDecimal.ZERO))
);
performanceTrainingScoreDto.setIpoScore(performanceScore.getIpoFlowScore().add(performanceScore.getIpoListedConditionScore()
.add(performanceScore.getIpoListedSectorScore()))); performanceTrainingScoreDto.setInvestmentSigningScore(
Optional.ofNullable(performanceScore.getInvestmentSigningVlauationReportScore()).orElse(BigDecimal.ZERO)
performanceTrainingScoreDto.setPricingIssuanceScore(performanceScore.getNewPricingIssuanceScore() .add(Optional.ofNullable(performanceScore.getInvestmentSigningDiligenceReportScore()).orElse(BigDecimal.ZERO))
.add(performanceScore.getPricingIssuanceConfirmScore().add(performanceScore.getInitPricingIssuanceScore() .add(Optional.ofNullable(performanceScore.getInvestmentSigningInvestScore()).orElse(BigDecimal.ZERO))
.add(performanceScore.getPricingIssuanceEnteringScore())))); .add(Optional.ofNullable(performanceScore.getInvestmentSigningScore()).orElse(BigDecimal.ZERO))
);
performanceTrainingScoreDto.setProfitManagementScore(performanceScore.getProfitManagementMarketValueScore()
.add(performanceScore.getProfitManagementFundScore() performanceTrainingScoreDto.setIpoScore(
.add(performanceScore.getProfitManagementFundExitScore() Optional.ofNullable(performanceScore.getIpoFlowScore()).orElse(BigDecimal.ZERO)
.add(performanceScore.getProfitManagementMarketValueExitScore())))); .add(Optional.ofNullable(performanceScore.getIpoListedConditionScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getIpoListedSectorScore()).orElse(BigDecimal.ZERO))
performanceTrainingScoreDto.setProfitDistributionScore(performanceScore.getProfitDistributionScore()); );
performanceTrainingScoreDto.setInvestmentReportScore(performanceScore.getInvestmentReportScore().add(performanceScore.getExperienceScore()));
performanceTrainingScoreDto.setTotalScore(performanceScore.getTotalScore()); 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; return performanceTrainingScoreDto;
} }
/* /*
* @author xcj * @author xcj
* @Date 2023/11/30 * @Date 2023/11/30

Loading…
Cancel
Save