| | |
| | | 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_param.PowerheartParam; |
| | | import com.whyc.pojo.db_ram_db.BattRtstate; |
| | | import com.whyc.pojo.db_station.BattInf; |
| | | import com.whyc.util.ActionUtil; |
| | |
| | | |
| | | @Autowired(required = false) |
| | | private BattRtstateService rtstateService; |
| | | |
| | | @Autowired |
| | | private PowerheartParamService heartService; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | return new Response().setII(1,map.size()>0,map,"获取电池组最近一季度的温度数据"); |
| | | } |
| | | //系统概览获取半小时核容设备信息 |
| | | public Response getHalfHourBattDevData(Integer battgroupId,Integer granularity) { |
| | | //系统概览获取前N笔核容设备信息 |
| | | public Response getBattDevData100(Integer powerId,Integer battgroupId) { |
| | | String dateTime = ActionUtil.sdfwithOutday.format(new Date()); |
| | | String tableName ="db_data_history.tb_batt_realdata_"+battgroupId+"_"+dateTime; |
| | | //获取前笔数*时间间隔 |
| | | PowerheartParam heartParam=heartService.getHeartParamByPowerId(powerId); |
| | | Integer interverCount=100*10;//默认值 |
| | | Integer granularity=10;//默认值 |
| | | if(heartParam!=null){ |
| | | interverCount=heartParam.getAcinInterverCfg()*heartParam.getAcinCountCfg(); |
| | | granularity=heartParam.getAcinInterverCfg(); |
| | | } |
| | | //获取前半个小时数据 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | // 计算半小时前的时间点 |
| | | LocalDateTime halfHourAgo = now.minusMinutes(30); |
| | | LocalDateTime halfHourAgo = now.minusMinutes(interverCount); |
| | | // 格式化输出 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | String halfHourAgoTime=halfHourAgo.format(formatter); |