| | |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.db_data_history.BattRealdataId; |
| | | import com.whyc.pojo.db_data_history.PwrdevHistorydataId; |
| | | import com.whyc.pojo.db_station.PowerInf; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | @Autowired |
| | | private PowerInfService powerInfService; |
| | | |
| | | //系统概览获取半小时交流输入统计 |
| | | public Response getHalfHourPwrHisAcinData(Integer powerId) { |
| | | public Response getHalfHourPwrHisAcinData(Integer powerId,Integer granularity) { |
| | | String dateTime = ActionUtil.sdfwithOutday.format(new Date()); |
| | | String tableName ="db_data_history.tb_pwrdev_historydata_"+powerId+"_"+dateTime; |
| | | String existTableName = commonMapper.existTable("db_data_history", "tb_pwrdev_historydata_"+powerId+"_"+dateTime); |
| | | if(existTableName == null){ |
| | | return new Response().set(1,false,"当前电池组不存在前面小时数据"); |
| | | } |
| | | List<PwrHisRealAcInDto> datalist=subTablePageInfoService.getHalfHourPwrHisAcinData(tableName); |
| | | List<PwrHisRealAcInDto> datalist=subTablePageInfoService.getHalfHourPwrHisAcinData(tableName,granularity); |
| | | return new Response().setII(1,datalist.size()>0,datalist,"获取半小时内交流输入统计"); |
| | | |
| | | } |
| | | //系统概览获取半小时直流输出统计 |
| | | public Response getHalfHourPwrHisDcoutData(Integer powerId) { |
| | | public Response getHalfHourPwrHisDcoutData(Integer powerId,Integer granularity) { |
| | | String dateTime = ActionUtil.sdfwithOutday.format(new Date()); |
| | | String tableName ="db_data_history.tb_pwrdev_historydata_"+powerId+"_"+dateTime; |
| | | String existTableName = commonMapper.existTable("db_data_history", "tb_pwrdev_historydata_"+powerId+"_"+dateTime); |
| | | if(existTableName == null){ |
| | | return new Response().set(1,false,"当前电源不存在前面小时数据"); |
| | | } |
| | | List<PwrHisRealDcoutInDto> datalist=subTablePageInfoService.getHalfHourPwrHisDcoutData(tableName); |
| | | return new Response().setII(1,datalist.size()>0,datalist,"获取半小时内直流输出统计"); |
| | | List<PwrHisRealDcoutInDto> datalist=subTablePageInfoService.getHalfHourPwrHisDcoutData(tableName,granularity); |
| | | Long modelCfg=0l; |
| | | PowerInf pinf=powerInfService.getPowerInfById(powerId); |
| | | if(pinf!=null){ |
| | | modelCfg=pinf.getModelCfg(); |
| | | } |
| | | return new Response().setIII(1,datalist.size()>0,datalist,modelCfg,"获取半小时内直流输出统计"); |
| | | } |
| | | } |