cjl
2023-10-27 e3bac98f092a10c0e897143bece3abbcc59469f2
screen-api/src/main/java/com/moral/api/service/impl/HistoryDailyServiceImpl.java
@@ -7,6 +7,7 @@
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -70,7 +71,10 @@
            result.put("avg", Constants.NULL_VALUE);
            return result;
        }
        result.put("avg", data.get(params.get("sensorCode")));
        double aDouble = Double.parseDouble(data.get(params.get("sensorCode")).toString());
        double v = new BigDecimal(aDouble).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
//        result.put("avg", data.get(params.get("sensorCode")));
        result.put("avg", ""+v);
        return result;
    }
@@ -103,6 +107,15 @@
    public List<HistoryDaily> getHistoryDailyByMacAndTimeSlot(String mac, Date startDate, Date endDate) {
        QueryWrapper<HistoryDaily> wrapper = new QueryWrapper<>();
        wrapper.in("mac", mac);
        wrapper.between("time", startDate, endDate);
        List<HistoryDaily> historyDailies = historyDailyMapper.selectList(wrapper);
        return historyDailies;
    }
    @Override
    public List<HistoryDaily> getHistoryDailyByMacAndTimeSlot( List<String> macs, Date startDate, Date endDate) {
        QueryWrapper<HistoryDaily> wrapper = new QueryWrapper<>();
        wrapper.in("mac", macs);
        wrapper.between("time", startDate, endDate);
        List<HistoryDaily> historyDailies = historyDailyMapper.selectList(wrapper);
        return historyDailies;
@@ -277,6 +290,9 @@
            boundary_point_one.add(Double.parseDouble(boundary_point_one_array[1]));
            boundary_pointList.add(boundary_point_one);
        }
        if (boundary_pointList.size()>0){
            boundary_pointList.add(boundary_pointList.get(0));
        }
        bound.add(boundary_pointList);
        resultMap.put("bound", bound);
        List centerPoint = new ArrayList();
@@ -450,6 +466,9 @@
            boundary_point_one.add(Double.parseDouble(boundary_point_one_array[1]));
            boundary_pointList.add(boundary_point_one);
        }
        if (boundary_pointList.size()>0){
            boundary_pointList.add(boundary_pointList.get(0));
        }
        bound.add(boundary_pointList);
        List centerPoint = new ArrayList();
        centerPoint.add(servicesScope.getCenterLongitude());