| | |
| | | int noHrDisNum = 0; |
| | | //实际容量 |
| | | float cap = 0f; |
| | | //去年的数据---------------- |
| | | //小于capAlarm |
| | | int oldalarmNum = 0; |
| | | //小于capChange |
| | | int oldchangeNum = 0; |
| | | //放电正常 |
| | | int oldgoodSum = 0; |
| | | //未正常 |
| | | int oldnoHrDisNum = 0; |
| | | //实际容量去年 |
| | | float oldcap = 0f; |
| | | //0.查询所有的电池组 |
| | | List<Battinf> binfList = binfMapper.getBinfList(userId); |
| | | if (binfList != null && binfList.size() > 0) { |
| | |
| | | float monVolstd = binf.getMonVolStd(); |
| | | //放电次数 |
| | | int disNum = 0; |
| | | //1.查出符合条件的电池组(核容数据)按照时间倒叙排序的第一个 |
| | | //1.查出符合条件的电池组(核容数据)按照时间倒叙排序的第一个(本年度) |
| | | BatttestdataInf inf = mapper.getGroupAnalysisQB(battgroupId); |
| | | //1.查出符合条件的电池组(核容数据)按照时间倒叙排序的第一个(上一年度) |
| | | BatttestdataInf oldinf = mapper.getGroupAnalysisQBOld(battgroupId); |
| | | if (inf != null) { |
| | | disNum = 1; |
| | | int hourRate = BattCapFactory.GetHourRate(monCapStd, inf.getTestCurr()); |
| | | cap = (float) BattCapFactory.GetMonomerCap(monCapStd, hourRate, inf.getTestCap(), inf.getMaxMonvol(), inf.getMinMonvol(), monVolstd, BattCapFactory.CapType_Real); |
| | | /*float testcap = inf.getTestCap(); |
| | | float maxMonvol = inf.getMaxMonvol(); |
| | | float minMonvol = inf.getMinMonvol(); |
| | | |
| | | if (battgroupId == 1000145) { |
| | | System.out.println(battgroupId + " " + monCapStd + " " + hourRate + " " + testcap + " " + maxMonvol + " " + minMonvol + " " + monVolstd + " " + BattCapFactory.CapType_Real + " "); |
| | | }*/ |
| | | int oldhourRate = BattCapFactory.GetHourRate(monCapStd, oldinf.getTestCurr()); |
| | | oldcap = (float) BattCapFactory.GetMonomerCap(monCapStd, oldhourRate, oldinf.getTestCap(), oldinf.getMaxMonvol(), oldinf.getMinMonvol(), monVolstd, BattCapFactory.CapType_Real); |
| | | } |
| | | //查询电池告警(劣化:内阻过高重要,电压过低重要;损坏:内阻过高紧急,电压过低紧急) |
| | | List listALmSH = alarmDataMapper.getAlm(battgroupId, 3); |
| | |
| | | } else { |
| | | noHrDisNum += 1; |
| | | } |
| | | //去年-----------------的数据 |
| | | //先判断是否损坏 |
| | | if ((disNum != 0 && oldcap < capChange * monCapStd) || (listALmSH != null && listALmSH.size() > 0)) { |
| | | if (disNum == 0) { |
| | | oldnoHrDisNum += 1; |
| | | } |
| | | oldchangeNum = oldchangeNum + 1; |
| | | }//在判断是否劣化 |
| | | else if ( |
| | | (disNum != 0 && oldcap <= capAlarm * monCapStd && oldcap >= capChange * monCapStd |
| | | ) |
| | | || (listALmLH != null && listALmLH.size() > 0)) { |
| | | if (disNum == 0) { |
| | | oldnoHrDisNum += 1; |
| | | } |
| | | oldalarmNum = oldalarmNum + 1; |
| | | }//再判断是否放电正常 |
| | | else if (disNum != 0 && oldcap > capAlarm * monCapStd) { |
| | | if (disNum == 0) { |
| | | oldnoHrDisNum += 1; |
| | | } |
| | | oldgoodSum = oldgoodSum + 1; |
| | | } else { |
| | | oldnoHrDisNum += 1; |
| | | } |
| | | } |
| | | } |
| | | Map<String, Integer> numMap = new HashMap<>(); |
| | |
| | | 6-组端电压下限到终止*/ |
| | | //int hrDisNum = mapper.getHrQuarterZC(userId); |
| | | numMap.put("noHrDisNum", noHrDisNum); |
| | | return new Response().setII(1, true, numMap, "蓄电池组优劣分析"); |
| | | //去年----------------------------统计 |
| | | Map<String, Integer> oldnumMap = new HashMap<>(); |
| | | oldnumMap.put("alarmNum", oldalarmNum); |
| | | oldnumMap.put("changeNum", oldchangeNum); |
| | | //总电池组(分类) |
| | | oldnumMap.put("groupNum", groupNum); |
| | | //蓄电池优良(已经放电数-告警数) |
| | | oldnumMap.put("goodSum", oldgoodSum); |
| | | /*本年度已核容放电电池组(testdate_inf中test_type=3,test_startType=3) |
| | | int hrDisNum = testInfService.getHrQuarter(userId); |
| | | * 修改为:领导层本年度已放数 仅需要统计放电正常停止的 正常停止的条件如下: |
| | | stop_type: |
| | | 2-放电时间到终止并且放电时间超过2小时 |
| | | 3-放电容量到终止 |
| | | 4-单体电压下限到终止 |
| | | 6-组端电压下限到终止*/ |
| | | oldnumMap.put("noHrDisNum", oldnoHrDisNum); |
| | | |
| | | return new Response().setIII(1, true, numMap,oldnumMap, "蓄电池组优劣分析"); |
| | | } catch (Exception e) { |
| | | return new Response<>().set(1, false, "发生异常:" + e.getCause()); |
| | | } |
| | | } |
| | | |
| | | //获取本年已核容放电电池组最新一次数据详情 |
| | | public Response getHrYeardisBattInfo() { |
| | | int userId = Integer.parseInt(ActionUtil.getUser().getUId().toString()); |