| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.BattMapInformationMapper; |
| | | import com.whyc.mapper.BattdischargePlanMapper; |
| | | import com.whyc.pojo.BattMapInformation; |
| | | import com.whyc.pojo.BattalarmData; |
| | | import com.whyc.pojo.Battinf; |
| | | import org.apache.commons.collections.map.HashedMap; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class BattMapInformationService { |
| | | |
| | | @Resource |
| | | private BattMapInformationMapper mapper; |
| | | |
| | | private BattdischargePlanMapper battdischargePlanMapper; |
| | | |
| | | @Resource |
| | | private BadBattMonService badBattMonService; |
| | |
| | | |
| | | |
| | | public Response multiAmount(String stationId){ |
| | | Response model = new Response(); |
| | | String state=""; |
| | | int numBadBatt=0;//落后总数 |
| | | int numAlarm=0;//告警总数 |
| | |
| | | } |
| | | |
| | | String battAlarmStr = battAlarmConfirmed+","+battAlarmNoConfirmed; |
| | | //todo 延迟总数 |
| | | // numPlan=(new BattDischarge_planImpl()).serchByStationId(binformation); //延迟总数 |
| | | // if(numBadBatt>0){ |
| | | // state="item-behind"; //落后机房 |
| | | // }else{ |
| | | // if(numAlarm > 0){ |
| | | // state="item-warn"; //告警机房 |
| | | // }else{ |
| | | // if(numPlan > 0){ |
| | | // state="item-timeout"; //延迟机房 |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | //model.setCode(numAlarm); //告警总数 |
| | | model.setMsg(battAlarmStr); //告警总数 |
| | | // model.setSum(numBadBatt); //落后总数 |
| | | // model.setNewsum(numPlan); //延时总数 |
| | | // model.setMsg(state); //61850状态 |
| | | // model.setMsgN(binformation.getFBSDeviceId().toString()); |
| | | return model; |
| | | numPlan=battdischargePlanMapper.searchByStationId(stationId); //延迟总数 |
| | | if(numBadBatt>0){ |
| | | state="item-behind"; //落后机房 |
| | | }else{ |
| | | if(numAlarm > 0){ |
| | | state="item-warn"; //告警机房 |
| | | }else{ |
| | | if(numPlan > 0){ |
| | | state="item-timeout"; //延迟机房 |
| | | } |
| | | } |
| | | } |
| | | Map<String,Object> map = new HashedMap(); |
| | | map.put("battAlarmStr",battAlarmStr); |
| | | map.put("numBadBatt",numBadBatt); |
| | | map.put("numPlan",numAlarm); |
| | | return new Response().set(1,map,"查询成功"); |
| | | |
| | | } |
| | | |