From b54a5d5741f286d9872e2a57471ba13b7293de08 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Fri, 2 Feb 2024 09:30:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProjectValuationController.java | 10 ++++++---- .../entity/dto/PerformanceScoreDto.java | 2 ++ .../ProfitDistributionServiceImpl.java | 17 +++++++++++++---- .../serviceImpl/tea/ClassScoreServiceImpl.java | 3 +++ 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/controller/ProjectValuationController.java b/src/main/java/com/sztzjy/fund_investment/controller/ProjectValuationController.java index 9254d6b..875446b 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/ProjectValuationController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/ProjectValuationController.java @@ -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 diff --git a/src/main/java/com/sztzjy/fund_investment/entity/dto/PerformanceScoreDto.java b/src/main/java/com/sztzjy/fund_investment/entity/dto/PerformanceScoreDto.java index 5a879b4..4c8dfa4 100644 --- a/src/main/java/com/sztzjy/fund_investment/entity/dto/PerformanceScoreDto.java +++ b/src/main/java/com/sztzjy/fund_investment/entity/dto/PerformanceScoreDto.java @@ -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; diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java index 6bca76f..bc148fd 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java @@ -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, "分配完成!"); diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java index 1d7a671..c0aa39b 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java @@ -136,6 +136,9 @@ public class ClassScoreServiceImpl implements ClassScoreService { } else { //选中某个班级返回 criteria.andClassIdEqualTo(classId).andStartTimeEqualTo(time); List teaClassScores = teaClassScoreMapper.selectByExample(teaClassScoreExample); + if (teaClassScores.isEmpty()){ + return null; + } TeaClassScore teaClassScore = teaClassScores.get(0); TeaClassScoreDto teaClassScoreDto = new TeaClassScoreDto(); BeanUtils.copyProperties(teaClassScore, teaClassScoreDto);