| | |
| | | import com.whyc.pojo.db_ckpwrdev_data_rt.CKPowerDevSignal; |
| | | import com.whyc.pojo.db_ckpwrdev_data_rt.CKPowerDevSignalSet; |
| | | import com.whyc.util.CommonUtil; |
| | | import com.whyc.util.DateUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | //头部开关统计 |
| | | public Response getSwitchReal(){ |
| | | Map<String,Integer> map=new HashMap<>(); |
| | | map.put("onSwitch",0); |
| | | map.put("offSwitch",0); |
| | | //map.put("alarmSwitch",0); |
| | | //map.put("runSwitch",0); |
| | | Map<String,String> map=new HashMap<>(); |
| | | map.put("onSwitch","0"); |
| | | map.put("offSwitch","0"); |
| | | map.put("nowTime",DateUtil.format_YYYY_MM_DD_HH_MM_SS(new Date())); |
| | | map.put("recordTime",DateUtil.format_YYYY_MM_DD_HH_MM_SS(new Date())); |
| | | QueryWrapper<CKPowerDevSignal> query = Wrappers.query(); |
| | | query.last(" limit 1"); |
| | | CKPowerDevSignal switchReal=mapper.selectOne(query); |
| | |
| | | }else{ |
| | | onSwitch+= CommonUtil.getIntToBinary(switchReal.getDc2Switch4TripFake()); |
| | | } |
| | | map.put("recordTime", DateUtil.format_YYYY_MM_DD_HH_MM_SS(switchReal.getRecordTime())); |
| | | } |
| | | map.put("onSwitch",onSwitch); |
| | | map.put("onSwitch",String.valueOf(onSwitch)); |
| | | //获取总的启用断路器开关数 |
| | | int swtichAll=breakerInfMapper.getSwtichAll(); |
| | | map.put("offSwitch",swtichAll-onSwitch); |
| | | map.put("offSwitch",String.valueOf(swtichAll-onSwitch)); |
| | | return new Response().set(1,map); |
| | | } |
| | | } |