| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.date.DateUtils; |
| | | import com.iailab.module.model.mcs.pre.dao.MmItemResultJsonDao; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemResultJsonEntity; |
| | | import com.iailab.module.model.mcs.pre.service.MmItemResultJsonService; |
| | |
| | | implements MmItemResultJsonService { |
| | | |
| | | @Override |
| | | public List<Object[]> getData(String outputId, Date predictTime) { |
| | | public List<Object[]> getData(String outputId, Date predictTime, String timeFormat) { |
| | | List<Object[]> result = new ArrayList<>(); |
| | | QueryWrapper<MmItemResultJsonEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("outputid", outputId) |
| | | .eq("predicttime", predictTime); |
| | | .eq("predicttime", DateUtils.format(predictTime,timeFormat)); |
| | | MmItemResultJsonEntity data = baseDao.selectOne(wrapper); |
| | | if (data == null || StringUtils.isBlank(data.getJsonvalue())) { |
| | | return result; |
| | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(predictTime); |
| | | valueList.forEach(value -> { |
| | | Object[] dv = { calendar.getTime(), value}; |
| | | Object[] dv = {DateUtils.format(calendar.getTime(), timeFormat), value}; |
| | | calendar.add(Calendar.MINUTE, 1); |
| | | result.add(dv); |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public String getDoubleData(String outputId, Date predictTime) { |
| | | QueryWrapper<MmItemResultJsonEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("outputid", outputId) |
| | | .eq("predicttime", predictTime); |
| | | MmItemResultJsonEntity mmItemResultJsonEntity = baseDao.selectOne(wrapper); |
| | | return null == mmItemResultJsonEntity ? null : mmItemResultJsonEntity.getCumulant(); |
| | | } |
| | | } |