From 55b196ea2e28a8d859c85326f2147a4f7b7196de Mon Sep 17 00:00:00 2001
From: zuojincheng <lf_zuo@163.com>
Date: 星期四, 10 四月 2025 10:58:32 +0800
Subject: [PATCH] feat(general): 新增开卡信息保存功能并优化界面布局- 新增 CardRegistrationBean 数据模型用于保存开卡信息 - 在数据库中添加 card_registration 表用于存储开卡记录 - 优化 NewCard2Activity 界面布局,调整样式和间距 - 添加协程支持,实现异步保存开卡信息到数据库 - 更新颜色配置,统一使用新加的 base_blue_bg 和 base_green_bg颜色

---
 qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/card/ElectricPriceCard.java |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/card/ElectricPriceCard.java b/qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/card/ElectricPriceCard.java
index 39303bf..f6aa469 100644
--- a/qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/card/ElectricPriceCard.java
+++ b/qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/card/ElectricPriceCard.java
@@ -32,11 +32,10 @@
     }
 
 
-
-    public static ElectricPriceCard getBean(List<byte[]> data){
-        ElectricPriceCard regionCard=new ElectricPriceCard();
-        byte[] zero=data.get(0);
-        regionCard.cardType= HexUtil.byteToHex(zero[0]);
+    public static ElectricPriceCard getBean(List<byte[]> data) {
+        ElectricPriceCard regionCard = new ElectricPriceCard();
+        byte[] zero = data.get(0);
+        regionCard.cardType = HexUtil.byteToHex(zero[0]);
 
         byte[] cardDataByte = new byte[4];
         System.arraycopy(zero, 1, cardDataByte, 0, cardDataByte.length);
@@ -45,7 +44,7 @@
 
         byte[] electricPriceByte = new byte[4];
         System.arraycopy(zero, 5, electricPriceByte, 0, electricPriceByte.length);
-        regionCard.electricPrice = HexUtil.bytesToFloat(electricPriceByte);
+        regionCard.electricPrice = HexUtil.hexToFloatLowHigh(electricPriceByte);
 
 
         return regionCard;
@@ -55,17 +54,21 @@
     /**
      * 绗�1鎵囧尯0鍧� 瀛樺偍鐨勬暟鎹�
      */
-    public class Zero  {
+    public class Zero {
         public byte[] toByte() {
             byte[] data = new byte[16];
             data[0] = HexUtil.hexToByte(cardType);
 
-            byte[] regionBytes = HexUtil.hexToByteArray(cardData);
+            byte[] regionBytes = new byte[4];
+            byte[] regionDatas = HexUtil.hexToByteArray(cardData);
+            System.arraycopy(regionDatas, 0, regionBytes, 0, regionDatas.length);
             if (regionBytes != null) {
                 System.arraycopy(regionBytes, 0, data, 1, regionBytes.length);
             }
 
-            byte[] controllerCodelBytes = HexUtil.folatToByte(electricPrice);
+            byte[] controllerCodelBytes = new byte[4];
+            byte[] controllerCodelDatas = HexUtil.hexToByteArray(HexUtil.floatToHexLowHigh(electricPrice));
+            System.arraycopy(controllerCodelDatas, 0, controllerCodelBytes, 0, controllerCodelDatas.length);
             if (controllerCodelBytes != null) {
                 System.arraycopy(controllerCodelBytes, 0, data, 5, controllerCodelBytes.length);
             }

--
Gitblit v1.8.0