|
@@ -1,5 +1,6 @@
|
|
|
package org.jeecg.modules.webaccess.service;
|
|
|
|
|
|
+import com.alipay.api.domain.DashboardParam;
|
|
|
import net.sf.json.JSONArray;
|
|
|
import net.sf.json.JSONObject;
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
@@ -17,6 +18,8 @@ import org.springframework.http.MediaType;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
+import javax.swing.plaf.synth.Region;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -34,6 +37,7 @@ public class WebAccessService {
|
|
|
@Autowired
|
|
|
private GuanDashboardParamMapper dashboardParamMapper;
|
|
|
|
|
|
+ //region <<字典获取webaccess信息>>
|
|
|
/**
|
|
|
* 获取webaccess的API信息
|
|
|
* @param itemtext(group:组合API,single:单独某个信息,login:登录信息)
|
|
@@ -57,7 +61,9 @@ public class WebAccessService {
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
+ //endregion
|
|
|
|
|
|
+ //region <<webaccess API>>
|
|
|
/**
|
|
|
* 登录
|
|
|
*
|
|
@@ -104,17 +110,30 @@ public class WebAccessService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 取得测点(Tag)的量测值(未解析)
|
|
|
+ *
|
|
|
+ * @param jsonObject
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public JSONObject getTagNameValuesNoAnalysis(JSONObject jsonObject) {
|
|
|
+ String paramValues = "";
|
|
|
+ String getTagValueUrl = getDictItemDesc("取得测点的量测值", "group");
|
|
|
+ JSONObject result = httpRequest(getTagValueUrl, jsonObject);
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 取得历史资料
|
|
|
*
|
|
|
* @param jsonObject
|
|
|
* @return
|
|
|
*/
|
|
|
- public JSONArray GetDataLog(JSONObject jsonObject) {
|
|
|
+ public JSONObject GetDataLog(JSONObject jsonObject) {
|
|
|
String getTagValueUrl = getDictItemDesc("取得历史资料", "group");
|
|
|
JSONObject result = httpRequest(getTagValueUrl, jsonObject);
|
|
|
- JSONArray jsonArray = result.getJSONArray("DataLog");
|
|
|
|
|
|
- return jsonArray;
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -256,7 +275,9 @@ public class WebAccessService {
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
+ //endregion
|
|
|
|
|
|
+ //region <<组成webaccess参数信息>>
|
|
|
/**
|
|
|
* 组成获取参数值的信息
|
|
|
* @param tags 参数名
|
|
@@ -297,8 +318,9 @@ public class WebAccessService {
|
|
|
|
|
|
return rtn;
|
|
|
}
|
|
|
+ //endregion
|
|
|
|
|
|
-
|
|
|
+ //region <<获取历史记录>>
|
|
|
/**
|
|
|
*
|
|
|
* 生成获取历史记录的参数
|
|
@@ -346,4 +368,37 @@ public class WebAccessService {
|
|
|
|
|
|
return rtn;
|
|
|
}
|
|
|
+ //endregion
|
|
|
+
|
|
|
+ //region <<根据大屏参数设置,获取点位实时值>>
|
|
|
+ /**
|
|
|
+ * 取得测点(Tag)的量测值
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public JSONObject getDashboardTagNameValues() {
|
|
|
+ // 获取大屏参数设置
|
|
|
+ GuanDashboardParam paramat = new GuanDashboardParam();
|
|
|
+ paramat.setStatus("1"); // 状态为启用
|
|
|
+ paramat.setIflog("N"); // 不需要获取历史记录
|
|
|
+ List<GuanDashboardParam> dashboardParamList = dashboardParamMapper.selectAllDashboardParam(paramat);
|
|
|
+
|
|
|
+ // 组合参数信息
|
|
|
+ List<WaLogDTO> tags = new ArrayList<>();
|
|
|
+ if (dashboardParamList != null && dashboardParamList.size() > 0) {
|
|
|
+ for (GuanDashboardParam param : dashboardParamList) {
|
|
|
+ if (param.getTagName() != null && !"".equals(param.getTagName())) {
|
|
|
+ WaLogDTO tag = new WaLogDTO(param.getTagName());
|
|
|
+ tags.add(tag);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ JSONObject waparams = generateGetObject(tags);
|
|
|
+ JSONObject jsonObject = getTagNameValuesNoAnalysis(waparams);
|
|
|
+ return jsonObject;
|
|
|
+ }
|
|
|
+ //endregion
|
|
|
}
|