Commit ed4db104 authored by chenying's avatar chenying

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/resources/application.properties
parents 6edba52f 729f983b
# java # java
# Version: 0.0.1 # Version: 1.8.191
FROM registry.cn-hangzhou.aliyuncs.com/witcloud/docker-java:0.0.1 FROM registry.cn-hangzhou.aliyuncs.com/witcloud/docker-cjava:1.8.191
# Maintainers # Maintainers
MAINTAINER Carit Zhu "carit.zhu@witium.com" MAINTAINER Carit Zhu "carit.zhu@witium.com"
COPY tdlcloud.jar /root/tdlcloud.jar COPY app.jar /root/jar/app.jar
COPY ca.crt /root/ca.crt COPY ca.crt /root/jar/ca.crt
COPY witcd.pem /root/witcd.pem COPY witcd.pem /root/jar/witcd.pem
COPY witcd.crt /root/witcd.crt COPY witcd.crt /root/jar/witcd.crt
ARG WITIUM_INFLUXDB_HOST
ENV WITIUM_INFLUXDB_HOST ${WITIUM_INFLUXDB_HOST:-http://witcloud-influxdb:8086}
ARG WITIUM_MQTT_URL
ENV WITIUM_MQTT_URL ${WITIUM_MQTT_URL:-tcp://witcloud-emq}
ARG WITIUM_MQTT_PORT
ENV WITIUM_MQTT_PORT ${WITIUM_MQTT_PORT:-1883}
ARG WITIUM_MQTT_CACRT
ENV WITIUM_MQTT_CACRT ${WITIUM_MQTT_CACRT:-/root/ca.crt}
ARG WITIUM_MQTT_CLIENTKEY
ENV WITIUM_MQTT_CLIENTKEY ${WITIUM_MQTT_CLIENTKEY:-/root/witcd.pem}
ARG WITIUM_MQTT_CLIENTCRT
ENV WITIUM_MQTT_CLIENTCRT ${WITIUM_MQTT_CLIENTCRT:-/root/witcd.crt}
EXPOSE 8092 EXPOSE 8092
ENTRYPOINT [ "java", "-jar","/root/tdlcloud.jar" ]
CMD ["--witium.influxdb.host ${WITIUM_INFLUXDB_HOST}","--witium.mqtt.url ${WITIUM_MQTT_URL}","--witium.mqtt.port ${WITIUM_MQTT_PORT}","--witium.mqtt.cacrt ${WITIUM_MQTT_CACRT}","--witium.mqtt.clientkey ${WITIUM_MQTT_CLIENTKEY}","--witium.mqtt.clientcrt ${WITIUM_MQTT_CLIENTCRT}"] ENTRYPOINT [ "/bin/bash", "/root/start-jar.sh" ]
\ No newline at end of file
...@@ -18,6 +18,7 @@ import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; ...@@ -18,6 +18,7 @@ import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.util.StringUtils;
import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.JedisPoolConfig;
import java.lang.reflect.Method; import java.lang.reflect.Method;
...@@ -41,6 +42,38 @@ public class RedisConfig extends CachingConfigurerSupport{ ...@@ -41,6 +42,38 @@ public class RedisConfig extends CachingConfigurerSupport{
private int poolmaxidle; private int poolmaxidle;
private int poolminidle; private int poolminidle;
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
public int getTimeout() {
return timeout;
}
public void setTimeout(int timeout) {
this.timeout = timeout;
}
public int getIndex() { public int getIndex() {
return index; return index;
} }
...@@ -81,38 +114,6 @@ public class RedisConfig extends CachingConfigurerSupport{ ...@@ -81,38 +114,6 @@ public class RedisConfig extends CachingConfigurerSupport{
this.poolminidle = poolminidle; this.poolminidle = poolminidle;
} }
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
public int getTimeout() {
return timeout;
}
public void setTimeout(int timeout) {
this.timeout = timeout;
}
/** /**
* 生产key的策略 * 生产key的策略
* *
...@@ -162,6 +163,9 @@ public class RedisConfig extends CachingConfigurerSupport{ ...@@ -162,6 +163,9 @@ public class RedisConfig extends CachingConfigurerSupport{
setIndex(dbIndex); setIndex(dbIndex);
factory.setHostName(host); factory.setHostName(host);
factory.setPort(Integer.valueOf(port)); factory.setPort(Integer.valueOf(port));
if(!StringUtils.isEmpty(password)){
factory.setPassword(password);
}
factory.setDatabase(index); factory.setDatabase(index);
factory.setTimeout(10000); // 设置连接超时时间 factory.setTimeout(10000); // 设置连接超时时间
factory.setPoolConfig(poolConfig()); factory.setPoolConfig(poolConfig());
......
package com.example.tdl.interceptor; package com.example.tdl.interceptor;
import com.example.tdl.service.redis.TokenRedisService; import com.example.tdl.service.redis.TokenRedisService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -16,7 +15,7 @@ public class LoginInterceptor implements HandlerInterceptor { ...@@ -16,7 +15,7 @@ public class LoginInterceptor implements HandlerInterceptor {
private static Logger logger = LoggerFactory.getLogger(LoginInterceptor.class); private static Logger logger = LoggerFactory.getLogger(LoginInterceptor.class);
@Autowired @Autowired
private TokenRedisService redisService; private TokenRedisService tokenRedisService;
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
...@@ -33,7 +32,7 @@ public class LoginInterceptor implements HandlerInterceptor { ...@@ -33,7 +32,7 @@ public class LoginInterceptor implements HandlerInterceptor {
ps.write("{\"code\":0,\"message\":\"用户未登录,请先登录\"}".getBytes("UTF-8")); ps.write("{\"code\":0,\"message\":\"用户未登录,请先登录\"}".getBytes("UTF-8"));
return false; return false;
} }
String data = redisService.get("TOKEN_" +token); String data = tokenRedisService.get("TOKEN_" +token);
if(data == null){ if(data == null){
response.setContentType("application/json"); response.setContentType("application/json");
response.setStatus(200); response.setStatus(200);
...@@ -42,7 +41,7 @@ public class LoginInterceptor implements HandlerInterceptor { ...@@ -42,7 +41,7 @@ public class LoginInterceptor implements HandlerInterceptor {
ps.write("{\"code\":2,\"message\":\"用户登录过期,请重新登录\"}".getBytes("UTF-8")); ps.write("{\"code\":2,\"message\":\"用户登录过期,请重新登录\"}".getBytes("UTF-8"));
return false; return false;
} }
redisService.refeshTimeOut("TOKEN_" +token,60 * 60 *24); tokenRedisService.refeshTimeOut("TOKEN_" +token,60 * 30);
return true; return true;
} }
......
...@@ -38,7 +38,6 @@ public class PermissionInterceptor implements HandlerInterceptor { ...@@ -38,7 +38,6 @@ public class PermissionInterceptor implements HandlerInterceptor {
if(URL.contains("swagger") || URL.contains("/v2/api-docs")){ if(URL.contains("swagger") || URL.contains("/v2/api-docs")){
return true; return true;
} }
logger.info("==============执行顺序: 1、preHandle================");
String requestUri = request.getRequestURI(); String requestUri = request.getRequestURI();
String contextPath = request.getContextPath(); String contextPath = request.getContextPath();
String url = requestUri.substring(contextPath.length()); String url = requestUri.substring(contextPath.length());
......
...@@ -59,7 +59,6 @@ public class DataUtil { ...@@ -59,7 +59,6 @@ public class DataUtil {
fb.setMessage(i18n.getMessage(request, "noCircuit")); fb.setMessage(i18n.getMessage(request, "noCircuit"));
return gson.toJson(fb); return gson.toJson(fb);
} }
// Long t2 = System.currentTimeMillis();
List<HistoryDataVo> historyDataVoList = new ArrayList<>(); List<HistoryDataVo> historyDataVoList = new ArrayList<>();
for (int i = 0; i < devList.size(); i++) { for (int i = 0; i < devList.size(); i++) {
HistoryDataVo historyDataVo = new HistoryDataVo(); HistoryDataVo historyDataVo = new HistoryDataVo();
...@@ -92,7 +91,6 @@ public class DataUtil { ...@@ -92,7 +91,6 @@ public class DataUtil {
historyDataVoList.add(historyDataVo); historyDataVoList.add(historyDataVo);
continue; continue;
} }
// logger.info(field+":"+count+"------");
String sql = ""; String sql = "";
if (count > 500) { if (count > 500) {
if (resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0) { if (resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0) {
...@@ -124,14 +122,15 @@ public class DataUtil { ...@@ -124,14 +122,15 @@ public class DataUtil {
if (queryResult.getResults().get(0).getSeries() != null) { if (queryResult.getResults().get(0).getSeries() != null) {
//解析数据 //解析数据
historyData = getHistoryData(queryResult, field); historyData = getHistoryData(queryResult, field);
String sql3 = "Select " + field + " From \"tdl_policy\".\"" + device + "\" where " + "\"tdl\"='" + devList.get(i) + "' " +" ORDER BY time DESC limit 1"; //获取最后一条数据
QueryResult queryResult2 = influxDBTemplate.query(new Query(sql3, database)); // String sql3 = "Select " + field + " From \"tdl_policy\".\"" + device + "\" where " + "\"tdl\"='" + devList.get(i) + "' " +" ORDER BY time DESC limit 1";
if(queryResult2.getResults().get(0).getSeries() != null){ // QueryResult queryResult2 = influxDBTemplate.query(new Query(sql3, database));
HistoryData data = new HistoryData(); // if(queryResult2.getResults().get(0).getSeries() != null){
data.setValue(queryResult2.getResults().get(0).getSeries().get(0).getValues().get(0).get(1).toString()); // HistoryData data = new HistoryData();
data.setTime(UTCToCST(queryResult2.getResults().get(0).getSeries().get(0).getValues().get(0).get(0).toString(),"0")); // data.setValue(queryResult2.getResults().get(0).getSeries().get(0).getValues().get(0).get(1).toString());
historyData.add(data); // data.setTime(UTCToCST(queryResult2.getResults().get(0).getSeries().get(0).getValues().get(0).get(0).toString(),"0"));
} // historyData.add(data);
// }
} }
historyDataVo.setDataList(historyData); historyDataVo.setDataList(historyData);
historyDataVoList.add(historyDataVo); historyDataVoList.add(historyDataVo);
...@@ -143,7 +142,6 @@ public class DataUtil { ...@@ -143,7 +142,6 @@ public class DataUtil {
public static String getSQL(String SN,String field, String device, String tdl,String event, Long startTime, Long endTime) { public static String getSQL(String SN,String field, String device, String tdl,String event, Long startTime, Long endTime) {
String sql = ""; String sql = "";
long times = (endTime - startTime) / 500; long times = (endTime - startTime) / 500;
logger.info(field +"---"+ times + "-----"+ startTime +"----" +endTime+"----" + tdl);
for (int i = 0; i < 500; i++) { for (int i = 0; i < 500; i++) {
Long maxTime = startTime + times; Long maxTime = startTime + times;
sql = sql + "Select " + field + " From \"tdl_policy\".\"" + device + "\" where " + sql = sql + "Select " + field + " From \"tdl_policy\".\"" + device + "\" where " +
......
package com.example.tdl.util; package com.example.tdl.util;
import java.text.DecimalFormat;
public class MapUtils { public class MapUtils {
private static double EARTH_RADIUS = 6371.393; private static double EARTH_RADIUS = 6371.393;
...@@ -60,7 +62,13 @@ public class MapUtils { ...@@ -60,7 +62,13 @@ public class MapUtils {
} }
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(MapUtils.getDistance(29.490295,106.486654,29.615467,106.581515)); DecimalFormat df = new DecimalFormat("0.0000");
double d = (double)37/44300;
System.out.println("d:" + df.format(d));
double p=1013.25* Math.pow((1 - Double.valueOf(df.format(d))),5.256);
System.out.println("pressure: "+ p);
} }
} }
...@@ -317,7 +317,7 @@ public class AlarmLogController { ...@@ -317,7 +317,7 @@ public class AlarmLogController {
sql = "SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\" where time >= "+ alarmMessageVo.getAlarmTime()*1000000l +" ORDER BY time limit 1;SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\" where time <= "+ alarmMessageVo.getAlarmTime()*1000000l +" ORDER BY time desc limit 1;"; sql = "SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\" where time >= "+ alarmMessageVo.getAlarmTime()*1000000l +" ORDER BY time limit 1;SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\" where time <= "+ alarmMessageVo.getAlarmTime()*1000000l +" ORDER BY time desc limit 1;";
} }
QueryResult queryResult =influxDBTemplate.query(new Query(sql,database)); QueryResult queryResult =influxDBTemplate.query(new Query(sql,database));
if(queryResult.getResults().get(0).getSeries() != null){ if(queryResult.getResults() != null){
//获取最精确的经纬度 //获取最精确的经纬度
circuitAlarmDataVo = parseLocation(queryResult,alarmMessageVo.getAlarmTime()); circuitAlarmDataVo = parseLocation(queryResult,alarmMessageVo.getAlarmTime());
}else{ }else{
......
...@@ -374,9 +374,9 @@ public class CircuitABBController { ...@@ -374,9 +374,9 @@ public class CircuitABBController {
return gson.toJson(fb); return gson.toJson(fb);
} }
//获取gateway的场景 //获取gateway的场景
if(resultGatewayVo.getUseScene()== 2){ if(resultGatewayVo.getUseScene()!= 0){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"gatewayConsistent")); fb.setMessage(i18n.getMessage(request,"usedgateway"));
return gson.toJson(fb); return gson.toJson(fb);
} }
String alarmTypeVar=""; String alarmTypeVar="";
......
...@@ -822,9 +822,14 @@ public class CircuitController { ...@@ -822,9 +822,14 @@ public class CircuitController {
return gson.toJson(fb); return gson.toJson(fb);
} }
//获取gateway的场景 //获取gateway的场景
if(resultGatewayVo.getUseScene()== 2){ // if(resultGatewayVo.getUseScene()== 2){
// fb.setCode(0);
// fb.setMessage(i18n.getMessage(request,"gatewayConsistent"));
// return gson.toJson(fb);
// }
if(resultGatewayVo.getUseScene() != 0){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"gatewayConsistent")); fb.setMessage(i18n.getMessage(request,"usedgateway"));
return gson.toJson(fb); return gson.toJson(fb);
} }
String alarmTypeVar=""; String alarmTypeVar="";
......
...@@ -395,6 +395,7 @@ public class DataController { ...@@ -395,6 +395,7 @@ public class DataController {
if (queryResults.getResults().get(0).getSeries() != null) { if (queryResults.getResults().get(0).getSeries() != null) {
count = Double.valueOf(queryResults.getResults().get(0).getSeries().get(0).getValues().get(0).get(1).toString()).intValue(); count = Double.valueOf(queryResults.getResults().get(0).getSeries().get(0).getValues().get(0).get(1).toString()).intValue();
} else { } else {
historyDataVo.setTDLSN(TDLSN);
historyDataVoList.add(historyDataVo); historyDataVoList.add(historyDataVo);
continue; continue;
} }
...@@ -627,6 +628,7 @@ public class DataController { ...@@ -627,6 +628,7 @@ public class DataController {
if(value.get(1) == null || value.get(1).toString().equals(devList.get(i))){ if(value.get(1) == null || value.get(1).toString().equals(devList.get(i))){
String[] objs = new String[rowsName.length]; String[] objs = new String[rowsName.length];
for (int j = 0; j < objs.length; j++) { for (int j = 0; j < objs.length; j++) {
logger.info(j+"=-----"+ rowsName[j]);
if(j==0){ if(j==0){
try { try {
objs[j] =timeStamp2Date(new Long(DataUtil.UTCToCST(String.valueOf(value.get(j)),transportationNo.getOffset()))); objs[j] =timeStamp2Date(new Long(DataUtil.UTCToCST(String.valueOf(value.get(j)),transportationNo.getOffset())));
...@@ -636,10 +638,10 @@ public class DataController { ...@@ -636,10 +638,10 @@ public class DataController {
continue; continue;
} }
}else if(j ==1) { }else if(j ==1) {
String pressure = value.get(j+1) == null ? "-" :value.get(j+1).toString(); objs[j] =value.get(j+1) == null ? "-" :value.get(j+1).toString();
objs[j] =pressure; }else if(j ==2){
Double altitude = value.get(j+1) == null ? null : 44300*(1-(Math.pow((Double.parseDouble(df.format(Float.valueOf(pressure)))/1013.25), (float)1/5.256))); Double altitude = value.get(2) == null ? null : 44300*(1-(Math.pow((Double.parseDouble(df.format(Float.valueOf(value.get(2).toString())))/1013.25), (float)1/5.256)));
objs[j+1] =altitude == null ? "-" : altitude.toString(); objs[j] = altitude == null ? "-" : altitude.toString();
}else{ }else{
objs[j] =value.get(j) == null ? "-" :value.get(j).toString(); objs[j] =value.get(j) == null ? "-" :value.get(j).toString();
} }
...@@ -928,7 +930,8 @@ public class DataController { ...@@ -928,7 +930,8 @@ public class DataController {
HistoryData altitudeData = new HistoryData(); HistoryData altitudeData = new HistoryData();
altitudeData.setTime(time); altitudeData.setTime(time);
//大气压力(kPa A) =101.325*(1-0.02257*海拔)^5.256 //大气压力(kPa A) =101.325*(1-0.02257*海拔)^5.256
Double height = 44300*(1-(Math.pow((Double.parseDouble(df.format(Float.valueOf(press)))/1013.25), (float)1/5.256))); // Double height = 44300*(1-(Math.pow((Double.parseDouble(df.format(Float.valueOf(press)))/1013.25), (float)1/5.256)));
Double height = 44300*(1-(Math.pow((Double.parseDouble(df.format(Float.valueOf(press)-10f))/1013.25), (float)1/5.256))); //气压临时减去10
altitudeData.setValue(df.format(height).toString()); altitudeData.setValue(df.format(height).toString());
pressureDataList.add(pressureData); pressureDataList.add(pressureData);
altitudeDataList.add(altitudeData); altitudeDataList.add(altitudeData);
......
...@@ -259,7 +259,7 @@ public class HomePageController { ...@@ -259,7 +259,7 @@ public class HomePageController {
} }
if(gatewayVo!=null&&circuitVos.get(i).getBindTime()!=null){ if(gatewayVo!=null&&circuitVos.get(i).getBindTime()!=null){
Long startTime = circuitVos.get(i).getBindTime() * 1000000l; Long startTime = circuitVos.get(i).getBindTime() * 1000000l;
String sql = "SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\"" + device + "\" where time >= " + startTime + " ORDER BY time desc limit 1"; String sql = "SELECT \"bdlng\",\"bdlat\" FROM \"tdl_policy\".\"" + device + "\" where \"data_type\" = 'location' and time >= " + startTime + " ORDER BY time desc limit 1";
QueryResult queryResult = influxDBTemplate.query(new Query(sql, database)); QueryResult queryResult = influxDBTemplate.query(new Query(sql, database));
if (queryResult.getResults().get(0).getSeries() != null) { if (queryResult.getResults().get(0).getSeries() != null) {
circuitVos.get(i).setTime(parseTime(queryResult.getResults().get(0).getSeries().get(0).getValues().get(0).get(0).toString())); circuitVos.get(i).setTime(parseTime(queryResult.getResults().get(0).getSeries().get(0).getValues().get(0).get(0).toString()));
......
#spring.datasource.url=jdbc:mysql://housetest-mysql:3306/tdlCloud?useUnicode=true&characterEncoding=utf-8&useSSL=false spring.datasource.url=jdbc:mysql://witcloud-mariadb:3306/tdlCloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.username=root
spring.datasource.password=37774020
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
server.port=8092
#spring.datasource.url=jdbc:mysql://witcloud-mysql:3306/tdlCloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
#spring.datasource.username=root #spring.datasource.username=root
#spring.datasource.password=37774020 #spring.datasource.password=37774020
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver #spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#
#
#tdl.redis.host=housetest-redis
#
#server.port=8092
#
## InfluxDB
#spring.influxdb.url=http://housetest-influxdb:8086
server.port=8092 tdl.redis.host = witcloud-redis
#tdl.redis.password=witium
spring.datasource.url=jdbc:mysql://witcloud-mysql:3306/tdlCloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.username=root
spring.datasource.password=37774020
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
tdl.redis.host=witcloud-redis
# InfluxDB # InfluxDB
spring.influxdb.url=http://witcloud-influxdb:8086 spring.influxdb.url=http://witcloud-influxdb:8086
...@@ -28,8 +22,10 @@ tdl.mqtt.port = 8883 ...@@ -28,8 +22,10 @@ tdl.mqtt.port = 8883
tdl.mqtt.username = logistics tdl.mqtt.username = logistics
tdl.mqtt.password = logistics37774020 tdl.mqtt.password = logistics37774020
tdl.core.add =http://logisticscore-java:8079/witium/addMount #tdl.core.add =http://logisticscore-java:8079/witium/addMount
tdl.core.delete =http://logisticscore-java:8079/witium/delMount #tdl.core.delete =http://logisticscore-java:8079/witium/delMount
tdl.core.add =http://abb-herocore:8079/witium/addMount
tdl.core.delete =http://abb-herocore:8079/witium/delMount
mqtt.userName = wtlogistics mqtt.userName = wtlogistics
mqtt.password = wtlogistics mqtt.password = wtlogistics
\ No newline at end of file
...@@ -376,3 +376,4 @@ AddSensor=Add Sensor ...@@ -376,3 +376,4 @@ AddSensor=Add Sensor
ModifySensor=Modify Sensor ModifySensor=Modify Sensor
DeleteSensor=Delete Sensor DeleteSensor=Delete Sensor
SensorAssignment=Sensor Assignment SensorAssignment=Sensor Assignment
usedgateway=The gateway has been used.
\ No newline at end of file
...@@ -70,6 +70,7 @@ gateway = \u7F51\u5173\u5E8F\u5217\u53F7\u4E0D\u80FD\u4E3A\u7A7A ...@@ -70,6 +70,7 @@ gateway = \u7F51\u5173\u5E8F\u5217\u53F7\u4E0D\u80FD\u4E3A\u7A7A
gatewayExist = \u8BE5\u7F51\u5173\u5E8F\u5217\u53F7\u4E0D\u5B58\u5728 gatewayExist = \u8BE5\u7F51\u5173\u5E8F\u5217\u53F7\u4E0D\u5B58\u5728
gatewayMounted = \u8BE5\u7F51\u5173\u672A\u6302\u8F7D gatewayMounted = \u8BE5\u7F51\u5173\u672A\u6302\u8F7D
gatewayConsistent = \u8BE5\u7F51\u5173\u7684\u4F7F\u7528\u573A\u666F\u4E0E\u5F53\u524D\u4E0D\u7B26 gatewayConsistent = \u8BE5\u7F51\u5173\u7684\u4F7F\u7528\u573A\u666F\u4E0E\u5F53\u524D\u4E0D\u7B26
usedgateway = \u8BE5\u7F51\u5173\u5DF2\u7ECF\u88AB\u4F7F\u7528\u4E86
tdl = \u4F20\u611F\u5668\u5E8F\u5217\u53F7\u4E0D\u80FD\u4E3A\u7A7A tdl = \u4F20\u611F\u5668\u5E8F\u5217\u53F7\u4E0D\u80FD\u4E3A\u7A7A
tdlExist={0}\u4F20\u611F\u5668\u4E0D\u5B58\u5728 tdlExist={0}\u4F20\u611F\u5668\u4E0D\u5B58\u5728
tdlUsed={0}\u7684\u4F20\u611F\u5668\u5DF2\u7ECF\u88AB\u4F7F\u7528 tdlUsed={0}\u7684\u4F20\u611F\u5668\u5DF2\u7ECF\u88AB\u4F7F\u7528
...@@ -336,15 +337,15 @@ TransportationState=\u8FD0\u8F93\u72B6\u6001 ...@@ -336,15 +337,15 @@ TransportationState=\u8FD0\u8F93\u72B6\u6001
WarehouseStatus=\u4ED3\u5E93\u72B6\u6001 WarehouseStatus=\u4ED3\u5E93\u72B6\u6001
SystemSetup=\u7CFB\u7EDF\u8BBE\u7F6E SystemSetup=\u7CFB\u7EDF\u8BBE\u7F6E
InformationManagement=\u4FE1\u606F\u7BA1\u7406 InformationManagement=\u4FE1\u606F\u7BA1\u7406
Devicemanagement=\u8BBE\u5907\u7BA1\u7406 DeviceManagement=\u8BBE\u5907\u7BA1\u7406
DataOverviewDetails=\u6570\u636E\u6982\u89C8\u8BE6\u60C5 DataOverviewDetails=\u6570\u636E\u6982\u89C8\u8BE6\u60C5
TransportationList=\u8FD0\u8F93\u5217\u8868 TransportationList=\u8FD0\u8F93\u5217\u8868
WarehouseList=\u4ED3\u5E93\u5217\u8868 WarehouseList=\u4ED3\u5E93\u5217\u8868
Usermanagement=\u7528\u6237\u7BA1\u7406 UserManagement=\u7528\u6237\u7BA1\u7406
Commonaddress=\u5E38\u7528\u5730\u5740 CommonAddress=\u5E38\u7528\u5730\u5740
CompanyManagement=\u516C\u53F8\u7BA1\u7406 CompanyManagement=\u516C\u53F8\u7BA1\u7406
Warningmanagement=\u9884\u8B66\u7BA1\u7406 WarningManagement=\u9884\u8B66\u7BA1\u7406
AlarmManagement=\u62A5\u8B66\u7BA1\u7406 AlarmManagement=\u62A5\u8B66\u7BA1\u7406
AccountManagement=\u89D2\u8272\u7BA1\u7406 AccountManagement=\u89D2\u8272\u7BA1\u7406
WarehouseManagement=\u4ED3\u5E93\u7BA1\u7406 WarehouseManagement=\u4ED3\u5E93\u7BA1\u7406
......
...@@ -25,4 +25,11 @@ ...@@ -25,4 +25,11 @@
<appender-ref ref="file" /> <appender-ref ref="file" />
</root> </root>
<!--<springProfile name="test,dev">-->
<!--<logger name="com.example.tdl" level="info" />-->
<!--</springProfile>-->
<!--&lt;!&ndash; 生产环境. &ndash;&gt;-->
<!--<springProfile name="docker">-->
<!--<logger name="com.example.tdl" level="ERROR" />-->
<!--</springProfile>-->
</configuration> </configuration>
\ No newline at end of file
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
</select> </select>
<select id="getForHomePage" parameterType="java.lang.String" resultType="com.example.tdl.domain.vo.CircuitABBVo"> <select id="getForHomePage" parameterType="java.lang.String" resultType="com.example.tdl.domain.vo.CircuitABBVo">
SELECT c.transportationNo,t.gatewaySN,t.TDLSN,cargoNo,cargoName,circuitState,IF(a.num>0,1,0) isAlarm,c.startTime SELECT c.transportationNo,t.gatewaySN,t.TDLSN,cargoNo,cargoName,circuitState,IF(a.num>0,1,0) isAlarm,c.startTime bindTime
from circuit c LEFT JOIN (SELECT DISTINCT TDLSN,gatewaySN,gatewayType,transportationNo FROM tdl_gateway_log) t from circuit c LEFT JOIN (SELECT DISTINCT TDLSN,gatewaySN,gatewayType,transportationNo FROM tdl_gateway_log) t
ON c.transportationNo=t.transportationNo LEFT JOIN (SELECT COUNT(id) num,transportationNo FROM alarm_log) a ON c.transportationNo=t.transportationNo LEFT JOIN (SELECT COUNT(id) num,transportationNo FROM alarm_log) a
ON a.transportationNo=c.transportationNo ON a.transportationNo=c.transportationNo
......
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
where c.state = 1 where c.state = 1
and circuitState !=2 and circuitState !=2
and c.transportationNo=#{transportationNo,jdbcType=VARCHAR} and c.transportationNo=#{transportationNo,jdbcType=VARCHAR}
limit 1
</select> </select>
......
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