| | |
| | | private ConfigInfo configInfo; |
| | | GeometryFactory geometryFactory; |
| | | WKTReader reader; |
| | | |
| | | |
| | | public DetectController() { |
| | | this.geometryFactory = new GeometryFactory(); |
| | | this.reader = new WKTReader(this.geometryFactory); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getAlarmInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("实时判断电子围栏和人员定位的位置关系并存储预警信息") |
| | | public void getAlarmInfo() { |
| | | this.schedulerTask.getInfo(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/saveFixedFence" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("保存固定电子围栏信息以及返回围栏重叠信息") |
| | | @ResponseBody |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/saveTempFence" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("保存临时电子围栏信息以及返回围栏重叠信息") |
| | | @ResponseBody |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getRoute" }, method = { RequestMethod.POST }) |
| | | @ApiImplicitParam(paramType = "query", name = "username", value = "人员姓名", required = true, dataType = "String") |
| | | @ApiOperation("获取人员活动轨迹") |
| | |
| | | final List<String> route = (List<String>)this.detectService.getRoute(username); |
| | | return route.toString(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getWifiInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取Wifi设备坐标") |
| | | @ResponseBody |
| | |
| | | map.put("data", dtoList); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getMonitorInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取摄像头设备坐标") |
| | | @ResponseBody |
| | |
| | | map.put("data", dtoList); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getMonitorDeviceInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取摄像头设备信息") |
| | | @ResponseBody |
| | |
| | | map.put("data", list); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getMonitorDeviceInfoById" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("通过ID获取摄像头设备信息") |
| | | @ResponseBody |
| | |
| | | map.put("data", list); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getDoorAccessInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取门禁设备坐标") |
| | | @ResponseBody |
| | |
| | | map.put("data", list); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getEnabledFenceInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取有效的电子围栏信息") |
| | | @ResponseBody |
| | |
| | | map.put("data", list); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getFixedFenceInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取固定的电子围栏信息") |
| | | @ResponseBody |
| | |
| | | map.put("data", list); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getFenceInfoById" }, method = { RequestMethod.POST }) |
| | | @ApiImplicitParam(paramType = "query", name = "workId", value = "工作票ID", required = true, dataType = "String") |
| | | @ApiOperation("根据工作票ID获取电子围栏信息") |
| | |
| | | map.put("data", list); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/updateFenceInfo" }, method = { RequestMethod.POST }) |
| | | @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", name = "fname", value = "电子围栏名称", required = false, dataType = "String"), @ApiImplicitParam(paramType = "query", name = "workId", value = "工作票ID", required = true, dataType = "String"), @ApiImplicitParam(paramType = "query", name = "workLeader", value = "工作票负责人", required = false, dataType = "String"), @ApiImplicitParam(paramType = "query", name = "starttime", value = "电子围栏生效时间", required = false, dataType = "String"), @ApiImplicitParam(paramType = "query", name = "disabledtime", value = "电子围栏失效时间", required = false, dataType = "String") }) |
| | | @ApiOperation("更新电子围栏信息") |
| | |
| | | result.setMessage("输入的围栏相关信息有误 更新失败"); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/deleteFenceById" }, method = { RequestMethod.POST }) |
| | | @ApiImplicitParam(paramType = "query", name = "workId", value = "工作票ID", required = true, dataType = "String") |
| | | @ApiOperation("根据工作票ID删除电子围栏信息") |
| | |
| | | result.setMessage("删除失败"); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/deleteFence" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("删除所有电子围栏信息") |
| | | @ResponseBody |
| | |
| | | result.setMessage("删除失败"); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getDeviceInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取设备的相关信息") |
| | | @ResponseBody |
| | |
| | | map.put("list", list); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getDeviceInfoById" }, method = { RequestMethod.GET }) |
| | | @ApiOperation("根据KKS编码获取设备的相关信息") |
| | | @ResponseBody |
| | |
| | | result.setMessage("输入的设备ID不存在 无法查询相应的数据"); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/selectFencePersonRelByworkid" }, method = { RequestMethod.GET }) |
| | | @ApiOperation("根据workid获取围栏内的人员信息") |
| | | @ResponseBody |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/selectFenceAndfixedArea" }, method = { RequestMethod.GET }) |
| | | @ApiOperation("获取围栏和固定区域列表") |
| | | @ResponseBody |
| | |
| | | } |
| | | return fencePositionList; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/saveFence_yq" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("保存区域信息") |
| | | @ResponseBody |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/saveFix" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("保存区域信息") |
| | | @ResponseBody |
| | |
| | | catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.out.println(polygon.toString()); |
| | | //System.out.println(polygon.toString()); |
| | | final FencePosition fencePosition = new FencePosition(); |
| | | fencePosition.setFenceposition(polygon.toString()); |
| | | fencePosition.setCreatetime(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date())); |
| | |
| | | this.detectService.insertPolygon(fencePosition); |
| | | return "ok"; |
| | | } |
| | | |
| | | |
| | | static { |
| | | DetectController.log = LoggerFactory.getLogger((Class)DetectController.class); |
| | | } |
| | |
| | | OutService outService; |
| | | @Autowired |
| | | private ConfigInfo configInfo; |
| | | |
| | | |
| | | @RequestMapping(value = { "/getCameraEntity" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取摄像头实体列表") |
| | | @ResponseBody |
| | |
| | | final JSONObject jsonObjectResult = JSONObject.parseObject(body); |
| | | return jsonObjectResult.get((Object)"data"); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getCloudplatformInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取摄像头云台操作信息") |
| | | @ResponseBody |
| | |
| | | final ResponseEntity<String> responseEntity = (ResponseEntity<String>)restTemplate.postForEntity(this.configInfo.getDevice_ip()+ "/restapi/iot/iotinfomgr/service/invoke/cameras/ptzControl?apikey=" + this.configInfo.getApikey(), (Object)httpEntity, (Class)String.class, new Object[0]); |
| | | return responseEntity.getBody(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getPreviewUrls" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取摄像头获取预览流url") |
| | | @ResponseBody |
| | |
| | | |
| | | return json; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getDoorAccessEntity" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取门禁实体列表") |
| | | @ResponseBody |
| | |
| | | final JSONObject jsonObjectResult = JSONObject.parseObject(body); |
| | | return jsonObjectResult.get((Object)"data"); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getPlaybackURLs" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("摄像头获取回放流url") |
| | | @ResponseBody |
| | |
| | | final JSON json = (JSON)JSON.parse((String)responseEntity.getBody()); |
| | | return json; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getHistoryDoorAccess" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取历史门禁信息") |
| | | @ResponseBody |
| | |
| | | final JSON json = (JSON)JSON.parse((String)responseEntity.getBody()); |
| | | return json; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getEquipmentInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("设备信息获取") |
| | | @ResponseBody |
| | |
| | | final JSON json = (JSON)JSON.parse((String)responseEntity.getBody()); |
| | | return json; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getReconditionInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取设备的检修历史") |
| | | @ResponseBody |
| | |
| | | final JSON json = (JSON)JSON.parse((String)responseEntity.getBody()); |
| | | return json; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getDeviceKKSInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取设备的KKS信息") |
| | | @ResponseBody |
| | |
| | | map.put("list", deviceList); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getDuty" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取当值值长") |
| | | @ResponseBody |
| | |
| | | final Map<String, Object> map = new HashMap<String, Object>(); |
| | | final String dzzzresponse = (String)template.getForObject(this.configInfo.getDzzzUrl(), (Class)String.class, new Object[0]); |
| | | final JSONObject json = JSONObject.parseObject(dzzzresponse); |
| | | System.out.println(json.getJSONObject("data").getString("id")); |
| | | //System.out.println(json.getJSONObject("data").getString("id")); |
| | | DeviceController.log.warn(dzzzresponse.toString()); |
| | | return dzzzresponse; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getOutPeople" }, method = { RequestMethod.GET }) |
| | | @ApiOperation("获取外包人员") |
| | | @ResponseBody |
| | |
| | | DeviceController.log.warn(list.toString()); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | static { |
| | | DeviceController.log = LoggerFactory.getLogger((Class)DeviceController.class); |
| | | } |
| | |
| | | GeometryFactory geometryFactory; |
| | | WKTReader reader; |
| | | SimpleDateFormat sdf; |
| | | |
| | | |
| | | public RemoteController() { |
| | | this.geometryFactory = new GeometryFactory(); |
| | | this.reader = new WKTReader(this.geometryFactory); |
| | | this.sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getMultiPersonlocations" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("远程调用多个人员定位接口获取定位信息并将其融合") |
| | | @ResponseBody |
| | |
| | | map.put("list", newList); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getRTCMultiPersonlocations" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("从缓存获取人员信息") |
| | | @ResponseBody |
| | |
| | | final Object object = this.getMultiPersonlocations(shopId, modId, modKey, pageNum, pageSize, value); |
| | | return object; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getPersonlocation" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("远程调用单个人员定位接口获取定位信息并将其融合") |
| | | @ResponseBody |
| | |
| | | final ResponseEntity<String> responseEntity1 = (ResponseEntity<String>)restTemplate.getForEntity(this.configInfo.getUWB_Historylocation() + "?apikey=" + this.configInfo.getApikey() + "&userId={userId}&shopId={shopId}&startTime={startTime}&endTime={endTime}", (Class)String.class, (Map)params1); |
| | | final String body1 = (String)responseEntity1.getBody(); |
| | | final JSONObject jsonObjectResult1 = JSONObject.parseObject(body1); |
| | | System.out.println(jsonObjectResult1.get((Object)"data")); |
| | | //System.out.println(jsonObjectResult1.get((Object)"data")); |
| | | if (jsonObjectResult1 != null) { |
| | | final JSONArray jsonArray1 = (JSONArray)jsonObjectResult1.get((Object)"data"); |
| | | final List<UWBHistoryInfo> list1 = (List<UWBHistoryInfo>)jsonArray1.toJavaList((Class)UWBHistoryInfo.class); |
| | |
| | | final ResponseEntity<String> responseEntity2 = (ResponseEntity<String>)restTemplate.postForEntity(this.configInfo.getGPS_Historylocation()+ "?apikey=" + this.configInfo.getApikey(), (Object)httpEntity, (Class)String.class, new Object[0]); |
| | | final String body2 = (String)responseEntity2.getBody(); |
| | | final JSONObject jsonObjectResult2 = JSONObject.parseObject(body2); |
| | | System.out.println(jsonObjectResult2.get((Object)"data")); |
| | | //System.out.println(jsonObjectResult2.get((Object)"data")); |
| | | final JSONObject object = (JSONObject)jsonObjectResult2.get((Object)"data"); |
| | | if (object != null) { |
| | | final JSONArray jsonArray2 = (JSONArray)object.get((Object)"statisticList"); |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getMultiHistorylocationByName" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("远程调用多个人员历史轨迹接口获取相关信息并将其融合(输入姓名)") |
| | | @ResponseBody |
| | |
| | | } |
| | | return hisInfo; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/oldgetHistorylocation" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("远程调用单个人员历史轨迹接口获取相关信息并将其融合(未补点)") |
| | | @ResponseBody |
| | |
| | | hisInfo.add(historyRoute); |
| | | return hisInfo; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getHistorylocation" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("远程调用单个人员历史轨迹接口获取相关信息并将其融合(输入ID)") |
| | | @ResponseBody |
| | |
| | | hisInfo.add(historyRoute); |
| | | return hisInfo; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getMultiHistorylocation" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("远程调用多个人员历史轨迹接口获取相关信息并将其融合(输入ID)") |
| | | @ResponseBody |
| | |
| | | } |
| | | return hisInfo; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getConfigInfo" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("获取配置信息") |
| | | @ResponseBody |
| | |
| | | configinfo.put("dzzzUrl", this.configInfo.getDzzzUrl()); |
| | | return configinfo; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getAllHistorylocation" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("远程调用所有人员历史轨迹接口获取相关信息并将其融合") |
| | | @ResponseBody |
| | |
| | | } |
| | | return hisInfo; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/sendMessageToUWB" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("sendMessageToUWB") |
| | | @ResponseBody |
| | |
| | | final ResponseEntity<String> responseEntity = (ResponseEntity<String>)restTemplate.postForEntity(uwbUrl+ "?apikey=" + this.configInfo.getApikey(), (Object)httpEntity, (Class)String.class, new Object[0]); |
| | | return responseEntity.getBody(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = { "/getMultiYQPersonlocations" }, method = { RequestMethod.POST }) |
| | | @ApiOperation("远程调用多个人员定位接口获取定位信息") |
| | | @ResponseBody |
| | |
| | | RemoteController.log.info("map" + map.toString()); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | private List<FencePositionYQ> getFencePositionYQ() { |
| | | final List<FencePositionYQ> yqList = new ArrayList<FencePositionYQ>(); |
| | | final FencePositionYQ yq11 = new FencePositionYQ(); |
| | |
| | | yqList.add(yq16); |
| | | return yqList; |
| | | } |
| | | |
| | | |
| | | static { |
| | | log = LoggerFactory.getLogger((Class)RemoteController.class); |
| | | } |
| | |
| | | private static Logger log; |
| | | private static final AtomicInteger OnlineCount; |
| | | private static CopyOnWriteArraySet<Session> SessionSet; |
| | | |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | | System.out.println("websocket 加载"); |
| | | // System.out.println("websocket 加载"); |
| | | } |
| | | |
| | | |
| | | @OnOpen |
| | | public void onOpen(final Session session) { |
| | | WebSocketServer.SessionSet.add(session); |
| | |
| | | WebSocketServer.log.info("有连接加入,当前连接数为:{}", (Object)cnt); |
| | | SendMessage(session, "连接成功"); |
| | | } |
| | | |
| | | |
| | | @OnClose |
| | | public void onClose(final Session session) { |
| | | WebSocketServer.SessionSet.remove(session); |
| | | final int cnt = WebSocketServer.OnlineCount.decrementAndGet(); |
| | | WebSocketServer.log.info("有连接关闭,当前连接数为:{}", (Object)cnt); |
| | | } |
| | | |
| | | |
| | | @OnMessage |
| | | public void onMessage(final String message, final Session session) { |
| | | WebSocketServer.log.info("来自客户端的消息:{}", (Object)message); |
| | | SendMessage(session, "收到消息,消息内容:" + message); |
| | | } |
| | | |
| | | |
| | | @OnError |
| | | public void onError(final Session session, final Throwable error) { |
| | | WebSocketServer.log.error("发生错误:{},Session ID: {}", (Object)error.getMessage(), (Object)session.getId()); |
| | | error.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | public static void SendMessage(final Session session, final String message) { |
| | | try { |
| | | session.getBasicRemote().sendText(String.format("%s", message)); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void BroadCastInfo(final String message) throws IOException { |
| | | |
| | | for (final Session session : WebSocketServer.SessionSet) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void SendMessage(final String message, final String sessionId) throws IOException { |
| | | Session session = null; |
| | | |
| | |
| | | WebSocketServer.log.warn("没有找到你指定ID的会话:{}", (Object)sessionId); |
| | | } |
| | | } |
| | | |
| | | |
| | | static { |
| | | WebSocketServer.log = LoggerFactory.getLogger((Class)WebSocketServer.class); |
| | | OnlineCount = new AtomicInteger(0); |
| | |
| | | private static final String PREFIX = "bearer "; |
| | | @Autowired |
| | | private RemoteController remoteController; |
| | | |
| | | |
| | | public Object getUserInfoFromIam(final String token) { |
| | | final RestTemplate restTemplate = new RestTemplate(); |
| | | final String url = PropertiesUtil.getProperty("userInfo_url"); |
| | |
| | | final ResponseEntity<String> responseEntity = (ResponseEntity<String>)restTemplate.exchange(url, HttpMethod.GET, httpEntity, (Class)String.class, new Object[0]); |
| | | if (responseEntity.getStatusCode().value() == 200) { |
| | | result = (String)responseEntity.getBody(); |
| | | System.out.println(result); |
| | | //System.out.println(result); |
| | | } |
| | | if ("".equals(result)) { |
| | | return null; |
| | |
| | | } |
| | | return resultJson.getJSONObject("data"); |
| | | } |
| | | |
| | | |
| | | public String getTokenByCode(final String code) { |
| | | if (StringUtils.isBlank((CharSequence)code)) { |
| | | return null; |
| | |
| | | final ResponseEntity<String> responseEntity = (ResponseEntity<String>)restTemplate.getForEntity(url, (Class)String.class, new Object[0]); |
| | | if (responseEntity.getStatusCode().value() == 200) { |
| | | result = (String)responseEntity.getBody(); |
| | | System.out.println(result); |
| | | //System.out.println(result); |
| | | } |
| | | if (StringUtils.isBlank((CharSequence)result)) { |
| | | return null; |
| | | } |
| | | final JSONObject resultJson = JSONObject.parseObject(result); |
| | | if (resultJson.containsKey((Object)"error")) { |
| | | System.out.println(resultJson.toJSONString()); |
| | | //System.out.println(resultJson.toJSONString()); |
| | | return null; |
| | | } |
| | | return resultJson.getString("data"); |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | public String getInfo() { |
| | | System.out.println(PropertiesUtil.getProperty("userInfo_url") + PropertiesUtil.getProperty("token_url")); |
| | | //System.out.println(PropertiesUtil.getProperty("userInfo_url") + PropertiesUtil.getProperty("token_url")); |
| | | return PropertiesUtil.getProperty("userInfo_url") + PropertiesUtil.getProperty("token_url"); |
| | | } |
| | | } |
| | |
| | | InformationService informationService ; |
| | | @Override |
| | | public void onMessage(String message) { |
| | | System.out.println("recv msg: "+message); |
| | | //System.out.println("recv msg: "+message); |
| | | sendAllMessage(message); |
| | | } |
| | | |
| | |
| | | */ |
| | | |
| | | public void sendAllMessage(String message) { |
| | | System.out.println("【websocket消息】广播消息:"+message); |
| | | //System.out.println("【websocket消息】广播消息:"+message); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(message); |
| | | String personNo = jsonObject.getString("personNo"); |
| | | |
| | | SysUser sysUser = infoSynchService.selectUserInfoById(personNo) ; |
| | | System.out.println("【user]:"+JSONObject.toJSONString(sysUser)); |
| | | //System.out.println("【user]:"+JSONObject.toJSONString(sysUser)); |
| | | List<RetInfo> list = new ArrayList<>(); |
| | | //查询用户所处围栏 |
| | | List<FencePosition> fencePositionList = null ; |
| | |
| | | }catch (Exception e){ |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | System.out.println("【FencePosition]:"+JSONObject.toJSONString(fencePositionList)); |
| | | //System.out.println("【FencePosition]:"+JSONObject.toJSONString(fencePositionList)); |
| | | RetInfo alertinfo = new RetInfo(); |
| | | initAlertInfos(jsonObject, personNo, sysUser, alertinfo); |
| | | if( fencePositionList != null && fencePositionList.size() > 0){ |
| | |
| | | list.add(alertinfo) ; |
| | | } |
| | | insertInformation(list); |
| | | System.out.println( "list:"+jsonObject.toJSONString(list)); |
| | | // System.out.println( "list:"+jsonObject.toJSONString(list)); |
| | | // if( list != null && list.size() > 0) |
| | | // System.out.println( "websocket status ..["+webSocketController.sendAllMessage(JSONObject.toJSONString(list))+"["+JSONObject.toJSONString(list)+"]" ); |
| | | } |
| | |
| | | private Map<Object, Object> map; |
| | | private static final SimpleDateFormat dateFormat; |
| | | public Integer mux; |
| | | |
| | | |
| | | public SchedulerTask() { |
| | | this.cmap = new ConcurrentHashMap(); |
| | | this.geometryFactory = new GeometryFactory(); |
| | |
| | | |
| | | List<RetInfo> rlist = new ArrayList<>(); |
| | | list.stream().forEach(r->rlist.add(JSONObject.parseObject(r,RetInfo.class))) ; |
| | | if( list != null && list.size() > 0) |
| | | System.out.println( "websocket status ..["+webSocketController.sendAllMessage(JSONObject.toJSONString(rlist))+"["+JSONObject.toJSONString(rlist)+"]" ); |
| | | if( list != null && list.size() > 0){ |
| | | webSocketController.sendAllMessage(JSONObject.toJSONString(rlist)); |
| | | } |
| | | // System.out.println( "websocket status ..["+JSONObject.toJSONString(rlist)+"]" ); |
| | | //推送报警信息 |
| | | pushIM(rlist); |
| | | } |
| | |
| | | |
| | | rlist.stream().forEach((k) -> { |
| | | // if( k.getStatus().equals("ok")) return ; |
| | | System.out.println( "k====="+k.getLongitude()+" "+k.getLatitude()) ; |
| | | //System.out.println( "k====="+k.getLongitude()+" "+k.getLatitude()) ; |
| | | MonitorInfo monitor = informationService.queryMinDistance(k.getLongitude(),k.getLatitude()); |
| | | if( monitor == null ) return ; |
| | | |
| | |
| | | map.put("startDate",formattedDate); |
| | | map.put("warnName", k.getUserName()+"进入"+k.getFence_name()); |
| | | String url = configInfo.getWarn_url(); |
| | | System.out.println( "post url warning "+url) ; |
| | | System.out.println( "post url warning "+configInfo.getServer_url()) ; |
| | | //System.out.println( "post url warning "+url) ; |
| | | //System.out.println( "post url warning "+configInfo.getServer_url()) ; |
| | | url = "http://10.69.206.205:8080/a/ew/ewWarning/warning"; |
| | | ResponseEntity<String> result = template.postForEntity(url, map,String.class); |
| | | System.out.println("【user info】:"+result); |
| | | //System.out.println("【user info】:"+result); |
| | | |
| | | }); |
| | | |
| | |
| | | final JSONObject json = JSONObject.parseObject(dzzzresponse); |
| | | SchedulerTask.log.warn(dzzzresponse.toString()); |
| | | SchedulerTask.log.warn(json.getJSONObject("data").getString("id")); |
| | | System.out.println(json.getJSONObject("data").getString("id")); |
| | | //System.out.println(json.getJSONObject("data").getString("id")); |
| | | if (',' == recipent.charAt(recipent.length() - 1)) { |
| | | recipent.append(json.getJSONObject("data").getString("id")); |
| | | } |
| | |
| | | final ResponseEntity responseEntity = template.postForEntity(imUrl + "/oapi/message/sendworkmsg?tenantId=" + tenantId, (Object)httpEntity, (Class)String.class, new Object[0]); |
| | | SchedulerTask.log.warn("推送结果" + responseEntity.toString()); |
| | | } |
| | | |
| | | |
| | | public void pushCommonMessage(final String userid, final String dzzzUrl, final String imUrl, final String tenantId, final MultiValueMap<String, String> params, final HttpHeaders headers, final RestTemplate template, final Map<String, Object> configMap, final JSONObject message) { |
| | | final StringBuilder recipent = new StringBuilder(message.get((Object)"recipient").toString()); |
| | | if (',' != recipent.charAt(recipent.length() - 1)) { |
| | |
| | | final JSONObject json = JSONObject.parseObject(dzzzresponse); |
| | | SchedulerTask.log.warn(dzzzresponse.toString()); |
| | | SchedulerTask.log.warn(json.getJSONObject("data").getString("id")); |
| | | System.out.println(json.getJSONObject("data").getString("id")); |
| | | //System.out.println(json.getJSONObject("data").getString("id")); |
| | | if (',' == recipent.charAt(recipent.length() - 1)) { |
| | | recipent.append(json.getJSONObject("data").getString("id")); |
| | | } |
| | |
| | | final ResponseEntity responseEntity = template.postForEntity(imUrl + "/oapi/message/sendworkmsg?tenantId=" + tenantId, (Object)httpEntity, (Class)String.class, new Object[0]); |
| | | SchedulerTask.log.warn("推送结果" + responseEntity.toString()); |
| | | } |
| | | |
| | | |
| | | // @Scheduled(fixedRate = 5000L) |
| | | public void changeFenceStatus() { |
| | | final List<FencePosition> fencePositions = (List<FencePosition>)this.detectService.getTempFenceInfo(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // @Scheduled(fixedRate = 60000L) |
| | | public void setRecipients() { |
| | | final List<Recipients> recipients_list = (List<Recipients>)this.infoSynchService.selectRecipients(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public void setPermissions() { |
| | | final List<Permissions> permissions_list = (List<Permissions>)this.infoSynchService.selectPermissions(); |
| | | final List<Permissions> permissions = (List<Permissions>)this.infoSynchService.getPermissions(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // @Scheduled(fixedRate = 300000L) |
| | | public void setWhiteList() { |
| | | final List<Fence_User> list = (List<Fence_User>)this.infoSynchService.selectWhiteList(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //@Scheduled(fixedRate = 5000L) |
| | | public void test() { |
| | | SchedulerTask.locationEnable = this.configInfo.getLocationEnable(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void main(final String[] args) { |
| | | } |
| | | |
| | | |
| | | static { |
| | | SchedulerTask.log = LoggerFactory.getLogger((Class)SchedulerTask.class); |
| | | SchedulerTask.personlocationentity = null; |
| | |
| | | final float[] a = { 2.0f, 3.0f, 4.0f }; |
| | | final float[] b = { 2.0f, 3.0f, 4.0f }; |
| | | final float[] g = new float[4]; |
| | | System.out.println(g.length); |
| | | //System.out.println(g.length); |
| | | final float[][] p = { a, b }; |
| | | final float[][] c = { a, b }; |
| | | final float[][][] t = { p, c }; |