Commit fdfe94c1 authored by yzm's avatar yzm

mqtt建金服务解决id 重复问题

parent 1d1a1f06
...@@ -76,12 +76,12 @@ public class MQTTSubsribe { ...@@ -76,12 +76,12 @@ public class MQTTSubsribe {
public MqttConnectOptions getMqttConnectOptions() { public MqttConnectOptions getMqttConnectOptions() {
this.mqttConnectOptions = new MqttConnectOptions(); this.mqttConnectOptions = new MqttConnectOptions();
this.mqttConnectOptions.setCleanSession(true); this.mqttConnectOptions.setCleanSession(true);
if(!"".equals(username) ) { // if(!"".equals(username) ) {
this.mqttConnectOptions.setUserName(username); // this.mqttConnectOptions.setUserName(username);
} // }
if(!"".equals(password) ) { // if(!"".equals(password) ) {
this.mqttConnectOptions.setPassword(password.toCharArray()); // this.mqttConnectOptions.setPassword(password.toCharArray());
} // }
this.mqttConnectOptions.setServerURIs(new String[]{url}); this.mqttConnectOptions.setServerURIs(new String[]{url});
this.mqttConnectOptions.setConnectionTimeout(completionTimeout); this.mqttConnectOptions.setConnectionTimeout(completionTimeout);
this.mqttConnectOptions.setKeepAliveInterval(2000); this.mqttConnectOptions.setKeepAliveInterval(2000);
......
package com.hzjt.controller; package com.hzjt.controller;
import com.alibaba.fastjson.JSONObject;
import com.hzjt.domain.GoalStructureParam;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Set;
/** /**
* 路由接口控制器 * 路由接口控制器
......
...@@ -23,26 +23,26 @@ public class DateUtils { ...@@ -23,26 +23,26 @@ public class DateUtils {
public static String getDateStringNoSign(Date date) { public static String getDateStringNoSign(Date date) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
log.info("date timezone:{}",formatter.getTimeZone()) ; // log.info("date timezone:{}",formatter.getTimeZone()) ;
formatter.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai")); formatter.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
log.info("date timezone:{}",formatter.getTimeZone()) ; // log.info("date timezone:{}",formatter.getTimeZone()) ;
String dateString = formatter.format(date); String dateString = formatter.format(date);
return dateString ; return dateString ;
} }
public static String formatCurrDayNoSign() { public static String formatCurrDayNoSign() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
log.info("date timezone:{}",formatter.getTimeZone()) ; // log.info("date timezone:{}",formatter.getTimeZone()) ;
formatter.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai")); formatter.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
log.info("date timezone:{}",formatter.getTimeZone()) ; // log.info("date timezone:{}",formatter.getTimeZone()) ;
String dateString = formatter.format(new Date()); String dateString = formatter.format(new Date());
return dateString ; return dateString ;
} }
public static Date Parsedate(String datestr) { public static Date Parsedate(String datestr) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
log.info("date timezone:{}",formatter.getTimeZone()) ; // log.info("date timezone:{}",formatter.getTimeZone()) ;
formatter.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai")); formatter.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
log.info("date timezone:{}",formatter.getTimeZone()) ; // log.info("date timezone:{}",formatter.getTimeZone()) ;
try { try {
Date dateString = formatter.parse(datestr); Date dateString = formatter.parse(datestr);
return dateString ; return dateString ;
......
...@@ -21,7 +21,7 @@ logging.level.com.hzjt=debug ...@@ -21,7 +21,7 @@ logging.level.com.hzjt=debug
#spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:1521:helowin #spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:1521:helowin
spring.datasource.username=hzjt spring.datasource.username=hzjt
spring.datasource.password=hzjt spring.datasource.password=hzjt
spring.datasource.url=jdbc:oracle:thin:@33.65.219.103:1521:helowin spring.datasource.url=jdbc:oracle:thin:@33.65.250.179:1521:helowin
spring.datasource.driverClassName=oracle.jdbc.OracleDriver spring.datasource.driverClassName=oracle.jdbc.OracleDriver
# druid # druid
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
...@@ -42,7 +42,7 @@ spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowS ...@@ -42,7 +42,7 @@ spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowS
spring.datasource.useGlobalDataSourceStat=true spring.datasource.useGlobalDataSourceStat=true
#redis #redis
spring.redis.host=33.65.219.103 spring.redis.host=33.65.250.179
#spring.redis.host=127.0.0.1 #spring.redis.host=127.0.0.1
spring.redis.port=6379 spring.redis.port=6379
#spring.redis.password=123456 #spring.redis.password=123456
...@@ -53,14 +53,14 @@ spring.redis.pool.max-idle=8 ...@@ -53,14 +53,14 @@ spring.redis.pool.max-idle=8
spring.redis.pool.min-idle=0 spring.redis.pool.min-idle=0
spring.redis.timeout=2000 spring.redis.timeout=2000
spring.session.store-type=none spring.session.store-type=none
ip.host=33.65.219.103 ip.host=33.65.250.179
port=21 port=21
message.dept=33030 message.dept=33030
message.rate=10 message.rate=10
ftp.host=33.65.219.40:21:hzjt:1qaz2wsx ftp.host=33.65.219.40:21:hzjt:1qaz2wsx
ftppath=hzjt:1qaz2wsx@33.65.219.40:21 ftppath=hzjt:1qaz2wsx@33.65.219.40:21
ftpServiceUrl=http://33.65.219.103:8089/api/alg/files ftpServiceUrl=http://33.65.250.179:8089/api/alg/files
alarm.subscribe.data.key=gs:traff:alarmlist alarm.subscribe.data.key=gs:traff:alarmlist
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
...@@ -81,7 +81,7 @@ mybatis.mapper-locations=classpath:mapper/*.xml ...@@ -81,7 +81,7 @@ mybatis.mapper-locations=classpath:mapper/*.xml
spring.mvc.throw-exception-if-no-handler-found=true spring.mvc.throw-exception-if-no-handler-found=true
spring.resources.add-mappings=true spring.resources.add-mappings=true
gs.traff.cloud.web.fileagent.url=ftp://hzjt:1qaz2wsx@33.65.219.103:21/gstraff/ gs.traff.cloud.web.fileagent.url=ftp://hzjt:1qaz2wsx@33.65.250.179:21/gstraff/
jms.queueName=demo_queue jms.queueName=demo_queue
alarmrecord.check.push.enable=1 alarmrecord.check.push.enable=1
alarmrecord.check.push.recordtype=1 alarmrecord.check.push.recordtype=1
...@@ -95,11 +95,11 @@ qingzhi.login.keepaliveurl=http://33.50.1.213:38080/api/auth/token/keepalive ...@@ -95,11 +95,11 @@ qingzhi.login.keepaliveurl=http://33.50.1.213:38080/api/auth/token/keepalive
#mqtt配置 - start #mqtt配置 - start
#用户名 #用户名
spring.mqtt.username =cico spring.mqtt.username =
#密码 #密码
spring.mqtt.password =cico@123 spring.mqtt.password =
#服务器连接地址 #服务器连接地址
spring.mqtt.url = tcp://33.65.219.23:1883 spring.mqtt.url = tcp://12.1.97.11:1883
#连接超时 #连接超时
spring.mqtt.completionTimeout=3000 spring.mqtt.completionTimeout=3000
spring.mqtt.qos=2 spring.mqtt.qos=2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment