From b9cc7390e8e8ce64c41c26fb369c98ce669d660c Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 07 五月 2025 15:02:30 +0800
Subject: [PATCH] Merge branch '1.2.0'

---
 app/src/main/java/com/hdl/photovoltaic/other/HdlESLocalJsonLogic.java |  427 +++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 302 insertions(+), 125 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlESLocalJsonLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlESLocalJsonLogic.java
index 7d2030a..7ffd5bc 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlESLocalJsonLogic.java
+++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlESLocalJsonLogic.java
@@ -1,5 +1,6 @@
 package com.hdl.photovoltaic.other;
 
+import android.os.Build;
 import android.text.TextUtils;
 
 import com.hdl.linkpm.sdk.core.exception.HDLException;
@@ -7,8 +8,11 @@
 import com.hdl.photovoltaic.internet.HttpClient;
 import com.hdl.photovoltaic.listener.CloudCallBeak;
 
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * 鏈湴json缂撳瓨閫昏緫
@@ -33,99 +37,88 @@
         return sHdlESLocalJsonLogic;
     }
 
+    /**
+     * 鑴氭湰鍦板潃鍩熷悕
+     */
+    private static final String address = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu";
 
     /**
-     * 銆愰�嗗彉鍣ㄣ�戣澶囧瀷鍙�
+     * 鎷兼帴绗﹀彿
      */
-    public static final String deviceModel_ME_GSE_S5K = "ME-GSE-S5K";
-    /**
-     * 銆愯礋杞芥帶鍒朵腑蹇冦�戣澶囧瀷鍙�
-     */
-    public static final String deviceModel_ME_GSE_SPG63A = "ME-GSE-SPG63A";
-    /**
-     * 銆怋MS銆戣澶囧瀷鍙�
-     */
-    public static final String deviceModel_ME_GSE_BMS15K = "ME-GSE-BMS15K";
-    /**
-     * 銆愮數姹犲寘銆戣澶囧瀷鍙�
-     */
-    public static final String deviceModel_ME_GSE_B5K = "ME-GSE-B5K";
+    private final String concatenation_symbol = "%";
 
     /**
-     * 鍒涘缓鐢电珯-閫嗗彉鍣ㄥ弬鏁伴厤缃�
+     * 鎷兼帴鏂板湴鍧�
+     *
+     * @param fileName    json鏂囦欢鍚嶇О
+     * @param deviceType  璁惧绫诲瀷锛坕nv锛宭c锛宐ms锛宐attery锛�
+     * @param deviceModel 璁惧鍨嬪彿
+     * @return 鏂板湴鍧�
      */
-    public static final String hdl_inv_ecu_quick = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/currentLanguage/inv/deviceModel/modbus_hdl_inv_ecu_quick_v1.5.1.json";
-    /**
-     * 鍒涘缓鐢电珯-璐熻浇鎺у埗涓績鍙傛暟閰嶇疆
-     */
-    public static final String hdl_lc_ecu_quick = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/currentLanguage/lc/deviceModel/modbus_hdl_lc_ecu_quick_v1.5.0.json";
-    /**
-     * 閫嗗彉鍣ㄥ弬鏁伴厤缃紙config锛�
-     */
-    public static final String hdl_inv_ecu = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/currentLanguage/inv/deviceModel/modbus_hdl_inv_ecu_v1.5.1.json";
-    /**
-     * 閫嗗彉鍣ㄨ鎯�-pv
-     */
-    public static final String hdl_inv_ecu_info_pv = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/currentLanguage/inv/deviceModel/info/modbus_hdl_inv_ecu_info_pv_v1.4.2.json";
-    /**
-     * 閫嗗彉鍣ㄨ鎯�-杈撳嚭
-     */
-    public static final String hdl_inv_ecu_info_output = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/currentLanguage/inv/deviceModel/info/modbus_hdl_inv_ecu_info_output_v1.4.2.json";
-    /**
-     * 閫嗗彉鍣ㄨ鎯�-item椤�
-     */
-    public static final String hdl_inv_ecu_info_item = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/currentLanguage/inv/deviceModel/info/modbus_hdl_inv_ecu_info_item_v1.5.1.json";
-    /**
-     * 鑾峰彇璐熻浇鎺у埗涓績
-     */
-    public static final String hdl_lc_ecu_info_item = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/currentLanguage/lc/deviceModel/modbus_hdl_lc_ecu_info_item_v1.5.0.json";
-    /**
-     * 鑾峰彇BMS淇℃伅
-     */
-    public static final String hdl_bms_ecu = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/currentLanguage/bms/deviceModel/modbus_hdl_bms_ecu_v1.4.2.json";
-    /**
-     * 鐢垫睜鍖呬俊鎭�
-     */
-    public static final String hdl_battery_ecu = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/currentLanguage/battery/deviceModel/modbus_hdl_battery_ecu_v1.4.2.json";
+    private String getStrJointNewUrl(String fileName, String deviceType, String deviceModel) {
+        String joinFileName = fileName + concatenation_symbol + deviceType + concatenation_symbol + deviceModel;
+        if (joinFileName.equals(FileName.hdl_inv_ecu_info_pv + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV)
+                || joinFileName.equals(FileName.hdl_inv_ecu_info_output + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV)
+                || joinFileName.equals(FileName.hdl_inv_ecu_info_item + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV)
+                || joinFileName.equals(FileName.hdl_inv_ecu_info_signal + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV)
+                || joinFileName.equals(FileName.hdl_inv_ecu_info_pv + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV)
+                || joinFileName.equals(FileName.hdl_inv_ecu_info_output + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV)
+                || joinFileName.equals(FileName.hdl_inv_ecu_info_item + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV)
+                || joinFileName.equals(FileName.hdl_inv_ecu_info_signal + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV)
+                || joinFileName.equals(FileName.hdl_inv_ecu_info_input_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV)
+        ) {
+            return address + "/" + UserConfigManage.getInstance().getCurrentAppLanguage() + "/" + deviceType + "/" + deviceModel + "/info/" + fileName + this.getVersion(joinFileName) + ".json";
+        }
+        return address + "/" + UserConfigManage.getInstance().getCurrentAppLanguage() + "/" + deviceType + "/" + deviceModel + "/" + fileName + this.getVersion(joinFileName) + ".json";
+    }
+
 
     /**
-     * 鐢垫睜鍖�-鐢佃姱淇℃伅
-     */
-    public static final String hdl_battery_ecu_cell = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/currentLanguage/battery/deviceModel/modbus_hdl_battery_ecu_cell_v1.4.2.json";
-
-    /**
-     * 閫嗗彉鍣ㄨ鎯�-淇″彿鐐�
-     */
-    public static final String hdl_inv_ecu_info_signal = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/currentLanguage/inv/deviceModel/info/modbus_hdl_inv_ecu_info_signal_v1.4.1.json";
-
-    /**
-     * 鑾峰彇閫嗗彉鍣ㄦ墍鏈塲son涓枃
-     */
-    public static final String hdl_inv_ecu_all_zh = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/zh/all_v1.5.1.json";
-    /**
-     * 鑾峰彇閫嗗彉鍣ㄦ墍鏈塲son鑻辨枃
-     */
-    public static final String hdl_inv_ecu_all_en = "https://hdl-hz-dev.oss-cn-hangzhou.aliyuncs.com/ecu/en/all_v1.5.1.json";
-
-    /**
-     * 鍒濆鍖栬剼鏈瑄rl
+     * 鑾峰彇鍔炵増鏈彿
      *
      * @return map
      */
-    private Map<String, String> getUrlMap() {
-        //娉ㄦ剰锛堥�嗗彉鍣�:ME-GSE-S5K锛岃礋杞戒腑蹇�:ME-GSE-SPG63A锛宐ms:ME-GSE-BMS15K锛岀數姹犲寘:ME-GSE-B5K锛夎澶囧瀷鍙蜂笉涓�鏍�
+    private String getVersion(String fileName) {
+        Map<String, String> map = this.getFeliAndVersion();
+        for (Map.Entry<String, String> entry : map.entrySet()) {
+            if (entry.getKey().equals(fileName)) {
+                return entry.getValue();
+            }
+        }
+        return "";
+    }
+
+    /**
+     * 鏂囦欢瀵瑰簲鐗堟湰鍙�
+     *
+     * @return map
+     */
+    private Map<String, String> getFeliAndVersion() {
         Map<String, String> map = new HashMap<>();
-        map.put(this.getNewUrl(hdl_lc_ecu_info_item, deviceModel_ME_GSE_SPG63A), deviceModel_ME_GSE_SPG63A);//鑾峰彇璐熻浇鎺у埗涓績
-        map.put(this.getNewUrl(hdl_lc_ecu_quick, deviceModel_ME_GSE_SPG63A), deviceModel_ME_GSE_SPG63A); //鍒涘缓鐢电珯-璐熻浇鎺у埗涓績鍙傛暟閰嶇疆
-        map.put(this.getNewUrl(hdl_inv_ecu_quick, deviceModel_ME_GSE_S5K), deviceModel_ME_GSE_S5K);//鍒涘缓鐢电珯-閫嗗彉鍣ㄥ弬鏁伴厤缃�
-        map.put(this.getNewUrl(hdl_inv_ecu, deviceModel_ME_GSE_S5K), deviceModel_ME_GSE_S5K);//閫嗗彉鍣ㄥ弬鏁伴厤缃�
-        map.put(this.getNewUrl(hdl_inv_ecu_info_pv, deviceModel_ME_GSE_S5K), deviceModel_ME_GSE_S5K);// 閫嗗彉鍣ㄨ鎯�-pv
-        map.put(this.getNewUrl(hdl_inv_ecu_info_output, deviceModel_ME_GSE_S5K), deviceModel_ME_GSE_S5K);//閫嗗彉鍣ㄨ鎯�-杈撳嚭
-        map.put(this.getNewUrl(hdl_inv_ecu_info_item, deviceModel_ME_GSE_S5K), deviceModel_ME_GSE_S5K);//閫嗗彉鍣ㄨ鎯�-item椤�
-        map.put(this.getNewUrl(hdl_inv_ecu_info_signal, deviceModel_ME_GSE_S5K), deviceModel_ME_GSE_S5K);//閫嗗彉鍣ㄨ鎯�-淇″彿鐐�
-        map.put(this.getNewUrl(hdl_bms_ecu, deviceModel_ME_GSE_BMS15K), deviceModel_ME_GSE_BMS15K);//鑾峰彇BMS淇℃伅
-        map.put(this.getNewUrl(hdl_battery_ecu, deviceModel_ME_GSE_B5K), deviceModel_ME_GSE_B5K);//鐢垫睜鍖呬俊鎭�
-        map.put(this.getNewUrl(hdl_battery_ecu_cell, deviceModel_ME_GSE_B5K), deviceModel_ME_GSE_B5K);//鐢垫睜鍖�-鐢佃姱淇℃伅
+        //鎷兼帴瑙勫垯锛氭枃浠跺悕_璁惧绫诲瀷_璁惧淇″彿
+        map.put(FileName.hdl_lc_ecu_info_item + concatenation_symbol + DeviceType.LC + concatenation_symbol + DeviceModel.LC, Version.v_1_5_0);//鑾峰彇璐熻浇鎺у埗涓績
+        map.put(FileName.hdl_lc_ecu_quick + concatenation_symbol + DeviceType.LC + concatenation_symbol + DeviceModel.LC, Version.v_1_5_2);//鍒涘缓鐢电珯-璐熻浇鎺у埗涓績鍙傛暟閰嶇疆
+        map.put(FileName.hdl_inv_ecu_quick + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_5_1);//鍒涘缓鐢电珯-閫嗗彉鍣ㄥ弬鏁伴厤缃�
+        map.put(FileName.hdl_inv_ecu + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_5_3);//閫嗗彉鍣ㄥ弬鏁伴厤缃�//鏇存柊鍒皏_1_5_3,鐩墠纭欢涓嶆敮鎸�
+        map.put(FileName.hdl_inv_ecu_info_pv + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_4_2);// 閫嗗彉鍣ㄨ鎯�-pv
+        map.put(FileName.hdl_inv_ecu_info_output + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_4_2);//閫嗗彉鍣ㄨ鎯�-杈撳嚭
+        map.put(FileName.hdl_inv_ecu_info_item + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_5_2);//閫嗗彉鍣ㄨ鎯�-item椤�//鏇存柊鍒皏_1_5_2锛岀洰鍓嶇‖浠朵笉鏀寔卢
+        map.put(FileName.hdl_inv_ecu_info_signal + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_4_1);//閫嗗彉鍣ㄨ鎯�-淇″彿鐐�
+        map.put(FileName.hdl_bms_ecu + concatenation_symbol + DeviceType.BMS + concatenation_symbol + DeviceModel.INV_BMS, Version.v_1_4_2);//鑾峰彇BMS淇℃伅
+        map.put(FileName.hdl_battery_ecu + concatenation_symbol + DeviceType.BATTERY + concatenation_symbol + DeviceModel.INV_BATTERY, Version.v_1_4_2);//鐢垫睜鍖呬俊鎭�
+        map.put(FileName.hdl_battery_ecu_cell + concatenation_symbol + DeviceType.BATTERY + concatenation_symbol + DeviceModel.INV_BATTERY, Version.v_1_4_2);//鐢垫睜鍖�-鐢佃姱淇℃伅
+        //绂荤綉閫嗗彉鍣�
+        map.put(FileName.hdl_inv_ecu_quick_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//绂荤綉閫嗗彉鍣ㄥ揩閫熼厤缃�
+        map.put(FileName.hdl_inv_master_ecu_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_3);//绂荤綉閫嗗彉鍣ㄥ揩閫熼厤缃�
+        map.put(FileName.hdl_inv_slave_ecu_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//绂荤綉閫嗗彉鍣ㄥ揩閫熼厤缃�
+        map.put(FileName.hdl_inv_ecu_info_pv_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//绂荤綉閫嗗彉鍣ㄥ揩閫熼厤缃�
+        map.put(FileName.hdl_inv_ecu_info_input_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//绂荤綉閫嗗彉鍣ㄥ揩閫熼厤缃�
+        map.put(FileName.hdl_inv_ecu_info_output_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//绂荤綉閫嗗彉鍣ㄥ揩閫熼厤缃�
+        map.put(FileName.hdl_inv_ecu_info_item_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//绂荤綉閫嗗彉鍣ㄥ揩閫熼厤缃�
+        map.put(FileName.hdl_inv_ecu_info_signal_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//绂荤綉閫嗗彉鍣ㄥ揩閫熼厤缃�
+        map.put(FileName.hdl_bms_ecu_off + concatenation_symbol + DeviceType.BMS + concatenation_symbol + DeviceModel.OFF_INV_BMS, Version.v_1_5_2);//绂荤綉閫嗗彉鍣ㄥ揩閫熼厤缃�
+        map.put(FileName.hdl_battery_ecu_off + concatenation_symbol + DeviceType.BATTERY + concatenation_symbol + DeviceModel.OFF_INV_BATTERY, Version.v_1_5_2);//绂荤綉閫嗗彉鍣ㄥ揩閫熼厤缃�
+        map.put(FileName.hdl_battery_ecu_cell_off + concatenation_symbol + DeviceType.BATTERY + concatenation_symbol + DeviceModel.OFF_INV_BATTERY, Version.v_1_5_2);//绂荤綉閫嗗彉鍣ㄥ揩閫熼厤缃�
         return map;
     }
 
@@ -133,26 +126,38 @@
      * 鍚戜簯绔幏鍙朖son銆愭墍鏈夈�戣剼鏈�
      */
     public void getAllHdlESLocalJson() {
-        for (Map.Entry<String, String> entry : getUrlMap().entrySet()) {
-            this.getHdlESLocalJson(entry.getKey(), entry.getValue(), null);
+        for (Map.Entry<String, String> str : this.getFeliAndVersion().entrySet()) {
+            if (TextUtils.isEmpty(str.getKey())) {
+                continue;
+            }
+            String[] ary = str.getKey().split(concatenation_symbol);
+            String fileName = ary[0];
+            String deviceType = ary[1];
+            String deviceMode = ary[2];
+            this.getHdlESLocalJson(fileName, deviceType, deviceMode, true, null);
         }
+
     }
 
 
     /**
      * 鍚戜簯绔幏鍙朖son銆愬崟涓�戣剼鏈�
      *
-     * @param url         鍦板潃
+     * @param fileName    鏂囦欢鍚�
+     * @param deviceType  璁惧绫诲瀷
      * @param deviceModel 璁惧鍨嬪彿
+     * @param isDelPath   鏄惁鍒犻櫎锛坱rue琛ㄧず鍒犻櫎锛屽惁鍒欎笉鍒犻櫎锛�
      */
-    public void getHdlESLocalJson(String url, String deviceModel, CloudCallBeak<String> callBeak) {
+    public void getHdlESLocalJson(String fileName, String deviceType, String deviceModel, boolean isDelPath, CloudCallBeak<String> callBeak) {
+        //鎷兼帴鍦板潃
+        String url = getStrJointNewUrl(fileName, deviceType, deviceModel);
         HttpClient.getInstance().requestJsonHttpGet(url, new CloudCallBeak<String>() {
             @Override
-            public void onSuccess(String str) {
-                saveJson(url, deviceModel, str);
-                HdlLogLogic.print("鑾峰彇浜戠鑴氭湰---" + url + "\r\n" + str, false);
+            public void onSuccess(String json) {
+                saveJson(fileName, deviceModel, json, isDelPath);
+                HdlLogLogic.print("鑾峰彇浜戠鑴氭湰---" + url + "\r\n" + json, false);
                 if (callBeak != null) {
-                    callBeak.onSuccess(str);
+                    callBeak.onSuccess(json);
                 }
             }
 
@@ -169,43 +174,24 @@
     /**
      * 璇诲彇鏈湴json鏁版嵁
      *
-     * @param url         鍦板潃
+     * @param fileName    鏂囦欢鍚�
      * @param deviceModel 璁惧鍨嬪彿
      */
-    public String readHdlESLocalJson(String url, String deviceModel) {
-        return this.readJson(url, deviceModel);
+    public String readHdlESLocalJson(String fileName, String deviceModel) {
+        return this.readJson(fileName, deviceModel);
     }
-
-    /**
-     * 澶勭悊url杩斿洖鏂扮殑url
-     *
-     * @param url         鍦板潃
-     * @param deviceModel 璁惧绫诲瀷
-     * @return 杩斿洖鍦板潃
-     */
-    private String getNewUrl(String url, String deviceModel) {
-        return url.replace("currentLanguage", UserConfigManage.getInstance().getCurrentAppLanguage()).replace("deviceModel", deviceModel);
-    }
-
 
     /**
      * 淇濆瓨json鏁版嵁
      *
-     * @param fileUrlOrFileName 鍦板潃鎴栬�呮枃浠跺悕
-     * @param deviceModel       璁惧鍨嬪彿锛堥�嗗彉鍣紝璐熻浇涓績锛宐ms锛岀數姹犲寘锛�
-     * @param json              鍐呭
+     * @param fileName    鏂囦欢鍚�
+     * @param deviceModel 璁惧鍨嬪彿锛堥�嗗彉鍣紝璐熻浇涓績锛宐ms锛岀數姹犲寘锛�
+     * @param json        json鍐呭
+     * @param isDelPath   鏄惁鍒犻櫎锛坱rue琛ㄧず鍒犻櫎锛屽惁鍒欎笉鍒犻櫎锛�
      */
-    private void saveJson(String fileUrlOrFileName, String deviceModel, String json) {
+    private void saveJson(String fileName, String deviceModel, String json, boolean isDelPath) {
         try {
             if (TextUtils.isEmpty(json)) {
-                return;
-            }
-            String fileName = fileUrlOrFileName;
-            if (fileUrlOrFileName.contains("/")) {
-                //琛ㄧず閾炬帴,鎴彇鏈�鍚庝竴涓储寮曡〃绀烘枃浠跺悕
-                fileName = fileUrlOrFileName.split("/")[fileUrlOrFileName.split("/").length - 1];
-            }
-            if (TextUtils.isEmpty(fileName)) {
                 return;
             }
             //鑻辨枃鏂囦欢璺緞
@@ -214,7 +200,9 @@
                 //涓枃鏂囦欢璺緞
                 fullPath = HdlFileLogic.getInstance().getHdlESLocalJsonZhFilePath(deviceModel, fileName);
             }
-
+            if (isDelPath) {
+                HdlFileLogic.getInstance().deleteFile(fullPath);
+            }
             HdlFileLogic.getInstance().writeFile(fullPath, json);
         } catch (Exception ignored) {
         }
@@ -223,16 +211,11 @@
     /**
      * 璇诲彇json鏁版嵁
      *
-     * @param fileUrlOrFileName 鍦板潃鎴栬�呮枃浠跺悕
-     * @param deviceModel       璁惧鍨嬪彿锛堥�嗗彉鍣紝璐熻浇涓績锛宐ms锛岀數姹犲寘锛�
+     * @param fileName    鏂囦欢鍚�
+     * @param deviceModel 璁惧鍨嬪彿锛堥�嗗彉鍣紝璐熻浇涓績锛宐ms锛岀數姹犲寘锛�
      */
-    private String readJson(String fileUrlOrFileName, String deviceModel) {
+    private String readJson(String fileName, String deviceModel) {
         try {
-            String fileName = fileUrlOrFileName;
-            if (fileUrlOrFileName.contains("/")) {
-                //琛ㄧず閾炬帴,鎴彇鏈�鍚庝竴涓储寮曡〃绀烘枃浠跺悕
-                fileName = fileUrlOrFileName.split("/")[fileUrlOrFileName.split("/").length - 1];
-            }
             if (TextUtils.isEmpty(fileName)) {
                 return "";
             }
@@ -248,4 +231,198 @@
         }
     }
 
+    /**
+     * Json鏁版嵁閰嶇疆鏂囦欢鍚�
+     */
+    public @interface FileName {
+        /**
+         * 鍒涘缓鐢电珯-閫嗗彉鍣ㄥ弬鏁伴厤缃�
+         */
+        String hdl_inv_ecu_quick = "modbus_hdl_inv_ecu_quick_v";
+
+        /**
+         * 閫嗗彉鍣ㄥ弬鏁伴厤缃紙config锛�
+         */
+        String hdl_inv_ecu = "modbus_hdl_inv_ecu_v";
+        /**
+         * 閫嗗彉鍣ㄨ鎯�-pv
+         */
+        String hdl_inv_ecu_info_pv = "modbus_hdl_inv_ecu_info_pv_v";
+        /**
+         * 閫嗗彉鍣ㄨ鎯�-杈撳嚭
+         */
+        String hdl_inv_ecu_info_output = "modbus_hdl_inv_ecu_info_output_v";
+        /**
+         * 閫嗗彉鍣ㄨ鎯�-item椤�
+         */
+        String hdl_inv_ecu_info_item = "modbus_hdl_inv_ecu_info_item_v";
+        /**
+         * 鍒涘缓鐢电珯-璐熻浇鎺у埗涓績鍙傛暟閰嶇疆
+         */
+        String hdl_lc_ecu_quick = "modbus_hdl_lc_ecu_quick_v";
+        /**
+         * 鑾峰彇璐熻浇鎺у埗涓績
+         */
+        String hdl_lc_ecu_info_item = "modbus_hdl_lc_ecu_info_item_v";
+        /**
+         * 鑾峰彇BMS淇℃伅
+         */
+        String hdl_bms_ecu = "modbus_hdl_bms_ecu_v";
+        /**
+         * 鐢垫睜鍖呬俊鎭�
+         */
+        String hdl_battery_ecu = "modbus_hdl_battery_ecu_v";
+
+        /**
+         * 鐢垫睜鍖�-鐢佃姱淇℃伅
+         */
+        String hdl_battery_ecu_cell = "modbus_hdl_battery_ecu_cell_v";
+
+        /**
+         * 閫嗗彉鍣ㄨ鎯�-淇″彿鐐�
+         */
+        String hdl_inv_ecu_info_signal = "modbus_hdl_inv_ecu_info_signal_v";
+
+
+        /**
+         * 绂荤綉閫嗗彉鍣ㄥ揩閫熼厤缃�
+         */
+        String hdl_inv_ecu_quick_off = "modbus_hdl_inv_ecu_quick_v";
+
+        /**
+         * 绂荤綉閫嗗彉鍣ㄤ富鏈洪厤缃�
+         */
+        String hdl_inv_master_ecu_off = "modbus_hdl_inv_master_ecu_v";
+
+        /**
+         * 绂荤綉閫嗗彉鍣ㄤ粠鏈洪厤缃�
+         */
+        String hdl_inv_slave_ecu_off = "modbus_hdl_inv_slave_ecu_v";
+
+        /**
+         * 绂荤綉閫嗗彉鍣ㄨ鎯呭厜浼忚緭鍏�
+         */
+        String hdl_inv_ecu_info_pv_off = "modbus_hdl_inv_ecu_info_pv_v";
+
+        /**
+         * 绂荤綉閫嗗彉鍣ㄨ鎯呬氦娴佽緭鍏�
+         */
+        String hdl_inv_ecu_info_input_off = "modbus_hdl_inv_ecu_info_input_v";
+
+        /**
+         * 绂荤綉閫嗗彉鍣ㄨ鎯呬氦娴佽緭鍑�
+         */
+        String hdl_inv_ecu_info_output_off = "modbus_hdl_inv_ecu_info_output_v";
+
+        /**
+         * 绂荤綉閫嗗彉鍣ㄨ鎯呭熀纭�鍙傛暟
+         */
+        String hdl_inv_ecu_info_item_off = "modbus_hdl_inv_ecu_info_item_v";
+
+        /**
+         * 绂荤綉閫嗗彉鍣ㄨ鎯呯粺璁�
+         */
+        String hdl_inv_ecu_info_signal_off = "modbus_hdl_inv_ecu_info_signal_v";
+
+        /**
+         * 绂荤綉閫嗗彉鍣˙MS璇︽儏
+         */
+        String hdl_bms_ecu_off = "modbus_hdl_bms_ecu_v";
+
+        /**
+         * 绂荤綉閫嗗彉鍣ㄧ數姹犺鎯�
+         */
+        String hdl_battery_ecu_off = "modbus_hdl_battery_ecu_v";
+
+        /**
+         * 绂荤綉閫嗗彉鍣ㄧ數姹犵數鑺�
+         */
+        String hdl_battery_ecu_cell_off = "modbus_hdl_battery_ecu_cell_v";
+
+
+        /**
+         * 鑾峰彇閫嗗彉鍣ㄦ墍鏈塲son涓枃
+         */
+        String hdl_inv_ecu_all_zh = "/zh/all_v";
+        /**
+         * 鑾峰彇閫嗗彉鍣ㄦ墍鏈塲son鑻辨枃
+         */
+        String hdl_inv_ecu_all_en = "/en/all_v";
+
+    }
+
+
+    /**
+     * 鐗堟湰鍙�
+     */
+    public @interface Version {
+        String v_1_4_1 = "1.4.1";
+        String v_1_4_2 = "1.4.2";
+        String v_1_5_0 = "1.5.0";
+        String v_1_5_1 = "1.5.1";
+        String v_1_5_2 = "1.5.2";
+        String v_1_5_3 = "1.5.3";
+
+    }
+
+    /**
+     * 璁惧鍨嬪彿
+     */
+    public @interface DeviceModel {
+        /**
+         * 銆愰�嗗彉鍣ㄣ�戣澶囧瀷鍙�
+         */
+        String INV = "ME-GSE-S5K";
+        /**
+         * 銆愯礋杞芥帶鍒朵腑蹇冦�戣澶囧瀷鍙�
+         */
+        String LC = "ME-GSE-SPG63A";
+        /**
+         * 銆怋MS銆戣澶囧瀷鍙�
+         */
+        String INV_BMS = "ME-GSE-BMS15K";
+        /**
+         * 銆愮數姹犲寘銆戣澶囧瀷鍙�
+         */
+        String INV_BATTERY = "ME-GSE-B5K";
+
+
+        /**
+         * 銆愮绾块�嗗彉鍣ㄣ�戣澶囧瀷鍙�
+         */
+        String OFF_INV = "ME-GLE-S5K";
+
+        /**
+         * 銆愮缃戦�嗗彉鍣ㄨ櫄鎷烞MS銆戣澶囧瀷鍙�
+         */
+        String OFF_INV_BMS = "ME-GLE-S5K-BMS";
+        /**
+         * 銆愮缃戦�嗗彉鍣ㄧ數姹犲寘銆戣澶囧瀷鍙�
+         */
+        String OFF_INV_BATTERY = "ME-GLE-B5K";
+    }
+
+    /**
+     * 璁惧绫诲瀷
+     */
+    public @interface DeviceType {
+        /**
+         * 銆愰�嗗彉鍣ㄣ�戠被鍨�
+         */
+        String INV = "inv";
+        /**
+         * 銆愯礋杞芥帶鍒朵腑蹇冦�戠被鍨�
+         */
+        String LC = "lc";
+        /**
+         * 銆怋MS銆戠被鍨�
+         */
+        String BMS = "bms";
+        /**
+         * 銆愮數姹犲寘銆戠被鍨�
+         */
+        String BATTERY = "battery";
+
+    }
+
 }

--
Gitblit v1.8.0