| | |
| | | import com.genersoft.iot.vmp.service.IDeviceAlarmService; |
| | | import com.genersoft.iot.vmp.service.IGbStreamService; |
| | | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| | | import com.genersoft.iot.vmp.utils.DateUtil; |
| | | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "报警信息管理") |
| | |
| | | |
| | | @Autowired |
| | | private IVideoManagerStorage storage; |
| | | |
| | | private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | private SimpleDateFormat formatForGB = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); |
| | | |
| | | /** |
| | | * 分页查询报警 |
| | |
| | | @RequestParam(required = false) String startTime, |
| | | @RequestParam(required = false) String endTime |
| | | ) { |
| | | if (StringUtils.isEmpty(alarmPriority)) alarmPriority = null; |
| | | if (StringUtils.isEmpty(alarmMethod)) alarmMethod = null; |
| | | if (StringUtils.isEmpty(alarmType)) alarmType = null; |
| | | if (StringUtils.isEmpty(startTime)) startTime = null; |
| | | if (StringUtils.isEmpty(endTime)) endTime = null; |
| | | if (StringUtils.isEmpty(alarmPriority)) { |
| | | alarmPriority = null; |
| | | } |
| | | if (StringUtils.isEmpty(alarmMethod)) { |
| | | alarmMethod = null; |
| | | } |
| | | if (StringUtils.isEmpty(alarmType)) { |
| | | alarmType = null; |
| | | } |
| | | if (StringUtils.isEmpty(startTime)) { |
| | | startTime = null; |
| | | } |
| | | if (StringUtils.isEmpty(endTime)) { |
| | | endTime = null; |
| | | } |
| | | |
| | | |
| | | try { |
| | | if (startTime != null) format.parse(startTime); |
| | | if (endTime != null) format.parse(endTime); |
| | | if (startTime != null) { |
| | | DateUtil.format.parse(startTime); |
| | | } |
| | | if (endTime != null) { |
| | | DateUtil.format.parse(endTime); |
| | | } |
| | | } catch (ParseException e) { |
| | | return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST); |
| | | } |
| | |
| | | @RequestParam(required = false) String deviceIds, |
| | | @RequestParam(required = false) String time |
| | | ) { |
| | | if (StringUtils.isEmpty(id)) id = null; |
| | | if (StringUtils.isEmpty(deviceIds)) deviceIds = null; |
| | | if (StringUtils.isEmpty(time)) time = null; |
| | | if (StringUtils.isEmpty(id)) { |
| | | id = null; |
| | | } |
| | | if (StringUtils.isEmpty(deviceIds)) { |
| | | deviceIds = null; |
| | | } |
| | | if (StringUtils.isEmpty(time)) { |
| | | time = null; |
| | | } |
| | | try { |
| | | if (time != null) { |
| | | format.parse(time); |
| | | DateUtil.format.parse(time); |
| | | } |
| | | } catch (ParseException e) { |
| | | return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST); |
| | |
| | | deviceAlarm.setAlarmDescription("test"); |
| | | deviceAlarm.setAlarmMethod("1"); |
| | | deviceAlarm.setAlarmPriority("1"); |
| | | deviceAlarm.setAlarmTime(formatForGB.format(System.currentTimeMillis())); |
| | | deviceAlarm.setAlarmTime(DateUtil.formatISO8601.format(System.currentTimeMillis())); |
| | | deviceAlarm.setAlarmType("1"); |
| | | deviceAlarm.setLongitude(115.33333); |
| | | deviceAlarm.setLatitude(39.33333); |