|
@@ -11,6 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
+import java.net.URLDecoder;
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -51,16 +54,18 @@ public class IntervalScoringTableController {
|
|
|
*/
|
|
|
@PostMapping(value = "/saveOrUpdate")
|
|
|
@ApiOperation(value = "新增(修改)", notes = "新增(修改)")
|
|
|
- public R saveOrUpdate(HttpServletRequest request,@RequestBody IntervalScoringTable intervalScoringTable) {
|
|
|
+ public R saveOrUpdate(@RequestBody IntervalScoringTable intervalScoringTable) {
|
|
|
|
|
|
try {
|
|
|
+ intervalScoringTable.setRange(URLDecoder.decode(intervalScoringTable.getRange(), "UTF-8"));
|
|
|
+ intervalScoringTable.setRegularExpression(URLDecoder.decode(intervalScoringTable.getRegularExpression(),"UTF-8"));
|
|
|
boolean b = intervalScoringTableService.saveOrUpdate(intervalScoringTable);
|
|
|
if (b) {
|
|
|
return R.ok().data(b);
|
|
|
} else {
|
|
|
return R.error().data("操作数据库失败!");
|
|
|
}
|
|
|
- } catch (CustomException e){
|
|
|
+ } catch (CustomException | UnsupportedEncodingException e){
|
|
|
return R.customError(e.getMessage()).data("失败!");
|
|
|
}
|
|
|
}
|