| | |
| | | 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; |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @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; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getThermodynamicDiagramDataByOrgIdSensorCodeTime(Map<String, Object> parameters) { |
| | | Map<String, Object> resultMap = new HashMap<>(); |
| | | int orgId = Integer.parseInt(parameters.get("organization_id").toString()); |