| | |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; |
| | | import org.springframework.boot.web.server.WebServerFactoryCustomizer; |
| | | import org.springframework.boot.web.servlet.ServletComponentScan; |
| | | import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; |
| | | import org.springframework.boot.web.servlet.server.ServletWebServerFactory; |
| | | import org.springframework.cache.annotation.EnableCaching; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.web.servlet.config.annotation.EnableWebMvc; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; |
| | |
| | | SpringApplication.run(App.class, args); |
| | | } |
| | | |
| | | @Bean |
| | | //配置内的system.subType=2时,端口为18919 |
| | | @ConditionalOnProperty(name = "system.subType", havingValue = "2") |
| | | public WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> webServerFactoryCustomizer() { |
| | | return factory -> factory.setPort(18919); |
| | | } |
| | | |
| | | @Value("${http.port}") |
| | | private Integer httpPort; |
| | |
| | | */ |
| | | public static Integer systemType; |
| | | |
| | | /** 系统子类别 */ |
| | | public static Integer systemSubType; |
| | | |
| | | /**人脸识别对比阈值*/ |
| | | public static Float faceThreshold; |
| | | |
| | |
| | | YamlProperties.systemType = systemType; |
| | | } |
| | | |
| | | @Value("${system.subType}") |
| | | public void setSystemSubType(Integer systemSubType) { |
| | | YamlProperties.systemSubType = systemSubType; |
| | | } |
| | | |
| | | @Value("${custom.face.threshold}") |
| | | private void setFaceThreshold(Float faceThreshold) { |
| | | YamlProperties.faceThreshold = faceThreshold; |
| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.DeviceConstant; |
| | | import com.whyc.constant.YamlProperties; |
| | | import com.whyc.dto.BattTestData; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.paramter.FbsStatePar; |
| | |
| | | List<Fbs9100State> fbs9100StateList = mapper.getListWithoutZJDYBTSE2(userId,type); |
| | | //上面的分组字段 只要能区分 不同的设备就行了. 因为如果是一拖二的情况,也可通过后面的状态优先级来覆盖,设备不会重复 |
| | | //太供可以通过ip来确定是哪台设备 |
| | | Map<String, List<Fbs9100State>> deviceMap = fbs9100StateList.stream().collect(Collectors.groupingBy(Fbs9100State::getDevIp)); |
| | | Map<String, List<Fbs9100State>> deviceMap = null; |
| | | if(YamlProperties.systemSubType == 3){ //晋源 - 因为所有设备共用一个ip, 所以需要加上devId |
| | | deviceMap = fbs9100StateList.stream().collect(Collectors.groupingBy(state -> String.format("%s_%s",state.getDevIp(), state.getDevId()))); |
| | | }else{ //默认通用 |
| | | deviceMap = fbs9100StateList.stream().collect(Collectors.groupingBy(state -> String.valueOf(state.getDevIp()))); |
| | | } |
| | | //Map<String, List<Fbs9100State>> deviceMap = fbs9100StateList.stream().collect(Collectors.groupingBy(state -> |
| | | // String.format("%s_%s",state.getDevIp(), state.getDevId()))); |
| | | Set<String> deviceSet = deviceMap.keySet(); |
| | |
| | | package com.whyc.webSocket; |
| | | |
| | | import com.whyc.config.WebSocketConfig; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.factory.ThreadPoolExecutorFactory; |
| | | import com.whyc.pojo.Battinf; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.io.IOException; |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 山西太原晋源特定接口 |
| | | * 山西太原晋源特定接口 - 这个是对外提供给晋源的接口. 晋源部署的平台的大屏还是通用的 |
| | | * 大屏展示 Socket |
| | | */ |
| | | @Component |
| | |
| | | #系统类型:1(普通,无限制),2(严格-gw标准),3(严格-签名) |
| | | system: |
| | | #系统类型:1(普通,无限制),2(严格-gw标准),3(严格-签名) |
| | | type: 1 |
| | | # 1-默认,2-tg,3-jy |
| | | subType: 1 |
| | | |
| | | #服务端口号 |
| | | server: |
| | | port: 8919 |
| | |
| | | #系统类型:1(普通,无限制),2(严格-gw标准),3(严格-签名) |
| | | system: |
| | | #系统类型:1(普通,无限制),2(严格-gw标准),3(严格-签名) |
| | | type: 1 |
| | | # 1-默认,2-tg,3-jy |
| | | subType: 1 |
| | | #服务端口号 |
| | | server: |
| | | port: 8443 |
| | |
| | | #系统类型:1(普通,无限制),2(严格-gw标准),3(严格-签名) |
| | | system: |
| | | #系统类型:1(普通,无限制),2(严格-gw标准),3(严格-签名) |
| | | type: 1 |
| | | # 1-默认,2-tg,3-jy |
| | | subType: 1 |
| | | #服务端口号 |
| | | server: |
| | | port: 8919 |