| | |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | //TODO |
| | | public Response<Map> getOnlineAndGroupVolAnalysis(int userId) { |
| | | // select alm_signal_id,count(alm_signal_id) as num from db_alarm.tb_battalarm_data alarm where alm_id in (119001,119002,119003,119004) |
| | | Response<Map> response = new Response(); //TODO RZG |
| | | Response<Map> response = new Response(); |
| | | HashMap<String, Object> resultMap = new HashMap<>(); |
| | | Map<String, Integer> resMap = new HashMap<>();//内阻测试数量 |
| | | Map<String, Integer> errMap = new HashMap<>();//故障数量 |
| | |
| | | |
| | | Integer highAlarmNum = onlinebatteryAlarmDto.getNum(); |
| | | Integer stationNum = onlinebatteryAlarmDto.getStationNum(); |
| | | resMap.put("highAlarmsNO", 1); //高告警数量 alm_signal_id:online 1 high; 2 low |
| | | resMap.put("高告警数量", 1); //高告警数量 alm_signal_id:online 1 high; 2 low |
| | | |
| | | resMap.put("lowAlarmsNO", 1); //低告警数量 |
| | | resMap.put("totalAlarmsScale", 1); //告警总数比例 |
| | | resMap.put("低告警数量", 1); //低告警数量 |
| | | resMap.put("告警总数比例", 1); //告警总数比例 |
| | | |
| | | Integer totalAlarmNum = mapper.getTotalAlarms(userId); |
| | | resMap.put("告警总数", totalAlarmNum); //告警总数 |
| | | |
| | | Integer totalAlarmRooms = mapper.getTotalAlarmRooms(userId); |
| | | resMap.put("totalAlarmRooms", 1); //告警机房总数 |
| | | resMap.put("告警机房总数", 1); //告警机房总数 |
| | | |
| | | resMap.put("lowAlarmRoomsScale", 1); //低告警机房数比例 |
| | | resMap.put("低告警机房数比例", 1); //低告警机房数比例 |
| | | resultMap.put("内阻测试数量", resMap); |
| | | |
| | | |
| | | errMap.put("highAlarmsNO", 1); //高告警数量 |
| | | errMap.put("lowAlarmsNO", 1); //低告警数量 |
| | | errMap.put("totalAlarmsScale", 1); //告警总数比例 |
| | | errMap.put("totalAlarms", 1); //告警总数 |
| | | errMap.put("totalAlarmRooms", 1); //告警机房总数 |
| | | errMap.put("lowAlarmRoomsScale", 1); //低告警机房数比例 |
| | | errMap.put("高告警数量", 1); //高告警数量 |
| | | errMap.put("低告警数量", 1); //低告警数量 |
| | | errMap.put("告警总数比例", 1); //告警总数比例 |
| | | errMap.put("告警总数", 1); //告警总数 |
| | | errMap.put("告警机房总数", 1); //告警机房总数 |
| | | errMap.put("低告警机房数比例", 1); //低告警机房数比例 |
| | | resultMap.put("故障数量", errMap); |
| | | |
| | | response.setCode(1); |
| | |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | //TODO |
| | | public Response<Map> getBTSEquipStatus(int userId) { |
| | | |
| | | Response<Map> response = new Response(); //TODO RZG |
| | | Response<Map> response = new Response(); |
| | | Map<String, Object> resultMap = new HashMap<>(); |
| | | try { |
| | | |
| | |
| | | // Integer chargeNO = fbs9100StateMapper.getChargeNO(devId,userId); |
| | | // Integer resTestNO = fbs9100StateMapper.getResTestNO(devId,userId); |
| | | // Integer errNO = fbs9100StateMapper.getErrNO(devId,userId); |
| | | resultMap.put("herongNO", herongNO); //核容数量 |
| | | resultMap.put("onlineFloatNO", 1); //在线浮充数量 |
| | | resultMap.put("chargeNO", 1); //充电数量 |
| | | resultMap.put("resTestNO", 1); //内阻测试数量 |
| | | resultMap.put("errNO", 1); //故障数量 |
| | | resultMap.put("核容数量", herongNO); //核容数量 |
| | | resultMap.put("在线浮充数量", 1); //在线浮充数量 |
| | | resultMap.put("充电数量", 1); //充电数量 |
| | | resultMap.put("内阻测试数量", 1); //内阻测试数量 |
| | | resultMap.put("故障数量", 1); //故障数量 |
| | | response.setCode(1); |
| | | response.setData(resultMap); |
| | | } catch (Exception e) { |
| | |
| | | try { |
| | | //放电电流低告警数和对应的告警机房数 |
| | | BatteryAlarmDto batteryAlarmDto = mapper.getLowDischargeAlarms(userId,AlarmConstant.ALM_SIGNAL_ID_DisChargeCurrLow); |
| | | int disChargealarmNum = batteryAlarmDto.getNum(); |
| | | int disChargestationNum = batteryAlarmDto.getStationNum(); |
| | | int disChargeAlarmNum = batteryAlarmDto.getNum(); |
| | | int disChargeStationNum = batteryAlarmDto.getStationNum(); |
| | | |
| | | //总告警数 |
| | | Integer totalAlarmNum = mapper.getTotalAlarms(userId); //是所有类型告警总数,无条件? |
| | | Integer totalAlarmNum = mapper.getTotalAlarms(userId); |
| | | //总机房数 |
| | | int totalStationNum = infoMapper.getStationCount(userId); |
| | | //容量低告警占比 |
| | | double disChargeLowRate = BigDecimal.valueOf(disChargealarmNum).divide(BigDecimal.valueOf(totalAlarmNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | //放电电流低告警占比 |
| | | double disChargeLowRate = BigDecimal.valueOf(disChargeAlarmNum).divide(BigDecimal.valueOf(totalAlarmNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | String disChargeLowRateStr = (int)(disChargeLowRate*100)+"%"; |
| | | //容量低告警机房占比 |
| | | double disChargeLowStationRate = BigDecimal.valueOf(disChargestationNum).divide(BigDecimal.valueOf(totalStationNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | //放电电流低告警机房占比 |
| | | double disChargeLowStationRate = BigDecimal.valueOf(disChargeStationNum).divide(BigDecimal.valueOf(totalStationNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | String disChargeLowStationRateStr = (int)(disChargeLowStationRate*100)+"%"; |
| | | |
| | | |
| | | resultMap.put("低告警数量", disChargealarmNum); //低告警数量 alm_signal_id:DisChargeCurr 7 high; 8 low |
| | | resultMap.put("告警机房总数", disChargestationNum); //告警机房总数 |
| | | resultMap.put("低告警数量", disChargeAlarmNum); //低告警数量 alm_signal_id:DisChargeCurr 7 high; 8 low |
| | | resultMap.put("告警机房总数", disChargeStationNum); //告警机房总数 |
| | | resultMap.put("告警机房数比例", disChargeLowRateStr); //告警机房数比例 |
| | | resultMap.put("告警总数", totalAlarmNum); //告警总数 |
| | | resultMap.put("告警总数比例", disChargeLowStationRateStr); //告警总数比例 |
| | |
| | | return response; |
| | | } |
| | | |
| | | // 充电电流 |
| | | |
| | | /** |
| | | * 放电和 充电电流 |
| | | * 放电和充电电流 高 |
| | | * alm_id 电池告警参数 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | //TODO |
| | | public Response<Map> getChargeAnalysis(int userId) { |
| | | |
| | | Response<Map> response = new Response(); //TODO RZG |
| | | Response<Map> response = new Response(); |
| | | HashMap<String, Object> resultMap = new HashMap<>(); |
| | | Map<String, Integer> disCharge = new HashMap<>();//放电电流 Alarm_curr_Discharge =119004 |
| | | Map<String, Integer> reCharge = new HashMap<>();//充电电流 Alarm_curr_Charge =119003 |
| | | |
| | | |
| | | disCharge.put("highAlarmsNO", 1); //高告警数量 alm_signal_id:ChargeCurrHigh 5 high; 6 low |
| | | disCharge.put("totalAlarms", 1); //告警总数 |
| | | disCharge.put("totalAlarmsScale", 1); //告警总数比例 |
| | | disCharge.put("totalAlarmRooms", 1); //告警机房总数 |
| | | disCharge.put("alarmRoomsScale", 1); //告警机房数比例 |
| | | disCharge.put("高告警数量", 1); //高告警数量 alm_signal_id:ChargeCurrHigh 5 high; 6 low |
| | | disCharge.put("告警总数", 1); //告警总数 |
| | | disCharge.put("告警总数比例", 1); //告警总数比例 |
| | | disCharge.put("告警机房总数", 1); //告警机房总数 |
| | | disCharge.put("告警机房数比例", 1); //告警机房数比例 |
| | | resultMap.put("disCharge", disCharge); |
| | | |
| | | reCharge.put("highAlarmsNO", 1); //高告警数量 |
| | | reCharge.put("totalAlarms", 1); //告警总数 |
| | | reCharge.put("totalAlarmsScale", 1); //告警总数比例 |
| | | reCharge.put("totalAlarmRooms", 1); //告警机房总数 |
| | | reCharge.put("alarmRoomsScale", 1); //告警机房数比例 |
| | | reCharge.put("高告警数量", 1); //高告警数量 |
| | | reCharge.put("告警总数", 1); //告警总数 |
| | | reCharge.put("告警总数比例", 1); //告警总数比例 |
| | | reCharge.put("告警机房总数", 1); //告警机房总数 |
| | | reCharge.put("告警机房数比例", 1); //告警机房数比例 |
| | | resultMap.put("reCharge", reCharge); |
| | | |
| | | response.setCode(1); |
| | |
| | | */ |
| | | public Response<Map> getMonVRTAnalysis(int userId) { |
| | | |
| | | Response<Map> response = new Response(); //TODO RZG |
| | | Response<Map> response = new Response(); |
| | | HashMap<String, Object> resultMap = new HashMap<>(); |
| | | Map<String, Object> monVolMap = new HashMap<>();//单体电压 Alarm_vol_Monomer =119005; |
| | | Map<String, Object> monResMap = new HashMap<>();//单体内阻 Alarm_res_Monomer =119007 |
| | | Map<String, Object> monTemMap = new HashMap<>();//单体温度 Alarm_tmp_Monomer =119006 |
| | | |
| | | |
| | | |
| | | // ******************************************单体电压**************************************************************** |
| | | /*======单体电压======*/ |
| | | |
| | | //高告警数量 |
| | | Integer volhighAlarmsNum = mapper.getVolAlamHighLow(userId,AlarmConstant.ALM_SIGNAL_ID_MonVolHigh); |
| | | Integer volHighAlarmsNum = mapper.getAlarmHighLow(userId,AlarmConstant.ALM_SIGNAL_ID_MonVolHigh); |
| | | //低告警数量 |
| | | Integer vollowAlarmsNum = mapper.getVolAlamHighLow(userId,AlarmConstant.ALM_SIGNAL_ID_MonVolLow); |
| | | Integer volLowAlarmsNum = mapper.getAlarmHighLow(userId,AlarmConstant.ALM_SIGNAL_ID_MonVolLow); |
| | | |
| | | //单体电压、内阻和温度 总告警数 |
| | | Integer voltotalAlarmNum = mapper.getVRTTotalAlarms(userId,AlarmConstant.Alarm_vol_Monomer); |
| | | // Integer restotalAlarmNum = mapper.getVRTTotalAlarms(userId,AlarmConstant.Alarm_res_Monomer); |
| | | // Integer temtotalAlarmNum = mapper.getVRTTotalAlarms(userId,AlarmConstant.Alarm_tmp_Monomer); |
| | | //单体电压总告警数 |
| | | Integer volTotalAlarmNum = volHighAlarmsNum+volLowAlarmsNum; |
| | | |
| | | //单体电压机房告警总数 |
| | | Integer voltotalStationAlarmNum =mapper.getVRTTotalAlarms(userId,AlarmConstant.Alarm_tmp_Monomer); |
| | | //告警总数 |
| | | Integer totalStationAlarmNum =mapper.getTotalAlarms(userId); |
| | | |
| | | //电压告警机房数 |
| | | int volTotalAlarmStations = mapper.getTotalAlarmStations(userId,AlarmConstant.Alarm_vol_Monomer); |
| | | |
| | | //总机房数 |
| | | int totalStationNum = infoMapper.getStationCount(userId); |
| | | |
| | | //电压告警占比 |
| | | double volRate = BigDecimal.valueOf(volhighAlarmsNum+vollowAlarmsNum).divide(BigDecimal.valueOf(voltotalAlarmNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | double volRate = BigDecimal.valueOf(volTotalAlarmNum).divide(BigDecimal.valueOf(totalStationAlarmNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | String volRateStr = (int)(volRate*100)+"%"; |
| | | //电压告警机房占比 |
| | | double volStationRate = BigDecimal.valueOf(voltotalAlarmNum).divide(BigDecimal.valueOf(totalStationNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | double volStationRate = BigDecimal.valueOf(volTotalAlarmStations).divide(BigDecimal.valueOf(totalStationNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | String volStationRateStr = (int)(volStationRate*100)+"%"; |
| | | |
| | | |
| | | monVolMap.put("高告警数量", volhighAlarmsNum); //高告警数量 alm_signal_id 9 |
| | | monVolMap.put("低告警数量", vollowAlarmsNum); //低告警数量 alm_signal_id 10 |
| | | monVolMap.put("告警总数", voltotalAlarmNum); //告警总数 |
| | | monVolMap.put("高告警数量", volHighAlarmsNum); //高告警数量 alm_signal_id 9 |
| | | monVolMap.put("低告警数量", volLowAlarmsNum); //低告警数量 alm_signal_id 10 |
| | | monVolMap.put("告警总数", volTotalAlarmNum); //告警总数 |
| | | monVolMap.put("告警总数比例", volRateStr); //告警总数比例 |
| | | monVolMap.put("告警机房总数", voltotalStationAlarmNum); //告警机房总数 |
| | | monVolMap.put("告警机房总数", volTotalAlarmStations); //告警机房总数 |
| | | monVolMap.put("告警机房数比例", volStationRateStr); //告警机房数比例 |
| | | resultMap.put("单体电压", monVolMap); |
| | | |
| | | |
| | | |
| | | // ******************************************单体内阻**************************************************************** |
| | | /*======单体内阻======*/ |
| | | |
| | | Integer reshighAlarmsNum = mapper.getResistanceAlamHighLow(userId,AlarmConstant.ALM_SIGNAL_ID_MonResHigh); |
| | | Integer reslowAlarmsNum = mapper.getResistanceAlamHighLow(userId,AlarmConstant.ALM_SIGNAL_ID_MonResLow); |
| | | //高告警数量 |
| | | Integer resHighAlarmsNum = mapper.getAlarmHighLow(userId,AlarmConstant.ALM_SIGNAL_ID_MonResHigh); |
| | | //低告警数量 |
| | | Integer resLowAlarmsNum = mapper.getAlarmHighLow(userId,AlarmConstant.ALM_SIGNAL_ID_MonResLow); |
| | | |
| | | //单体电压、内阻和温度 总告警数 |
| | | Integer restotalAlarmNum = mapper.getVRTTotalAlarms(userId,AlarmConstant.Alarm_res_Monomer); |
| | | //告警机房总数 |
| | | Integer restotalStationAlarmNum =mapper.getVRTTotalAlarms(userId,AlarmConstant.Alarm_tmp_Monomer); |
| | | //总机房数 |
| | | // int totalStationNum = infoMapper.getStationCount(userId); |
| | | //单体内阻总告警数 |
| | | Integer resTotalAlarmNum = resHighAlarmsNum+resLowAlarmsNum; |
| | | |
| | | //内阻告警机房数 |
| | | int resTotalAlarmStations = mapper.getTotalAlarmStations(userId,AlarmConstant.Alarm_res_Monomer); |
| | | |
| | | //内阻告警占比 |
| | | double resRate = BigDecimal.valueOf(reshighAlarmsNum+reslowAlarmsNum).divide(BigDecimal.valueOf(restotalAlarmNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | double resRate = BigDecimal.valueOf(resTotalAlarmNum).divide(BigDecimal.valueOf(totalStationAlarmNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | String resRateStr = (int)(resRate*100)+"%"; |
| | | //内阻告警机房占比 TODO |
| | | double resStationRate = BigDecimal.valueOf(restotalStationAlarmNum).divide(BigDecimal.valueOf(totalStationNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | //内阻告警机房占比 |
| | | double resStationRate = BigDecimal.valueOf(resTotalAlarmStations).divide(BigDecimal.valueOf(totalStationNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | String resStationRateStr = (int)(resStationRate*100)+"%"; |
| | | |
| | | monResMap.put("高告警数量", reshighAlarmsNum); //高告警数量 alm_signal_id 13 |
| | | monResMap.put("低告警数量", reslowAlarmsNum); //低告警数量 alm_signal_id 14 |
| | | monResMap.put("告警总数", restotalAlarmNum); //告警总数 |
| | | monResMap.put("高告警数量", resHighAlarmsNum); //高告警数量 alm_signal_id 13 |
| | | monResMap.put("低告警数量", resLowAlarmsNum); //低告警数量 alm_signal_id 14 |
| | | monResMap.put("告警总数", resTotalAlarmNum); //告警总数 |
| | | monResMap.put("告警总数比例", resRateStr); //告警总数比例 |
| | | monResMap.put("告警机房总数", restotalStationAlarmNum); //告警机房总数 |
| | | monResMap.put("告警机房总数", resTotalAlarmStations); //告警机房总数 |
| | | monResMap.put("告警机房数比例", resStationRateStr); //告警机房数比例 |
| | | resultMap.put("单体内阻", monResMap); |
| | | |
| | | /*======单体温度======*/ |
| | | |
| | | //高告警数量 |
| | | Integer tempHighAlarmsNum = mapper.getAlarmHighLow(userId,AlarmConstant.ALM_SIGNAL_ID_MonTmpHigh); |
| | | //低告警数量 |
| | | Integer tempLowAlarmsNum = mapper.getAlarmHighLow(userId,AlarmConstant.ALM_SIGNAL_ID_MonTmpLow); |
| | | |
| | | // ******************************************单体温度**************************************************************** |
| | | //单体温度总告警数 |
| | | Integer tempTotalAlarmNum = tempHighAlarmsNum+tempLowAlarmsNum; |
| | | |
| | | //温度告警机房数 |
| | | int tempTotalAlarmStations = mapper.getTotalAlarmStations(userId,AlarmConstant.Alarm_tmp_Monomer); |
| | | |
| | | /* Integer temhighAlarmsNum = mapper.getTemperatureAlamHighLow(userId,AlarmConstant.ALM_SIGNAL_ID_MonTmpHigh); |
| | | Integer temlowAlarmsNum = mapper.getTemperatureAlamHighLow(userId,AlarmConstant.ALM_SIGNAL_ID_MonTmpLow); |
| | | monTemMap.put("highAlarmsNO", temhighAlarmsNum); //高告警数量 alm_signal_id 11 |
| | | monTemMap.put("lowAlarmsNO", temlowAlarmsNum); //低告警数量 alm_signal_id 12 |
| | | //温度告警占比 |
| | | double tempRate = BigDecimal.valueOf(tempTotalAlarmNum).divide(BigDecimal.valueOf(totalStationAlarmNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | String tempRateStr = (int)(tempRate*100)+"%"; |
| | | //温度告警机房占比 |
| | | double tempStationRate = BigDecimal.valueOf(tempTotalAlarmStations).divide(BigDecimal.valueOf(totalStationNum), 2, RoundingMode.HALF_UP).doubleValue(); |
| | | String tempStationRateStr = (int)(tempStationRate*100)+"%"; |
| | | |
| | | monTemMap.put("totalAlarms", 1); //告警总数 |
| | | monTemMap.put("totalAlarmsScale", 1); //告警总数比例 |
| | | |
| | | |
| | | monTemMap.put("totalAlarmRooms", 1); //告警机房总数 |
| | | monTemMap.put("alarmRoomsScale", 1); //告警机房数比例 |
| | | resultMap.put("monTemMap", monTemMap);*/ |
| | | monTemMap.put("高告警数量", tempHighAlarmsNum); //高告警数量 alm_signal_id 13 |
| | | monTemMap.put("低告警数量", tempLowAlarmsNum); //低告警数量 alm_signal_id 14 |
| | | monTemMap.put("告警总数", tempTotalAlarmNum); //告警总数 |
| | | monTemMap.put("告警总数比例", tempRateStr); //告警总数比例 |
| | | monTemMap.put("告警机房总数", tempTotalAlarmStations); //告警机房总数 |
| | | monTemMap.put("告警机房数比例", tempStationRateStr); //告警机房数比例 |
| | | resultMap.put("单体温度", monTemMap); |
| | | |
| | | response.setCode(1); |
| | | response.setData(resultMap); |