|
@@ -7,6 +7,8 @@ import org.apache.commons.collections.map.HashedMap;
|
|
import org.jeecg.modules.system.entity.SysDictItem;
|
|
import org.jeecg.modules.system.entity.SysDictItem;
|
|
import org.jeecg.modules.system.service.ISysDictItemService;
|
|
import org.jeecg.modules.system.service.ISysDictItemService;
|
|
import org.jeecg.modules.webaccess.dto.WaLogDTO;
|
|
import org.jeecg.modules.webaccess.dto.WaLogDTO;
|
|
|
|
+import org.jeecg.modules.webaccess.entity.GuanDashboardParam;
|
|
|
|
+import org.jeecg.modules.webaccess.mapper.GuanDashboardParamMapper;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.HttpEntity;
|
|
import org.springframework.http.HttpEntity;
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpHeaders;
|
|
@@ -29,6 +31,9 @@ public class WebAccessService {
|
|
@Autowired
|
|
@Autowired
|
|
private ISysDictItemService sysDictItemService;
|
|
private ISysDictItemService sysDictItemService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private GuanDashboardParamMapper dashboardParamMapper;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 获取webaccess的API信息
|
|
* 获取webaccess的API信息
|
|
* @param itemtext(group:组合API,single:单独某个信息,login:登录信息)
|
|
* @param itemtext(group:组合API,single:单独某个信息,login:登录信息)
|
|
@@ -99,6 +104,20 @@ public class WebAccessService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 取得历史资料
|
|
|
|
+ *
|
|
|
|
+ * @param jsonObject
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public JSONArray GetDataLog(JSONObject jsonObject) {
|
|
|
|
+ String getTagValueUrl = getDictItemDesc("取得历史资料", "group");
|
|
|
|
+ JSONObject result = httpRequest(getTagValueUrl, jsonObject);
|
|
|
|
+ JSONArray jsonArray = result.getJSONArray("DataLog");
|
|
|
|
+
|
|
|
|
+ return jsonArray;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 更改测点(Tag)的量测值
|
|
* 更改测点(Tag)的量测值
|
|
*
|
|
*
|
|
* @param jsonObject
|
|
* @param jsonObject
|
|
@@ -278,4 +297,53 @@ public class WebAccessService {
|
|
|
|
|
|
return rtn;
|
|
return rtn;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ * 生成获取历史记录的参数
|
|
|
|
+ *
|
|
|
|
+ * {
|
|
|
|
+ * "StartTime":"字符串内容", -- 起始时间,格式为 yyyy-mm-dd HH:MM:SS。
|
|
|
|
+ * "IntervalType":"字符串内容", -- 查询之时间单位,S:秒,M:分,H:时,D:日。
|
|
|
|
+ * "Interval":数值, -- 每笔数据之间隔时间,以 IntervalType 为单位。
|
|
|
|
+ * "Records":数值, -- 欲查询之每个点的数据笔数。
|
|
|
|
+ * "Tags":[{
|
|
|
|
+ * "Name":"字符串内容", -- 测点名称。
|
|
|
|
+ * "DataType":"字符串内容" -- 数据型态,0 - Last,1-Min,2 - Max,3 - Avg。
|
|
|
|
+ * }]
|
|
|
|
+ * }
|
|
|
|
+ * @param StartTime 起始时间,格式为 yyyy-mm-dd HH:MM:SS。
|
|
|
|
+ * @param IntervalType 查询之时间单位,S:秒,M:分,H:时,D:日。
|
|
|
|
+ * @param Interval 每笔数据之间隔时间,以 IntervalType 为单位。
|
|
|
|
+ * @param Records 欲查询之每个点的数据笔数。
|
|
|
|
+ * @param DataType 数据型态,0 - Last,1-Min,2 - Max,3 - Avg。
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public JSONObject generateDataLogObject(String StartTime, String IntervalType, Integer Interval, Integer Records, String DataType) {
|
|
|
|
+ JSONArray list = new JSONArray();
|
|
|
|
+ JSONObject rtn = new JSONObject();
|
|
|
|
+
|
|
|
|
+ // 获取大屏参数设置
|
|
|
|
+ GuanDashboardParam paramat = new GuanDashboardParam();
|
|
|
|
+ paramat.setStatus("1"); // 状态为启用
|
|
|
|
+ paramat.setIflog("Y"); // 需要获取历史记录
|
|
|
|
+ List<GuanDashboardParam> dashboardParamList = dashboardParamMapper.selectAllDashboardParam(paramat);
|
|
|
|
+
|
|
|
|
+ rtn.put("StartTime", StartTime);
|
|
|
|
+ rtn.put("IntervalType", IntervalType);
|
|
|
|
+ rtn.put("Interval", Interval);
|
|
|
|
+ rtn.put("Records", Records);
|
|
|
|
+ if (dashboardParamList != null && dashboardParamList.size() > 0) {
|
|
|
|
+ for (GuanDashboardParam param : dashboardParamList) {
|
|
|
|
+ JSONObject sub = new JSONObject();
|
|
|
|
+ sub.put("Name", param.getTagName());
|
|
|
|
+ sub.put("DataType", DataType);
|
|
|
|
+ list.add(sub);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ rtn.put("Tags", list);
|
|
|
|
+
|
|
|
|
+ return rtn;
|
|
|
|
+ }
|
|
}
|
|
}
|