| | |
| | | import com.whyc.mapper.CommonMapper; |
| | | |
| | | import com.whyc.pojo.db_data_history.BattRealdataId; |
| | | import com.whyc.pojo.db_param.AlmAnalysisParam; |
| | | import com.whyc.pojo.db_param.AppParam; |
| | | import com.whyc.pojo.db_ram_db.BattRtstate; |
| | | import com.whyc.pojo.db_station.BattInf; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.DateUtil; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | |
| | | |
| | | @Autowired |
| | | private BattInfService binfService; |
| | | |
| | | @Autowired(required = false) |
| | | private BattRtstateService rtstateService; |
| | | |
| | | |
| | | |
| | | //获取电池组最近一季度的单体数据 |
| | |
| | | } |
| | | //历史实时数据 |
| | | public Response getBattRealDataHis(Integer battgroupId, Integer granularity,String startTime,String endTime) throws ParseException, InterruptedException { |
| | | Map<String,Object> map=new HashMap<>(); |
| | | //实时获取电池组信息 |
| | | BattRtstate battRtstate = rtstateService.getBattRealInfo(battgroupId); |
| | | //获取电池组信息 |
| | | BattInf binf = binfService.getBinfByBattgroupId(battgroupId); |
| | | map.put("标称容量",binf.getMoncapstd()); |
| | | map.put("蓄电池数量",binf.getMoncount()); |
| | | map.put("标称电压",binf.getMonvolstd()); |
| | | map.put("浮充电压",battRtstate.getGroupVol()); |
| | | |
| | | List<RealDateDTO> dataList = new LinkedList<>(); |
| | | List<List<Date>> monthTimeList = DateUtil.getMonthTime(ThreadLocalUtil.parse(startTime,1), ThreadLocalUtil.parse(endTime,1)); |
| | | ThreadPoolExecutor pool = ThreadPoolExecutorFactory.getPoolExecutor(); |
| | |
| | | } |
| | | latch.await(10, TimeUnit.MINUTES); |
| | | List dataListSorted = dataList.stream().sorted(Comparator.comparing(RealDateDTO::getRecordTime)).collect(Collectors.toList()); |
| | | return new Response().set(1, dataListSorted); |
| | | |
| | | return new Response().setIII(1, dataListSorted!=null,dataListSorted,map,"历史实时查询"); |
| | | } |
| | | } |