| | |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereHeartbeatReportInnerFrame; |
| | | import com.sandu.ximon.admin.newnova.conf.ProgramPathConfig; |
| | | import com.sandu.ximon.admin.newnova.param.NewNovaLedParam; |
| | | import com.sandu.ximon.admin.newnova.param.ProgramPrarm; |
| | |
| | | import com.sandu.ximon.admin.newnova.vo.StatusVO; |
| | | import com.sandu.ximon.admin.newnova.vo.TrasfromStatusVO; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.service.AirDataService; |
| | | import com.sandu.ximon.admin.service.PoleBindingService; |
| | | import com.sandu.ximon.admin.service.PoleService; |
| | | import com.sandu.ximon.dao.bo.AirDataNongGengBo; |
| | | import com.sandu.ximon.dao.bo.NewNovaGroupListBo; |
| | | import com.sandu.ximon.dao.domain.NewNovaLed; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.mapper.AirDataNongGengMapper; |
| | | import com.sandu.ximon.dao.mapper.NewNovaLedMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | if (nova == null) { |
| | | throw new BusinessException("未绑定诺瓦设备"); |
| | | } |
| | | PoleBinding air = poleBindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, nova.getPoleId()).eq(PoleBinding::getDeviceType, 3)); |
| | | PoleBinding air = poleBindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, nova.getPoleId()).eq(PoleBinding::getDeviceType, 11)); |
| | | if (air == null) { |
| | | throw new BusinessException("未绑定大气设备"); |
| | | } |
| | | |
| | | //获取大气监测数据 |
| | | A5AtmosphereHeartbeatReportInnerFrame.HeartBeatDataPackage data = SpringContextHolder.getBean(AirDataService.class).getDataByPoleid(nova.getPoleId()); |
| | | AirDataNongGengBo data = SpringContextHolder.getBean(AirDataNongGengMapper.class).historyData(air.getDeviceCode()).get(0); |
| | | |
| | | //解析大气数据 |
| | | Map pageInfo = parseData(data, duration, fontSize); |
| | |
| | | * @return |
| | | */ |
| | | |
| | | private Map parseData(A5AtmosphereHeartbeatReportInnerFrame.HeartBeatDataPackage data, Long duration, Long fontSize) { |
| | | private Map parseData(AirDataNongGengBo data, Long duration, Long fontSize) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z+8:00'"); |
| | | Date end = new Date(); |
| | | end.setTime(end.getTime() + duration); |
| | |
| | | " {\n" + |
| | | " \"segs\": [\n" + |
| | | " {\n" + |
| | | " \"content\": \"温度:" + (data == null || data.getTemperature() == null ? " - " : data.getTemperature()) + "°\"" + "\n" + |
| | | " \"content\": \"温度:" + (data == null || data.getAirTemperature() == null ? " - " : data.getAirTemperature()) + "\"" + "\n" + |
| | | " }\n" + |
| | | " ]\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"segs\": [\n" + |
| | | " {\n" + |
| | | " \"content\": \"湿度:" + (data == null || data.getHumidity() == null ? " - " : data.getHumidity()) + "%\"" + "\n" + |
| | | " \"content\": \"湿度:" + (data == null || data.getAirHumidity() == null ? " - " : data.getAirHumidity()) + "\"" + "\n" + |
| | | " }\n" + |
| | | " ]\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"segs\": [\n" + |
| | | " {\n" + |
| | | " \"content\": \"pm25:" + (data == null || data.getPm25() == null ? " - " : data.getPm25()) + "μg/m³\"" + "\n" + |
| | | " \"content\": \"pm25:" + (data == null || data.getPm2point5() == null ? " - " : data.getPm2point5()) + "\"" + "\n" + |
| | | " }\n" + |
| | | " ]\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"segs\": [\n" + |
| | | " {\n" + |
| | | " \"content\": \"pm10:" + (data == null || data.getPm10() == null ? " - " : data.getPm10()) + "μg/m³\"" + "\n" + |
| | | " \"content\": \"pm10:" + (data == null || data.getPm10() == null ? " - " : data.getPm10()) + "\"" + "\n" + |
| | | " }\n" + |
| | | " ]\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"segs\": [\n" + |
| | | " {\n" + |
| | | " \"content\": \"甲醛:" + (data == null || data.getEch2o() == null ? " - " : data.getEch2o()) + "μg/m³\"" + "\n" + |
| | | " \"content\": \"光照:" + (data == null || data.getIllumination() == null ? " - " : data.getIllumination()) + "\"" + "\n" + |
| | | " }\n" + |
| | | " ]\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"segs\": [\n" + |
| | | " {\n" + |
| | | " \"content\": \"CO2:" + (data == null || data.getCo2() == null ? " - " : data.getCo2()) + "ppm\"" + "\n" + |
| | | " \"content\": \"噪音:" + (data == null || data.getNoise() == null ? " - " : data.getNoise()) + "\"" + "\n" + |
| | | " }\n" + |
| | | " ]\n" + |
| | | " }\n" + |