From 37344537965177d6be00d96ab2038800995b7c3d Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 1 Jun 2022 19:12:31 +0800 Subject: [PATCH] ... --- lib/yawei-pso-2.0.2.jar | Bin 0 -> 10463 bytes renren-admin/pom.xml | 45 +- .../main/java/io/renren/AdminApplication.java | 10 + .../common/aspect/ActivitiNoticeAspect.java | 144 +- .../common/config/RestTemplateConfig.java | 7 + .../interceptor/IdentityInterceptor.java | 112 -- .../renren/common/interceptor/Validator.java | 83 -- .../activiti/service/ActModelService.java | 2 +- .../modules/monitor/config/CachingConfig.java | 33 + .../monitor/config/GlobalCorsConfig.java | 32 + .../controller/BuildingController.java | 58 + .../monitor/controller/Controller.java | 565 ++++++++ .../monitor/controller/EventController.java | 183 +++ .../monitor/controller/FileController.java | 42 + .../monitor/controller/FordController.java | 55 + .../monitor/controller/SJZTController.java | 54 + .../controller/SanitationController.java | 44 + .../monitor/controller/StaticController.java | 38 + .../modules/monitor/dto/CameraChannelDto.java | 14 + .../monitor/dto/CameraChannelDto1.java | 28 + .../monitor/dto/CameraChannelNLDto.java | 28 + .../modules/monitor/dto/ChannelLabelDto.java | 23 + .../monitor/dto/ChannelPictureDto.java | 24 + .../modules/monitor/dto/ChengguanDto.java | 14 + .../modules/monitor/dto/ScenicCameraDto.java | 33 + .../renren/modules/monitor/entity/Booth.java | 19 + .../monitor/entity/BuildingRecords.java | 43 + .../modules/monitor/entity/BuildingSite.java | 28 + .../renren/modules/monitor/entity/Camera.java | 26 + .../modules/monitor/entity/CameraChannel.java | 32 + .../modules/monitor/entity/CameraCheck.java | 28 + .../monitor/entity/CameraOrganization.java | 22 + .../modules/monitor/entity/CameraScenic.java | 16 + .../modules/monitor/entity/CaseCityLaw.java | 60 + .../monitor/entity/ChannelPicture.java | 23 + .../renren/modules/monitor/entity/Event.java | 27 + .../renren/modules/monitor/entity/Label.java | 17 + .../modules/monitor/entity/PassengerFlow.java | 30 + .../modules/monitor/entity/Picture.java | 14 + .../modules/monitor/entity/Project.java | 30 + .../renren/modules/monitor/entity/Result.java | 35 + .../modules/monitor/entity/RoadData.java | 42 + .../modules/monitor/entity/Sanitation.java | 66 + .../monitor/entity/SanitationRoad.java | 70 + .../monitor/entity/SanitationTask.java | 69 + .../renren/modules/monitor/entity/Scenic.java | 33 + .../modules/monitor/entity/SedimentTrail.java | 41 + .../monitor/entity/TrailSanitation.java | 45 + .../modules/monitor/mapper/BoothMapper.java | 16 + .../monitor/mapper/BuildingRecordsMapper.java | 24 + .../monitor/mapper/BuildingSiteMapper.java | 23 + .../monitor/mapper/CameraChannelMapper.java | 65 + .../modules/monitor/mapper/CameraMapper.java | 24 + .../mapper/CameraOrgenizationMapper.java | 17 + .../monitor/mapper/CameraScenicMapper.java | 10 + .../monitor/mapper/CaseCityLawMapper.java | 23 + .../monitor/mapper/ChannelPictureMapper.java | 18 + .../modules/monitor/mapper/EventMapper.java | 22 + .../monitor/mapper/PassengerFlowlMapper.java | 16 + .../modules/monitor/mapper/ProjectMapper.java | 11 + .../monitor/mapper/RoadDataMapper.java | 21 + .../monitor/mapper/SanitationMapper.java | 24 + .../monitor/mapper/SanitationTaskMapper.java | 17 + .../modules/monitor/mapper/ScenicMapper.java | 23 + .../monitor/mapper/SedimentTrailMapper.java | 21 + .../monitor/mapper/TrailSanitationMapper.java | 15 + .../service/BuildingRecordsService.java | 91 ++ .../monitor/service/BuildingSiteService.java | 39 + .../monitor/service/CameraChannelService.java | 41 + .../modules/monitor/service/EventService.java | 93 ++ .../monitor/service/MonitorService.java | 1196 +++++++++++++++++ .../monitor/service/PassengerFlowService.java | 283 ++++ .../monitor/service/RoadDataService.java | 110 ++ .../modules/monitor/service/SJZTService.java | 221 +++ .../monitor/service/SanitationService.java | 105 ++ .../monitor/service/SedimentTrailService.java | 71 + .../service/TrailSanitationService.java | 48 + .../modules/monitor/utils/EhcacheUtil.java | 53 + .../modules/monitor/utils/LongLatUtil.java | 63 + .../monitorCamera/service/CameraService.java | 89 ++ .../service/ApiGatewayService.java | 11 +- .../resource/entity/ResourceEntity.java | 4 +- .../modules/security/config/WebMvcConfig.java | 4 - .../security/controller/LoginController.java | 14 +- .../modules/security/oauth2/Oauth2Filter.java | 246 ++-- .../security/oauth2/YaWeiCookieManage.java | 48 + .../src/main/resources/application-dev.yml | 1 + .../src/main/resources/application-hwx.yml | 6 +- .../src/main/resources/application-prod.yml | 3 +- renren-admin/src/main/resources/ehcache.xml | 33 + .../mapper/monitor/BuildingRecordsMapper.xml | 19 + .../mapper/monitor/CameraChannelMapper.xml | 35 + .../monitor/CameraOrganizationMapper.xml | 5 + .../mapper/monitor/CameraScenicMapper.xml | 5 + .../mapper/monitor/CaseCityLawMapper.xml | 38 + .../mapper/monitor/ChannelPicture.xml | 5 + .../resources/mapper/monitor/EventMapper.xml | 5 + .../mapper/monitor/PassengerFlowlMapper.xml | 21 + .../mapper/monitor/RoadDataMapper.xml | 19 + .../mapper/monitor/SanitationMapper.xml | 53 + .../mapper/monitor/SedimentTrailMapper.xml | 19 + .../mapper/monitor/TrailSanitationMapper.xml | 18 + .../src/main/resources/yaweisso.properties | 4 +- .../java/io/renren/ApiGatewayServiceTest.java | 25 +- .../test/java/io/renren/CameraDataTest.java | 33 + 105 files changed, 5738 insertions(+), 316 deletions(-) create mode 100644 lib/yawei-pso-2.0.2.jar delete mode 100644 renren-admin/src/main/java/io/renren/common/interceptor/IdentityInterceptor.java delete mode 100644 renren-admin/src/main/java/io/renren/common/interceptor/Validator.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/config/CachingConfig.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/config/GlobalCorsConfig.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/controller/BuildingController.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/controller/Controller.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/controller/EventController.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/controller/FileController.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/controller/FordController.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/controller/SJZTController.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/controller/SanitationController.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/controller/StaticController.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/dto/CameraChannelDto.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/dto/CameraChannelDto1.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/dto/CameraChannelNLDto.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/dto/ChannelLabelDto.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/dto/ChannelPictureDto.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/dto/ChengguanDto.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/dto/ScenicCameraDto.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/Booth.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/BuildingRecords.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/BuildingSite.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/Camera.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/CameraChannel.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/CameraCheck.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/CameraOrganization.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/CameraScenic.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/CaseCityLaw.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/ChannelPicture.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/Event.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/Label.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/PassengerFlow.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/Picture.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/Project.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/Result.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/RoadData.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/Sanitation.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/SanitationRoad.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/SanitationTask.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/Scenic.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/SedimentTrail.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/entity/TrailSanitation.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/BoothMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/BuildingRecordsMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/BuildingSiteMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/CameraChannelMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/CameraMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/CameraOrgenizationMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/CameraScenicMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/CaseCityLawMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/ChannelPictureMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/EventMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/PassengerFlowlMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/ProjectMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/RoadDataMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/SanitationMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/SanitationTaskMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/ScenicMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/SedimentTrailMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/mapper/TrailSanitationMapper.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/service/BuildingRecordsService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/service/BuildingSiteService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/service/CameraChannelService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/service/EventService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/service/MonitorService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/service/PassengerFlowService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/service/RoadDataService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/service/SJZTService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/service/SanitationService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/service/SedimentTrailService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/service/TrailSanitationService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/utils/EhcacheUtil.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitor/utils/LongLatUtil.java create mode 100644 renren-admin/src/main/java/io/renren/modules/monitorCamera/service/CameraService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/security/oauth2/YaWeiCookieManage.java create mode 100644 renren-admin/src/main/resources/ehcache.xml create mode 100644 renren-admin/src/main/resources/mapper/monitor/BuildingRecordsMapper.xml create mode 100644 renren-admin/src/main/resources/mapper/monitor/CameraChannelMapper.xml create mode 100644 renren-admin/src/main/resources/mapper/monitor/CameraOrganizationMapper.xml create mode 100644 renren-admin/src/main/resources/mapper/monitor/CameraScenicMapper.xml create mode 100644 renren-admin/src/main/resources/mapper/monitor/CaseCityLawMapper.xml create mode 100644 renren-admin/src/main/resources/mapper/monitor/ChannelPicture.xml create mode 100644 renren-admin/src/main/resources/mapper/monitor/EventMapper.xml create mode 100644 renren-admin/src/main/resources/mapper/monitor/PassengerFlowlMapper.xml create mode 100644 renren-admin/src/main/resources/mapper/monitor/RoadDataMapper.xml create mode 100644 renren-admin/src/main/resources/mapper/monitor/SanitationMapper.xml create mode 100644 renren-admin/src/main/resources/mapper/monitor/SedimentTrailMapper.xml create mode 100644 renren-admin/src/main/resources/mapper/monitor/TrailSanitationMapper.xml create mode 100644 renren-admin/src/test/java/io/renren/CameraDataTest.java diff --git a/lib/yawei-pso-2.0.2.jar b/lib/yawei-pso-2.0.2.jar new file mode 100644 index 0000000000000000000000000000000000000000..d3e0a29b2119953777325b640e870a50569a1b12 GIT binary patch literal 10463 zcmb7q1z1(<@;)J*0@B^FHz^%TcXzW1>Fy3;)7?mjbc%v>cS?6i3ew%e53ctd&(VAC z|9^*P@3nZCd6{pmZ`RD3c@?CgpCCd!%Bh94{J&2A{e|#wloeGG1WL+@F)9384Ibj; zL9MVMyvXX| oSbtTM6_k?{6IE7WlodOX9UPF61~QJKNCW9V4-Qu$z$P*bJ?dZguHWY>rY+8T4gX^sJaCj;!u=>ETM4(n`v$hEXt~eRxHP z&7mem?ugwUFX2aH-|ZyEp?vHV8YW#@h)E7lMuPamJBWXI_u$Z<^5o&n$kzH#|9{tb zT>PVkJIK|<{J-d-{!P!$(e}US;{2xTXkz5-VD9Apr_qlK*(YX`#|Z@iLI2<<@oz>V zASV+E6DvCt2Sy_+kfURylCC_aAQu04xo$lp5KBP>OQp~{yObmlj=A}5E*g+8A?C1l zG0M5(CU#GyRbN# z6m>r~GFGB8%ZFEOo%O7$m;}^>nD22}4@5}UJ;6>zUY!QJVC&B@@5B8LF1}+&qb;f> zlLvWh)h$wRV)x4jfNudF$Vkpirx}hH2}m^CL7(B&kMR%0_?AE^`*wBn(MH6*`4MPA z^3Iic4&OV!Z}aGKZgF8@3k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-20VHJ=C5lxJWdYJdYa2=~4E-vH@{Eei&sCV8SF^HKvvR20 zp`t1>vocq$Z_xjn_QF2KHo~^PA;r|s1U!`aAp3cEvP1?TKQu8Q4`5r}kOI*6$w#3tY4#V& z&QFBjX)=#QnjiA`kGmdDf6!`vy81{A`a|dO_+tT&XO9+}568dKZ2sBqk!bTn9_`Q` z;_;{5kC^>u+ehNfPg~yKZ2z2r{aosQCgS`7lk0Ey8_2J;oL{kiWmx>gT6<_x{j!)} z_!hrn{W{Y7iPik@=KXi9KNt7gfbUn-U&l^AQSFfa5%rfL)UTMoHq3uwB0fC&|H0E= z+ULJw{@U34iCK;DE9P%)zF)z9ZCCsR17iOQ_8*!TKjD5)SC6^vhoD2;-^-K!CA|K~ zbU*j(uROcQT=zpBjlD>JGk&;sf6sjXjP;oNe#j$ME$ROY>#v#c57hsh3;)2)^}qWc vQ2(77e_p%){8au4K1%-o@A4z~&u6rPG|WT$7Xkv~;fLda-xN>r_}l*hcq+^N literal 0 HcmV?d00001 diff --git a/renren-admin/pom.xml b/renren-admin/pom.xml index 6592369f..2c5300ba 100644 --- a/renren-admin/pom.xml +++ b/renren-admin/pom.xml @@ -32,6 +32,12 @@ 2.9.0 2.4.17 2.5.1 + 2.4.4 + 1.2.72 + 2.10.6 + 1.5.7 + linux-x86_64 + 5.0 1.8 @@ -223,6 +229,43 @@ org.springframework.boot spring-boot-test-autoconfigure + + + com.alibaba + fastjson + ${fastjson.version} + + + + org.springframework.boot + spring-boot-starter-cache + ${spring-boot-starter-cache.version} + + + + net.sf.ehcache + ehcache + ${ehcache.version} + + + + + org.bytedeco + javacv + ${javacv.version} + + + org.bytedeco + javacpp-platform + ${javacv.version} + + + + org.bytedeco + ffmpeg + ${ffmpeg.version}-${javacv.version} + ${system.linux-x86_64} + @@ -232,7 +275,7 @@ src/main/resources - application-prod.yml + diff --git a/renren-admin/src/main/java/io/renren/AdminApplication.java b/renren-admin/src/main/java/io/renren/AdminApplication.java index a21188a0..e8bd16f8 100644 --- a/renren-admin/src/main/java/io/renren/AdminApplication.java +++ b/renren-admin/src/main/java/io/renren/AdminApplication.java @@ -1,9 +1,14 @@ package io.renren; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.scheduling.annotation.EnableScheduling; +import springfox.documentation.swagger2.annotations.EnableSwagger2; /** @@ -14,10 +19,15 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer org.activiti.spring.boot.SecurityAutoConfiguration.class, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class }) +@EnableSwagger2 +//@MapperScan("io.renren.modules.monitor.mapper") +@EnableCaching +@EnableScheduling public class AdminApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(AdminApplication.class, args); + System.out.println("项目启动成功"); } @Override diff --git a/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java b/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java index b1de7dfe..63b55082 100644 --- a/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java +++ b/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java @@ -5,7 +5,13 @@ import io.renren.common.annotation.ActivitiNoticeOperation; import io.renren.modules.notice.dto.SysNoticeDTO; import io.renren.modules.notice.enums.NoticeStatusEnum; import io.renren.modules.notice.service.SysNoticeService; +import io.renren.modules.resource.dto.ResourceDTO; +import io.renren.modules.resource.service.ResourceService; +import io.renren.modules.sys.dto.SysDeptDTO; +import io.renren.modules.sys.dto.SysRoleDTO; import io.renren.modules.sys.dto.SysUserDTO; +import io.renren.modules.sys.service.SysDeptService; +import io.renren.modules.sys.service.SysRoleService; import io.renren.modules.sys.service.SysUserService; import org.activiti.engine.delegate.DelegateExecution; import org.activiti.engine.delegate.DelegateTask; @@ -20,6 +26,7 @@ import org.aspectj.lang.reflect.MethodSignature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import java.lang.reflect.Method; @@ -38,8 +45,19 @@ public class ActivitiNoticeAspect { private SysNoticeService sysNoticeService; @Autowired private SysUserService sysUserService; + @Autowired + private ResourceService resourceService; + @Autowired + private SysDeptService sysDeptService; + @Autowired + private SysRoleService sysRoleService; private Set work_ = new CopyOnWriteArraySet<>(); + @Value("${big_date.name}") + private String bigDateDeptName; // 大数据局名称 + @Value("${big_date.assignee_role_name}") + private String roleName; // 具备审批的角色名称 + public ActivitiNoticeAspect() { logger.error("构造:ActivitiNoticeAspect"); } @@ -62,11 +80,14 @@ public class ActivitiNoticeAspect { Arrays.asList(joinPoint.getArgs()).stream().findFirst().ifPresent(arg -> { final DelegateTask delegateTask = (DelegateTask) arg; final String eventName = delegateTask.getEventName(); + logger.error("任务监听器事件:" + eventName); switch (eventName) { case TaskListener.EVENTNAME_ASSIGNMENT: // 节点被委派给某人 - logger.error("任务监听器事件:" + eventName); assignment_notice(delegateTask, activitiNoticeOperation); break; + case TaskListener.EVENTNAME_COMPLETE: // 节点执行完成 + task_complete_notice(delegateTask, activitiNoticeOperation); + break; default: } }); @@ -76,9 +97,9 @@ public class ActivitiNoticeAspect { Arrays.asList(joinPoint.getArgs()).stream().findFirst().ifPresent(arg -> { final DelegateExecution execution = (DelegateExecution) arg; final String eventName = execution.getEventName(); + logger.error("执行监听器事件:" + eventName); switch (eventName) { - case ExecutionListener.EVENTNAME_END: // 节点被委派给某人 - logger.error("执行监听器事件:" + eventName); + case ExecutionListener.EVENTNAME_END: // 流程完成 end_notice(execution, activitiNoticeOperation); break; default: @@ -92,6 +113,86 @@ public class ActivitiNoticeAspect { logger.error("执行时长{} ms", time); } + /** + * 进行节点流转 + * + * @param delegateTask + * @param activitiNoticeOperation + */ + private void task_complete_notice(final DelegateTask delegateTask, final ActivitiNoticeOperation activitiNoticeOperation) { + Map kv = delegateTask.getVariables(); + logger.error("表单:" + kv.toString()); + if (work_.contains(kv.get("id").toString())) { + logger.error("------------出现重放------------"); + return; + } + work_.add(kv.get("id").toString()); + String creator = null; + if (kv.containsKey("creator")) { // 表单存在创建者 + creator = kv.get("creator").toString(); + } else if (kv.containsKey("userId")) { + creator = kv.get("userId").toString(); + } + if (StringUtils.isEmpty(creator)) { + return; + } + try { + String result; + Boolean termination = + Boolean.valueOf(kv.get("termination") != null ? kv.get("termination").toString() : Boolean.FALSE.toString()); // 直接终结 + Boolean reject = + Boolean.valueOf(kv.get("reject") != null ? kv.get("reject").toString() : Boolean.FALSE.toString()); // 被拒绝 + if (termination) { + result = "终止被拒"; + } else if (reject) { + result = "被拒"; + } else { + result = "通过"; + } + String finalCreator = creator; + String finalResult = result; + CompletableFuture.runAsync(() -> { // 发起人 + SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator)); + Long resourceId = null; + if (kv.containsKey("resourceId")) { + resourceId = Long.valueOf(kv.get("resourceId").toString()); + } else if (kv.containsKey("id")) { + resourceId = Long.valueOf(kv.get("id").toString()); + } + Optional resourceDTO = Optional.ofNullable(resourceService.get(resourceId)); + kv.get("resourceId"); + kv.get("id"); + String content = "【通知】" + userDTO.getRealName() + ",您发起的" + (resourceDTO.isPresent() ? resourceDTO.get().getName() : "") + + activitiNoticeOperation.process() + " " + activitiNoticeOperation.value() + "节点" + finalResult; + SysNoticeDTO dto = new SysNoticeDTO(); + dto.setType(2); + dto.setTitle("流程结束系统通知"); + dto.setContent(content); // 通知内容 + dto.setReceiverType(1); + dto.setReceiverTypeIds(finalCreator); + dto.setStatus(NoticeStatusEnum.SEND.value()); + dto.setSenderName("流程系统"); + dto.setSenderDate(new Date()); + dto.setCreator(sysUserService.getByUsername("admin").getId()); + dto.setCreateDate(new Date()); + sysNoticeService.save(dto); + }).thenRunAsync(() -> { + // 防止重放 + new Thread(() -> { + try { + Thread.sleep(200); + work_.remove(kv.get("id").toString()); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + }).start(); + }); + + } catch (Exception e) { + + } + } + /** * 流程结束时通知 * @@ -130,8 +231,19 @@ public class ActivitiNoticeAspect { } String finalCreator = creator; String finalResult = result; + Long resourceId = null; + if (kv.containsKey("resourceId")) { + resourceId = Long.valueOf(kv.get("resourceId").toString()); + } else if (kv.containsKey("id")) { + resourceId = Long.valueOf(kv.get("id").toString()); + } + Optional resourceDTO = Optional.ofNullable(resourceService.get(resourceId)); CompletableFuture.runAsync(() -> { // 发起人 - String content = "您发起的流程<" + activitiNoticeOperation.process() + "> 已结束。审核结果为:" + finalResult; + SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator)); + kv.get("resourceId"); + kv.get("id"); + String content = "【通知】" + userDTO.getRealName() + ",您发起的" + (resourceDTO.isPresent() ? resourceDTO.get().getName() : "") + + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult; SysNoticeDTO dto = new SysNoticeDTO(); dto.setType(2); dto.setTitle("流程结束系统通知"); @@ -144,6 +256,30 @@ public class ActivitiNoticeAspect { dto.setCreator(sysUserService.getByUsername("admin").getId()); dto.setCreateDate(new Date()); sysNoticeService.save(dto); + }).thenRunAsync(() -> { + logger.error("大数据局名称:" + bigDateDeptName); + SysDeptDTO deptDTO = sysDeptService.getByName(bigDateDeptName); + logger.error("deptDTOId:" + deptDTO.getId()); + SysRoleDTO roleDTO = sysRoleService.getByName(roleName); + logger.error("roleDTOId:" + roleDTO.getId()); + Optional userDTO = Optional.ofNullable(sysUserService.getByDeptIdAndRoleId(deptDTO.getId(), roleDTO.getId())); + userDTO.ifPresent(user -> { + SysUserDTO creatorDTO = sysUserService.get(Long.valueOf(finalCreator)); + SysNoticeDTO dto = new SysNoticeDTO(); + dto.setType(2); + dto.setTitle("流程结束系统通知"); + String content = "【通知】" + user.getRealName() + "," + creatorDTO.getRealName() + "发起的" + (resourceDTO.isPresent() ? resourceDTO.get().getName() : "") + + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult; + dto.setContent(content); // 通知内容 + dto.setReceiverType(1); + dto.setReceiverTypeIds(finalCreator); + dto.setStatus(NoticeStatusEnum.SEND.value()); + dto.setSenderName("流程系统"); + dto.setSenderDate(new Date()); + dto.setCreator(sysUserService.getByUsername("admin").getId()); + dto.setCreateDate(new Date()); + sysNoticeService.save(dto); + }); }).thenRunAsync(() -> { // 防止重放 new Thread(() -> { diff --git a/renren-admin/src/main/java/io/renren/common/config/RestTemplateConfig.java b/renren-admin/src/main/java/io/renren/common/config/RestTemplateConfig.java index f910548b..dcaeef28 100644 --- a/renren-admin/src/main/java/io/renren/common/config/RestTemplateConfig.java +++ b/renren-admin/src/main/java/io/renren/common/config/RestTemplateConfig.java @@ -9,6 +9,9 @@ import org.springframework.http.converter.StringHttpMessageConverter; import org.springframework.web.client.RestTemplate; import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.SocketAddress; import java.nio.charset.Charset; import java.util.Collections; @@ -27,6 +30,10 @@ public class RestTemplateConfig { SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); factory.setReadTimeout(30000);//单位为ms factory.setConnectTimeout(30000);//单位为ms + +// SocketAddress address = new InetSocketAddress("127.0.0.1", 8888); +// Proxy proxy = new Proxy(Proxy.Type.HTTP, address); +// factory.setProxy(proxy); return factory; } } diff --git a/renren-admin/src/main/java/io/renren/common/interceptor/IdentityInterceptor.java b/renren-admin/src/main/java/io/renren/common/interceptor/IdentityInterceptor.java deleted file mode 100644 index fbba7ca1..00000000 --- a/renren-admin/src/main/java/io/renren/common/interceptor/IdentityInterceptor.java +++ /dev/null @@ -1,112 +0,0 @@ -package io.renren.common.interceptor; - -import com.yawei.pso.PSORequest; -import com.yawei.pso.SSOResponse; -import com.yawei.pso.TicketManager; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.web.servlet.HandlerInterceptor; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.net.URLEncoder; -import java.util.Iterator; -import java.util.Map.Entry; - -/** - * 亚微 sso拦截 - */ -@Component -public class IdentityInterceptor implements HandlerInterceptor { - private static Logger logger = LoggerFactory.getLogger(IdentityInterceptor.class); - - public final static String SEESION_USER = "seesion_user"; - - @Autowired - private YaweiSSOProperties yaweiSSOProperties; - - - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - logger.info("==============执行顺序: 1、preHandle================"); - // 获取当前请求的url - String requestUri = request.getRequestURI(); - - Validator validator = Validator.getInstance(); - - String strResponse = request.getParameter(yaweiSSOProperties.getSsoKey()); - if (StringUtils.isEmpty(strResponse)) { - TicketManager tm = new TicketManager(); - if (!tm.LoadTicket(request)) { - PSORequest psoRequest = new PSORequest(request); - String requeststr = psoRequest.CreateHash(); - - String keeperUrl = yaweiSSOProperties.getKeeperUrl(); - keeperUrl = keeperUrl + "?" + yaweiSSOProperties.getSsoKey() + "=" - + URLEncoder.encode(requeststr, "UTF-8"); - response.addHeader("REDIRECT", keeperUrl); - response.sendRedirect(keeperUrl); - return false; - } - } else { - // 如果服务器端通过认证后,会返回后执行改操作,然后写入cookie - SSOResponse ssoResp = new SSOResponse(strResponse); - TicketManager tm = ssoResp.CreatePSOTicket(); - if (tm == null) { - PSORequest psoRequest = new PSORequest(request); - String requeststr = psoRequest.CreateHash(); - - String keeperUrl = yaweiSSOProperties.getKeeperUrl(); - keeperUrl = keeperUrl + "?" + yaweiSSOProperties.getSsoKey() + "=" - + URLEncoder.encode(requeststr, "UTF-8"); - response.sendRedirect(keeperUrl); - } else { - String domainName = yaweiSSOProperties.getDomain(); - tm.SaveTicket(response, domainName); - Iterator> iterator = request - .getParameterMap().entrySet().iterator(); - StringBuffer param = new StringBuffer(); - int i = 0; - while (iterator.hasNext()) { - Entry entry = (Entry) iterator - .next(); - if (entry.getKey().equals(yaweiSSOProperties.getSsoKey())) - continue; - else { - i++; - if (i == 1) - param.append("?").append(entry.getKey()) - .append("="); - else - param.append("&").append(entry.getKey()) - .append("="); - - if (entry.getValue() instanceof String[]) { - param.append(((String[]) entry.getValue())[0]); - } else { - param.append(entry.getValue()); - } - } - } - response.sendRedirect(requestUri + param.toString()); - return false; - } - } - validator.SetUserTicket(request); - return true; - } - - @Override - public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { - logger.info("==============执行顺序: 2、postHandle================"); - } - - @Override - public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { - logger.info("==============执行顺序: 3、afterCompletion================"); - } -} diff --git a/renren-admin/src/main/java/io/renren/common/interceptor/Validator.java b/renren-admin/src/main/java/io/renren/common/interceptor/Validator.java deleted file mode 100644 index b02bc2f7..00000000 --- a/renren-admin/src/main/java/io/renren/common/interceptor/Validator.java +++ /dev/null @@ -1,83 +0,0 @@ -package io.renren.common.interceptor; - -import com.yawei.pso.TicketManager; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -/** - * 验证器 - */ -public class Validator { - private static Logger logger = LoggerFactory.getLogger(Validator.class); - private static ThreadLocal validatorHolder = new ThreadLocal() { - - protected Validator initialValue() { - return new Validator(); - } - - }; - - // 当前请求的session - private HttpSession session = null; - - // 当前的请求 - private HttpServletRequest request = null; - - private Validator() { - - } - - public static Validator getInstance() { - return validatorHolder.get(); - } - - /** - * 执行初始化 - * - * @param httpRequest - */ - public void init(HttpServletRequest httpRequest) { - this.request = httpRequest; - this.session = request.getSession(); - } - - /** - * 将凭证身份加入到session - * - * @param httpRequest - */ - public void SetUserTicket(HttpServletRequest httpRequest) { - try { - if (httpRequest.getSession() - .getAttribute(IdentityInterceptor.SEESION_USER) == null) { - TicketManager ticket = new TicketManager(); - if (ticket.LoadTicket(httpRequest)) { - // 登录用户姓名 - String userName = ticket.getUserName(); - // 登录用户账号 - String userAccount = ticket.getUserID(); - // 登录用户标识 - String userGuid = ticket.getADGUID(); - logger.info("===userName===" + userName); - logger.info("===userAccount===" + userAccount); - logger.info("===userGuid===" + userGuid); - } - } else { - - } - } catch (Exception ex) { - logger.error("", ex); - } - } - - /** - * 清除session - */ - public void cancel() { - this.session = null; - } - -} diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActModelService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActModelService.java index db654be6..0cd8dd97 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActModelService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActModelService.java @@ -172,7 +172,7 @@ public class ActModelService { BufferedImage bufferedImage = ImageIO.read(in); ImageIO.write(bufferedImage, "png", response.getOutputStream()); } else { - response.getWriter().println("No image Info!"); + response.getOutputStream().println("No image Info!"); } } catch (IOException e) { e.printStackTrace(); diff --git a/renren-admin/src/main/java/io/renren/modules/monitor/config/CachingConfig.java b/renren-admin/src/main/java/io/renren/modules/monitor/config/CachingConfig.java new file mode 100644 index 00000000..16d299ed --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/monitor/config/CachingConfig.java @@ -0,0 +1,33 @@ +package io.renren.modules.monitor.config; + +import net.sf.ehcache.CacheManager; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.cache.ehcache.EhCacheCacheManager; +import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.ClassPathResource; + + +/** + * @author admin + * @version 1.0.0 + * @ClassName CachingConfig.java + * @Description cache配置 + * @createTime 2022年05月12日 09:45:00 + */ +@Configuration +@EnableCaching +public class CachingConfig { + @Bean + public EhCacheCacheManager cacheManager(CacheManager cm) { + return new EhCacheCacheManager(cm); + } + + @Bean + public EhCacheManagerFactoryBean ehcache() { + EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean(); + cacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache.xml")); + return cacheManagerFactoryBean; + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/monitor/config/GlobalCorsConfig.java b/renren-admin/src/main/java/io/renren/modules/monitor/config/GlobalCorsConfig.java new file mode 100644 index 00000000..4aa28724 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/monitor/config/GlobalCorsConfig.java @@ -0,0 +1,32 @@ +package io.renren.modules.monitor.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +@Configuration +public class GlobalCorsConfig { + + @Bean + public CorsFilter corsFilter() { + //1. 添加 CORS配置信息 + CorsConfiguration config = new CorsConfiguration(); + //放行哪些原始域 + config.addAllowedOrigin("*"); + //是否发送 Cookie + config.setAllowCredentials(true); + //放行哪些请求方式 + config.addAllowedMethod("*"); + //放行哪些原始请求头部信息 + config.addAllowedHeader("*"); + //暴露哪些头部信息 + config.addExposedHeader("*"); + //2. 添加映射路径 + UrlBasedCorsConfigurationSource corsConfigurationSource = new UrlBasedCorsConfigurationSource(); + corsConfigurationSource.registerCorsConfiguration("/**",config); + //3. 返回新的CorsFilter + return new CorsFilter(corsConfigurationSource); + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/monitor/controller/BuildingController.java b/renren-admin/src/main/java/io/renren/modules/monitor/controller/BuildingController.java new file mode 100644 index 00000000..c0738eb0 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/monitor/controller/BuildingController.java @@ -0,0 +1,58 @@ +package io.renren.modules.monitor.controller; + +import io.renren.modules.monitor.entity.BuildingRecords; +import io.renren.modules.monitor.entity.Result; +import io.renren.modules.monitor.service.BuildingRecordsService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +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.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Map; + +/** + * @author admin + * @version 1.0.0 + * @ClassName BuildingController.java + * @Description 工地 + * @createTime 2022年05月17日 15:26:00 + */ +@Api(tags = "工地") +@RequestMapping("api/project/building") +@RestController +public class BuildingController { + @Autowired + private BuildingRecordsService buildingRecordsService; + + @GetMapping("/getRecords") + @ApiOperation("测试,获取工地实时数据--调用接口") + public List getRecords(){ + return buildingRecordsService.getRecords(); + } + + @GetMapping("/getAndSaveRecords") + @ApiOperation("获取工地实时数据并保存到表中--调用接口获取") + public Result getAndSaveRecords(){ + boolean result = buildingRecordsService.getAndSaveRecords(); + if(result){ + return Result.success(); + }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") + public List listRecords( + @RequestParam(value="pushTime") String pushTime + ){ + return buildingRecordsService.listRecords(pushTime); + } + +} diff --git a/renren-admin/src/main/java/io/renren/modules/monitor/controller/Controller.java b/renren-admin/src/main/java/io/renren/modules/monitor/controller/Controller.java new file mode 100644 index 00000000..81de3c72 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/monitor/controller/Controller.java @@ -0,0 +1,565 @@ +package io.renren.modules.monitor.controller; + +import io.renren.modules.monitor.dto.*; +import io.renren.modules.monitor.entity.*; +import io.renren.modules.monitor.mapper.*; +import io.renren.modules.monitor.service.*; +import io.renren.modules.monitor.utils.LongLatUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +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.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("api/project") +@Api(tags="通用") +public class Controller { + + @Autowired + private ProjectMapper projectMapper; + + @Autowired + private CameraMapper cameraMapper; + + @Autowired + private ScenicMapper scenicMapper; + + @Autowired + private MonitorService monitorService; + + @Autowired + private SedimentTrailService sedimentTrailService; + + @Autowired + private CameraChannelMapper cameraChannelMapper; + + @Autowired + private CameraOrgenizationMapper cameraOrgenMapper; + + @Autowired + private PassengerFlowService passengerFlowService; + + @Autowired + private TrailSanitationService trailSanitationService; + + @Autowired + private RoadDataService roadDataService; + + @Autowired + private CameraChannelService cameraChannelService; + + @Autowired + private BuildingSiteService buildingSitrService; + + @Autowired + private BuildingSiteMapper buildingSiteMapper; + + @Autowired + private ChannelPictureMapper channelPictureMapper; + + + @GetMapping("all") + public Object all(){ + List projects = projectMapper.selectList(null); + projects.forEach(project -> { + List pics = cameraMapper.selectPicByProjectId(project.getId()); + project.setPics(pics); + }); + + return projects; + } + + /** + * 推送给城管接口用的 + * @return + */ + @GetMapping("cameras") + public Result cameras(){ + List channelPictureDtos = channelPictureMapper.selectByProject(); + Result success = Result.success(channelPictureDtos); + success.setCount(channelPictureDtos.size()); + return success; + } + + /** + * 景区人流识别 + * @return + */ + @GetMapping("scenicCamera") + public Result scenicCamera(){ + List scenicCameraDtos = scenicMapper.selectScenicCameras(); + Result success = Result.success(scenicCameraDtos); + success.setCount(scenicCameraDtos.size()); + return success; + } + + @GetMapping("capture") + public Object capture(){ + monitorService.start(); + + return "finish capture"; + } + + @GetMapping("startScenic") + public Object startScenic(){ + monitorService.startScenic(); + + return "startScenic finish"; + } + + @GetMapping("capture1") + public Object capture1(){ + monitorService.listChannelPlayStates(); + + return "finish capture"; + } + + + /** + * 查询所有摄像头 + * @param + * @return + */ + @GetMapping("selectAll") + @ApiOperation("查询所有摄像头") + 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){ + + List list = cameraChannelMapper.selectByChannelCode(channelCode); + + Result success = Result.success(list); + + return success; + + + } + + /** + * 根据摄像头名字模糊查询摄像头 + * @param channelName + * @return + */ + @GetMapping("selectByChannelName") + @ApiOperation("根据摄像头名字模糊查询摄像头") + @ApiImplicitParam(name = "channelName",value = "摄像头名称",required = true,dataType = "String") + public Result selectByChannelName(String channelName){ + + List labels = cameraChannelMapper.selectByChannelName(channelName); + + Result success = Result.success(labels); + + return success; + } + + /** + * 根据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") + }) + public Result selectByParentId(String parentId,String checkStatus){ + + List list = cameraChannelMapper.selectByParentId(parentId,checkStatus); + + Result success = Result.success(list); + + return success; + + } + + /** + * 根据标签查询对应摄像头 + * @return + */ + @GetMapping("selectLabel") + @ApiOperation("根据标签查询对应摄像头") + @ApiImplicitParam(name = "labelCode",value = "标签号",required = true,dataType = "String") + public Result selectLabel(String labelCode){ + + List channelLabelDtos = cameraChannelMapper.selectLabel(labelCode); + + for (ChannelLabelDto channelLabelDto :channelLabelDtos) { + String nodeName = channelLabelDto.getNodeName(); + String[] splits = nodeName.split("->"); + String split = splits[1]; + channelLabelDto.setNodeName(split); + + } + + return Result.success(channelLabelDtos); + } + + /** + * 根据经纬度查询半径内所有的摄像头 + * @param gpsX + * @param gpsY + * @param radius + * @return + */ + @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"),} + ) + public Result selectAllByGps(Double gpsX,Double gpsY,Integer radius){ + double[] around = LongLatUtil.getAround(gpsX, gpsY, radius); + List c = cameraChannelMapper.selectAllByGps(around[0], around[2], around[1], around[3]); + Result success = Result.success(c); + return success; + } + + /** + * 查询所有标签 + * @return + */ + @GetMapping("selectAllLabel") + @ApiOperation("查询所有标签") + public Result selectAllLabel(){ + + List