修改收益管理,新增基金募资金额字段

master
xiaoCJ 1 year ago
parent dcdc378c4b
commit 9169429ce8

@ -59,7 +59,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
private InquiryParticipationMapper inquiryParticipationMapper; private InquiryParticipationMapper inquiryParticipationMapper;
@Autowired @Autowired
private IssuanceParameterInputMapper issuanceParameterInputMapper; private IssuanceParameterInputMapper issuanceParameterInputMapper;
@Autowired @Autowired
private PerformanceScoreMapper performanceScoreMapper; private PerformanceScoreMapper performanceScoreMapper;
@ -71,7 +71,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
* *
*/ */
@Override @Override
public ResultEntity<String> uploadDueDiligenceReport(List<MultipartFile> files , ReportUploadDto reportNameType) { public ResultEntity<String> uploadDueDiligenceReport(List<MultipartFile> files, ReportUploadDto reportNameType) {
int count = 0; int count = 0;
for (MultipartFile file : files) { for (MultipartFile file : files) {
@ -91,8 +91,8 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
//一个两个做判断 //一个两个做判断
if ("尽调报告".equals(reportNameType.getReportNameType())){ if ("尽调报告".equals(reportNameType.getReportNameType())) {
if (trainingReports.size() > 0 ) { if (trainingReports.size() > 0) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "不允许重复提交!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "不允许重复提交!");
} else { //只允许提交一次 } else { //只允许提交一次
TrainingReport trainingReport = new TrainingReport(); TrainingReport trainingReport = new TrainingReport();
@ -106,16 +106,16 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
trainingReport.setStep(reportNameType.getReportNameType()); trainingReport.setStep(reportNameType.getReportNameType());
trainingReportMapper.insert(trainingReport); trainingReportMapper.insert(trainingReport);
//每个2分共4分 //每个2分共4分
if ("尽调报告".equals(reportNameType.getReportNameType())){ if ("尽调报告".equals(reportNameType.getReportNameType())) {
//investmentSigningDiligenceReportScore //investmentSigningDiligenceReportScore
performanceScoreService.calculateScoreByModule("investmentSigningDiligenceReportScore", 2, reportNameType.getFlowId()); performanceScoreService.calculateScoreByModule("investmentSigningDiligenceReportScore", 2, reportNameType.getFlowId());
}
} }
} } else if ("估值报告".equals(reportNameType.getReportNameType())) {
}else if ("估值报告".equals(reportNameType.getReportNameType())){ if (trainingReports.size() >= 2) {
if (trainingReports.size() >= 2 ) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "不允许重复提交!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "不允许重复提交!");
}else { } else {
TrainingReport trainingReport = new TrainingReport(); TrainingReport trainingReport = new TrainingReport();
trainingReport.setId(IdUtil.fastSimpleUUID()); trainingReport.setId(IdUtil.fastSimpleUUID());
trainingReport.setFlowId(reportNameType.getFlowId()); trainingReport.setFlowId(reportNameType.getFlowId());
@ -127,8 +127,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
trainingReport.setStep(reportNameType.getReportNameType()); trainingReport.setStep(reportNameType.getReportNameType());
trainingReportMapper.insert(trainingReport); trainingReportMapper.insert(trainingReport);
count++; count++;
if (count == 1) if (count == 1) {
{
performanceScoreService.calculateScoreByModule("investmentSigningVlauationReportScore", 2, reportNameType.getFlowId()); performanceScoreService.calculateScoreByModule("investmentSigningVlauationReportScore", 2, reportNameType.getFlowId());
} }
} }
@ -175,12 +174,12 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
ProjectPool projectPool = projectPools.get(0); ProjectPool projectPool = projectPools.get(0);
//项目估值 //项目估值
latestValuation = Double.valueOf(projectPool.getLatestValuation()); latestValuation = Double.valueOf(projectPool.getLatestValuation());
//获取公司名 //获取公司名
companyName = projectPool.getCompanyName(); companyName = projectPool.getCompanyName();
} }
//公司名 //公司名
investmentAgreementDto.setCorporateName(companyName+"有限公司"); investmentAgreementDto.setCorporateName(companyName + "有限公司");
//法定代表人 //法定代表人
investmentAgreementDto.setLegalRepresentativePartA(list.get(0).getLegalPerson()); investmentAgreementDto.setLegalRepresentativePartA(list.get(0).getLegalPerson());
//注册地址 //注册地址
@ -211,7 +210,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
investmentAgreementDto.setIncreaseCapitalShare(profitManagement.getInvestmentAmount().toString()); investmentAgreementDto.setIncreaseCapitalShare(profitManagement.getInvestmentAmount().toString());
long v = profitManagement.getInvestmentAmount().longValue(); long v = profitManagement.getInvestmentAmount().longValue();
Long aLong = Convert.toLong(latestValuation); Long aLong = Convert.toLong(latestValuation);
Long sum = aLong+v; Long sum = aLong + v;
//增资后公司总股本 //增资后公司总股本
investmentAgreementDto.setTotalShareCapital(String.valueOf(sum)); investmentAgreementDto.setTotalShareCapital(String.valueOf(sum));
@ -230,7 +229,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
//hutool工具转换金额 //hutool工具转换金额
String s = Convert.digitToChinese(aDouble); String s = Convert.digitToChinese(aDouble);
//第三条注册资本大写金额 //第三条注册资本大写金额
investmentAgreementDto.setRegisteredCapitalAmount(s+"人民币"); investmentAgreementDto.setRegisteredCapitalAmount(s + "人民币");
//投资金额 //投资金额
BigDecimal investmentAmount = profitManagement.getInvestmentAmount(); BigDecimal investmentAmount = profitManagement.getInvestmentAmount();
@ -240,8 +239,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
Long aLong1 = Convert.toLong(registeredCapital); Long aLong1 = Convert.toLong(registeredCapital);
//注册资本加上投资金额 //注册资本加上投资金额
long sumMoney = aLong1+ aDouble1; long sumMoney = aLong1 + aDouble1;
//第三条注册资本增加至 //第三条注册资本增加至
@ -252,7 +250,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
String s2 = Convert.digitToChinese(sumMoney); String s2 = Convert.digitToChinese(sumMoney);
//第三条注册资本增加至大写金额 //第三条注册资本增加至大写金额
investmentAgreementDto.setRegisteredCapitalIncreaseAmount(s2+"人民币"); investmentAgreementDto.setRegisteredCapitalIncreaseAmount(s2 + "人民币");
//第三条增资股份等于投资金额 //第三条增资股份等于投资金额
investmentAgreementDto.setCapitalIncreaseShares(String.valueOf(investmentAmount)); investmentAgreementDto.setCapitalIncreaseShares(String.valueOf(investmentAmount));
@ -279,7 +277,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
investmentAgreementDto.setSigningAddress(businessInfoList.get(0).getRegisteredAddress()); investmentAgreementDto.setSigningAddress(businessInfoList.get(0).getRegisteredAddress());
return investmentAgreementDto; return investmentAgreementDto;
} }
@ -289,6 +287,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
/** /**
* *
*
* @return * @return
*/ */
@Override @Override
@ -302,18 +301,16 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
issuanceInfoExample.createCriteria().andFlowIdEqualTo(issuanceInfo.getFlowId()); issuanceInfoExample.createCriteria().andFlowIdEqualTo(issuanceInfo.getFlowId());
List<IssuanceInfo> issuanceInfos = issuanceInfoMapper.selectByExample(issuanceInfoExample); List<IssuanceInfo> issuanceInfos = issuanceInfoMapper.selectByExample(issuanceInfoExample);
//查询有无第一次录入的数据 //查询有无第一次录入的数据
if (issuanceInfos.size()>0) if (issuanceInfos.size() > 0) {
{
//获取上一次录入的数据和这一次录入的做对比 //获取上一次录入的数据和这一次录入的做对比
String s = compareFields(issuanceInfo,issuanceInfos.get(0)); String s = compareFields(issuanceInfo, issuanceInfos.get(0));
if (!s.isEmpty()) if (!s.isEmpty()) {
{
issuanceInfoMapper.deleteByExample(issuanceInfoExample); issuanceInfoMapper.deleteByExample(issuanceInfoExample);
return new ResultEntity<>(HttpStatus.OK,s,"两次输入的"+s+":"+"值不同!"); return new ResultEntity<>(HttpStatus.OK, s, "两次输入的" + s + ":" + "值不同!");
} }
//完成新建发行申请3分 //完成新建发行申请3分
performanceScoreService.calculateScoreByModule("newPricingIssuanceScore", 3, issuanceInfo.getFlowId()); performanceScoreService.calculateScoreByModule("newPricingIssuanceScore", 3, issuanceInfo.getFlowId());
return new ResultEntity<>(HttpStatus.OK,s,"添加成功"); return new ResultEntity<>(HttpStatus.OK, s, "添加成功");
} }
@ -342,25 +339,25 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
long info = l * 100000; long info = l * 100000;
//判断估值和4亿比较 //判断估值和4亿比较
//估值小于4亿的发行总量大于等于估值的25%估值大于4亿的发行总量大于估值的10% //估值小于4亿的发行总量大于等于估值的25%估值大于4亿的发行总量大于估值的10%
if(aLong > max){ if (aLong > max) {
if (info/aLong >0.1) { if (info / aLong > 0.1) {
issuanceInfo.setId(IdUtil.fastSimpleUUID()); issuanceInfo.setId(IdUtil.fastSimpleUUID());
//插入数据 //插入数据
issuanceInfoMapper.insert(issuanceInfo); issuanceInfoMapper.insert(issuanceInfo);
return new ResultEntity(HttpStatus.OK); return new ResultEntity(HttpStatus.OK);
}else { } else {
return new ResultEntity(HttpStatus.BAD_REQUEST, "发行总量小于估值的10%"); return new ResultEntity(HttpStatus.BAD_REQUEST, "发行总量小于估值的10%");
} }
}else if (aLong < max){ } else if (aLong < max) {
if (info/aLong >0.25) { if (info / aLong > 0.25) {
issuanceInfo.setId(IdUtil.fastSimpleUUID()); issuanceInfo.setId(IdUtil.fastSimpleUUID());
//插入数据 //插入数据
issuanceInfoMapper.insert(issuanceInfo); issuanceInfoMapper.insert(issuanceInfo);
return new ResultEntity(HttpStatus.OK); return new ResultEntity(HttpStatus.OK);
}else { } else {
return new ResultEntity(HttpStatus.BAD_REQUEST, "发行总量小于估值的25%"); return new ResultEntity(HttpStatus.BAD_REQUEST, "发行总量小于估值的25%");
} }
} }
@ -373,7 +370,8 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
} }
/** /**
* *
*
* @param flowId * @param flowId
* @return * @return
*/ */
@ -433,14 +431,12 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
issuanceParameterInputExample.createCriteria().andFlowIdEqualTo(issuanceParameterInput.getFlowId()); issuanceParameterInputExample.createCriteria().andFlowIdEqualTo(issuanceParameterInput.getFlowId());
List<IssuanceParameterInput> issuanceParameterInputList = issuanceParameterInputMapper.selectByExample(issuanceParameterInputExample); List<IssuanceParameterInput> issuanceParameterInputList = issuanceParameterInputMapper.selectByExample(issuanceParameterInputExample);
//查询有无第一次录入的数据 //查询有无第一次录入的数据
if (issuanceParameterInputList.size()>0) if (issuanceParameterInputList.size() > 0) {
{
//获取上一次录入的数据和这一次录入的做对比 //获取上一次录入的数据和这一次录入的做对比
String s = compareFieldsTwo(issuanceParameterInput,issuanceParameterInputList.get(0)); String s = compareFieldsTwo(issuanceParameterInput, issuanceParameterInputList.get(0));
if (!s.isEmpty()) if (!s.isEmpty()) {
{
issuanceParameterInputMapper.deleteByExample(issuanceParameterInputExample); issuanceParameterInputMapper.deleteByExample(issuanceParameterInputExample);
return new ResultEntity<>(HttpStatus.OK,s,"两次输入的"+s+":"+"值不同!"); return new ResultEntity<>(HttpStatus.OK, s, "两次输入的" + s + ":" + "值不同!");
} }
//询价结果查询及发行参数录入2分 //询价结果查询及发行参数录入2分
performanceScoreService.calculateScoreByModule("pricingIssuanceEnteringScore", 2, issuanceParameterInput.getFlowId()); performanceScoreService.calculateScoreByModule("pricingIssuanceEnteringScore", 2, issuanceParameterInput.getFlowId());
@ -450,7 +446,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
performanceScore.setPricingIssuanceTime(new Date()); performanceScore.setPricingIssuanceTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore); performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity<>(HttpStatus.OK,s,"添加成功"); return new ResultEntity<>(HttpStatus.OK, s, "添加成功");
} }
//第一次录入和估值做计算 //第一次录入和估值做计算
else { else {
@ -465,6 +461,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
/** /**
* *
*
* @param flowId * @param flowId
* @return * @return
*/ */
@ -485,7 +482,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
// 比较两个Student对象的字段返回不相同的字段 // 比较两个Student对象的字段返回不相同的字段
public String compareFieldsTwo(IssuanceParameterInput newInfo ,IssuanceParameterInput other) { public String compareFieldsTwo(IssuanceParameterInput newInfo, IssuanceParameterInput other) {
IssuanceParameterInputExample issuanceParameterInputExample = new IssuanceParameterInputExample(); IssuanceParameterInputExample issuanceParameterInputExample = new IssuanceParameterInputExample();
issuanceParameterInputExample.createCriteria().andFlowIdEqualTo(newInfo.getFlowId()); issuanceParameterInputExample.createCriteria().andFlowIdEqualTo(newInfo.getFlowId());
List<IssuanceParameterInput> issuanceParameterInputList = issuanceParameterInputMapper.selectByExample(issuanceParameterInputExample); List<IssuanceParameterInput> issuanceParameterInputList = issuanceParameterInputMapper.selectByExample(issuanceParameterInputExample);
@ -530,8 +527,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
if (!formattedThisValue.equals(formattedOtherValue)) { if (!formattedThisValue.equals(formattedOtherValue)) {
differences.append(field.getName()).append(": ").append(formattedThisValue).append(" -> ").append(formattedOtherValue).append("/n"); differences.append(field.getName()).append(": ").append(formattedThisValue).append(" -> ").append(formattedOtherValue).append("/n");
} }
} } else {
else {
// 对于非浮点数,直接使用 equals 进行比较 // 对于非浮点数,直接使用 equals 进行比较
if ((thisValue == null && otherValue != null) || (thisValue != null && !thisValue.equals(otherValue))) { if ((thisValue == null && otherValue != null) || (thisValue != null && !thisValue.equals(otherValue))) {
differences.append(field.getName()).append(": ").append(thisValue).append(" -> ").append(otherValue).append("/n"); differences.append(field.getName()).append(": ").append(thisValue).append(" -> ").append(otherValue).append("/n");
@ -547,10 +543,8 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
} }
// 比较两个Student对象的字段返回不相同的字段 // 比较两个Student对象的字段返回不相同的字段
public String compareFields(IssuanceInfo newInfo ,IssuanceInfo other) { public String compareFields(IssuanceInfo newInfo, IssuanceInfo other) {
IssuanceInfoExample issuanceInfoExample = new IssuanceInfoExample(); IssuanceInfoExample issuanceInfoExample = new IssuanceInfoExample();
issuanceInfoExample.createCriteria().andFlowIdEqualTo(other.getFlowId()); issuanceInfoExample.createCriteria().andFlowIdEqualTo(other.getFlowId());
List<IssuanceInfo> issuanceInfos = issuanceInfoMapper.selectByExample(issuanceInfoExample); List<IssuanceInfo> issuanceInfos = issuanceInfoMapper.selectByExample(issuanceInfoExample);
@ -594,8 +588,7 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
if (!formattedThisValue.equals(formattedOtherValue)) { if (!formattedThisValue.equals(formattedOtherValue)) {
differences.append(field.getName()).append(": ").append(formattedThisValue).append(" -> ").append(formattedOtherValue).append("/n"); differences.append(field.getName()).append(": ").append(formattedThisValue).append(" -> ").append(formattedOtherValue).append("/n");
} }
} } else {
else {
// 对于非浮点数,直接使用 equals 进行比较 // 对于非浮点数,直接使用 equals 进行比较
if ((thisValue == null && otherValue != null) || (thisValue != null && !thisValue.equals(otherValue))) { if ((thisValue == null && otherValue != null) || (thisValue != null && !thisValue.equals(otherValue))) {
differences.append(field.getName()).append(": ").append(thisValue).append(" -> ").append(otherValue).append("/n"); differences.append(field.getName()).append(": ").append(thisValue).append(" -> ").append(otherValue).append("/n");
@ -611,19 +604,13 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
} }
public List<TrainingReport> getTrainingReports(String flowId, String reportName) {
TrainingReportExample trainingReportExample = new TrainingReportExample();
trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(reportName);
return trainingReportMapper.selectByExample(trainingReportExample);
}
}
public List<TrainingReport> getTrainingReports (String flowId, String reportName){
TrainingReportExample trainingReportExample = new TrainingReportExample();
trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(reportName);
return trainingReportMapper.selectByExample(trainingReportExample);
}
}

@ -92,7 +92,7 @@ public class InvestmentReportServiceImpl implements InvestmentReportService {
@Override @Override
public List<TrainingReport> getTrainingReports(String flowId) { public List<TrainingReport> getTrainingReports(String flowId) {
TrainingReportExample trainingReportExample = new TrainingReportExample(); TrainingReportExample trainingReportExample = new TrainingReportExample();
trainingReportExample.createCriteria().andFlowIdEqualTo(flowId); trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(Constant.TZBG);
return trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample); return trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
} }

@ -179,8 +179,8 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
BigDecimal userRemainingEarningsPreferredLp = profitDistribution.getRemainingEarningsPreferredLp();//用户/第二轮优先级LP BigDecimal userRemainingEarningsPreferredLp = profitDistribution.getRemainingEarningsPreferredLp();//用户/第二轮优先级LP
BigDecimal rightOwnFunds = fundraising.getOwnFunds();//正确/第一轮自有资金 BigDecimal rightOwnFunds = fundraising.getOwnFunds();//正确/第一轮自有资金
Integer type = fundraising.getType(); Integer type = fundraising.getType();
//计算可用资金是否正确 //计算可用资金是否正确 基金募集总金额-投资金额+退出时投资收益
BigDecimal rightAvailableFunds = fundraisingAmount.add(exitFundEarnings).setScale(2, RoundingMode.HALF_UP);//可用资金 BigDecimal rightAvailableFunds = fundraisingAmount.subtract(exitTime.getInvestmentAmount()).add(exitFundEarnings).setScale(2, RoundingMode.HALF_UP);//可用资金
profitDistribution.setAvailableFunds(rightAvailableFunds); //设置可用资金 profitDistribution.setAvailableFunds(rightAvailableFunds); //设置可用资金
if (profitDistribution.getUserAvailableFunds().compareTo(rightAvailableFunds) == 0) { if (profitDistribution.getUserAvailableFunds().compareTo(rightAvailableFunds) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionAvailablefundsScore", 1, flowId); performanceScoreService.calculateScoreByModule("profitDistributionAvailablefundsScore", 1, flowId);

Loading…
Cancel
Save