leutu
2024-05-20 a4e99a6a39284643fdf2b04dbe55212e5954973c
src/main/java/com/skyline/electricity/timer/SchedulerTask.java
@@ -76,7 +76,7 @@
    private Map<Object, Object> map;
    private static final SimpleDateFormat dateFormat;
    public Integer mux;
    public SchedulerTask() {
        this.cmap = new ConcurrentHashMap();
        this.geometryFactory = new GeometryFactory();
@@ -92,8 +92,10 @@
        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);
    }
@@ -116,7 +118,7 @@
        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 ;
@@ -139,11 +141,11 @@
            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);
        });
@@ -511,7 +513,7 @@
        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"));
        }
@@ -526,7 +528,7 @@
        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)) {
@@ -547,7 +549,7 @@
        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"));
        }
@@ -562,7 +564,7 @@
        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();
@@ -594,7 +596,7 @@
            }
        }
    }
//    @Scheduled(fixedRate = 60000L)
    public void setRecipients() {
        final List<Recipients> recipients_list = (List<Recipients>)this.infoSynchService.selectRecipients();
@@ -605,7 +607,7 @@
            }
        }
    }
    public void setPermissions() {
        final List<Permissions> permissions_list = (List<Permissions>)this.infoSynchService.selectPermissions();
        final List<Permissions> permissions = (List<Permissions>)this.infoSynchService.getPermissions();
@@ -615,7 +617,7 @@
            }
        }
    }
//    @Scheduled(fixedRate = 300000L)
    public void setWhiteList() {
        final List<Fence_User> list = (List<Fence_User>)this.infoSynchService.selectWhiteList();
@@ -631,7 +633,7 @@
            }
        }
    }
   //@Scheduled(fixedRate = 5000L)
    public void test() {
        SchedulerTask.locationEnable = this.configInfo.getLocationEnable();
@@ -648,10 +650,10 @@
            }
        }
    }
    public static void main(final String[] args) {
    }
    static {
        SchedulerTask.log = LoggerFactory.getLogger((Class)SchedulerTask.class);
        SchedulerTask.personlocationentity = null;