2021与蓝度共同重构项目,服务端
chenjiantian
2021-12-15 d74dd3d6f754a7dd3660ef025276f9a055111b6b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.sandu.ximon.admin.service;
 
import com.github.pagehelper.PageHelper;
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.domain.LightReportData;
import com.sandu.ximon.dao.mapper.LightReportDataMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * @author chenjiantian
 * @date 2021/12/13 16:00
 * 灯上报数据 service
 */
@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);
 
        return save(lightReportData);
    }
 
    /**
     * 获取路灯列表
     * @return 返回组合数据dto
     */
    public List<LightDataDto> listLight(int pageNo, int pageSize, String keyword) {
        PageHelper.startPage(pageNo,pageSize);
 
        return null;
    }
}