| | |
| | | registerActivityLifecycleCallbacks(this) |
| | | PlatformConfig.setWeixin("wx6078319d54d38c66", "c3ef243fae93fb0fd093d457ada38b4c") |
| | | PlatformConfig.setQQZone("102047428", "qcBXgbJo6B2f5HF0") //qq互联 |
| | | // CrashReport.initCrashReport(getApplicationContext(), "444bb776ed", false); |
| | | CrashReport.initCrashReport(this, "6f590c5687", true) |
| | | LogUtils.OpenLog(true) |
| | | // initUpPoint() |
| | | initSocket() |
| | |
| | | setAlisa() |
| | | } |
| | | |
| | | public fun setAlisa() { |
| | | fun setAlisa() { |
| | | if (CacheKey.getUserId().isNotEmpty()) { |
| | | var alisa = "DRIVER" + CacheKey.getUserId() |
| | | sysErr(alisa) |
| | |
| | | } |
| | | } |
| | | |
| | | private var errorCount = 0 //定位上传失败次数 |
| | | private fun sendLocation() { |
| | | if (getUserId() != -1 && aMapLocation != null) { |
| | | val bean = CarLocationBean() |
| | | val dataBean = CarLocationBean.DataBean( |
| | | getUserId(), |
| | | currentOrderId, |
| | | currentOrderType, |
| | | aMapLocation!!.longitude, |
| | | aMapLocation!!.latitude, |
| | | aMapLocation!!.bearing.toDouble(), |
| | | aMapLocation!!.altitude |
| | | ) |
| | | bean.data = dataBean |
| | | NettyClient.getInstance() |
| | | .sendMessage(Gson().toJson(bean)) |
| | | sysErr(dataBean.toString()) |
| | | if (getUserId() != -1) { |
| | | if (aMapLocation == null|| aMapLocation!!.latitude <= 0){ |
| | | errorCount++ |
| | | if (errorCount == 10){ |
| | | Handler(Looper.getMainLooper()).postDelayed({ |
| | | getTTsManager().setVideoText("司机定位异常,请检查手机网络定位并重启司机APP") |
| | | errorCount = 0 |
| | | }, 600) |
| | | } |
| | | }else{ |
| | | errorCount = 0 |
| | | val bean = CarLocationBean() |
| | | val dataBean = CarLocationBean.DataBean( |
| | | getUserId(), |
| | | currentOrderId, |
| | | currentOrderType, |
| | | aMapLocation!!.longitude, |
| | | aMapLocation!!.latitude, |
| | | aMapLocation!!.bearing.toDouble(), |
| | | aMapLocation!!.altitude |
| | | ) |
| | | bean.data = dataBean |
| | | NettyClient.getInstance() |
| | | .sendMessage(Gson().toJson(bean)) |
| | | sysErr(dataBean.toString()) |
| | | } |
| | | } |
| | | } |
| | | |