| | |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.dto.LightDataDto; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5LightHeartbeatReportInnerFrame; |
| | | import com.sandu.ximon.dao.bo.LightBo; |
| | | import com.sandu.ximon.dao.bo.LightReportDataBo; |
| | | import com.sandu.ximon.dao.domain.LightReportData; |
| | | import com.sandu.ximon.dao.mapper.LightReportDataMapper; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Service |
| | | public class LightReportDataService extends BaseServiceImpl<LightReportDataMapper, LightReportData> { |
| | | |
| | | |
| | | /** |
| | | * 保存上报的灯心跳数据 |
| | | * |
| | | * @return 是否成功 |
| | | */ |
| | | public boolean saveReportData(String deviceName, A5LightHeartbeatReportInnerFrame.HeartBeatDataPackage heartBeatDataPackage) { |
| | | |
| | | LightReportData lightReportData = new LightReportData(); |
| | | BeanUtils.copyProperties(heartBeatDataPackage, lightReportData); |
| | | lightReportData.setDeviceMac(deviceName); |
| | | lightReportData.setDeviceCode(deviceName); |
| | | |
| | | return save(lightReportData); |
| | | } |
| | | |
| | | /** |
| | | * 获取路灯列表 |
| | | * @return 返回组合数据dto |
| | | * 获取指定设备码最新的一天上报数据 |
| | | * @param deviceCodeList 设备码列表 |
| | | * @return 上报数据 |
| | | */ |
| | | public List<LightDataDto> listLight(int pageNo, int pageSize, String keyword) { |
| | | PageHelper.startPage(pageNo,pageSize); |
| | | public List<LightReportData> getNewestReportByDeviceCode(List<String> deviceCodeList) { |
| | | return baseMapper.getNewestReportByDeviceCode(deviceCodeList); |
| | | } |
| | | |
| | | return null; |
| | | /** |
| | | * 获取上报数据 |
| | | * @param keyword 关键词 |
| | | * @param deviceCode 设备码 |
| | | */ |
| | | public List<LightReportDataBo> listReportData(int pageNo, int pageSize, String keyword, String deviceCode) { |
| | | PageHelper.startPage(pageNo,pageSize); |
| | | return baseMapper.listReportData(keyword,deviceCode); |
| | | } |
| | | } |