2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-04-26 af9cb02606e8f8d5d8bbad05ba1647dc7a91ffc3
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightReportDataService.java
@@ -37,10 +37,8 @@
import java.io.File;
import java.sql.Wrapper;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.time.LocalDateTime;
import java.util.*;
/**
 * @author chenjiantian
@@ -60,10 +58,14 @@
     * @return 是否成功
     */
    public boolean saveReportData(String deviceName, A5LightHeartbeatReportInnerFrame.HeartBeatDataPackage heartBeatDataPackage) {
        LightReportData lightReportData = new LightReportData();
        LightReportData lightReportData = RedisUtils.getBean().get(A5LightDataEnum.LIGHT_HEART_BEAT.getCode() + deviceName, LightReportData.class);
        if (lightReportData == null) {
            lightReportData = new LightReportData();
            lightReportData.setCreateTime(LocalDateTime.now());
        }
        BeanUtils.copyProperties(heartBeatDataPackage, lightReportData);
        lightReportData.setDeviceCode(deviceName);
        lightReportData.setUpdateTime(LocalDateTime.now());
        //单灯数据保存到缓存里
        RedisUtils.getBean().set(A5LightDataEnum.LIGHT_HEART_BEAT.getCode() + deviceName, lightReportData);
@@ -105,7 +107,7 @@
                if (lightReportData != null) {
                    BeanUtils.copyProperties(lightReportData, lightReportDataBo);
                }
                lightReportDataBo.setDeviceCode(macCode);
                Pole pole = SpringContextHolder.getBean(PoleService.class).getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getDeviceCode, macCode));
                if (pole != null) {
                    lightReportDataBo.setPoleName(pole.getPoleName());