MQTT采集功能与前端适配

This commit is contained in:
杨晓东 2025-11-27 14:45:40 +08:00
parent 8cb0506b9d
commit 2dfe968f16

View File

@ -399,8 +399,18 @@ public class AutoCollectService {
dbData.setEquipmentType("1");
dbData.setStatus("1");
dbData.setSetTem(equipmentInfo.getSetTem());
paramDTO.minValue = ruleCache.get(equipmentInfo.getRuleCode()).getMinValue();
paramDTO.maxValue = ruleCache.get(equipmentInfo.getRuleCode()).getMaxValue();
String ruleCode = equipmentInfo.getRuleCode();
DryParamThreshold rule = ruleCache.get(ruleCode);
if (rule != null) {
paramDTO.minValue = rule.getMinValue();
paramDTO.maxValue = rule.getMaxValue();
} else {
// 无规则时设默认值避免前端显示异常
paramDTO.minValue = "0";
paramDTO.maxValue = "0";
log.warn("【转换DryingDTO】设备{}的规则{}在缓存中不存在,阈值设为默认值",
equipmentInfo.getEquipmentCode(), ruleCode);
}
dbData.setParamDTO(paramDTO);
return dbData;