zhangnaisong
2023-07-22 ed71767fdb228c6dc154e585756fb8afb7f531d7
ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
@@ -84,27 +84,33 @@
                    Map<String,Map<String,Object>> deptMap = PositionContainer.getDeptPositionMap().get(deptId);
                    if(deptMap == null){
                        deptMap = new HashMap();
                    }
                    deptMap.put((String)gpsMap.get("carId"),gpsMap);//首次加入容器,再次去重
                        deptMap.put((String)gpsMap.get("carId"),gpsMap);
                    PositionContainer.getDeptPositionMap().put(deptId,deptMap);
                }else{
                        deptMap.put((String)gpsMap.get("carId"),gpsMap);
                    }
                }else{//其他部门
                    //加入本部门容器
                    String deptId = String.valueOf(gpsMap.get("deptId"));
                    Map<String,Map<String,Object>> deptMap = PositionContainer.getDeptPositionMap().get(deptId);
                    if(deptMap == null){
                        deptMap = new HashMap();
                    }
                    deptMap.put((String)gpsMap.get("carId"),gpsMap);//首次加入容器,再次去重
                        deptMap.put((String)gpsMap.get("carId"),gpsMap);
                    PositionContainer.getDeptPositionMap().put(deptId,deptMap);
                    }else{
                        deptMap.put((String)gpsMap.get("carId"),gpsMap);
                    }
                    //加入父级部门容器
                    for(int i = 1;i <= ancestorsArray.length - 1;i++){
                        String deptIdp = String.valueOf(gpsMap.get(ancestorsArray[i]));
                        String deptIdp = ancestorsArray[i];
                        Map<String,Map<String,Object>> deptMapp = PositionContainer.getDeptPositionMap().get(deptIdp);
                        if(deptMapp == null){
                            deptMapp = new HashMap();
                            deptMapp.put((String)gpsMap.get("carId"),gpsMap);
                            PositionContainer.getDeptPositionMap().put(deptIdp,deptMapp);
                        }else{
                            deptMapp.put((String)gpsMap.get("carId"),gpsMap);
                        }
                        deptMapp.put((String)gpsMap.get("carId"),gpsMap);//首次加入容器,再次去重
                        PositionContainer.getDeptPositionMap().put(deptIdp,deptMap);
                    }
                }
            }
@@ -137,7 +143,7 @@
    public void sendMassage() {
        try {
            PushClientImplPosition client = new PushClientImplPosition();
            client.setLog(false);//是否打印明文
            client.setLog(true);//是否打印明文
            client.setHost(this.ip);//服务器IP
            client.setPort(10100);//服务器端口
            client.setUserName(this.userId);//系统用户名