|
|
@ -162,6 +162,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//查看基金募集属于哪种情况
|
|
|
|
//查看基金募集属于哪种情况
|
|
|
|
String flowId = profitDistribution.getFlowId();
|
|
|
|
String flowId = profitDistribution.getFlowId();
|
|
|
|
|
|
|
|
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
|
|
|
|
Fundraising fundraising = fundraisingService.selectByFlowId(flowId);
|
|
|
|
Fundraising fundraising = fundraisingService.selectByFlowId(flowId);
|
|
|
|
ExitTime exitTime = exitTimeMapper.selectByPrimaryKey(flowId);
|
|
|
|
ExitTime exitTime = exitTimeMapper.selectByPrimaryKey(flowId);
|
|
|
|
profitDistribution.setProjectName(exitTime.getProjectName());
|
|
|
|
profitDistribution.setProjectName(exitTime.getProjectName());
|
|
|
@ -204,6 +205,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (subtract.compareTo(rightOwnFunds) <= 0 && subtract.compareTo(BigDecimal.ZERO) >= 0) { //如果可用资金 - 优先级LP <= 需要分配的自有资金剩余金额全部给 自有资金,第二轮都为0
|
|
|
|
if (subtract.compareTo(rightOwnFunds) <= 0 && subtract.compareTo(BigDecimal.ZERO) >= 0) { //如果可用资金 - 优先级LP <= 需要分配的自有资金剩余金额全部给 自有资金,第二轮都为0
|
|
|
@ -215,6 +217,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
profitDistribution.setRoundOwnFunds(rightOwnFunds);
|
|
|
|
profitDistribution.setRoundOwnFunds(rightOwnFunds);
|
|
|
@ -230,7 +233,6 @@ 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());
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
performanceScoreMapper.updateByPrimaryKey(performanceScore);
|
|
|
|
performanceScoreMapper.updateByPrimaryKey(performanceScore);
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
@ -260,6 +262,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
BigDecimal.ZERO.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
|
|
|
|
BigDecimal.ZERO.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
profitDistribution.setRoundPreferredLp(rightFundraisingAmount); //下面的情况优先级LP都足够
|
|
|
|
profitDistribution.setRoundPreferredLp(rightFundraisingAmount); //下面的情况优先级LP都足够
|
|
|
@ -273,6 +276,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
subtract.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
|
|
|
|
subtract.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//分配完优劣LP后剩余的钱
|
|
|
|
//分配完优劣LP后剩余的钱
|
|
|
@ -287,6 +291,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
subordinatedLp.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
|
|
|
|
subordinatedLp.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 第一轮归还劣后级LP本金
|
|
|
|
// 第一轮归还劣后级LP本金
|
|
|
@ -314,7 +319,6 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
performanceScoreMapper.updateByPrimaryKey(performanceScore);
|
|
|
|
performanceScoreMapper.updateByPrimaryKey(performanceScore);
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
@ -344,6 +348,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
profitDistribution.setRoundBankLoan(rightBankLoan); //下面的情况优先级银行贷款都足够
|
|
|
|
profitDistribution.setRoundBankLoan(rightBankLoan); //下面的情况优先级银行贷款都足够
|
|
|
@ -357,6 +362,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//分配完优先级LP后剩余的钱给自有资金
|
|
|
|
//分配完优先级LP后剩余的钱给自有资金
|
|
|
@ -371,6 +377,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
profitDistribution.setRoundPreferredLp(rightFundraisingAmount);
|
|
|
|
profitDistribution.setRoundPreferredLp(rightFundraisingAmount);
|
|
|
@ -387,7 +394,6 @@ 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());
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
performanceScoreMapper.updateByPrimaryKey(performanceScore);
|
|
|
|
performanceScoreMapper.updateByPrimaryKey(performanceScore);
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
@ -424,6 +430,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
BigDecimal.ZERO.compareTo(userRoundSubordinatedLp) == 0) {
|
|
|
|
BigDecimal.ZERO.compareTo(userRoundSubordinatedLp) == 0) {
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
profitDistribution.setRoundBankLoan(rightBankLoan); //下面的情况优先级银行贷款都足够
|
|
|
|
profitDistribution.setRoundBankLoan(rightBankLoan); //下面的情况优先级银行贷款都足够
|
|
|
@ -438,6 +445,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
&& BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
|
|
|
|
&& BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//分配完优先级LP后剩余的钱给劣后级LP
|
|
|
|
//分配完优先级LP后剩余的钱给劣后级LP
|
|
|
@ -452,6 +460,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -468,6 +477,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) {
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -489,7 +499,6 @@ 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());
|
|
|
|
performanceScore.setProfitDistributionTime(new Date());
|
|
|
|
performanceScoreMapper.updateByPrimaryKey(performanceScore);
|
|
|
|
performanceScoreMapper.updateByPrimaryKey(performanceScore);
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
|
|
|
|