修改失效得分问题

master
xiaoCJ 1 year ago
parent 1674feb723
commit 654f780445

@ -203,9 +203,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
//算分
if (BigDecimal.ZERO.compareTo(userRoundOwnFunds) == 0 && rightAvailableFunds.compareTo(userRoundPreferredLp) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
if (subtract.compareTo(rightOwnFunds) <= 0 && subtract.compareTo(BigDecimal.ZERO) >= 0) { //如果可用资金 - 优先级LP <= 需要分配的自有资金剩余金额全部给 自有资金第二轮都为0
@ -215,9 +215,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
//判断算分
if (subtract.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
profitDistribution.setRoundOwnFunds(rightOwnFunds);
@ -231,10 +231,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
//算分 共五分可用资金1分其他共4分错一个不得分
if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
twoRightOwnFunds.compareTo(userRemainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, 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) {
@ -260,9 +259,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
if (BigDecimal.ZERO.compareTo(userRoundOwnFunds) == 0 && rightAvailableFunds.compareTo(userRoundPreferredLp) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0 &&
BigDecimal.ZERO.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
profitDistribution.setRoundPreferredLp(rightFundraisingAmount); //下面的情况优先级LP都足够
@ -274,9 +273,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0 &&
subtract.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
//分配完优劣LP后剩余的钱
@ -290,8 +289,8 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0 &&
subordinatedLp.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
performanceScore.setProfitDistributionTime(new Date());
}
performanceScore.setProfitDistributionTime(new Date());
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
// 第一轮归还劣后级LP本金
@ -316,11 +315,10 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0 &&
userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 &&
userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
}
performanceScore.setProfitDistributionTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
} else if (type == 3) { //3:银行借款/自有资金/优先级LP
if (profitDistribution.getUserRoundBankLoan() == null) {
@ -346,9 +344,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
if (BigDecimal.ZERO.compareTo(userRoundOwnFunds) == 0 && rightAvailableFunds.compareTo(userRoundBankLoan) == 0 &&
BigDecimal.ZERO.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
profitDistribution.setRoundBankLoan(rightBankLoan); //下面的情况优先级银行贷款都足够
@ -360,9 +358,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
if (BigDecimal.ZERO.compareTo(userRoundOwnFunds) == 0 && rightBankLoan.compareTo(userRoundBankLoan) == 0 &&
subtractBankLoan.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
//分配完优先级LP后剩余的钱给自有资金
@ -375,9 +373,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
if (subtractRoundOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightBankLoan.compareTo(userRoundBankLoan) == 0 &&
rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
profitDistribution.setRoundPreferredLp(rightFundraisingAmount);
@ -392,10 +390,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
twoRightOwnFunds.compareTo(userRemainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0 &&
rightBankLoan.compareTo(userRoundBankLoan) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
} else { //4:银行借款/优先级LP/劣后级LP/自有资金
if (profitDistribution.getUserRemainingEarningsSubordinatedLp() == null || profitDistribution.getUserRoundSubordinatedLp() == null) {
@ -428,9 +425,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
BigDecimal.ZERO.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0 &&
BigDecimal.ZERO.compareTo(userRoundSubordinatedLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
profitDistribution.setRoundBankLoan(rightBankLoan); //下面的情况优先级银行贷款都足够
@ -443,9 +440,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
subtractBankLoan.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRoundSubordinatedLp) == 0
&& BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
//分配完优先级LP后剩余的钱给劣后级LP
@ -458,9 +455,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
if (subtractSubordinatedLp.compareTo(userRoundOwnFunds) == 0 && rightBankLoan.compareTo(userRoundBankLoan) == 0 &&
rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
@ -475,9 +472,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
subordinatedLp.compareTo(userRoundSubordinatedLp) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && subordinatedLp.compareTo(userRoundSubordinatedLp) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
@ -498,10 +495,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
twoRightOwnFunds.compareTo(userRemainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0 &&
rightBankLoan.compareTo(userRoundBankLoan) == 0 && userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 &&
userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) {
performanceScore.setProfitDistributionTime(new Date());
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
performanceScore.setProfitDistributionTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
}

@ -505,7 +505,11 @@ public class ClassScoreServiceImpl implements ClassScoreService {
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.setProjectSearchScore(
(performanceScore.getProjectSearchScore() != null ? performanceScore.getProjectSearchScore() : BigDecimal.ZERO).add(
(performanceScore.getProjectSearchReportScore() != null ? performanceScore.getProjectSearchReportScore() : BigDecimal.ZERO)
)
);
performanceTrainingScoreDto.setProjectDueDiligenceScore(
Optional.ofNullable(performanceScore.getProjectDueDiligenceScore()).map(score ->
score.add(Optional.ofNullable(performanceScore.getProjectDueDiligenceFinanceReportScore()).orElse(BigDecimal.ZERO))

Loading…
Cancel
Save