From 1ae322e4359f903f7f107c56f75cd35482ee6e1b Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Tue, 5 Jul 2022 13:58:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=A5=E5=9C=B0=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E5=99=AA=E5=A3=B0=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BuildingController.java | 12 ++++++++++++ .../monitormanage/mapper/BuildingRecordsMapper.java | 2 ++ .../hisense/monitormanage/service/EventService.java | 4 +++- .../monitormanage/service/RoadDataService.java | 2 +- src/main/resources/mapper/BuildingRecordsMapper.xml | 13 +++++++++++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java index 4098dbb..e146290 100644 --- a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java +++ b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java @@ -113,6 +113,18 @@ public class BuildingController { return success; } + /** + * 查询工地噪声事件 + * @return + */ + @GetMapping("selectNoiceEvent") + @ApiOperation("查询工地噪声事件") + public Result selectNoiceEvent(Integer page,Integer pageSize){ + List recordsDtos = buildingRecordsMapper.selectNoiceEvent(page,pageSize); + Result success = Result.success(recordsDtos); + return success; + } + /** * 根据工地名称搜索工地 * @param projectName diff --git a/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java b/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java index f547023..dda16e7 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java @@ -36,6 +36,8 @@ public interface BuildingRecordsMapper extends BaseMapper { List selectRaise(@Param("page") Integer page,@Param("pageSize") Integer pageSize); + List selectNoiceEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize); + @Select("select br.*,bs.sgwz,bs.jd,bs.wd,bs.ssdq,bs.yjsg from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + " where br.project_name like concat('%',#{projectName},'%')") List selectByProjectName(String projectName); diff --git a/src/main/java/com/hisense/monitormanage/service/EventService.java b/src/main/java/com/hisense/monitormanage/service/EventService.java index 4028e3d..576b0e7 100644 --- a/src/main/java/com/hisense/monitormanage/service/EventService.java +++ b/src/main/java/com/hisense/monitormanage/service/EventService.java @@ -101,6 +101,7 @@ public class EventService { public void screenshot(){ String url = "http://218.58.65.132:2580/api/haixin"; + String image = "http://120.221.72.8:7002"; QueryWrapper queryWrapper = new QueryWrapper<>(); List events = eventMapper.selectList(queryWrapper); events.forEach(event -> { @@ -111,7 +112,8 @@ public class EventService { map.put("cjname",event.getEventCnName()); map.put("datetime",event.getCaptureTime()); map.put("vidorpic",0); - map.put("resultpicurl1",event.getImageUrl()); + String substring = event.getImageUrl().substring(26); + map.put("resultpicurl1",image + substring); map.put("piclongitude",event.getLongitude()); map.put("piclatitude",event.getLatitude()); map.put("sign", SecureUtil.md5(sign)); diff --git a/src/main/java/com/hisense/monitormanage/service/RoadDataService.java b/src/main/java/com/hisense/monitormanage/service/RoadDataService.java index c747572..122f4fd 100644 --- a/src/main/java/com/hisense/monitormanage/service/RoadDataService.java +++ b/src/main/java/com/hisense/monitormanage/service/RoadDataService.java @@ -68,7 +68,7 @@ public class RoadDataService { } //道路统计数据与排名(道路污染),调用公开接口并保存到表t_road_data - @Scheduled(cron="0 0 8 * * ?") + @Scheduled(cron="0 0 7 * * ?") public void saveRoadData(){ String url = "http://outerdata.novaecs.com/api/qingdaoData/roadData?groupId={groupId}&timeType={timeType}&dt={dt}"; diff --git a/src/main/resources/mapper/BuildingRecordsMapper.xml b/src/main/resources/mapper/BuildingRecordsMapper.xml index d7f010f..d6adeb4 100644 --- a/src/main/resources/mapper/BuildingRecordsMapper.xml +++ b/src/main/resources/mapper/BuildingRecordsMapper.xml @@ -37,4 +37,17 @@ limit #{page},#{pageSize} + + \ No newline at end of file