兼容不规范的时间格式iso8601格式;升级fastjson版本
This commit is contained in:
@@ -24,6 +24,7 @@ import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -98,14 +99,7 @@ public class AlarmController {
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
if (startTime != null) {
|
||||
DateUtil.format.parse(startTime);
|
||||
}
|
||||
if (endTime != null) {
|
||||
DateUtil.format.parse(endTime);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
if (!DateUtil.verification(startTime, DateUtil.formatter) || !DateUtil.verification(endTime, DateUtil.formatter)){
|
||||
return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
@@ -144,11 +138,7 @@ public class AlarmController {
|
||||
if (StringUtils.isEmpty(time)) {
|
||||
time = null;
|
||||
}
|
||||
try {
|
||||
if (time != null) {
|
||||
DateUtil.format.parse(time);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
if (!DateUtil.verification(time, DateUtil.formatter) ){
|
||||
return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
List<String> deviceIdList = null;
|
||||
@@ -189,7 +179,7 @@ public class AlarmController {
|
||||
deviceAlarm.setAlarmDescription("test");
|
||||
deviceAlarm.setAlarmMethod("1");
|
||||
deviceAlarm.setAlarmPriority("1");
|
||||
deviceAlarm.setAlarmTime(DateUtil.formatISO8601.format(System.currentTimeMillis()));
|
||||
deviceAlarm.setAlarmTime(DateUtil.formatterISO8601.format(LocalDateTime.now()));
|
||||
deviceAlarm.setAlarmType("1");
|
||||
deviceAlarm.setLongitude(115.33333);
|
||||
deviceAlarm.setLatitude(39.33333);
|
||||
|
||||
@@ -72,7 +72,7 @@ public class GBRecordController {
|
||||
if (!DateUtil.verification(startTime, DateUtil.formatter)){
|
||||
WVPResult<RecordInfo> wvpResult = new WVPResult<>();
|
||||
wvpResult.setCode(-1);
|
||||
wvpResult.setMsg("startTime error, format is " + DateUtil.yyyy_MM_dd_HH_mm_ss);
|
||||
wvpResult.setMsg("startTime error, format is " + DateUtil.PATTERN);
|
||||
|
||||
ResponseEntity<WVPResult<RecordInfo>> resultResponseEntity = new ResponseEntity<>(wvpResult, HttpStatus.OK);
|
||||
result.setResult(resultResponseEntity);
|
||||
@@ -81,7 +81,7 @@ public class GBRecordController {
|
||||
if (!DateUtil.verification(endTime, DateUtil.formatter)){
|
||||
WVPResult<RecordInfo> wvpResult = new WVPResult<>();
|
||||
wvpResult.setCode(-1);
|
||||
wvpResult.setMsg("endTime error, format is " + DateUtil.yyyy_MM_dd_HH_mm_ss);
|
||||
wvpResult.setMsg("endTime error, format is " + DateUtil.PATTERN);
|
||||
ResponseEntity<WVPResult<RecordInfo>> resultResponseEntity = new ResponseEntity<>(wvpResult, HttpStatus.OK);
|
||||
result.setResult(resultResponseEntity);
|
||||
return result;
|
||||
|
||||
@@ -76,14 +76,7 @@ public class LogController {
|
||||
logger.warn("自动记录日志功能已关闭,查询结果可能不完整。");
|
||||
}
|
||||
|
||||
try {
|
||||
if (startTime != null) {
|
||||
DateUtil.format.parse(startTime);
|
||||
}
|
||||
if (endTime != null) {
|
||||
DateUtil.format.parse(endTime);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
if (!DateUtil.verification(startTime, DateUtil.formatter) || !DateUtil.verification(endTime, DateUtil.formatter)){
|
||||
return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user