Admin
2021-04-12 65463f956e67cc0589072e501fb4a3b5e5d4c36a
gengxinditu cheliang
2个文件已修改
58 ■■■■ 已修改文件
app/src/main/java/safeluck/drive/evaluation/fragment/BaseDatasFragment.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/util/DataInit.kt 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/fragment/BaseDatasFragment.java
@@ -161,10 +161,26 @@
                                        Iterator<Map .Entry<BaseDataUIBean.TYPE_,MapInfoHead>> iterator = hashMaps.entrySet().iterator();
                                        while (iterator.hasNext()){
                                            Map.Entry<BaseDataUIBean.TYPE_,MapInfoHead>entry = iterator.next();
                                            MapInfoHead mapInfoHead = entry.getValue();
                                            Log.i(TAG,"key= " + entry.getKey() + " and value= " + entry.getValue());
                                            datas.add(new BaseDataUIBean(str2SpannableString(entry.getValue().getStr()),R.mipmap.province_id,str2FouregourdSpannableString(getResources().getString(R.string.mapversion)+entry.getValue().getVersion()),
                                                    entry.getKey()== BaseDataUIBean.TYPE_.car?"更新车辆模型":(entry.getKey()== BaseDataUIBean.TYPE_.road?"更新道路地图":"更新场地地图")
                                                    ,1, entry.getKey()));
                                            if (mapInfoHead!=null){
                                                String str = mapInfoHead.getStr();
                                                if (!TextUtils.isEmpty(str)){
                                                    datas.add(new BaseDataUIBean(str2SpannableString(entry.getValue().getStr()),R.mipmap.province_id,str2FouregourdSpannableString(getResources().getString(R.string.mapversion)+entry.getValue().getVersion()),
                                                            entry.getKey()== BaseDataUIBean.TYPE_.car?"更新车辆模型":(entry.getKey()== BaseDataUIBean.TYPE_.road?"更新道路地图":"更新场地地图")
                                                            ,1, entry.getKey()));
                                                    if (str.contains("失败")){
                                                        showMannualMapCar();
                                                    }
                                                }else{
                                                    showMannualMapCar();
                                                }
                                            }else{
                                                showMannualMapCar();
                                            }
                                        }
                                    }
@@ -179,6 +195,20 @@
        }
    };
    private void showMannualMapCar() {
        String roadMapPath = ExamPlatformData.getInstance().getRoadMapPath();
        String MapPath = ExamPlatformData.getInstance().getMapPath();
        String carModelPath = ExamPlatformData.getInstance().getCarModelPath();
        if (!TextUtils.isEmpty(roadMapPath)){
            datas.add(new BaseDataUIBean(str2SpannableString("手动设置道路  "),R.mipmap.platform_pic,str2FouregourdSpannableString(roadMapPath),"",1,null));
        }
        if (!TextUtils.isEmpty(MapPath)){
            datas.add(new BaseDataUIBean(str2SpannableString("手动设置场地  "),R.mipmap.platform_pic,str2FouregourdSpannableString(MapPath),"",1,null));
        }
        if (!TextUtils.isEmpty(carModelPath)){
            datas.add(new BaseDataUIBean(str2SpannableString("手动设置车辆  "),R.mipmap.platform_pic,str2FouregourdSpannableString(carModelPath),"",1,null));
        }
    }
    private String left(String s,int pos){
app/src/main/java/safeluck/drive/evaluation/util/DataInit.kt
@@ -262,8 +262,8 @@
                MyLog.i(PlatFormConstant.HTTPTAG,str)
                jsonObject1 = JSONObject(str)
                val result = jsonObject1!!.getBoolean("result")
                if (result) {
                    var mapInfoHead: MapInfoHead = MapInfoHead("","", BaseDataUIBean.TYPE_.car,"","")
                if (result) {
                    when(type){
                        "road" ->{
@@ -294,6 +294,8 @@
                            }else{
                                MyLog.i(PlatFormConstant.HTTPTAG,"返回失败,则发送用户已经选择的道路文件")
                                mapInfoHead.version = ""
                                mapInfoHead.str = "获取道路地图失败"
                                sendRoadMapInfo()
                            }}
                        "yard" ->{
@@ -316,6 +318,8 @@
                                    })
                                }
                            }else{
                                mapInfoHead.version = ""
                                mapInfoHead.str = "获取场地地图失败"
                                MyLog.i(PlatFormConstant.HTTPTAG,"返回失败,则发送用户已经选择的场地文件")
                                sendMapInfo()
                            }
@@ -344,6 +348,8 @@
                                }
                            }else{
                                mapInfoHead.version = ""
                                mapInfoHead.str = "获取车辆模型失败"
                                MyLog.i(PlatFormConstant.HTTPTAG,"返回失败,则发送用户已经选择的车辆模型文件")
                                sendVehicleInfo()
                            }
@@ -352,14 +358,24 @@
                    ExamPlatformData.getInstance().setMapHeadInfo(mapInfoHead)
                } else {
                    if (str.contains("car")){
                        mapInfoHead.type= BaseDataUIBean.TYPE_.car
                        mapInfoHead.version = ""
                        mapInfoHead.str = "从平台获取车辆模型失败"
                        ExamPlatformData.getInstance().setMapHeadInfo(mapInfoHead)
                        sendVehicleInfo()
                    }
                    if (str.contains("yard")){
                        mapInfoHead.type= BaseDataUIBean.TYPE_.yard
                        mapInfoHead.version = ""
                        mapInfoHead.str = "从平台获取场地地图失败"
                        ExamPlatformData.getInstance().setMapHeadInfo(mapInfoHead)
                        sendMapInfo()
                    }
                    if (str.contains("road")){
                        mapInfoHead.type= BaseDataUIBean.TYPE_.road
                        mapInfoHead.version = ""
                        mapInfoHead.str = "从平台获取道路地图失败"
                        ExamPlatformData.getInstance().setMapHeadInfo(mapInfoHead)
                        sendRoadMapInfo()
                    }