| | |
| | | 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{ |
| | |
| | | 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 ; |
| | | } |
| | | |
| | | |
| | |
| | | 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()); |