|
@@ -0,0 +1,68 @@
|
|
|
+package com.persagy.dmp.rwd.iot.service.impl;
|
|
|
+
|
|
|
+import com.persagy.dmp.common.context.AppContext;
|
|
|
+import com.persagy.dmp.rwd.iot.model.CurrentDataModel;
|
|
|
+import com.persagy.dmp.rwd.iot.service.CurrentDataService;
|
|
|
+import lombok.Getter;
|
|
|
+import lombok.Setter;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * iot-查询实时数据
|
|
|
+ * @author:linhuili
|
|
|
+ * @date:2021/8/11
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class CurrentDataServiceImpl implements CurrentDataService {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询实时数据
|
|
|
+ * @param param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<CurrentDataModel> getCurrentData(List<CurrentDataModel> param) {
|
|
|
+ if(param == null || param.size()<=0){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ String groupCode = AppContext.getContext().getGroupCode();
|
|
|
+ String projectId = AppContext.getContext().getProjectId();
|
|
|
+
|
|
|
+ //查询对象绑点信息点的实时数据
|
|
|
+ List<PointParam> parameters = new LinkedList<>();
|
|
|
+ for (CurrentDataModel model : param) {
|
|
|
+ if (model.getObjectId() == null) {
|
|
|
+ model.setError("对象id不可为空");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String infoCode = model.getInfoCode();
|
|
|
+ if (infoCode == null) {
|
|
|
+ model.setError("信息点编码不可为空");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ //表号功能号校验
|
|
|
+ // String infoCodeValue = getInfoCodeValue(groupCode, projectId, model.getObjectId(), infoCode);
|
|
|
+ parameters.add(new PointParam(model.getMeter(), model.getFunction()));
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 信息点参数定义
|
|
|
+ */
|
|
|
+ @Getter
|
|
|
+ @Setter
|
|
|
+ public static class PointParam {
|
|
|
+ String meter;
|
|
|
+ String funcid;
|
|
|
+
|
|
|
+ public PointParam(String meter, String function) {
|
|
|
+ this.meter = meter;
|
|
|
+ this.funcid = function;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|