From 1b5df154914da4dca4ef1213b20fbdcc2dca8be8 Mon Sep 17 00:00:00 2001 From: squallzhjch Date: Tue, 5 Sep 2023 09:18:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=94=B6=E8=B4=B9=E7=AB=99?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signMoreInfo/LaneBoundaryAdapter.kt | 1 + .../java/com/navinfo/omqs/util/SignUtil.kt | 83 ++++++++++++------- vtm | 2 +- 3 files changed, 57 insertions(+), 29 deletions(-) diff --git a/app/src/main/java/com/navinfo/omqs/ui/fragment/signMoreInfo/LaneBoundaryAdapter.kt b/app/src/main/java/com/navinfo/omqs/ui/fragment/signMoreInfo/LaneBoundaryAdapter.kt index 59f8bddc..19f8b18d 100644 --- a/app/src/main/java/com/navinfo/omqs/ui/fragment/signMoreInfo/LaneBoundaryAdapter.kt +++ b/app/src/main/java/com/navinfo/omqs/ui/fragment/signMoreInfo/LaneBoundaryAdapter.kt @@ -37,6 +37,7 @@ class LaneBoundaryAdapter : RecyclerView.Adapter() { fun bind(pos: Int, laneBoundaryItem: LaneBoundaryItem) { viewBinding.contactName.text = laneBoundaryItem.title if (laneBoundaryItem.itemList != null) { + viewBinding.infos.removeAllViews() for (item in laneBoundaryItem.itemList) { var view = LayoutInflater.from(viewBinding.root.context) .inflate(R.layout.adapter_two_item, null, false) diff --git a/app/src/main/java/com/navinfo/omqs/util/SignUtil.kt b/app/src/main/java/com/navinfo/omqs/util/SignUtil.kt index ec6b6c94..cbda1321 100644 --- a/app/src/main/java/com/navinfo/omqs/util/SignUtil.kt +++ b/app/src/main/java/com/navinfo/omqs/util/SignUtil.kt @@ -563,15 +563,57 @@ class SignUtil { try { val linkList = renderEntity.properties["tollinfoList"] if (linkList != null && linkList != "" && linkList != "null") { - val itemList = mutableListOf() + val jsonArray = JSONArray(linkList) for (i in 0 until jsonArray.length()) { val arrayObject: JSONObject = jsonArray[i] as JSONObject - - // itemList.add(TwoItemAdapterItem("方向", direct)) - + val itemList = mutableListOf() try { + itemList.add( + TwoItemAdapterItem("通道号码", "${arrayObject.optString("pid")}") + ) val stringBuffer = StringBuffer() + + stringBuffer.setLength(0) + val passageType = arrayObject.getInt("passageType") + for (i in 1 downTo 0) { + val bit = (passageType shr i) and 1 + if (bit == 1) { + when (i) { + 0 -> stringBuffer.append("称重车道 ") + 1 -> stringBuffer.append("绿色通道 ") + } + } + } + itemList.add( + TwoItemAdapterItem("通道类型", stringBuffer.toString()) + ) + + + stringBuffer.setLength(0) + val payMethod = arrayObject.getInt("payMethod") + for (i in 8 downTo 0) { + val bit = (payMethod shr i) and 1 + if (bit == 1) { + when (i) { + 0 -> stringBuffer.append("ETC ") + 1 -> stringBuffer.append("现金 ") + 2 -> stringBuffer.append("银行卡(借记卡) ") + 3 -> stringBuffer.append("信用卡 ") + 4 -> stringBuffer.append("IC卡 ") + 5 -> stringBuffer.append("预付卡 ") + 6 -> stringBuffer.append("微信 ") + 7 -> stringBuffer.append("支付宝 ") + 8 -> stringBuffer.append("其他APP ") + + } + } + } + itemList.add( + TwoItemAdapterItem("收费方式", stringBuffer.toString()) + ) + + stringBuffer.setLength(0) val cardType = arrayObject.getInt("cardType") for (i in 2 downTo 0) { val bit = (cardType shr i) and 1 @@ -586,34 +628,18 @@ class SignUtil { itemList.add( TwoItemAdapterItem("领卡方式", stringBuffer.toString()) ) - } catch (e: Exception) { - Log.e("jingo", "领卡方式 报错 ${e.message}") - } - try { - val stringBuffer = StringBuffer() - val passageType = arrayObject.getInt("passageType") - for (i in 2 downTo 0) { - val bit = (passageType shr i) and 1 - if (bit == 1) { - when (i) { - 0 -> stringBuffer.append("ETC ") - 1 -> stringBuffer.append("人工 ") - 2 -> stringBuffer.append("自助 ") - } - } - } - itemList.add( - TwoItemAdapterItem("领卡方式", stringBuffer.toString()) + + val seqNum = arrayObject.getInt("seqNum") + list.add( + LaneBoundaryItem( + "车道$seqNum", null, itemList + ) ) } catch (e: Exception) { Log.e("jingo", "领卡方式 报错 ${e.message}") } } - list.add( - LaneBoundaryItem( - "车道信息", null, itemList - ) - ) + } } catch (e: Exception) { @@ -642,9 +668,9 @@ class SignUtil { try { val linkList = renderEntity.properties["linkList"] if (linkList != null && linkList != "" && linkList != "null") { - val itemList = mutableListOf() val jsonArray = JSONArray(linkList) for (i in 0 until jsonArray.length()) { + val itemList = mutableListOf() val arrayObject: JSONObject = jsonArray[i] as JSONObject val direct = when (arrayObject.getInt("direct")) { 2 -> "顺方向" @@ -652,6 +678,7 @@ class SignUtil { else -> "" } itemList.add(TwoItemAdapterItem("方向", direct)) + val featureType = when (arrayObject.getInt("featureType")) { 1 -> "LINK" 2 -> "LINK PA" diff --git a/vtm b/vtm index 91fd1a33..facb2419 160000 --- a/vtm +++ b/vtm @@ -1 +1 @@ -Subproject commit 91fd1a339c207abd54e293d1839df6188804f520 +Subproject commit facb2419b710ea272eb9b06ebce2acf373ef6e73