|
|
@@ -29,10 +29,14 @@ import com.goafanti.common.model.ValueEvaluation;
|
|
|
import com.goafanti.common.service.IndustryCategoryService;
|
|
|
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.service.ValueEvaluationService;
|
|
|
|
|
|
@@ -147,6 +151,29 @@ public class EvaluationController extends BaseApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping(value = "/step5", method = RequestMethod.POST)
|
|
|
+ public Result step5(String id, String type, String forecastIncomes) {
|
|
|
+ Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
|
|
|
+ Result res = new Result();
|
|
|
+ Step5 step = new Step5();
|
|
|
+ try {
|
|
|
+ step.setType(Integer.valueOf(type));
|
|
|
+ List<ForecastIncome> ja = JSON.parseArray(forecastIncomes, ForecastIncome.class);
|
|
|
+ if (ja.size() != 3) {
|
|
|
+ res.error(buildError(ErrorConstants.EVALUATE_PARAM));
|
|
|
+ } else {
|
|
|
+ step.setForecastIncomes(ja);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ res.error(buildError(ErrorConstants.EVALUATE_PARAM));
|
|
|
+ }
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ updateSteps(step, 5, "4", res, id);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
@RequestMapping(value = "/step5/{id}", method = RequestMethod.GET)
|
|
|
public Result step5Info(@PathVariable String id) {
|
|
|
Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
|
|
|
@@ -164,6 +191,28 @@ public class EvaluationController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping(value = "/step6", method = RequestMethod.POST)
|
|
|
+ public Result step6(String id, @Valid Step6 data, BindingResult bindingResult) {
|
|
|
+ Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
|
|
|
+ Result res = new Result();
|
|
|
+ if (handleBindingError(res, bindingResult)) {
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ updateSteps(data, 6, "5", res, id);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "/step7", method = RequestMethod.POST)
|
|
|
+ public Result step7(String id, @Valid Step7 data, BindingResult bindingResult) {
|
|
|
+ Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
|
|
|
+ Result res = new Result();
|
|
|
+ if (handleBindingError(res, bindingResult)) {
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ updateSteps(data, 7, "6", res, id);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
|
|
|
private void updateSteps(Object step, Integer nextStep, String key, Result res, String id) {
|
|
|
ValueEvaluation ve = valueEvaluationService.getEvaluation(Long.valueOf(id));
|