From 80fea40d01296005c6e391bafb40d8d83dce121d Mon Sep 17 00:00:00 2001 From: yz <3614508250@qq.com> Date: Mon, 18 Dec 2023 16:30:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE=E4=BC=B0?= =?UTF-8?q?=E5=80=BC=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=A1=B9=E7=9B=AE=E5=AE=8C=E6=88=90=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FoundProjectController.java | 8 ++++++++ .../controller/FundraisingController.java | 7 +++++++ .../ProjectDueDiligenceController.java | 6 ++++++ .../controller/ProjectValuationController.java | 12 ++++++++---- .../entity/ProFinancialIndexDetailUser.java | 3 +++ .../SysProjectDueDiligenceServiceImpl.java | 17 ++++++++++------- .../SysProjectValuationServiceImpl.java | 2 +- 7 files changed, 43 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/controller/FoundProjectController.java b/src/main/java/com/sztzjy/fund_investment/controller/FoundProjectController.java index e9d47d8..abf21fc 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/FoundProjectController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/FoundProjectController.java @@ -3,8 +3,10 @@ package com.sztzjy.fund_investment.controller; import com.github.pagehelper.PageInfo; import com.sztzjy.fund_investment.annotation.AnonymousAccess; import com.sztzjy.fund_investment.entity.FoundProject; +import com.sztzjy.fund_investment.entity.PerformanceScore; import com.sztzjy.fund_investment.entity.ProjectPool; import com.sztzjy.fund_investment.mapper.FoundProjectMapper; +import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper; import com.sztzjy.fund_investment.service.ISysFoundProjectService; import com.sztzjy.fund_investment.service.ISysProjectPoolService; import com.sztzjy.fund_investment.service.PerformanceScoreService; @@ -24,6 +26,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.File; import java.nio.file.Paths; +import java.util.Date; //yz @RestController @@ -40,6 +43,8 @@ public class FoundProjectController { ISysFoundProjectService foundProjectService; @Autowired PerformanceScoreService scoreService; + @Autowired + PerformanceScoreMapper performanceScoreMapper; @GetMapping("getProjectPoolList") @ApiOperation("寻找项目数据展示") @@ -92,6 +97,9 @@ public class FoundProjectController { scoreService.calculateScoreByModule("projectSearchReportScore",0,foundProject.getFlowId()); } scoreService.calculateScoreByModule("projectSearchScore",3,foundProject.getFlowId()); + PerformanceScore performanceScore = scoreService.getByFlowId(foundProject.getFlowId()); + performanceScore.setProjectSearchTime(new Date()); + performanceScoreMapper.updateByPrimaryKey(performanceScore); return new ResultEntity(HttpStatus.OK,"立项成功"); } diff --git a/src/main/java/com/sztzjy/fund_investment/controller/FundraisingController.java b/src/main/java/com/sztzjy/fund_investment/controller/FundraisingController.java index 2413e4f..1d7abda 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/FundraisingController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/FundraisingController.java @@ -3,6 +3,7 @@ package com.sztzjy.fund_investment.controller; import com.sztzjy.fund_investment.entity.Fundraising; import com.sztzjy.fund_investment.entity.PerformanceScore; import com.sztzjy.fund_investment.mapper.FundraisingMapper; +import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper; import com.sztzjy.fund_investment.service.ISysFundraisingService; import com.sztzjy.fund_investment.service.PerformanceScoreService; import com.sztzjy.fund_investment.util.ResultEntity; @@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.math.BigDecimal; +import java.util.Date; import java.util.UUID; //yz @@ -30,6 +32,8 @@ public class FundraisingController { FundraisingMapper fundraisingMapper; @Autowired PerformanceScoreService performanceScoreService; + @Autowired + PerformanceScoreMapper performanceScoreMapper; @GetMapping("getFundraising") @ApiOperation("资金募资回显") @@ -126,6 +130,9 @@ public class FundraisingController { if(aBoolean){ //新增成功 增加分数 如果之前分数为零 则不进行加分 performanceScoreService.calculateScoreByModule("fundraisingScore",5,flowId); + PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId); + performanceScore.setFundraisingTime(new Date()); + performanceScoreMapper.updateByPrimaryKey(performanceScore); return new ResultEntity(HttpStatus.OK,"资金募资新增成功",fundraising); }else { return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败"); diff --git a/src/main/java/com/sztzjy/fund_investment/controller/ProjectDueDiligenceController.java b/src/main/java/com/sztzjy/fund_investment/controller/ProjectDueDiligenceController.java index bd610bf..8ab0036 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/ProjectDueDiligenceController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/ProjectDueDiligenceController.java @@ -12,6 +12,7 @@ import com.sztzjy.fund_investment.annotation.AnonymousAccess; import com.sztzjy.fund_investment.entity.*; import com.sztzjy.fund_investment.entity.treeSelect.TreeSelect; import com.sztzjy.fund_investment.mapper.FoundProjectMapper; +import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper; import com.sztzjy.fund_investment.mapper.ProjectPoolMapper; import com.sztzjy.fund_investment.service.ISysProjectDueDiligenceService; import com.sztzjy.fund_investment.service.PerformanceScoreService; @@ -55,6 +56,8 @@ public class ProjectDueDiligenceController { private IFileUtil fileUtil; @Autowired PerformanceScoreService scoreService; + @Autowired + PerformanceScoreMapper performanceScoreMapper; //*************公司业务尽职调查 @@ -321,6 +324,9 @@ public class ProjectDueDiligenceController { } projectDueDiligenceService.updateServiceDueDiligence(foundProject); scoreService.calculateScoreByModule("projectDueDiligenceFinanceReportScore",2,foundProject.getFlowId()); + PerformanceScore performanceScore = scoreService.getByFlowId(foundProject.getFlowId()); + performanceScore.setProjectDueDiligenceTime(new Date()); + performanceScoreMapper.updateByPrimaryKey(performanceScore); return new ResultEntity(HttpStatus.OK, "财务尽调结论保存成功"); } 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 d91c28c..8e3582b 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/ProjectValuationController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/ProjectValuationController.java @@ -11,6 +11,7 @@ import com.sztzjy.fund_investment.entity.*; import com.sztzjy.fund_investment.entity.dto.DDMDto; import com.sztzjy.fund_investment.entity.dto.FCFFFCFEDto; import com.sztzjy.fund_investment.mapper.FoundProjectMapper; +import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper; import com.sztzjy.fund_investment.mapper.ProjectPoolMapper; import com.sztzjy.fund_investment.service.*; import com.sztzjy.fund_investment.util.ResultEntity; @@ -28,10 +29,8 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.math.BigDecimal; import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Arrays; +import java.util.*; import java.util.List; -import java.util.TreeMap; //yz @RestController @@ -56,6 +55,8 @@ public class ProjectValuationController { PerformanceScoreService scoreService; @Autowired ISysProjectDueDiligenceService projectDueDiligenceService; + @Autowired + PerformanceScoreMapper performanceScoreMapper; @GetMapping("getPE") @ApiOperation("相对估值法-PE市盈率法") @@ -166,11 +167,14 @@ public class ProjectValuationController { if (StringUtils.isBlank(foundProject.getFlowId())) { return new ResultEntity(HttpStatus.BAD_REQUEST, "流程ID为空"); } - if (StringUtils.isBlank(foundProject.getProjectValuationRelative())) { + if (StringUtils.isBlank(foundProject.getProjectValuationAbsolute())) { return new ResultEntity(HttpStatus.BAD_REQUEST, "绝对估值结论为空"); } projectDueDiligenceService.updateServiceDueDiligence(foundProject); scoreService.calculateScoreByModule("projectValuationRelativeScore",2,foundProject.getFlowId()); + PerformanceScore performanceScore = scoreService.getByFlowId(foundProject.getFlowId()); + performanceScore.setProjectValuationTime(new Date()); + performanceScoreMapper.updateByPrimaryKey(performanceScore); return new ResultEntity(HttpStatus.OK, "绝对估值结论保存成功"); } diff --git a/src/main/java/com/sztzjy/fund_investment/entity/ProFinancialIndexDetailUser.java b/src/main/java/com/sztzjy/fund_investment/entity/ProFinancialIndexDetailUser.java index cc4944c..d6e6f28 100644 --- a/src/main/java/com/sztzjy/fund_investment/entity/ProFinancialIndexDetailUser.java +++ b/src/main/java/com/sztzjy/fund_investment/entity/ProFinancialIndexDetailUser.java @@ -45,6 +45,9 @@ public class ProFinancialIndexDetailUser { this.lastThreeYearValue=proFinancialIndexDetail.getLastThreeYearValue(); } + public ProFinancialIndexDetailUser() { + } + public String getId() { return id; } diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectDueDiligenceServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectDueDiligenceServiceImpl.java index 45e0e7c..55dd679 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectDueDiligenceServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectDueDiligenceServiceImpl.java @@ -251,14 +251,17 @@ public class SysProjectDueDiligenceServiceImpl implements ISysProjectDueDiligenc criteria.andFlowIdEqualTo(flowId); List indexDetailUsers = proFinancialIndexDetailUserMapper.selectByExample(example); List list = pageInfo.getList(); - for (int j = 0; j < list.size(); j++) { - list.get(j).setLastYearValue("0"); - if (indexDetailUsers.isEmpty()) { - continue; + + if(indexDetailUsers.isEmpty()){ + for (int i = 0; i < list.size(); i++) { + list.get(i).setLastYearValue("0"); } - for (int i = 0; i < indexDetailUsers.size(); i++) { - if (list.get(j).getFinancialIndexId().equals(indexDetailUsers.get(i))) { - list.get(j).setLastYearValue(indexDetailUsers.get(i).getLastYearValue()); + }else { + for (int j = 0; j < list.size(); j++) { + for (int i = 0; i < indexDetailUsers.size(); i++) { + if (list.get(j).getFinancialIndexId().equals(indexDetailUsers.get(i).getFinancialIndexId())) { + list.get(j).setLastYearValue(indexDetailUsers.get(i).getLastYearValue()); + } } } } diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectValuationServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectValuationServiceImpl.java index 4286549..67084a3 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectValuationServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectValuationServiceImpl.java @@ -132,7 +132,7 @@ public class SysProjectValuationServiceImpl implements ISysProjectValuationServi BigDecimal marketPrice = valuation.getMarketPrice(); //对比公司 每股市价 BigDecimal netWorth = valuation.getNetWorth();//对比公司 每股净资产 BigDecimal netInterest = valuation.getNetInterest();//对比公司 权益净利率 - flag = flag.add(marketPrice.divide(netWorth).divide(netInterest)); + flag = flag.add(marketPrice.divide(netWorth,2,BigDecimal.ROUND_HALF_UP).divide(netInterest,2,BigDecimal.ROUND_HALF_UP)); } BigDecimal avg = flag.divide(BigDecimal.valueOf(3)); //平均数 BigDecimal answer = avg.multiply(netWorth1).multiply(netInterest1).setScale(2,BigDecimal.ROUND_HALF_UP);