| | |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | //import com.sinata.push.config.QYTConfig; |
| | | import com.sinata.push.config.QYTConfig; |
| | | import com.sinata.push.util.*; |
| | | import io.netty.buffer.ByteBuf; |
| | | import io.netty.buffer.Unpooled; |
| | |
| | | |
| | | public static Hashtable<String,String> table; |
| | | |
| | | // public static QYTConfig qytConfig; |
| | | public static QYTConfig qytConfig; |
| | | |
| | | private RedisUtil redisUtil = SpringUtil.getObject(RedisUtil.class); |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | // public static void setQytConfig(QYTConfig qytConfig) { |
| | | // NettyServerController.qytConfig = qytConfig; |
| | | // } |
| | | public static void setQytConfig(QYTConfig qytConfig) { |
| | | NettyServerController.qytConfig = qytConfig; |
| | | } |
| | | |
| | | public static boolean isdebug = false; |
| | | public static int i = 0; |
| | |
| | | params.put("lat", String.valueOf(lat)); |
| | | params.put("directionAngle", String.valueOf(computeAzimuth)); |
| | | params.put("altitude", String.valueOf(altitude)); |
| | | HttpRequest post = HttpUtil.createPost("http://10.31.182.11:8010/chuxing/driver-server/base/savePosition"); |
| | | HttpRequest post = HttpUtil.createPost(qytConfig.getChuxingUrl() + "/driver-server/base/savePosition"); |
| | | post.contentType(MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | |
| | | params.put("lat", String.valueOf(lat)); |
| | | params.put("directionAngle", String.valueOf(computeAzimuth)); |
| | | params.put("altitude", String.valueOf(altitude)); |
| | | HttpRequest post = HttpUtil.createPost("http://10.31.182.11:8010/daijia/driver-server/base/driver/addDriverPosition"); |
| | | HttpRequest post = HttpUtil.createPost(qytConfig.getDaijiaurl() + "/driver-server/base/driver/addDriverPosition"); |
| | | post.contentType(MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | |
| | | } |
| | | } |
| | | |
| | | redisUtil.setStrValue(business + "_DRIVER" + driverId, lon + "," + lat, 30);//实时位置存入redis中 |
| | | redisUtil.setStrValue(business + ":DRIVER" + driverId, lon + "," + lat, 30);//实时位置存入redis中 |
| | | }else{ |
| | | this.sendMsgToClient(ctx, "__error__" + msg.toString()); |
| | | } |