From 678cad7a35baf06162095e5fc7d8acb656fb2ae3 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Mon, 29 Jan 2024 11:40:33 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProfitManagementController.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java b/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java index 6c1638f..364fb80 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.List; import java.util.Random; @@ -54,12 +55,14 @@ public class ProfitManagementController { @ApiOperation("退出时机弹窗/随机获取股票价格") @AnonymousAccess @GetMapping("/getRandomPrice") - public ResultEntity getRandomPrice(@ApiParam("getLineChart返回的Id") @RequestParam String id) { + public ResultEntity getRandomPrice(@ApiParam("getLineChart返回的Id") @RequestParam String id) { Random random = new Random(); double randomValue = 0.01 + random.nextDouble() * 19.99; // 生成0到20之间的随机数(不包括0) - return new ResultEntity<>(randomValue); + BigDecimal bigDecimal = BigDecimal.valueOf(randomValue).setScale(2, RoundingMode.HALF_UP); + return new ResultEntity<>(bigDecimal); } + @ApiOperation("退出时机弹窗/判断市值和基金收益对错,计算错误则返回正确答案") @AnonymousAccess @GetMapping("/getExitTimeRightMarketValueAndFundEarnings") From e54e8ca2d3545413590caf288bdb95527be8ef6a Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Mon, 29 Jan 2024 13:57:20 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fund_investment/controller/UserController.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/controller/UserController.java b/src/main/java/com/sztzjy/fund_investment/controller/UserController.java index 9347fa6..bddf1f5 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/UserController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/UserController.java @@ -254,12 +254,13 @@ public class UserController { int index2 = random.nextInt(2); Map> map = evaluatePerformanceLevel(trainingScore, maxScoresMap); evaluationLevel.setLevelMap(map); - - String[] evaluationLevelArr = {"恭喜你完成实验,你本次实验总体" + level + ",实验过程充满挑战,能够完成实验已经很棒了,接下来我们看下实验完成情况吧。实验中你完成的" + arr1[index1] + "的步骤有" - + String.join(",", map.get("非常好")) + "步骤," + "你对这些步骤知识掌提的非常" + arr2[index2] + ",相信你一定做了不少努力,这些对你以后参与股权基金投资相关工作非常有帮助。实验中你完成的一般的步骤有" - + String.join(",", map.get("一般")) + "步骤,你初步" + arr4[index2] + "了这部分内容,相信你通过学习" + arr5[index2] + "做的更好,这些都是股权基金投资实务业务知识,跟理论还是有一定差距的,努力学习吧! " - + "实验中你完成的" + arr6[index2] + "的步骤有" + String.join(",", map.get("较差")) + "步骤,是不是没有认真实验呢?这是个" + arr3[index2] + "的实验,要认真对待哦,不会的业务知识去搜集资料或者请教下同学和老师吧,争取早日掌握它们! " - + "如果你对实验过程有什么疑问,可以通过系统场景右下角的答疑按钮进行提问哦,会有人回复的,如果你对实验有什么意见,也欢迎提出,我们一起改进,让这个实验越来越好帮助更多的人!"}; + String s = "

恭喜你完成实验,你本次实验总体" + level + ",实验过程充满挑战,能够完成实验已经很棒了,接下来我们看下实验完成情况吧。

实验中你完成的" + arr1[index1] + "的步骤有" + + String.join(",", map.get("非常好")) + "步骤," + "你对这些步骤知识掌提的非常" + arr2[index2] + ",相信你一定做了不少努力,这些对你以后参与股权基金投资相关工作非常有帮助。

实验中你完成的一般的步骤有" + + String.join(",", map.get("一般")) + "步骤,你初步" + arr4[index2] + "了这部分内容,相信你通过学习" + arr5[index2] + "做的更好,这些都是股权基金投资实务业务知识,跟理论还是有一定差距的,努力学习吧!

" + + "

实验中你完成的" + arr6[index2] + "的步骤有" + String.join(",", map.get("较差")) + "步骤,是不是没有认真实验呢?这是个" + arr3[index2] + "的实验,要认真对待哦,不会的业务知识去搜集资料或者请教下同学和老师吧,争取早日掌握它们!

" + + "

如果你对实验过程有什么疑问,可以通过系统场景右下角的答疑按钮进行提问哦,会有人回复的,如果你对实验有什么意见,也欢迎提出,我们一起改进,让这个实验越来越好帮助更多的人!

"; + String trim = s.trim(); + String[] evaluationLevelArr = {trim}; evaluationLevel.setEvaluation(evaluationLevelArr); return new ResultEntity(evaluationLevel); } From dcdc378c4b173847d85ebfae9a4913945ee83a3f Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Tue, 30 Jan 2024 11:32:16 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=94=B6=E7=9B=8A?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=9F=BA=E9=87=91?= =?UTF-8?q?=E5=8B=9F=E8=B5=84=E9=87=91=E9=A2=9D=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProfitDistributionController.java | 14 +++-- .../ProfitManagementController.java | 13 ++-- .../service/ProfitManagementService.java | 5 +- .../ProfitManagementServiceImpl.java | 59 ++++++++----------- 4 files changed, 45 insertions(+), 46 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/controller/ProfitDistributionController.java b/src/main/java/com/sztzjy/fund_investment/controller/ProfitDistributionController.java index 70c1963..0a84cb4 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/ProfitDistributionController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/ProfitDistributionController.java @@ -12,6 +12,10 @@ import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + /** * @Author xcj * @Date 2023/12/6 @@ -41,11 +45,13 @@ public class ProfitDistributionController { @AnonymousAccess @PostMapping("/getType") - @ApiOperation("返回基金募集的类型") - public Integer submit(@RequestParam String flowId) { + @ApiOperation("返回基金募集的类型和总金额") + public ResultEntity> submit(@RequestParam String flowId) { Fundraising fundraising = fundraisingService.selectByFlowId(flowId); - if (fundraising!=null) { - return fundraising.getType(); + Map map = new HashMap<>(); + if (fundraising != null) { + map.put(fundraising.getType(), fundraising.getFundraisingAmount()); + return new ResultEntity<>(map); } return null; } diff --git a/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java b/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java index 364fb80..d982ab2 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java @@ -9,6 +9,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -66,11 +67,11 @@ public class ProfitManagementController { @ApiOperation("退出时机弹窗/判断市值和基金收益对错,计算错误则返回正确答案") @AnonymousAccess @GetMapping("/getExitTimeRightMarketValueAndFundEarnings") - public ResultEntity getExitTimeRightMarketValueAndFundEarnings(@RequestParam String flowId, - @ApiParam("退出时间") @RequestParam String exitTime, - @ApiParam("随机生成的价格") @RequestParam BigDecimal price, - @ApiParam("用户输入的市值") @RequestParam BigDecimal userMarketValue, - @ApiParam("用户输入的基金收益") @RequestParam BigDecimal userFundEarnings) { + public ResultEntity getExitTimeRightMarketValueAndFundEarnings(@RequestParam String flowId, + @ApiParam("退出时间") @RequestParam String exitTime, + @ApiParam("随机生成的价格") @RequestParam BigDecimal price, + @ApiParam("用户输入的市值") @RequestParam BigDecimal userMarketValue, + @ApiParam("用户输入的基金收益") @RequestParam BigDecimal userFundEarnings) { return profitManagementService.getExitTimeRightMarketValueAndFundEarnings(flowId, exitTime, price, userMarketValue, userFundEarnings); } @@ -88,7 +89,7 @@ public class ProfitManagementController { @ApiOperation("判断市值和基金收益对错,计算错误则返回正确答案") @AnonymousAccess @GetMapping("/getRightMarketValueAndFundEarnings") - public ResultEntity getStockInfo(@RequestParam @ApiParam("getLineChart返回的Id") String id, + public ResultEntity getStockInfo(@RequestParam @ApiParam("getLineChart返回的Id") String id, @ApiParam("用户输入的市值") @RequestParam BigDecimal userMarketValue, @ApiParam("用户输入的基金收益") @RequestParam BigDecimal userFundEarnings) { return profitManagementService.getRightMarketValueAndFundEarnings(id, userMarketValue, userFundEarnings); diff --git a/src/main/java/com/sztzjy/fund_investment/service/ProfitManagementService.java b/src/main/java/com/sztzjy/fund_investment/service/ProfitManagementService.java index c1c6dea..a21e9a5 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/ProfitManagementService.java +++ b/src/main/java/com/sztzjy/fund_investment/service/ProfitManagementService.java @@ -3,6 +3,7 @@ package com.sztzjy.fund_investment.service; import com.sztzjy.fund_investment.entity.ExitTime; import com.sztzjy.fund_investment.entity.ProfitManagement; import com.sztzjy.fund_investment.util.ResultEntity; +import org.springframework.http.HttpStatus; import java.math.BigDecimal; import java.util.List; @@ -16,9 +17,9 @@ public interface ProfitManagementService { ProfitManagement getStockInfo(String id); - ResultEntity getRightMarketValueAndFundEarnings(String id, BigDecimal userMarketValue, BigDecimal userFundEarnings); + ResultEntity getRightMarketValueAndFundEarnings(String id, BigDecimal userMarketValue, BigDecimal userFundEarnings); ExitTime getExitTime(String flowId); - ResultEntity getExitTimeRightMarketValueAndFundEarnings(String flowId, String exitTime, BigDecimal price, BigDecimal userMarketValue, BigDecimal userFundEarnings); + ResultEntity getExitTimeRightMarketValueAndFundEarnings(String flowId, String exitTime, BigDecimal price, BigDecimal userMarketValue, BigDecimal userFundEarnings); } diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitManagementServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitManagementServiceImpl.java index 76899a1..1cec2b9 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitManagementServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitManagementServiceImpl.java @@ -74,12 +74,12 @@ public class ProfitManagementServiceImpl implements ProfitManagementService { profitManagementMapper.updateByPrimaryKey(profitManagement); if (!(userMarketValue.compareTo(marketValue) == 0)) { - return new ResultEntity(HttpStatus.BAD_REQUEST, "市值计算错误!", marketValue); + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "市值计算错误!", marketValue); } else { performanceScoreService.calculateScoreByModule("profitManagementMarketValueScore", 2, profitManagement.getFlowId()); } if (!(userFundEarnings.compareTo(fundEarnings) == 0)) { - return new ResultEntity(HttpStatus.BAD_REQUEST, "收益计算错误!", fundEarnings); + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "收益计算错误!", fundEarnings); } else { performanceScoreService.calculateScoreByModule("profitManagementFundScore", 2, profitManagement.getFlowId()); } @@ -93,25 +93,7 @@ public class ProfitManagementServiceImpl implements ProfitManagementService { */ @Override public ExitTime getExitTime(String flowId) { - ExitTime dataExitTime = exitTimeMapper.selectByPrimaryKey(flowId); - if (dataExitTime != null) { - return dataExitTime; - } else { - ExitTime exitTime = new ExitTime(); - List profitManagementList = getLineChart(flowId); - if (profitManagementList.isEmpty()){ - return null; - } - ProfitManagement profitManagement = profitManagementList.get(0); - exitTime.setFlowId(flowId); - exitTime.setProjectName(profitManagement.getProjectName()); - exitTime.setInvestmentAmount(profitManagement.getInvestmentAmount()); - exitTime.setShareRatio(profitManagement.getShareRatio()); - exitTime.setTotalEquity(profitManagement.getTotalEquity()); - exitTime.setShareCount(profitManagement.getShareCount()); - exitTimeMapper.insert(exitTime); - return exitTime; - } + return exitTimeMapper.selectByPrimaryKey(flowId); } @@ -122,37 +104,46 @@ public class ProfitManagementServiceImpl implements ProfitManagementService { @Override public ResultEntity getExitTimeRightMarketValueAndFundEarnings(String flowId, String exitTime, BigDecimal price, BigDecimal userMarketValue, BigDecimal userFundEarnings) { - ExitTime exitTimeEntity = exitTimeMapper.selectByPrimaryKey(flowId); + ExitTime exitTimeEntity =new ExitTime(); + List profitManagementList = getLineChart(flowId); + if (profitManagementList.isEmpty()) { + return null; + } + ProfitManagement profitManagement = profitManagementList.get(0); + exitTimeEntity.setFlowId(flowId); + exitTimeEntity.setProjectName(profitManagement.getProjectName()); + exitTimeEntity.setInvestmentAmount(profitManagement.getInvestmentAmount()); + exitTimeEntity.setShareRatio(profitManagement.getShareRatio()); + exitTimeEntity.setTotalEquity(profitManagement.getTotalEquity()); + exitTimeEntity.setShareCount(profitManagement.getShareCount()); exitTimeEntity.setExitTiming(exitTime); exitTimeEntity.setExitStockPrice(price); exitTimeEntity.setUserMarketValue(userMarketValue); exitTimeEntity.setUserFundEarnings(userFundEarnings); //公司市值=股票价格*总股本 - BigDecimal marketValue = exitTimeEntity.getExitStockPrice().multiply(exitTimeEntity.getTotalEquity()).setScale(2, RoundingMode.HALF_UP); + BigDecimal marketValue = price.multiply(exitTimeEntity.getTotalEquity()).setScale(2, RoundingMode.HALF_UP); exitTimeEntity.setExitMarketValue(marketValue); - exitTimeEntity.setUserMarketValue(userMarketValue); //基金收益=持股数量*股票价格-投资金额 - BigDecimal fundEarnings = exitTimeEntity.getShareCount().multiply(exitTimeEntity.getExitStockPrice()).subtract(exitTimeEntity.getInvestmentAmount()).setScale(2, RoundingMode.HALF_UP); - exitTimeEntity.setUserFundEarnings(userFundEarnings); + BigDecimal fundEarnings = exitTimeEntity.getShareCount().multiply(price).subtract(exitTimeEntity.getInvestmentAmount()).setScale(2, RoundingMode.HALF_UP); exitTimeEntity.setExitFundEarnings(fundEarnings); // 退出时收益率 = 基金收益 / 投资金额 - BigDecimal exitYield = exitTimeEntity.getExitFundEarnings().divide(exitTimeEntity.getInvestmentAmount(), 2, RoundingMode.HALF_UP); + BigDecimal exitYield = profitManagement.getFundEarnings().divide(exitTimeEntity.getInvestmentAmount(), 2, RoundingMode.HALF_UP); exitTimeEntity.setExitYield(exitYield); - exitTimeMapper.updateByPrimaryKey(exitTimeEntity); + exitTimeMapper.insert(exitTimeEntity); + //标记页面完成时间 + PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId); + performanceScore.setProfitManagementTime(new Date()); + performanceScoreMapper.updateByPrimaryKey(performanceScore); if (!(userMarketValue.compareTo(marketValue) == 0)) { - return new ResultEntity(HttpStatus.BAD_REQUEST, "市值计算错误!", marketValue); + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "市值计算错误!", marketValue); } else { performanceScoreService.calculateScoreByModule("profitManagementFundExitScore", 3, flowId); } if (!(userFundEarnings.compareTo(fundEarnings) == 0)) { - return new ResultEntity(HttpStatus.BAD_REQUEST, "收益计算错误!", fundEarnings); + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "收益计算错误!", fundEarnings); } else { performanceScoreService.calculateScoreByModule("profitManagementMarketValueExitScore", 3, flowId); } - //标记页面完成时间 - PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId); - performanceScore.setProfitManagementTime(new Date()); - performanceScoreMapper.updateByPrimaryKey(performanceScore); return null; } } From 9169429ce8790a55c1ec7162ba3e458f433b4cab Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Tue, 30 Jan 2024 15:38:30 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=94=B6=E7=9B=8A?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=9F=BA=E9=87=91?= =?UTF-8?q?=E5=8B=9F=E8=B5=84=E9=87=91=E9=A2=9D=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContractInvestmentServiceImpl.java | 109 ++++++++---------- .../InvestmentReportServiceImpl.java | 2 +- .../ProfitDistributionServiceImpl.java | 4 +- 3 files changed, 51 insertions(+), 64 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ContractInvestmentServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ContractInvestmentServiceImpl.java index f3f156b..76599b1 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ContractInvestmentServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ContractInvestmentServiceImpl.java @@ -59,7 +59,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService private InquiryParticipationMapper inquiryParticipationMapper; @Autowired - private IssuanceParameterInputMapper issuanceParameterInputMapper; + private IssuanceParameterInputMapper issuanceParameterInputMapper; @Autowired private PerformanceScoreMapper performanceScoreMapper; @@ -71,7 +71,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService * 上传尽调报告 */ @Override - public ResultEntity uploadDueDiligenceReport(List files , ReportUploadDto reportNameType) { + public ResultEntity uploadDueDiligenceReport(List files, ReportUploadDto reportNameType) { int count = 0; for (MultipartFile file : files) { @@ -91,8 +91,8 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService //一个两个做判断 - if ("尽调报告".equals(reportNameType.getReportNameType())){ - if (trainingReports.size() > 0 ) { + if ("尽调报告".equals(reportNameType.getReportNameType())) { + if (trainingReports.size() > 0) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "不允许重复提交!"); } else { //只允许提交一次 TrainingReport trainingReport = new TrainingReport(); @@ -106,16 +106,16 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService trainingReport.setStep(reportNameType.getReportNameType()); trainingReportMapper.insert(trainingReport); //(每个2分,共4分) - if ("尽调报告".equals(reportNameType.getReportNameType())){ + if ("尽调报告".equals(reportNameType.getReportNameType())) { //investmentSigningDiligenceReportScore performanceScoreService.calculateScoreByModule("investmentSigningDiligenceReportScore", 2, reportNameType.getFlowId()); + } } - } - }else if ("估值报告".equals(reportNameType.getReportNameType())){ - if (trainingReports.size() >= 2 ) { + } else if ("估值报告".equals(reportNameType.getReportNameType())) { + if (trainingReports.size() >= 2) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "不允许重复提交!"); - }else { + } else { TrainingReport trainingReport = new TrainingReport(); trainingReport.setId(IdUtil.fastSimpleUUID()); trainingReport.setFlowId(reportNameType.getFlowId()); @@ -127,8 +127,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService trainingReport.setStep(reportNameType.getReportNameType()); trainingReportMapper.insert(trainingReport); count++; - if (count == 1) - { + if (count == 1) { performanceScoreService.calculateScoreByModule("investmentSigningVlauationReportScore", 2, reportNameType.getFlowId()); } } @@ -175,12 +174,12 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService ProjectPool projectPool = projectPools.get(0); //项目估值 - latestValuation = Double.valueOf(projectPool.getLatestValuation()); + latestValuation = Double.valueOf(projectPool.getLatestValuation()); //获取公司名 - companyName = projectPool.getCompanyName(); + companyName = projectPool.getCompanyName(); } //公司名 - investmentAgreementDto.setCorporateName(companyName+"有限公司"); + investmentAgreementDto.setCorporateName(companyName + "有限公司"); //法定代表人 investmentAgreementDto.setLegalRepresentativePartA(list.get(0).getLegalPerson()); //注册地址 @@ -211,7 +210,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService investmentAgreementDto.setIncreaseCapitalShare(profitManagement.getInvestmentAmount().toString()); long v = profitManagement.getInvestmentAmount().longValue(); Long aLong = Convert.toLong(latestValuation); - Long sum = aLong+v; + Long sum = aLong + v; //增资后公司总股本 investmentAgreementDto.setTotalShareCapital(String.valueOf(sum)); @@ -230,7 +229,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService //hutool工具转换金额 String s = Convert.digitToChinese(aDouble); //第三条注册资本大写金额 - investmentAgreementDto.setRegisteredCapitalAmount(s+"人民币"); + investmentAgreementDto.setRegisteredCapitalAmount(s + "人民币"); //投资金额 BigDecimal investmentAmount = profitManagement.getInvestmentAmount(); @@ -240,8 +239,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService Long aLong1 = Convert.toLong(registeredCapital); //注册资本加上投资金额 - long sumMoney = aLong1+ aDouble1; - + long sumMoney = aLong1 + aDouble1; //第三条注册资本增加至 @@ -252,7 +250,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService String s2 = Convert.digitToChinese(sumMoney); //第三条注册资本增加至大写金额 - investmentAgreementDto.setRegisteredCapitalIncreaseAmount(s2+"人民币"); + investmentAgreementDto.setRegisteredCapitalIncreaseAmount(s2 + "人民币"); //第三条增资股份等于投资金额 investmentAgreementDto.setCapitalIncreaseShares(String.valueOf(investmentAmount)); @@ -279,7 +277,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService investmentAgreementDto.setSigningAddress(businessInfoList.get(0).getRegisteredAddress()); - return investmentAgreementDto; + return investmentAgreementDto; } @@ -289,6 +287,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService /** * 承销商新建发行申请 + * * @return */ @Override @@ -302,18 +301,16 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService issuanceInfoExample.createCriteria().andFlowIdEqualTo(issuanceInfo.getFlowId()); List issuanceInfos = issuanceInfoMapper.selectByExample(issuanceInfoExample); //查询有无第一次录入的数据 - if (issuanceInfos.size()>0) - { + if (issuanceInfos.size() > 0) { //获取上一次录入的数据和这一次录入的做对比 - String s = compareFields(issuanceInfo,issuanceInfos.get(0)); - if (!s.isEmpty()) - { + String s = compareFields(issuanceInfo, issuanceInfos.get(0)); + if (!s.isEmpty()) { issuanceInfoMapper.deleteByExample(issuanceInfoExample); - return new ResultEntity<>(HttpStatus.OK,s,"两次输入的"+s+":"+"值不同!"); + return new ResultEntity<>(HttpStatus.OK, s, "两次输入的" + s + ":" + "值不同!"); } //完成新建发行申请3分 performanceScoreService.calculateScoreByModule("newPricingIssuanceScore", 3, issuanceInfo.getFlowId()); - return new ResultEntity<>(HttpStatus.OK,s,"添加成功"); + return new ResultEntity<>(HttpStatus.OK, s, "添加成功"); } @@ -342,25 +339,25 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService long info = l * 100000; //判断估值和4亿比较 //估值小于4亿的,发行总量大于等于估值的25%,估值大于4亿的,发行总量大于估值的10% - if(aLong > max){ + if (aLong > max) { - if (info/aLong >0.1) { + if (info / aLong > 0.1) { issuanceInfo.setId(IdUtil.fastSimpleUUID()); //插入数据 issuanceInfoMapper.insert(issuanceInfo); return new ResultEntity(HttpStatus.OK); - }else { + } else { return new ResultEntity(HttpStatus.BAD_REQUEST, "发行总量小于估值的10%"); } - }else if (aLong < max){ - if (info/aLong >0.25) { + } else if (aLong < max) { + if (info / aLong > 0.25) { issuanceInfo.setId(IdUtil.fastSimpleUUID()); //插入数据 issuanceInfoMapper.insert(issuanceInfo); return new ResultEntity(HttpStatus.OK); - }else { + } else { return new ResultEntity(HttpStatus.BAD_REQUEST, "发行总量小于估值的25%"); } } @@ -373,7 +370,8 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService } /** - *发行参数录入基本信息 + * 发行参数录入基本信息 + * * @param flowId * @return */ @@ -433,14 +431,12 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService issuanceParameterInputExample.createCriteria().andFlowIdEqualTo(issuanceParameterInput.getFlowId()); List issuanceParameterInputList = issuanceParameterInputMapper.selectByExample(issuanceParameterInputExample); //查询有无第一次录入的数据 - if (issuanceParameterInputList.size()>0) - { + if (issuanceParameterInputList.size() > 0) { //获取上一次录入的数据和这一次录入的做对比 - String s = compareFieldsTwo(issuanceParameterInput,issuanceParameterInputList.get(0)); - if (!s.isEmpty()) - { + String s = compareFieldsTwo(issuanceParameterInput, issuanceParameterInputList.get(0)); + if (!s.isEmpty()) { issuanceParameterInputMapper.deleteByExample(issuanceParameterInputExample); - return new ResultEntity<>(HttpStatus.OK,s,"两次输入的"+s+":"+"值不同!"); + return new ResultEntity<>(HttpStatus.OK, s, "两次输入的" + s + ":" + "值不同!"); } //询价结果查询及发行参数录入2分 performanceScoreService.calculateScoreByModule("pricingIssuanceEnteringScore", 2, issuanceParameterInput.getFlowId()); @@ -450,7 +446,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService performanceScore.setPricingIssuanceTime(new Date()); performanceScoreMapper.updateByPrimaryKey(performanceScore); - return new ResultEntity<>(HttpStatus.OK,s,"添加成功"); + return new ResultEntity<>(HttpStatus.OK, s, "添加成功"); } //第一次录入和估值做计算 else { @@ -465,6 +461,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService /** * 网下初步配售发行价格发行总量 + * * @param flowId * @return */ @@ -485,7 +482,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService // 比较两个Student对象的字段,返回不相同的字段 - public String compareFieldsTwo(IssuanceParameterInput newInfo ,IssuanceParameterInput other) { + public String compareFieldsTwo(IssuanceParameterInput newInfo, IssuanceParameterInput other) { IssuanceParameterInputExample issuanceParameterInputExample = new IssuanceParameterInputExample(); issuanceParameterInputExample.createCriteria().andFlowIdEqualTo(newInfo.getFlowId()); List issuanceParameterInputList = issuanceParameterInputMapper.selectByExample(issuanceParameterInputExample); @@ -530,8 +527,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService if (!formattedThisValue.equals(formattedOtherValue)) { differences.append(field.getName()).append(": ").append(formattedThisValue).append(" -> ").append(formattedOtherValue).append("/n"); } - } - else { + } else { // 对于非浮点数,直接使用 equals 进行比较 if ((thisValue == null && otherValue != null) || (thisValue != null && !thisValue.equals(otherValue))) { differences.append(field.getName()).append(": ").append(thisValue).append(" -> ").append(otherValue).append("/n"); @@ -547,10 +543,8 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService } - - // 比较两个Student对象的字段,返回不相同的字段 - public String compareFields(IssuanceInfo newInfo ,IssuanceInfo other) { + public String compareFields(IssuanceInfo newInfo, IssuanceInfo other) { IssuanceInfoExample issuanceInfoExample = new IssuanceInfoExample(); issuanceInfoExample.createCriteria().andFlowIdEqualTo(other.getFlowId()); List issuanceInfos = issuanceInfoMapper.selectByExample(issuanceInfoExample); @@ -594,8 +588,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService if (!formattedThisValue.equals(formattedOtherValue)) { differences.append(field.getName()).append(": ").append(formattedThisValue).append(" -> ").append(formattedOtherValue).append("/n"); } - } - else { + } else { // 对于非浮点数,直接使用 equals 进行比较 if ((thisValue == null && otherValue != null) || (thisValue != null && !thisValue.equals(otherValue))) { differences.append(field.getName()).append(": ").append(thisValue).append(" -> ").append(otherValue).append("/n"); @@ -611,19 +604,13 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService } + public List getTrainingReports(String flowId, String reportName) { + TrainingReportExample trainingReportExample = new TrainingReportExample(); + trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(reportName); + return trainingReportMapper.selectByExample(trainingReportExample); + } - - - - - - public List getTrainingReports (String flowId, String reportName){ - TrainingReportExample trainingReportExample = new TrainingReportExample(); - trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(reportName); - return trainingReportMapper.selectByExample(trainingReportExample); - } - - } +} diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java index 6f4a96c..273472e 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java @@ -92,7 +92,7 @@ public class InvestmentReportServiceImpl implements InvestmentReportService { @Override public List getTrainingReports(String flowId) { TrainingReportExample trainingReportExample = new TrainingReportExample(); - trainingReportExample.createCriteria().andFlowIdEqualTo(flowId); + trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(Constant.TZBG); return trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample); } 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 23ae5dc..29fdfcd 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 @@ -179,8 +179,8 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService BigDecimal userRemainingEarningsPreferredLp = profitDistribution.getRemainingEarningsPreferredLp();//用户/第二轮优先级LP BigDecimal rightOwnFunds = fundraising.getOwnFunds();//正确/第一轮自有资金 Integer type = fundraising.getType(); - //计算可用资金是否正确 - BigDecimal rightAvailableFunds = fundraisingAmount.add(exitFundEarnings).setScale(2, RoundingMode.HALF_UP);//可用资金 + //计算可用资金是否正确 基金募集总金额-投资金额+退出时投资收益 + BigDecimal rightAvailableFunds = fundraisingAmount.subtract(exitTime.getInvestmentAmount()).add(exitFundEarnings).setScale(2, RoundingMode.HALF_UP);//可用资金 profitDistribution.setAvailableFunds(rightAvailableFunds); //设置可用资金 if (profitDistribution.getUserAvailableFunds().compareTo(rightAvailableFunds) == 0) { performanceScoreService.calculateScoreByModule("profitDistributionAvailablefundsScore", 1, flowId); From 33f6a4931810a813c8868b9a98a8d417e869cf75 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Wed, 31 Jan 2024 11:29:30 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=94=B6=E7=9B=8A=E5=88=86=E9=85=8D=E4=BC=98=E5=85=88=E7=BA=A7?= =?UTF-8?q?LP=E5=88=86=E9=85=8D=E7=8E=87=EF=BC=8C=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88bug=EF=BC=8C=E9=80=80=E5=87=BA=E6=97=B6=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InvestmentReportController.java | 16 +++++++-- .../ProfitManagementController.java | 2 +- .../service/InvestmentReportService.java | 3 ++ .../InvestmentReportServiceImpl.java | 36 ++++++++++++++++++- .../ProfitDistributionServiceImpl.java | 26 +++++++++----- .../ProfitManagementServiceImpl.java | 10 ++---- 6 files changed, 72 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/controller/InvestmentReportController.java b/src/main/java/com/sztzjy/fund_investment/controller/InvestmentReportController.java index 87ff50d..5bf3913 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/InvestmentReportController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/InvestmentReportController.java @@ -14,6 +14,7 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -72,6 +73,13 @@ public class InvestmentReportController { return investmentReportService.commitExperience(trainingReport); } + @AnonymousAccess + @PostMapping("saveExperience") + @ApiOperation("保存心得") + public ResultEntity saveExperience(@ApiParam("用户填写的心得") @RequestParam String text, @RequestParam String flowId, @RequestParam String schoolId) { + return investmentReportService.saveExperience(text,flowId,schoolId); + } + @AnonymousAccess @GetMapping("getExperience") @ApiOperation("心得回显") @@ -81,10 +89,12 @@ public class InvestmentReportController { return null; } TrainingReport trainingReport = trainingReports.get(0); - if (StringUtils.isBlank(trainingReport.getExperience())) { - return null; + if (!StringUtils.isBlank(trainingReport.getExperience())) { + return new ResultEntity<>(trainingReport.getExperience()); + } if (!StringUtils.isBlank(trainingReport.getVersion())) { + return new ResultEntity<>(trainingReport.getVersion()); } - return new ResultEntity<>(trainingReport.getExperience()); + return null; } @AnonymousAccess diff --git a/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java b/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java index d982ab2..7ef81b6 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java @@ -67,7 +67,7 @@ public class ProfitManagementController { @ApiOperation("退出时机弹窗/判断市值和基金收益对错,计算错误则返回正确答案") @AnonymousAccess @GetMapping("/getExitTimeRightMarketValueAndFundEarnings") - public ResultEntity getExitTimeRightMarketValueAndFundEarnings(@RequestParam String flowId, + public ResultEntity getExitTimeRightMarketValueAndFundEarnings(@RequestParam String flowId, @ApiParam("退出时间") @RequestParam String exitTime, @ApiParam("随机生成的价格") @RequestParam BigDecimal price, @ApiParam("用户输入的市值") @RequestParam BigDecimal userMarketValue, diff --git a/src/main/java/com/sztzjy/fund_investment/service/InvestmentReportService.java b/src/main/java/com/sztzjy/fund_investment/service/InvestmentReportService.java index 24eb249..0447c5e 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/InvestmentReportService.java +++ b/src/main/java/com/sztzjy/fund_investment/service/InvestmentReportService.java @@ -2,6 +2,7 @@ package com.sztzjy.fund_investment.service; import com.sztzjy.fund_investment.entity.TrainingReport; import com.sztzjy.fund_investment.util.ResultEntity; +import org.springframework.http.HttpStatus; import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -16,4 +17,6 @@ public interface InvestmentReportService { List getTrainingReports(String flowId); ResultEntity commitExperience(TrainingReport trainingReport); + + ResultEntity saveExperience(String text, String flowId, String schoolId); } diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java index 273472e..160961b 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java @@ -106,7 +106,7 @@ public class InvestmentReportServiceImpl implements InvestmentReportService { if (StringUtils.isBlank(trainingReport.getExperience())) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请先填写心得再提交!"); } - if (StringUtils.isBlank(trainingReport.getId()) || StringUtils.isBlank(trainingReport.getFlowId()) || StringUtils.isBlank(trainingReport.getSchoolId())) { + if (StringUtils.isBlank(trainingReport.getFlowId()) || StringUtils.isBlank(trainingReport.getSchoolId())) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "提交失败!缺少所需的ID!"); } TrainingReportExample trainingReportExample = new TrainingReportExample(); @@ -122,10 +122,44 @@ public class InvestmentReportServiceImpl implements InvestmentReportService { trainingReportMapper.updateByPrimaryKeyWithBLOBs(dataTrainingReport); } } else { //为空新增 + trainingReport.setId(IdUtil.simpleUUID()); trainingReport.setUploadtime(new Date()); trainingReport.setStep(Constant.TZBG); trainingReportMapper.insert(trainingReport); } return new ResultEntity<>(HttpStatus.OK, "提交成功!"); } + + + + /* 保存实训心得 + * @author xcj + * @Date 2024/1/31 + */ + @Override + public ResultEntity saveExperience(String text,String flowId,String schoolId) { + TrainingReportExample trainingReportExample = new TrainingReportExample(); + trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(Constant.TZBG); + List trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample); + //为空代表没有提交或保存过,新增一条 + if (trainingReports.isEmpty()){ + TrainingReport trainingReport = new TrainingReport(); + trainingReport.setFlowId(flowId); + trainingReport.setId(IdUtil.simpleUUID()); + trainingReport.setSchoolId(schoolId); + trainingReport.setUploadtime(new Date()); + trainingReport.setStep(Constant.TZBG); + trainingReport.setVersion(text); //新增保存功能,使用版本字段,没有再添加字段 + trainingReportMapper.insert(trainingReport); + return new ResultEntity<>(HttpStatus.OK,"保存成功!"); + }else { + TrainingReport trainingReport = trainingReports.get(0); + if (trainingReport.getExperience()!=null){ + return new ResultEntity<>(HttpStatus.BAD_REQUEST,"提交过不允许再保存!"); + } + trainingReport.setVersion(text); + trainingReportMapper.updateByPrimaryKeyWithBLOBs(trainingReport); + return new ResultEntity<>(HttpStatus.OK,"保存成功!"); + } + } } 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 29fdfcd..9dab20d 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 @@ -149,10 +149,10 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService if (profitDistribution.getUserAvailableFunds() == null) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请输入可用资金!"); } - ProfitDistributionExample example =new ProfitDistributionExample(); + ProfitDistributionExample example = new ProfitDistributionExample(); example.createCriteria().andFlowIdEqualTo(profitDistribution.getFlowId()); List profitDistributions = profitDistributionMapper.selectByExample(example); - if (!profitDistributions.isEmpty()){ + if (!profitDistributions.isEmpty()) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请勿重复提交!"); } //校验优先级LP和自有资金 @@ -295,16 +295,24 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService residualIncome = residualIncome.subtract(subordinatedLp); //剩余收益 // 2.剩余收益分配比例为,自有资金25%,优先级LP 30%,劣后级LP 45% BigDecimal twoRightOwnFunds = residualIncome.multiply(BigDecimal.valueOf(0.25)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金 - BigDecimal twoRightFundraisingAmount = residualIncome.multiply(BigDecimal.valueOf(0.35)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金 + BigDecimal twoRightFundraisingAmount = residualIncome.multiply(BigDecimal.valueOf(0.3)).setScale(2, RoundingMode.HALF_UP);//剩余优先级 BigDecimal twoRightSubordinatedLp = residualIncome.subtract(twoRightOwnFunds).subtract(twoRightFundraisingAmount); //剩余劣后级LP profitDistribution.setRemainingOwnFunds(twoRightOwnFunds); profitDistribution.setRemainingEarningsPreferredLp(twoRightFundraisingAmount); profitDistribution.setRemainingEarningsSubordinatedLp(twoRightSubordinatedLp); profitDistributionMapper.insert(profitDistribution); - if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 && - twoRightOwnFunds.compareTo(userRemainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0 && - userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 && userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) { - performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); + if (rightOwnFunds != null && userRoundOwnFunds != null && + userRoundPreferredLp != null && + userRoundSubordinatedLp != null && subordinatedLp != null && + userRemainingEarningsSubordinatedLp != null) { + if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && + rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 && + twoRightOwnFunds.compareTo(userRemainingOwnFunds) == 0 && + twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0 && + userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 && + userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) { + performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); + } } PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId); performanceScore.setProfitDistributionTime(new Date()); @@ -469,7 +477,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService residualIncome = residualIncome.subtract(subordinatedLp).subtract(rightBankLoan); //剩余收益 //2.剩余收益分配比例为,自有资金25%,优先级LP 30%,劣后级LP 45% BigDecimal twoRightOwnFunds = residualIncome.multiply(BigDecimal.valueOf(0.25)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金 - BigDecimal twoRightFundraisingAmount = residualIncome.multiply(BigDecimal.valueOf(0.35)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金 + BigDecimal twoRightFundraisingAmount = residualIncome.multiply(BigDecimal.valueOf(0.3)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金 BigDecimal twoRightSubordinatedLp = residualIncome.subtract(twoRightOwnFunds).subtract(twoRightFundraisingAmount); //剩余劣后级LP profitDistribution.setRemainingOwnFunds(twoRightOwnFunds); profitDistribution.setRemainingEarningsPreferredLp(twoRightFundraisingAmount); @@ -498,7 +506,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService ProfitDistributionExample profitDistributionExample = new ProfitDistributionExample(); profitDistributionExample.createCriteria().andFlowIdEqualTo(flowId); List profitDistributions = profitDistributionMapper.selectByExample(profitDistributionExample); - if (profitDistributions.isEmpty()){ + if (profitDistributions.isEmpty()) { return null; } return profitDistributions.get(0); diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitManagementServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitManagementServiceImpl.java index 1cec2b9..b180981 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitManagementServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitManagementServiceImpl.java @@ -104,7 +104,7 @@ public class ProfitManagementServiceImpl implements ProfitManagementService { @Override public ResultEntity getExitTimeRightMarketValueAndFundEarnings(String flowId, String exitTime, BigDecimal price, BigDecimal userMarketValue, BigDecimal userFundEarnings) { - ExitTime exitTimeEntity =new ExitTime(); + ExitTime exitTimeEntity = new ExitTime(); List profitManagementList = getLineChart(flowId); if (profitManagementList.isEmpty()) { return null; @@ -134,14 +134,10 @@ public class ProfitManagementServiceImpl implements ProfitManagementService { PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId); performanceScore.setProfitManagementTime(new Date()); performanceScoreMapper.updateByPrimaryKey(performanceScore); - if (!(userMarketValue.compareTo(marketValue) == 0)) { - return new ResultEntity<>(HttpStatus.BAD_REQUEST, "市值计算错误!", marketValue); - } else { + if (userMarketValue.compareTo(marketValue) == 0) { performanceScoreService.calculateScoreByModule("profitManagementFundExitScore", 3, flowId); } - if (!(userFundEarnings.compareTo(fundEarnings) == 0)) { - return new ResultEntity<>(HttpStatus.BAD_REQUEST, "收益计算错误!", fundEarnings); - } else { + if (userFundEarnings.compareTo(fundEarnings) == 0) { performanceScoreService.calculateScoreByModule("profitManagementMarketValueExitScore", 3, flowId); } return null;