若依微服务1.2.1版本

监控平台所有方法重写
dev
xins 1 year ago
parent a1030e6180
commit 1abf79f98f

@ -32,4 +32,19 @@ public class HwDictConstants {
public static final String DEVICE_STATUS_PUBLISH = "1";//设备状态:已发布
public static final String FENCE_TYPE_DEVICE = "1";//电子围栏规则类型,设备
public static final String FENCE_TYPE_MONITOR_UNIT = "2";//电子围栏规则类型,监控单元
public static final String FENCE_TYPE_SCENE = "3";//电子围栏规则类型,场景
public static final String CONTROL_DEVICE = "1";//监控型设备
public static final String ACQUISITION_DEVICE = "2";//采集型设备
public static final String CONTROL_DEVICE_NAME = "control";//监控型设备
public static final String ACQUISITION_DEVICE_NAME = "acquisition";//采集型设备
public static final String DEVICE_DEFAULT_FLAG_YES="1";//默认是
public static final String DEVICE_DEFAULT_FLAG_NO="0";//默认否
}

@ -60,6 +60,13 @@ public class TdEngineConstants {
TDENGINE_KEY_TRANSFER_MAP.put("value", "value1");
}
public static final Map<String, String> DEVICE_DATA_COLUMN_MAP = new HashMap<String, String>();
static {
DEVICE_DATA_COLUMN_MAP.put(ST_TAG_DEVICECODE, "设备编号");
DEVICE_DATA_COLUMN_MAP.put(ST_TAG_DEVICENAME, "设备名称");
}
/**
* @return String
* @param: sceneId
@ -71,6 +78,17 @@ public class TdEngineConstants {
return DEFAULT_DB_NAME_PREFIX + sceneId;
}
/**
* @param: deviceModeId
* @description
* @author xins
* @date 2023-09-16 14:42
* @return String
*/
public static String getSupertTableName(Long deviceModeId) {
return DEFAULT_SUPER_TABLE_NAME_PREFIX + deviceModeId;
}
/**
* @param: deviceId
* @return String

@ -0,0 +1,21 @@
package com.ruoyi.common.core.utils;
import java.text.DecimalFormat;
/**
* @Description:
* @ClassName: NumberUtils
* @Author : xins
* @Date :2023-09-15 9:28
* @Version :1.0
*/
public class NumberUtils {
public static String getPercentage(int x, int y) {
double d1 = x * 1.0;
double d2 = y * 1.0;
// 设置保留几位小数, “.”后面几个零就保留几位小数,这里设置保留四位小数
DecimalFormat decimalFormat = new DecimalFormat("##.00%");
return decimalFormat.format(d1 / d2);
}
}
Loading…
Cancel
Save