更新BUG

master
yz 1 year ago
parent a0da41015a
commit 84a6cdc1cc

@ -7,6 +7,7 @@ import com.sztzjy.fund_investment.entity.ProjectPool;
import com.sztzjy.fund_investment.mapper.FoundProjectMapper;
import com.sztzjy.fund_investment.service.ISysFoundProjectService;
import com.sztzjy.fund_investment.service.ISysProjectPoolService;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
import com.sztzjy.fund_investment.util.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -20,6 +21,7 @@ import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.nio.file.Paths;
@ -36,6 +38,8 @@ public class FoundProjectController {
FoundProjectMapper foundProjectMapper;
@Autowired
ISysFoundProjectService foundProjectService;
@Autowired
PerformanceScoreService scoreService;
@GetMapping("getProjectPoolList")
@ApiOperation("寻找项目数据展示")
@ -50,8 +54,8 @@ public class FoundProjectController {
@GetMapping("getBP")
@ApiOperation("BP按钮")
@AnonymousAccess
public ResponseEntity<FileSystemResource> getFundraising(@ApiParam("bp路径") @RequestParam String bp_path) {
String PDFPath = filePath + bp_path;
public ResponseEntity<FileSystemResource> getFundraising(@ApiParam("企业简称") @RequestParam String companyName, HttpServletResponse response) {
String PDFPath = filePath +"/bpbdf/商业计划书-"+ companyName+".pdf";
File videoFile = new File(PDFPath);
if (videoFile.exists()) {
Paths.get(PDFPath);
@ -82,6 +86,12 @@ public class FoundProjectController {
return new ResultEntity(HttpStatus.BAD_REQUEST,"本次实训已立项过");
}
foundProjectMapper.insert(foundProject);
if(foundProject.getFoundProjectConclusion()!=null){
scoreService.calculateScoreByModule("projectSearchReportScore",2,foundProject.getFlowId());
}else {
scoreService.calculateScoreByModule("projectSearchReportScore",0,foundProject.getFlowId());
}
scoreService.calculateScoreByModule("projectSearchScore",3,foundProject.getFlowId());
return new ResultEntity(HttpStatus.OK,"立项成功");
}
@ -93,6 +103,8 @@ public class FoundProjectController {
FoundProject foundProject=foundProjectService.selectByFlowId(flowId);
foundProject.setFinancialDueDiligence(null);
foundProject.setServiceDueDiligence(null);
foundProject.setProjectValuationRelative(null);
foundProject.setProjectValuationAbsolute(null);
return new ResultEntity(HttpStatus.OK,"立项回显成功",foundProject);
}

@ -1,8 +1,10 @@
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.service.ISysFundraisingService;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
import com.sztzjy.fund_investment.util.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -26,6 +28,8 @@ public class FundraisingController {
ISysFundraisingService fundraisingService;
@Autowired
FundraisingMapper fundraisingMapper;
@Autowired
PerformanceScoreService performanceScoreService;
@GetMapping("getFundraising")
@ApiOperation("资金募资回显")
@ -43,12 +47,74 @@ public class FundraisingController {
@ApiParam("劣后级LP") @RequestParam(required = false) BigDecimal subordinatedLP,
@ApiParam("基金募资金额(为前面四个参数之和)") @RequestParam BigDecimal fundraisingAmount) {
if (ownFunds.add(priorityLP).compareTo(BigDecimal.valueOf(1000000))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败-自有资金与优先级LP之和不小于一百万");
}
if(fundraisingService.selectByFlowId(flowId)!=null){
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败-基金募资已提交");
}
Fundraising fundraising = new Fundraising();
//判断基金募集类型 1:自有资金/优先级LP、2:自有资金/优先级LP/劣后级LP、3:自有资金/优先级LP/银行借款、4:自有资金/优先级LP/劣后级LP/银行借款
if(subordinatedLP!=null){
if(bankLoan!=null){
fundraising.setType(4);
BigDecimal totalFunds = priorityLP.add(ownFunds).add(subordinatedLP).add(bankLoan);
if(ownFunds.divide(totalFunds).compareTo(new BigDecimal("0.05"))>0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型4,自有资金不能超过总资金的5%");
}
if(priorityLP.divide(totalFunds).compareTo(new BigDecimal("0.6"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型4,优先级LP不能低于总资金的60%");
}
if(subordinatedLP.divide(totalFunds).compareTo(new BigDecimal("0.3"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型4,劣后级LP不能低于总资金的30%");
}
if(bankLoan.divide(totalFunds).compareTo(new BigDecimal("0.05"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型4,银行借款不能低于总资金的5%");
}
}else {
BigDecimal totalFunds = priorityLP.add(ownFunds).add(subordinatedLP);
if(ownFunds.divide(totalFunds).compareTo(new BigDecimal("0.1"))>0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型2,自有资金不能超过总资金的10%");
}
if(priorityLP.divide(totalFunds).compareTo(new BigDecimal("0.6"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型2,优先级LP不能低于总资金的60%");
}
if(subordinatedLP.divide(totalFunds).compareTo(new BigDecimal("0.3"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型2,劣后级LP不能低于总资金的30%");
}
fundraising.setType(2);
}
}else {
if(bankLoan!=null){
BigDecimal totalFunds = priorityLP.add(ownFunds).add(bankLoan);
if(ownFunds.divide(totalFunds).compareTo(new BigDecimal("0.1"))>0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型3,自有资金不能超过总资金的10%");
}
if(priorityLP.divide(totalFunds).compareTo(new BigDecimal("0.6"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型3,优先级LP不能低于总资金的60%");
}
if(bankLoan.divide(totalFunds).compareTo(new BigDecimal("0.3"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型3,银行借款不能低于总资金的30%");
}
fundraising.setType(3);
}else {
if(ownFunds.divide(priorityLP.add(ownFunds)).compareTo(new BigDecimal("0.1"))>0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型1,自有资金不能超过总资金的10%");
}
fundraising.setType(1);
}
}
fundraising.setId(String.valueOf(UUID.randomUUID()));
fundraising.setFlowId(flowId);
fundraising.setOwnFunds(ownFunds);
@ -58,6 +124,8 @@ public class FundraisingController {
fundraising.setFundraisingAmount(fundraisingAmount);
Boolean aBoolean = fundraisingService.insertFundraising(fundraising);
if(aBoolean){
//新增成功 增加分数 如果之前分数为零 则不进行加分
performanceScoreService.calculateScoreByModule("fundraisingScore",5,flowId);
return new ResultEntity(HttpStatus.OK,"资金募资新增成功",fundraising);
}else {
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败");

@ -14,6 +14,7 @@ import com.sztzjy.fund_investment.entity.treeSelect.TreeSelect;
import com.sztzjy.fund_investment.mapper.FoundProjectMapper;
import com.sztzjy.fund_investment.mapper.ProjectPoolMapper;
import com.sztzjy.fund_investment.service.ISysProjectDueDiligenceService;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
import com.sztzjy.fund_investment.util.ResultEntity;
import com.sztzjy.fund_investment.util.excel.FilePortUtil;
import com.sztzjy.fund_investment.util.file.IFileUtil;
@ -52,6 +53,8 @@ public class ProjectDueDiligenceController {
HeaderAndFooterEvent headerAndFooterEvent;
@Autowired
private IFileUtil fileUtil;
@Autowired
PerformanceScoreService scoreService;
//*************公司业务尽职调查
@ -188,6 +191,7 @@ public class ProjectDueDiligenceController {
return new ResultEntity(HttpStatus.BAD_REQUEST, "业务尽调结论为空");
}
projectDueDiligenceService.updateServiceDueDiligence(foundProject);
scoreService.calculateScoreByModule("projectDueDiligenceBusinessReportScore",2,foundProject.getFlowId());
return new ResultEntity(HttpStatus.OK, "业务尽调结论保存成功");
}
@ -198,6 +202,8 @@ public class ProjectDueDiligenceController {
FoundProject foundProject = foundProjectMapper.selectByPrimaryKey(flowId);
foundProject.setFinancialDueDiligence(null);
foundProject.setFoundProjectConclusion(null);
foundProject.setProjectValuationAbsolute(null);
foundProject.setProjectValuationRelative(null);
return new ResultEntity(HttpStatus.OK, "业务尽调结论,展示成功", foundProject);
}
@ -232,6 +238,15 @@ public class ProjectDueDiligenceController {
return new ResultEntity(HttpStatus.OK, "财务指标查询成功", pageInfo);
}
@PostMapping("insertProFinancialIndexDetailUserList")
@ApiOperation("财务指标保存")
@AnonymousAccess
public ResultEntity insertProFinancialIndexDetailUserList(@ApiParam("保存的对象") @RequestBody List<ProFinancialIndexDetail> proFinancialIndexDetailList,
@ApiParam("流程ID") @RequestParam String flowId) {
ResultEntity resultEntity = projectDueDiligenceService.insertProFinancialIndexDetailUserList(proFinancialIndexDetailList, flowId);
return resultEntity;
}
@PostMapping("selectProFinancialStatementDetailList")
@ApiOperation("财务报表查询")
@AnonymousAccess
@ -305,6 +320,7 @@ public class ProjectDueDiligenceController {
return new ResultEntity(HttpStatus.BAD_REQUEST, "财务尽调结论为空");
}
projectDueDiligenceService.updateServiceDueDiligence(foundProject);
scoreService.calculateScoreByModule("projectDueDiligenceFinanceReportScore",2,foundProject.getFlowId());
return new ResultEntity(HttpStatus.OK, "财务尽调结论保存成功");
}
@ -315,6 +331,8 @@ public class ProjectDueDiligenceController {
FoundProject foundProject = foundProjectMapper.selectByPrimaryKey(flowId);
foundProject.setServiceDueDiligence(null);
foundProject.setFoundProjectConclusion(null);
foundProject.setProjectValuationAbsolute(null);
foundProject.setProjectValuationRelative(null);
return new ResultEntity(HttpStatus.OK, "财务尽调结论,展示成功", foundProject);
}

@ -1,25 +1,37 @@
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.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import com.sztzjy.fund_investment.annotation.AnonymousAccess;
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.ProjectPoolMapper;
import com.sztzjy.fund_investment.service.*;
import com.sztzjy.fund_investment.util.ResultEntity;
import com.sztzjy.fund_investment.util.excel.FilePortUtil;
import com.sztzjy.fund_investment.util.pdfUtils.HeaderAndFooterEvent;
import io.swagger.annotations.Api;
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 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.List;
import java.util.TreeMap;
//yz
@RestController
@ -36,6 +48,14 @@ public class ProjectValuationController {
ISysEduFCFEService eduFCFEService;
@Autowired
ISysEduDDMService eduDDMService;
@Autowired
FoundProjectMapper foundProjectMapper;
@Autowired
ProjectPoolMapper projectPoolMapper;
@Autowired
PerformanceScoreService scoreService;
@Autowired
ISysProjectDueDiligenceService projectDueDiligenceService;
@GetMapping("getPE")
@ApiOperation("相对估值法-PE市盈率法")
@ -77,8 +97,10 @@ public class ProjectValuationController {
@ApiParam("修改值") @RequestParam BigDecimal valuePerShare) {
Boolean aBoolean = projectValuationService.updatePE(flowId, valuePerShare);
if(aBoolean){
scoreService.calculateScoreByModule2("projectUseValuationRelativeScore",2,flowId);
return new ResultEntity(HttpStatus.OK, "相对估值法-PE市盈率法修改成功");
}
scoreService.calculateScoreByModule2("projectUseValuationRelativeScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST, "您计算的值有误,请检查!(相对估值法-PE市盈率法)");
}
@ -89,8 +111,10 @@ public class ProjectValuationController {
@ApiParam("修改值") @RequestParam BigDecimal valuePerShare) {
Boolean aBoolean = projectValuationService.updatePB(flowId, valuePerShare);
if(aBoolean){
scoreService.calculateScoreByModule2("projectUseValuationRelativeScore",2,flowId);
return new ResultEntity(HttpStatus.OK, "相对估值法-PB市盈率法修改成功");
}
scoreService.calculateScoreByModule2("projectUseValuationRelativeScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST, "您计算的值有误,请检查!(相对估值法-PB市盈率法)");
}
@ -101,11 +125,67 @@ public class ProjectValuationController {
@ApiParam("修改值") @RequestParam BigDecimal valuePerShare) {
Boolean aBoolean = projectValuationService.updatePS(flowId, valuePerShare);
if(aBoolean){
scoreService.calculateScoreByModule2("projectUseValuationRelativeScore",2,flowId);
return new ResultEntity(HttpStatus.OK, "相对估值法-PS市盈率法修改成功");
}
scoreService.calculateScoreByModule2("projectUseValuationRelativeScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST, "您计算的值有误,请检查!(相对估值法-PS市盈率法)");
}
@PostMapping("updateProjectValuationRelative")
@ApiOperation("相对估值结论")
@AnonymousAccess
public ResultEntity updateProjectValuationRelative(@ApiParam("转递flow_id、project_valuation_relative") @RequestBody FoundProject foundProject) {
if (StringUtils.isBlank(foundProject.getFlowId())) {
return new ResultEntity(HttpStatus.BAD_REQUEST, "流程ID为空");
}
if (StringUtils.isBlank(foundProject.getProjectValuationRelative())) {
return new ResultEntity(HttpStatus.BAD_REQUEST, "相对估值结论为空");
}
projectDueDiligenceService.updateServiceDueDiligence(foundProject);
scoreService.calculateScoreByModule("projectValuationRelativeScore",2,foundProject.getFlowId());
return new ResultEntity(HttpStatus.OK, "相对估值结论保存成功");
}
@GetMapping("getProjectValuationRelative")
@ApiOperation("相对估值结论回显")
@AnonymousAccess
public ResultEntity<FoundProject> getProjectValuationRelative(@ApiParam("流程ID") @RequestParam String flowId) {
FoundProject foundProject = foundProjectMapper.selectByPrimaryKey(flowId);
foundProject.setServiceDueDiligence(null);
foundProject.setFoundProjectConclusion(null);
foundProject.setFinancialDueDiligence(null);
foundProject.setProjectValuationAbsolute(null);
return new ResultEntity(HttpStatus.OK, "相对估值结论,展示成功", foundProject);
}
@PostMapping("updateProjectValuationAbsolute")
@ApiOperation("绝对估值结论")
@AnonymousAccess
public ResultEntity updateProjectValuationAbsolute(@ApiParam("转递flow_id、project_valuation_absolute") @RequestBody FoundProject foundProject) {
if (StringUtils.isBlank(foundProject.getFlowId())) {
return new ResultEntity(HttpStatus.BAD_REQUEST, "流程ID为空");
}
if (StringUtils.isBlank(foundProject.getProjectValuationRelative())) {
return new ResultEntity(HttpStatus.BAD_REQUEST, "绝对估值结论为空");
}
projectDueDiligenceService.updateServiceDueDiligence(foundProject);
scoreService.calculateScoreByModule("projectValuationRelativeScore",2,foundProject.getFlowId());
return new ResultEntity(HttpStatus.OK, "绝对估值结论保存成功");
}
@GetMapping("getProjectValuationAbsolute")
@ApiOperation("绝对估值结论回显")
@AnonymousAccess
public ResultEntity<FoundProject> getProjectValuationAbsolute(@ApiParam("流程ID") @RequestParam String flowId) {
FoundProject foundProject = foundProjectMapper.selectByPrimaryKey(flowId);
foundProject.setServiceDueDiligence(null);
foundProject.setFoundProjectConclusion(null);
foundProject.setProjectValuationRelative(null);
foundProject.setFinancialDueDiligence(null);
return new ResultEntity(HttpStatus.OK, "绝对估值结论,展示成功", foundProject);
}
@GetMapping("selectFCFF")
@ApiOperation("绝对估值法-FCFF-查询")
@AnonymousAccess
@ -504,4 +584,5 @@ public class ProjectValuationController {
}
}
}

@ -0,0 +1,111 @@
package com.sztzjy.fund_investment.entity;
import io.swagger.annotations.ApiModelProperty;
import java.util.UUID;
/**
*
* @author xcj
* pro_financial_index_detail_user
*/
public class ProFinancialIndexDetailUser {
@ApiModelProperty("财务指标保存id")
private String id;
@ApiModelProperty("流程id")
private String flowId;
@ApiModelProperty("项目池ID")
private String projectPoolId;
@ApiModelProperty("财务指标选取ID")
private String financialIndexId;
@ApiModelProperty("财务指标选取详情名")
private String name;
@ApiModelProperty("去年数值")
private String lastYearValue;
@ApiModelProperty("前年数值")
private String lastTowYearValue;
@ApiModelProperty("大前年数值")
private String lastThreeYearValue;
public ProFinancialIndexDetailUser(ProFinancialIndexDetail proFinancialIndexDetail,String flowId) {
this.id= String.valueOf(UUID.randomUUID());
this.flowId=flowId;
this.projectPoolId=proFinancialIndexDetail.getProjectPoolId();
this.financialIndexId=proFinancialIndexDetail.getFinancialIndexId();
this.name=proFinancialIndexDetail.getName();
this.lastYearValue=proFinancialIndexDetail.getLastYearValue();
this.lastTowYearValue=proFinancialIndexDetail.getLastTowYearValue();
this.lastThreeYearValue=proFinancialIndexDetail.getLastThreeYearValue();
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getFlowId() {
return flowId;
}
public void setFlowId(String flowId) {
this.flowId = flowId == null ? null : flowId.trim();
}
public String getProjectPoolId() {
return projectPoolId;
}
public void setProjectPoolId(String projectPoolId) {
this.projectPoolId = projectPoolId == null ? null : projectPoolId.trim();
}
public String getFinancialIndexId() {
return financialIndexId;
}
public void setFinancialIndexId(String financialIndexId) {
this.financialIndexId = financialIndexId == null ? null : financialIndexId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getLastYearValue() {
return lastYearValue;
}
public void setLastYearValue(String lastYearValue) {
this.lastYearValue = lastYearValue == null ? null : lastYearValue.trim();
}
public String getLastTowYearValue() {
return lastTowYearValue;
}
public void setLastTowYearValue(String lastTowYearValue) {
this.lastTowYearValue = lastTowYearValue == null ? null : lastTowYearValue.trim();
}
public String getLastThreeYearValue() {
return lastThreeYearValue;
}
public void setLastThreeYearValue(String lastThreeYearValue) {
this.lastThreeYearValue = lastThreeYearValue == null ? null : lastThreeYearValue.trim();
}
}

@ -0,0 +1,759 @@
package com.sztzjy.fund_investment.entity;
import java.util.ArrayList;
import java.util.List;
public class ProFinancialIndexDetailUserExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public ProFinancialIndexDetailUserExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andFlowIdIsNull() {
addCriterion("flow_id is null");
return (Criteria) this;
}
public Criteria andFlowIdIsNotNull() {
addCriterion("flow_id is not null");
return (Criteria) this;
}
public Criteria andFlowIdEqualTo(String value) {
addCriterion("flow_id =", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdNotEqualTo(String value) {
addCriterion("flow_id <>", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdGreaterThan(String value) {
addCriterion("flow_id >", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdGreaterThanOrEqualTo(String value) {
addCriterion("flow_id >=", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdLessThan(String value) {
addCriterion("flow_id <", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdLessThanOrEqualTo(String value) {
addCriterion("flow_id <=", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdLike(String value) {
addCriterion("flow_id like", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdNotLike(String value) {
addCriterion("flow_id not like", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdIn(List<String> values) {
addCriterion("flow_id in", values, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdNotIn(List<String> values) {
addCriterion("flow_id not in", values, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdBetween(String value1, String value2) {
addCriterion("flow_id between", value1, value2, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdNotBetween(String value1, String value2) {
addCriterion("flow_id not between", value1, value2, "flowId");
return (Criteria) this;
}
public Criteria andProjectPoolIdIsNull() {
addCriterion("project_pool_id is null");
return (Criteria) this;
}
public Criteria andProjectPoolIdIsNotNull() {
addCriterion("project_pool_id is not null");
return (Criteria) this;
}
public Criteria andProjectPoolIdEqualTo(String value) {
addCriterion("project_pool_id =", value, "projectPoolId");
return (Criteria) this;
}
public Criteria andProjectPoolIdNotEqualTo(String value) {
addCriterion("project_pool_id <>", value, "projectPoolId");
return (Criteria) this;
}
public Criteria andProjectPoolIdGreaterThan(String value) {
addCriterion("project_pool_id >", value, "projectPoolId");
return (Criteria) this;
}
public Criteria andProjectPoolIdGreaterThanOrEqualTo(String value) {
addCriterion("project_pool_id >=", value, "projectPoolId");
return (Criteria) this;
}
public Criteria andProjectPoolIdLessThan(String value) {
addCriterion("project_pool_id <", value, "projectPoolId");
return (Criteria) this;
}
public Criteria andProjectPoolIdLessThanOrEqualTo(String value) {
addCriterion("project_pool_id <=", value, "projectPoolId");
return (Criteria) this;
}
public Criteria andProjectPoolIdLike(String value) {
addCriterion("project_pool_id like", value, "projectPoolId");
return (Criteria) this;
}
public Criteria andProjectPoolIdNotLike(String value) {
addCriterion("project_pool_id not like", value, "projectPoolId");
return (Criteria) this;
}
public Criteria andProjectPoolIdIn(List<String> values) {
addCriterion("project_pool_id in", values, "projectPoolId");
return (Criteria) this;
}
public Criteria andProjectPoolIdNotIn(List<String> values) {
addCriterion("project_pool_id not in", values, "projectPoolId");
return (Criteria) this;
}
public Criteria andProjectPoolIdBetween(String value1, String value2) {
addCriterion("project_pool_id between", value1, value2, "projectPoolId");
return (Criteria) this;
}
public Criteria andProjectPoolIdNotBetween(String value1, String value2) {
addCriterion("project_pool_id not between", value1, value2, "projectPoolId");
return (Criteria) this;
}
public Criteria andFinancialIndexIdIsNull() {
addCriterion("financial_index_id is null");
return (Criteria) this;
}
public Criteria andFinancialIndexIdIsNotNull() {
addCriterion("financial_index_id is not null");
return (Criteria) this;
}
public Criteria andFinancialIndexIdEqualTo(String value) {
addCriterion("financial_index_id =", value, "financialIndexId");
return (Criteria) this;
}
public Criteria andFinancialIndexIdNotEqualTo(String value) {
addCriterion("financial_index_id <>", value, "financialIndexId");
return (Criteria) this;
}
public Criteria andFinancialIndexIdGreaterThan(String value) {
addCriterion("financial_index_id >", value, "financialIndexId");
return (Criteria) this;
}
public Criteria andFinancialIndexIdGreaterThanOrEqualTo(String value) {
addCriterion("financial_index_id >=", value, "financialIndexId");
return (Criteria) this;
}
public Criteria andFinancialIndexIdLessThan(String value) {
addCriterion("financial_index_id <", value, "financialIndexId");
return (Criteria) this;
}
public Criteria andFinancialIndexIdLessThanOrEqualTo(String value) {
addCriterion("financial_index_id <=", value, "financialIndexId");
return (Criteria) this;
}
public Criteria andFinancialIndexIdLike(String value) {
addCriterion("financial_index_id like", value, "financialIndexId");
return (Criteria) this;
}
public Criteria andFinancialIndexIdNotLike(String value) {
addCriterion("financial_index_id not like", value, "financialIndexId");
return (Criteria) this;
}
public Criteria andFinancialIndexIdIn(List<String> values) {
addCriterion("financial_index_id in", values, "financialIndexId");
return (Criteria) this;
}
public Criteria andFinancialIndexIdNotIn(List<String> values) {
addCriterion("financial_index_id not in", values, "financialIndexId");
return (Criteria) this;
}
public Criteria andFinancialIndexIdBetween(String value1, String value2) {
addCriterion("financial_index_id between", value1, value2, "financialIndexId");
return (Criteria) this;
}
public Criteria andFinancialIndexIdNotBetween(String value1, String value2) {
addCriterion("financial_index_id not between", value1, value2, "financialIndexId");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andLastYearValueIsNull() {
addCriterion("last_year_value is null");
return (Criteria) this;
}
public Criteria andLastYearValueIsNotNull() {
addCriterion("last_year_value is not null");
return (Criteria) this;
}
public Criteria andLastYearValueEqualTo(String value) {
addCriterion("last_year_value =", value, "lastYearValue");
return (Criteria) this;
}
public Criteria andLastYearValueNotEqualTo(String value) {
addCriterion("last_year_value <>", value, "lastYearValue");
return (Criteria) this;
}
public Criteria andLastYearValueGreaterThan(String value) {
addCriterion("last_year_value >", value, "lastYearValue");
return (Criteria) this;
}
public Criteria andLastYearValueGreaterThanOrEqualTo(String value) {
addCriterion("last_year_value >=", value, "lastYearValue");
return (Criteria) this;
}
public Criteria andLastYearValueLessThan(String value) {
addCriterion("last_year_value <", value, "lastYearValue");
return (Criteria) this;
}
public Criteria andLastYearValueLessThanOrEqualTo(String value) {
addCriterion("last_year_value <=", value, "lastYearValue");
return (Criteria) this;
}
public Criteria andLastYearValueLike(String value) {
addCriterion("last_year_value like", value, "lastYearValue");
return (Criteria) this;
}
public Criteria andLastYearValueNotLike(String value) {
addCriterion("last_year_value not like", value, "lastYearValue");
return (Criteria) this;
}
public Criteria andLastYearValueIn(List<String> values) {
addCriterion("last_year_value in", values, "lastYearValue");
return (Criteria) this;
}
public Criteria andLastYearValueNotIn(List<String> values) {
addCriterion("last_year_value not in", values, "lastYearValue");
return (Criteria) this;
}
public Criteria andLastYearValueBetween(String value1, String value2) {
addCriterion("last_year_value between", value1, value2, "lastYearValue");
return (Criteria) this;
}
public Criteria andLastYearValueNotBetween(String value1, String value2) {
addCriterion("last_year_value not between", value1, value2, "lastYearValue");
return (Criteria) this;
}
public Criteria andLastTowYearValueIsNull() {
addCriterion("last_tow_year_value is null");
return (Criteria) this;
}
public Criteria andLastTowYearValueIsNotNull() {
addCriterion("last_tow_year_value is not null");
return (Criteria) this;
}
public Criteria andLastTowYearValueEqualTo(String value) {
addCriterion("last_tow_year_value =", value, "lastTowYearValue");
return (Criteria) this;
}
public Criteria andLastTowYearValueNotEqualTo(String value) {
addCriterion("last_tow_year_value <>", value, "lastTowYearValue");
return (Criteria) this;
}
public Criteria andLastTowYearValueGreaterThan(String value) {
addCriterion("last_tow_year_value >", value, "lastTowYearValue");
return (Criteria) this;
}
public Criteria andLastTowYearValueGreaterThanOrEqualTo(String value) {
addCriterion("last_tow_year_value >=", value, "lastTowYearValue");
return (Criteria) this;
}
public Criteria andLastTowYearValueLessThan(String value) {
addCriterion("last_tow_year_value <", value, "lastTowYearValue");
return (Criteria) this;
}
public Criteria andLastTowYearValueLessThanOrEqualTo(String value) {
addCriterion("last_tow_year_value <=", value, "lastTowYearValue");
return (Criteria) this;
}
public Criteria andLastTowYearValueLike(String value) {
addCriterion("last_tow_year_value like", value, "lastTowYearValue");
return (Criteria) this;
}
public Criteria andLastTowYearValueNotLike(String value) {
addCriterion("last_tow_year_value not like", value, "lastTowYearValue");
return (Criteria) this;
}
public Criteria andLastTowYearValueIn(List<String> values) {
addCriterion("last_tow_year_value in", values, "lastTowYearValue");
return (Criteria) this;
}
public Criteria andLastTowYearValueNotIn(List<String> values) {
addCriterion("last_tow_year_value not in", values, "lastTowYearValue");
return (Criteria) this;
}
public Criteria andLastTowYearValueBetween(String value1, String value2) {
addCriterion("last_tow_year_value between", value1, value2, "lastTowYearValue");
return (Criteria) this;
}
public Criteria andLastTowYearValueNotBetween(String value1, String value2) {
addCriterion("last_tow_year_value not between", value1, value2, "lastTowYearValue");
return (Criteria) this;
}
public Criteria andLastThreeYearValueIsNull() {
addCriterion("last_three_year_value is null");
return (Criteria) this;
}
public Criteria andLastThreeYearValueIsNotNull() {
addCriterion("last_three_year_value is not null");
return (Criteria) this;
}
public Criteria andLastThreeYearValueEqualTo(String value) {
addCriterion("last_three_year_value =", value, "lastThreeYearValue");
return (Criteria) this;
}
public Criteria andLastThreeYearValueNotEqualTo(String value) {
addCriterion("last_three_year_value <>", value, "lastThreeYearValue");
return (Criteria) this;
}
public Criteria andLastThreeYearValueGreaterThan(String value) {
addCriterion("last_three_year_value >", value, "lastThreeYearValue");
return (Criteria) this;
}
public Criteria andLastThreeYearValueGreaterThanOrEqualTo(String value) {
addCriterion("last_three_year_value >=", value, "lastThreeYearValue");
return (Criteria) this;
}
public Criteria andLastThreeYearValueLessThan(String value) {
addCriterion("last_three_year_value <", value, "lastThreeYearValue");
return (Criteria) this;
}
public Criteria andLastThreeYearValueLessThanOrEqualTo(String value) {
addCriterion("last_three_year_value <=", value, "lastThreeYearValue");
return (Criteria) this;
}
public Criteria andLastThreeYearValueLike(String value) {
addCriterion("last_three_year_value like", value, "lastThreeYearValue");
return (Criteria) this;
}
public Criteria andLastThreeYearValueNotLike(String value) {
addCriterion("last_three_year_value not like", value, "lastThreeYearValue");
return (Criteria) this;
}
public Criteria andLastThreeYearValueIn(List<String> values) {
addCriterion("last_three_year_value in", values, "lastThreeYearValue");
return (Criteria) this;
}
public Criteria andLastThreeYearValueNotIn(List<String> values) {
addCriterion("last_three_year_value not in", values, "lastThreeYearValue");
return (Criteria) this;
}
public Criteria andLastThreeYearValueBetween(String value1, String value2) {
addCriterion("last_three_year_value between", value1, value2, "lastThreeYearValue");
return (Criteria) this;
}
public Criteria andLastThreeYearValueNotBetween(String value1, String value2) {
addCriterion("last_three_year_value not between", value1, value2, "lastThreeYearValue");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,32 @@
package com.sztzjy.fund_investment.mapper;
import com.sztzjy.fund_investment.entity.ProFinancialIndexDetailUser;
import com.sztzjy.fund_investment.entity.ProFinancialIndexDetailUserExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface ProFinancialIndexDetailUserMapper {
long countByExample(ProFinancialIndexDetailUserExample example);
int deleteByExample(ProFinancialIndexDetailUserExample example);
int deleteByPrimaryKey(String id);
int insert(ProFinancialIndexDetailUser record);
int insertSelective(ProFinancialIndexDetailUser record);
List<ProFinancialIndexDetailUser> selectByExample(ProFinancialIndexDetailUserExample example);
ProFinancialIndexDetailUser selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") ProFinancialIndexDetailUser record, @Param("example") ProFinancialIndexDetailUserExample example);
int updateByExample(@Param("record") ProFinancialIndexDetailUser record, @Param("example") ProFinancialIndexDetailUserExample example);
int updateByPrimaryKeySelective(ProFinancialIndexDetailUser record);
int updateByPrimaryKey(ProFinancialIndexDetailUser record);
}

@ -3,6 +3,7 @@ package com.sztzjy.fund_investment.service;
import com.github.pagehelper.PageInfo;
import com.sztzjy.fund_investment.entity.*;
import com.sztzjy.fund_investment.entity.treeSelect.TreeSelect;
import com.sztzjy.fund_investment.util.ResultEntity;
import java.math.BigDecimal;
import java.util.List;
@ -49,4 +50,6 @@ public interface ISysProjectDueDiligenceService {
BigDecimal selectDetailByFlowId(String proFinancialStatementId, String flowId);
ProFinancialStatementDetail selectStatementDetailByFlowId(String proFinancialStatementId, String flowId);
ResultEntity insertProFinancialIndexDetailUserList(List<ProFinancialIndexDetail> proFinancialIndexDetailList, String flowId);
}

@ -8,5 +8,6 @@ import com.sztzjy.fund_investment.entity.PerformanceScore;
*/
public interface PerformanceScoreService {
void calculateScoreByModule(String methodName, Integer score, String flowId);
void calculateScoreByModule2(String methodName, Integer score, String flowId);
PerformanceScore getByFlowId(String flowId);
}

@ -27,14 +27,33 @@ public class PerformanceScoreServiceImpl implements PerformanceScoreService {
@Override // 实体类字段名 分数 流程ID
public void calculateScoreByModule(String methodName, Integer score, String flowId) {
PerformanceScore performanceScore = getByFlowId(flowId);
BigDecimal scoreOld =(BigDecimal) performanceScore.get(methodName);
if (scoreOld==null){
Object o = performanceScore.get(methodName);
if (o==null){
performanceScore.set(methodName, BigDecimal.valueOf(score));
performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score)));
performanceScoreMapper.updateByPrimaryKey(performanceScore);
}
}
@Override // 实体类字段名 分数 流程ID
public void calculateScoreByModule2(String methodName, Integer score, String flowId) {
PerformanceScore performanceScore = getByFlowId(flowId);
Object o = performanceScore.get(methodName);
if(o==null){
performanceScore.set(methodName, BigDecimal.valueOf(score));
performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score)));
performanceScoreMapper.updateByPrimaryKey(performanceScore);
}else {
BigDecimal bigDecimal=(BigDecimal) performanceScore.get(methodName);
if(bigDecimal.compareTo(BigDecimal.valueOf(score))<0){
performanceScore.set(methodName, BigDecimal.valueOf(score));
performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score)).subtract(bigDecimal));
performanceScoreMapper.updateByPrimaryKey(performanceScore);
}
}
}
@Override
public PerformanceScore getByFlowId(String flowId) {
PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();

@ -3,20 +3,25 @@ package com.sztzjy.fund_investment.service.serviceImpl;
import com.sztzjy.fund_investment.entity.EduDDM;
import com.sztzjy.fund_investment.mapper.EduDDMMapper;
import com.sztzjy.fund_investment.service.ISysEduDDMService;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
import com.sztzjy.fund_investment.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@Service
public class SysEduDDMServiceImpl implements ISysEduDDMService {
@Autowired
EduDDMMapper ddmMapper;
@Autowired
PerformanceScoreService scoreService;
@Override
public EduDDM selectDDMByFlowId(String flowId) {
EduDDM eduDDM = ddmMapper.selectByPrimaryKey(flowId);
if(eduDDM==null){
if (eduDDM == null) {
EduDDM eduDDM1 = new EduDDM();
eduDDM1.setFlowId(flowId);
return eduDDM1;
@ -26,8 +31,91 @@ public class SysEduDDMServiceImpl implements ISysEduDDMService {
@Override
public ResultEntity updateDDMByFlowId(String flowId, EduDDM eduDDM) {
int num = 0; //记录错误数量
if (eduDDM.getGlnzzl2021() == null) {
num++;
}
if (eduDDM.getGlnzzl2022() == null) {
num++;
}
if (eduDDM.getGlnzzl2023() == null) {
num++;
}
if(eduDDM.getQwgl2021()==null){
num++;
}
if(eduDDM.getGdbybcl2021()==null){
num++;
}
if(eduDDM.getGdbybcl2022()==null){
num++;
}
if(eduDDM.getGdbybcl2023()==null){
num++;
}
if(num>2){
scoreService.calculateScoreByModule2("projectUseValuationAbsoluteScore",0,flowId);
}else {
if(eduDDM.getGsfxgpdnzjz2021()!=null){
if(eduDDM.getGlnzzl2021()==null || eduDDM.getGdbybcl2021()==null || eduDDM.getQwgl2021()==null){
num++;
}else {
if(eduDDM.getGsfxgpdnzjz2021().setScale(2, BigDecimal.ROUND_HALF_UP).compareTo(eduDDM.getQwgl2021().divide(eduDDM.getGdbybcl2021().subtract(eduDDM.getGlnzzl2021())).setScale(2,BigDecimal.ROUND_HALF_UP))!=0){
num++;
}
}
}else {
num++;
}
if(eduDDM.getGsfxgpdnzjz2022()!=null){
if(eduDDM.getGlnzzl2022()==null || eduDDM.getGdbybcl2022()==null || eduDDM.getQwgl2022()==null){
num++;
}else {
if(eduDDM.getGsfxgpdnzjz2022().setScale(2, BigDecimal.ROUND_HALF_UP).compareTo(eduDDM.getQwgl2022().divide(eduDDM.getGdbybcl2022().subtract(eduDDM.getGlnzzl2022())).setScale(2,BigDecimal.ROUND_HALF_UP))!=0){
num++;
}
}
}else {
num++;
}
if(eduDDM.getGsfxgpdnzjz2023()!=null){
if(eduDDM.getGlnzzl2023()==null || eduDDM.getGdbybcl2023()==null || eduDDM.getQwgl2023()==null){
num++;
}else {
if(eduDDM.getGsfxgpdnzjz2023().setScale(2, BigDecimal.ROUND_HALF_UP).compareTo(eduDDM.getQwgl2023().divide(eduDDM.getGdbybcl2023().subtract(eduDDM.getGlnzzl2023())).setScale(2,BigDecimal.ROUND_HALF_UP))!=0){
num++;
}
}
}else {
num++;
}
if(eduDDM.getQwgl2022()!=null){
if(eduDDM.getQwgl2021()==null || eduDDM.getGlnzzl2022()==null){
num++;
}else {
if(eduDDM.getQwgl2022().setScale(2,BigDecimal.ROUND_HALF_UP).compareTo(eduDDM.getQwgl2021().multiply(BigDecimal.ONE.add(eduDDM.getGlnzzl2022())).setScale(2,BigDecimal.ROUND_HALF_UP))!=0){
num++;
}
}
}else {
num++;
}
if(eduDDM.getQwgl2023()!=null){
if(eduDDM.getQwgl2022()==null || eduDDM.getGlnzzl2023()==null){
num++;
}else {
if(eduDDM.getQwgl2023().setScale(2,BigDecimal.ROUND_HALF_UP).compareTo(eduDDM.getQwgl2022().multiply(BigDecimal.ONE.add(eduDDM.getGlnzzl2023())).setScale(2,BigDecimal.ROUND_HALF_UP))!=0){
num++;
}
}
}else {
num++;
}
}
EduDDM eduDDM1 = ddmMapper.selectByPrimaryKey(flowId);
if(eduDDM1==null){
if (eduDDM1 == null) {
ddmMapper.insert(eduDDM);
return new ResultEntity(HttpStatus.OK, "保存成功");
}

@ -4,6 +4,7 @@ import com.sztzjy.fund_investment.entity.EduFCFE;
import com.sztzjy.fund_investment.mapper.EduFCFEMapper;
import com.sztzjy.fund_investment.service.ISysEduFCFEService;
import com.sztzjy.fund_investment.service.ISysProjectDueDiligenceService;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
import com.sztzjy.fund_investment.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@ -17,6 +18,8 @@ public class SysEduFCFEServiceImpl implements ISysEduFCFEService {
EduFCFEMapper fcfeMapper;
@Autowired
ISysProjectDueDiligenceService projectDueDiligenceService;
@Autowired
PerformanceScoreService scoreService;
@Override
public EduFCFE selectFCFEByFlowId(String flowId) {
@ -39,32 +42,172 @@ public class SysEduFCFEServiceImpl implements ISysEduFCFEService {
//股东权益
BigDecimal gdqy = projectDueDiligenceService.selectDetailByFlowId("134",flowId);
//净利润=利润总额-所得税费用
BigDecimal lrze = projectDueDiligenceService.selectDetailByFlowId("42",flowId);
BigDecimal sdsfy = projectDueDiligenceService.selectDetailByFlowId("43",flowId);
EduFCFE fcfe1 = new EduFCFE();
fcfe1.setFlowId(flowId);
fcfe1.setYysr2020(yysr);
fcfe1.setJfz2020(jyxjrfz.add(ysjrfz).add(dqjk).add(cqjk).add(yfzq).subtract(jyxjrzc).subtract(ysjrzc).subtract(zqtz).subtract(qtzqtz).subtract(qtqygjtz));
fcfe1.setGdqy2020(gdqy);
// fcfe1.setJlr2020();
fcfe1.setJlr2020(lrze.subtract(sdsfy));
return fcfe1;
}else {
return fcfe;
}
}
@Override
public ResultEntity updateFCFFByFlowId(String flowId, EduFCFE eduFCFE) {
// if (eduFCFE.getXszzl2021()!=null){
//
// }
String msg="保存成功";
Integer num=0; //记录错误数量
if(eduFCFE.getXszzl2021()==null || eduFCFE.getXszzl2022()==null || eduFCFE.getXszzl2023()==null){
num=4;
}else {
if(eduFCFE.getYysr2021()!=null){
BigDecimal daan=eduFCFE.getYysr2021().subtract(eduFCFE.getYysr2020().multiply(BigDecimal.ONE.add(eduFCFE.getXszzl2021())));
if (daan.compareTo(BigDecimal.ONE)>0 || daan.compareTo(new BigDecimal(-1))<0){ //回答错误
msg="营业收入计算错误,保存成功";
num++;
}
}else{
num++;
}
if(eduFCFE.getYysr2022()!=null){
BigDecimal daan=eduFCFE.getYysr2022().subtract(eduFCFE.getYysr2020().multiply(BigDecimal.ONE.add(eduFCFE.getXszzl2022())));
if (daan.compareTo(BigDecimal.ONE)>0 || daan.compareTo(new BigDecimal(-1))<0){ //回答错误
msg="营业收入计算错误,保存成功";
num++;
}
}else{
num++;
}
if(eduFCFE.getYysr2023()!=null){
BigDecimal daan=eduFCFE.getYysr2023().subtract(eduFCFE.getYysr2020().multiply(BigDecimal.ONE.add(eduFCFE.getXszzl2023())));
if (daan.compareTo(BigDecimal.ONE)>0 || daan.compareTo(new BigDecimal(-1))<0){ //回答错误
msg="营业收入计算错误,保存成功";
num++;
}
}else{
num++;
}
if(eduFCFE.getJfz2021()!=null){
BigDecimal daan=eduFCFE.getJfz2021().subtract(eduFCFE.getJfz2020().multiply(BigDecimal.ONE.add(eduFCFE.getXszzl2021())));
if (daan.compareTo(BigDecimal.ONE)>0 || daan.compareTo(new BigDecimal(-1))<0){ //回答错误
msg="净负债计算错误,保存成功";
num++;
}
}else{
num++;
}
if(eduFCFE.getJfz2022()!=null){
BigDecimal daan=eduFCFE.getJfz2022().subtract(eduFCFE.getJfz2020().multiply(BigDecimal.ONE.add(eduFCFE.getXszzl2022())));
if (daan.compareTo(BigDecimal.ONE)>0 || daan.compareTo(new BigDecimal(-1))<0){ //回答错误
msg="净负债计算错误,保存成功";
num++;
}
}else{
num++;
}
if(eduFCFE.getJfz2023()!=null){
BigDecimal daan=eduFCFE.getJfz2023().subtract(eduFCFE.getJfz2020().multiply(BigDecimal.ONE.add(eduFCFE.getXszzl2023())));
if (daan.compareTo(BigDecimal.ONE)>0 || daan.compareTo(new BigDecimal(-1))<0){ //回答错误
msg="净负债计算错误,保存成功";
num++;
}
}else{
num++;
}
if(eduFCFE.getGdqy2021()!=null){
BigDecimal daan=eduFCFE.getGdqy2021().subtract(eduFCFE.getGdqy2020().multiply(BigDecimal.ONE.add(eduFCFE.getXszzl2021())));
if (daan.compareTo(BigDecimal.ONE)>0 || daan.compareTo(new BigDecimal(-1))<0){ //回答错误
msg="股东权益计算错误,保存成功";
num++;
}
}else{
num++;
}
if(eduFCFE.getGdqy2022()!=null){
BigDecimal daan=eduFCFE.getGdqy2022().subtract(eduFCFE.getGdqy2020().multiply(BigDecimal.ONE.add(eduFCFE.getXszzl2022())));
if (daan.compareTo(BigDecimal.ONE)>0 || daan.compareTo(new BigDecimal(-1))<0){ //回答错误
msg="股东权益计算错误,保存成功";
num++;
}
}else{
num++;
}
if(eduFCFE.getGdqy2023()!=null){
BigDecimal daan=eduFCFE.getGdqy2023().subtract(eduFCFE.getGdqy2020().multiply(BigDecimal.ONE.add(eduFCFE.getXszzl2023())));
if (daan.compareTo(BigDecimal.ONE)>0 || daan.compareTo(new BigDecimal(-1))<0){ //回答错误
msg="净利润计算错误,保存成功";
num++;
}
}else{
num++;
}
if(eduFCFE.getJlr2022()!=null){
BigDecimal daan=eduFCFE.getJlr2022().subtract(eduFCFE.getJlr2020().multiply(BigDecimal.ONE.add(eduFCFE.getJlr2022())));
if (daan.compareTo(BigDecimal.ONE)>0 || daan.compareTo(new BigDecimal(-1))<0){ //回答错误
msg="净利润计算错误,保存成功";
num++;
}
}else{
num++;
}
if(eduFCFE.getJlr2023()!=null){
BigDecimal daan=eduFCFE.getJlr2023().subtract(eduFCFE.getJlr2020().multiply(BigDecimal.ONE.add(eduFCFE.getJlr2023())));
if (daan.compareTo(BigDecimal.ONE)>0 || daan.compareTo(new BigDecimal(-1))<0){ //回答错误
msg="净利润计算错误,保存成功";
num++;
}
}else{
num++;
}
if(eduFCFE.getGqzbcbre2021()==null){
num++;
}
if(eduFCFE.getGqzbcbre2022()==null){
num++;
}
if(eduFCFE.getGqzbcbre2023()==null){
num++;
}
if(eduFCFE.getGqxjl2021()==null){
num++;
}
if(eduFCFE.getGqxjl2022()==null){
num++;
}
if(eduFCFE.getGqxjl2023()==null){
num++;
}
if(eduFCFE.getGqjz2021()==null){
num++;
}
if(eduFCFE.getGqjz2022()==null){
num++;
}
if(eduFCFE.getGqjz2023()==null){
num++;
}
if(eduFCFE.getGqjz2020()==null){
num++;
}
}
if(num>=4){
scoreService.calculateScoreByModule2("projectUseValuationAbsoluteScore",0,flowId);
}else {
scoreService.calculateScoreByModule2("projectUseValuationAbsoluteScore",4-num,flowId);
}
EduFCFE fcfe = fcfeMapper.selectByPrimaryKey(flowId);
if(fcfe==null){
fcfeMapper.insert(eduFCFE);
return new ResultEntity(HttpStatus.OK, "保存成功");
return new ResultEntity(HttpStatus.OK, msg);
}
fcfeMapper.updateByPrimaryKeySelective(eduFCFE);
return new ResultEntity(HttpStatus.OK, "保存成功");
return new ResultEntity(HttpStatus.OK, msg);
}
}

@ -5,6 +5,7 @@ import com.sztzjy.fund_investment.entity.ProFinancialStatementDetail;
import com.sztzjy.fund_investment.mapper.EduFCFFMapper;
import com.sztzjy.fund_investment.service.ISysEduFCFFService;
import com.sztzjy.fund_investment.service.ISysProjectDueDiligenceService;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
import com.sztzjy.fund_investment.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@ -18,6 +19,8 @@ public class SysEduFCFFServiceImpl implements ISysEduFCFFService {
EduFCFFMapper fcffMapper;
@Autowired
ISysProjectDueDiligenceService projectDueDiligenceService;
@Autowired
PerformanceScoreService scoreService;
//先根据flowid查询FCFF表中是否有数据 有则直接返回 没有则计算出三个数据返回
@Override
@ -69,90 +72,115 @@ public class SysEduFCFFServiceImpl implements ISysEduFCFFService {
//更新FCFF
@Override
public ResultEntity updateFCFFByFlowId(String flowId,EduFCFF eduFCFF) {
ResultEntity resultEntity=null;
EduFCFF fcff = fcffMapper.selectByPrimaryKey(flowId);
if(fcff==null){
fcffMapper.insert(eduFCFF);
}
fcffMapper.updateByPrimaryKeySelective(eduFCFF);
Integer num=0;
if(eduFCFF.getYyxjmll2020()!=null){ //营业现金毛流量
if(eduFCFF.getZjtx2020()!=null){
if(eduFCFF.getShjyjlr2020().add(eduFCFF.getZjtx2020()).compareTo(eduFCFF.getYyxjmll2020())!=0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "营业现金毛流量填写错误");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "营业现金毛流量填写错误");
}
}else {
num++;
return new ResultEntity(HttpStatus.BAD_REQUEST, "折旧摊销填写错误");
}
if(eduFCFF.getYyxjjll2020()!=null){
BigDecimal yyxjjll2020=eduFCFF.getYyxjmll2020().subtract(eduFCFF.getJyyyzbzj2020());
if(eduFCFF.getYyxjjll2020().compareTo(yyxjjll2020)!=0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "营业现金净流量填写错误");
num++;
resultEntity=new ResultEntity(HttpStatus.BAD_REQUEST, "营业现金净流量填写错误");
}
if(eduFCFF.getZbzc2020()!=null && eduFCFF.getQyzyxjl2020()!=null){
if(eduFCFF.getQyzyxjl2020().compareTo(yyxjjll2020.subtract(eduFCFF.getZbzc2020()))!=0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "企业自由现金流填写错误");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "企业自由现金流填写错误");
}
}
}
}
if(eduFCFF.getXszzl2021()!=null){
if(eduFCFF.getXszzl2021().compareTo(BigDecimal.ZERO)<0 || eduFCFF.getXszzl2021().compareTo(BigDecimal.ONE)>0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "销售增长率填写错误");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "销售增长率填写错误");
}
}
if(eduFCFF.getXszzl2022()!=null){
if(eduFCFF.getXszzl2022().compareTo(BigDecimal.ZERO)<0 || eduFCFF.getXszzl2022().compareTo(BigDecimal.ONE)>0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "销售增长率填写错误");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "销售增长率填写错误");
}
}
if(eduFCFF.getXszzl2023()!=null){
if(eduFCFF.getXszzl2023().compareTo(BigDecimal.ZERO)<0 || eduFCFF.getXszzl2023().compareTo(BigDecimal.ONE)>0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "销售增长率填写错误");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "销售增长率填写错误");
}
}
if(eduFCFF.getZwzbbzWd2021()!=null || eduFCFF.getGqzbbzWb2021()!=null){
if(eduFCFF.getZwzbbzWd2021()==null || eduFCFF.getGqzbbzWb2021()==null){
return new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd与股权资本比重We之和为1");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd与股权资本比重We之和为1");
}
if(eduFCFF.getZwzbbzWd2021().compareTo(BigDecimal.ZERO)<0 || eduFCFF.getZwzbbzWd2021().compareTo(BigDecimal.ONE)>0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd填写错误");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd填写错误");
}
if(eduFCFF.getGqzbbzWb2021().compareTo(BigDecimal.ZERO)<0 || eduFCFF.getGqzbbzWb2021().compareTo(BigDecimal.ONE)>0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "股权资本比重We填写错误");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "股权资本比重We填写错误");
}
if(eduFCFF.getZwzbbzWd2021().add(eduFCFF.getGqzbbzWb2021()).compareTo(BigDecimal.ONE)!=0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd与股权资本比重We之和为1");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd与股权资本比重We之和为1");
}
}
if(eduFCFF.getZwzbbzWd2022()!=null || eduFCFF.getGqzbbzWb2022()!=null){
if(eduFCFF.getZwzbbzWd2022()==null || eduFCFF.getGqzbbzWb2022()==null){
return new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd与股权资本比重We之和为1");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd与股权资本比重We之和为1");
}
if(eduFCFF.getZwzbbzWd2022().compareTo(BigDecimal.ZERO)<0 || eduFCFF.getZwzbbzWd2022().compareTo(BigDecimal.ONE)>0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd填写错误");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd填写错误");
}
if(eduFCFF.getGqzbbzWb2022().compareTo(BigDecimal.ZERO)<0 || eduFCFF.getGqzbbzWb2022().compareTo(BigDecimal.ONE)>0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "股权资本比重We填写错误");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "股权资本比重We填写错误");
}
if(eduFCFF.getZwzbbzWd2022().add(eduFCFF.getGqzbbzWb2022()).compareTo(BigDecimal.ONE)!=0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd与股权资本比重We之和为1");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd与股权资本比重We之和为1");
}
}
if(eduFCFF.getZwzbbzWd2023()!=null || eduFCFF.getGqzbbzWb2023()!=null){
if(eduFCFF.getZwzbbzWd2023()==null || eduFCFF.getGqzbbzWb2023()==null){
return new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd与股权资本比重We之和为1");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd与股权资本比重We之和为1");
}
if(eduFCFF.getZwzbbzWd2023().compareTo(BigDecimal.ZERO)<0 || eduFCFF.getZwzbbzWd2023().compareTo(BigDecimal.ONE)>0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd填写错误");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd填写错误");
}
if(eduFCFF.getGqzbbzWb2023().compareTo(BigDecimal.ZERO)<0 || eduFCFF.getGqzbbzWb2023().compareTo(BigDecimal.ONE)>0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "股权资本比重We填写错误");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "股权资本比重We填写错误");
}
if(eduFCFF.getZwzbbzWd2023().add(eduFCFF.getGqzbbzWb2023()).compareTo(BigDecimal.ONE)!=0){
return new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd与股权资本比重We之和为1");
num++;
resultEntity= new ResultEntity(HttpStatus.BAD_REQUEST, "债务资本比重wd与股权资本比重We之和为1");
}
}
EduFCFF fcff = fcffMapper.selectByPrimaryKey(flowId);
if(fcff==null){
fcffMapper.insert(eduFCFF);
return new ResultEntity(HttpStatus.OK, "保存成功");
if(num>=4){
scoreService.calculateScoreByModule2("projectUseValuationAbsoluteScore",0,flowId);
}else {
scoreService.calculateScoreByModule2("projectUseValuationAbsoluteScore",4-num,flowId);
}
fcffMapper.updateByPrimaryKeySelective(eduFCFF);
return new ResultEntity(HttpStatus.OK, "保存成功");
return resultEntity;
}
}

@ -7,13 +7,15 @@ import com.sztzjy.fund_investment.entity.treeSelect.TreeSelect;
import com.sztzjy.fund_investment.mapper.*;
import com.sztzjy.fund_investment.service.ISysFoundProjectService;
import com.sztzjy.fund_investment.service.ISysProjectDueDiligenceService;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
import com.sztzjy.fund_investment.util.ResultEntity;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
@Service
public class SysProjectDueDiligenceServiceImpl implements ISysProjectDueDiligenceService {
@ -57,6 +59,10 @@ public class SysProjectDueDiligenceServiceImpl implements ISysProjectDueDiligenc
ProFinancialIndexDetailMapper proFinancialIndexDetailMapper;
@Autowired
ProFinancialStatementDetailMapper proFinancialStatementDetailMapper;
@Autowired
ProFinancialIndexDetailUserMapper proFinancialIndexDetailUserMapper;
@Autowired
PerformanceScoreService scoreService;
//公司背景-公司信息
//先根据flowId查询项目池ID 根据项目池ID获取对应的数据
@ -209,8 +215,8 @@ public class SysProjectDueDiligenceServiceImpl implements ISysProjectDueDiligenc
//返回财务指标选取树
@Override
public List<TreeSelect> getProFinancialIndexSelectTree() {
List<ProFinancialIndex> financialIndexList=proFinancialIndexMapper.selectAll();
List<TreeSelect> treeSelectList=new ArrayList<>();
List<ProFinancialIndex> financialIndexList = proFinancialIndexMapper.selectAll();
List<TreeSelect> treeSelectList = new ArrayList<>();
for (int i = 0; i < financialIndexList.size(); i++) {
treeSelectList.add(new TreeSelect(financialIndexList.get(i)));
}
@ -221,8 +227,8 @@ public class SysProjectDueDiligenceServiceImpl implements ISysProjectDueDiligenc
//返回财务报表选取树
@Override
public List<TreeSelect> getProFinancialStatementSelectTree() {
List<ProFinancialStatement> financialStatementList=proFinancialStatementMapper.selectAll();
List<TreeSelect> treeSelectList=new ArrayList<>();
List<ProFinancialStatement> financialStatementList = proFinancialStatementMapper.selectAll();
List<TreeSelect> treeSelectList = new ArrayList<>();
for (int i = 0; i < financialStatementList.size(); i++) {
treeSelectList.add(new TreeSelect(financialStatementList.get(i)));
}
@ -233,18 +239,37 @@ public class SysProjectDueDiligenceServiceImpl implements ISysProjectDueDiligenc
//财务指标详情查询
//先根据flowid查询项目池id
@Override
public PageInfo<ProFinancialIndexDetail> selectProFinancialIndexDetailList(List<String> proFinancialIndexIdList,String flowId,Integer size,Integer index) {
public PageInfo<ProFinancialIndexDetail> selectProFinancialIndexDetailList(List<String> proFinancialIndexIdList, String flowId, Integer size, Integer index) {
PageHelper.startPage(index, size);
String projectPoolId = foundProjectService.selectProjectPoolIdByFlowId(flowId);
List<ProFinancialIndexDetail> detailList = proFinancialIndexDetailMapper.selectByProFinancialIndexIdListAndProjectPoolId(proFinancialIndexIdList, projectPoolId);
PageInfo<ProFinancialIndexDetail> pageInfo = new PageInfo<>(detailList);
//查询ProFinancialIndexDetailUser表中 flowid的所有数据
ProFinancialIndexDetailUserExample example = new ProFinancialIndexDetailUserExample();
ProFinancialIndexDetailUserExample.Criteria criteria = example.createCriteria();
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;
}
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());
}
}
}
pageInfo.setList(list);
return pageInfo;
}
@Override
public PageInfo<ProFinancialStatementDetail> selectProFinancialStatementDetailList(List<String> proFinancialStatementIdList, String flowId,Integer size,Integer index) {
public PageInfo<ProFinancialStatementDetail> selectProFinancialStatementDetailList(List<String> proFinancialStatementIdList, String flowId, Integer size, Integer index) {
String projectPoolId = foundProjectService.selectProjectPoolIdByFlowId(flowId);
List<ProFinancialStatementDetail> detailList=proFinancialStatementDetailMapper.selectByproFinancialStatementIdListAndProjectPoolId(proFinancialStatementIdList,projectPoolId);
List<ProFinancialStatementDetail> detailList = proFinancialStatementDetailMapper.selectByproFinancialStatementIdListAndProjectPoolId(proFinancialStatementIdList, projectPoolId);
PageInfo<ProFinancialStatementDetail> pageInfo = new PageInfo<>(detailList);
return pageInfo;
}
@ -257,9 +282,9 @@ public class SysProjectDueDiligenceServiceImpl implements ISysProjectDueDiligenc
ProFinancialStatementDetailExample.Criteria criteria = example.createCriteria();
criteria.andProjectPoolIdEqualTo(projectPoolId).andFinancialStatementIdEqualTo(proFinancialStatementId);
List<ProFinancialStatementDetail> detailList = proFinancialStatementDetailMapper.selectByExample(example);
String returnDecimal="0";
if (detailList.isEmpty()){
return new BigDecimal(returnDecimal);
String returnDecimal = "0";
if (detailList.isEmpty()) {
return new BigDecimal(returnDecimal);
}
returnDecimal = proFinancialStatementDetailMapper.selectByExample(example).get(0).getLastYearValue();
return new BigDecimal(returnDecimal);
@ -275,5 +300,84 @@ public class SysProjectDueDiligenceServiceImpl implements ISysProjectDueDiligenc
return proFinancialStatementDetail;
}
//财务指标保存
@Override
public ResultEntity insertProFinancialIndexDetailUserList(List<ProFinancialIndexDetail> proFinancialIndexDetailList, String flowId) {
String projectPoolId = foundProjectService.selectProjectPoolIdByFlowId(flowId);
ProFinancialIndexDetailExample example = new ProFinancialIndexDetailExample();
ProFinancialIndexDetailExample.Criteria criteria = example.createCriteria();
criteria.andProjectPoolIdEqualTo(projectPoolId);
List<ProFinancialIndexDetail> detailList = proFinancialIndexDetailMapper.selectByExample(example);
Boolean flag = check(proFinancialIndexDetailList, detailList, flowId);
for (int i = 0; i < proFinancialIndexDetailList.size(); i++) {
String financialIndexId = proFinancialIndexDetailList.get(i).getFinancialIndexId();
for (int j = 0; j < detailList.size(); j++) {
if (financialIndexId.equals(detailList.get(j).getFinancialIndexId())) {
detailList.remove(detailList.get(j));
}
}
}
List<ProFinancialIndexDetailUser> detailUserList = new ArrayList<>();
if (!proFinancialIndexDetailList.isEmpty()) {
for (int i = 0; i < proFinancialIndexDetailList.size(); i++) {
ProFinancialIndexDetailUser proFinancialIndexDetailUser = new ProFinancialIndexDetailUser(proFinancialIndexDetailList.get(i), flowId);
detailUserList.add(proFinancialIndexDetailUser);
}
}
if (!detailList.isEmpty()) {
for (int i = 0; i < detailList.size(); i++) {
detailList.get(i).setLastYearValue(String.valueOf(0));
ProFinancialIndexDetailUser proFinancialIndexDetailUser = new ProFinancialIndexDetailUser(detailList.get(i), flowId);
detailUserList.add(proFinancialIndexDetailUser);
}
}
//保存前先删除该流程下的所有数据
ProFinancialIndexDetailUserExample userExample = new ProFinancialIndexDetailUserExample();
ProFinancialIndexDetailUserExample.Criteria userExampleCriteria = userExample.createCriteria();
userExampleCriteria.andFlowIdEqualTo(flowId);
proFinancialIndexDetailUserMapper.deleteByExample(userExample);
for (int i = 0; i < detailUserList.size(); i++) {
proFinancialIndexDetailUserMapper.insert(detailUserList.get(i));
}
if(flag){
return new ResultEntity(HttpStatus.OK,"财务指标保存成功");
}else {
return new ResultEntity(HttpStatus.BAD_REQUEST,"计算有误");
}
}
private Boolean check(List<ProFinancialIndexDetail> proFinancialIndexDetailList, List<ProFinancialIndexDetail> allDetailList, String flowId) {
Boolean flag = true;
Integer num = 0;
Map<String, String> map = new HashMap<>();
for (int i = 0; i < allDetailList.size(); i++) {
ProFinancialIndexDetail detail = allDetailList.get(i);
map.put(detail.getFinancialIndexId(), detail.getLastYearValue());
}
for (int i = 0; i < proFinancialIndexDetailList.size(); i++) {
ProFinancialIndexDetail proFinancialIndexDetail = proFinancialIndexDetailList.get(i);
String financialIndexId = proFinancialIndexDetail.getFinancialIndexId();
String lastYearValue = proFinancialIndexDetail.getLastYearValue();
String trueLastYearValue = map.get(financialIndexId);
BigDecimal inValue = new BigDecimal(lastYearValue);
BigDecimal trueValue = new BigDecimal(trueLastYearValue);
if (inValue.subtract(trueValue).compareTo(BigDecimal.valueOf(0.01)) > 0 || inValue.subtract(trueValue).compareTo(BigDecimal.valueOf(-0.01)) < 0) {
flag = false;
} else {
num++;
}
}
if (num - 17 > 0) {
scoreService.calculateScoreByModule("projectValuationEstimationRiskScore", num - 17, flowId);
return flag;
} else {
scoreService.calculateScoreByModule("projectValuationEstimationRiskScore", 0, flowId);
return flag;
}
}
}

@ -0,0 +1,259 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.fund_investment.mapper.ProFinancialIndexDetailUserMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.ProFinancialIndexDetailUser">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="flow_id" jdbcType="VARCHAR" property="flowId" />
<result column="project_pool_id" jdbcType="VARCHAR" property="projectPoolId" />
<result column="financial_index_id" jdbcType="VARCHAR" property="financialIndexId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="last_year_value" jdbcType="VARCHAR" property="lastYearValue" />
<result column="last_tow_year_value" jdbcType="VARCHAR" property="lastTowYearValue" />
<result column="last_three_year_value" jdbcType="VARCHAR" property="lastThreeYearValue" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, flow_id, project_pool_id, financial_index_id, name, last_year_value, last_tow_year_value,
last_three_year_value
</sql>
<select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.ProFinancialIndexDetailUserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from pro_financial_index_detail_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from pro_financial_index_detail_user
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from pro_financial_index_detail_user
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.ProFinancialIndexDetailUserExample">
delete from pro_financial_index_detail_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.fund_investment.entity.ProFinancialIndexDetailUser">
insert into pro_financial_index_detail_user (id, flow_id, project_pool_id,
financial_index_id, name, last_year_value,
last_tow_year_value, last_three_year_value)
values (#{id,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR}, #{projectPoolId,jdbcType=VARCHAR},
#{financialIndexId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{lastYearValue,jdbcType=VARCHAR},
#{lastTowYearValue,jdbcType=VARCHAR}, #{lastThreeYearValue,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.ProFinancialIndexDetailUser">
insert into pro_financial_index_detail_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="flowId != null">
flow_id,
</if>
<if test="projectPoolId != null">
project_pool_id,
</if>
<if test="financialIndexId != null">
financial_index_id,
</if>
<if test="name != null">
name,
</if>
<if test="lastYearValue != null">
last_year_value,
</if>
<if test="lastTowYearValue != null">
last_tow_year_value,
</if>
<if test="lastThreeYearValue != null">
last_three_year_value,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="flowId != null">
#{flowId,jdbcType=VARCHAR},
</if>
<if test="projectPoolId != null">
#{projectPoolId,jdbcType=VARCHAR},
</if>
<if test="financialIndexId != null">
#{financialIndexId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="lastYearValue != null">
#{lastYearValue,jdbcType=VARCHAR},
</if>
<if test="lastTowYearValue != null">
#{lastTowYearValue,jdbcType=VARCHAR},
</if>
<if test="lastThreeYearValue != null">
#{lastThreeYearValue,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.ProFinancialIndexDetailUserExample" resultType="java.lang.Long">
select count(*) from pro_financial_index_detail_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update pro_financial_index_detail_user
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.flowId != null">
flow_id = #{record.flowId,jdbcType=VARCHAR},
</if>
<if test="record.projectPoolId != null">
project_pool_id = #{record.projectPoolId,jdbcType=VARCHAR},
</if>
<if test="record.financialIndexId != null">
financial_index_id = #{record.financialIndexId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.lastYearValue != null">
last_year_value = #{record.lastYearValue,jdbcType=VARCHAR},
</if>
<if test="record.lastTowYearValue != null">
last_tow_year_value = #{record.lastTowYearValue,jdbcType=VARCHAR},
</if>
<if test="record.lastThreeYearValue != null">
last_three_year_value = #{record.lastThreeYearValue,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update pro_financial_index_detail_user
set id = #{record.id,jdbcType=VARCHAR},
flow_id = #{record.flowId,jdbcType=VARCHAR},
project_pool_id = #{record.projectPoolId,jdbcType=VARCHAR},
financial_index_id = #{record.financialIndexId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
last_year_value = #{record.lastYearValue,jdbcType=VARCHAR},
last_tow_year_value = #{record.lastTowYearValue,jdbcType=VARCHAR},
last_three_year_value = #{record.lastThreeYearValue,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.fund_investment.entity.ProFinancialIndexDetailUser">
update pro_financial_index_detail_user
<set>
<if test="flowId != null">
flow_id = #{flowId,jdbcType=VARCHAR},
</if>
<if test="projectPoolId != null">
project_pool_id = #{projectPoolId,jdbcType=VARCHAR},
</if>
<if test="financialIndexId != null">
financial_index_id = #{financialIndexId,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="lastYearValue != null">
last_year_value = #{lastYearValue,jdbcType=VARCHAR},
</if>
<if test="lastTowYearValue != null">
last_tow_year_value = #{lastTowYearValue,jdbcType=VARCHAR},
</if>
<if test="lastThreeYearValue != null">
last_three_year_value = #{lastThreeYearValue,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.ProFinancialIndexDetailUser">
update pro_financial_index_detail_user
set flow_id = #{flowId,jdbcType=VARCHAR},
project_pool_id = #{projectPoolId,jdbcType=VARCHAR},
financial_index_id = #{financialIndexId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
last_year_value = #{lastYearValue,jdbcType=VARCHAR},
last_tow_year_value = #{lastTowYearValue,jdbcType=VARCHAR},
last_three_year_value = #{lastThreeYearValue,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save