| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class PwrdevHistorydataIdService { |
| | |
| | | List<String> datelist=ActionUtil.getDateListBetweenDates(apptimeParam.getParamValue(), new Date()); |
| | | //获取电源优良判断的标准参数值 |
| | | List<PowerPropertyParam> paramList=propertyParamService.getPwrStandardParam(powerType); |
| | | /*Map<String,Float> paramValues=new HashMap<>(); |
| | | for (PowerPropertyParam param : paramList) { |
| | | paramValues.put(param.getPropertyName()+"_upper", param.getBasisVal()*param.getAlarmLimithUpper()); |
| | | paramValues.put(param.getPropertyName()+"_lower", param.getBasisVal()*param.getAlarmLimitlLower()); |
| | | map.put(param.getPropertyName(), 0); |
| | | }*/ |
| | | List<String> propertyNameList = paramList.stream() |
| | | .map(param -> param.getPropertyName()) |
| | | .collect(Collectors.toList()); |
| | | for (int i=0;i<datelist.size();i++) { |
| | | String date=datelist.get(i); |
| | | String tableName ="db_data_history.tb_pwrdev_historydata_"+powerId+"_"+date; |
| | |
| | | if(existTableName == null){ |
| | | continue; |
| | | } |
| | | List<PwrdevHistorydataId> datalist=subTablePageInfoService.getPwrQuarter7(tableName); |
| | | List<PwrdevHistorydataId> datalist=subTablePageInfoService.getPwrQuarter7(tableName,propertyNameList); |
| | | // 遍历 dataList 并比较属性值 |
| | | for (PwrdevHistorydataId data : datalist) { |
| | | /*if(paramValues.get("acin1_vola_upper")!=null){ |
| | | if ((data.getAcin1Vola() > paramValues.get("acin1_vola_upper"))||(data.getAcin1Vola() < paramValues.get("acin1_vola_lower"))) { |
| | | map.put("acin1_vola", map.get("acin1_vola") + 1); |
| | | } |
| | | } |
| | | if(paramValues.get("acout_curra_upper")!=null) { |
| | | if ((data.getAcoutCurra() > paramValues.get("acout_curra_upper")) || (data.getAcoutCurra() < paramValues.get("acout_curra_lower"))) { |
| | | map.put("acout_curra", map.get("acout_curra") + 1); |
| | | } |
| | | } |
| | | if(paramValues.get("dcout_vol_upper")!=null) { |
| | | if ((data.getDcoutVol() > paramValues.get("dcout_vol_upper")) || (data.getDcoutVol() < paramValues.get("dcout_vo_lower"))) { |
| | | map.put("dcout_vol", map.get("dcout_vol") + 1); |
| | | } |
| | | } |
| | | if(paramValues.get("dcout_curr_upper")!=null) { |
| | | if ((data.getDcoutCurr() > paramValues.get("dcout_curr_upper")) || (data.getDcoutCurr() < paramValues.get("dcout_curr_lower"))) { |
| | | map.put("dcout_curr", map.get("dcout_curr") + 1); |
| | | } |
| | | }*/ |
| | | for (int j=0;j<paramList.size();j++) { |
| | | PowerPropertyParam param = paramList.get(j); |
| | | String propertyName = ActionUtil.toCamelCase(param.getPropertyName()); |