删除多余import,无用接口和代码
This commit is contained in:
parent
b5a9ade539
commit
a9eaba2a2d
|
@ -3,7 +3,6 @@ package com.hisense.monitormanage;
|
|||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.hisense.monitormanage.controller;
|
|||
|
||||
import com.hisense.monitormanage.dto.BuildingRecordsDto;
|
||||
import com.hisense.monitormanage.entity.BuildingRecords;
|
||||
import com.hisense.monitormanage.entity.CameraChannel;
|
||||
import com.hisense.monitormanage.entity.Result;
|
||||
import com.hisense.monitormanage.mapper.BuildingRecordsMapper;
|
||||
import com.hisense.monitormanage.service.BuildingRecordsService;
|
||||
|
|
|
@ -329,15 +329,6 @@ public class Controller {
|
|||
return success;
|
||||
}
|
||||
|
||||
//查询视频点播巡检结果,只取异常的
|
||||
// @RequestMapping("listChannelPlayStates")
|
||||
// public Result listChannelPlayStates(
|
||||
// @RequestParam(value="page",required = false,defaultValue = "1") Integer page,
|
||||
// @RequestParam(value="pageSize",required = false,defaultValue = "20") Integer pageSize
|
||||
// ){
|
||||
// return monitorService.listChannelPlayStates();
|
||||
// }
|
||||
|
||||
//道路统计数据与排名
|
||||
@GetMapping("roadData")
|
||||
@ApiOperation("道路统计数据与排名,根据后台dt调用接口")
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
@ -68,36 +67,29 @@ public class EventController {
|
|||
event.setEventCnName(jsonObject.getString("eventAlias"));
|
||||
event.setEventSerial(jsonObject.getString("eventSerial"));
|
||||
JSONObject attributes = jsonObject.getJSONObject("attributes");
|
||||
if (attributes==null){
|
||||
}else {
|
||||
if (attributes!=null){
|
||||
JSONObject text = attributes.getJSONObject("text");
|
||||
if (text == null){
|
||||
}else {
|
||||
if (text != null){
|
||||
event.setVehicle(text.getString("valueDescription"));
|
||||
}
|
||||
JSONObject color = attributes.getJSONObject("color");
|
||||
if (color == null) {
|
||||
} else {
|
||||
if (color != null) {
|
||||
event.setColor(color.getString("valueDescription"));
|
||||
}
|
||||
JSONObject largeVehicle = attributes.getJSONObject("large_vehicle");
|
||||
if (largeVehicle == null) {
|
||||
} else {
|
||||
if (largeVehicle != null) {
|
||||
event.setVehicle(largeVehicle.getString("valueDescription"));
|
||||
}
|
||||
JSONObject trainingVehicle = attributes.getJSONObject("training_vehicle");
|
||||
if (trainingVehicle == null) {
|
||||
} else {
|
||||
event.setVehicle(trainingVehicle.getString("valueDescription"));
|
||||
}
|
||||
JSONObject smallVehicle = attributes.getJSONObject("small_vehicle");
|
||||
if (smallVehicle == null) {
|
||||
} else {
|
||||
if (smallVehicle != null) {
|
||||
event.setVehicle(smallVehicle.getString("valueDescription"));
|
||||
}
|
||||
JSONObject aClass = attributes.getJSONObject("class");
|
||||
if (aClass == null) {
|
||||
} else {
|
||||
if (aClass != null) {
|
||||
event.setClasses(aClass.getString("valueDescription"));
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +150,12 @@ public class EventController {
|
|||
event.setEventNewName(event.getEventCnName());
|
||||
}
|
||||
}
|
||||
Result success = Result.success(events);
|
||||
Integer integer = eventMapper.selectCountEvent();
|
||||
page = integer/pageSize + 1;
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("page",page);
|
||||
map.put("events",events);
|
||||
Result success = Result.success(map);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -32,11 +32,4 @@ public class FileController {
|
|||
Result success = Result.success(s);
|
||||
return success;
|
||||
}
|
||||
|
||||
@GetMapping("token")
|
||||
public Result token( ) {
|
||||
String s = monitorService.init();
|
||||
Result success = Result.success(s);
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.hisense.monitormanage.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.api.R;
|
||||
import com.hisense.monitormanage.entity.Result;
|
||||
import com.hisense.monitormanage.service.SanitationService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
|
@ -3,24 +3,15 @@ package com.hisense.monitormanage.controller;
|
|||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.hisense.monitormanage.dto.ChengguanDto;
|
||||
import com.hisense.monitormanage.dto.ScenicCameraDto;
|
||||
import com.hisense.monitormanage.entity.Camera;
|
||||
import com.hisense.monitormanage.entity.Picture;
|
||||
import com.hisense.monitormanage.entity.Project;
|
||||
import com.hisense.monitormanage.entity.Result;
|
||||
import com.hisense.monitormanage.mapper.CameraMapper;
|
||||
import com.hisense.monitormanage.mapper.ProjectMapper;
|
||||
import com.hisense.monitormanage.mapper.ScenicMapper;
|
||||
import com.hisense.monitormanage.service.MonitorService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/static")
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
package com.hisense.monitormanage.dto;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.hisense.monitormanage.entity.Camera;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class ChengguanDto extends Camera {
|
||||
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package com.hisense.monitormanage.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.hisense.monitormanage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@TableName("t_project")
|
||||
|
|
|
@ -7,7 +7,6 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,8 +3,6 @@ package com.hisense.monitormanage.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.hisense.monitormanage.dto.BuildingRecordsDto;
|
||||
import com.hisense.monitormanage.entity.BuildingRecords;
|
||||
import com.hisense.monitormanage.entity.CameraChannel;
|
||||
import com.hisense.monitormanage.entity.Label;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@ public interface EventMapper extends BaseMapper<Event> {
|
|||
|
||||
List<EventDto> selectEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
|
||||
|
||||
@Select("select count(*) from t_event where track_event = 'START'")
|
||||
Integer selectCountEvent();
|
||||
|
||||
@Select("SELECT * FROM t_event where TO_DAYS(capture_time) = TO_DAYS(NOW()) AND track_event = 'START'")
|
||||
List<EventDto> selectByTime();
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@ package com.hisense.monitormanage.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.hisense.monitormanage.entity.Project;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ProjectMapper extends BaseMapper<Project> {
|
||||
|
||||
}
|
||||
|
|
|
@ -11,8 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -2,13 +2,9 @@ package com.hisense.monitormanage.service;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hisense.monitormanage.dto.CameraChannelDto;
|
||||
import com.hisense.monitormanage.entity.CameraChannel;
|
||||
import com.hisense.monitormanage.entity.Result;
|
||||
import com.hisense.monitormanage.mapper.CameraChannelMapper;
|
||||
import com.hisense.monitormanage.utils.EhcacheUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.cache.ehcache.EhCacheCacheManager;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.hisense.monitormanage.service;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
@ -18,7 +17,6 @@ import org.springframework.beans.factory.annotation.Value;
|
|||
import org.springframework.http.*;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Base64Utils;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
@ -39,7 +37,6 @@ import java.time.ZonedDateTime;
|
|||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service
|
||||
|
@ -90,7 +87,7 @@ public class MonitorService {
|
|||
static int keepaliveCount = 16;
|
||||
|
||||
@PostConstruct
|
||||
public String init(){
|
||||
public void init(){
|
||||
|
||||
String loginUrl = monitorDomain + "/videoService/accounts/authorize";
|
||||
HashMap<String, String> loginParam = new HashMap<>();
|
||||
|
@ -128,13 +125,13 @@ public class MonitorService {
|
|||
String token = (String) reponse.get("token");
|
||||
if (token== null || StringUtils.isEmpty(token)){
|
||||
log.error("[monitor-capture]:" + "监控系统登录失败");
|
||||
return "";
|
||||
return;
|
||||
}
|
||||
this.token = token;
|
||||
Integer duration = (Integer) reponse.get("duration");
|
||||
if (duration == null || duration < 20){
|
||||
log.error("[monitor-capture]:" + "监控系统失效时间异常" + duration);
|
||||
return "";
|
||||
return;
|
||||
}
|
||||
|
||||
duration = duration - 20;
|
||||
|
@ -171,14 +168,9 @@ public class MonitorService {
|
|||
timer.cancel();
|
||||
thatMonitorService.start();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}, 0, duration * 1000);
|
||||
}
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 0 8 * * ?")
|
||||
|
|
|
@ -12,7 +12,6 @@ import org.springframework.http.HttpStatus;
|
|||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
|
|
@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.baomidou.mybatisplus.extension.api.R;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.hisense.monitormanage.entity.CaseCityLaw;
|
||||
import com.hisense.monitormanage.entity.Result;
|
||||
|
@ -22,8 +21,6 @@ import org.springframework.util.LinkedMultiValueMap;
|
|||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
|
|
@ -5,18 +5,14 @@ import com.google.common.collect.Lists;
|
|||
import com.hisense.monitormanage.entity.SedimentTrail;
|
||||
import com.hisense.monitormanage.mapper.SedimentTrailMapper;
|
||||
import com.hisense.monitormanage.utils.LongLatUtil;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.hisense.monitormanage.service;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.hisense.monitormanage.entity.SedimentTrail;
|
||||
import com.hisense.monitormanage.entity.TrailSanitation;
|
||||
import com.hisense.monitormanage.mapper.TrailSanitationMapper;
|
||||
import com.hisense.monitormanage.utils.LongLatUtil;
|
||||
|
|
Loading…
Reference in New Issue