From dd2562d8dc2b01bcdfca3152f82f09efbbd09259 Mon Sep 17 00:00:00 2001
From: zuoxiao <lf_zuo@163.com>
Date: 星期三, 25 六月 2025 19:49:48 +0800
Subject: [PATCH] fix(generallibrary): 优化卡片处理和支付方式获取逻辑- 修复地区卡处理逻辑,增加对"00"类型卡的特殊处理 - 优化用户卡数据解析和显示逻辑,提高容错性 - 改进支付方式获取方法,增加错误处理和日志记录 -调整充值接口调用参数,确保正确传递当前余额等信息- 修复 AreaCard 中 areaNumber 类型,改为字符串处理
---
generallibrary/src/main/java/com/dayu/general/bean/card/BaseCard.kt | 44 ++++++++++++++++++++++----------------------
1 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/generallibrary/src/main/java/com/dayu/general/bean/card/BaseCard.kt b/generallibrary/src/main/java/com/dayu/general/bean/card/BaseCard.kt
index 7a8f09f..0429fcf 100644
--- a/generallibrary/src/main/java/com/dayu/general/bean/card/BaseCard.kt
+++ b/generallibrary/src/main/java/com/dayu/general/bean/card/BaseCard.kt
@@ -1,12 +1,12 @@
package com.dayu.general.bean.card
-import com.dayu.baselibrary.tools.HexUtil
+import com.dayu.baselibrary.tools.BaseCard
import com.dayu.general.bean.db.CardData
import com.dayu.general.dao.AppDataBase
import com.dayu.general.tool.CardCommon
import com.tencent.bugly.crashreport.CrashReport
-open class BaseCard {
+open class BaseCard : BaseCard() {
var cardData: String? = null //鏍囪瘑鐮�
companion object {
@@ -33,25 +33,25 @@
}
- /**
- * 鍓�15涓瓧鑺傜畻鏈疮鍔犲拰 涓嶅惈杩涗綅
- *
- * @param data 婧愭暟鎹�
- * @return 16杩涘埗
- */
- fun getByteSum(data: ByteArray?): Byte {
- if (data != null) {
- var sum = 0
- for (b in data) {
- sum += b.toInt() and 0xFF // & 0xFF 鍙互灏嗗瓧鑺傛墿灞曚负姝f暣鏁帮紝閬垮厤绗﹀彿浣嶇殑褰卞搷
- }
- var hex = HexUtil.get10to16CompleteHex(sum)
- hex = HexUtil.spaceHex(hex)
- val hexArr = hex.split(" ".toRegex()).dropLastWhile { it.isEmpty() }
- .toTypedArray()
- return HexUtil.hexToByte(hexArr[hexArr.size - 1])
- }
- return 0
- }
+// /**
+// * 鍓�15涓瓧鑺傜畻鏈疮鍔犲拰 涓嶅惈杩涗綅
+// *
+// * @param data 婧愭暟鎹�
+// * @return 16杩涘埗
+// */
+// fun getByteSum(data: ByteArray?): Byte {
+// if (data != null) {
+// var sum = 0
+// for (b in data) {
+// sum += b.toInt() and 0xFF // & 0xFF 鍙互灏嗗瓧鑺傛墿灞曚负姝f暣鏁帮紝閬垮厤绗﹀彿浣嶇殑褰卞搷
+// }
+// var hex = HexUtil.get10to16CompleteHex(sum)
+// hex = HexUtil.spaceHex(hex)
+// val hexArr = hex.split(" ".toRegex()).dropLastWhile { it.isEmpty() }
+// .toTypedArray()
+// return HexUtil.hexToByte(hexArr[hexArr.size - 1])
+// }
+// return 0
+// }
}
\ No newline at end of file
--
Gitblit v1.8.0