lizhanwei
2020-07-27 202bc6b58cc9b5157761163e645c8e0170ab97ac
app/src/main/java/safeluck/drive/evaluation/DB/rtktb/RTKConfigUpdateWorker.kt
@@ -106,8 +106,9 @@
                                                + applicationContext.getPackageName() + "/" + fileName)
                                        CThreadPoolExecutor.runInBackground(Runnable {
                                            str = gson.toJson(map.data.map_json)
                                            MyLog.i(PlatFormConstant.HTTPTAG,"科三道路地图保存成功")
                                            FileUtil.writeTxtFileToSD(applicationContext, fileName, str, "")
                                            sendRoadMapInfo()
//                                            sendRoadMapInfo()
                                        })
                                    }
@@ -124,9 +125,10 @@
                                            ExamPlatformData.getInstance().setNewMapPath(Environment.getExternalStorageDirectory().absolutePath + "/"
                                                    + applicationContext.getPackageName() + "/"+fileName)
                                            CThreadPoolExecutor.runInBackground(Runnable{
                                                MyLog.i(PlatFormConstant.HTTPTAG,"科三场地地图保存成功")
                                                str = gson.toJson(yard.data.map_json)
                                                FileUtil.writeTxtFileToSD(applicationContext,fileName,str,"")
                                                sendMapInfo()
//                                                sendMapInfo()
                                            })
                                        }
                                    }
@@ -142,8 +144,9 @@
                                        Log.i(TAG, "解析之后的车模型=$str")
                                        CThreadPoolExecutor.runInBackground(Runnable{
                                            str = gson.toJson(car.data.map_json)
                                            MyLog.i(PlatFormConstant.HTTPTAG,"车辆模型保存成功")
                                            FileUtil.writeTxtFileToSD(applicationContext,fileName,str,"")
                                            sendVehicleInfo()
//                                            sendVehicleInfo()
                                        })
                                    }
@@ -152,18 +155,18 @@
                        }
                    } else {
                        Toast.makeText(applicationContext, jsonObject1!!.getString("data"), Toast.LENGTH_SHORT).show()
//                        Toast.makeText(applicationContext, jsonObject1!!.getString("data"), Toast.LENGTH_SHORT).show()
                    }
                }
            })
        }else{
            MyLog.i(PlatFormConstant.HTTPTAG,"已存在直接发送车辆和地图")
            when(type){
                "road" -> sendRoadMapInfo()
                "yard" -> sendMapInfo()
                else -> sendVehicleInfo()
            }
//            MyLog.i(PlatFormConstant.HTTPTAG,"已存在直接发送车辆和地图"+fileName)
//            when(type){
//                "road" -> sendRoadMapInfo()
//                "yard" -> sendMapInfo()
//                else -> sendVehicleInfo()
//            }
        }
    }