leutu
2024-08-20 bbd50cf91c9a8c7cfe48b3c00dde205b7049ae3b
src/main/java/com/skyline/electricity/timer/Consumer.java
@@ -82,7 +82,7 @@
                Fence_User fence_user = detectService.checkInAlert(f.getWorkId(),sysUser.getId());
                alertinfo.setFence_name(f.getFname());
                alertinfo.setWtId(f.getWorkId());
                if( fence_user == null && checkHight(alertinfo.getBaseFloor(),f.getStartaltitude())){
                if( fence_user == null && checkHight(alertinfo.getBaseFloor(),f)){
                    alertinfo.setStatus("alert");
                }else{
@@ -118,8 +118,10 @@
        alertinfo.setHb(jsonObject.getInteger("hb").intValue());
    }
    private boolean checkHight(String basefloor,double start){
        return  (Integer.parseInt(basefloor)-2)*6.3 >=start ;
    private boolean checkHight(String basefloor,FencePosition f){
        int fl = (int)(f.getEndaltitude()/7)+1 ;
        System.out.println("接收:"+basefloor+" 围栏楼层:"+f.getFname()+":"+fl);
        return  (Integer.parseInt(basefloor)-1) ==fl ;
    }
@@ -131,7 +133,7 @@
           information.setName(r.getFence_name());
           //information.setStartTime(r.getStartTime());
           //避免时间同步问题
           information.setStartTime((new Date()).getTime()+"");
           information.setStartTime((new Date()).getTime()/1000+"");
           information.setStatus(r.getStatus());
           information.setUserId(r.getUserId());
           information.setWtId(r.getWtId());