|
|
@@ -57,6 +57,7 @@ public class EvaluationController extends BaseApiController {
|
|
|
ValueEvaluation ve = new ValueEvaluation();
|
|
|
ve.setUid(TokenManager.getUserId());
|
|
|
ve.setStep(0);
|
|
|
+ ve.setValue(0l);
|
|
|
ve.setLog("{}");
|
|
|
valueEvaluationService.insert(ve);
|
|
|
return new Result(ve.getId().toString());
|
|
|
@@ -94,14 +95,7 @@ public class EvaluationController extends BaseApiController {
|
|
|
if (handleBindingError(res, bindingResult)) {
|
|
|
return res;
|
|
|
}
|
|
|
- ValueEvaluation ve = valueEvaluationService.getEvaluation(Long.valueOf(id));
|
|
|
- Assert.notNull(ve, ErrorConstants.EVALUATE_ID);
|
|
|
- ve.setName(data.getName());
|
|
|
- ve.setStep(1);
|
|
|
- JSONObject jo = JSON.parseObject(ve.getLog());
|
|
|
- jo.put("0", data);
|
|
|
- ve.setLog(jo.toJSONString());
|
|
|
- res.data(valueEvaluationService.update(ve));
|
|
|
+ updateSteps(data, 1, "0", res, id);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -191,7 +185,7 @@ 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);
|
|
|
@@ -202,7 +196,7 @@ public class EvaluationController extends BaseApiController {
|
|
|
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);
|
|
|
@@ -218,6 +212,10 @@ public class EvaluationController extends BaseApiController {
|
|
|
ValueEvaluation ve = valueEvaluationService.getEvaluation(Long.valueOf(id));
|
|
|
Assert.notNull(ve, ErrorConstants.EVALUATE_ID);
|
|
|
ve.setStep(Math.max(nextStep, ve.getStep()));
|
|
|
+ if (nextStep == 1) {
|
|
|
+ ve.setName(((Step1) step).getName());
|
|
|
+ }
|
|
|
+ ve.setValue(0l);
|
|
|
JSONObject jo = JSON.parseObject(ve.getLog());
|
|
|
jo.put(key, step);
|
|
|
ve.setLog(jo.toJSONString());
|