|
@@ -6,6 +6,7 @@ import com.github.pagehelper.PageInfo;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.model.constant.NumberConstant;
|
|
import com.sckw.core.model.constant.NumberConstant;
|
|
|
import com.sckw.core.model.enums.DeviceEnum;
|
|
import com.sckw.core.model.enums.DeviceEnum;
|
|
|
|
|
+import com.sckw.core.model.enums.ThresholdEnum;
|
|
|
import com.sckw.core.model.page.PageRes;
|
|
import com.sckw.core.model.page.PageRes;
|
|
|
import com.sckw.core.utils.IdWorker;
|
|
import com.sckw.core.utils.IdWorker;
|
|
|
import com.sckw.core.utils.RegularUtils;
|
|
import com.sckw.core.utils.RegularUtils;
|
|
@@ -89,15 +90,15 @@ public class ThresholdService {
|
|
|
.eq(KwsThreshold::getDelFlag, NumberConstant.ZERO)
|
|
.eq(KwsThreshold::getDelFlag, NumberConstant.ZERO)
|
|
|
.orderByDesc(KwsThreshold::getCreateTime)
|
|
.orderByDesc(KwsThreshold::getCreateTime)
|
|
|
);
|
|
);
|
|
|
- String setting = "0";
|
|
|
|
|
- String statusName = "未设置";
|
|
|
|
|
|
|
+ String setting = ThresholdEnum.IS_NOT_SET.getStatus();
|
|
|
|
|
+ String statusName = ThresholdEnum.IS_NOT_SET.getDestination();
|
|
|
if (!CollectionUtils.isEmpty(kwsThresholds)) {
|
|
if (!CollectionUtils.isEmpty(kwsThresholds)) {
|
|
|
setting = kwsThresholds.get(0).getSetting();
|
|
setting = kwsThresholds.get(0).getSetting();
|
|
|
- if ("1".equals(setting)) {
|
|
|
|
|
- statusName = "部分设置";
|
|
|
|
|
|
|
+ if (ThresholdEnum.PARTIAL_SETTING.getStatus().equals(setting)) {
|
|
|
|
|
+ statusName = ThresholdEnum.PARTIAL_SETTING.getDestination();
|
|
|
} else {
|
|
} else {
|
|
|
- setting = "2";
|
|
|
|
|
- statusName = "已设置";
|
|
|
|
|
|
|
+ setting = ThresholdEnum.HAVE_SET.getStatus();
|
|
|
|
|
+ statusName = ThresholdEnum.HAVE_SET.getDestination();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
dto.setId(thresholdQuery.getProjectId());
|
|
dto.setId(thresholdQuery.getProjectId());
|
|
@@ -241,11 +242,12 @@ public class ThresholdService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 比较数据库中存在的阈值与页面填写的阈值范围
|
|
* 比较数据库中存在的阈值与页面填写的阈值范围
|
|
|
- * @param level 阈值等级
|
|
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param level 阈值等级
|
|
|
* @param thresholdBean 页面填写数据
|
|
* @param thresholdBean 页面填写数据
|
|
|
* @param headerData 请求头信息
|
|
* @param headerData 请求头信息
|
|
|
- * @param deviceId 设备id
|
|
|
|
|
- * @param itemName 要素项
|
|
|
|
|
|
|
+ * @param deviceId 设备id
|
|
|
|
|
+ * @param itemName 要素项
|
|
|
*/
|
|
*/
|
|
|
private void checkDatabaseThresholdLevel(int level, ThresholdBean thresholdBean, HeaderData headerData, String deviceId, String itemName) {
|
|
private void checkDatabaseThresholdLevel(int level, ThresholdBean thresholdBean, HeaderData headerData, String deviceId, String itemName) {
|
|
|
if (1 == level) {
|
|
if (1 == level) {
|