Commit fc0f8c0d authored by KeYong's avatar KeYong

修改故障案例更新bug

parent 303beff8
......@@ -46,4 +46,17 @@ public enum EmergencyLevelEum {
return str;
}
public static String getCodeByName(String name) {
String str = "";
if (StringUtils.isNotEmpty(name)) {
for(EmergencyLevelEum eum : EmergencyLevelEum.values()) {
if (name.equalsIgnoreCase(eum.getName())) {
str = eum.getName();
break;
}
}
}
return str;
}
}
......@@ -84,6 +84,7 @@ public class FaultCaseController extends AbstractBaseController {
@PutMapping(value = "/update")
@ApiOperation(httpMethod = "PUT", value = "根据id更新故障案例", notes = "根据id更新故障案例")
public ResponseModel<FaultCase> updateByIdWlFaultCase(@RequestBody FaultCase model) {
model.setFaultLevel(StringUtil.isNotEmpty(model.getFaultLevel()) ? EmergencyLevelEum.getCodeByName(model.getFaultLevel()) : "");
faultCaseService.updateById(model);
return ResponseHelper.buildResponse(model);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment