| | |
| | | package com.whyc.service; |
| | | |
| | | import com.whyc.dto.Real.CompareDto; |
| | | import com.whyc.dto.Real.PwrHisRealAcInDto; |
| | | import com.whyc.dto.Real.PwrHisRealDcoutInDto; |
| | | import com.whyc.dto.Real.QuarterDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.Statistic.QuarterPwr7Res; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.db_data_history.BattRealdataId; |
| | | import com.whyc.pojo.db_data_history.PwrdevHistorydataId; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class PwrdevHistorydataIdService { |
| | |
| | | } |
| | | return new Response().setIII(1,datalist.size()>0,datalist,modelCfg,"获取半小时内直流输出统计"); |
| | | } |
| | | //1.2.7优良电源统计上一季度的电源某一属性和参数阈值超过的次数 |
| | | public Map<String,Integer> getPwrQuarter7(Integer powerId, Map<String,Float> paramValue) { |
| | | Map<String,Integer> map=new HashMap<>(); |
| | | map.put("acin1Vola",0); |
| | | map.put("acoutVola",0); |
| | | map.put("dcoutVol",0); |
| | | map.put("dcoutCurr",0); |
| | | List<String> datelist = ActionUtil.getLastQuarterYearMonths(); |
| | | for (int i=0;i<datelist.size();i++) { |
| | | String date=datelist.get(i); |
| | | String tableName ="db_data_history.tb_pwrdev_historydata_"+powerId+"_"+date; |
| | | String existTableName = commonMapper.existTable("db_data_history", "tb_pwrdev_historydata_"+powerId+"_"+date); |
| | | //判断表是否存在 |
| | | if(existTableName == null){ |
| | | continue; |
| | | } |
| | | List<QuarterPwr7Res> datalist=subTablePageInfoService.getPwrQuarter7(tableName); |
| | | // 遍历 dataList 并比较属性值 |
| | | for (QuarterPwr7Res data : datalist) { |
| | | if (data.getAcin1Vola() > paramValue.get("acin1Vola")) { |
| | | map.put("acin1Vola", map.get("acin1Vola") + 1); |
| | | } |
| | | if (data.getAcoutVola() > paramValue.get("acoutVola")) { |
| | | map.put("acoutVola", map.get("acoutVola") + 1); |
| | | } |
| | | if (data.getDcoutVol() > paramValue.get("dcoutVol")) { |
| | | map.put("dcoutVol", map.get("dcoutVol") + 1); |
| | | } |
| | | if (data.getDcoutCurr() > paramValue.get("dcoutCurr")) { |
| | | map.put("dcoutCurr", map.get("dcoutCurr") + 1); |
| | | } |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | } |