| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.PwrdevAcdataMapper; |
| | | import com.whyc.mapper.PwrdevAcdcdataMapper; |
| | | import com.whyc.mapper.PwrdevDcdataMapper; |
| | | import com.whyc.mapper.*; |
| | | import com.whyc.pojo.PowerInf; |
| | | import com.whyc.pojo.PwrdevAcdata; |
| | | import com.whyc.pojo.PwrdevAcdcdata; |
| | | import com.whyc.pojo.PwrdevDcdata; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | @Resource |
| | | private PwrdevDcdataMapper dcdataMapper; |
| | | |
| | | @Resource |
| | | private PowerInfMapper powerInfMapper; |
| | | |
| | | @Autowired |
| | | private SubTablePageInfoService subService; |
| | | |
| | | //查询电源的ACDC信息 |
| | | @Transactional |
| | |
| | | response.setData2(resultMap); |
| | | return response; |
| | | } |
| | | /*重庆bts4810(61850) |
| | | 目前客户的负载电流比较小,充放电参数设置时,小于0.1C10的,电流值要求能自动识别, |
| | | 采用一天内电流平均值来放电。负载电流大于0.1C10.用0.1C10放电客户要求自动填充,不要人为的录入. |
| | | (100AH电池 负载电流小于10A 就用负载电流的平均值 大于10A 就用10A) |
| | | */ |
| | | public float getBts4810LoadCurr(String stationId,float monCapStd) { |
| | | float loadCurr=0f; |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("stationid",stationId); |
| | | wrapper.last("limit 1"); |
| | | PowerInf powerInf=powerInfMapper.selectOne(wrapper); |
| | | if(powerInf!=null){ |
| | | int powerId=powerInf.getPowerDeviceId(); |
| | | QueryWrapper wrapper1=new QueryWrapper(); |
| | | wrapper1.eq("PowerDeviceId",powerId); |
| | | wrapper1.last("limit 1"); |
| | | PwrdevAcdcdata acdcdata=mapper.selectOne(wrapper1); |
| | | if(acdcdata!=null){ |
| | | loadCurr=acdcdata.getLoaderCurr(); |
| | | if (loadCurr<(0.1*monCapStd)) { |
| | | String tableName="db_pwrdev_data_history_gw"+"."+"tb_pwrdev_historydata_gw_"+powerId; |
| | | tableName=tableName+"_"+ ActionUtil.sdfwithOutday.format(new Date()); |
| | | Float avgCurr=subService.getAvgLoadCurr(powerId,tableName); |
| | | loadCurr=avgCurr; |
| | | }else{ |
| | | loadCurr=0.1f*monCapStd; |
| | | } |
| | | } |
| | | } |
| | | return loadCurr; |
| | | } |
| | | } |