| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import com.alibaba.fastjson.JSONReader;
|
| | | import com.alibaba.fastjson.TypeReference;
|
| | | import com.alibaba.fastjson.*;
|
| | | import com.moral.common.util.StringUtils;
|
| | | import com.moral.entity.*;
|
| | | import com.moral.entity.alarm.AlarmConfig;
|
| | |
| | | import org.springframework.web.bind.annotation.*;
|
| | | import org.springframework.web.servlet.ModelAndView;
|
| | | import org.xml.sax.InputSource;
|
| | | import com.alibaba.fastjson.JSONArray;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.moral.common.bean.Constants;
|
| | | import com.moral.common.bean.JsonData;
|
| | | import com.moral.common.bean.PageResult;
|
| | |
| | | @GetMapping("report_avg_datas")
|
| | | public ResultBean<List<Map<String, Object>>> getMonitorPointOrDeviceAvgData(HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | parameters.put("type", "month");
|
| | | int length = ((String)parameters.get("time")).split("-").length;
|
| | | if (length == 2) {
|
| | | parameters.put("type", "month");
|
| | | } else if (length == 3){
|
| | | parameters.put("type", "day");
|
| | | }
|
| | | parameters.put("monitorPointId", parameters.remove("monitorPoint"));
|
| | | String sensorKey = parameters.remove("sensorKey").toString();
|
| | | List<String> sensorKeys = new ArrayList<String>();
|
| | |
| | | DeviceVersion deviceVersion = deviceVersionService.queryVersionById(device.getDeviceVersionId());
|
| | | rtdLayout = orgLayoutService.queryRtdLayoutWithUnit(orgId,deviceVersion.getVersion());
|
| | | }else {
|
| | | return ResultBean.fail();
|
| | | String errMsg = "device 数据异常:"+ JSON.toJSONString(device);
|
| | | log.warn(errMsg);
|
| | | return ResultBean.fail(errMsg);
|
| | | }
|
| | |
|
| | | } else {
|