| | |
| | | import java.sql.Wrapper; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | * @return 是否成功 |
| | | */ |
| | | public boolean saveReportData(String deviceName, A5LightHeartbeatReportInnerFrame.HeartBeatDataPackage heartBeatDataPackage) { |
| | | LightReportData lightReportData = RedisUtils.getBean().get(A5LightDataEnum.LIGHT_HEART_BEAT.getCode() + deviceName, LightReportData.class); |
| | | // LightReportData lightReportData = RedisUtils.getBean().get(A5LightDataEnum.LIGHT_HEART_BEAT.getCode() + deviceName, LightReportData.class); |
| | | |
| | | |
| | | String format = LocalDateTime.now().format(DateTimeFormatter.ofPattern("YYYY-MM-dd HH:mm:ss")); |
| | | LightReportData lightReportData = new LightReportData(); |
| | | |
| | | if (lightReportData == null) { |
| | | lightReportData = new LightReportData(); |
| | | lightReportData.setCreateTime(LocalDateTime.now()); |
| | | lightReportData.setCreateTime(format); |
| | | } |
| | | //todo |
| | | lightReportData.setCreateTime(format); |
| | | BeanUtils.copyProperties(heartBeatDataPackage, lightReportData); |
| | | lightReportData.setDeviceCode(deviceName); |
| | | lightReportData.setUpdateTime(LocalDateTime.now()); |
| | | |
| | | lightReportData.setUpdateTime(format); |
| | | //单灯数据保存到缓存里 |
| | | RedisUtils.getBean().set(A5LightDataEnum.LIGHT_HEART_BEAT.getCode() + deviceName, lightReportData); |
| | | |
| | |
| | | |
| | | List<LightReportDataBo> lightReportDataBos = new ArrayList<>(pageSize); |
| | | |
| | | CommonPage<String> stringCommonPage = SpringContextHolder.getBean(LightService.class).listDeviceCode(pageNo, pageSize); |
| | | CommonPage<String> stringCommonPage = SpringContextHolder.getBean(LightService.class).listDeviceCode(pageNo, pageSize, keyword, deviceCode); |
| | | List<String> macList = stringCommonPage.getList(); |
| | | if (CollUtil.isEmpty(macList)) { |
| | | return new CommonPage(); |