|
@@ -325,25 +325,28 @@ public class UserEvaluationApiController extends BaseApiController {
|
|
|
result.put("industry", industryCategoryService.list(0).stream().filter(it -> {
|
|
result.put("industry", industryCategoryService.list(0).stream().filter(it -> {
|
|
|
return it.getId().equals(step1.getIndustry());
|
|
return it.getId().equals(step1.getIndustry());
|
|
|
}).findFirst().get().getName());
|
|
}).findFirst().get().getName());
|
|
|
-
|
|
|
|
|
|
|
+ //获得行业分类平均值 -10.43
|
|
|
BigDecimal industryAverageRate = getIndustryCategoryValue(step1, subs);
|
|
BigDecimal industryAverageRate = getIndustryCategoryValue(step1, subs);
|
|
|
|
|
+ //获取用户预测收入
|
|
|
List<Long> userForecast = step5.getForecastIncomes().stream().map(fc -> {
|
|
List<Long> userForecast = step5.getForecastIncomes().stream().map(fc -> {
|
|
|
return fc.getIncome();
|
|
return fc.getIncome();
|
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
|
|
|
+ //使用行业平均值+预测收入+剩余年份做计算
|
|
|
List<Long> sysForecast = calcSysForecast(userForecast, industryAverageRate, timeLeft);
|
|
List<Long> sysForecast = calcSysForecast(userForecast, industryAverageRate, timeLeft);
|
|
|
calcUserForecast(userForecast, timeLeft);
|
|
calcUserForecast(userForecast, timeLeft);
|
|
|
List<Long> measuredForecast = calcMeasuredForecast(userForecast, sysForecast);
|
|
List<Long> measuredForecast = calcMeasuredForecast(userForecast, sysForecast);
|
|
|
|
|
|
|
|
Map<String, Integer> profitScores = getProfitScores(step2, step3);
|
|
Map<String, Integer> profitScores = getProfitScores(step2, step3);
|
|
|
|
|
+ //用户预测+系统预测 >>位移获得值
|
|
|
Map<String, Integer> discountRates = getDiscountRates(step7);
|
|
Map<String, Integer> discountRates = getDiscountRates(step7);
|
|
|
-
|
|
|
|
|
|
|
+ //利润率
|
|
|
BigDecimal profitRate = calcProfitRate(profitScores, step1.getIndustry(), result);
|
|
BigDecimal profitRate = calcProfitRate(profitScores, step1.getIndustry(), result);
|
|
|
|
|
|
|
|
BigDecimal governmentLoanRoR = new BigDecimal(GOVERNMENT_LOAN_ROR,
|
|
BigDecimal governmentLoanRoR = new BigDecimal(GOVERNMENT_LOAN_ROR,
|
|
|
MathContext.DECIMAL32);
|
|
MathContext.DECIMAL32);
|
|
|
// BigDecimal governmentLoanRoR = new BigDecimal(0);
|
|
// BigDecimal governmentLoanRoR = new BigDecimal(0);
|
|
|
BigDecimal taxRate = new BigDecimal(step6.getTaxRate());
|
|
BigDecimal taxRate = new BigDecimal(step6.getTaxRate());
|
|
|
-
|
|
|
|
|
|
|
+ //折扣率
|
|
|
BigDecimal discountRate = calcDiscountRate(discountRates, taxRate, governmentLoanRoR);
|
|
BigDecimal discountRate = calcDiscountRate(discountRates, taxRate, governmentLoanRoR);
|
|
|
result.put("userForecast", userForecast);
|
|
result.put("userForecast", userForecast);
|
|
|
result.put("sysForecast", sysForecast);
|
|
result.put("sysForecast", sysForecast);
|
|
@@ -361,6 +364,14 @@ public class UserEvaluationApiController extends BaseApiController {
|
|
|
return value;
|
|
return value;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param measuredForecast 测量预测
|
|
|
|
|
+ * @param profitRate 利润率
|
|
|
|
|
+ * @param discountRate 折扣率
|
|
|
|
|
+ * @param result
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
private Long calcTotal(List<Long> measuredForecast, BigDecimal profitRate, BigDecimal discountRate,
|
|
private Long calcTotal(List<Long> measuredForecast, BigDecimal profitRate, BigDecimal discountRate,
|
|
|
Map<String, Object> result) {
|
|
Map<String, Object> result) {
|
|
|
List<Long> profitList = new ArrayList<>();
|
|
List<Long> profitList = new ArrayList<>();
|
|
@@ -379,7 +390,7 @@ public class UserEvaluationApiController extends BaseApiController {
|
|
|
index++;
|
|
index++;
|
|
|
}
|
|
}
|
|
|
result.put("profitList", profitList); // 收入分成额
|
|
result.put("profitList", profitList); // 收入分成额
|
|
|
- return total.longValue();
|
|
|
|
|
|
|
+ return Math.abs(total.longValue());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private BigDecimal calcDiscountRate(Map<String, Integer> discountRates, BigDecimal taxRate,
|
|
private BigDecimal calcDiscountRate(Map<String, Integer> discountRates, BigDecimal taxRate,
|
|
@@ -508,6 +519,7 @@ public class UserEvaluationApiController extends BaseApiController {
|
|
|
List<Long> sysForecast = new ArrayList<>();
|
|
List<Long> sysForecast = new ArrayList<>();
|
|
|
BigDecimal lastYear = BigDecimal.ZERO;
|
|
BigDecimal lastYear = BigDecimal.ZERO;
|
|
|
BigDecimal step = new BigDecimal(0.1, DEFAULT_PRECISION);
|
|
BigDecimal step = new BigDecimal(0.1, DEFAULT_PRECISION);
|
|
|
|
|
+ //
|
|
|
industryAverageRate = industryAverageRate.multiply(PERCENTAGE);
|
|
industryAverageRate = industryAverageRate.multiply(PERCENTAGE);
|
|
|
for (int i = 0; i < timeLeft; i++) {
|
|
for (int i = 0; i < timeLeft; i++) {
|
|
|
if (i == 0) {
|
|
if (i == 0) {
|