修改项目估值计算逻辑 添加项目完成时间

master
yz 1 year ago
parent af35efab4d
commit 80fea40d01

@ -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,"立项成功");
}

@ -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,"新增基金募资失败");

@ -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, "财务尽调结论保存成功");
}

@ -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, "绝对估值结论保存成功");
}

@ -45,6 +45,9 @@ public class ProFinancialIndexDetailUser {
this.lastThreeYearValue=proFinancialIndexDetail.getLastThreeYearValue();
}
public ProFinancialIndexDetailUser() {
}
public String getId() {
return id;
}

@ -251,17 +251,20 @@ public class SysProjectDueDiligenceServiceImpl implements ISysProjectDueDiligenc
criteria.andFlowIdEqualTo(flowId);
List<ProFinancialIndexDetailUser> indexDetailUsers = proFinancialIndexDetailUserMapper.selectByExample(example);
List<ProFinancialIndexDetail> 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");
}
}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))) {
if (list.get(j).getFinancialIndexId().equals(indexDetailUsers.get(i).getFinancialIndexId())) {
list.get(j).setLastYearValue(indexDetailUsers.get(i).getLastYearValue());
}
}
}
}
pageInfo.setList(list);
return pageInfo;
}

@ -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);

Loading…
Cancel
Save