This commit is contained in:
parent
b0d7f9dc09
commit
7e1a9195a0
20
pom.xml
20
pom.xml
|
@ -87,16 +87,16 @@
|
|||
<artifactId>javacv</artifactId>
|
||||
<version>1.5.7</version>
|
||||
</dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.bytedeco</groupId>-->
|
||||
<!-- <artifactId>ffmpeg-platform</artifactId>-->
|
||||
<!-- <version>1.5.7</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.bytedeco</groupId>-->
|
||||
<!-- <artifactId>opencv-platform</artifactId>-->
|
||||
<!-- <version>1.5.7</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.bytedeco</groupId>-->
|
||||
<!-- <artifactId>ffmpeg-platform</artifactId>-->
|
||||
<!-- <version>1.5.7</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.bytedeco</groupId>-->
|
||||
<!-- <artifactId>opencv-platform</artifactId>-->
|
||||
<!-- <version>1.5.7</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -26,7 +26,7 @@ public class GlobalCorsConfig {
|
|||
//2. 添加映射路径
|
||||
UrlBasedCorsConfigurationSource corsConfigurationSource = new UrlBasedCorsConfigurationSource();
|
||||
|
||||
corsConfigurationSource.registerCorsConfiguration("/**",config);
|
||||
corsConfigurationSource.registerCorsConfiguration("/**", config);
|
||||
//3. 返回新的CorsFilter
|
||||
return new CorsFilter(corsConfigurationSource);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public class SwaggerConfig {
|
|||
private boolean enable;
|
||||
|
||||
@Bean
|
||||
public Docket createRestApi(){
|
||||
public Docket createRestApi() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.enable(enable)
|
||||
.select()
|
||||
|
|
|
@ -49,40 +49,41 @@ public class BuildingController {
|
|||
|
||||
@GetMapping("/getRecords")
|
||||
@ApiOperation("测试,获取工地实时数据--调用接口")
|
||||
public List<Map> getRecords(){
|
||||
public List<Map> getRecords() {
|
||||
return buildingRecordsService.getRecords();
|
||||
}
|
||||
|
||||
@GetMapping("/getAndSaveRecords")
|
||||
@ApiOperation("获取工地实时数据并保存到表中--调用接口获取")
|
||||
public Result getAndSaveRecords(){
|
||||
public Result getAndSaveRecords() {
|
||||
boolean result = buildingRecordsService.getAndSaveRecords();
|
||||
if(result){
|
||||
if (result) {
|
||||
return Result.success();
|
||||
}else{
|
||||
} else {
|
||||
return Result.error(String.valueOf(result));
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/listRecords")
|
||||
@ApiOperation("获取工地实时数据列表-从t_building_records表中查询")
|
||||
@ApiImplicitParam(name="pushTime",value="上传时间",paramType = "query",required = true,dataType = "string",example = "2022-01-01")
|
||||
@ApiImplicitParam(name = "pushTime", value = "上传时间", paramType = "query", required = true, dataType = "string", example = "2022-01-01")
|
||||
public List<BuildingRecords> listRecords(
|
||||
@RequestParam(value="pushTime") String pushTime
|
||||
){
|
||||
@RequestParam(value = "pushTime") String pushTime
|
||||
) {
|
||||
return buildingRecordsService.listRecords(pushTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有工地最新列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectAllBuilding")
|
||||
@ApiOperation("查询所有工地")
|
||||
public Result selectAllBuilding(){
|
||||
public Result selectAllBuilding() {
|
||||
List<BuildingRecordsDto> records = buildingRecordsMapper.selectAllBuilding();
|
||||
records.forEach(record ->{
|
||||
records.forEach(record -> {
|
||||
record.setProjectName(record.getGdmc());
|
||||
});
|
||||
Result success = Result.success(records);
|
||||
|
@ -91,15 +92,16 @@ public class BuildingController {
|
|||
|
||||
/**
|
||||
* 根据建筑编号查询近7天工地噪声和扬尘的信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectWeekPmAndNoice")
|
||||
@ApiOperation("根据建筑编号查询近7天工地噪声和扬尘的信息")
|
||||
@ApiImplicitParam(name = "buildLicense", value = "建筑许可编号", required = true, dataType = "String")
|
||||
public Result selectWeekPmAndNoice(String buildLicense){
|
||||
public Result selectWeekPmAndNoice(String buildLicense) {
|
||||
List<BuildingRecordsDtos> records = buildingRecordsMapper.selectWeekPmAndNoice(buildLicense);
|
||||
records.forEach(record ->{
|
||||
if (record.getPm10() == null && record.getNoice() == null){
|
||||
records.forEach(record -> {
|
||||
if (record.getPm10() == null && record.getNoice() == null) {
|
||||
record.setPm10(0);
|
||||
record.setNoice(0);
|
||||
}
|
||||
|
@ -110,15 +112,16 @@ public class BuildingController {
|
|||
|
||||
/**
|
||||
* 根据建筑编号查询近30天工地噪声和扬尘的信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectMonthPmAndNoice")
|
||||
@ApiOperation("根据建筑编号查询近30天工地噪声和扬尘的信息")
|
||||
@ApiImplicitParam(name = "buildLicense", value = "建筑许可编号", required = true, dataType = "String")
|
||||
public Result selectMonthPmAndNoice(String buildLicense){
|
||||
public Result selectMonthPmAndNoice(String buildLicense) {
|
||||
List<BuildingRecordsDtos> records = buildingRecordsMapper.selectMonthPmAndNoice(buildLicense);
|
||||
records.forEach(record ->{
|
||||
if (record.getPm10() == null && record.getNoice() == null){
|
||||
records.forEach(record -> {
|
||||
if (record.getPm10() == null && record.getNoice() == null) {
|
||||
record.setPm10(0);
|
||||
record.setNoice(0);
|
||||
}
|
||||
|
@ -129,6 +132,7 @@ public class BuildingController {
|
|||
|
||||
/**
|
||||
* 查询工地扬尘事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectRaise")
|
||||
|
@ -136,21 +140,22 @@ public class BuildingController {
|
|||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "startTime",value = "开始时间",required = false,dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime",value = "结束时间",required = false,dataType = "String")
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", required = false, dataType = "String")
|
||||
})
|
||||
public Result selectRaise(Integer page,Integer pageSize,String startTime,String endTime){
|
||||
List<BuildingRecordsDto> records = buildingRecordsMapper.selectRaise(page,pageSize,startTime,endTime);
|
||||
public Result selectRaise(Integer page, Integer pageSize, String startTime, String endTime) {
|
||||
List<BuildingRecordsDto> records = buildingRecordsMapper.selectRaise(page, pageSize, startTime, endTime);
|
||||
Integer integer = buildingRecordsMapper.selectCountRaise();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("data",records);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("data", records);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工地噪声事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectNoiceEvent")
|
||||
|
@ -159,18 +164,19 @@ public class BuildingController {
|
|||
@ApiImplicitParam(name = "page", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Integer")
|
||||
})
|
||||
public Result selectNoiceEvent(Integer page,Integer pageSize){
|
||||
List<BuildingRecordsDto> records = buildingRecordsMapper.selectNoiceEvent(page,pageSize);
|
||||
public Result selectNoiceEvent(Integer page, Integer pageSize) {
|
||||
List<BuildingRecordsDto> records = buildingRecordsMapper.selectNoiceEvent(page, pageSize);
|
||||
Integer integer = buildingRecordsMapper.selectCountNoice();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("data",records);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("data", records);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工地视频感知事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByAllEvent")
|
||||
|
@ -179,28 +185,29 @@ public class BuildingController {
|
|||
@ApiImplicitParam(name = "page", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Integer")
|
||||
})
|
||||
public Result selectByAllEvent(Integer page,Integer pageSize){
|
||||
public Result selectByAllEvent(Integer page, Integer pageSize) {
|
||||
List<EventDto> eventDtos = buildingRecordsMapper.selectByAllEvent(page, pageSize);
|
||||
eventDtos.forEach(eventDto -> {
|
||||
eventDto.setEventNewName(eventDto.getEventCnName());
|
||||
});
|
||||
Integer integer = buildingRecordsMapper.selectCountEvent();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("data",eventDtos);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("data", eventDtos);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工地名称搜索工地
|
||||
*
|
||||
* @param projectName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByProjectName")
|
||||
@ApiOperation("根据工地名称搜索工地")
|
||||
@ApiImplicitParam(name = "projectName", value = "工地名称",required = true,dataType ="String")
|
||||
public Result selectByProjectName(String projectName){
|
||||
@ApiImplicitParam(name = "projectName", value = "工地名称", required = true, dataType = "String")
|
||||
public Result selectByProjectName(String projectName) {
|
||||
List<BuildingRecordsDto> records = buildingRecordsMapper.selectByProjectName(projectName);
|
||||
Result success = Result.success(records);
|
||||
return success;
|
||||
|
@ -208,22 +215,23 @@ public class BuildingController {
|
|||
|
||||
/**
|
||||
* 根据经纬度查询半径内所有的工地
|
||||
*
|
||||
* @param jd
|
||||
* @param wd
|
||||
* @param radius
|
||||
* @return
|
||||
*/
|
||||
@GetMapping ("selectByJdWd")
|
||||
@GetMapping("selectByJdWd")
|
||||
@ApiOperation("根据经纬度查询半径内所有的工地")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "jd", value = "经度",required = true,dataType ="Double"),
|
||||
@ApiImplicitParam(name = "wd", value = "纬度",required = true,dataType ="Double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米",required = true,dataType ="Integer"),}
|
||||
@ApiImplicitParam(name = "jd", value = "经度", required = true, dataType = "Double"),
|
||||
@ApiImplicitParam(name = "wd", value = "纬度", required = true, dataType = "Double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", required = true, dataType = "Integer"),}
|
||||
)
|
||||
public Result selectByJdWd(Double jd,Double wd,Integer radius){
|
||||
public Result selectByJdWd(Double jd, Double wd, Integer radius) {
|
||||
double[] around = LongLatUtil.getAround(jd, wd, radius);
|
||||
List<BuildingRecordsDto> buildingRecordsDtos = buildingRecordsMapper.selectByJdWd(around[0], around[2], around[1], around[3]);
|
||||
buildingRecordsDtos.forEach(buildingRecordsDto->{
|
||||
buildingRecordsDtos.forEach(buildingRecordsDto -> {
|
||||
buildingRecordsDto.setProjectName(buildingRecordsDto.getGdmc());
|
||||
});
|
||||
Result success = Result.success(buildingRecordsDtos);
|
||||
|
@ -232,181 +240,192 @@ public class BuildingController {
|
|||
|
||||
/**
|
||||
* 查询当天工地视频感知事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByEvent")
|
||||
@ApiOperation("查询当天工地视频感知事件")
|
||||
public Result selectByEvent(){
|
||||
public Result selectByEvent() {
|
||||
List<EventDto> events = buildingRecordsMapper.selectByEvent();
|
||||
events.forEach(eventDto -> {
|
||||
eventDto.setEventNewName(eventDto.getEventCnName());
|
||||
});
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",events.size());
|
||||
map.put("data",events);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", events.size());
|
||||
map.put("data", events);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当天扬尘事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByDayRaise")
|
||||
@ApiOperation("查询当天扬尘事件")
|
||||
public Result selectByDayRaise(){
|
||||
public Result selectByDayRaise() {
|
||||
List<BuildingRecordsDto> records = buildingRecordsMapper.selectByDayRaise();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",records.size());
|
||||
map.put("data",records);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", records.size());
|
||||
map.put("data", records);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当天噪声事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByDayNoice")
|
||||
@ApiOperation("查询当天噪声事件")
|
||||
public Result selectByDayNoice(){
|
||||
public Result selectByDayNoice() {
|
||||
List<BuildingRecordsDto> records = buildingRecordsMapper.selectByDayNoice();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",records.size());
|
||||
map.put("data",records);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", records.size());
|
||||
map.put("data", records);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当天道路污染事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByDayRoadData")
|
||||
@ApiOperation("查询当天道路污染事件")
|
||||
public Result selectByDayRoadData(){
|
||||
public Result selectByDayRoadData() {
|
||||
RoadData byMaxId = roadDataMapper.getByMaxId();
|
||||
String dt = byMaxId.getDt();
|
||||
String dt = byMaxId.getDt();
|
||||
List<RoadData> roadData = buildingRecordsMapper.selectByDayRoadData(dt);
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",roadData.size());
|
||||
map.put("data",roadData);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", roadData.size());
|
||||
map.put("data", roadData);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
@GetMapping("exportEvent")
|
||||
public String exportRaiseEvent(String startTime,String endTime) throws Exception {
|
||||
buildingRecordsService.testHSSF(startTime,endTime);
|
||||
public String exportRaiseEvent(String startTime, String endTime) throws Exception {
|
||||
buildingRecordsService.testHSSF(startTime, endTime);
|
||||
return "导出成功";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询近7天噪声事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByWeekNoice")
|
||||
@ApiOperation("查询近7天噪声事件")
|
||||
public Result selectByWeekNoice(){
|
||||
public Result selectByWeekNoice() {
|
||||
List<BuildingRecordsDto> buildingRecordsDtos = buildingRecordsMapper.selectByWeekNoice();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",buildingRecordsDtos.size());
|
||||
map.put("data",buildingRecordsDtos);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", buildingRecordsDtos.size());
|
||||
map.put("data", buildingRecordsDtos);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询近30天噪声事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByMonthNoice")
|
||||
@ApiOperation("查询近30天噪声事件")
|
||||
public Result selectByMonthNoice(){
|
||||
public Result selectByMonthNoice() {
|
||||
List<BuildingRecordsDto> buildingRecordsDtos = buildingRecordsMapper.selectByMonthNoice();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",buildingRecordsDtos.size());
|
||||
map.put("data",buildingRecordsDtos);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", buildingRecordsDtos.size());
|
||||
map.put("data", buildingRecordsDtos);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询近7天扬尘事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByWeekNaise")
|
||||
@ApiOperation("查询近7天扬尘事件")
|
||||
public Result selectByWeekNaise(){
|
||||
public Result selectByWeekNaise() {
|
||||
List<BuildingRecordsDto> buildingRecordsDtos = buildingRecordsMapper.selectByWeekNaise();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",buildingRecordsDtos.size());
|
||||
map.put("data",buildingRecordsDtos);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", buildingRecordsDtos.size());
|
||||
map.put("data", buildingRecordsDtos);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询近30天扬尘事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByMonthNaise")
|
||||
@ApiOperation("查询近30天扬尘事件")
|
||||
public Result selectByMonthNaise(){
|
||||
public Result selectByMonthNaise() {
|
||||
List<BuildingRecordsDto> buildingRecordsDtos = buildingRecordsMapper.selectByMonthNaise();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",buildingRecordsDtos.size());
|
||||
map.put("data",buildingRecordsDtos);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", buildingRecordsDtos.size());
|
||||
map.put("data", buildingRecordsDtos);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询近7天工地视频感知事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByWeekEvent")
|
||||
@ApiOperation("查询近7天工地视频感知事件")
|
||||
public Result selectByWeekEvent(){
|
||||
public Result selectByWeekEvent() {
|
||||
List<EventDto> events = buildingRecordsMapper.selectByWeekEvent();
|
||||
events.forEach(eventDto -> {
|
||||
eventDto.setEventNewName(eventDto.getEventCnName());
|
||||
});
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",events.size());
|
||||
map.put("data",events);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", events.size());
|
||||
map.put("data", events);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询近30天工地视频感知事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByMonthEvent")
|
||||
@ApiOperation("查询近30天工地视频感知事件")
|
||||
public Result selectByMonthEvent(){
|
||||
public Result selectByMonthEvent() {
|
||||
List<EventDto> events = buildingRecordsMapper.selectByMonthEvent();
|
||||
events.forEach(eventDto -> {
|
||||
eventDto.setEventNewName(eventDto.getEventCnName());
|
||||
});
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",events.size());
|
||||
map.put("data",events);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", events.size());
|
||||
map.put("data", events);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询近30天物联感知事件时间趋势
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectMonthCurrentByBuilding")
|
||||
@ApiOperation("查询近30天物联感知事件时间趋势")
|
||||
public Result selectMonthCurrentByBuilding(){
|
||||
public Result selectMonthCurrentByBuilding() {
|
||||
List<BuildingRecordsDtos> buildingRecordsDtos = buildingRecordsMapper.selectMonthCurrentByBuilding();
|
||||
buildingRecordsDtos.forEach(buildingRecordsDto -> {
|
||||
if (buildingRecordsDto.getNumber() == null){
|
||||
if (buildingRecordsDto.getNumber() == null) {
|
||||
buildingRecordsDto.setNumber(0);
|
||||
}
|
||||
});
|
||||
|
@ -416,14 +435,15 @@ public class BuildingController {
|
|||
|
||||
/**
|
||||
* 查询近30天工地视频感知事件时间趋势
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectMonthCurrentByEvent")
|
||||
@ApiOperation("查询近30天工地视频感知事件时间趋势")
|
||||
public Result selectMonthCurrentByEvent(){
|
||||
public Result selectMonthCurrentByEvent() {
|
||||
List<BuildingRecordsDtos> buildingRecordsDtos = buildingRecordsMapper.selectMonthCurrentByEvent();
|
||||
buildingRecordsDtos.forEach(buildingRecordsDto -> {
|
||||
if (buildingRecordsDto.getNumber() == null){
|
||||
if (buildingRecordsDto.getNumber() == null) {
|
||||
buildingRecordsDto.setNumber(0);
|
||||
}
|
||||
});
|
||||
|
@ -433,62 +453,66 @@ public class BuildingController {
|
|||
|
||||
/**
|
||||
* 查询走航监测top5全部道路污染事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectRoadDataCountEvent")
|
||||
@ApiOperation("查询走航监测top5全部道路污染事件")
|
||||
public Result selectRoadDataCountEvent(){
|
||||
public Result selectRoadDataCountEvent() {
|
||||
List<RoadDataDto> roadDataDtos = buildingRecordsMapper.selectRoadDataCountEvent();
|
||||
Integer integer = roadDataMapper.selectCountRoadData();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("roadDataDtos",roadDataDtos);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("roadDataDtos", roadDataDtos);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询走航监测top5近7天道路污染事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectRoadDataWeekEvent")
|
||||
@ApiOperation("查询走航监测top5近7天道路污染事件")
|
||||
public Result selectRoadDataWeekEvent(){
|
||||
public Result selectRoadDataWeekEvent() {
|
||||
List<RoadDataDto> roadDataDtos = buildingRecordsMapper.selectRoadDataWeekEvent();
|
||||
Integer integer = roadDataMapper.selectCountWeekRoadData();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("roadDataDtos",roadDataDtos);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("roadDataDtos", roadDataDtos);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询走航监测top5近30天道路污染事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectRoadDataMonthEvent")
|
||||
@ApiOperation("查询走航监测top5近30天道路污染事件")
|
||||
public Result selectRoadDataMonthEvent(){
|
||||
public Result selectRoadDataMonthEvent() {
|
||||
List<RoadDataDto> roadDataDtos = buildingRecordsMapper.selectRoadDataMonthEvent();
|
||||
Integer integer = roadDataMapper.selectCountMonthRoadData();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("roadDataDtos",roadDataDtos);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("roadDataDtos", roadDataDtos);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询近30天走航监测事件时间趋势
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectMonthCurrentByRoadData")
|
||||
@ApiOperation("查询近30天走航监测事件时间趋势")
|
||||
public Result selectMonthCurrentByRoadData(){
|
||||
public Result selectMonthCurrentByRoadData() {
|
||||
List<BuildingRecordsDtos> buildingRecordsDtos = buildingRecordsMapper.selectMonthCurrentByRoadData();
|
||||
buildingRecordsDtos.forEach(buildingRecordsDto -> {
|
||||
if (buildingRecordsDto.getNumber() == null){
|
||||
if (buildingRecordsDto.getNumber() == null) {
|
||||
buildingRecordsDto.setNumber(0);
|
||||
}
|
||||
});
|
||||
|
@ -497,5 +521,4 @@ public class BuildingController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -13,11 +13,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/project")
|
||||
@Api(tags="视频监控")
|
||||
@Api(tags = "视频监控")
|
||||
public class Controller {
|
||||
|
||||
@Autowired
|
||||
|
@ -45,7 +46,7 @@ public class Controller {
|
|||
private ChannelPictureMapper channelPictureMapper;
|
||||
|
||||
@GetMapping("all")
|
||||
public Object all(){
|
||||
public Object all() {
|
||||
List<Project> projects = projectMapper.selectList(null);
|
||||
projects.forEach(project -> {
|
||||
List<Picture> pics = cameraMapper.selectPicByProjectId(project.getId());
|
||||
|
@ -57,10 +58,11 @@ public class Controller {
|
|||
|
||||
/**
|
||||
* 推送给城管接口用的
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("cameras")
|
||||
public Result cameras(){
|
||||
public Result cameras() {
|
||||
List<ChannelPictureDto> channelPictureDtos = channelPictureMapper.selectByProject();
|
||||
Result success = Result.success(channelPictureDtos);
|
||||
success.setCount(channelPictureDtos.size());
|
||||
|
@ -68,11 +70,10 @@ public class Controller {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("camera")
|
||||
public Result camera(){
|
||||
public Result camera() {
|
||||
List<PictureDto> pictureDtos = channelPictureMapper.selectByPicture();
|
||||
Result success = Result.success(pictureDtos);
|
||||
return success;
|
||||
|
@ -80,10 +81,11 @@ public class Controller {
|
|||
|
||||
/**
|
||||
* 景区人流识别
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("scenicCamera")
|
||||
public Result scenicCamera(){
|
||||
public Result scenicCamera() {
|
||||
List<ScenicCameraDto> scenicCameraDtos = scenicMapper.selectScenicCameras();
|
||||
Result success = Result.success(scenicCameraDtos);
|
||||
success.setCount(scenicCameraDtos.size());
|
||||
|
@ -91,21 +93,21 @@ public class Controller {
|
|||
}
|
||||
|
||||
@GetMapping("capture")
|
||||
public Object capture(){
|
||||
public Object capture() {
|
||||
monitorService.CameraScreenshot();
|
||||
|
||||
return "finish capture";
|
||||
}
|
||||
|
||||
@GetMapping("startScenic")
|
||||
public Object startScenic(){
|
||||
public Object startScenic() {
|
||||
monitorService.startScenic();
|
||||
|
||||
return "startScenic finish";
|
||||
}
|
||||
|
||||
@GetMapping("capture1")
|
||||
public Object capture1(){
|
||||
public Object capture1() {
|
||||
monitorService.scenicSpotAndBathing1();
|
||||
|
||||
return "finish capture";
|
||||
|
@ -114,24 +116,26 @@ public class Controller {
|
|||
|
||||
/**
|
||||
* 查询所有摄像头
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectAll")
|
||||
@ApiOperation("查询所有摄像头")
|
||||
public String selectAll(){
|
||||
public String selectAll() {
|
||||
return cameraChannelService.selectAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据channelCode查询摄像头详细信息
|
||||
*
|
||||
* @param channelCode
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByChannelCode")
|
||||
@ApiOperation("根据摄像头编号查询摄像头详细信息")
|
||||
@ApiImplicitParam(name = "channelCode",value = "摄像头标识",required = true,dataType = "String")
|
||||
public Result selectByChannelCode(String channelCode){
|
||||
@ApiImplicitParam(name = "channelCode", value = "摄像头标识", required = true, dataType = "String")
|
||||
public Result selectByChannelCode(String channelCode) {
|
||||
|
||||
List<CameraChannelDto1> list = cameraChannelMapper.selectByChannelCode(channelCode);
|
||||
|
||||
|
@ -144,13 +148,14 @@ public class Controller {
|
|||
|
||||
/**
|
||||
* 根据摄像头名字模糊查询摄像头
|
||||
*
|
||||
* @param channelName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByChannelName")
|
||||
@ApiOperation("根据摄像头名字模糊查询摄像头")
|
||||
@ApiImplicitParam(name = "channelName",value = "摄像头名称",required = true,dataType = "String")
|
||||
public Result selectByChannelName(String channelName){
|
||||
@ApiImplicitParam(name = "channelName", value = "摄像头名称", required = true, dataType = "String")
|
||||
public Result selectByChannelName(String channelName) {
|
||||
|
||||
List<CameraChannel> labels = cameraChannelMapper.selectByChannelName(channelName);
|
||||
|
||||
|
@ -161,18 +166,19 @@ public class Controller {
|
|||
|
||||
/**
|
||||
* 根据parentId和checkStatus查询摄像头
|
||||
*
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByParentId")
|
||||
@ApiOperation("根据摄像头的组织Id和异常状态查询摄像头")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "parentId",value = "摄像头的组织Id",required = true,dataType = "String"),
|
||||
@ApiImplicitParam(name = "checkStatus",value = "异常状态 1正常,0异常",required = true,dataType = "String")
|
||||
@ApiImplicitParam(name = "parentId", value = "摄像头的组织Id", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "checkStatus", value = "异常状态 1正常,0异常", required = true, dataType = "String")
|
||||
})
|
||||
public Result selectByParentId(String parentId,String checkStatus){
|
||||
public Result selectByParentId(String parentId, String checkStatus) {
|
||||
|
||||
List<CameraChannel> list = cameraChannelMapper.selectByParentId(parentId,checkStatus);
|
||||
List<CameraChannel> list = cameraChannelMapper.selectByParentId(parentId, checkStatus);
|
||||
|
||||
Result success = Result.success(list);
|
||||
|
||||
|
@ -182,16 +188,17 @@ public class Controller {
|
|||
|
||||
/**
|
||||
* 根据标签查询对应摄像头
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectLabel")
|
||||
@ApiOperation("根据标签查询对应摄像头")
|
||||
@ApiImplicitParam(name = "labelCode",value = "标签号",required = true,dataType = "String")
|
||||
public Result selectLabel(String labelCode){
|
||||
@ApiImplicitParam(name = "labelCode", value = "标签号", required = true, dataType = "String")
|
||||
public Result selectLabel(String labelCode) {
|
||||
|
||||
List<ChannelLabelDto> channelLabelDtos = cameraChannelMapper.selectLabel(labelCode);
|
||||
|
||||
for (ChannelLabelDto channelLabelDto :channelLabelDtos) {
|
||||
for (ChannelLabelDto channelLabelDto : channelLabelDtos) {
|
||||
String nodeName = channelLabelDto.getNodeName();
|
||||
String[] splits = nodeName.split("->");
|
||||
String split = splits[1];
|
||||
|
@ -204,19 +211,20 @@ public class Controller {
|
|||
|
||||
/**
|
||||
* 根据经纬度查询半径内所有的摄像头
|
||||
*
|
||||
* @param gpsX
|
||||
* @param gpsY
|
||||
* @param radius
|
||||
* @return
|
||||
*/
|
||||
@GetMapping ("selectAllByGps")
|
||||
@GetMapping("selectAllByGps")
|
||||
@ApiOperation("根据经纬度查询半径内所有的摄像头")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gpsX", value = "经度",required = true,dataType ="Double"),
|
||||
@ApiImplicitParam(name = "gpsY", value = "纬度",required = true,dataType ="Double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米",required = true,dataType ="Integer"),}
|
||||
@ApiImplicitParam(name = "gpsX", value = "经度", required = true, dataType = "Double"),
|
||||
@ApiImplicitParam(name = "gpsY", value = "纬度", required = true, dataType = "Double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", required = true, dataType = "Integer"),}
|
||||
)
|
||||
public Result selectAllByGps(Double gpsX,Double gpsY,Integer radius){
|
||||
public Result selectAllByGps(Double gpsX, Double gpsY, Integer radius) {
|
||||
double[] around = LongLatUtil.getAround(gpsX, gpsY, radius);
|
||||
List<CameraChannel> c = cameraChannelMapper.selectAllByGps(around[0], around[2], around[1], around[3]);
|
||||
Result success = Result.success(c);
|
||||
|
@ -225,11 +233,12 @@ public class Controller {
|
|||
|
||||
/**
|
||||
* 查询所有标签
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectAllLabel")
|
||||
@ApiOperation("查询所有标签")
|
||||
public Result selectAllLabel(){
|
||||
public Result selectAllLabel() {
|
||||
|
||||
List<Label> labels = cameraChannelMapper.selectAllLabel();
|
||||
|
||||
|
@ -240,11 +249,12 @@ public class Controller {
|
|||
|
||||
/**
|
||||
* 查询city为1的标签
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByLabelCity")
|
||||
@ApiOperation("查询city为1的标签")
|
||||
public Result selectByLabelCity(){
|
||||
public Result selectByLabelCity() {
|
||||
|
||||
List<Label> labels = cameraChannelMapper.selectByLabelCity();
|
||||
|
||||
|
@ -255,13 +265,14 @@ public class Controller {
|
|||
|
||||
/**
|
||||
* 根据标签名字模糊查询标签
|
||||
*
|
||||
* @param labelName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByLabelName")
|
||||
@ApiOperation("根据标签名字模糊查询标签")
|
||||
@ApiImplicitParam(name = "labelName",value = "标签名称",required = true,dataType = "String")
|
||||
public Result selectByLabelName(String labelName){
|
||||
@ApiImplicitParam(name = "labelName", value = "标签名称", required = true, dataType = "String")
|
||||
public Result selectByLabelName(String labelName) {
|
||||
|
||||
List<Label> labels = cameraChannelMapper.selectByLabelName(labelName);
|
||||
|
||||
|
@ -272,14 +283,15 @@ public class Controller {
|
|||
|
||||
/**
|
||||
* 根据parentId查询组织
|
||||
*
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectSubOrgan")
|
||||
@ApiOperation("根据上级组织id查询组织")
|
||||
@ApiImplicitParam(name = "parentId",value = "上级组织id",required = true,dataType = "String")
|
||||
public Result selectSubOrganization(String parentId){
|
||||
if (parentId == null){
|
||||
@ApiImplicitParam(name = "parentId", value = "上级组织id", required = true, dataType = "String")
|
||||
public Result selectSubOrganization(String parentId) {
|
||||
if (parentId == null) {
|
||||
parentId = "";
|
||||
}
|
||||
|
||||
|
@ -292,6 +304,7 @@ public class Controller {
|
|||
|
||||
/**
|
||||
* 提供给其他项目分页查询摄像头接口
|
||||
*
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @return
|
||||
|
@ -299,11 +312,11 @@ public class Controller {
|
|||
@GetMapping("selectCamera")
|
||||
@ApiOperation("提供给其他项目分页查询摄像头接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page",value = "页码",required = true,dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize",value = "页码大小",required = true,dataType = "Integer")
|
||||
@ApiImplicitParam(name = "page", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Integer")
|
||||
})
|
||||
public Result selectNLAll(Integer page,Integer pageSize){
|
||||
List<CameraChannelNLDto> selectNLAll = cameraChannelMapper.selectNLAll(page,pageSize);
|
||||
public Result selectNLAll(Integer page, Integer pageSize) {
|
||||
List<CameraChannelNLDto> selectNLAll = cameraChannelMapper.selectNLAll(page, pageSize);
|
||||
Result success = Result.success(selectNLAll);
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -37,16 +37,18 @@ public class EventController {
|
|||
|
||||
/**
|
||||
* 订阅任务下发接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("subscribe")
|
||||
public JSONObject subscribe(){
|
||||
public JSONObject subscribe() {
|
||||
return eventService.subscribe();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 订阅任务下发接口
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
* @throws IOException
|
||||
|
@ -68,9 +70,9 @@ public class EventController {
|
|||
event.setEventCnName(jsonObject.getString("eventAlias"));
|
||||
event.setEventSerial(jsonObject.getString("eventSerial"));
|
||||
JSONObject attributes = jsonObject.getJSONObject("attributes");
|
||||
if (attributes!=null){
|
||||
if (attributes != null) {
|
||||
JSONObject text = attributes.getJSONObject("text");
|
||||
if (text != null){
|
||||
if (text != null) {
|
||||
event.setVehicle(text.getString("valueDescription"));
|
||||
}
|
||||
JSONObject color = attributes.getJSONObject("color");
|
||||
|
@ -95,14 +97,14 @@ public class EventController {
|
|||
}
|
||||
}
|
||||
JSONObject camera = jsonObject.getJSONObject("camera");
|
||||
if (camera!=null){
|
||||
if (camera != null) {
|
||||
event.setCameraName(camera.getString("cameraName"));
|
||||
event.setDistrict(camera.getString("district"));
|
||||
event.setLatitude(camera.getBigDecimal("latitude"));
|
||||
event.setLongitude(camera.getBigDecimal("longitude"));
|
||||
}
|
||||
JSONObject image = jsonObject.getJSONObject("image");
|
||||
if (image!=null){
|
||||
if (image != null) {
|
||||
event.setImageUrl(image.getString("imageUrl"));
|
||||
}
|
||||
event.setTaskId(jsonObject.getString("taskId"));
|
||||
|
@ -111,7 +113,7 @@ public class EventController {
|
|||
try {
|
||||
date = sdf.parse(sdf.format(jsonObject.get("captureTime")));
|
||||
event.setCaptureTime(sdf.format(date));
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
event.setTrackEvent(jsonObject.getString("trackEvent"));
|
||||
|
@ -123,17 +125,19 @@ public class EventController {
|
|||
|
||||
/**
|
||||
* 事件模板分页查询接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("tamplate")
|
||||
@ApiOperation("事件模板分页查询接口")
|
||||
public JSONObject tamplate(){
|
||||
public JSONObject tamplate() {
|
||||
return eventService.template();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectEvent")
|
||||
|
@ -142,28 +146,28 @@ public class EventController {
|
|||
@ApiImplicitParam(name = "page", value = "页码", required = false, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "页码大小", required = false, dataType = "Integer")
|
||||
})
|
||||
public Result selectEvent(Integer page,Integer pageSize){
|
||||
List<EventDto> events = eventMapper.selectEvent(page,pageSize);
|
||||
for (EventDto event: events) {
|
||||
public Result selectEvent(Integer page, Integer pageSize) {
|
||||
List<EventDto> events = eventMapper.selectEvent(page, pageSize);
|
||||
for (EventDto event : events) {
|
||||
if (event.getEventCnName().equals("街头伞篷") || event.getEventCnName().equals("水果和食品摊")
|
||||
|| event.getEventCnName().equals("地摊")|| event.getEventCnName().equals("户外桌椅")){
|
||||
|| event.getEventCnName().equals("地摊") || event.getEventCnName().equals("户外桌椅")) {
|
||||
event.setEventNewName("占道经营");
|
||||
}else if (event.getEventCnName().equals("纸箱")|| event.getEventCnName().equals("街头散落垃圾")
|
||||
||event.getEventCnName().equals("塑料篮子")){
|
||||
} else if (event.getEventCnName().equals("纸箱") || event.getEventCnName().equals("街头散落垃圾")
|
||||
|| event.getEventCnName().equals("塑料篮子")) {
|
||||
event.setEventNewName("环境卫生");
|
||||
}else if (event.getEventCnName().equals("沿街晾晒衣物被单")){
|
||||
} else if (event.getEventCnName().equals("沿街晾晒衣物被单")) {
|
||||
event.setEventNewName("沿街晾晒");
|
||||
}else if (event.getEventCnName().equals("机动车违停")){
|
||||
} else if (event.getEventCnName().equals("机动车违停")) {
|
||||
event.setEventNewName("违章停车");
|
||||
}else {
|
||||
} else {
|
||||
event.setEventNewName(event.getEventCnName());
|
||||
}
|
||||
}
|
||||
Integer integer = eventMapper.selectCountEvent();
|
||||
page = integer/pageSize + 1;
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("page",page);
|
||||
map.put("events",events);
|
||||
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;
|
||||
|
@ -171,24 +175,25 @@ public class EventController {
|
|||
|
||||
/**
|
||||
* 查询当天事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByTime")
|
||||
@ApiOperation("查询当天事件")
|
||||
public Result selectByTime(){
|
||||
public Result selectByTime() {
|
||||
List<EventDto> events = eventMapper.selectByTime();
|
||||
for (EventDto event: events) {
|
||||
for (EventDto event : events) {
|
||||
if (event.getEventCnName().equals("街头伞篷") || event.getEventCnName().equals("水果和食品摊")
|
||||
|| event.getEventCnName().equals("地摊")|| event.getEventCnName().equals("户外桌椅")){
|
||||
|| event.getEventCnName().equals("地摊") || event.getEventCnName().equals("户外桌椅")) {
|
||||
event.setEventNewName("占道经营");
|
||||
}else if (event.getEventCnName().equals("纸箱")|| event.getEventCnName().equals("街头散落垃圾")
|
||||
||event.getEventCnName().equals("塑料篮子")){
|
||||
} else if (event.getEventCnName().equals("纸箱") || event.getEventCnName().equals("街头散落垃圾")
|
||||
|| event.getEventCnName().equals("塑料篮子")) {
|
||||
event.setEventNewName("环境卫生");
|
||||
}else if (event.getEventCnName().equals("沿街晾晒衣物被单")){
|
||||
} else if (event.getEventCnName().equals("沿街晾晒衣物被单")) {
|
||||
event.setEventNewName("沿街晾晒");
|
||||
}else if (event.getEventCnName().equals("机动车违停")){
|
||||
} else if (event.getEventCnName().equals("机动车违停")) {
|
||||
event.setEventNewName("违章停车");
|
||||
}else {
|
||||
} else {
|
||||
event.setEventNewName(event.getEventCnName());
|
||||
}
|
||||
}
|
||||
|
@ -201,6 +206,7 @@ public class EventController {
|
|||
|
||||
/**
|
||||
* 根据事件名称查询事件
|
||||
*
|
||||
* @param eventNewName
|
||||
* @return
|
||||
*/
|
||||
|
@ -211,62 +217,62 @@ public class EventController {
|
|||
@ApiImplicitParam(name = "page", value = "页码", required = false, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "页码大小", required = false, dataType = "Integer")
|
||||
})
|
||||
public Result selectByName(String eventNewName,Integer page,Integer pageSize){
|
||||
if (eventNewName.equals("环境卫生")){
|
||||
List<EventDto> lists = eventMapper.selectByName("'塑料篮子','纸箱','街头散落垃圾'",page,pageSize);
|
||||
lists.forEach(list ->{
|
||||
public Result selectByName(String eventNewName, Integer page, Integer pageSize) {
|
||||
if (eventNewName.equals("环境卫生")) {
|
||||
List<EventDto> lists = eventMapper.selectByName("'塑料篮子','纸箱','街头散落垃圾'", page, pageSize);
|
||||
lists.forEach(list -> {
|
||||
list.setEventNewName("环境卫生");
|
||||
});
|
||||
Integer integer = eventMapper.selectCountByName("'塑料篮子','纸箱','街头散落垃圾'");
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("events",lists);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("events", lists);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}else if (eventNewName.equals("占道经营")){
|
||||
List<EventDto> lists = eventMapper.selectByName("'街头伞篷','水果和食品摊','地摊','户外桌椅'",page,pageSize);
|
||||
lists.forEach(list ->{
|
||||
} else if (eventNewName.equals("占道经营")) {
|
||||
List<EventDto> lists = eventMapper.selectByName("'街头伞篷','水果和食品摊','地摊','户外桌椅'", page, pageSize);
|
||||
lists.forEach(list -> {
|
||||
list.setEventNewName("占道经营");
|
||||
});
|
||||
Integer integer = eventMapper.selectCountByName("'街头伞篷','水果和食品摊','地摊','户外桌椅'");
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("events",lists);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("events", lists);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}else if (eventNewName.equals("沿街晾晒")){
|
||||
List<EventDto> lists = eventMapper.selectByName("'沿街晾晒衣物被单'",page,pageSize);
|
||||
lists.forEach(list ->{
|
||||
} else if (eventNewName.equals("沿街晾晒")) {
|
||||
List<EventDto> lists = eventMapper.selectByName("'沿街晾晒衣物被单'", page, pageSize);
|
||||
lists.forEach(list -> {
|
||||
list.setEventNewName("沿街晾晒");
|
||||
});
|
||||
Integer integer = eventMapper.selectCountByName("'沿街晾晒衣物被单'");
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("events",lists);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("events", lists);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}else if (eventNewName.equals("违章停车")){
|
||||
List<EventDto> lists = eventMapper.selectByName("'机动车违停'",page,pageSize);
|
||||
lists.forEach(list ->{
|
||||
} else if (eventNewName.equals("违章停车")) {
|
||||
List<EventDto> lists = eventMapper.selectByName("'机动车违停'", page, pageSize);
|
||||
lists.forEach(list -> {
|
||||
list.setEventNewName("违章停车");
|
||||
});
|
||||
Integer integer = eventMapper.selectCountByName("'机动车违停'");
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("events",lists);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("events", lists);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}else {
|
||||
} else {
|
||||
StringBuilder str = new StringBuilder(eventNewName);
|
||||
String s = str.insert(0, "'").append("'").toString();
|
||||
List<EventDto> lists = eventMapper.selectByName(s, page, pageSize);
|
||||
lists.forEach(list ->{
|
||||
lists.forEach(list -> {
|
||||
list.setEventNewName(list.getEventCnName());
|
||||
});
|
||||
Integer integer = eventMapper.selectCountByName(s);
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("events",lists);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("events", lists);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
@ -274,12 +280,13 @@ public class EventController {
|
|||
|
||||
/**
|
||||
* 查询当天根据事件名称查询事件
|
||||
*
|
||||
* @param eventNewName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByTimeAndName")
|
||||
@ApiOperation("查询当天根据事件名称查询事件")
|
||||
@ApiImplicitParam(name = "eventNewName",value = "事件名称",required = true,dataType = "String")
|
||||
@ApiImplicitParam(name = "eventNewName", value = "事件名称", required = true, dataType = "String")
|
||||
public Result selectByTimeAndName(String eventNewName) {
|
||||
if (eventNewName.equals("环境卫生")) {
|
||||
List<EventDto> lists = eventMapper.selectByTimeAndName("'塑料篮子','纸箱','街头散落垃圾'");
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.io.IOException;
|
|||
|
||||
@RestController
|
||||
@RequestMapping("api/project")
|
||||
@Api(tags="视频流")
|
||||
@Api(tags = "视频流")
|
||||
public class FileController {
|
||||
|
||||
@Autowired
|
||||
|
@ -22,6 +22,7 @@ public class FileController {
|
|||
|
||||
/**
|
||||
* 根据摄像头标识获取视频流
|
||||
*
|
||||
* @param channelCode
|
||||
* @return
|
||||
* @throws IOException
|
||||
|
@ -29,7 +30,7 @@ public class FileController {
|
|||
@GetMapping("file")
|
||||
@ApiOperation("根据摄像头标识获取视频流")
|
||||
@ApiImplicitParam(name = "channelCode", value = "摄像头标识", required = true, dataType = "String")
|
||||
public Result File(String channelCode)throws IOException {
|
||||
public Result File(String channelCode) throws IOException {
|
||||
String s = monitorService.fileCode(channelCode);
|
||||
Result success = Result.success(s);
|
||||
return success;
|
||||
|
|
|
@ -18,7 +18,7 @@ public class FordController {
|
|||
|
||||
@GetMapping("components/**")
|
||||
@ApiOperation("前端访问图片请求转发")
|
||||
public void ford(HttpServletRequest request, HttpServletResponse response){
|
||||
public void ford(HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
String imageDomain = "http://10.132.191.48:30080";
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class FordController {
|
|||
len = inputStream.read(buffer);
|
||||
}
|
||||
inputStream.close();
|
||||
}catch(Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ public class KeyAreaController {
|
|||
|
||||
/**
|
||||
* 根据区域类型查询全部区域列表的最新时间的人数
|
||||
*
|
||||
* @param type1
|
||||
* @param type2
|
||||
* @param type3
|
||||
|
@ -47,10 +48,10 @@ public class KeyAreaController {
|
|||
*/
|
||||
@GetMapping("selectKeyAreaList")
|
||||
@ApiOperation("根据区域类型查询全部区域列表的最新时间的人数")
|
||||
public Result selectKeyAreaList(String type1,String type2,String type3){
|
||||
public Result selectKeyAreaList(String type1, String type2, String type3) {
|
||||
PassengerFlow maxId = passengerFlowMapper.getByMaxId();
|
||||
String timeId = maxId.getTimeId();
|
||||
List<KeyAreaDto> keyAreaDtos = keyAreaMapper.selectKeyAreaList(type1,type2,type3,timeId);
|
||||
List<KeyAreaDto> keyAreaDtos = keyAreaMapper.selectKeyAreaList(type1, type2, type3, timeId);
|
||||
keyAreaDtos.forEach(keyAreaDto -> {
|
||||
keyAreaDto.setTimeId(timeId);
|
||||
});
|
||||
|
@ -60,15 +61,16 @@ public class KeyAreaController {
|
|||
|
||||
/**
|
||||
* 根据区域类型查询区域的最新时间的人数
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectKeyArea")
|
||||
@ApiOperation("根据区域类型查询区域的最新时间的人数")
|
||||
public Result selectKeyArea(String type){
|
||||
public Result selectKeyArea(String type) {
|
||||
PassengerFlow maxId = passengerFlowMapper.getByMaxId();
|
||||
String timeId = maxId.getTimeId();
|
||||
List<KeyAreaDto> keyAreaDtos = keyAreaMapper.selectKeyArea(type,timeId);
|
||||
List<KeyAreaDto> keyAreaDtos = keyAreaMapper.selectKeyArea(type, timeId);
|
||||
keyAreaDtos.forEach(keyAreaDto -> {
|
||||
keyAreaDto.setTimeId(timeId);
|
||||
});
|
||||
|
@ -78,12 +80,13 @@ public class KeyAreaController {
|
|||
|
||||
/**
|
||||
* 根据名称查询商圈范围
|
||||
*
|
||||
* @param areaName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByAreaName")
|
||||
@ApiOperation("根据名称查询商圈范围")
|
||||
public Result selectByAreaName(String areaName){
|
||||
public Result selectByAreaName(String areaName) {
|
||||
List<KeyAreaLocation> keyAreaLocations = keyAreaMapper.selectByAreaName(areaName);
|
||||
Result success = Result.success(keyAreaLocations);
|
||||
return success;
|
||||
|
@ -91,13 +94,14 @@ public class KeyAreaController {
|
|||
|
||||
/**
|
||||
* 根据名称查询重点区域名称
|
||||
*
|
||||
* @param areaName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByLikeName")
|
||||
@ApiOperation("根据名称查询重点区域名称")
|
||||
@ApiImplicitParam(name = "areaName",value = "重点区域名称",required = true,dataType = "String")
|
||||
public Result selectByLikeName(String areaName){
|
||||
@ApiImplicitParam(name = "areaName", value = "重点区域名称", required = true, dataType = "String")
|
||||
public Result selectByLikeName(String areaName) {
|
||||
List<KeyArea> keyAreaLocations = keyAreaMapper.selectByLikeName(areaName);
|
||||
Result success = Result.success(keyAreaLocations);
|
||||
return success;
|
||||
|
@ -105,6 +109,7 @@ public class KeyAreaController {
|
|||
|
||||
/**
|
||||
* 重点区域场景查询所有事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByAreaEvent")
|
||||
|
@ -113,27 +118,27 @@ public class KeyAreaController {
|
|||
@ApiImplicitParam(name = "page", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Integer")
|
||||
})
|
||||
public Result selectByAreaEvent(Integer page,Integer pageSize){
|
||||
List<EventDto> events = keyAreaMapper.selectByAreaEvent(page,pageSize);
|
||||
public Result selectByAreaEvent(Integer page, Integer pageSize) {
|
||||
List<EventDto> events = keyAreaMapper.selectByAreaEvent(page, pageSize);
|
||||
events.forEach(event -> {
|
||||
if (event.getEventCnName().equals("街头伞篷") || event.getEventCnName().equals("水果和食品摊")
|
||||
|| event.getEventCnName().equals("地摊")|| event.getEventCnName().equals("户外桌椅")){
|
||||
|| event.getEventCnName().equals("地摊") || event.getEventCnName().equals("户外桌椅")) {
|
||||
event.setEventNewName("占道经营");
|
||||
}else if (event.getEventCnName().equals("纸箱")|| event.getEventCnName().equals("街头散落垃圾")
|
||||
||event.getEventCnName().equals("塑料篮子")){
|
||||
} else if (event.getEventCnName().equals("纸箱") || event.getEventCnName().equals("街头散落垃圾")
|
||||
|| event.getEventCnName().equals("塑料篮子")) {
|
||||
event.setEventNewName("环境卫生");
|
||||
}else if (event.getEventCnName().equals("沿街晾晒衣物被单")){
|
||||
} else if (event.getEventCnName().equals("沿街晾晒衣物被单")) {
|
||||
event.setEventNewName("沿街晾晒");
|
||||
}else if (event.getEventCnName().equals("机动车违停")){
|
||||
} else if (event.getEventCnName().equals("机动车违停")) {
|
||||
event.setEventNewName("违章停车");
|
||||
}else {
|
||||
} else {
|
||||
event.setEventNewName(event.getEventCnName());
|
||||
}
|
||||
});
|
||||
Integer integer = keyAreaMapper.selectCountAreaEvent();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("events",events);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("events", events);
|
||||
Result success = Result.success(map);
|
||||
|
||||
return success;
|
||||
|
@ -141,30 +146,31 @@ public class KeyAreaController {
|
|||
|
||||
/**
|
||||
* 重点区域场景查询当天事件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByDayAreaEvent")
|
||||
@ApiOperation("重点区域场景查询当天事件")
|
||||
public Result selectByDayAreaEvent(){
|
||||
public Result selectByDayAreaEvent() {
|
||||
List<EventDto> events = keyAreaMapper.selectByDayAreaEvent();
|
||||
events.forEach(event -> {
|
||||
if (event.getEventCnName().equals("街头伞篷") || event.getEventCnName().equals("水果和食品摊")
|
||||
|| event.getEventCnName().equals("地摊")|| event.getEventCnName().equals("户外桌椅")){
|
||||
|| event.getEventCnName().equals("地摊") || event.getEventCnName().equals("户外桌椅")) {
|
||||
event.setEventNewName("占道经营");
|
||||
}else if (event.getEventCnName().equals("纸箱")|| event.getEventCnName().equals("街头散落垃圾")
|
||||
||event.getEventCnName().equals("塑料篮子")){
|
||||
} else if (event.getEventCnName().equals("纸箱") || event.getEventCnName().equals("街头散落垃圾")
|
||||
|| event.getEventCnName().equals("塑料篮子")) {
|
||||
event.setEventNewName("环境卫生");
|
||||
}else if (event.getEventCnName().equals("沿街晾晒衣物被单")){
|
||||
} else if (event.getEventCnName().equals("沿街晾晒衣物被单")) {
|
||||
event.setEventNewName("沿街晾晒");
|
||||
}else if (event.getEventCnName().equals("机动车违停")){
|
||||
} else if (event.getEventCnName().equals("机动车违停")) {
|
||||
event.setEventNewName("违章停车");
|
||||
}else {
|
||||
} else {
|
||||
event.setEventNewName(event.getEventCnName());
|
||||
}
|
||||
});
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",events.size());
|
||||
map.put("events",events);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", events.size());
|
||||
map.put("events", events);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
|
||||
|
@ -172,50 +178,51 @@ public class KeyAreaController {
|
|||
|
||||
/**
|
||||
* 重点区域场景根据事件名称查询事件
|
||||
*
|
||||
* @param eventNewName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByNameAreaEvent")
|
||||
@ApiOperation("重点区域场景根据事件名称查询事件")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "eventNewName",value = "事件名称",required = true,dataType = "String"),
|
||||
@ApiImplicitParam(name = "eventNewName", value = "事件名称", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "page", value = "页码", required = false, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "页码大小", required = false, dataType = "Integer")
|
||||
})
|
||||
public Result selectByNameAreaEvent(String eventNewName,Integer page,Integer pageSize){
|
||||
if (eventNewName.equals("环境卫生")){
|
||||
List<EventDto> lists = keyAreaMapper.selectByNameAreaEvent("'塑料篮子','纸箱','街头散落垃圾'",page,pageSize);
|
||||
lists.forEach(list ->{
|
||||
public Result selectByNameAreaEvent(String eventNewName, Integer page, Integer pageSize) {
|
||||
if (eventNewName.equals("环境卫生")) {
|
||||
List<EventDto> lists = keyAreaMapper.selectByNameAreaEvent("'塑料篮子','纸箱','街头散落垃圾'", page, pageSize);
|
||||
lists.forEach(list -> {
|
||||
list.setEventNewName("环境卫生");
|
||||
});
|
||||
Integer integer = keyAreaMapper.selectCountByNameAreaEvent("'塑料篮子','纸箱','街头散落垃圾'");
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("events",lists);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("events", lists);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}else if (eventNewName.equals("占道经营")){
|
||||
List<EventDto> lists = keyAreaMapper.selectByNameAreaEvent("'街头伞篷','水果和食品摊','地摊','户外桌椅'",page,pageSize);
|
||||
lists.forEach(list ->{
|
||||
} else if (eventNewName.equals("占道经营")) {
|
||||
List<EventDto> lists = keyAreaMapper.selectByNameAreaEvent("'街头伞篷','水果和食品摊','地摊','户外桌椅'", page, pageSize);
|
||||
lists.forEach(list -> {
|
||||
list.setEventNewName("占道经营");
|
||||
});
|
||||
Integer integer = keyAreaMapper.selectCountByNameAreaEvent("'街头伞篷','水果和食品摊','地摊','户外桌椅'");
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("events",lists);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("events", lists);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}else {
|
||||
} else {
|
||||
StringBuilder str = new StringBuilder(eventNewName);
|
||||
String s = str.insert(0, "'").append("'").toString();
|
||||
List<EventDto> lists = keyAreaMapper.selectByNameAreaEvent(s, page, pageSize);
|
||||
lists.forEach(list ->{
|
||||
lists.forEach(list -> {
|
||||
list.setEventNewName(list.getEventCnName());
|
||||
});
|
||||
Integer integer = keyAreaMapper.selectCountByNameAreaEvent(s);
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("events",lists);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("events", lists);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
@ -223,14 +230,15 @@ public class KeyAreaController {
|
|||
|
||||
/**
|
||||
* 查询近30天重点区域视频感知事件时间趋势
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectMonthAreaEvent")
|
||||
@ApiOperation("查询近30天重点区域视频感知事件时间趋势")
|
||||
public Result selectMonthAreaEvent(){
|
||||
public Result selectMonthAreaEvent() {
|
||||
List<KeyAreaDtos> keyAreaDtos = keyAreaMapper.selectMonthAreaEvent();
|
||||
keyAreaDtos.forEach(keyAreaDtos1 -> {
|
||||
if (keyAreaDtos1.getNumber() == null){
|
||||
if (keyAreaDtos1.getNumber() == null) {
|
||||
keyAreaDtos1.setNumber(0);
|
||||
}
|
||||
});
|
||||
|
@ -240,24 +248,25 @@ public class KeyAreaController {
|
|||
|
||||
/**
|
||||
* 统计事件类型
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectEventType")
|
||||
@ApiOperation("统计事件类型")
|
||||
public Result selectEventType(){
|
||||
public Result selectEventType() {
|
||||
List<KeyAreaDtos> keyAreaDtos = keyAreaMapper.selectEventType();
|
||||
keyAreaDtos.forEach(keyAreaDtos1 -> {
|
||||
if (keyAreaDtos1.getEventCnName().equals("街头伞篷") || keyAreaDtos1.getEventCnName().equals("水果和食品摊")
|
||||
|| keyAreaDtos1.getEventCnName().equals("地摊")|| keyAreaDtos1.getEventCnName().equals("户外桌椅")){
|
||||
|| keyAreaDtos1.getEventCnName().equals("地摊") || keyAreaDtos1.getEventCnName().equals("户外桌椅")) {
|
||||
keyAreaDtos1.setEventNewName("占道经营");
|
||||
}else if (keyAreaDtos1.getEventCnName().equals("纸箱")|| keyAreaDtos1.getEventCnName().equals("街头散落垃圾")
|
||||
||keyAreaDtos1.getEventCnName().equals("塑料篮子")){
|
||||
} else if (keyAreaDtos1.getEventCnName().equals("纸箱") || keyAreaDtos1.getEventCnName().equals("街头散落垃圾")
|
||||
|| keyAreaDtos1.getEventCnName().equals("塑料篮子")) {
|
||||
keyAreaDtos1.setEventNewName("环境卫生");
|
||||
}else if (keyAreaDtos1.getEventCnName().equals("沿街晾晒衣物被单")){
|
||||
} else if (keyAreaDtos1.getEventCnName().equals("沿街晾晒衣物被单")) {
|
||||
keyAreaDtos1.setEventNewName("沿街晾晒");
|
||||
}else if (keyAreaDtos1.getEventCnName().equals("机动车违停")){
|
||||
} else if (keyAreaDtos1.getEventCnName().equals("机动车违停")) {
|
||||
keyAreaDtos1.setEventNewName("违章停车");
|
||||
}else {
|
||||
} else {
|
||||
keyAreaDtos1.setEventNewName(keyAreaDtos1.getEventCnName());
|
||||
}
|
||||
});
|
||||
|
@ -267,14 +276,15 @@ public class KeyAreaController {
|
|||
|
||||
/**
|
||||
* 查询近7天重点区域本地外地人流峰值按每一天输出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectLocalWeekArea")
|
||||
@ApiOperation("查询近7天重点区域本地外地人流峰值按每一天输出")
|
||||
public Result selectLocalWeekArea(String areaName){
|
||||
public Result selectLocalWeekArea(String areaName) {
|
||||
List<KeyAreaDtos> keyAreaDtos = keyAreaMapper.selectLocalWeekArea(areaName);
|
||||
keyAreaDtos.forEach(keyAreaDtos1 -> {
|
||||
if (keyAreaDtos1.getLocalNums() == null && keyAreaDtos1.getNonlocalNums() == null){
|
||||
if (keyAreaDtos1.getLocalNums() == null && keyAreaDtos1.getNonlocalNums() == null) {
|
||||
keyAreaDtos1.setLocalNums(0);
|
||||
keyAreaDtos1.setNonlocalNums(0);
|
||||
}
|
||||
|
@ -285,14 +295,15 @@ public class KeyAreaController {
|
|||
|
||||
/**
|
||||
* 查询近30天重点区域本地外地人流峰值按每一天输出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectLocalMonthArea")
|
||||
@ApiOperation("查询近30天重点区域本地外地人流峰值按每一天输出")
|
||||
public Result selectLocalMonthArea(String areaName){
|
||||
public Result selectLocalMonthArea(String areaName) {
|
||||
List<KeyAreaDtos> keyAreaDtos = keyAreaMapper.selectLocalMonthArea(areaName);
|
||||
keyAreaDtos.forEach(keyAreaDtos1 -> {
|
||||
if (keyAreaDtos1.getLocalNums() == null && keyAreaDtos1.getNonlocalNums() == null){
|
||||
if (keyAreaDtos1.getLocalNums() == null && keyAreaDtos1.getNonlocalNums() == null) {
|
||||
keyAreaDtos1.setLocalNums(0);
|
||||
keyAreaDtos1.setNonlocalNums(0);
|
||||
}
|
||||
|
@ -303,11 +314,12 @@ public class KeyAreaController {
|
|||
|
||||
/**
|
||||
* 查询重点区域抓图照片
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByAreaImage")
|
||||
@ApiOperation("查询重点区域抓图照片")
|
||||
public Result selectByAreaImage(String areaName){
|
||||
public Result selectByAreaImage(String areaName) {
|
||||
List<KeyAreaDto> keyAreaDtos = keyAreaMapper.selectByAreaImage(areaName);
|
||||
Result success = Result.success(keyAreaDtos);
|
||||
return success;
|
||||
|
|
|
@ -23,11 +23,12 @@ public class PassengerTestController {
|
|||
|
||||
/**
|
||||
* 查询全部人流测试点
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectPassengerTest")
|
||||
@ApiOperation("查询全部人流测试点")
|
||||
public Result selectPassengerTest(){
|
||||
public Result selectPassengerTest() {
|
||||
QueryWrapper<PassengerTest> queryWrapper = new QueryWrapper<>();
|
||||
List<PassengerTest> passengerTests = passengerTestMapper.selectList(queryWrapper);
|
||||
Result success = Result.success(passengerTests);
|
||||
|
|
|
@ -26,13 +26,14 @@ public class PeopleRecognizeController {
|
|||
|
||||
/**
|
||||
* 查询全部安保区域人流
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectPeopleRecognize")
|
||||
@ApiOperation("查询全部安保区域人流")
|
||||
public Result selectPeopleRecognize(){
|
||||
public Result selectPeopleRecognize() {
|
||||
List<PeopleRecognizeDto> lists = peopleRecognizeMapper.selectPeopleRecognize();
|
||||
for (PeopleRecognizeDto list :lists) {
|
||||
for (PeopleRecognizeDto list : lists) {
|
||||
String nodeName = list.getNodeName();
|
||||
list.setNewNodeName(nodeName);
|
||||
String[] splits = nodeName.split("->");
|
||||
|
@ -44,7 +45,7 @@ public class PeopleRecognizeController {
|
|||
}
|
||||
|
||||
@GetMapping("recover")
|
||||
public Object recover(){
|
||||
public Object recover() {
|
||||
monitorService.peopleRecognize();
|
||||
return "finish recover";
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public class QidiController {
|
|||
//道路统计数据与排名
|
||||
@GetMapping("roadData")
|
||||
@ApiOperation("道路统计数据与排名,根据后台dt调用接口")
|
||||
public List<Map> roadData(){
|
||||
public List<Map> roadData() {
|
||||
return roadDataService.roadData();
|
||||
}
|
||||
|
||||
|
@ -70,60 +70,61 @@ public class QidiController {
|
|||
//登录
|
||||
@GetMapping("qidiToken")
|
||||
@ApiOperation("启迪数据中台登录获取token")
|
||||
public String qidiToken(){
|
||||
public String qidiToken() {
|
||||
return qidiService.qidiToken();
|
||||
}
|
||||
|
||||
//渣土车轨迹数据
|
||||
@GetMapping("resCatalogApplyZTYS")
|
||||
@ApiOperation("获取渣土车轨迹数据,根据后台UPLOADTIME调用接口")
|
||||
public List<Map> resCatalogApply(){
|
||||
public List<Map> resCatalogApply() {
|
||||
return qidiService.resCatalogApplyZTYS();
|
||||
}
|
||||
|
||||
//环卫车轨迹数据
|
||||
@GetMapping("resCatalogApplyHJWS")
|
||||
@ApiOperation("环卫车轨迹数据,根据后台updatetime调用接口")
|
||||
public List<Map> resCatalogApplyHJWS(){
|
||||
public List<Map> resCatalogApplyHJWS() {
|
||||
return qidiService.resCatalogApplyHJWS();
|
||||
}
|
||||
|
||||
//工地信息
|
||||
@GetMapping("resCatalogApplyGDYS")
|
||||
@ApiOperation("获取工地信息-表中获取")
|
||||
public List<Map> resCatalogApplyGDYS(){
|
||||
public List<Map> resCatalogApplyGDYS() {
|
||||
return qidiService.resCatalogApplyGDYS();
|
||||
}
|
||||
|
||||
//环卫车辆数据1,基础
|
||||
@GetMapping("resCatalogApplyHJWSBase")
|
||||
@ApiOperation("环卫车辆数据1,基础--根据后台updatetime调用接口")
|
||||
public List<Map> resCatalogApplyHJWSBase(){
|
||||
public List<Map> resCatalogApplyHJWSBase() {
|
||||
return qidiService.resCatalogApplyHJWSBase();
|
||||
}
|
||||
|
||||
//环卫车辆数据1,作业
|
||||
@GetMapping("resCatalogApplyHJWSZY")
|
||||
@ApiOperation("环卫车辆数据1,作业--根据后台ZYRQ调用接口")
|
||||
public List<Map> resCatalogApplyHJWSZY(){
|
||||
public List<Map> resCatalogApplyHJWSZY() {
|
||||
return qidiService.resCatalogApplyHJWSZY();
|
||||
}
|
||||
|
||||
//环卫道路明细数据
|
||||
@GetMapping("resCatalogApplyHJWSRoad")
|
||||
@ApiOperation("环卫道路明细数据,根据后台updatetime调用接口")
|
||||
public List<Map> resCatalogApplyHJWSRoad(){
|
||||
public List<Map> resCatalogApplyHJWSRoad() {
|
||||
return qidiService.resCatalogApplyHJWSRoad();
|
||||
}
|
||||
|
||||
//获取渣土车轨迹并保存到t_trail_sediment
|
||||
@GetMapping(value = "saveResCatalogApplyZTYS")
|
||||
@ApiOperation("取渣土车轨迹并保存到t_trail_sediment,根据后台UPLOADTIME调用接口")
|
||||
public Result resCatalogApplyZTYS(){
|
||||
public Result resCatalogApplyZTYS() {
|
||||
|
||||
boolean result = sedimentTrailService.batchSaveSedimentTrail();
|
||||
if(result){
|
||||
boolean result = sedimentTrailService.batchSaveSedimentTrail();
|
||||
if (result) {
|
||||
return Result.success();
|
||||
}else{
|
||||
} else {
|
||||
return Result.error(String.valueOf(result));
|
||||
}
|
||||
}
|
||||
|
@ -132,29 +133,28 @@ public class QidiController {
|
|||
@GetMapping(value = "listSedimentTrailByPoints")
|
||||
@ApiOperation("渣土车轨迹信息,根据经纬度和半径从表中查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query",required = true,dataType ="double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query",required = true,dataType ="double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", paramType = "query",required = true,dataType ="Integer"),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间,2021-08-03 10:17:23", paramType = "query",required = true,dataType ="string"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间,2021-08-03 12:17:23", paramType = "query",required = true,dataType ="string")
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query", required = true, dataType = "double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query", required = true, dataType = "double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间,2021-08-03 10:17:23", paramType = "query", required = true, dataType = "string"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间,2021-08-03 12:17:23", paramType = "query", required = true, dataType = "string")
|
||||
})
|
||||
public Result listSedimentTrailByPoints(
|
||||
@RequestParam(value="longitude") double longitude,
|
||||
@RequestParam(value="latitude") double latitude,
|
||||
@RequestParam(value="radius") Integer radius,
|
||||
@RequestParam(value="start") String start,
|
||||
@RequestParam(value = "longitude") double longitude,
|
||||
@RequestParam(value = "latitude") double latitude,
|
||||
@RequestParam(value = "radius") Integer radius,
|
||||
@RequestParam(value = "start") String start,
|
||||
@RequestParam(value = "end") String end
|
||||
){
|
||||
List<SedimentTrail> map = sedimentTrailService.listSedimentTrailByPoints(longitude,latitude,radius,start,end);
|
||||
) {
|
||||
List<SedimentTrail> map = sedimentTrailService.listSedimentTrailByPoints(longitude, latitude, radius, start, end);
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//测试获取最新的客流列表,从接口获取
|
||||
@GetMapping("passengerFlow")
|
||||
@ApiOperation("获取最新的客流列表,测试接口,调用接口获取")
|
||||
public List<Map> passengerFlow(){
|
||||
public List<Map> passengerFlow() {
|
||||
List<Map> list = passengerFlowService.passengerFlow();
|
||||
return list;
|
||||
}
|
||||
|
@ -162,15 +162,16 @@ public class QidiController {
|
|||
//获取最新的实时客流列表,从表获取
|
||||
@GetMapping("listPassengerFlow")
|
||||
@ApiOperation("获取最新的实时客流列表,从表获取,热力图")
|
||||
@ApiImplicitParam(name="timeId",value = "时间点",required = false,paramType = "query",dataType = "string")
|
||||
public List<PassengerFlow> listPassengerFlow(@RequestParam(value="timeId",required = false,defaultValue = "1970000000") String timeId){
|
||||
@ApiImplicitParam(name = "timeId", value = "时间点", required = false, paramType = "query", dataType = "string")
|
||||
public List<PassengerFlow> listPassengerFlow(@RequestParam(value = "timeId", required = false, defaultValue = "1970000000") String timeId) {
|
||||
List<PassengerFlow> list = passengerFlowService.listPassengerFlow(timeId);
|
||||
return list;
|
||||
}
|
||||
|
||||
//从表中获取最新的客流列表,并筛选出all_nums >=5000的
|
||||
@GetMapping("listPassengerFlowByAllNums")
|
||||
@ApiOperation("从表中获取最新的客流列表,并筛选出all_nums >=5000的")
|
||||
public List<PassengerFlow> listPassengerFlowByAllNums(){
|
||||
public List<PassengerFlow> listPassengerFlowByAllNums() {
|
||||
List<PassengerFlow> list = passengerFlowService.listPassengerFlowByAllNums();
|
||||
return list;
|
||||
}
|
||||
|
@ -178,12 +179,12 @@ public class QidiController {
|
|||
//获取实时客流并保存到表t_passenger_flow
|
||||
@GetMapping("savePassengerFlow")
|
||||
@ApiOperation("获取实时客流并保存到表t_passenger_flow,调用接口")
|
||||
public Result savePassengerFlow(){
|
||||
public Result savePassengerFlow() {
|
||||
List<Map> list = passengerFlowService.passengerFlow();
|
||||
boolean result = passengerFlowService.savePassengerFlow(list);
|
||||
if(result){
|
||||
if (result) {
|
||||
return Result.success();
|
||||
}else{
|
||||
} else {
|
||||
return Result.error(String.valueOf(result));
|
||||
}
|
||||
}
|
||||
|
@ -192,22 +193,23 @@ public class QidiController {
|
|||
@GetMapping("getPassengerNum")
|
||||
@ApiOperation("查询游客总数,根据经纬度和半径米、timeId从表中查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query",required = false,dataType ="double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query",required = false,dataType ="double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", paramType = "query",required = false,dataType ="Integer"),
|
||||
@ApiImplicitParam(name = "timeId", value = "时间点,202205101600", paramType = "query",required = true,dataType ="string"),
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query", required = false, dataType = "double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query", required = false, dataType = "double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", paramType = "query", required = false, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "timeId", value = "时间点,202205101600", paramType = "query", required = true, dataType = "string"),
|
||||
})
|
||||
public Result getPassengerNum(
|
||||
@RequestParam(value="longitude",required = false,defaultValue = "0.00") double longitude,
|
||||
@RequestParam(value="latitude",required = false,defaultValue = "0.00") double latitude,
|
||||
@RequestParam(value="radius",required = false,defaultValue = "0") Integer radius,
|
||||
@RequestParam(value="timeId",required = true) String timeId
|
||||
){
|
||||
return Result.success(passengerFlowService.passengerNums(longitude,latitude,radius,timeId));
|
||||
@RequestParam(value = "longitude", required = false, defaultValue = "0.00") double longitude,
|
||||
@RequestParam(value = "latitude", required = false, defaultValue = "0.00") double latitude,
|
||||
@RequestParam(value = "radius", required = false, defaultValue = "0") Integer radius,
|
||||
@RequestParam(value = "timeId", required = true) String timeId
|
||||
) {
|
||||
return Result.success(passengerFlowService.passengerNums(longitude, latitude, radius, timeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询半径范围内格栅
|
||||
*
|
||||
* @param longitude
|
||||
* @param latitude
|
||||
* @param radius
|
||||
|
@ -217,14 +219,14 @@ public class QidiController {
|
|||
@GetMapping("selectPassenger")
|
||||
@ApiOperation("查询半径范围内格栅,根据经纬度和半径米、timeId从表中查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query",required = false,dataType ="double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query",required = false,dataType ="double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", paramType = "query",required = false,dataType ="Integer"),
|
||||
@ApiImplicitParam(name = "timeId", value = "时间点,202205101600", paramType = "query",required = true,dataType ="string"),
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query", required = false, dataType = "double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query", required = false, dataType = "double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", paramType = "query", required = false, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "timeId", value = "时间点,202205101600", paramType = "query", required = true, dataType = "string"),
|
||||
})
|
||||
public Result selectPassenger(Double longitude,Double latitude,Integer radius,String timeId){
|
||||
public Result selectPassenger(Double longitude, Double latitude, Integer radius, String timeId) {
|
||||
double[] around = LongLatUtil.getAround(longitude, latitude, radius);
|
||||
List<PassengerFlowDto> c = passengerFlowlMapper.selectPassenger(around[0], around[2], around[1], around[3],timeId);
|
||||
List<PassengerFlowDto> c = passengerFlowlMapper.selectPassenger(around[0], around[2], around[1], around[3], timeId);
|
||||
Result success = Result.success(c);
|
||||
return success;
|
||||
}
|
||||
|
@ -232,11 +234,11 @@ public class QidiController {
|
|||
//查询并保存环卫车轨迹到表t_trail_sanitation
|
||||
@GetMapping("saveTrailSanitation")
|
||||
@ApiOperation("保存环卫车轨迹到表t_trail_sanitation,根据后台updatetime调用接口")
|
||||
public Result saveTrailSanitation(){
|
||||
public Result saveTrailSanitation() {
|
||||
boolean result = trailSanitationService.saveTrailSanitation();
|
||||
if(result){
|
||||
if (result) {
|
||||
return Result.success();
|
||||
}else{
|
||||
} else {
|
||||
return Result.error(String.valueOf(result));
|
||||
}
|
||||
}
|
||||
|
@ -245,30 +247,31 @@ public class QidiController {
|
|||
@GetMapping(value = "listTrailSanitationByPoints")
|
||||
@ApiOperation("查询范围内环卫车轨迹信息,根据经纬度、半径米,时间从表中查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query",required = true,dataType ="double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query",required = true,dataType ="double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", paramType = "query",required = true,dataType ="Integer"),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间,2021-03-17 00:00:00", paramType = "query",required = true,dataType ="string"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间,2021-03-22 00:00:00", paramType = "query",required = true,dataType ="string"),
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query", required = true, dataType = "double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query", required = true, dataType = "double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间,2021-03-17 00:00:00", paramType = "query", required = true, dataType = "string"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间,2021-03-22 00:00:00", paramType = "query", required = true, dataType = "string"),
|
||||
})
|
||||
public Result listTrailSanitationByPoints(
|
||||
@RequestParam(value="longitude") double longitude,
|
||||
@RequestParam(value="latitude") double latitude,
|
||||
@RequestParam(value="radius") Integer radius,
|
||||
@RequestParam(value="start") String start,
|
||||
@RequestParam(value = "longitude") double longitude,
|
||||
@RequestParam(value = "latitude") double latitude,
|
||||
@RequestParam(value = "radius") Integer radius,
|
||||
@RequestParam(value = "start") String start,
|
||||
@RequestParam(value = "end") String end
|
||||
){
|
||||
List<TrailSanitation> list = trailSanitationService.listSedimentTrailByPoints(longitude,latitude,radius,start,end);
|
||||
) {
|
||||
List<TrailSanitation> list = trailSanitationService.listSedimentTrailByPoints(longitude, latitude, radius, start, end);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部环卫车轨迹信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectAllTrailSanitation")
|
||||
@ApiOperation("查询全部环卫车轨迹信息")
|
||||
public Result selectAllTrailSanitation(){
|
||||
public Result selectAllTrailSanitation() {
|
||||
List<TrailSanitation> trailSanitations = trailSanitationMapper.selectAllTrailSanitation();
|
||||
Result success = Result.success(trailSanitations);
|
||||
return success;
|
||||
|
@ -276,11 +279,12 @@ public class QidiController {
|
|||
|
||||
/**
|
||||
* 查询全部渣土车轨迹信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectAllSedimentTrail")
|
||||
@ApiOperation("查询全部渣土车轨迹信息")
|
||||
public Result selectAllSedimentTrail(){
|
||||
public Result selectAllSedimentTrail() {
|
||||
List<SedimentTrail> trailSanitations = sedimentTrailMapper.selectAllSedimentTrail();
|
||||
Result success = Result.success(trailSanitations);
|
||||
return success;
|
||||
|
@ -288,47 +292,49 @@ public class QidiController {
|
|||
|
||||
//查询道路污染数据
|
||||
//查询道路污染数据,根据dt从表中最新时间的数据
|
||||
@GetMapping(value="listRoadData")
|
||||
@GetMapping(value = "listRoadData")
|
||||
@ApiOperation("查询道路污染数据,根据dt从表中最新时间的数据")
|
||||
public Result listRoadData(){
|
||||
public Result listRoadData() {
|
||||
RoadData byMaxId = roadDataMapper.getByMaxId();
|
||||
String dt = byMaxId.getDt();
|
||||
String dt = byMaxId.getDt();
|
||||
List<RoadData> roadData = roadDataService.listRoadData(dt);
|
||||
roadData.forEach(roadData1 -> {
|
||||
roadData1.setDt(roadData1.getDt().substring(0,10));
|
||||
roadData1.setDt(roadData1.getDt().substring(0, 10));
|
||||
});
|
||||
return Result.success(roadData);
|
||||
}
|
||||
|
||||
//根据输入的日期间隔查询道路污染数据(例如:2022-05-10 00:00:00至2022-05-11 00:00:00)
|
||||
@GetMapping(value="listRoadDataByTimeRegion")
|
||||
@GetMapping(value = "listRoadDataByTimeRegion")
|
||||
@ApiOperation("根据输入的日期间隔查询道路污染数据(例如:2022-05-10 00:00:00至2022-05-11 00:00:00)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "begin", value = "开始日期", paramType = "query", dataType = "string", required = true),
|
||||
@ApiImplicitParam(name = "over", value = "结束日期", paramType = "query", dataType = "string", required = true)
|
||||
})
|
||||
public Result listRoadDataByTimeRegion(String begin, String over){
|
||||
public Result listRoadDataByTimeRegion(String begin, String over) {
|
||||
List<RoadDataDtos> roadDataDtos = roadDataMapper.listRoadDataByTimeRegion(begin, over);
|
||||
roadDataDtos.forEach(roadData1 -> {
|
||||
roadData1.setDt(roadData1.getDt().substring(0,10));
|
||||
roadData1.setDt(roadData1.getDt().substring(0, 10));
|
||||
});
|
||||
return Result.success(roadDataDtos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部道路污染累计事件数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectRoadData")
|
||||
@ApiOperation("查询全部道路污染累计事件数量")
|
||||
public Result selectRoadData(Integer page,Integer pageSize){
|
||||
List<RoadData> roadData = roadDataMapper.selectRoadData(page,pageSize);
|
||||
public Result selectRoadData(Integer page, Integer pageSize) {
|
||||
List<RoadData> roadData = roadDataMapper.selectRoadData(page, pageSize);
|
||||
roadData.forEach(roadData1 -> {
|
||||
roadData1.setDt(roadData1.getDt().substring(0,10));
|
||||
roadData1.setDt(roadData1.getDt().substring(0, 10));
|
||||
});
|
||||
Integer integer = roadDataMapper.selectCountRoadData();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("sum",integer);
|
||||
map.put("roadData",roadData);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sum", integer);
|
||||
map.put("roadData", roadData);
|
||||
Result success = Result.success(map);
|
||||
return success;
|
||||
}
|
||||
|
@ -338,23 +344,24 @@ public class QidiController {
|
|||
@GetMapping(value = "listBuildingSiteByPoints")
|
||||
@ApiOperation("查询工地信息,根据经纬度和半径从表中查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="longitude",value = "经度",paramType = "query",required = true,dataType = "double"),
|
||||
@ApiImplicitParam(name="longitude",value = "经度",paramType = "query",required = true,dataType = "double"),
|
||||
@ApiImplicitParam(name = "radius",value = "半径",paramType = "query",required = true,dataType = "Integer")
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query", required = true, dataType = "double"),
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query", required = true, dataType = "double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径", paramType = "query", required = true, dataType = "Integer")
|
||||
})
|
||||
public Result listBuildingSiteByPoints(double longitude,double latitude,Integer radius){
|
||||
public Result listBuildingSiteByPoints(double longitude, double latitude, Integer radius) {
|
||||
List<BuildingSite> list = new ArrayList<>();
|
||||
list = buildingSitrService.listBuildingSiteByPoints(longitude,latitude,radius);
|
||||
list = buildingSitrService.listBuildingSiteByPoints(longitude, latitude, radius);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部工地信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectBuildSite")
|
||||
@ApiOperation("查询全部工地信息")
|
||||
public Result selectBuildSite(){
|
||||
public Result selectBuildSite() {
|
||||
List<BuildingSite> buildingSites = buildingSiteMapper.selectBuildSite();
|
||||
Result success = Result.success(buildingSites);
|
||||
return success;
|
||||
|
|
|
@ -24,30 +24,30 @@ public class SJZTController {
|
|||
//从接口获取案件数据
|
||||
@GetMapping("listSJZTDatas")
|
||||
@ApiOperation("获取案件数据,根据后台条件调用接口获取")
|
||||
public List<Map> listSJZTDatas(){
|
||||
return sjztService.listSJZTDatas();
|
||||
public List<Map> listSJZTDatas() {
|
||||
return sjztService.listSJZTDatas();
|
||||
}
|
||||
|
||||
//测试保存
|
||||
@GetMapping("batchSaveSJZT")
|
||||
@ApiOperation("测试保存,根据后台条件调用接口获取并保存到表,这个后台条件需要改动,也可能是做成自动任务调度")
|
||||
public void batchSaveSJZT(){
|
||||
public void batchSaveSJZT() {
|
||||
sjztService.batchSave();
|
||||
}
|
||||
|
||||
//从表中查询案件数据,需要根据要求增加条件
|
||||
@GetMapping("listSJZTByDt")
|
||||
@ApiOperation("获取案件数据,根据ajjlsj从表中获取")
|
||||
@ApiImplicitParam(name="ajjlsj",value="案件建立时间,2021-01-01",paramType = "query",required = true,dataType = "string")
|
||||
@ApiImplicitParam(name = "ajjlsj", value = "案件建立时间,2021-01-01", paramType = "query", required = true, dataType = "string")
|
||||
public List<CaseCityLaw> listSJZTByDt(
|
||||
@RequestParam(value="ajjlsj") String ajjlsj
|
||||
){
|
||||
@RequestParam(value = "ajjlsj") String ajjlsj
|
||||
) {
|
||||
return sjztService.listSJZTByDt(ajjlsj);
|
||||
}
|
||||
|
||||
@PostMapping("upStream")
|
||||
@ApiOperation("案件上报,调用接口上报,暂时未测试")
|
||||
public Result upStream(@ApiParam(value="data,直接以json字符串的形式传递",required = true) @RequestBody String data){
|
||||
public Result upStream(@ApiParam(value = "data,直接以json字符串的形式传递", required = true) @RequestBody String data) {
|
||||
System.out.println("案件上报,调用接口上报");
|
||||
return sjztService.upStream(JSONObject.parseObject(data));
|
||||
}
|
||||
|
|
|
@ -25,20 +25,20 @@ public class SanitationController {
|
|||
|
||||
@GetMapping("/saveSantation")
|
||||
@ApiOperation("测试获取环卫车辆基础数据并保存到表中")
|
||||
public Result saveSantation(){
|
||||
public Result saveSantation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/saveSanitationRoad")
|
||||
@ApiOperation("测试获取环卫道路数据并保存到表中")
|
||||
public Result saveSanitationRoad(){
|
||||
public Result saveSanitationRoad() {
|
||||
return sanitationService.saveSanitationRoad();
|
||||
}
|
||||
|
||||
@GetMapping("saveSanitationTask")
|
||||
@ApiOperation("测试获取环卫车作业数据并保存到表中")
|
||||
public Result saveSanitationTask(){
|
||||
public Result saveSanitationTask() {
|
||||
return sanitationService.saveSanitationTask();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public class StaticController {
|
|||
private CameraMapper cameraMapper;
|
||||
|
||||
@RequestMapping("all")
|
||||
public Object all(){
|
||||
public Object all() {
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
//
|
||||
Integer cameraCount = cameraMapper.selectCount(null);
|
||||
|
|
|
@ -16,7 +16,7 @@ public class UserLoginController {
|
|||
private UserLoginService userLoginService;
|
||||
|
||||
@PostMapping("login")
|
||||
public Result login(String username,String password){
|
||||
public Result login(String username, String password) {
|
||||
UserLoginDto login = userLoginService.login(username, password);
|
||||
Result success = Result.success(login);
|
||||
return success;
|
||||
|
|
|
@ -29,11 +29,12 @@ public class WaterPointController {
|
|||
|
||||
/**
|
||||
* 查询积水点列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectWaterPoint")
|
||||
@ApiOperation("查询积水点列表")
|
||||
public Result selectWaterPoint(){
|
||||
public Result selectWaterPoint() {
|
||||
List<WaterPointDto> waterPoints = waterPointMapper.selectWaterPoint();
|
||||
Result success = Result.success(waterPoints);
|
||||
return success;
|
||||
|
@ -41,13 +42,14 @@ public class WaterPointController {
|
|||
|
||||
/**
|
||||
* 查询积水点等级
|
||||
*
|
||||
* @param reportOrigin
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectReportOrigin")
|
||||
@ApiOperation("查询积水点等级")
|
||||
@ApiImplicitParam(name = "reportOrigin",value = "等级标识",required = true,dataType = "String")
|
||||
public Result selectReportOrigin(String reportOrigin){
|
||||
@ApiImplicitParam(name = "reportOrigin", value = "等级标识", required = true, dataType = "String")
|
||||
public Result selectReportOrigin(String reportOrigin) {
|
||||
List<WaterPointDto> waterPoints = waterPointMapper.selectReportOrigin(reportOrigin);
|
||||
Result success = Result.success(waterPoints);
|
||||
return success;
|
||||
|
@ -55,13 +57,14 @@ public class WaterPointController {
|
|||
|
||||
/**
|
||||
* 根据名称查询积水点详细信息
|
||||
*
|
||||
* @param waterPointName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectCameraByName")
|
||||
@ApiOperation("根据名称查询积水点详细信息")
|
||||
@ApiImplicitParam(name = "waterPointName",value = "积水点名称",required = true,dataType = "String")
|
||||
public Result selectCameraByName(String waterPointName){
|
||||
@ApiImplicitParam(name = "waterPointName", value = "积水点名称", required = true, dataType = "String")
|
||||
public Result selectCameraByName(String waterPointName) {
|
||||
List<WaterCameraDto> waterCameras = waterPointMapper.selectCameraByName(waterPointName);
|
||||
Result success = Result.success(waterCameras);
|
||||
return success;
|
||||
|
@ -69,11 +72,12 @@ public class WaterPointController {
|
|||
|
||||
/**
|
||||
* 统计分析积水点市区分布
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectCountWater")
|
||||
@ApiOperation("统计分析积水点市区分布")
|
||||
public Result selectCountWater(){
|
||||
public Result selectCountWater() {
|
||||
List<WaterPointDtos> waterCameras = waterPointMapper.selectCountWater();
|
||||
Result success = Result.success(waterCameras);
|
||||
return success;
|
||||
|
@ -81,11 +85,12 @@ public class WaterPointController {
|
|||
|
||||
/**
|
||||
* 统计分析积水点来源
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectCountWaters")
|
||||
@ApiOperation("统计分析积水点来源")
|
||||
public Result selectCountWaters(){
|
||||
public Result selectCountWaters() {
|
||||
List<WaterPointDtos> waterCameras = waterPointMapper.selectCountWaters();
|
||||
Result success = Result.success(waterCameras);
|
||||
return success;
|
||||
|
@ -93,11 +98,12 @@ public class WaterPointController {
|
|||
|
||||
/**
|
||||
* 统计分析积水点等级
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectCountLevel")
|
||||
@ApiOperation("统计分析积水点等级")
|
||||
public Result selectCountLevel(){
|
||||
public Result selectCountLevel() {
|
||||
List<WaterPointDtos> waterCameras = waterPointMapper.selectCountLevel();
|
||||
Result success = Result.success(waterCameras);
|
||||
return success;
|
||||
|
@ -105,19 +111,20 @@ public class WaterPointController {
|
|||
|
||||
/**
|
||||
* 根据经纬度查询积水点周边监控
|
||||
*
|
||||
* @param longitude
|
||||
* @param latitude
|
||||
* @param radius
|
||||
* @return
|
||||
*/
|
||||
@GetMapping ("selectByLongAndLiti")
|
||||
@GetMapping("selectByLongAndLiti")
|
||||
@ApiOperation("根据经纬度查询积水点周边监控")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "longitude", value = "经度",required = true,dataType ="Double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度",required = true,dataType ="Double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米",required = true,dataType ="Integer"),}
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", required = true, dataType = "Double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度", required = true, dataType = "Double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", required = true, dataType = "Integer"),}
|
||||
)
|
||||
public Result selectByLongAndLiti(Double longitude,Double latitude,Integer radius){
|
||||
public Result selectByLongAndLiti(Double longitude, Double latitude, Integer radius) {
|
||||
double[] around = LongLatUtil.getAround(longitude, latitude, radius);
|
||||
List<WaterPoint> c = waterPointMapper.selectByLongAndLiti(around[0], around[2], around[1], around[3]);
|
||||
Result success = Result.success(c);
|
||||
|
@ -126,11 +133,12 @@ public class WaterPointController {
|
|||
|
||||
/**
|
||||
* 查询交警提供积水点列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectWaterPoliceList")
|
||||
@ApiOperation("查询交警提供积水点列表")
|
||||
public Result selectWaterPoliceList(){
|
||||
public Result selectWaterPoliceList() {
|
||||
List<WaterPointPolice> pointPolices = waterPointMapper.selectWaterPoliceList();
|
||||
Result success = Result.success(pointPolices);
|
||||
return success;
|
||||
|
|
|
@ -7,49 +7,49 @@ import lombok.Data;
|
|||
@Data
|
||||
public class BuildingRecordsDto {
|
||||
|
||||
@ExcelProperty(value = {"工地名称"},index = 0)
|
||||
@ExcelProperty(value = {"工地名称"}, index = 0)
|
||||
private String projectName;//工地名称
|
||||
|
||||
private String gdmc;//工地名称
|
||||
|
||||
@ExcelProperty(value = {"建筑编号"},index = 1)
|
||||
@ExcelProperty(value = {"建筑编号"}, index = 1)
|
||||
private String buildLicense;//建筑编号
|
||||
|
||||
@ExcelProperty(value = {"推送时间"},index = 2)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@ExcelProperty(value = {"推送时间"}, index = 2)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private String pushTime;//推送时间
|
||||
|
||||
@ExcelProperty(value = {"appid"},index = 3)
|
||||
@ExcelProperty(value = {"appid"}, index = 3)
|
||||
private String appid;
|
||||
|
||||
@ExcelProperty(value = {"施工位置"},index = 4)
|
||||
@ExcelProperty(value = {"施工位置"}, index = 4)
|
||||
private String sgwz;//施工位置
|
||||
|
||||
@ExcelProperty(value = {"经度"},index = 5)
|
||||
@ExcelProperty(value = {"经度"}, index = 5)
|
||||
private double jd;//经度
|
||||
|
||||
@ExcelProperty(value = {"纬度"},index = 6)
|
||||
@ExcelProperty(value = {"纬度"}, index = 6)
|
||||
private double wd;//纬度
|
||||
|
||||
@ExcelProperty(value = {"所属区域"},index = 7)
|
||||
@ExcelProperty(value = {"所属区域"}, index = 7)
|
||||
private String ssdq;//所属区域
|
||||
|
||||
@ExcelProperty(value = {"扬尘"},index = 8)
|
||||
@ExcelProperty(value = {"扬尘"}, index = 8)
|
||||
private double pm10;//扬尘
|
||||
|
||||
@ExcelProperty(value = {"噪声"},index = 9)
|
||||
@ExcelProperty(value = {"噪声"}, index = 9)
|
||||
private double noice;//噪声
|
||||
|
||||
@ExcelProperty(value = {"夜间施工"},index = 10)
|
||||
@ExcelProperty(value = {"夜间施工"}, index = 10)
|
||||
private String yjsg;//夜间施工
|
||||
|
||||
@ExcelProperty(value = {"图片路径"},index = 11)
|
||||
@ExcelProperty(value = {"图片路径"}, index = 11)
|
||||
private String picUrl;//图片路径
|
||||
|
||||
@ExcelProperty(value = {"摄像头编号"},index = 12)
|
||||
@ExcelProperty(value = {"摄像头编号"}, index = 12)
|
||||
private String channelCode;//摄像头编号
|
||||
|
||||
@ExcelProperty(value = {"摄像头名称"},index = 13)
|
||||
@ExcelProperty(value = {"摄像头名称"}, index = 13)
|
||||
private String channelName;//摄像头名称
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ public class ChannelPictureDto {
|
|||
|
||||
private String PicUrl;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date insertTime;
|
||||
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class EventDto {
|
|||
|
||||
private String taskId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private String captureTime;
|
||||
|
||||
private String trackEvent;
|
||||
|
|
|
@ -16,7 +16,7 @@ public class PeopleRecognizeDto {
|
|||
|
||||
private Integer personNum;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date insertTime;
|
||||
|
||||
private String gpsX;
|
||||
|
|
|
@ -24,7 +24,7 @@ public class PictureDto {
|
|||
|
||||
private String pic;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date captureTime;
|
||||
|
||||
}
|
||||
|
|
|
@ -33,12 +33,12 @@ public class RoadDataDtos {
|
|||
|
||||
private String points;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd mm:HH:ss", timezone = "GMT+8")
|
||||
private String dt;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd mm:HH:ss", timezone = "GMT+8")
|
||||
private String begin;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd mm:HH:ss", timezone = "GMT+8")
|
||||
private String over;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public class BuildingRecords {
|
|||
@ApiModelProperty("项目建筑批准编号")
|
||||
private String buildLicense;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty("数据上传时间")
|
||||
private LocalDateTime pushTime;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ public class Camera {
|
|||
|
||||
private String latitude;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date captureTime;
|
||||
|
||||
private String pic;
|
||||
|
|
|
@ -26,7 +26,7 @@ public class CaseCityLaw {
|
|||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime ajjlsj;
|
||||
|
||||
private String dzms;
|
||||
|
@ -65,13 +65,13 @@ public class CaseCityLaw {
|
|||
|
||||
private String yzb;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime pqsj;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime ajjssj;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime ajzfsj;
|
||||
|
||||
private String czsxcqjaaqjacqwjayqja;
|
||||
|
|
|
@ -18,7 +18,7 @@ public class ChannelPicture {
|
|||
|
||||
private String PicUrl;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date insertTime;
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class Event {
|
|||
|
||||
private String taskId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private String captureTime;
|
||||
|
||||
private String trackEvent;
|
||||
|
|
|
@ -22,7 +22,7 @@ public class PeopleRecognize {
|
|||
|
||||
private Integer personNum;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date insertTime;
|
||||
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Date;
|
|||
@Data
|
||||
public class Picture {
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd mm:HH:ss", timezone = "GMT+8")
|
||||
private Date captureTime;
|
||||
|
||||
private String pic;
|
||||
|
|
|
@ -16,14 +16,14 @@ public class Result<T> {
|
|||
|
||||
private int count;
|
||||
|
||||
static public Result success(){
|
||||
static public Result success() {
|
||||
return Result.builder()
|
||||
.code(1)
|
||||
.message("success")
|
||||
.build();
|
||||
}
|
||||
|
||||
static public Result success(Object obj){
|
||||
static public Result success(Object obj) {
|
||||
return Result.builder()
|
||||
.code(1)
|
||||
.message("success")
|
||||
|
@ -31,7 +31,7 @@ public class Result<T> {
|
|||
.build();
|
||||
}
|
||||
|
||||
static public Result error(String errMsg){
|
||||
static public Result error(String errMsg) {
|
||||
return Result.builder()
|
||||
.code(0)
|
||||
.message(errMsg)
|
||||
|
|
|
@ -53,7 +53,7 @@ public class RoadData {
|
|||
|
||||
private String points;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd mm:HH:ss", timezone = "GMT+8")
|
||||
private String dt;
|
||||
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public class Sanitation {
|
|||
@ApiModelProperty("驾驶员")
|
||||
private String jsy;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd mm:HH:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty("购买日期")
|
||||
private LocalDateTime gmri;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class SanitationTask {
|
|||
@ApiModelProperty("作业完成率")
|
||||
private double zywcl;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd mm:HH:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty("作业日期")
|
||||
private LocalDateTime zyrq;
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class SanitationTask {
|
|||
@ApiModelProperty("作业GPS点数")
|
||||
private double zygpsds;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd mm:HH:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty("上传时间")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
|
|
|
@ -7,27 +7,27 @@ import java.io.Serializable;
|
|||
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author huangweixiong
|
||||
* @Date 2022-04-19
|
||||
* @Description
|
||||
* @Author huangweixiong
|
||||
* @Date 2022-04-19
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("t_scenic" )
|
||||
public class Scenic implements Serializable {
|
||||
@TableName("t_scenic")
|
||||
public class Scenic implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4864551986417177990L;
|
||||
private static final long serialVersionUID = 4864551986417177990L;
|
||||
|
||||
private Long id;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景区名
|
||||
*/
|
||||
private String jqmc;
|
||||
/**
|
||||
* 景区名
|
||||
*/
|
||||
private String jqmc;
|
||||
|
||||
/**
|
||||
* 管理单位
|
||||
*/
|
||||
private String gldw;
|
||||
/**
|
||||
* 管理单位
|
||||
*/
|
||||
private String gldw;
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.time.LocalDateTime;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("t_trail_sediment")
|
||||
public class SedimentTrail{
|
||||
public class SedimentTrail {
|
||||
|
||||
@TableId
|
||||
private Integer id;
|
||||
|
@ -29,7 +29,7 @@ public class SedimentTrail{
|
|||
|
||||
private String simCardNum;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime uploadtime;
|
||||
|
||||
private String coordinateX;
|
||||
|
@ -40,12 +40,12 @@ public class SedimentTrail{
|
|||
|
||||
private double latitude;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime recordTime;
|
||||
|
||||
private String angle;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private String status;
|
||||
|
|
|
@ -31,7 +31,7 @@ public class TrailSanitation {
|
|||
|
||||
private String wz;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private String fssj;
|
||||
|
||||
private String jd;
|
||||
|
@ -58,7 +58,7 @@ public class TrailSanitation {
|
|||
|
||||
private String gd;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private String updatetime;
|
||||
|
||||
}
|
||||
|
|
|
@ -36,11 +36,11 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
|
|||
|
||||
List<BuildingRecordsDtos> selectMonthPmAndNoice(@Param("buildLicense") String buildLicense);
|
||||
|
||||
List<BuildingRecordsDto> selectRaise(@Param("page") Integer page,@Param("pageSize") Integer pageSize,@Param("startTime")String startTime,@Param("endTime") String endTime);
|
||||
List<BuildingRecordsDto> selectRaise(@Param("page") Integer page, @Param("pageSize") Integer pageSize, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<BuildingRecordsDto> selectNoiceEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
|
||||
List<BuildingRecordsDto> selectNoiceEvent(@Param("page") Integer page, @Param("pageSize") Integer pageSize);
|
||||
|
||||
List<EventDto> selectByAllEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
|
||||
List<EventDto> selectByAllEvent(@Param("page") Integer page, @Param("pageSize") Integer pageSize);
|
||||
|
||||
@Select("select COUNT(*) from t_event te JOIN t_scene_event tse ON te.camera_name = tse.channel_name where te.track_event = 'START' and tse.scene_id = 1 ")
|
||||
Integer selectCountEvent();
|
||||
|
@ -57,9 +57,10 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
|
|||
|
||||
@Select("select * from t_building_site bs LEFT JOIN (select a.*,br.appid,br.noice,br.pm10,br.project_name FROM t_building_records br JOIN (select build_license,MAX(push_time) AS push_time from t_building_records GROUP BY build_license) a ON br.build_license = a.build_license AND br.push_time = a.push_time) b ON b.project_name = bs.gdmc WHERE (bs.jd between #{jd} and #{jd1}) and (bs.wd between #{wd} and #{wd1})")
|
||||
List<BuildingRecordsDto> selectByJdWd(@Param("jd") Double jd,
|
||||
@Param("jd1") Double jd1,
|
||||
@Param("wd") Double wd,
|
||||
@Param("wd1") Double wd1);
|
||||
@Param("jd1") Double jd1,
|
||||
@Param("wd") Double wd,
|
||||
@Param("wd1") Double wd1);
|
||||
|
||||
@Select("select * from t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc where TO_DAYS(push_time) = TO_DAYS(NOW()) AND br.pm10 > 80")
|
||||
List<BuildingRecordsDto> selectByDayRaise();
|
||||
|
||||
|
|
|
@ -50,11 +50,11 @@ public interface CameraChannelMapper extends BaseMapper<CameraChannel> {
|
|||
@Select("select cc.* from t_camera_channel cc " +
|
||||
"where (gps_x between #{gpsX} and #{gpsX1}) and (gps_y between #{gpsY} and #{gpsY1} )")
|
||||
List<CameraChannel> selectAllByGps(@Param("gpsX") Double gpsX,
|
||||
@Param("gpsX1") Double gpsX1,
|
||||
@Param("gpsY") Double gpsY,
|
||||
@Param("gpsY1") Double gpsY1);
|
||||
@Param("gpsX1") Double gpsX1,
|
||||
@Param("gpsY") Double gpsY,
|
||||
@Param("gpsY1") Double gpsY1);
|
||||
|
||||
List<CameraChannelNLDto> selectNLAll(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
|
||||
List<CameraChannelNLDto> selectNLAll(@Param("page") Integer page, @Param("pageSize") Integer pageSize);
|
||||
|
||||
@Select("SELECT * FROM t_camera_channel WHERE channel_code < '009_37021544001321925022' AND channel_code > '009_37021502001321352341' ORDER BY channel_code DESC")
|
||||
List<CameraChannel> selectCameraChannel();
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Select;
|
|||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface ChannelPictureMapper extends BaseMapper<ChannelPicture> {
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||
@Repository
|
||||
public interface EventMapper extends BaseMapper<Event> {
|
||||
|
||||
List<EventDto> selectEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
|
||||
List<EventDto> selectEvent(@Param("page") Integer page, @Param("pageSize") Integer pageSize);
|
||||
|
||||
@Select("select count(*) from t_event where track_event = 'START'")
|
||||
Integer selectCountEvent();
|
||||
|
@ -20,10 +20,10 @@ public interface EventMapper extends BaseMapper<Event> {
|
|||
@Select("SELECT * FROM t_event where TO_DAYS(capture_time) = TO_DAYS(NOW()) AND track_event = 'START'")
|
||||
List<EventDto> selectByTime();
|
||||
|
||||
List<EventDto> selectByName(@Param("eventNewName") String eventNewName,@Param("page") Integer page,@Param("pageSize") Integer pageSize);
|
||||
List<EventDto> selectByName(@Param("eventNewName") String eventNewName, @Param("page") Integer page, @Param("pageSize") Integer pageSize);
|
||||
|
||||
@Select("select count(*) from t_event where track_event = 'START' and event_cn_name in (${eventNewName})")
|
||||
Integer selectCountByName(@Param("eventNewName")String eventNewName);
|
||||
Integer selectCountByName(@Param("eventNewName") String eventNewName);
|
||||
|
||||
@Select("SELECT * FROM t_event where TO_DAYS(capture_time) = TO_DAYS(NOW()) AND event_cn_name in (${eventNewName}) AND track_event = 'START'")
|
||||
List<EventDto> selectByTimeAndName(@Param("eventNewName") String eventNewName);
|
||||
|
|
|
@ -15,9 +15,9 @@ import java.util.List;
|
|||
@Repository
|
||||
public interface KeyAreaMapper extends BaseMapper<KeyArea> {
|
||||
|
||||
List<KeyAreaDto> selectKeyAreaList(@Param("type1") String type1,@Param("type2") String type2,@Param("type3") String type3,@Param("timeId") String timeId);
|
||||
List<KeyAreaDto> selectKeyAreaList(@Param("type1") String type1, @Param("type2") String type2, @Param("type3") String type3, @Param("timeId") String timeId);
|
||||
|
||||
List<KeyAreaDto> selectKeyArea(@Param("type") String type,@Param("timeId") String timeId);
|
||||
List<KeyAreaDto> selectKeyArea(@Param("type") String type, @Param("timeId") String timeId);
|
||||
|
||||
@Select("SELECT * FROM t_key_area_location kal JOIN t_key_area ka ON kal.area_id = ka.area_id WHERE ka.area_name = #{areaName}")
|
||||
List<KeyAreaLocation> selectByAreaName(String areaName);
|
||||
|
@ -25,7 +25,7 @@ public interface KeyAreaMapper extends BaseMapper<KeyArea> {
|
|||
@Select("select * from t_key_area where area_name like concat('%',#{areaName},'%')")
|
||||
List<KeyArea> selectByLikeName(String areaName);
|
||||
|
||||
List<EventDto> selectByAreaEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
|
||||
List<EventDto> selectByAreaEvent(@Param("page") Integer page, @Param("pageSize") Integer pageSize);
|
||||
|
||||
@Select("SELECT COUNT(*) FROM t_event te JOIN t_scene_event tse ON te.camera_name = tse.channel_name WHERE te.track_event = 'START' AND tse.scene_id = 2")
|
||||
Integer selectCountAreaEvent();
|
||||
|
@ -33,10 +33,10 @@ public interface KeyAreaMapper extends BaseMapper<KeyArea> {
|
|||
@Select("SELECT * FROM t_event te JOIN t_scene_event tse ON te.camera_name = tse.channel_name WHERE te.track_event = 'START' AND tse.scene_id = 2 AND TO_DAYS(te.capture_time) = TO_DAYS(NOW())")
|
||||
List<EventDto> selectByDayAreaEvent();
|
||||
|
||||
List<EventDto> selectByNameAreaEvent(@Param("eventNewName") String eventNewName,@Param("page") Integer page,@Param("pageSize") Integer pageSize);
|
||||
List<EventDto> selectByNameAreaEvent(@Param("eventNewName") String eventNewName, @Param("page") Integer page, @Param("pageSize") Integer pageSize);
|
||||
|
||||
@Select("SELECT COUNT(*) FROM t_event te JOIN t_scene_event tse ON te.camera_name = tse.channel_name WHERE te.track_event = 'START' AND tse.scene_id = 2 AND event_cn_name IN (${eventNewName})")
|
||||
Integer selectCountByNameAreaEvent(@Param("eventNewName")String eventNewName);
|
||||
Integer selectCountByNameAreaEvent(@Param("eventNewName") String eventNewName);
|
||||
|
||||
List<KeyAreaDtos> selectMonthAreaEvent();
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ public interface RoadDataMapper extends BaseMapper<RoadData> {
|
|||
|
||||
void batchSave(List<Map> list);
|
||||
|
||||
List<RoadData> selectRoadData(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
|
||||
List<RoadData> selectRoadData(@Param("page") Integer page, @Param("pageSize") Integer pageSize);
|
||||
|
||||
@Select("select count(*) from t_road_data where pm10 > 150")
|
||||
Integer selectCountRoadData();
|
||||
|
|
|
@ -35,9 +35,9 @@ public interface WaterPointMapper extends BaseMapper<WaterPoint> {
|
|||
|
||||
@Select("select * from water_point where (longitude between #{longitude1} and #{longitude2}) and (latitude between #{latitude1} and #{latitude2} ) and audit_flag = '2' and disp_flag in (0,1)")
|
||||
List<WaterPoint> selectByLongAndLiti(@Param("longitude1") Double longitude1,
|
||||
@Param("longitude2") Double longitude2,
|
||||
@Param("latitude1") Double latitude1,
|
||||
@Param("latitude2") Double latitude2);
|
||||
@Param("longitude2") Double longitude2,
|
||||
@Param("latitude1") Double latitude1,
|
||||
@Param("latitude2") Double latitude2);
|
||||
|
||||
@Select("select * from water_point_police")
|
||||
List<WaterPointPolice> selectWaterPoliceList();
|
||||
|
|
|
@ -109,13 +109,13 @@ public class BuildingRecordsService {
|
|||
}
|
||||
|
||||
//导出excel表格
|
||||
public void testHSSF(String startTime,String endTime) throws Exception {
|
||||
public void testHSSF(String startTime, String endTime) throws Exception {
|
||||
// 1. 创建一个工作簿
|
||||
HSSFWorkbook wb = new HSSFWorkbook();
|
||||
// 2. 创建一个工作表
|
||||
HSSFSheet sheet = wb.createSheet();
|
||||
// 3. 获取数据库数据
|
||||
List<BuildingRecordsDto> buildingRecordsDtos = buildingRecordsMapper.selectRaise(null, null,startTime,endTime);
|
||||
List<BuildingRecordsDto> buildingRecordsDtos = buildingRecordsMapper.selectRaise(null, null, startTime, endTime);
|
||||
for (int i = 0; i < buildingRecordsDtos.size(); i++) {
|
||||
// 4. 创建行
|
||||
HSSFRow row = sheet.createRow(i);
|
||||
|
@ -131,7 +131,7 @@ public class BuildingRecordsService {
|
|||
}
|
||||
}
|
||||
// 7.写文件
|
||||
FileOutputStream fos = new FileOutputStream("D:/"+System.currentTimeMillis()+".xls");
|
||||
FileOutputStream fos = new FileOutputStream("D:/" + System.currentTimeMillis() + ".xls");
|
||||
// 8.关闭流
|
||||
wb.write(fos);
|
||||
fos.close();
|
||||
|
|
|
@ -24,15 +24,15 @@ public class BuildingSiteService {
|
|||
@Autowired
|
||||
private BuildingSiteMapper buildingSiteMapper;
|
||||
|
||||
public List<BuildingSite> listBuildingSiteByPoints(double longitude,double latitude,Integer radius){
|
||||
public List<BuildingSite> listBuildingSiteByPoints(double longitude, double latitude, Integer radius) {
|
||||
List<BuildingSite> list = new ArrayList<>();
|
||||
try{
|
||||
double[] points = LongLatUtil.getAround(longitude,latitude,radius);
|
||||
try {
|
||||
double[] points = LongLatUtil.getAround(longitude, latitude, radius);
|
||||
QueryWrapper<BuildingSite> wrapper = new QueryWrapper();
|
||||
wrapper.between("jd",points[0],points[2]).between("wd",points[1],points[3]);
|
||||
wrapper.between("jd", points[0], points[2]).between("wd", points[1], points[3]);
|
||||
list = buildingSiteMapper.selectList(wrapper);
|
||||
}catch (Exception e){
|
||||
log.error("[listBuildingSiteByPoints] Exception:"+e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("[listBuildingSiteByPoints] Exception:" + e.getMessage());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
|
@ -28,12 +28,12 @@ public class CameraChannelService {
|
|||
|
||||
//查询所有摄像头
|
||||
//@Cacheable(value = "fillIn")
|
||||
public String selectAll(){
|
||||
String list = (String)EhcacheUtil.getInstance().get("fillIn", "allCameraList");
|
||||
if(StringUtils.isEmpty(list)){
|
||||
List<CameraChannelDto> cameraChannelDtos = cameraChannelMapper.selectAll();
|
||||
public String selectAll() {
|
||||
String list = (String) EhcacheUtil.getInstance().get("fillIn", "allCameraList");
|
||||
if (StringUtils.isEmpty(list)) {
|
||||
List<CameraChannelDto> cameraChannelDtos = cameraChannelMapper.selectAll();
|
||||
list = JSONObject.toJSONString(cameraChannelDtos);
|
||||
EhcacheUtil.getInstance().put("fillIn", "allCameraList",list);
|
||||
EhcacheUtil.getInstance().put("fillIn", "allCameraList", list);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
|
@ -28,15 +28,15 @@ public class EventService {
|
|||
|
||||
//1.登录
|
||||
//2.获取token
|
||||
public String shangtangToken () {
|
||||
public String shangtangToken() {
|
||||
String url = "http://10.132.191.54:10270/whale-open-api/tenant/token";
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("accessKey","a1ddCV7z7Jhv0SBGx5O3hblO");
|
||||
map.put("secretKey","glIixzORLgoFJz0VdF1aXICR");
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("accessKey", "a1ddCV7z7Jhv0SBGx5O3hblO");
|
||||
map.put("secretKey", "glIixzORLgoFJz0VdF1aXICR");
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try {
|
||||
responseEntity = restTemplate.postForEntity(url,map,JSONObject.class);
|
||||
responseEntity = restTemplate.postForEntity(url, map, JSONObject.class);
|
||||
JSONObject body = responseEntity.getBody();
|
||||
JSONObject data = body.getJSONObject("data");
|
||||
String token = data.getString("token");
|
||||
|
@ -49,7 +49,7 @@ public class EventService {
|
|||
}
|
||||
|
||||
//订阅任务下发接口
|
||||
public JSONObject subscribe(){
|
||||
public JSONObject subscribe() {
|
||||
String token = this.shangtangToken();
|
||||
String url = "http://10.132.191.54:10270/whale-open-api/subscribe";
|
||||
|
||||
|
@ -57,40 +57,40 @@ public class EventService {
|
|||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
|
||||
headers.add("token", token);
|
||||
headers.add("tid","default");
|
||||
headers.add("tid", "default");
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("callBackUrl","http://15.2.23.205:7009/STapi/project/receive");
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("callBackUrl", "http://15.2.23.205:7009/STapi/project/receive");
|
||||
// map.put("certPubKey","");
|
||||
map.put("subscribeType",3);
|
||||
map.put("subscribeType", 3);
|
||||
// map.put("taskId","serial");
|
||||
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(map), headers);
|
||||
try {
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.POST,entity,JSONObject.class);
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.POST, entity, JSONObject.class);
|
||||
JSONObject body = responseEntity.getBody();
|
||||
return body;
|
||||
}catch (Exception e){
|
||||
log.info( "[subscribe] exception:{}",e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.info("[subscribe] exception:{}", e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//事件模板分页查询接口
|
||||
public JSONObject template(){
|
||||
public JSONObject template() {
|
||||
String token = this.shangtangToken();
|
||||
String url = "http://10.132.191.54:10270/whale-open-api/scenario/event/template?pageNum=1&pageSize=1000";
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("token",token);
|
||||
headers.add("tid","default");
|
||||
headers.add("token", token);
|
||||
headers.add("tid", "default");
|
||||
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try {
|
||||
responseEntity = restTemplate.exchange(url,HttpMethod.GET,new HttpEntity<>(headers),JSONObject.class);
|
||||
JSONObject jsonObject = responseEntity.getBody();
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(headers), JSONObject.class);
|
||||
JSONObject jsonObject = responseEntity.getBody();
|
||||
return jsonObject;
|
||||
} catch (Exception e) {
|
||||
log.info("[template] exception:{}", e.getMessage());
|
||||
|
@ -99,30 +99,30 @@ public class EventService {
|
|||
|
||||
}
|
||||
|
||||
public void screenshot(){
|
||||
public void screenshot() {
|
||||
String url = "http://218.58.65.132:2580/api/haixin";
|
||||
String image = "http://120.221.72.8:7002";
|
||||
QueryWrapper<Event> queryWrapper = new QueryWrapper<>();
|
||||
List<Event> events = eventMapper.selectList(queryWrapper);
|
||||
events.forEach(event -> {
|
||||
String key = "NcjzgcBOJaD79xQm";
|
||||
String sign = "cjname=" + event.getEventCnName() + "&datetime=" + event.getCaptureTime() + "&piclatitude=" + event.getLatitude() +
|
||||
"&piclongitude=" + event.getLongitude() + "&resultpicurl1=" + event.getImageUrl()+ "&vidorpic=" + 0 + "&key=" + key;
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("cjname",event.getEventCnName());
|
||||
map.put("datetime",event.getCaptureTime());
|
||||
map.put("vidorpic",0);
|
||||
String sign = "cjname=" + event.getEventCnName() + "&datetime=" + event.getCaptureTime() + "&piclatitude=" + event.getLatitude() +
|
||||
"&piclongitude=" + event.getLongitude() + "&resultpicurl1=" + event.getImageUrl() + "&vidorpic=" + 0 + "&key=" + key;
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("cjname", event.getEventCnName());
|
||||
map.put("datetime", event.getCaptureTime());
|
||||
map.put("vidorpic", 0);
|
||||
String substring = event.getImageUrl().substring(26);
|
||||
map.put("resultpicurl1",image + substring);
|
||||
map.put("piclongitude",event.getLongitude());
|
||||
map.put("piclatitude",event.getLatitude());
|
||||
map.put("resultpicurl1", image + substring);
|
||||
map.put("piclongitude", event.getLongitude());
|
||||
map.put("piclatitude", event.getLatitude());
|
||||
map.put("sign", SecureUtil.md5(sign));
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try {
|
||||
responseEntity = restTemplate.postForEntity(url,map,JSONObject.class);
|
||||
responseEntity = restTemplate.postForEntity(url, map, JSONObject.class);
|
||||
JSONObject body = responseEntity.getBody();
|
||||
System.out.println(body);
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
log.info("[screenshot] exception:{}", e.getMessage());
|
||||
}
|
||||
});
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.util.List;
|
|||
|
||||
@Service
|
||||
@Log4j2
|
||||
public class MonitorService{
|
||||
public class MonitorService {
|
||||
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
|
@ -99,7 +99,7 @@ public class MonitorService{
|
|||
static int keepaliveCount = 16;
|
||||
|
||||
@PostConstruct
|
||||
public void init(){
|
||||
public void init() {
|
||||
|
||||
String loginUrl = monitorDomain + "/videoService/accounts/authorize";
|
||||
HashMap<String, String> loginParam = new HashMap<>();
|
||||
|
@ -111,14 +111,14 @@ public class MonitorService{
|
|||
try {
|
||||
ResponseEntity<HashMap> loginResEntity = restTemplate.postForEntity(loginUrl, loginParam, HashMap.class, new HashMap<>());
|
||||
reponse = loginResEntity.getBody();
|
||||
}catch (HttpClientErrorException e){
|
||||
} catch (HttpClientErrorException e) {
|
||||
if (e.getStatusCode() == HttpStatus.UNAUTHORIZED) {
|
||||
String responseString = e.getResponseBodyAsString();
|
||||
reponse = JSONObject.parseObject(responseString, HashMap.class);
|
||||
}
|
||||
}
|
||||
|
||||
if (reponse == null){
|
||||
if (reponse == null) {
|
||||
log.error("[monitor-capture]:" + "监控系统登录握手失败");
|
||||
throw new RuntimeException("监控系统登录握手失败");
|
||||
}
|
||||
|
@ -126,22 +126,22 @@ public class MonitorService{
|
|||
//登录
|
||||
loginParam.putAll(reponse);
|
||||
String sigin = SecureUtil.md5(password);
|
||||
sigin = SecureUtil.md5(userName+sigin);
|
||||
sigin = SecureUtil.md5(userName + sigin);
|
||||
sigin = SecureUtil.md5(sigin);
|
||||
sigin = SecureUtil.md5(userName+":"+loginParam.get("realm")+":"+sigin);
|
||||
sigin = SecureUtil.md5(sigin+":"+loginParam.get("randomKey"));
|
||||
sigin = SecureUtil.md5(userName + ":" + loginParam.get("realm") + ":" + sigin);
|
||||
sigin = SecureUtil.md5(sigin + ":" + loginParam.get("randomKey"));
|
||||
loginParam.put("signature", sigin);
|
||||
|
||||
reponse = restTemplate.postForEntity(loginUrl, loginParam, HashMap.class, new HashMap<>()).getBody();
|
||||
if (reponse != null){
|
||||
if (reponse != null) {
|
||||
String token = (String) reponse.get("token");
|
||||
if (token== null || StringUtils.isEmpty(token)){
|
||||
if (token == null || StringUtils.isEmpty(token)) {
|
||||
log.error("[monitor-capture]:" + "监控系统登录失败");
|
||||
return;
|
||||
}
|
||||
this.token = token;
|
||||
Integer duration = (Integer) reponse.get("duration");
|
||||
if (duration == null || duration < 20){
|
||||
if (duration == null || duration < 20) {
|
||||
log.error("[monitor-capture]:" + "监控系统失效时间异常" + duration);
|
||||
return;
|
||||
}
|
||||
|
@ -152,27 +152,27 @@ public class MonitorService{
|
|||
|
||||
//会话保活
|
||||
Timer timer = new Timer("monitor-capture-keepalive");
|
||||
timer.scheduleAtFixedRate(new TimerTask(){
|
||||
timer.scheduleAtFixedRate(new TimerTask() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
try{
|
||||
String keepaliveUrl = monitorDomain + "/videoService/accounts/token/keepalive";
|
||||
try {
|
||||
String keepaliveUrl = monitorDomain + "/videoService/accounts/token/keepalive";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("X-Subject-Token",token);
|
||||
headers.add("X-Subject-Token", token);
|
||||
|
||||
HashMap<Object, Object> keepaliveParam = new HashMap<>();
|
||||
keepaliveParam.put("token", token);
|
||||
HttpEntity<Object> httpEntity = new HttpEntity<>(keepaliveParam, headers);
|
||||
restTemplate.put(keepaliveUrl, httpEntity);
|
||||
|
||||
if (keepaliveCount++ > 12){//大概36分钟输出一次日志
|
||||
if (keepaliveCount++ > 12) {//大概36分钟输出一次日志
|
||||
log.info("[monitor-capture]: keepalive success");
|
||||
keepaliveCount = 0;
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
log.info("[monitor-capture]: keepalive faild, restart.....");
|
||||
e.printStackTrace();
|
||||
|
||||
|
@ -204,14 +204,14 @@ public class MonitorService{
|
|||
camera.setPic(picUrl);
|
||||
camera.setCaptureTime(new Date());
|
||||
cameraMapper.updateById(camera);
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +cameraCode + " 截图图片失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + cameraCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: end capture1");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -241,22 +241,22 @@ public class MonitorService{
|
|||
picture.setPicUrl(picUrl);
|
||||
/*picture.setInsertTime(new Date());
|
||||
channelPictureMapper.insert(picture);*/
|
||||
if (channelCode == null){
|
||||
if (channelCode == null) {
|
||||
channelPictureMapper.insert(picture);
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("channel_code", channelCode);
|
||||
picture.setInsertTime(new Date());
|
||||
channelPictureMapper.update(picture, queryWrapper);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: end capture1");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -284,22 +284,22 @@ public class MonitorService{
|
|||
picture.setPicUrl(picUrl);
|
||||
/*picture.setInsertTime(new Date());
|
||||
channelPictureMapper.insert(picture);*/
|
||||
if (channelCode == null){
|
||||
if (channelCode == null) {
|
||||
channelPictureMapper.insert(picture);
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("channel_code", channelCode);
|
||||
picture.setInsertTime(new Date());
|
||||
channelPictureMapper.update(picture, queryWrapper);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: end capture");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -327,22 +327,22 @@ public class MonitorService{
|
|||
picture.setPicUrl(picUrl);
|
||||
/*picture.setInsertTime(new Date());
|
||||
channelPictureMapper.insert(picture);*/
|
||||
if (channelCode == null){
|
||||
if (channelCode == null) {
|
||||
channelPictureMapper.insert(picture);
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("channel_code", channelCode);
|
||||
picture.setInsertTime(new Date());
|
||||
channelPictureMapper.update(picture, queryWrapper);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: end capture");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -398,15 +398,15 @@ public class MonitorService{
|
|||
picture.setPicUrl(picUrl);
|
||||
picture.setInsertTime(new Date());
|
||||
channelPictureMapper.insert(picture);
|
||||
}catch (Exception e){
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
TestCode testCode = new TestCode();
|
||||
testCode.setChannelCode(channelCode);
|
||||
testCodeMapper.insert(testCode);
|
||||
}
|
||||
});
|
||||
log.info("[monitor-capture]: end capture");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -414,7 +414,7 @@ public class MonitorService{
|
|||
/**
|
||||
* 海水浴场人群图片算法识别
|
||||
*/
|
||||
public void bathingBeach () {
|
||||
public void bathingBeach() {
|
||||
try {
|
||||
|
||||
log.info("[monitor-capture]: start capture");
|
||||
|
@ -438,17 +438,17 @@ public class MonitorService{
|
|||
personImage.put("img_base64", imgBase64);
|
||||
ResponseEntity<HashMap> responseEntity = restTemplate.postForEntity(personNumUrl, personImage, HashMap.class);
|
||||
HashMap body = responseEntity.getBody();
|
||||
if (body != null && (Integer) body.get("code") == 200){
|
||||
if (body != null && (Integer) body.get("code") == 200) {
|
||||
Map data = (Map) body.get("data");
|
||||
log.info(picUrl);
|
||||
log.info("人流识别算法" + data);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
log.info("[monitor-capture]: end capture");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -480,7 +480,7 @@ public class MonitorService{
|
|||
personImage.put("img_base64", imgBase64);
|
||||
ResponseEntity<HashMap> responseEntity = restTemplate.postForEntity(personNumUrl, personImage, HashMap.class);
|
||||
HashMap body = responseEntity.getBody();
|
||||
if (body != null && (Integer) body.get("code") == 200){
|
||||
if (body != null && (Integer) body.get("code") == 200) {
|
||||
Map data = (Map) body.get("data");
|
||||
Integer personNum = (Integer) data.get("person_num");
|
||||
PeopleRecognize peopleRecognize = new PeopleRecognize();
|
||||
|
@ -488,21 +488,21 @@ public class MonitorService{
|
|||
peopleRecognize.setChannelName(label.getChannelName());
|
||||
peopleRecognize.setPicUrl(picUrl);
|
||||
peopleRecognize.setPersonNum(personNum);
|
||||
if (channelCode == null){
|
||||
if (channelCode == null) {
|
||||
peopleRecognizeMapper.insert(peopleRecognize);
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<PeopleRecognize> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("channel_code", channelCode);
|
||||
peopleRecognize.setInsertTime(new Date());
|
||||
peopleRecognizeMapper.update(peopleRecognize, queryWrapper);
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
log.info("[monitor-capture]: end capture");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -539,7 +539,7 @@ public class MonitorService{
|
|||
personImage.put("img_base64", imgBase64);
|
||||
ResponseEntity<HashMap> responseEntity = restTemplate.postForEntity(personNumUrl, personImage, HashMap.class);
|
||||
HashMap body = responseEntity.getBody();
|
||||
if (body != null && (Integer) body.get("code") == 200){
|
||||
if (body != null && (Integer) body.get("code") == 200) {
|
||||
Map data = (Map) body.get("data");
|
||||
Integer personNum = (Integer) data.get("person_num");
|
||||
CameraScenic cameraScenic = new CameraScenic();
|
||||
|
@ -547,33 +547,33 @@ public class MonitorService{
|
|||
cameraScenic.setPersonNum(personNum);
|
||||
|
||||
CameraScenic cs = cameraScenicMapper.selectById(cameraCode);
|
||||
if (cs == null){
|
||||
if (cs == null) {
|
||||
cameraScenicMapper.insert(cameraScenic);
|
||||
}else {
|
||||
} else {
|
||||
cameraScenicMapper.updateById(cameraScenic);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +cameraCode + " 人流识别失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + cameraCode + " 人流识别失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: startScenic end capture");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private BufferedImage capturecreenshot(String code) throws IOException {
|
||||
String url = monitorDomain + "/videoService/realmonitor/uri?scheme=HLS&channelId=" + code;
|
||||
String url = monitorDomain + "/videoService/realmonitor/uri?scheme=HLS&channelId=" + code;
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("X-Subject-Token",token);
|
||||
headers.add("X-Subject-Token", token);
|
||||
|
||||
ResponseEntity<HashMap> forEntity = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity(headers), HashMap.class );
|
||||
ResponseEntity<HashMap> forEntity = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity(headers), HashMap.class);
|
||||
|
||||
HashMap body = forEntity.getBody();
|
||||
|
||||
|
@ -593,7 +593,7 @@ public class MonitorService{
|
|||
|
||||
int frameIndex = 60;
|
||||
Java2DFrameConverter converter = new Java2DFrameConverter();
|
||||
while (true){
|
||||
while (true) {
|
||||
Frame frame = grabber.grabImage();
|
||||
if (frame != null) {
|
||||
log.debug("grabber 跳帧:" + frameIndex);
|
||||
|
@ -602,9 +602,9 @@ public class MonitorService{
|
|||
return bufferedImage;
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
}finally {
|
||||
} finally {
|
||||
grabber.stop();
|
||||
grabber.release();
|
||||
}
|
||||
|
@ -612,19 +612,20 @@ public class MonitorService{
|
|||
|
||||
/**
|
||||
* 获取路径返回给前端
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public String fileCode(String code)throws IOException{
|
||||
String url = monitorDomain + "/videoService/realmonitor/uri?scheme=HLS&channelId=" + code;
|
||||
public String fileCode(String code) throws IOException {
|
||||
String url = monitorDomain + "/videoService/realmonitor/uri?scheme=HLS&channelId=" + code;
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("X-Subject-Token",token);
|
||||
headers.add("X-Subject-Token", token);
|
||||
|
||||
System.out.println(token);
|
||||
|
||||
ResponseEntity<HashMap> forEntity = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity(headers), HashMap.class );
|
||||
ResponseEntity<HashMap> forEntity = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity(headers), HashMap.class);
|
||||
|
||||
HashMap body = forEntity.getBody();
|
||||
|
||||
|
@ -639,6 +640,7 @@ public class MonitorService{
|
|||
|
||||
/**
|
||||
* 调用接口获取摄像头和组织
|
||||
*
|
||||
* @param parentId
|
||||
* @param path
|
||||
* @throws IOException
|
||||
|
@ -650,17 +652,17 @@ public class MonitorService{
|
|||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
|
||||
headers.add("X-Subject-Token",token);
|
||||
headers.add("X-Subject-Token", token);
|
||||
|
||||
ResponseEntity<List> forEntity = null;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
try {
|
||||
forEntity = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity(headers), List.class );
|
||||
forEntity = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity(headers), List.class);
|
||||
break;
|
||||
}catch (Exception e){
|
||||
log.error("重试次数:{} url:{}",i,url);
|
||||
} catch (Exception e) {
|
||||
log.error("重试次数:{} url:{}", i, url);
|
||||
log.error(e);
|
||||
Thread.sleep(5*1000);
|
||||
Thread.sleep(5 * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -673,17 +675,17 @@ public class MonitorService{
|
|||
for (Map result : results) {
|
||||
Boolean isParent = (Boolean) result.get("isParent");
|
||||
|
||||
if (isParent){
|
||||
if (isParent) {
|
||||
CameraOrganization cameraOrganization = JSONObject.parseObject(JSONObject.toJSONString(result), CameraOrganization.class);
|
||||
|
||||
cameraOrgenMapper.insert(cameraOrganization);
|
||||
|
||||
videoService((String) result.get("id"),path + sep + result.get("name"));
|
||||
}else {
|
||||
if (result.get("channelId") != null){
|
||||
videoService((String) result.get("id"), path + sep + result.get("name"));
|
||||
} else {
|
||||
if (result.get("channelId") != null) {
|
||||
CameraChannel cameraChannel = JSONObject.parseObject(JSONObject.toJSONString(result), CameraChannel.class);
|
||||
|
||||
String id = (String)result.get("orgCode");
|
||||
String id = (String) result.get("orgCode");
|
||||
|
||||
if (path != null && path.startsWith(sep)) {
|
||||
path = path.substring(sep.length());
|
||||
|
@ -701,68 +703,68 @@ public class MonitorService{
|
|||
}
|
||||
|
||||
//查询视频点播巡检结果
|
||||
@Scheduled(cron="0 5 6 * * ?")
|
||||
public Result listChannelPlayStates(){
|
||||
@Scheduled(cron = "0 5 6 * * ?")
|
||||
public Result listChannelPlayStates() {
|
||||
//获取当前时间和前一天的UTC时间
|
||||
Map<String,Object> condition = new HashMap<>();
|
||||
Map<String, Object> condition = new HashMap<>();
|
||||
ZonedDateTime endUTC = ZonedDateTime.now(ZoneOffset.UTC);
|
||||
ZonedDateTime startUTC = endUTC.minusDays(90);
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMdd'T'HHmmss'Z'");
|
||||
condition.put("checkStatus",0);
|
||||
condition.put("startTime",dateTimeFormatter.format(startUTC));
|
||||
condition.put("endTime",dateTimeFormatter.format(endUTC));
|
||||
condition.put("checkStatus", 0);
|
||||
condition.put("startTime", dateTimeFormatter.format(startUTC));
|
||||
condition.put("endTime", dateTimeFormatter.format(endUTC));
|
||||
//组装查询条件,经过验证pageSize设置过大也没效果,最大512
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("condition",condition);
|
||||
map.put("page",1);
|
||||
map.put("pageSize",500);//最多一次512条
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("condition", condition);
|
||||
map.put("page", 1);
|
||||
map.put("pageSize", 500);//最多一次512条
|
||||
//查询路径和请求头信息
|
||||
String url = monitorDomain + "/nms/api/channel/play/list";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("X-Subject-Token",token);
|
||||
headers.add("X-Subject-Token", token);
|
||||
|
||||
//查询数据的页数
|
||||
int pageCount = 0;
|
||||
//查询结果
|
||||
List<Map> list = new ArrayList<>();
|
||||
|
||||
HttpEntity<Map<String,Object>> request = new HttpEntity<>(map,headers);
|
||||
ResponseEntity<JSONObject> responseEntity = restTemplate.exchange(url, HttpMethod.POST, request, JSONObject.class );
|
||||
HttpEntity<Map<String, Object>> request = new HttpEntity<>(map, headers);
|
||||
ResponseEntity<JSONObject> responseEntity = restTemplate.exchange(url, HttpMethod.POST, request, JSONObject.class);
|
||||
JSONObject entityBody = responseEntity.getBody();
|
||||
if (entityBody.get("i18n") != null && entityBody.get("i18n").toString() == "error"){
|
||||
log.info("{}程序异常{}",entityBody.get("message").toString());
|
||||
if (entityBody.get("i18n") != null && entityBody.get("i18n").toString() == "error") {
|
||||
log.info("{}程序异常{}", entityBody.get("message").toString());
|
||||
}
|
||||
List<Map> results = (List<Map>) entityBody.get("results");
|
||||
if(!results.isEmpty()){
|
||||
if (!results.isEmpty()) {
|
||||
list.addAll(results);
|
||||
pageCount = entityBody.getIntValue("totalCount")/500 + 1;
|
||||
pageCount = entityBody.getIntValue("totalCount") / 500 + 1;
|
||||
}
|
||||
for(int i = 2;i<=pageCount;i++){
|
||||
map.put("page",i);
|
||||
HttpEntity<Map<String,Object>> request2 = new HttpEntity<>(map,headers);
|
||||
ResponseEntity<JSONObject> responseEntity2 = restTemplate.exchange(url, HttpMethod.POST, request2, JSONObject.class );
|
||||
for (int i = 2; i <= pageCount; i++) {
|
||||
map.put("page", i);
|
||||
HttpEntity<Map<String, Object>> request2 = new HttpEntity<>(map, headers);
|
||||
ResponseEntity<JSONObject> responseEntity2 = restTemplate.exchange(url, HttpMethod.POST, request2, JSONObject.class);
|
||||
JSONObject entityBody2 = responseEntity2.getBody();
|
||||
List<Map> results2 = (List<Map>) entityBody2.get("results");
|
||||
log.info("循环次数:" + i);
|
||||
if(!results2.isEmpty()){
|
||||
if (!results2.isEmpty()) {
|
||||
list.addAll(results);
|
||||
}
|
||||
}
|
||||
//通过set对channel_code去重
|
||||
Set<String> set = new HashSet<>();
|
||||
|
||||
for(Map m:list){
|
||||
for (Map m : list) {
|
||||
set.add(m.get("channelCode").toString());
|
||||
}
|
||||
List<String> lists = new ArrayList<>(set.size());
|
||||
lists.addAll(set);
|
||||
//根据channel_code对t_camera_channel表的status字段进行更新(0)
|
||||
List<List<String>> listMap = Lists.partition(lists,100);
|
||||
for(List<String> ll:listMap){
|
||||
List<List<String>> listMap = Lists.partition(lists, 100);
|
||||
for (List<String> ll : listMap) {
|
||||
cameraChannelMapper.updateCameraStatus(ll);
|
||||
}
|
||||
log.info("{} 查询视频点播巡检成功,发现异常数量:{}",LocalDateTime.now(),set.size());
|
||||
return Result.success();
|
||||
log.info("{} 查询视频点播巡检成功,发现异常数量:{}", LocalDateTime.now(), set.size());
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -788,25 +790,26 @@ public class MonitorService{
|
|||
picture.setPicUrl(picUrl);
|
||||
/*picture.setInsertTime(new Date());
|
||||
channelPictureMapper.insert(picture);*/
|
||||
if (channelCode == null){
|
||||
if (channelCode == null) {
|
||||
channelPictureMapper.insert(picture);
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("channel_code", channelCode);
|
||||
picture.setInsertTime(new Date());
|
||||
channelPictureMapper.update(picture, queryWrapper);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: end capture1");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 特定摊点8:50抓图
|
||||
*/
|
||||
|
@ -830,25 +833,26 @@ public class MonitorService{
|
|||
picture.setPicUrl(picUrl);
|
||||
/*picture.setInsertTime(new Date());
|
||||
channelPictureMapper.insert(picture);*/
|
||||
if (channelCode == null){
|
||||
if (channelCode == null) {
|
||||
channelPictureMapper.insert(picture);
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("channel_code", channelCode);
|
||||
picture.setInsertTime(new Date());
|
||||
channelPictureMapper.update(picture, queryWrapper);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: end capture1");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 特定摊点9:50抓图
|
||||
*/
|
||||
|
@ -872,25 +876,26 @@ public class MonitorService{
|
|||
picture.setPicUrl(picUrl);
|
||||
/*picture.setInsertTime(new Date());
|
||||
channelPictureMapper.insert(picture);*/
|
||||
if (channelCode == null){
|
||||
if (channelCode == null) {
|
||||
channelPictureMapper.insert(picture);
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("channel_code", channelCode);
|
||||
picture.setInsertTime(new Date());
|
||||
channelPictureMapper.update(picture, queryWrapper);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: end capture1");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 特定摊点9:20抓图
|
||||
*/
|
||||
|
@ -914,25 +919,26 @@ public class MonitorService{
|
|||
picture.setPicUrl(picUrl);
|
||||
/*picture.setInsertTime(new Date());
|
||||
channelPictureMapper.insert(picture);*/
|
||||
if (channelCode == null){
|
||||
if (channelCode == null) {
|
||||
channelPictureMapper.insert(picture);
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("channel_code", channelCode);
|
||||
picture.setInsertTime(new Date());
|
||||
channelPictureMapper.update(picture, queryWrapper);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: end capture1");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 特定摊点11:20抓图
|
||||
*/
|
||||
|
@ -956,25 +962,26 @@ public class MonitorService{
|
|||
picture.setPicUrl(picUrl);
|
||||
/*picture.setInsertTime(new Date());
|
||||
channelPictureMapper.insert(picture);*/
|
||||
if (channelCode == null){
|
||||
if (channelCode == null) {
|
||||
channelPictureMapper.insert(picture);
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("channel_code", channelCode);
|
||||
picture.setInsertTime(new Date());
|
||||
channelPictureMapper.update(picture, queryWrapper);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: end capture1");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 特定摊点12:20抓图
|
||||
*/
|
||||
|
@ -998,25 +1005,26 @@ public class MonitorService{
|
|||
picture.setPicUrl(picUrl);
|
||||
/*picture.setInsertTime(new Date());
|
||||
channelPictureMapper.insert(picture);*/
|
||||
if (channelCode == null){
|
||||
if (channelCode == null) {
|
||||
channelPictureMapper.insert(picture);
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("channel_code", channelCode);
|
||||
picture.setInsertTime(new Date());
|
||||
channelPictureMapper.update(picture, queryWrapper);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: end capture1");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 特定摊点19:20抓图
|
||||
*/
|
||||
|
@ -1040,25 +1048,26 @@ public class MonitorService{
|
|||
picture.setPicUrl(picUrl);
|
||||
/*picture.setInsertTime(new Date());
|
||||
channelPictureMapper.insert(picture);*/
|
||||
if (channelCode == null){
|
||||
if (channelCode == null) {
|
||||
channelPictureMapper.insert(picture);
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("channel_code", channelCode);
|
||||
picture.setInsertTime(new Date());
|
||||
channelPictureMapper.update(picture, queryWrapper);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: end capture1");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 特定摊点20:20抓图
|
||||
*/
|
||||
|
@ -1082,22 +1091,22 @@ public class MonitorService{
|
|||
picture.setPicUrl(picUrl);
|
||||
/*picture.setInsertTime(new Date());
|
||||
channelPictureMapper.insert(picture);*/
|
||||
if (channelCode == null){
|
||||
if (channelCode == null) {
|
||||
channelPictureMapper.insert(picture);
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("channel_code", channelCode);
|
||||
picture.setInsertTime(new Date());
|
||||
channelPictureMapper.update(picture, queryWrapper);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
log.info("[monitor-capture]: end capture1");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -1123,12 +1132,12 @@ public class MonitorService{
|
|||
QueryWrapper<WCamera> queryWrapper1 = new QueryWrapper<>();
|
||||
queryWrapper1.eq("channel_code", channelCode);
|
||||
wCameraMapper.update(wCamera, queryWrapper1);
|
||||
}catch (Exception e){
|
||||
log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.info("[monitor-capture] " + channelCode + " 截图图片失败 " + e.getMessage());
|
||||
}
|
||||
});
|
||||
log.info("[monitor-capture]: end capture");
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,12 +53,13 @@ public class PassengerFlowService {
|
|||
|
||||
/**
|
||||
* 最新的实时客流
|
||||
*
|
||||
* @param
|
||||
* @return List
|
||||
*/
|
||||
//{"APIKEY":"202204141052331249fcc8-046","ParamJson":{"data":"{\"appId\":\"apitest\",\"mac\":\"f51093001255129b88deba6c5045ee26\",\"timeStamp\":\"20220510152759\",\"hourId\":\"2022051013\",\"timeId\":\"202205101300\"}"}}
|
||||
public List<Map> passengerFlow(){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
public List<Map> passengerFlow() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||
|
||||
LocalDateTime dateNow = LocalDateTime.now();
|
||||
|
@ -66,206 +67,211 @@ public class PassengerFlowService {
|
|||
String[] tt = this.newMinusMinutesStr(dateNow);
|
||||
|
||||
String url = "http://15.72.158.72:8081/getway/api/Proxy/HandleByKey/1249fcc8-0466-4897-87b4-d2111a9baf4f";
|
||||
map.put("APIKEY",APIKEY);
|
||||
map.put("APIKEY", APIKEY);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("appId",appId);
|
||||
jsonObject.put("appId", appId);
|
||||
//安全认证 MD5(appId+”-”+timeStamp+”-”+ appSecret)
|
||||
String code = appId+"-"+timeStamp+"-"+ appSecret;
|
||||
String code = appId + "-" + timeStamp + "-" + appSecret;
|
||||
String md5Str = DigestUtils.md5DigestAsHex(code.getBytes(StandardCharsets.UTF_8));
|
||||
jsonObject.put("mac",md5Str);
|
||||
jsonObject.put("timeStamp",timeStamp);
|
||||
jsonObject.put("hourId",tt[1]);
|
||||
jsonObject.put("timeId",tt[0]);
|
||||
jsonObject.put("mac", md5Str);
|
||||
jsonObject.put("timeStamp", timeStamp);
|
||||
jsonObject.put("hourId", tt[1]);
|
||||
jsonObject.put("timeId", tt[0]);
|
||||
JSONObject para = new JSONObject();
|
||||
para.put("data",JSONObject.toJSONString(jsonObject));
|
||||
map.put("ParamJson",para);
|
||||
para.put("data", JSONObject.toJSONString(jsonObject));
|
||||
map.put("ParamJson", para);
|
||||
|
||||
System.out.println("multimap->"+map.toString());
|
||||
log.info("[passengerFlow] ->",map.toString());
|
||||
System.out.println("multimap->" + map.toString());
|
||||
log.info("[passengerFlow] ->", map.toString());
|
||||
ResponseEntity<String> responseEntity;
|
||||
List<Map> list = new ArrayList<>();
|
||||
try{
|
||||
responseEntity = restTemplate.postForEntity(url,map,String.class);
|
||||
if(responseEntity.getStatusCodeValue() == 200){
|
||||
try {
|
||||
responseEntity = restTemplate.postForEntity(url, map, String.class);
|
||||
if (responseEntity.getStatusCodeValue() == 200) {
|
||||
String result = responseEntity.getBody();
|
||||
JSONObject jsonResult = JSONObject.parseObject(result);
|
||||
System.out.println(jsonResult.keySet().toString());
|
||||
if(jsonResult.getIntValue("code") == 0){
|
||||
if (jsonResult.getIntValue("code") == 0) {
|
||||
JSONArray jsonArray = jsonResult.getJSONArray("result");
|
||||
list = JSONObject.parseArray(JSONObject.toJSONString(jsonArray),Map.class);
|
||||
list = JSONObject.parseArray(JSONObject.toJSONString(jsonArray), Map.class);
|
||||
}
|
||||
}
|
||||
} catch (Exception e){
|
||||
log.error("[passengerFlow] Exception:"+e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("[passengerFlow] Exception:" + e.getMessage());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
//从表中获取最新的实时客流
|
||||
public List<PassengerFlow> listPassengerFlow(String timeId){
|
||||
List<PassengerFlow> lists = new ArrayList<>();
|
||||
public List<PassengerFlow> listPassengerFlow(String timeId) {
|
||||
List<PassengerFlow> lists = new ArrayList<>();
|
||||
long longTimeId = Long.valueOf(timeId);
|
||||
if(longTimeId == 1970000000){
|
||||
if (longTimeId == 1970000000) {
|
||||
PassengerFlow passengerFlow = passengerFlowMapper.getByMaxId();
|
||||
timeId = passengerFlow.getTimeId();
|
||||
}
|
||||
QueryWrapper<PassengerFlow> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("time_id",timeId);
|
||||
wrapper.eq("time_id", timeId);
|
||||
lists = passengerFlowMapper.selectList(wrapper);
|
||||
|
||||
return lists;
|
||||
}
|
||||
|
||||
//从表中获取获取最新的实时客流,并筛选出all_nums>=5000,并desc排序
|
||||
public List<PassengerFlow> listPassengerFlowByAllNums(){
|
||||
public List<PassengerFlow> listPassengerFlowByAllNums() {
|
||||
List<PassengerFlow> lists = new ArrayList<>();
|
||||
String timeId = passengerFlowMapper.getByMaxId().getTimeId();
|
||||
QueryWrapper<PassengerFlow> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("time_id",timeId).ge("all_nums",5000).orderByDesc("all_nums");
|
||||
wrapper.eq("time_id", timeId).ge("all_nums", 5000).orderByDesc("all_nums");
|
||||
lists = passengerFlowMapper.selectList(wrapper);
|
||||
return lists;
|
||||
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 31 10-22/1 * * ? ")
|
||||
//提供的接口能查到当前时间2个小时之前的数据,每隔15分钟一次,我们只取整点从早8点到晚8点的整点数据
|
||||
//10:31 到晚上10:31,每小时的31分执行一次
|
||||
public void passengerFlowSchedule(){
|
||||
if (enable){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
public void passengerFlowSchedule() {
|
||||
if (enable) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||
|
||||
LocalDateTime dateNow = LocalDateTime.now();
|
||||
String timeStamp = dateNow.format(dateTimeFormatter1);//yyyyMMddHHmmss
|
||||
String[] tt = this.minusMinutesStr(dateNow,120);
|
||||
String[] tt = this.minusMinutesStr(dateNow, 120);
|
||||
|
||||
String url = "http://15.72.158.72:8081/getway/api/Proxy/HandleByKey/1249fcc8-0466-4897-87b4-d2111a9baf4f";
|
||||
map.put("APIKEY",APIKEY);
|
||||
map.put("APIKEY", APIKEY);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("appId",appId);
|
||||
jsonObject.put("appId", appId);
|
||||
//安全认证 MD5(appId+”-”+timeStamp+”-”+ appSecret)
|
||||
String code = appId+"-"+timeStamp+"-"+ appSecret;
|
||||
String code = appId + "-" + timeStamp + "-" + appSecret;
|
||||
String md5Str = DigestUtils.md5DigestAsHex(code.getBytes(StandardCharsets.UTF_8));
|
||||
jsonObject.put("mac",md5Str);
|
||||
jsonObject.put("timeStamp",timeStamp);
|
||||
jsonObject.put("hourId",tt[1]);
|
||||
jsonObject.put("timeId",tt[0]);
|
||||
jsonObject.put("mac", md5Str);
|
||||
jsonObject.put("timeStamp", timeStamp);
|
||||
jsonObject.put("hourId", tt[1]);
|
||||
jsonObject.put("timeId", tt[0]);
|
||||
JSONObject para = new JSONObject();
|
||||
para.put("data",JSONObject.toJSONString(jsonObject));
|
||||
map.put("ParamJson",para);
|
||||
para.put("data", JSONObject.toJSONString(jsonObject));
|
||||
map.put("ParamJson", para);
|
||||
|
||||
System.out.println("multimap->"+map.toString());
|
||||
System.out.println("multimap->" + map.toString());
|
||||
ResponseEntity<String> responseEntity;
|
||||
List<Map> list = new ArrayList<>();
|
||||
try{
|
||||
responseEntity = restTemplate.postForEntity(url,map,String.class);
|
||||
if(responseEntity.getStatusCodeValue() == 200){
|
||||
try {
|
||||
responseEntity = restTemplate.postForEntity(url, map, String.class);
|
||||
if (responseEntity.getStatusCodeValue() == 200) {
|
||||
String result = responseEntity.getBody();
|
||||
JSONObject jsonResult = JSONObject.parseObject(result);
|
||||
System.out.println(jsonResult.keySet().toString());
|
||||
if(jsonResult.getIntValue("code") == 0){
|
||||
if (jsonResult.getIntValue("code") == 0) {
|
||||
JSONArray jsonArray = jsonResult.getJSONArray("result");
|
||||
list = JSONObject.parseArray(JSONObject.toJSONString(jsonArray),Map.class);
|
||||
List<List<Map>> lists = Lists.partition(list,200);
|
||||
lists.forEach(ll ->passengerFlowMapper.batchSave(ll));
|
||||
list = JSONObject.parseArray(JSONObject.toJSONString(jsonArray), Map.class);
|
||||
List<List<Map>> lists = Lists.partition(list, 200);
|
||||
lists.forEach(ll -> passengerFlowMapper.batchSave(ll));
|
||||
}
|
||||
}
|
||||
} catch (Exception e){
|
||||
log.error("[passengerFlowSchedule] Exception:"+e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("[passengerFlowSchedule] Exception:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//保存实时客流
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean savePassengerFlow(List<Map> maps){
|
||||
List<List<Map>> lists = Lists.partition(maps,200);
|
||||
try{
|
||||
lists.forEach(list ->passengerFlowMapper.batchSave(list));
|
||||
public boolean savePassengerFlow(List<Map> maps) {
|
||||
List<List<Map>> lists = Lists.partition(maps, 200);
|
||||
try {
|
||||
lists.forEach(list -> passengerFlowMapper.batchSave(list));
|
||||
return true;
|
||||
}catch (Exception e){
|
||||
log.error("[savePassengerFlow] Exception:"+e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("[savePassengerFlow] Exception:" + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//根据半径,一个经纬度和timeId查询游客总数
|
||||
public JSONObject passengerNums(double longitude, double latitude, Integer radius,String timeId){
|
||||
int allCount = 0;
|
||||
int localCount = 0;
|
||||
int nonLocalCount = 0;
|
||||
public JSONObject passengerNums(double longitude, double latitude, Integer radius, String timeId) {
|
||||
int allCount = 0;
|
||||
int localCount = 0;
|
||||
int nonLocalCount = 0;
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
try{
|
||||
try {
|
||||
double[] around = LongLatUtil.getAround(longitude, latitude, radius);
|
||||
List<PassengerFlowDto> list = passengerFlowMapper.selectPassenger(around[0], around[2], around[1], around[3],timeId);
|
||||
for(PassengerFlowDto p:list){
|
||||
List<PassengerFlowDto> list = passengerFlowMapper.selectPassenger(around[0], around[2], around[1], around[3], timeId);
|
||||
for (PassengerFlowDto p : list) {
|
||||
|
||||
allCount+=Integer.parseInt(p.getAllNums());
|
||||
localCount+=Integer.parseInt(p.getLocalNums());
|
||||
nonLocalCount+=Integer.parseInt(p.getNonlocalNums());
|
||||
allCount += Integer.parseInt(p.getAllNums());
|
||||
localCount += Integer.parseInt(p.getLocalNums());
|
||||
nonLocalCount += Integer.parseInt(p.getNonlocalNums());
|
||||
}
|
||||
result.put("local_nums",localCount);
|
||||
result.put("nonlocal_nums",nonLocalCount);
|
||||
result.put("all_nums",allCount);
|
||||
}catch (Exception e){
|
||||
log.error("[passengerNums] Exception:"+e.getMessage());
|
||||
result.put("local_nums", localCount);
|
||||
result.put("nonlocal_nums", nonLocalCount);
|
||||
result.put("all_nums", allCount);
|
||||
} catch (Exception e) {
|
||||
log.error("[passengerNums] Exception:" + e.getMessage());
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//当前时间减去固定的分钟数,然后分钟取30
|
||||
private String[] minusMinutesStr(LocalDateTime datetime,long minutes){
|
||||
String t1,t2;//t1 yyyyMMddHHmm t2 yyyyMMddHH
|
||||
private String[] minusMinutesStr(LocalDateTime datetime, long minutes) {
|
||||
String t1, t2;//t1 yyyyMMddHHmm t2 yyyyMMddHH
|
||||
LocalDateTime minus = datetime.minus(minutes, ChronoUnit.MINUTES);
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm");
|
||||
DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyyMMddHH");
|
||||
String time1 = minus.format(dateTimeFormatter);
|
||||
System.out.println(time1);
|
||||
String mm = time1.substring(time1.length() -2,time1.length());
|
||||
String mm = time1.substring(time1.length() - 2, time1.length());
|
||||
System.out.println(mm);
|
||||
if(0 < Integer.parseInt(mm) &&Integer.parseInt(mm)>=30){
|
||||
t1 = time1.substring(0,time1.length() -2)+"00";
|
||||
}else if(Integer.parseInt(mm)<30){
|
||||
LocalDateTime lastHour = LocalDateTime.parse(time1,dateTimeFormatter).plus(1,ChronoUnit.HOURS);
|
||||
t1 = lastHour.format(dateTimeFormatter2)+"00";
|
||||
}else{
|
||||
if (0 < Integer.parseInt(mm) && Integer.parseInt(mm) >= 30) {
|
||||
t1 = time1.substring(0, time1.length() - 2) + "00";
|
||||
} else if (Integer.parseInt(mm) < 30) {
|
||||
LocalDateTime lastHour = LocalDateTime.parse(time1, dateTimeFormatter).plus(1, ChronoUnit.HOURS);
|
||||
t1 = lastHour.format(dateTimeFormatter2) + "00";
|
||||
} else {
|
||||
t1 = time1;
|
||||
}
|
||||
|
||||
t2 = t1.substring(0,t1.length()-2);
|
||||
System.out.println("t1->"+t1+"...t2->"+t2);
|
||||
return new String[]{t1,t2};
|
||||
t2 = t1.substring(0, t1.length() - 2);
|
||||
System.out.println("t1->" + t1 + "...t2->" + t2);
|
||||
return new String[]{t1, t2};
|
||||
}
|
||||
|
||||
//查询出最新有游客数据的时间点
|
||||
private String[] newMinusMinutesStr(LocalDateTime datetime){
|
||||
String t1,t2;//t1 yyyyMMddHHmm t2 yyyyMMddHH
|
||||
private String[] newMinusMinutesStr(LocalDateTime datetime) {
|
||||
String t1, t2;//t1 yyyyMMddHHmm t2 yyyyMMddHH
|
||||
LocalDateTime minus = datetime.minus(125, ChronoUnit.MINUTES);
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm");
|
||||
DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyyMMddHH");
|
||||
String time1 = minus.format(dateTimeFormatter);
|
||||
System.out.println(time1);
|
||||
String mm = time1.substring(time1.length() -2,time1.length());
|
||||
String mm = time1.substring(time1.length() - 2, time1.length());
|
||||
System.out.println(mm);
|
||||
|
||||
Integer i = Integer.parseInt(mm)/15;
|
||||
if(i == 0){
|
||||
t1 = time1.substring(0,time1.length() -2)+"00";
|
||||
}else{
|
||||
t1 = time1.substring(0,time1.length() -2)+String.valueOf(15*i);
|
||||
Integer i = Integer.parseInt(mm) / 15;
|
||||
if (i == 0) {
|
||||
t1 = time1.substring(0, time1.length() - 2) + "00";
|
||||
} else {
|
||||
t1 = time1.substring(0, time1.length() - 2) + String.valueOf(15 * i);
|
||||
}
|
||||
t2 = t1.substring(0,t1.length()-2);
|
||||
System.out.println("t1->"+t1+"...t2->"+t2);
|
||||
return new String[]{t1,t2};
|
||||
t2 = t1.substring(0, t1.length() - 2);
|
||||
System.out.println("t1->" + t1 + "...t2->" + t2);
|
||||
return new String[]{t1, t2};
|
||||
}
|
||||
|
||||
|
||||
/** @param vertX polygon coordinates latitudes
|
||||
* @param vertY polygon coordinates longitudes
|
||||
* @return true indicate inside of the polygon, false indicate outside of the polygon
|
||||
/**
|
||||
* @param vertX polygon coordinates latitudes
|
||||
* @param vertY polygon coordinates longitudes
|
||||
* @return true indicate inside of the polygon, false indicate outside of the polygon
|
||||
*/
|
||||
public Integer pnpolyAlgorithm(List<Double> vertX, List<Double> vertY,String timeId) {
|
||||
public Integer pnpolyAlgorithm(List<Double> vertX, List<Double> vertY, String timeId) {
|
||||
List<PassengerFlow> passengerFlows = passengerFlowMapper.selectByTime(timeId);
|
||||
int people = 0;
|
||||
for (PassengerFlow passengerFlow: passengerFlows) {
|
||||
for (PassengerFlow passengerFlow : passengerFlows) {
|
||||
double latitude = Double.parseDouble(passengerFlow.getLatitude());
|
||||
double longitude = Double.parseDouble(passengerFlow.getLongitude());
|
||||
if (CollectionUtils.isEmpty(vertX) || CollectionUtils.isEmpty(vertY)) {
|
||||
|
@ -290,7 +296,7 @@ public class PassengerFlowService {
|
|||
result = !result;
|
||||
}
|
||||
}
|
||||
if (result){
|
||||
if (result) {
|
||||
Integer allNums = Integer.parseInt(passengerFlow.getAllNums());
|
||||
people += allNums;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public class QidiService {
|
|||
|
||||
//启迪数据中台相关
|
||||
//1.登录
|
||||
public String qidiToken () {
|
||||
public String qidiToken() {
|
||||
String url = "http://120.221.95.13:9090/apin/authorization/oauth/token";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Basic dGVzdF9jbGllbnQ6ZTk4OWQ0NmZkYmMxYzM3NmMxOWE0M2FhZjg1MjI3YTQ=");
|
||||
|
@ -62,7 +62,7 @@ public class QidiService {
|
|||
}
|
||||
|
||||
//渣土车轨迹数据,最新的
|
||||
public List<Map> resCatalogApplyZTYS () {
|
||||
public List<Map> resCatalogApplyZTYS() {
|
||||
String token = this.qidiToken();
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Bearer " + token);
|
||||
|
@ -76,7 +76,7 @@ public class QidiService {
|
|||
|
||||
JSONObject jsonObject = responseEntity.getBody();
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("list");
|
||||
log.info("[resCatalogApplyZTYS] 返回数据的数量:{}",jsonArray.size());
|
||||
log.info("[resCatalogApplyZTYS] 返回数据的数量:{}", jsonArray.size());
|
||||
return JSONObject.parseArray(JSONObject.toJSONString(jsonArray), Map.class);
|
||||
} catch (Exception e) {
|
||||
log.info("[resCatalogApplyZTYS] exception:{}", e.getMessage());
|
||||
|
@ -85,7 +85,7 @@ public class QidiService {
|
|||
}
|
||||
|
||||
//环卫车轨迹数据
|
||||
public List<Map> resCatalogApplyHJWS () {
|
||||
public List<Map> resCatalogApplyHJWS() {
|
||||
String token = this.qidiToken();
|
||||
String url = "http://120.221.95.13:9090/catalog/resCatalogApply/getData/UC_QUERY_HJWS_307013400000000442_1";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
|
@ -105,18 +105,18 @@ public class QidiService {
|
|||
}
|
||||
|
||||
//工地信息
|
||||
public List<Map> resCatalogApplyGDYS () {
|
||||
public List<Map> resCatalogApplyGDYS() {
|
||||
String token = this.qidiToken();
|
||||
String url = "http://120.221.95.13:9090/catalog/resCatalogApply/getData/UC_QUERY_ZTYS_307013600000000025_1";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Bearer " + token);
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
JSONObject search = new JSONObject();
|
||||
search.put("opt","LIKE");
|
||||
search.put("key","updatetime");
|
||||
search.put("val",this.dateStr());
|
||||
map.put("json",search);
|
||||
search.put("opt", "LIKE");
|
||||
search.put("key", "updatetime");
|
||||
search.put("val", this.dateStr());
|
||||
map.put("json", search);
|
||||
|
||||
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(null, headers);
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
|
@ -132,18 +132,18 @@ public class QidiService {
|
|||
}
|
||||
|
||||
//环卫车辆数据1,基础
|
||||
public List<Map> resCatalogApplyHJWSBase () {
|
||||
public List<Map> resCatalogApplyHJWSBase() {
|
||||
String token = this.qidiToken();
|
||||
String url = "http://120.221.95.13:9090/catalog/resCatalogApply/getData/UC_QUERY_HJWS_307013400000000365_1";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Bearer " + token);
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
JSONObject search = new JSONObject();
|
||||
search.put("opt","EQ");
|
||||
search.put("key","SSQY");
|
||||
search.put("val","胶州市");
|
||||
map.put("json",search);
|
||||
search.put("opt", "EQ");
|
||||
search.put("key", "SSQY");
|
||||
search.put("val", "胶州市");
|
||||
map.put("json", search);
|
||||
|
||||
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(null, headers);
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
|
@ -159,20 +159,20 @@ public class QidiService {
|
|||
}
|
||||
|
||||
//环卫车辆数据2,作业,5月20号已经把能查到的都保存到表中了(忘了保存updatetime)
|
||||
public List<Map> resCatalogApplyHJWSZY () {
|
||||
public List<Map> resCatalogApplyHJWSZY() {
|
||||
String token = this.qidiToken();
|
||||
String url = "http://120.221.95.13:9090/catalog/resCatalogApply/getData/UC_QUERY_HJWS_307013400000000363_1";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Bearer " + token);
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
JSONObject search = new JSONObject();
|
||||
map.put("json",search);
|
||||
map.put("json", search);
|
||||
|
||||
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(null, headers);
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try {
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.GET, request, JSONObject.class,map);
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.GET, request, JSONObject.class, map);
|
||||
JSONObject jsonObject = responseEntity.getBody();
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("list");
|
||||
return JSONObject.parseArray(JSONObject.toJSONString(jsonArray), Map.class);
|
||||
|
@ -182,37 +182,38 @@ public class QidiService {
|
|||
}
|
||||
}
|
||||
|
||||
public List<Map> resCatalogApplyHJWSZY(String updatetime) throws Exception{
|
||||
public List<Map> resCatalogApplyHJWSZY(String updatetime) throws Exception {
|
||||
String token = this.qidiToken();
|
||||
String url = "http://120.221.95.13:9090/catalog/resCatalogApply/getData/UC_QUERY_HJWS_307013400000000363_1?search=[{json}]";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Bearer " + token);
|
||||
|
||||
List<Map> maps = new ArrayList<>();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
JSONObject search = new JSONObject();
|
||||
search.put("opt","GT");
|
||||
search.put("key","updatetime");
|
||||
search.put("val",updatetime);
|
||||
map.put("json",search);
|
||||
search.put("opt", "GT");
|
||||
search.put("key", "updatetime");
|
||||
search.put("val", updatetime);
|
||||
map.put("json", search);
|
||||
|
||||
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(null, headers);
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.GET, request, JSONObject.class,map);
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.GET, request, JSONObject.class, map);
|
||||
JSONObject jsonObject = responseEntity.getBody();
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("list");
|
||||
maps = JSONObject.parseArray(JSONObject.toJSONString(jsonArray), Map.class);
|
||||
|
||||
return maps;
|
||||
}
|
||||
|
||||
//环卫道路明细数据
|
||||
public List<Map> resCatalogApplyHJWSRoad () {
|
||||
public List<Map> resCatalogApplyHJWSRoad() {
|
||||
String token = this.qidiToken();
|
||||
String url = "http://120.221.95.13:9090/catalog/resCatalogApply/getData/UC_QUERY_HJWS_307013400000000370_2";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Bearer " + token);
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(null, headers);
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
|
@ -226,16 +227,18 @@ public class QidiService {
|
|||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
//获取当前日期的时间串,2022-05-08 00:00:00
|
||||
private String dateTimeStr(){
|
||||
private String dateTimeStr() {
|
||||
LocalDate localDate = LocalDate.now();
|
||||
LocalDate yestDay = localDate.minusDays(1);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime dateTime = LocalDateTime.of(yestDay.getYear(),yestDay.getMonth(),yestDay.getDayOfMonth(),0,0,0);
|
||||
LocalDateTime dateTime = LocalDateTime.of(yestDay.getYear(), yestDay.getMonth(), yestDay.getDayOfMonth(), 0, 0, 0);
|
||||
return dateTime.format(formatter);
|
||||
}
|
||||
|
||||
//获取当前日期的时间串,2022-05-08
|
||||
private String dateStr(){
|
||||
private String dateStr() {
|
||||
LocalDate localDate = LocalDate.now();
|
||||
LocalDate yestDay = localDate.minusDays(1);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
|
|
|
@ -40,14 +40,14 @@ public class RoadDataService {
|
|||
private RoadDataMapper roadDataMapper;
|
||||
|
||||
//道路统计数据与排名,调用公开接口
|
||||
public List<Map> roadData(){
|
||||
public List<Map> roadData() {
|
||||
String url = "http://outerdata.novaecs.com/api/qingdaoData/roadData?groupId={groupId}&timeType={timeType}&dt={dt}";
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
map.put("dt",this.dateTimeStr());
|
||||
map.put("groupId",1);
|
||||
map.put("timeType","日");
|
||||
map.put("dt", this.dateTimeStr());
|
||||
map.put("groupId", 1);
|
||||
map.put("timeType", "日");
|
||||
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
List<Map> list = new ArrayList<>();
|
||||
|
@ -69,15 +69,15 @@ public class RoadDataService {
|
|||
}
|
||||
|
||||
//道路统计数据与排名(道路污染),调用公开接口并保存到表t_road_data
|
||||
@Scheduled(cron="0 0 7 * * ?")
|
||||
public void saveRoadData(){
|
||||
@Scheduled(cron = "0 0 7 * * ?")
|
||||
public void saveRoadData() {
|
||||
String url = "http://outerdata.novaecs.com/api/qingdaoData/roadData?groupId={groupId}&timeType={timeType}&dt={dt}";
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
map.put("dt",this.dateTimeStr());
|
||||
map.put("groupId",1);
|
||||
map.put("timeType","日");
|
||||
map.put("dt", this.dateTimeStr());
|
||||
map.put("groupId", 1);
|
||||
map.put("timeType", "日");
|
||||
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
List<Map> list = new ArrayList<>();
|
||||
|
@ -94,36 +94,36 @@ public class RoadDataService {
|
|||
} catch (Exception e) {
|
||||
log.info("[roadData] exception:{}", e.getMessage());
|
||||
}
|
||||
if(list.size() > 0){
|
||||
List<Map> maps = list.stream().map(l->{
|
||||
l.put("points",JSONObject.toJSONString(l.get("points")));
|
||||
l.put("dt",this.dateTimeStr());
|
||||
if (list.size() > 0) {
|
||||
List<Map> maps = list.stream().map(l -> {
|
||||
l.put("points", JSONObject.toJSONString(l.get("points")));
|
||||
l.put("dt", this.dateTimeStr());
|
||||
return l;
|
||||
}).collect(Collectors.toList());
|
||||
List<List<Map>> lists = Lists.partition(maps,200);
|
||||
lists.forEach(ll->roadDataMapper.batchSave(ll));
|
||||
List<List<Map>> lists = Lists.partition(maps, 200);
|
||||
lists.forEach(ll -> roadDataMapper.batchSave(ll));
|
||||
}
|
||||
}
|
||||
|
||||
//根据日期查询道路污染数据
|
||||
public List<RoadData> listRoadData(String dt){
|
||||
public List<RoadData> listRoadData(String dt) {
|
||||
QueryWrapper<RoadData> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("dt",dt);
|
||||
wrapper.eq("dt", dt);
|
||||
List<RoadData> list = roadDataMapper.selectList(wrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
//获取当前日期的时间串,2022-05-08 00:00:00
|
||||
private String dateTimeStr(){
|
||||
private String dateTimeStr() {
|
||||
LocalDate localDate = LocalDate.now();
|
||||
LocalDate yestDay = localDate.minusDays(1);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime dateTime = LocalDateTime.of(yestDay.getYear(),yestDay.getMonth(),yestDay.getDayOfMonth(),0,0,0);
|
||||
LocalDateTime dateTime = LocalDateTime.of(yestDay.getYear(), yestDay.getMonth(), yestDay.getDayOfMonth(), 0, 0, 0);
|
||||
return dateTime.format(formatter);
|
||||
}
|
||||
|
||||
//获取当前日期的时间串,2022-05-08
|
||||
private String dateStr(){
|
||||
private String dateStr() {
|
||||
LocalDate localDate = LocalDate.now();
|
||||
LocalDate yestDay = localDate.minusDays(1);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.Map;
|
|||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName SJZTService.java
|
||||
* @Description 数交中台service,城市执法
|
||||
* @Description 数交中台service, 城市执法
|
||||
* @createTime 2022年05月12日 18:00:00
|
||||
*/
|
||||
@Service
|
||||
|
@ -46,7 +46,7 @@ public class SJZTService {
|
|||
|
||||
//数交中台
|
||||
//1.登录
|
||||
public String sjztToken () {
|
||||
public String sjztToken() {
|
||||
String url = "http://120.221.95.13:9090/apin/authorization/oauth/token";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Basic dGVzdF9jbGllbnQ6ZTk4OWQ0NmZkYmMxYzM3NmMxOWE0M2FhZjg1MjI3YTQ=");
|
||||
|
@ -83,132 +83,133 @@ public class SJZTService {
|
|||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Bearer " + token);
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
JSONObject search = new JSONObject();
|
||||
search.put("opt","LIKE");
|
||||
search.put("key","WTLYMC");
|
||||
search.put("val","微信举报");
|
||||
search.put("opt", "LIKE");
|
||||
search.put("key", "WTLYMC");
|
||||
search.put("val", "微信举报");
|
||||
|
||||
map.put("json",search);
|
||||
map.put("json", search);
|
||||
int i = 1;
|
||||
int roundCount = 0;
|
||||
int count = 0;
|
||||
List<Map> maps = new ArrayList<>();
|
||||
do{
|
||||
do {
|
||||
String url = "http://120.221.95.13:9090/catalog/resCatalogApply/getData/UC_QUERY_QDZWT_307013311122000064_1?pageSize=10000&pageNo={1}&search=[{2}]";
|
||||
HttpEntity<Map> httpEntity = new HttpEntity<>(null, headers);
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try {
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, JSONObject.class,i,search);
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, JSONObject.class, i, search);
|
||||
|
||||
JSONObject jsonObject = responseEntity.getBody();
|
||||
count = jsonObject.getIntValue("count");
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("list");
|
||||
maps.addAll(JSONObject.parseArray(JSONObject.toJSONString(jsonArray), Map.class));
|
||||
i++;
|
||||
roundCount = i*10000;
|
||||
roundCount = i * 10000;
|
||||
} catch (Exception e) {
|
||||
log.info("[listSJZTDatas] exception:{}", e.getMessage());
|
||||
return null;
|
||||
}
|
||||
} while(roundCount <=count);
|
||||
} while (roundCount <= count);
|
||||
|
||||
log.info("[listSJZTDatas] 返回数据的数量:{}",maps.size());
|
||||
log.info("[listSJZTDatas] 返回数据的数量:{}", maps.size());
|
||||
return maps;
|
||||
}
|
||||
|
||||
//从接口获取案件数据并保存
|
||||
public void batchSave(){
|
||||
public void batchSave() {
|
||||
String token = this.sjztToken();
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Bearer " + token);
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
JSONObject search = new JSONObject();
|
||||
search.put("opt","LIKE");
|
||||
search.put("key","AJJLSJ");
|
||||
search.put("opt", "LIKE");
|
||||
search.put("key", "AJJLSJ");
|
||||
// search.put("val",this.dateStr());
|
||||
search.put("val","2017");
|
||||
search.put("val", "2017");
|
||||
|
||||
map.put("json",search);
|
||||
map.put("json", search);
|
||||
int i = 1;
|
||||
int roundCount = 0;
|
||||
int count = 0;
|
||||
List<Map> mapList = new ArrayList<>();
|
||||
do{
|
||||
do {
|
||||
String url = "http://120.221.95.13:9090/catalog/resCatalogApply/getData/UC_QUERY_QDZWT_307013311122000064_1?pageSize=10000&pageNo={1}&search=[{2}]";
|
||||
HttpEntity<Map> httpEntity = new HttpEntity<>(null, headers);
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try {
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, JSONObject.class,i,search);
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, JSONObject.class, i, search);
|
||||
|
||||
JSONObject jsonObject = responseEntity.getBody();
|
||||
count = jsonObject.getIntValue("count");
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("list");
|
||||
mapList.addAll(JSONObject.parseArray(JSONObject.toJSONString(jsonArray), Map.class));
|
||||
i++;
|
||||
roundCount = i*10000;
|
||||
roundCount = i * 10000;
|
||||
} catch (Exception e) {
|
||||
log.info("[SJZTService-batchSave] exception:{}", e.getMessage());
|
||||
}
|
||||
} while(roundCount <=count);
|
||||
} while (roundCount <= count);
|
||||
System.out.println(mapList.size());
|
||||
|
||||
IdentifierGenerator identifierGenerator=new DefaultIdentifierGenerator();
|
||||
mapList.forEach(m-> m.put("id",identifierGenerator.nextId(new Object())));//给id赋值
|
||||
IdentifierGenerator identifierGenerator = new DefaultIdentifierGenerator();
|
||||
mapList.forEach(m -> m.put("id", identifierGenerator.nextId(new Object())));//给id赋值
|
||||
|
||||
List<List<Map>> lists = Lists.partition(mapList,50);
|
||||
try{
|
||||
lists.forEach(l->caseCityLawMapper.batchSave(l));
|
||||
}catch (Exception e){
|
||||
List<List<Map>> lists = Lists.partition(mapList, 50);
|
||||
try {
|
||||
lists.forEach(l -> caseCityLawMapper.batchSave(l));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("[SJZTService batchsave Exception]:",e.getMessage());
|
||||
log.error("[SJZTService batchsave Exception]:", e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<CaseCityLaw> listSJZTByDt(String ajjlsj){
|
||||
public List<CaseCityLaw> listSJZTByDt(String ajjlsj) {
|
||||
QueryWrapper<CaseCityLaw> wrapper = new QueryWrapper<>();
|
||||
wrapper.like("ajjlsj",ajjlsj);
|
||||
wrapper.like("ajjlsj", ajjlsj);
|
||||
return caseCityLawMapper.selectList(wrapper);
|
||||
}
|
||||
|
||||
public Result upStream(JSONObject data){
|
||||
public Result upStream(JSONObject data) {
|
||||
String url = "?actionType={1}&senderCode={2}&data={3}";
|
||||
String senderCode = "";//发送方标识
|
||||
String actionType = "UP_REC_REPORT";//调用方法,固定值
|
||||
boolean result = false;
|
||||
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try{
|
||||
responseEntity = restTemplate.postForEntity(url, null, JSONObject.class,senderCode,actionType,data);
|
||||
try {
|
||||
responseEntity = restTemplate.postForEntity(url, null, JSONObject.class, senderCode, actionType, data);
|
||||
JSONObject responseJSON = responseEntity.getBody();
|
||||
if(responseEntity.getStatusCodeValue() == 200){
|
||||
if(responseJSON.getBooleanValue("success") && responseJSON.getIntValue("code") == 0){
|
||||
if (responseEntity.getStatusCodeValue() == 200) {
|
||||
if (responseJSON.getBooleanValue("success") && responseJSON.getIntValue("code") == 0) {
|
||||
return Result.success(responseJSON.get("data"));
|
||||
}else{
|
||||
} else {
|
||||
return Result.error(responseJSON.getString("data"));
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
return Result.error(String.valueOf(responseEntity.getStatusCodeValue()));
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("[SJZTService upStream] Exception:"+e.getMessage());
|
||||
log.error("[SJZTService upStream] Exception:" + e.getMessage());
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//获取当前日期的时间串,2022-05-08 00:00:00
|
||||
private String dateTimeStr(){
|
||||
private String dateTimeStr() {
|
||||
LocalDate localDate = LocalDate.now();
|
||||
LocalDate yestDay = localDate.minusDays(1);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime dateTime = LocalDateTime.of(yestDay.getYear(),yestDay.getMonth(),yestDay.getDayOfMonth(),0,0,0);
|
||||
LocalDateTime dateTime = LocalDateTime.of(yestDay.getYear(), yestDay.getMonth(), yestDay.getDayOfMonth(), 0, 0, 0);
|
||||
return dateTime.format(formatter);
|
||||
}
|
||||
|
||||
//获取当前日期的时间串,2022-05-08
|
||||
private String dateStr(){
|
||||
private String dateStr() {
|
||||
LocalDate localDate = LocalDate.now();
|
||||
LocalDate yestDay = localDate.minusDays(1);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
|
|
|
@ -35,59 +35,59 @@ public class SanitationService {
|
|||
@Autowired
|
||||
private SanitationTaskMapper sanitationTaskMapper;
|
||||
|
||||
public Result saveSanitationRoad(){
|
||||
public Result saveSanitationRoad() {
|
||||
List<Map> list = qidiService.resCatalogApplyHJWSRoad();
|
||||
try{
|
||||
if(list.size() > 0){
|
||||
List<List<Map>> maps = Lists.partition(list,100);
|
||||
maps.forEach(m->sanitationMapper.batchSaveSanitationRoad(m));
|
||||
try {
|
||||
if (list.size() > 0) {
|
||||
List<List<Map>> maps = Lists.partition(list, 100);
|
||||
maps.forEach(m -> sanitationMapper.batchSaveSanitationRoad(m));
|
||||
}
|
||||
return Result.success();
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("[SanitationService saveSanitationRoad] Exception:"+e.getMessage());
|
||||
log.error("[SanitationService saveSanitationRoad] Exception:" + e.getMessage());
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public Result saveSanitationTask(){
|
||||
public Result saveSanitationTask() {
|
||||
List<Map> list = qidiService.resCatalogApplyHJWSZY();
|
||||
try{
|
||||
if(list.size() > 0){
|
||||
List<List<Map>> maps = Lists.partition(list,100);
|
||||
maps.forEach(m->sanitationMapper.batchSaveSanitationTask(m));
|
||||
try {
|
||||
if (list.size() > 0) {
|
||||
List<List<Map>> maps = Lists.partition(list, 100);
|
||||
maps.forEach(m -> sanitationMapper.batchSaveSanitationTask(m));
|
||||
}
|
||||
return Result.success();
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("[SanitationService saveSanitationTask] Exception:"+e.getMessage());
|
||||
log.error("[SanitationService saveSanitationTask] Exception:" + e.getMessage());
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//批量查询环卫车作业数据并保存,可以根据实际需求更改
|
||||
@Scheduled(cron = "0 0 8 * * ?")
|
||||
public void saveSanitationTaskScheduled(){
|
||||
public void saveSanitationTaskScheduled() {
|
||||
QueryWrapper<SanitationTask> wrapper = new QueryWrapper<>();
|
||||
wrapper.orderByDesc("updatetime").last("limit 1");
|
||||
SanitationTask sanitationTask = sanitationTaskMapper.selectOne(wrapper);
|
||||
List<Map> maps = new ArrayList<>();
|
||||
|
||||
try{
|
||||
if(sanitationTask != null){
|
||||
try {
|
||||
if (sanitationTask != null) {
|
||||
maps = qidiService.resCatalogApplyHJWSZY(String.valueOf(sanitationTask.getUpdatetime()));
|
||||
|
||||
}else{
|
||||
} else {
|
||||
maps = qidiService.resCatalogApplyHJWSZY();
|
||||
}
|
||||
|
||||
if(maps.size() > 0){
|
||||
List<List<Map>> lists = Lists.partition(maps,100);
|
||||
lists.forEach(list->sanitationMapper.batchSaveSanitationTask(list));
|
||||
if (maps.size() > 0) {
|
||||
List<List<Map>> lists = Lists.partition(maps, 100);
|
||||
lists.forEach(list -> sanitationMapper.batchSaveSanitationTask(list));
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("[SanitationService saveSanitationTaskScheduled] Exception:"+e.getMessage());
|
||||
log.error("[SanitationService saveSanitationTaskScheduled] Exception:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,29 +33,29 @@ public class SedimentTrailService {
|
|||
|
||||
//获取渣土车轨迹并保存到表t_trail_sediment
|
||||
//@Transactional(rollbackFor = Exception.class)
|
||||
public boolean batchSaveSedimentTrail(){
|
||||
try{
|
||||
public boolean batchSaveSedimentTrail() {
|
||||
try {
|
||||
List<Map> maps = qidiService.resCatalogApplyZTYS();
|
||||
Lists.partition(maps,200).forEach(
|
||||
item-> sedimentTrailMapper.batchaSave(item)
|
||||
Lists.partition(maps, 200).forEach(
|
||||
item -> sedimentTrailMapper.batchaSave(item)
|
||||
);
|
||||
return true;
|
||||
}catch (Exception e){
|
||||
log.error("[batchSaveSedimentTrail] exception:{}",e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("[batchSaveSedimentTrail] exception:{}", e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据输入的经纬度和查询的半径(米)查询范围内的渣土车轨迹信息
|
||||
* @param longitude(经度) latitude(纬度) radius(米) start(时间) end(时间)
|
||||
*
|
||||
* @param longitude(经度) latitude(纬度) radius(米) start(时间) end(时间)
|
||||
*/
|
||||
public List<SedimentTrail> listSedimentTrailByPoints(double longitude, double latitude, Integer radius,String start,String end){
|
||||
double[] points = LongLatUtil.getAround(longitude,latitude,radius);
|
||||
public List<SedimentTrail> listSedimentTrailByPoints(double longitude, double latitude, Integer radius, String start, String end) {
|
||||
double[] points = LongLatUtil.getAround(longitude, latitude, radius);
|
||||
QueryWrapper<SedimentTrail> wrapper = new QueryWrapper<>();
|
||||
wrapper.between("update_time",start,end).between("longitude",points[0],points[2]).between("latitude",points[1],points[3])
|
||||
.orderByAsc("sim_card_num","record_time");
|
||||
wrapper.between("update_time", start, end).between("longitude", points[0], points[2]).between("latitude", points[1], points[3])
|
||||
.orderByAsc("sim_card_num", "record_time");
|
||||
List<SedimentTrail> list = sedimentTrailMapper.selectList(wrapper);
|
||||
return list;
|
||||
}
|
||||
|
|
|
@ -20,28 +20,28 @@ public class TrailSanitationService {
|
|||
@Autowired
|
||||
private QidiService qidiService;
|
||||
|
||||
public boolean saveTrailSanitation(){
|
||||
public boolean saveTrailSanitation() {
|
||||
boolean result = false;
|
||||
try{
|
||||
try {
|
||||
List<Map> list = qidiService.resCatalogApplyHJWS();
|
||||
List<List<Map>> lists = Lists.partition(list,200);
|
||||
lists.forEach(l->trailSanitationMapper.batchaSave(l));
|
||||
List<List<Map>> lists = Lists.partition(list, 200);
|
||||
lists.forEach(l -> trailSanitationMapper.batchaSave(l));
|
||||
result = true;
|
||||
}catch (Exception e){
|
||||
log.error("[saveTrailSanitation] Exception:",e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("[saveTrailSanitation] Exception:", e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据输入的经纬度和查询的半径(米)查询范围内的环卫车轨迹信息
|
||||
* @param longitude(经度) latitude(纬度) raidus(米) start(时间) end(时间)
|
||||
*
|
||||
* @param longitude(经度) latitude(纬度) raidus(米) start(时间) end(时间)
|
||||
*/
|
||||
public List<TrailSanitation> listSedimentTrailByPoints(double longitude, double latitude, Integer radius, String start, String end){
|
||||
double[] points = LongLatUtil.getAround(longitude,latitude,radius);
|
||||
public List<TrailSanitation> listSedimentTrailByPoints(double longitude, double latitude, Integer radius, String start, String end) {
|
||||
double[] points = LongLatUtil.getAround(longitude, latitude, radius);
|
||||
QueryWrapper<TrailSanitation> wrapper = new QueryWrapper<>();
|
||||
wrapper.between("fssj",start,end).between("jd",points[0],points[2]).between("wd",points[1],points[3]);
|
||||
wrapper.between("fssj", start, end).between("jd", points[0], points[2]).between("wd", points[1], points[3]);
|
||||
return trailSanitationMapper.selectList(wrapper);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,10 +15,10 @@ public class UserLoginService {
|
|||
@Autowired
|
||||
private UserLoginMapper userLoginMapper;
|
||||
|
||||
public UserLoginDto login(String username, String password){
|
||||
public UserLoginDto login(String username, String password) {
|
||||
UserLogin user = userLoginMapper.getUserByName();
|
||||
UserLoginDto userLoginDto = new UserLoginDto();
|
||||
if (user.getUsername().equals(username) && user.getPassword().equals(SecureUtil.md5(password))){
|
||||
if (user.getUsername().equals(username) && user.getPassword().equals(SecureUtil.md5(password))) {
|
||||
userLoginDto.setUsername(username);
|
||||
userLoginDto.setStatus("登录成功");
|
||||
return userLoginDto;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.hisense.monitormanage.utils;
|
||||
|
||||
import net.sf.ehcache.CacheManager;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import net.sf.ehcache.Cache;
|
||||
import net.sf.ehcache.Element;
|
||||
|
||||
|
@ -17,14 +19,15 @@ public class EhcacheUtil {
|
|||
private URL url;
|
||||
private CacheManager manager;
|
||||
private static EhcacheUtil ehCache;
|
||||
|
||||
private EhcacheUtil(String path) {
|
||||
url = getClass().getResource(path);
|
||||
manager = CacheManager.create(url);
|
||||
}
|
||||
|
||||
public static EhcacheUtil getInstance() {
|
||||
if (ehCache== null) {
|
||||
ehCache= new EhcacheUtil(path);
|
||||
if (ehCache == null) {
|
||||
ehCache = new EhcacheUtil(path);
|
||||
}
|
||||
return ehCache;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ package com.hisense.monitormanage.utils;
|
|||
*/
|
||||
public class LongLatUtil {
|
||||
private static final double PI = 3.1415926;
|
||||
|
||||
/**
|
||||
* 计算地球上任意两点(经纬度)距离
|
||||
*
|
||||
|
@ -39,7 +40,7 @@ public class LongLatUtil {
|
|||
* @param radius 单位米
|
||||
* @return minLat, minLng, maxLat, maxLng
|
||||
*/
|
||||
public static double[] getAround(double lon,double lat, int radius) {
|
||||
public static double[] getAround(double lon, double lat, int radius) {
|
||||
|
||||
Double latitude = lat;
|
||||
Double longitude = lon;
|
||||
|
@ -57,7 +58,7 @@ public class LongLatUtil {
|
|||
Double radiusLng = dpmLng * radiusMile;
|
||||
Double minLng = longitude - radiusLng;
|
||||
Double maxLng = longitude + radiusLng;
|
||||
return new double[]{minLng,minLat, maxLng, maxLat};
|
||||
return new double[]{minLng, minLat, maxLng, maxLat};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# 应用名称
|
||||
spring.application.name=monitor-manage
|
||||
|
||||
logging.level.com.hisense.monitormanage=INFO
|
||||
|
||||
# 应用服务 WEB 访问端口
|
||||
server.port=7009
|
||||
# 数据库驱动:
|
||||
|
@ -14,7 +12,6 @@ spring.datasource.url=jdbc:mysql://15.72.183.91:3306/monitor_manage?useUnicode=t
|
|||
# 数据库用户名&密码:
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=w@CmM1mBVQkPhdrc
|
||||
|
||||
hwx.file.work-path=/data/services/monitor/
|
||||
#用于生成图片地址
|
||||
hwx.file.pic-host=http://15.72.183.90:7009
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# 应用名称
|
||||
spring.application.name=monitor-manage
|
||||
|
||||
logging.level.com.hisense.monitormanage=DEBUG
|
||||
|
||||
# 应用服务 WEB 访问端口
|
||||
server.port=7009
|
||||
# 数据库驱动:
|
||||
|
@ -16,14 +14,12 @@ spring.datasource.url=jdbc:mysql://15.72.183.91:3306/monitor_manage?useUnicode=t
|
|||
spring.datasource.username=root
|
||||
spring.datasource.password=w@CmM1mBVQkPhdrc
|
||||
#spring.datasource.password=123456
|
||||
|
||||
hwx.file.work-path=D:/tupian/
|
||||
hwx.file.pic-host=http://127.0.0.1:7009
|
||||
spring.resources.static-locations=classpath:/static,classpath:/public,file:${hwx.file.work-path}
|
||||
mybatis-plus.mapper-locations=classpath*:/mapper/*.xml
|
||||
#??????swagger,true???false??
|
||||
swagger.enable=true
|
||||
|
||||
scheduled.enable=false
|
||||
|
||||
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
<insert id="batchSave" parameterType="java.util.List">
|
||||
INSERT INTO t_building_records
|
||||
(
|
||||
project_name,build_license,push_time,appid,pm10,noice
|
||||
)
|
||||
(
|
||||
project_name,build_license,push_time,appid,pm10,noice
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(
|
||||
#{item.projectName},#{item.buildLicense},#{item.pushTime},#{item.appid},
|
||||
#{item.pm10},#{item.noice}
|
||||
#{item.projectName},#{item.buildLicense},#{item.pushTime},#{item.appid},
|
||||
#{item.pm10},#{item.noice}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
@ -33,9 +33,9 @@
|
|||
<select id="selectRaise" resultType="com.hisense.monitormanage.dto.BuildingRecordsDto">
|
||||
SELECT * FROM
|
||||
(SELECT br.project_name,br.build_license,br.noice,br.pm10,br.push_time,bs.channel_code,
|
||||
bs.channel_name,bs.jd,bs.wd,bs.ssdq,bs.yjsg,bs.sgwz FROM t_building_records br
|
||||
JOIN t_building_site bs
|
||||
ON br.project_name = bs.gdmc WHERE br.pm10 > 80 ) ss
|
||||
bs.channel_name,bs.jd,bs.wd,bs.ssdq,bs.yjsg,bs.sgwz FROM t_building_records br
|
||||
JOIN t_building_site bs
|
||||
ON br.project_name = bs.gdmc WHERE br.pm10 > 80 ) ss
|
||||
LEFT JOIN t_channel_picture cp ON ss.channel_code = cp.channel_code
|
||||
ORDER BY ss.push_time DESC
|
||||
<if test="page!=null and '' != page and pageSize != null and '' != pageSize">
|
||||
|
@ -47,12 +47,16 @@
|
|||
<select id="selectNoiceEvent" resultType="com.hisense.monitormanage.dto.BuildingRecordsDto">
|
||||
SELECT * FROM
|
||||
(SELECT a.* FROM
|
||||
(SELECT br.noice,br.push_time,br.project_name,br.pm10,br.build_license,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq,bs.channel_code FROM
|
||||
t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
(SELECT
|
||||
br.noice,br.push_time,br.project_name,br.pm10,br.build_license,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq,bs.channel_code
|
||||
FROM
|
||||
t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
WHERE (HOUR(br.push_time)>=22 OR 6 > HOUR(br.push_time)) AND br.noice > 55
|
||||
UNION
|
||||
SELECT br.noice,br.push_time,br.project_name,br.pm10,br.build_license,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq,bs.channel_code FROM
|
||||
t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
SELECT
|
||||
br.noice,br.push_time,br.project_name,br.pm10,br.build_license,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq,bs.channel_code
|
||||
FROM
|
||||
t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
WHERE DATE_FORMAT(br.push_time,'%H')>=6 AND DATE_FORMAT(br.push_time,'%H') < 22 AND br.noice > 70) a ) b
|
||||
LEFT JOIN t_channel_picture cp ON b.channel_code = cp.channel_code
|
||||
ORDER BY b.push_time DESC
|
||||
|
@ -64,8 +68,8 @@
|
|||
|
||||
<select id="selectByAllEvent" resultType="com.hisense.monitormanage.dto.EventDto">
|
||||
SELECT * FROM t_event te
|
||||
JOIN t_scene_event tse ON te.camera_name = tse.channel_name
|
||||
WHERE te.track_event = 'START' AND tse.scene_id = 1
|
||||
JOIN t_scene_event tse ON te.camera_name = tse.channel_name
|
||||
WHERE te.track_event = 'START' AND tse.scene_id = 1
|
||||
ORDER BY te.capture_time DESC
|
||||
<if test="page!=null and '' != page and pageSize != null and '' != pageSize">
|
||||
<bind name="page" value="(page-1)*pageSize"/>
|
||||
|
@ -94,121 +98,121 @@
|
|||
SELECT DATE_FORMAT(br.push_time,'%Y%-%m-%d') pushTime,ROUND(AVG(br.pm10)) pm10,ROUND(AVG(br.noice)) noice
|
||||
FROM t_building_records br JOIN t_building_site bns ON br.project_name = bns.gdmc
|
||||
WHERE br.build_license = #{buildLicense}
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) < DATE(br.push_time) GROUP BY pushTime) b
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) < DATE(br.push_time) GROUP BY pushTime) b
|
||||
ON a.pushTime = b.pushTime ORDER BY a.pushTime
|
||||
</select>
|
||||
|
||||
<select id="selectMonthPmAndNoice" resultType="com.hisense.monitormanage.dto.BuildingRecordsDtos">
|
||||
SELECT a.pushTime,b.pm10,b.noice
|
||||
FROM (
|
||||
SELECT date_sub(curdate(), INTERVAL 1 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 2 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 3 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 4 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 5 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 6 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 7 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 8 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 9 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 10 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 11 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 12 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 13 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 14 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 15 day) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 16 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 17 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 18 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 19 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 20 DAY) as pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 21 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 22 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 23 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 24 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 25 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 26 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 27 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 28 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 29 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 30 DAY) AS pushTime
|
||||
) a
|
||||
LEFT JOIN (
|
||||
SELECT DATE_FORMAT(br.push_time,'%Y%-%m-%d') pushTime,ROUND(AVG(br.pm10)) pm10,ROUND(AVG(br.noice)) noice
|
||||
FROM t_building_records br JOIN t_building_site bns ON br.project_name = bns.gdmc
|
||||
WHERE br.build_license = #{buildLicense}
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) < DATE(br.push_time) GROUP BY pushTime) b
|
||||
SELECT date_sub(curdate(), INTERVAL 1 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 2 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 3 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 4 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 5 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 6 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 7 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 8 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 9 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 10 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 11 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 12 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 13 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 14 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 15 day) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 16 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 17 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 18 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 19 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 20 DAY) as pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 21 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 22 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 23 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 24 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 25 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 26 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 27 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 28 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 29 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 30 DAY) AS pushTime
|
||||
) a
|
||||
LEFT JOIN (
|
||||
SELECT DATE_FORMAT(br.push_time,'%Y%-%m-%d') pushTime,ROUND(AVG(br.pm10)) pm10,ROUND(AVG(br.noice)) noice
|
||||
FROM t_building_records br JOIN t_building_site bns ON br.project_name = bns.gdmc
|
||||
WHERE br.build_license = #{buildLicense}
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) < DATE(br.push_time) GROUP BY pushTime) b
|
||||
ON a.pushTime = b.pushTime ORDER BY a.pushTime
|
||||
</select>
|
||||
|
||||
<select id="selectByWeekNoice" resultType="com.hisense.monitormanage.dto.BuildingRecordsDto">
|
||||
SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq
|
||||
FROM
|
||||
t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
WHERE (HOUR(br.push_time)>=22 OR 6 > HOUR(br.push_time)) AND br.noice > 55
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) < DATE(br.push_time)
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) < DATE(br.push_time)
|
||||
UNION
|
||||
SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq
|
||||
FROM
|
||||
t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
WHERE DATE_FORMAT(br.push_time,'%H')>=6 AND DATE_FORMAT(br.push_time,'%H') < 22
|
||||
AND br.noice > 70 AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) < DATE(br.push_time)
|
||||
AND br.noice > 70 AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) < DATE(br.push_time)
|
||||
</select>
|
||||
|
||||
<select id="selectByMonthNoice" resultType="com.hisense.monitormanage.dto.BuildingRecordsDto">
|
||||
SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq
|
||||
FROM
|
||||
t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
WHERE (HOUR(br.push_time)>=22 OR 6 > HOUR(br.push_time)) AND br.noice > 55
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) < DATE(br.push_time)
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) < DATE(br.push_time)
|
||||
UNION
|
||||
SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq
|
||||
FROM
|
||||
t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
WHERE DATE_FORMAT(br.push_time,'%H')>=6 AND DATE_FORMAT(br.push_time,'%H') < 22
|
||||
AND br.noice > 70 AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) < DATE(br.push_time)
|
||||
AND br.noice > 70 AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) < DATE(br.push_time)
|
||||
</select>
|
||||
|
||||
<select id="selectByWeekNaise" resultType="com.hisense.monitormanage.dto.BuildingRecordsDto">
|
||||
SELECT *
|
||||
FROM t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
FROM t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
WHERE br.pm10 > 80 AND
|
||||
DATE_SUB(CURDATE(), INTERVAL 7 DAY) < DATE(br.push_time)
|
||||
</select>
|
||||
|
||||
<select id="selectByMonthNaise" resultType="com.hisense.monitormanage.dto.BuildingRecordsDto">
|
||||
SELECT *
|
||||
FROM t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
FROM t_building_records br JOIN t_building_site bs ON br.project_name = bs.gdmc
|
||||
WHERE br.pm10 > 80 AND
|
||||
DATE_SUB(CURDATE(), INTERVAL 30 DAY) < DATE(br.push_time)
|
||||
DATE_SUB(CURDATE(), INTERVAL 30 DAY) < DATE(br.push_time)
|
||||
</select>
|
||||
|
||||
<select id="selectByWeekEvent" resultType="com.hisense.monitormanage.dto.EventDto">
|
||||
|
@ -220,7 +224,7 @@
|
|||
<select id="selectByMonthEvent" resultType="com.hisense.monitormanage.dto.EventDto">
|
||||
SELECT * FROM t_event te JOIN t_scene_event tse ON te.camera_name = tse.channel_name
|
||||
WHERE te.track_event = 'START' AND tse.scene_id = 1
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) < DATE(te.capture_time)
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) < DATE(te.capture_time)
|
||||
</select>
|
||||
|
||||
<select id="selectMonthCurrentByBuilding" resultType="com.hisense.monitormanage.dto.BuildingRecordsDtos">
|
||||
|
@ -286,24 +290,24 @@
|
|||
SELECT date_sub(curdate(), INTERVAL 30 DAY) AS pushTime
|
||||
) b
|
||||
LEFT JOIN (
|
||||
SELECT DATE_FORMAT(a.push_time,'%Y%-%m-%d') AS pushTime,COUNT(*) AS number FROM(
|
||||
SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq
|
||||
FROM t_building_records br JOIN t_building_site bs
|
||||
ON br.project_name = bs.gdmc
|
||||
WHERE br.pm10 > 80 AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= DATE(br.push_time)
|
||||
SELECT DATE_FORMAT(a.push_time,'%Y%-%m-%d') AS pushTime,COUNT(*) AS number FROM(
|
||||
SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq
|
||||
FROM t_building_records br JOIN t_building_site bs
|
||||
ON br.project_name = bs.gdmc
|
||||
WHERE br.pm10 > 80 AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= DATE(br.push_time)
|
||||
UNION
|
||||
SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq
|
||||
FROM t_building_records br JOIN t_building_site bs
|
||||
ON br.project_name = bs.gdmc
|
||||
WHERE (HOUR(br.push_time)>=22 OR 6 > HOUR(br.push_time)) AND br.noice > 55
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= DATE(br.push_time)
|
||||
SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq
|
||||
FROM t_building_records br JOIN t_building_site bs
|
||||
ON br.project_name = bs.gdmc
|
||||
WHERE (HOUR(br.push_time)>=22 OR 6 > HOUR(br.push_time)) AND br.noice > 55
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= DATE(br.push_time)
|
||||
UNION
|
||||
SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq
|
||||
FROM t_building_records br JOIN t_building_site bs
|
||||
ON br.project_name = bs.gdmc
|
||||
WHERE DATE_FORMAT(br.push_time,'%H')>=6 AND DATE_FORMAT(br.push_time,'%H') < 22
|
||||
AND br.noice > 70 AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= DATE(br.push_time)
|
||||
) a GROUP BY pushTime
|
||||
SELECT br.noice,br.push_time,br.project_name,bs.jd,bs.wd,bs.channel_name,bs.sgwz,bs.ssdq
|
||||
FROM t_building_records br JOIN t_building_site bs
|
||||
ON br.project_name = bs.gdmc
|
||||
WHERE DATE_FORMAT(br.push_time,'%H')>=6 AND DATE_FORMAT(br.push_time,'%H') < 22
|
||||
AND br.noice > 70 AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= DATE(br.push_time)
|
||||
) a GROUP BY pushTime
|
||||
) c ON b.pushTime = c.pushTime ORDER BY b.pushTime
|
||||
</select>
|
||||
|
||||
|
@ -371,7 +375,7 @@
|
|||
) b LEFT JOIN (
|
||||
SELECT DATE_FORMAT(te.capture_time,'%Y%-%m-%d') AS pushTime,COUNT(1) AS number
|
||||
FROM t_event te
|
||||
JOIN t_scene_event tse ON te.camera_name = tse.channel_name
|
||||
JOIN t_scene_event tse ON te.camera_name = tse.channel_name
|
||||
WHERE te.track_event = 'START' AND tse.scene_id = 1
|
||||
AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= DATE(te.capture_time)
|
||||
GROUP BY pushTime) a
|
||||
|
@ -440,13 +444,11 @@
|
|||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 30 DAY) AS pushTime
|
||||
) b LEFT JOIN (
|
||||
SELECT DATE_FORMAT(rd.dt,'%Y%-%m-%d') AS pushTime,COUNT(1) AS number
|
||||
from t_road_data rd where pm10 > 150 AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= DATE(rd.dt) GROUP BY pushTime) a
|
||||
SELECT DATE_FORMAT(rd.dt,'%Y%-%m-%d') AS pushTime,COUNT(1) AS number
|
||||
from t_road_data rd where pm10 > 150 AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= DATE(rd.dt) GROUP BY
|
||||
pushTime) a
|
||||
ON a.pushTime = b.pushTime ORDER BY b.pushTime
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
|
@ -5,11 +5,11 @@
|
|||
<select id="selectAll" resultType="com.hisense.monitormanage.dto.CameraChannelDto">
|
||||
SELECT c.* FROM t_camera_channel c
|
||||
WHERE (c.gps_x NOT IN('0.0','0','','-1000.0') OR c.gps_y NOT IN('0.0','0','','-1000.0'))
|
||||
AND c.status != 0 AND c.check_status != 0
|
||||
AND c.status != 0 AND c.check_status != 0
|
||||
</select>
|
||||
|
||||
<update id="updateCameraStatus" parameterType="java.util.List">
|
||||
<foreach collection="list" item="item" index="index" separator=";">
|
||||
<foreach collection="list" item="item" index="index" separator=";">
|
||||
UPDATE t_camera_channel SET check_status = 0
|
||||
WHERE channel_code = #{item,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
jdmc,sqbs,sqmc,xzb,yzb,pqsj,ajjssj,ajzfsj,czsxcqjaaqjacqwjayqja,sbtpsl,cztpsl
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator="," >
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.id},#{item.AJJLSJ},#{item.DZMS},#{item.WTMS},#{item.WTLYBS},#{item.WTLYMC},
|
||||
#{item.AJLXBS},#{item.AJLXMC},#{item.DLBS},#{item.DLMC},#{item.XLBS},
|
||||
#{item.XLMC},#{item.QBS},#{item.QMC},#{item.JDBS},#{item.JDMC},#{item.SQBS},
|
||||
#{item.SQMC},#{item.XZB},#{item.YZB},#{item.PQSJ},#{item.AJJSSJ},#{item.AJZFSJ},
|
||||
#{item.CZSXCQJAAQJACQWJAYQJA},#{item.SBTPSL},#{item.CZTPSL}
|
||||
#{item.SQMC},#{item.XZB},#{item.YZB},#{item.PQSJ},#{item.AJJSSJ},#{item.AJZFSJ},
|
||||
#{item.CZSXCQJAAQJACQWJAYQJA},#{item.SBTPSL},#{item.CZTPSL}
|
||||
)
|
||||
</foreach>
|
||||
|
||||
|
@ -26,13 +26,13 @@
|
|||
jdmc,sqbs,sqmc,xzb,yzb,pqsj,ajjssj,ajzfsj,czsxcqjaaqjacqwjayqja,sbtpsl,cztpsl
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{id},#{AJJLSJ},#{DZMS},#{WTMS},#{WTLYBS},#{WTLYMC},
|
||||
#{AJLXBS},#{AJLXMC},#{DLBS},#{DLMC},#{XLBS},
|
||||
#{XLMC},#{QBS},#{QMC},#{JDBS},#{JDMC},#{SQBS},
|
||||
#{SQMC},#{XZB},#{YZB},#{PQSJ},#{AJJSSJ},#{AJZFSJ},
|
||||
#{itCZSXCQJAAQJACQWJAYQJA},#{SBTPSL},#{CZTPSL}
|
||||
)
|
||||
(
|
||||
#{id},#{AJJLSJ},#{DZMS},#{WTMS},#{WTLYBS},#{WTLYMC},
|
||||
#{AJLXBS},#{AJLXMC},#{DLBS},#{DLMC},#{XLBS},
|
||||
#{XLMC},#{QBS},#{QMC},#{JDBS},#{JDMC},#{SQBS},
|
||||
#{SQMC},#{XZB},#{YZB},#{PQSJ},#{AJJSSJ},#{AJZFSJ},
|
||||
#{itCZSXCQJAAQJACQWJAYQJA},#{SBTPSL},#{CZTPSL}
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
|
@ -10,7 +10,8 @@
|
|||
</select>
|
||||
|
||||
<select id="selectByName" resultType="com.hisense.monitormanage.dto.EventDto">
|
||||
SELECT * FROM t_event WHERE track_event = 'START' AND event_cn_name IN (${eventNewName}) ORDER BY capture_time DESC
|
||||
SELECT * FROM t_event WHERE track_event = 'START' AND event_cn_name IN (${eventNewName}) ORDER BY capture_time
|
||||
DESC
|
||||
<if test="page!=null and '' != page and pageSize != null and '' != pageSize">
|
||||
<bind name="page" value="(page-1)*pageSize"/>
|
||||
limit #{page},#{pageSize}
|
||||
|
|
|
@ -3,57 +3,57 @@
|
|||
<mapper namespace="com.hisense.monitormanage.mapper.KeyAreaMapper">
|
||||
<select id="selectKeyAreaList" resultType="com.hisense.monitormanage.dto.KeyAreaDto">
|
||||
SELECT * FROM
|
||||
(SELECT ka.type,ka.location,ka.service_time,ka.management,ka.scenic_level,
|
||||
ka.about,ka.area_id,ka.area_name,ka.channel_code,ka.channel_name,ss.allNums,ss.localNums,ss.nonlocalNums
|
||||
FROM t_key_area ka LEFT JOIN
|
||||
(SELECT pt.area_name,SUM(pf.all_nums) AS allNums,SUM(pf.local_nums) AS localNums,
|
||||
SUM(pf.nonlocal_nums) AS nonlocalNums
|
||||
FROM t_passenger_flow pf JOIN t_passenger_test pt
|
||||
ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude
|
||||
WHERE pf.time_id = #{timeId} AND pt.type IN (${type1}) GROUP BY pt.area_name)
|
||||
ss ON ka.area_name = ss.area_name WHERE ka.type IN (${type1})) a
|
||||
LEFT JOIN t_key_area_location kal ON kal.area_id = a.area_id
|
||||
(SELECT ka.type,ka.location,ka.service_time,ka.management,ka.scenic_level,
|
||||
ka.about,ka.area_id,ka.area_name,ka.channel_code,ka.channel_name,ss.allNums,ss.localNums,ss.nonlocalNums
|
||||
FROM t_key_area ka LEFT JOIN
|
||||
(SELECT pt.area_name,SUM(pf.all_nums) AS allNums,SUM(pf.local_nums) AS localNums,
|
||||
SUM(pf.nonlocal_nums) AS nonlocalNums
|
||||
FROM t_passenger_flow pf JOIN t_passenger_test pt
|
||||
ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude
|
||||
WHERE pf.time_id = #{timeId} AND pt.type IN (${type1}) GROUP BY pt.area_name)
|
||||
ss ON ka.area_name = ss.area_name WHERE ka.type IN (${type1})) a
|
||||
LEFT JOIN t_key_area_location kal ON kal.area_id = a.area_id
|
||||
UNION
|
||||
SELECT * FROM
|
||||
(SELECT ka.type,ka.location,ka.service_time,ka.management,ka.scenic_level,
|
||||
ka.about,ka.area_id,ka.area_name,ka.channel_code,ka.channel_name,ss.allNums,ss.localNums,ss.nonlocalNums
|
||||
FROM t_key_area ka LEFT JOIN
|
||||
(SELECT pt.area_name,SUM(pf.all_nums) AS allNums,SUM(pf.local_nums) AS localNums,
|
||||
SUM(pf.nonlocal_nums) AS nonlocalNums
|
||||
FROM t_passenger_flow pf JOIN t_passenger_test pt
|
||||
ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude
|
||||
WHERE pf.time_id = #{timeId} AND pt.type IN (${type2}) GROUP BY pt.area_name)
|
||||
ss ON ka.area_name = ss.area_name WHERE ka.type IN (${type2})) a
|
||||
LEFT JOIN t_key_area_location kal ON kal.area_id = a.area_id
|
||||
(SELECT ka.type,ka.location,ka.service_time,ka.management,ka.scenic_level,
|
||||
ka.about,ka.area_id,ka.area_name,ka.channel_code,ka.channel_name,ss.allNums,ss.localNums,ss.nonlocalNums
|
||||
FROM t_key_area ka LEFT JOIN
|
||||
(SELECT pt.area_name,SUM(pf.all_nums) AS allNums,SUM(pf.local_nums) AS localNums,
|
||||
SUM(pf.nonlocal_nums) AS nonlocalNums
|
||||
FROM t_passenger_flow pf JOIN t_passenger_test pt
|
||||
ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude
|
||||
WHERE pf.time_id = #{timeId} AND pt.type IN (${type2}) GROUP BY pt.area_name)
|
||||
ss ON ka.area_name = ss.area_name WHERE ka.type IN (${type2})) a
|
||||
LEFT JOIN t_key_area_location kal ON kal.area_id = a.area_id
|
||||
UNION
|
||||
SELECT * FROM
|
||||
(SELECT ka.type,ka.location,ka.service_time,ka.management,ka.scenic_level,
|
||||
ka.about,ka.area_id,ka.area_name,ka.channel_code,ka.channel_name,ss.allNums,ss.localNums,ss.nonlocalNums
|
||||
FROM t_key_area ka LEFT JOIN
|
||||
(SELECT pt.area_name,SUM(pf.all_nums) AS allNums,SUM(pf.local_nums) AS localNums,
|
||||
SUM(pf.nonlocal_nums) AS nonlocalNums
|
||||
FROM t_passenger_flow pf JOIN t_passenger_test pt
|
||||
ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude
|
||||
WHERE pf.time_id = #{timeId} AND pt.type IN (${type3}) GROUP BY pt.area_name)
|
||||
ss ON ka.area_name = ss.area_name WHERE ka.type IN (${type3})) a
|
||||
LEFT JOIN t_key_area_location kal ON kal.area_id = a.area_id
|
||||
(SELECT ka.type,ka.location,ka.service_time,ka.management,ka.scenic_level,
|
||||
ka.about,ka.area_id,ka.area_name,ka.channel_code,ka.channel_name,ss.allNums,ss.localNums,ss.nonlocalNums
|
||||
FROM t_key_area ka LEFT JOIN
|
||||
(SELECT pt.area_name,SUM(pf.all_nums) AS allNums,SUM(pf.local_nums) AS localNums,
|
||||
SUM(pf.nonlocal_nums) AS nonlocalNums
|
||||
FROM t_passenger_flow pf JOIN t_passenger_test pt
|
||||
ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude
|
||||
WHERE pf.time_id = #{timeId} AND pt.type IN (${type3}) GROUP BY pt.area_name)
|
||||
ss ON ka.area_name = ss.area_name WHERE ka.type IN (${type3})) a
|
||||
LEFT JOIN t_key_area_location kal ON kal.area_id = a.area_id
|
||||
</select>
|
||||
<select id="selectKeyArea" resultType="com.hisense.monitormanage.dto.KeyAreaDto">
|
||||
SELECT * FROM
|
||||
(SELECT ka.type,ka.location,ka.service_time,ka.management,ka.scenic_level,
|
||||
ka.about,ka.area_id,ka.area_name,ka.channel_code,ka.channel_name,ss.allNums,ss.localNums,ss.nonlocalNums
|
||||
FROM t_key_area ka LEFT JOIN
|
||||
(SELECT pt.area_name,SUM(pf.all_nums) AS allNums,SUM(pf.local_nums) AS localNums,
|
||||
SUM(pf.nonlocal_nums) AS nonlocalNums
|
||||
FROM t_passenger_flow pf JOIN t_passenger_test pt
|
||||
ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude
|
||||
WHERE pf.time_id = #{timeId} AND pt.type = #{type} GROUP BY pt.area_name)
|
||||
ss ON ka.area_name = ss.area_name WHERE ka.type = #{type}) a
|
||||
LEFT JOIN t_key_area_location kal ON kal.area_id = a.area_id
|
||||
(SELECT ka.type,ka.location,ka.service_time,ka.management,ka.scenic_level,
|
||||
ka.about,ka.area_id,ka.area_name,ka.channel_code,ka.channel_name,ss.allNums,ss.localNums,ss.nonlocalNums
|
||||
FROM t_key_area ka LEFT JOIN
|
||||
(SELECT pt.area_name,SUM(pf.all_nums) AS allNums,SUM(pf.local_nums) AS localNums,
|
||||
SUM(pf.nonlocal_nums) AS nonlocalNums
|
||||
FROM t_passenger_flow pf JOIN t_passenger_test pt
|
||||
ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude
|
||||
WHERE pf.time_id = #{timeId} AND pt.type = #{type} GROUP BY pt.area_name)
|
||||
ss ON ka.area_name = ss.area_name WHERE ka.type = #{type}) a
|
||||
LEFT JOIN t_key_area_location kal ON kal.area_id = a.area_id
|
||||
</select>
|
||||
<select id="selectByAreaEvent" resultType="com.hisense.monitormanage.dto.EventDto">
|
||||
SELECT * FROM t_event te
|
||||
JOIN t_scene_event tse ON te.camera_name = tse.channel_name
|
||||
JOIN t_scene_event tse ON te.camera_name = tse.channel_name
|
||||
WHERE te.track_event = 'START' AND tse.scene_id = 2
|
||||
ORDER BY te.capture_time DESC
|
||||
<if test="page!=null and '' != page and pageSize != null and '' != pageSize">
|
||||
|
@ -161,10 +161,10 @@
|
|||
) a
|
||||
LEFT JOIN (
|
||||
SELECT str_to_date(LEFT(pf.time_id,8),'%Y%m%d') as pushTime,
|
||||
MAX(pf.local_nums) AS localNums,MAX(pf.nonlocal_nums) AS nonlocalNums
|
||||
MAX(pf.local_nums) AS localNums,MAX(pf.nonlocal_nums) AS nonlocalNums
|
||||
FROM t_passenger_flow pf JOIN t_passenger_test pt
|
||||
ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude
|
||||
WHERE pt.area_name = #{areaName} AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) < DATE(
|
||||
WHERE pt.area_name = #{areaName} AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) < DATE(
|
||||
str_to_date(pf.time_id,'%Y%m%d%H%i')) GROUP BY str_to_date(LEFT(pf.time_id,8),'%Y%m%d')
|
||||
) b
|
||||
ON a.pushTime = b.pushTime ORDER BY a.pushTime DESC
|
||||
|
@ -173,74 +173,74 @@
|
|||
<select id="selectLocalMonthArea" resultType="com.hisense.monitormanage.dto.KeyAreaDtos">
|
||||
SELECT a.*,b.localNums,b.nonlocalNums
|
||||
FROM (
|
||||
SELECT date_sub(curdate(), INTERVAL 1 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 2 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 3 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 4 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 5 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 6 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 7 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 8 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 9 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 10 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 11 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 12 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 13 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 14 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 15 day) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 16 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 17 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 18 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 19 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 20 DAY) as pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 21 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 22 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 23 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 24 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 25 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 26 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 27 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 28 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 29 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 30 DAY) AS pushTime
|
||||
) a
|
||||
LEFT JOIN (
|
||||
SELECT str_to_date(LEFT(pf.time_id,8),'%Y%m%d') as pushTime,
|
||||
MAX(pf.local_nums) AS localNums,MAX(pf.nonlocal_nums) AS nonlocalNums
|
||||
FROM t_passenger_flow pf JOIN t_passenger_test pt
|
||||
ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude
|
||||
WHERE pt.area_name = #{areaName} AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) < DATE(
|
||||
str_to_date(pf.time_id,'%Y%m%d%H%i')) GROUP BY str_to_date(LEFT(pf.time_id,8),'%Y%m%d')
|
||||
) b
|
||||
SELECT date_sub(curdate(), INTERVAL 1 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 2 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 3 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 4 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 5 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 6 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 7 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 8 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 9 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 10 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 11 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 12 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 13 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 14 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 15 day) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 16 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 17 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 18 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 19 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 20 DAY) as pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 21 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 22 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 23 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 24 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 25 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 26 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 27 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 28 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 29 DAY) AS pushTime
|
||||
UNION ALL
|
||||
SELECT date_sub(curdate(), INTERVAL 30 DAY) AS pushTime
|
||||
) a
|
||||
LEFT JOIN (
|
||||
SELECT str_to_date(LEFT(pf.time_id,8),'%Y%m%d') as pushTime,
|
||||
MAX(pf.local_nums) AS localNums,MAX(pf.nonlocal_nums) AS nonlocalNums
|
||||
FROM t_passenger_flow pf JOIN t_passenger_test pt
|
||||
ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude
|
||||
WHERE pt.area_name = #{areaName} AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) < DATE(
|
||||
str_to_date(pf.time_id,'%Y%m%d%H%i')) GROUP BY str_to_date(LEFT(pf.time_id,8),'%Y%m%d')
|
||||
) b
|
||||
ON a.pushTime = b.pushTime ORDER BY a.pushTime DESC
|
||||
</select>
|
||||
</mapper>
|
|
@ -6,7 +6,7 @@
|
|||
INSERT INTO t_passenger_flow
|
||||
(hour_id,time_id,longitude,latitude,all_nums,local_nums,nonlocal_nums)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator="," >
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.hour_id},#{item.time_id},#{item.longitude},#{item.latitude},#{item.all_nums},
|
||||
#{item.local_nums},#{item.nonlocal_nums}
|
||||
|
@ -15,7 +15,7 @@
|
|||
</insert>
|
||||
|
||||
<select id="getByMaxId" resultType="com.hisense.monitormanage.entity.PassengerFlow">
|
||||
SELECT * FROM t_passenger_flow ORDER BY id DESC limit 1
|
||||
SELECT * FROM t_passenger_flow ORDER BY id DESC limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectByTime" resultType="com.hisense.monitormanage.entity.PassengerFlow">
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
(region_name,street_name,road_name,start,end,lng,lat,pm10,pm25,desc_pm10_rank,asc_pm10_rank,
|
||||
desc_pm25_rank,asc_pm25_rank,points,dt)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator="," >
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.regionName},#{item.streetName},#{item.roadName},#{item.start},#{item.end},
|
||||
#{item.lng},#{item.lat},#{item.pm10},#{item.pm25},#{item.desc_pm10_rank},
|
||||
|
@ -25,7 +25,7 @@
|
|||
</select>
|
||||
|
||||
<select id="getByMaxId" resultType="com.hisense.monitormanage.entity.RoadData">
|
||||
SELECT * FROM t_road_data ORDER BY id DESC limit 1
|
||||
SELECT * FROM t_road_data ORDER BY id DESC limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -3,21 +3,21 @@
|
|||
<mapper namespace="com.hisense.monitormanage.mapper.SanitationMapper">
|
||||
<insert id="batchSaveSanitationRoad" parameterType="java.util.List">
|
||||
INSERT INTO t_sanitation_road
|
||||
(bh,dlmc,qdlkdlmc,zdlkdlmc,zcgdlxzc,bjdj,dlzd,dlkd,dlzmj,cxdmj,rxdmj,jsmj,ssmj,
|
||||
gycxmj,bjysl,gpxsl,ssqybh,ssjdbsc,sshwgsbh,zbjh,sfqy,bh1,dtdlhzkd,
|
||||
zcgd,jsqz,cxqz,jj,tplj,zbdfxbz0zx1fx,fxzbxxid,ys,btmx,jsts,jspc,
|
||||
sfjs0bjs1js,sfss0bss1ss,sfcx0bcx1cx,sspc,cxpc,ssts,cxts,sfkh,updatetime
|
||||
)
|
||||
(bh,dlmc,qdlkdlmc,zdlkdlmc,zcgdlxzc,bjdj,dlzd,dlkd,dlzmj,cxdmj,rxdmj,jsmj,ssmj,
|
||||
gycxmj,bjysl,gpxsl,ssqybh,ssjdbsc,sshwgsbh,zbjh,sfqy,bh1,dtdlhzkd,
|
||||
zcgd,jsqz,cxqz,jj,tplj,zbdfxbz0zx1fx,fxzbxxid,ys,btmx,jsts,jspc,
|
||||
sfjs0bjs1js,sfss0bss1ss,sfcx0bcx1cx,sspc,cxpc,ssts,cxts,sfkh,updatetime
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.BH},#{item.DLMC},#{item.QDLKDLMC},#{item.ZDLKDLMC},#{item.ZCGDLXZC},#{item.BJDJ},#{item.DLZD},
|
||||
#{item.DLKD},#{item.DLZMJ},#{item.CXDMJ},#{item.RXDMJ},#{item.JSMJ},#{item.SSMJ},
|
||||
#{item.GYCXMJ},#{item.BJYSL},#{item.GPXSL},#{item.SSQYBH},#{item.SSJDBSC},#{item.SSHWGSBH},
|
||||
#{item.ZBJH},#{item.SFQY},#{item.BH1},#{item.DTDLHZKD},#{item.ZCGD},#{item.JSQZ},
|
||||
#{item.CXQZ},#{item.JJ},#{item.TPLJ},#{item.ZBDFXBZ0ZX1FX},#{item.FXZBXXID},#{item.YS},
|
||||
#{item.BTMX},#{item.JSTS},#{item.JSPC},#{item.SFJS0BJS1JS},#{item.SFSS0BSS1SS},#{item.SFCX0BCX1CX},
|
||||
#{item.SSPC},#{item.CXPC},#{item.SSTS},#{item.CXTS},#{item.SFKH},#{item.updatetime}
|
||||
#{item.BH},#{item.DLMC},#{item.QDLKDLMC},#{item.ZDLKDLMC},#{item.ZCGDLXZC},#{item.BJDJ},#{item.DLZD},
|
||||
#{item.DLKD},#{item.DLZMJ},#{item.CXDMJ},#{item.RXDMJ},#{item.JSMJ},#{item.SSMJ},
|
||||
#{item.GYCXMJ},#{item.BJYSL},#{item.GPXSL},#{item.SSQYBH},#{item.SSJDBSC},#{item.SSHWGSBH},
|
||||
#{item.ZBJH},#{item.SFQY},#{item.BH1},#{item.DTDLHZKD},#{item.ZCGD},#{item.JSQZ},
|
||||
#{item.CXQZ},#{item.JJ},#{item.TPLJ},#{item.ZBDFXBZ0ZX1FX},#{item.FXZBXXID},#{item.YS},
|
||||
#{item.BTMX},#{item.JSTS},#{item.JSPC},#{item.SFJS0BJS1JS},#{item.SFSS0BSS1SS},#{item.SFCX0BCX1CX},
|
||||
#{item.SSPC},#{item.CXPC},#{item.SSTS},#{item.CXTS},#{item.SFKH},#{item.updatetime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
@ -32,7 +32,7 @@
|
|||
(
|
||||
#{item.DLMC},#{item.KSDL},#{item.ZZDL},#{item.SSQS},#{item.CPH},#{item.ZYWCL},
|
||||
#{item.ZYRQ},#{item.ZYLX},#{item.ZYSJ},#{item.ZYTS},#{item.ZYPC},#{item.ZYZD},
|
||||
#{item.ZYKD},#{item.ZYMJ},#{item.WZYDS},#{item.ZYCSDS},#{item.ZYGPSDS},#{item.updatetime}
|
||||
#{item.ZYKD},#{item.ZYMJ},#{item.WZYDS},#{item.ZYCSDS},#{item.ZYGPSDS},#{item.updatetime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<mapper namespace="com.hisense.monitormanage.mapper.SedimentTrailMapper">
|
||||
|
||||
<insert id="batchaSave" parameterType="java.util.List">
|
||||
<foreach collection="list" item="item" separator=";" >
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
INSERT INTO t_trail_sediment
|
||||
(speed,sim_card_num,uploadtime,coordinate_x,coordinate_y,
|
||||
longitude,latitude,record_time,angle,update_time,status,fuel)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
INSERT INTO t_trail_sanitation
|
||||
(simkh,cph,fssj,jd,wd,sd,fx,zt,yl,lc,sfzx,bjzt,gd,updatetime)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator="," >
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.SIMKH},#{item.CPH},#{item.FSSJ},#{item.JD},#{item.WD},
|
||||
#{item.SD},#{item.FX},#{item.ZT},#{item.YL},#{item.LC},
|
||||
|
|
|
@ -4,40 +4,41 @@
|
|||
<select id="selectWaterPoint" resultType="com.hisense.monitormanage.dto.WaterPointDto">
|
||||
SELECT a.*,b.updated_date AS waterPointDepth
|
||||
FROM
|
||||
(SELECT wp.*,wpr.point_level
|
||||
FROM water_point wp
|
||||
LEFT JOIN water_point_report wpr
|
||||
ON wp.water_point_id = wpr.water_point_id
|
||||
WHERE wp.audit_flag = '2' AND wp.disp_flag IN (0,1)) a
|
||||
LEFT JOIN
|
||||
(SELECT c.*,wps.updated_date
|
||||
FROM water_point_sensor wps
|
||||
JOIN
|
||||
(SELECT water_point_id,MAX(water_point_area) AS water_point_area
|
||||
FROM water_point_sensor
|
||||
GROUP BY water_point_id) c
|
||||
ON wps.water_point_area = c.water_point_area
|
||||
AND wps.water_point_id = c.water_point_id) b
|
||||
ON a.water_point_id = b.water_point_id
|
||||
(SELECT wp.*,wpr.point_level
|
||||
FROM water_point wp
|
||||
LEFT JOIN water_point_report wpr
|
||||
ON wp.water_point_id = wpr.water_point_id
|
||||
WHERE wp.audit_flag = '2' AND wp.disp_flag IN (0,1)) a
|
||||
LEFT JOIN
|
||||
(SELECT c.*,wps.updated_date
|
||||
FROM water_point_sensor wps
|
||||
JOIN
|
||||
(SELECT water_point_id,MAX(water_point_area) AS water_point_area
|
||||
FROM water_point_sensor
|
||||
GROUP BY water_point_id) c
|
||||
ON wps.water_point_area = c.water_point_area
|
||||
AND wps.water_point_id = c.water_point_id) b
|
||||
ON a.water_point_id = b.water_point_id
|
||||
ORDER BY waterPointDepth DESC
|
||||
</select>
|
||||
<select id="selectCountWaters" resultType="com.hisense.monitormanage.dto.WaterPointDtos">
|
||||
SELECT c.report_origin,COUNT(*) as count,MAX(waterPointDepth) AS waterPointDepth FROM (SELECT a.*,b.updated_date AS waterPointDepth
|
||||
FROM
|
||||
(SELECT wp.*,wpr.point_level
|
||||
FROM water_point wp
|
||||
LEFT JOIN water_point_report wpr
|
||||
ON wp.water_point_id = wpr.water_point_id
|
||||
WHERE wp.audit_flag = '2' AND wp.disp_flag IN (0,1)) a
|
||||
LEFT JOIN
|
||||
(SELECT c.*,wps.updated_date
|
||||
FROM water_point_sensor wps
|
||||
JOIN
|
||||
(SELECT water_point_id,MAX(water_point_area) AS water_point_area
|
||||
FROM water_point_sensor
|
||||
GROUP BY water_point_id) c
|
||||
ON wps.water_point_area = c.water_point_area
|
||||
AND wps.water_point_id = c.water_point_id) b
|
||||
ON a.water_point_id = b.water_point_id) c GROUP BY c.report_origin
|
||||
SELECT c.report_origin,COUNT(*) as count,MAX(waterPointDepth) AS waterPointDepth FROM (SELECT a.*,b.updated_date
|
||||
AS waterPointDepth
|
||||
FROM
|
||||
(SELECT wp.*,wpr.point_level
|
||||
FROM water_point wp
|
||||
LEFT JOIN water_point_report wpr
|
||||
ON wp.water_point_id = wpr.water_point_id
|
||||
WHERE wp.audit_flag = '2' AND wp.disp_flag IN (0,1)) a
|
||||
LEFT JOIN
|
||||
(SELECT c.*,wps.updated_date
|
||||
FROM water_point_sensor wps
|
||||
JOIN
|
||||
(SELECT water_point_id,MAX(water_point_area) AS water_point_area
|
||||
FROM water_point_sensor
|
||||
GROUP BY water_point_id) c
|
||||
ON wps.water_point_area = c.water_point_area
|
||||
AND wps.water_point_id = c.water_point_id) b
|
||||
ON a.water_point_id = b.water_point_id) c GROUP BY c.report_origin
|
||||
</select>
|
||||
</mapper>
|
|
@ -29,21 +29,21 @@ class MonitorManageApplicationTests {
|
|||
// }
|
||||
|
||||
@Test
|
||||
void start1(){
|
||||
void start1() {
|
||||
buildingRecordsService.getAndSaveRecords();
|
||||
}
|
||||
|
||||
@Test
|
||||
void start2(){
|
||||
void start2() {
|
||||
roadDataService.saveRoadData();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void videoService()throws IOException ,InterruptedException{
|
||||
void videoService() throws IOException, InterruptedException {
|
||||
|
||||
monitorService.videoService("","");
|
||||
monitorService.videoService("", "");
|
||||
|
||||
System.out.println(JSONObject.toJSONString(MonitorService.cameras));
|
||||
|
||||
|
|
Loading…
Reference in New Issue