|
|
@@ -1,29 +1,5 @@
|
|
|
package com.goafanti.evaluation.controller;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.math.MathContext;
|
|
|
-import java.math.RoundingMode;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-import java.util.stream.Stream;
|
|
|
-
|
|
|
-import javax.validation.Valid;
|
|
|
-
|
|
|
-import com.goafanti.common.utils.HttpUtils;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.slf4j.Logger;
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.util.Assert;
|
|
|
-import org.springframework.validation.BindingResult;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
@@ -34,25 +10,40 @@ import com.goafanti.common.model.IndustryCategory;
|
|
|
import com.goafanti.common.model.ValueEvaluation;
|
|
|
import com.goafanti.common.service.DistrictGlossoryService;
|
|
|
import com.goafanti.common.service.IndustryCategoryService;
|
|
|
+import com.goafanti.common.utils.HttpUtils;
|
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
-import com.goafanti.evaluation.bo.ForecastIncome;
|
|
|
-import com.goafanti.evaluation.bo.Step1;
|
|
|
-import com.goafanti.evaluation.bo.Step2;
|
|
|
-import com.goafanti.evaluation.bo.Step3;
|
|
|
-import com.goafanti.evaluation.bo.Step4;
|
|
|
-import com.goafanti.evaluation.bo.Step5;
|
|
|
-import com.goafanti.evaluation.bo.Step6;
|
|
|
-import com.goafanti.evaluation.bo.Step7;
|
|
|
-import com.goafanti.evaluation.bo.YearIncome;
|
|
|
+import com.goafanti.evaluation.bo.*;
|
|
|
import com.goafanti.evaluation.enums.ProfitRate;
|
|
|
import com.goafanti.evaluation.service.ValueEvaluationService;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.util.Assert;
|
|
|
+import org.springframework.validation.BindingResult;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.MathContext;
|
|
|
+import java.math.RoundingMode;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/api/user/evaluate")
|
|
|
public class UserEvaluationApiController extends BaseApiController {
|
|
|
|
|
|
- private static final String GOVERNMENT_LOAN_ROR = "government_loan_ror"; //政府贷款利率
|
|
|
+// private static final String GOVERNMENT_LOAN_ROR = "government_loan_ror"; //政府贷款利率
|
|
|
+ private static final String GOVERNMENT_LOAN_ROR = "4.6"; //政府贷款利率
|
|
|
private static final Logger logger = LoggerFactory.getLogger(UserEvaluationApiController.class);
|
|
|
private static final MathContext DEFAULT_PRECISION = new MathContext(4, RoundingMode.HALF_UP); //默认精度
|
|
|
|
|
|
@@ -348,9 +339,9 @@ public class UserEvaluationApiController extends BaseApiController {
|
|
|
|
|
|
BigDecimal profitRate = calcProfitRate(profitScores, step1.getIndustry(), result);
|
|
|
|
|
|
- /*BigDecimal governmentLoanRoR = new BigDecimal(sysDictService.getValue(GOVERNMENT_LOAN_ROR),
|
|
|
- MathContext.DECIMAL32);*/
|
|
|
- BigDecimal governmentLoanRoR = new BigDecimal(0);
|
|
|
+ BigDecimal governmentLoanRoR = new BigDecimal(GOVERNMENT_LOAN_ROR,
|
|
|
+ MathContext.DECIMAL32);
|
|
|
+// BigDecimal governmentLoanRoR = new BigDecimal(0);
|
|
|
BigDecimal taxRate = new BigDecimal(step6.getTaxRate());
|
|
|
|
|
|
BigDecimal discountRate = calcDiscountRate(discountRates, taxRate, governmentLoanRoR);
|
|
|
@@ -404,6 +395,8 @@ public class UserEvaluationApiController extends BaseApiController {
|
|
|
return discountRate;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
private Map<String, Integer> getDiscountRates(Step7 step7) {
|
|
|
Map<String, Integer> profitScores = new HashMap<>();
|
|
|
profitScores.put("capital", getDiscountScore(step7.getCapital()));// 资金风险
|
|
|
@@ -631,13 +624,5 @@ public class UserEvaluationApiController extends BaseApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/getLPR", method = RequestMethod.GET)
|
|
|
- public Result getLPR(){
|
|
|
- Result res =new Result();
|
|
|
- StringBuffer str=new StringBuffer("https://www.chinamoney.com.cn/ags/ms/cm-u-bk-currency/LprChrtCSV?startDate=2022-01-01");
|
|
|
- JSONObject json =HttpUtils.httpGet(str.toString());
|
|
|
- System.out.println(json.toJSONString());
|
|
|
- res.data(json.toJSONString());
|
|
|
- return res;
|
|
|
- }
|
|
|
+
|
|
|
}
|