| | |
| | | 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<>(); |
| | | //查询固定位置的文件数 |
| | |
| | | //String videoDirPath = "C:\\Users\\29550\\Desktop\\当前项目\\2023\\0智能机器人运维系统\\巡检记录\\video"; |
| | | //String docDirPath = "C:\\Users\\29550\\Desktop\\当前项目\\2023\\0智能机器人运维系统\\巡检记录\\recordAnalysis"; |
| | | String videoDirPath = "/mnt/disk2/YunNan3/video"; |
| | | String docDirPath = "/mnt/disk2/YunNan3/recordAnalysis"; |
| | | String docDirPath = "/mnt/disk2/YunNan3/reportAnalysis"; |
| | | File file = new File(docDirPath); |
| | | String[] filenameListOrigin = file.list(); |
| | | List<String> filenameList = new LinkedList<>(); |
| | |
| | | String videoName = date+"-"+num+"-kjg.mp4"; |
| | | inspectionRecord.setDate(ThreadLocalUtil.parse(date,3)); |
| | | inspectionRecord.setNum(num); |
| | | inspectionRecord.setVideoUrl("http://192.168.10.133:8088/br/inspectRecord/video/"+videoName); |
| | | inspectionRecord.setDocUrl("http://192.168.10.133:8088/br/inspectRecord/recordAnalysis/"+recordName); |
| | | inspectionRecord.setVideoUrl("/inspectRecord/video/"+videoName); |
| | | inspectionRecord.setDocUrl("/inspectRecord/recordAnalysis/"+recordName); |
| | | |
| | | recordList.add(inspectionRecord); |
| | | } |