| | |
| | | import com.hxzkoa.services.SysSettingService; |
| | | import com.hxzkoa.services.ZhwService; |
| | | import com.hxzkoa.services.AnchorService; |
| | | import com.hxzkoa.services.FenceService; |
| | | import com.hxzkoa.udp.Dell_Ip; |
| | | import com.hxzkoa.udp.GetNowTime; |
| | | import com.hxzkoa.udp.ReadPeizhiMessage; |
| | |
| | | private SysSettingService sysSettingService; |
| | | @Autowired |
| | | private AnchorService AnchorService; |
| | | @Autowired |
| | | private FenceService fenceService; |
| | | |
| | | httpsos sos = new httpsos(); |
| | | |
| | |
| | | public String drawFence_init(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
| | | String toPage = "forward:/hxzk/fence/drawFence.jsp"; |
| | | List<tb_map> floorList = ZhwService.getFloor(); |
| | | List<tb_fence> fenceList = fenceService.getFenceList(); |
| | | List<String> fencenames = new ArrayList<>(); |
| | | for (int i =0;i < fenceList.size(); i++) { |
| | | fencenames.add(fenceList.get(i).getName()); |
| | | } |
| | | request.setAttribute("fenceList", fencenames); |
| | | request.setAttribute("floorList", floorList); |
| | | return toPage; |
| | | } |
| | |
| | | public int sanweiFence_add(HttpServletRequest request) { |
| | | tb_fence fence = new tb_fence(); |
| | | String layer = request.getParameter("layer"); |
| | | if(!layer.equals("百度地图")) { |
| | | if(!layer.equals("百度地图") && !layer.equals("手动输入") && !layer.equals("自动输入")) { |
| | | Integer layerjj = Integer.parseInt(layer); |
| | | layer = layerjj.toString(); |
| | | }else { |
| | | layer = "百度地图"; |
| | | } |
| | | fence.setFloor(layer); |
| | | fence.setType(request.getParameter("weilanleixing")); |
| | |
| | | fence.setName(request.getParameter("quyumingcheng")); |
| | | fence.setBaoliu1(request.getParameter("fencegao")); |
| | | String zuobiao =(String) request.getParameter("zuobiao"); |
| | | String zuobiaodufen = (String) request.getParameter("zuobiaodufen"); |
| | | fence.setZuobiao(zuobiao); |
| | | |
| | | fence.setShape(request.getParameter("xingzhuang")); |
| | |
| | | |
| | | fence.setColor(request.getParameter("yanse")); |
| | | ZhwService.sanweiFence_add(fence); |
| | | String xieyi = "BSTOCS1,ADDFENCE,"+fence.getFloor()+","+fence.getType()+","+fence.getBumen()+","+fence.getName()+","+fence.getZuobiao()+","+fence.getShape()+","+fence.getStart()+","+fence.getStop()+","+GetNowTime.now()+","+fence.getColor()+",END"; |
| | | String xieyi = "BSTOCS1,ADDFENCE,"+fence.getFloor()+","+fence.getType()+","+fence.getBumen()+","+fence.getName()+","+zuobiao+","+fence.getShape()+","+fence.getStart()+","+fence.getStop()+","+GetNowTime.now()+","+fence.getColor()+","+fence.getBaoliu1()+",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | |
| | | sysSettingService.guiling(); |
| | | String type = request.getParameter("weilanleixing"); |
| | | String name = request.getParameter("quyumingcheng"); |
| | | String floor = request.getParameter("layer"); |
| | |
| | | position.setSos(node.getP_sos()); |
| | | position.setTime(node.getP_addtiem()); |
| | | position.setFence(node.getP_fence()); |
| | | |
| | | position.setChaichu(node.getBaoliu6()); |
| | | finalPositionList.add(position); |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | public List<tb_gps> getGPS(HttpServletRequest request) { |
| | | final List<tb_gps> gpsList = ZhwService.getGPS(); |
| | | long timeNow = System.currentTimeMillis(); |
| | | long timeStart = timeNow - 1000; //取1s内最新的一条数据作为当前的实时位置,后期可更改,此处为ms单位 |
| | | // long timeStart = 0; |
| | | |
| | | List<tb_gps> finalGPSList = new ArrayList<tb_gps>(); |
| | | for ( tb_gps node : gpsList) { |
| | | //仅取最新更新时间在当前时间十秒内的数据 |
| | | // String timeRecent = node.getAddtime(); |
| | | // Timestamp ts = Timestamp.valueOf(timeRecent); |
| | | // long times = ts.getTime(); |
| | | // if (times >= timeStart) { |
| | | // int jingdu = node.getGsp_jingdu().length(); |
| | | // //System.out.print("执行了"+jingdu); |
| | | if (node.getGsp_jingdu() != null && !node.getGsp_jingdu().equals("00000.000000") && node.getGps_weidu() != null && !node.getGps_weidu().equals("00000.000000")) { |
| | | // String weidu = node.getGps_weidu().substring(0,node.getGps_weidu().length()-1); |
| | | // node.setGps_weidu(weidu); |
| | | // String jingdu2 = node.getGsp_jingdu().substring(0, node.getGsp_jingdu().length()-1); |
| | | // node.setGsp_jingdu(jingdu2); |
| | | finalGPSList.add(node); |
| | | } |
| | | // String weidu = node.getGps_weidu().substring(0,node.getGps_weidu().length()-1); |
| | | // node.setGps_weidu(weidu); |
| | | // String jingdu = node.getGsp_jingdu().substring(0, node.getGsp_jingdu().length()-1); |
| | | // node.setGsp_jingdu(jingdu); |
| | | // finalGPSList.add(node); |
| | | // } |
| | | }; |
| | | return finalGPSList; |
| | | } |
| | |
| | | public void sosgaojing(HttpServletRequest request) throws IOException { |
| | | String tagid=request.getParameter("tagid"); |
| | | ZhwService.sosgao(tagid); |
| | | String xieyi = "BSTOCS1,DELLWARN," +tagid+ ",SOS,END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | |
| | | @RequestMapping(value = "/fencegaojing.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void fencegaojing(HttpServletRequest request) throws IOException { |
| | | String tagid=request.getParameter("tagid"); |
| | | String type=request.getParameter("type"); |
| | | ZhwService.fencegao(tagid); |
| | | String xieyi = "BSTOCS1,DELLWARN," +tagid+ ","+type+",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | |
| | | @RequestMapping(value = "/chaichugaojing.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void chaichugaojing(HttpServletRequest request) throws IOException { |
| | | String tagid=request.getParameter("tagid"); |
| | | ZhwService.chaichugao(tagid); |
| | | String xieyi = "BSTOCS1,DELLWARN," +tagid+ ",被拆除,END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | |
| | | @RequestMapping(value = "/gaojingzongchuli.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void gaojingzongchuli(HttpServletRequest request) throws IOException { |
| | | List<tb_person> soslist = ZhwService.getsosgaojing(); |
| | | for (int i=0; i<soslist.size(); i++) { |
| | | String tagid = soslist.get(i).getP_tagid(); |
| | | ZhwService.sosgao(tagid); |
| | | String xieyi = "BSTOCS1,DELLWARN," +tagid+ ",SOS,END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | List<tb_person> fencelist = ZhwService.getfencegaojing(); |
| | | for (int i=0; i<fencelist.size(); i++) { |
| | | String tagid = fencelist.get(i).getP_tagid(); |
| | | ZhwService.fencegao(tagid); |
| | | String xieyi = "BSTOCS1,DELLWARN," +tagid+ ",危险区域,END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | List<tb_person> chufencelist = ZhwService.getchufencegaojing(); |
| | | for (int i=0; i<fencelist.size(); i++) { |
| | | String tagid = chufencelist.get(i).getP_tagid(); |
| | | ZhwService.fencegao(tagid); |
| | | String xieyi = "BSTOCS1,DELLWARN," +tagid+ ",出区域告警,END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | return realkaoqingList; |
| | | } |
| | | |
| | | @RequestMapping(value = "/xiafazhendong.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void xiafazhendong(HttpServletRequest request) throws IOException { |
| | | String tagid=request.getParameter("tagid"); |
| | | String xieyi = "55BB,TAG_SHAKE,10,"+tagid+",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | |
| | | public static List<Object[]> objectToArray_qihouManagement2(List<tb_qihou> tb_qihouList) { |
| | | List<Object[]> reList = new ArrayList<>(); |
| | | for (int i = 0; i < tb_qihouList.size(); i++) { |