|
@@ -4,6 +4,7 @@ import com.shkpr.iot.common.core.domain.po.Destination;
|
|
import com.shkpr.iot.common.core.domain.po.Equipment;
|
|
import com.shkpr.iot.common.core.domain.po.Equipment;
|
|
import com.shkpr.iot.common.core.domain.po.PointRule;
|
|
import com.shkpr.iot.common.core.domain.po.PointRule;
|
|
import com.shkpr.iot.common.core.domain.po.Template;
|
|
import com.shkpr.iot.common.core.domain.po.Template;
|
|
|
|
+import com.shkpr.iot.common.core.enums.ValueTypeEnum;
|
|
import com.shkpr.iot.server.data.service.EquipmentService;
|
|
import com.shkpr.iot.server.data.service.EquipmentService;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -50,21 +51,25 @@ public class EquipmentServiceImpl implements EquipmentService {
|
|
pointRule1.setKey("ph");
|
|
pointRule1.setKey("ph");
|
|
pointRule1.setFlagIndex("sensorId,267");
|
|
pointRule1.setFlagIndex("sensorId,267");
|
|
pointRule1.setValueIndex("dataValue");
|
|
pointRule1.setValueIndex("dataValue");
|
|
|
|
+ pointRule1.setValueType(ValueTypeEnum.SINGLE_FLOAT);
|
|
//浊度
|
|
//浊度
|
|
PointRule pointRule2 = new PointRule();
|
|
PointRule pointRule2 = new PointRule();
|
|
pointRule2.setKey("turbidity");
|
|
pointRule2.setKey("turbidity");
|
|
pointRule2.setFlagIndex("sensorId,9");
|
|
pointRule2.setFlagIndex("sensorId,9");
|
|
pointRule2.setValueIndex("dataValue");
|
|
pointRule2.setValueIndex("dataValue");
|
|
|
|
+ pointRule2.setValueType(ValueTypeEnum.SINGLE_FLOAT);
|
|
//余氯
|
|
//余氯
|
|
PointRule pointRule3 = new PointRule();
|
|
PointRule pointRule3 = new PointRule();
|
|
pointRule3.setKey("chlorine");
|
|
pointRule3.setKey("chlorine");
|
|
pointRule3.setFlagIndex("sensorId,264");
|
|
pointRule3.setFlagIndex("sensorId,264");
|
|
pointRule3.setValueIndex("dataValue");
|
|
pointRule3.setValueIndex("dataValue");
|
|
|
|
+ pointRule3.setValueType(ValueTypeEnum.SINGLE_FLOAT);
|
|
//水温
|
|
//水温
|
|
PointRule pointRule4 = new PointRule();
|
|
PointRule pointRule4 = new PointRule();
|
|
pointRule4.setKey("temperature");
|
|
pointRule4.setKey("temperature");
|
|
pointRule4.setFlagIndex("sensorId,10");
|
|
pointRule4.setFlagIndex("sensorId,10");
|
|
pointRule4.setValueIndex("dataValue");
|
|
pointRule4.setValueIndex("dataValue");
|
|
|
|
+ pointRule4.setValueType(ValueTypeEnum.SINGLE_FLOAT);
|
|
template.setRules(Arrays.asList(pointRule1, pointRule2, pointRule3, pointRule4));
|
|
template.setRules(Arrays.asList(pointRule1, pointRule2, pointRule3, pointRule4));
|
|
equipment.setTemplates(Collections.singletonList(template));
|
|
equipment.setTemplates(Collections.singletonList(template));
|
|
|
|
|