| | |
| | | package cn.gistack.nky.service.impl; |
| | | |
| | | import cn.gistack.common.utils.CommonUtil; |
| | | import cn.gistack.nky.entity.ArimaPredict; |
| | | import cn.gistack.nky.mapper.ArimaPredictMapper; |
| | | import cn.gistack.nky.requestpojo.ArimaPredictReqPo; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.ObjectUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | |
| | | }else { |
| | | return null; |
| | | } |
| | | return cdList; |
| | | List<DataResChildrenPo> filterList = filterTimeList(cdList, 24); |
| | | return filterList; |
| | | } |
| | | |
| | | /** |
| | | * 筛选时间内的集合 |
| | | * @param sourceList |
| | | * @param timeGap |
| | | * @return |
| | | */ |
| | | public List<DataResChildrenPo> filterTimeList(List<DataResChildrenPo> sourceList,Integer timeGap){ |
| | | //当前时间的时间戳 |
| | | Long todayTimeStamp = DateUtil.now().getTime(); |
| | | |
| | | //过去时间的时间戳 |
| | | Long beforeTimeStamp = todayTimeStamp - 1000*60*60*timeGap; |
| | | |
| | | //过去时间的日期 |
| | | Date beforeDate = new Date(beforeTimeStamp); |
| | | |
| | | List<DataResChildrenPo> collect = sourceList.stream().filter(item -> CommonUtil.strToDate(item.getTm()).after(beforeDate)).collect(Collectors.toList()); |
| | | |
| | | return collect; |
| | | } |
| | | } |