| | |
| | | package com.whyc.service; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.EnvironmentThreshold; |
| | | import com.whyc.dto.InspectionRecord; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.util.HttpUtil; |
| | |
| | | return response; |
| | | } |
| | | |
| | | |
| | | public Response setInspectionInterval(float hour) { |
| | | String httpUrl = "http://192.168.10.45:8085"+"/InspectionIntervals?hour="+2; |
| | | Response response = HttpUtil.doPost(httpUrl, (String) null); |
| | | //对结果进行处理 |
| | | if(response.getCode() == 1){ //请求成功,data有正常数据 |
| | | String dataStr = (String) response.getData(); |
| | | //巡检间隔已设置: 2.0 h/次 |
| | | response.setMsg(dataStr); |
| | | response.setData(null); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | public Response setEnvironmentThreshold(EnvironmentThreshold threshold) { |
| | | String httpUrl = "http://192.168.10.45:8085"+"/EnvironmentThrSet?tempThold="+threshold.getTempThold()+"&humidityThold="+threshold.getHumidityThold()+"&COTthold="+threshold.getCOTthold()+"&CO2Thold="+threshold.getCO2Thold()+"&CH4Thold="+threshold.getCH4Thold()+"&H2Thold="+threshold.getH2Thold()+"&SmokeThold="+threshold.getSmokeThold(); |
| | | Response response = HttpUtil.doPost(httpUrl, (String) null); |
| | | //对结果进行处理 |
| | | if(response.getCode() == 1){ //请求成功,data有正常数据 |
| | | String dataStr = (String) response.getData(); |
| | | //环境阈值修改成功,温度阈值:60.0、湿度阈值:60.0、CO:100.0、CO2:1500、CH4:100.0、H2:100.0、烟感:100.0 |
| | | response.setMsg(dataStr); |
| | | response.setData(null); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | |
| | | public Response getEnvironmentThreshold() { |
| | | //TODO 环境读取接口 |
| | | return null; |
| | | } |
| | | |
| | | public Response<PageInfo<InspectionRecord>> getPageOfInspectionRecord(int pageNum, int pageSize, String startDateStr, String endDateStr) { |
| | | List<InspectionRecord> recordList = new LinkedList<>(); |
| | | //查询固定位置的文件数 |