@@ -39,6 +39,7 @@ public enum ResultCode {
LABOR_ID_EMPTY(60017, "人工id为空"),
PART_STOCK_ERROR(60018, "备件库存不足"),
REPAIR_SN_EXITS(60019, "设备正在维修,请勿重复报修。"),
+ MATH_TO_MAX(60020, "请输入正确金额"),
@@ -21,6 +21,9 @@ public class GlobalExceptionHandler {
@ResponseBody
@ExceptionHandler(value = Exception.class)
public ResultData exceptionHandler(Exception e) throws Exception {
+ if(e.getCause().getMessage().contains("Data truncation: Out of range value")){
+ return ResultData.error( ResultCode.MATH_TO_MAX);
+ }
log.error("服务错误:", e);
return ResultData.error( 500, e.getCause().getMessage());
}