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

master
xiaoCJ 1 year ago
parent 6ce77a293d
commit 9a112b559a

@ -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;
}

@ -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;
}
}

@ -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);

@ -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

Loading…
Cancel
Save