修改部分bug

master
xiaoCJ 1 year ago
parent 4452191dcd
commit b54a5d5741

@ -2,9 +2,10 @@ package com.sztzjy.fund_investment.controller;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.IdUtil;
import com.itextpdf.text.*;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Font;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
@ -29,10 +30,11 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
//yz

@ -69,6 +69,8 @@ public class PerformanceScoreDto {
@ApiModelProperty("基金募资完成时间")
private Date fundraisingTime;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty("寻找项目完成时间")
private Date projectSearchTime;

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

@ -136,6 +136,9 @@ public class ClassScoreServiceImpl implements ClassScoreService {
} else { //选中某个班级返回
criteria.andClassIdEqualTo(classId).andStartTimeEqualTo(time);
List<TeaClassScore> teaClassScores = teaClassScoreMapper.selectByExample(teaClassScoreExample);
if (teaClassScores.isEmpty()){
return null;
}
TeaClassScore teaClassScore = teaClassScores.get(0);
TeaClassScoreDto teaClassScoreDto = new TeaClassScoreDto();
BeanUtils.copyProperties(teaClassScore, teaClassScoreDto);

Loading…
Cancel
Save