diff --git a/app/src/main/java/com/casic/br/extensions/String.kt b/app/src/main/java/com/casic/br/extensions/String.kt index 554e7e2..17824d6 100644 --- a/app/src/main/java/com/casic/br/extensions/String.kt +++ b/app/src/main/java/com/casic/br/extensions/String.kt @@ -120,20 +120,20 @@ return "其他" } return when (this) { - "yyj" -> "智能油烟机" - "rs" -> "智能热水器" - "rq" -> "智能燃气灶" - "bgl" -> "智能壁挂炉" - "pc" -> "Wi-Fi智能插排" - "cz" -> "Wi-Fi智能插座" - "wg2" -> "智能网关" + "yyj" -> "油烟机" + "rs" -> "燃气热水器" + "rq" -> "燃气灶" + "bgl" -> "燃气壁挂炉" + "pc" -> "智能排插(带USB)" + "cz" -> "10A智能单插" + "wg2" -> "Zigbee智能网关(无线)" "wsdcg" -> "温湿度传感器" - "ywbj" -> "火灾报警器" + "ywbj" -> "烟雾报警器" "rqbj" -> "燃气报警器" "cobj" -> "一氧化碳报警器" - "yinsj" -> "即热式台式饮水机" + "yinsj" -> "即热式智能饮水机" "kj" -> "空气净化器" - "sd" -> "智能扫地机器人" + "sd" -> "扫地机器人" else -> "其他" } } @@ -171,24 +171,66 @@ return this.toDouble() } +fun String.toBrandCode(): String { + return when (this) { + "rs" -> "PP0001" + "yyj" -> "PP0001" + "bgl" -> "PP0001" + "rq" -> "PP0001" + "pc" -> "PP0002" + "cz" -> "PP0002" + "wg2" -> "PP0002" + "0204" -> "PP0002" + "wsdcg" -> "PP0002" + "ywbj" -> "PP0002" + "rqbj" -> "PP0002" + "cobj" -> "PP0002" + "yinsj" -> "PP0002" + "kj" -> "PP0002" + "sd" -> "PP0002" + else -> "PP0004" + } +} + fun String.toBrandName(): String { - when (this) { - "rs" -> return "万家乐" - "yyj" -> return "万家乐" - "bgl" -> return "万家乐" - "rq" -> return "万家乐" - "pc" -> return "涂鸦" - "cz" -> return "涂鸦" - "wg2" -> return "涂鸦" - "0204" -> return "涂鸦" - "wsdcg" -> return "涂鸦" - "ywbj" -> return "涂鸦" - "rqbj" -> return "涂鸦" - "cobj" -> return "涂鸦" - "yinsj" -> return "涂鸦" - "kj" -> return "涂鸦" - "sd" -> return "涂鸦" - else -> return "汉威" + return when (this) { + "rs" -> "万家乐" + "yyj" -> "万家乐" + "bgl" -> "万家乐" + "rq" -> "万家乐" + "pc" -> "涂鸦" + "cz" -> "涂鸦" + "wg2" -> "涂鸦" + "0204" -> "涂鸦" + "wsdcg" -> "涂鸦" + "ywbj" -> "涂鸦" + "rqbj" -> "涂鸦" + "cobj" -> "涂鸦" + "yinsj" -> "涂鸦" + "kj" -> "涂鸦" + "sd" -> "涂鸦" + else -> "汉威" + } +} + +fun String.toProductCode(): String { + return when (this) { + "rs" -> "JSQ30-16RS051" + "yyj" -> "CXW-320-CXS051" + "bgl" -> "LL1GBQ28-28LS051" + "rq" -> "JZT-QZS051" + "pc" -> "MS800" + "cz" -> "MC010" + "wg2" -> "DMD8CE" + "0204" -> "MD180" + "wsdcg" -> "TT180" + "ywbj" -> "LH-601ZB" + "rqbj" -> "LT-LH-801" + "cobj" -> "HS1CA" + "yinsj" -> "WM001-W" + "kj" -> "TT100" + "sd" -> "CR101" + else -> "JT-KBZ1" } } @@ -217,8 +259,8 @@ "rqbj" -> "70x70x28" "cobj" -> "60*60*49.2" "yinsj" -> "20.5*20.5*16.0" - "kj" -> return "" - "sd" -> return "" + "kj" -> "" + "sd" -> "" else -> "89×89×32" } } diff --git a/app/src/main/java/com/casic/br/extensions/String.kt b/app/src/main/java/com/casic/br/extensions/String.kt index 554e7e2..17824d6 100644 --- a/app/src/main/java/com/casic/br/extensions/String.kt +++ b/app/src/main/java/com/casic/br/extensions/String.kt @@ -120,20 +120,20 @@ return "其他" } return when (this) { - "yyj" -> "智能油烟机" - "rs" -> "智能热水器" - "rq" -> "智能燃气灶" - "bgl" -> "智能壁挂炉" - "pc" -> "Wi-Fi智能插排" - "cz" -> "Wi-Fi智能插座" - "wg2" -> "智能网关" + "yyj" -> "油烟机" + "rs" -> "燃气热水器" + "rq" -> "燃气灶" + "bgl" -> "燃气壁挂炉" + "pc" -> "智能排插(带USB)" + "cz" -> "10A智能单插" + "wg2" -> "Zigbee智能网关(无线)" "wsdcg" -> "温湿度传感器" - "ywbj" -> "火灾报警器" + "ywbj" -> "烟雾报警器" "rqbj" -> "燃气报警器" "cobj" -> "一氧化碳报警器" - "yinsj" -> "即热式台式饮水机" + "yinsj" -> "即热式智能饮水机" "kj" -> "空气净化器" - "sd" -> "智能扫地机器人" + "sd" -> "扫地机器人" else -> "其他" } } @@ -171,24 +171,66 @@ return this.toDouble() } +fun String.toBrandCode(): String { + return when (this) { + "rs" -> "PP0001" + "yyj" -> "PP0001" + "bgl" -> "PP0001" + "rq" -> "PP0001" + "pc" -> "PP0002" + "cz" -> "PP0002" + "wg2" -> "PP0002" + "0204" -> "PP0002" + "wsdcg" -> "PP0002" + "ywbj" -> "PP0002" + "rqbj" -> "PP0002" + "cobj" -> "PP0002" + "yinsj" -> "PP0002" + "kj" -> "PP0002" + "sd" -> "PP0002" + else -> "PP0004" + } +} + fun String.toBrandName(): String { - when (this) { - "rs" -> return "万家乐" - "yyj" -> return "万家乐" - "bgl" -> return "万家乐" - "rq" -> return "万家乐" - "pc" -> return "涂鸦" - "cz" -> return "涂鸦" - "wg2" -> return "涂鸦" - "0204" -> return "涂鸦" - "wsdcg" -> return "涂鸦" - "ywbj" -> return "涂鸦" - "rqbj" -> return "涂鸦" - "cobj" -> return "涂鸦" - "yinsj" -> return "涂鸦" - "kj" -> return "涂鸦" - "sd" -> return "涂鸦" - else -> return "汉威" + return when (this) { + "rs" -> "万家乐" + "yyj" -> "万家乐" + "bgl" -> "万家乐" + "rq" -> "万家乐" + "pc" -> "涂鸦" + "cz" -> "涂鸦" + "wg2" -> "涂鸦" + "0204" -> "涂鸦" + "wsdcg" -> "涂鸦" + "ywbj" -> "涂鸦" + "rqbj" -> "涂鸦" + "cobj" -> "涂鸦" + "yinsj" -> "涂鸦" + "kj" -> "涂鸦" + "sd" -> "涂鸦" + else -> "汉威" + } +} + +fun String.toProductCode(): String { + return when (this) { + "rs" -> "JSQ30-16RS051" + "yyj" -> "CXW-320-CXS051" + "bgl" -> "LL1GBQ28-28LS051" + "rq" -> "JZT-QZS051" + "pc" -> "MS800" + "cz" -> "MC010" + "wg2" -> "DMD8CE" + "0204" -> "MD180" + "wsdcg" -> "TT180" + "ywbj" -> "LH-601ZB" + "rqbj" -> "LT-LH-801" + "cobj" -> "HS1CA" + "yinsj" -> "WM001-W" + "kj" -> "TT100" + "sd" -> "CR101" + else -> "JT-KBZ1" } } @@ -217,8 +259,8 @@ "rqbj" -> "70x70x28" "cobj" -> "60*60*49.2" "yinsj" -> "20.5*20.5*16.0" - "kj" -> return "" - "sd" -> return "" + "kj" -> "" + "sd" -> "" else -> "89×89×32" } } diff --git a/app/src/main/java/com/casic/br/utils/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/br/utils/retrofit/RetrofitServiceManager.kt index f696ccb..eb6e66f 100644 --- a/app/src/main/java/com/casic/br/utils/retrofit/RetrofitServiceManager.kt +++ b/app/src/main/java/com/casic/br/utils/retrofit/RetrofitServiceManager.kt @@ -235,10 +235,10 @@ val paramObject = JSONObject() paramObject.put("snCode", "") paramObject.put("deviceId", devResp.devId) - paramObject.put("brandCode", "") + paramObject.put("brandCode", selectedCategory.toBrandCode()) paramObject.put("brandName", selectedCategory.toBrandName()) - paramObject.put("productCode", devResp.productId) - paramObject.put("productName", selectedCategory) + paramObject.put("productCode", selectedCategory.toProductCode()) + paramObject.put("productName", "厨房家居类") paramObject.put("produceDate", "2022-9-15 08:00:00") paramObject.put("deviceStatus", 1) paramObject.put("deviceActive", 1)