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/ui/adapter/HouseInfoAdapter.java |   53 +++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java b/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java
index 3263f89..d66c905 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java
@@ -61,19 +61,36 @@
         HouseIdBean houseIdBean = this.mList.get(position);
         holder.homeNameTv.setText(houseIdBean.getHomeName().trim());
         //瑁呮満瀹归噺
-        String capacity = HdlCommonLogic.getConvertDoubleUnit(houseIdBean.getInstalledCapacity(), UnitType.kWp, false);
+        String capacity = HdlCommonLogic.getBigDecimal(houseIdBean.getInstalledCapacity()).toString();
         holder.capacityTv.setText(capacity);
         //鍙戠數鍔熺巼
-        holder.power_value_tv.setText(HdlCommonLogic.getConvertDoubleUnit(houseIdBean.getPower(), UnitType.kW));
+        holder.power_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getPower()));
+        holder.power_kw_unit.setText(HdlCommonLogic.convertUnit(houseIdBean.getPower(), UnitType.kW));
         //褰撴棩鍙戠數閲�
-        holder.day_value_tv.setText(HdlCommonLogic.getConvertDoubleUnit(houseIdBean.getTodayElectricity(), UnitType.kWh));
-        //褰撴湀鍙戠數閲�
-        holder.month_value_tv.setText(HdlCommonLogic.getConvertDoubleUnit(houseIdBean.getMonthElectricity(), UnitType.kWh));
-        holder.plant_details_location_tv.setText(houseIdBean.getHomeAddress());
+        holder.day_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getTodayElectricity()));
+        holder.day_kwh_unit.setText(HdlCommonLogic.convertUnit(houseIdBean.getTodayElectricity(), UnitType.kWh));
+        //鐢垫睜瀹归噺
+        holder.month_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getBatteryCapacity()));
+        holder.month_kwh_unit.setText(HdlCommonLogic.convertUnit(houseIdBean.getBatteryCapacity(), UnitType.kWh));
+
+        //缁勪覆瀹归噺(鍒涘缓鐢电珯鏃惰緭鍏ョ殑缁勪覆瀹归噺)
+        holder.pv_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getInstalledCapacity(), UnitType.kWp));
+        holder.pv_kw_unit.setText(HdlCommonLogic.convertKWPUnit(houseIdBean.getInstalledCapacity()));
+        //褰撴棩鍙戠數
+        holder.generation_today_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getTodayElectricity(), UnitType.kWh));
+        holder.generation_today_kw_unit.setText(HdlCommonLogic.convertKWHUnit(houseIdBean.getTodayElectricity()));
+        //閫嗗彉鍣ㄩ瀹氬姛鐜囷紙鍗曚釜閫嗗彉鍣ㄩ瀹氬姛鐜�*閫嗗彉鍣ㄦ暟閲忥級
+        holder.output_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getInvPower(), UnitType.kW));
+        holder.output_kw_unit.setText(HdlCommonLogic.convertKWUnit(houseIdBean.getInvPower()));
+        //鐢垫睜鑳介噺锛堝閲�*鐢垫睜鏁伴噺锛�
+        holder.battery_storage_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getBatteryCapacity(), UnitType.kWh));
+        holder.battery_storage_kw_unit.setText(HdlCommonLogic.convertKWHUnit(houseIdBean.getBatteryCapacity()));
+
+        holder.home_location_tv.setText(houseIdBean.getHomeAddress());
         holder.item_parent_rl.setTag(position);
         setTextViewStyle(holder.stateTv, houseIdBean.getPowerStationStatus());
-        GlideUtils.getRoundedCornersImage(mContext, houseIdBean.getPowerStationImage(), holder.homeIconIv, new RoundedCorners(2));
-        HdlLogLogic.print("---鐢电珯鍚嶇О:" + houseIdBean.getHomeName() + "---鍥剧墖url:" + houseIdBean.getPowerStationImage(), false);
+        GlideUtils.getRoundedCornersImage(mContext, houseIdBean.getPowerStationImage(), holder.homeIconIv, 6);
+//        HdlLogLogic.print("---鐢电珯鍚嶇О:" + houseIdBean.getHomeName() + "---鍥剧墖url:" + houseIdBean.getPowerStationImage(), false);
         holder.item_parent_rl.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -97,8 +114,9 @@
                 }
             }
         });
-        holder.del_home_ll.setVisibility(View.GONE);
-        if (houseIdBean.getDeliverStatus().equals("UNDELIVERED")) {
+        holder.home_del_ll.setVisibility(View.GONE);
+
+        if (houseIdBean.getDebugStatus().equals(DebugStatus.Debugging)) {
             //鏈氦浠樺畬瑕佹樉绀哄垹闄ゆ寜閽�
             holder.del_home_ll.setVisibility(View.VISIBLE);
         }
@@ -155,7 +173,7 @@
      *                    璁惧鍦ㄧ嚎 浣嗘槸褰撳墠澶勪簬鏁呴殰 鐘舵�侊細鏁呴殰
      *                    璁惧鍦ㄧ嚎锛堟湁涓婃姤杩囨暟鎹紝娌℃湁鏁呴殰锛�  鐘舵�侊細鍦ㄧ嚎
      *                    璁惧绂荤嚎 鐘舵�侊細绂荤嚎
-     * @param state_value 鐢电珯鐘舵��(1:姝e父(杩愯),2:绂荤嚎,3:杩炴帴涓�,4:鏁呴殰,5:绂荤嚎鏈夋晠闅�)
+     * @param state_value 鐢电珯鐘舵��(1:姝e父(杩愯),2:绂荤嚎,3:杩炴帴涓�,4:鏁呴殰,5:绂荤嚎鏈夋晠闅�,6:閮ㄥ垎绂荤嚎)
      */
     private void setTextViewStyle(TextView textView, int state_value) {
 
@@ -168,7 +186,8 @@
                 }
                 break;
 
-                case 2: {
+                case 2:
+                case 6: {
                     text = mContext.getString(R.string.my_power_station_off_line);
                     drawable = AppCompatResources.getDrawable(mContext, R.drawable.device_state_ffb9b9b9);
                 }
@@ -201,7 +220,7 @@
             text = mContext.getString(R.string.my_power_station_connecting);
             drawable = AppCompatResources.getDrawable(mContext, R.drawable.device_satte_ffb300);
         }
-        textView.setText(text);
+//        textView.setText(text);
         textView.setBackground(drawable);
 
 
@@ -216,8 +235,11 @@
         public TextView homeNameTv;//浣忓畢鍚嶇О
         public TextView capacityTv;//瑁呮満瀹归噺
         public TextView power_value_tv;//鍙戠數鍔熺巼
+        public TextView power_kw_unit;//鍙戠數鍔熺巼鍗曚綅
         public TextView day_value_tv;//褰撴棩鍙戠數閲�
+        public TextView day_kwh_unit;//褰撴棩鍙戠數閲忓崟浣�
         public TextView month_value_tv;//褰撴湀鍙戠數閲�
+        public TextView month_kwh_unit;//褰撴湀鍙戠數閲忓崟浣�
         public TextView stateTv;//鐢电珯鐘舵��(杩炴帴涓�,杩愯,绂荤嚎,鏁呴殰);
         public RelativeLayout item_parent_rl;//鏉$洰鐖跺鍣�
         public LinearLayout move_home_ll;//绉诲姩鐢电珯浣嶇疆
@@ -231,8 +253,11 @@
             homeNameTv = itemView.findViewById(R.id.device_details_name_tv);
             capacityTv = itemView.findViewById(R.id.device_details_value_tv);
             power_value_tv = itemView.findViewById(R.id.power_value_tv);
+            power_kw_unit = itemView.findViewById(R.id.power_kw_unit);
             day_value_tv = itemView.findViewById(R.id.day_value_tv);
+            day_kwh_unit = itemView.findViewById(R.id.day_kwh_unit);
             month_value_tv = itemView.findViewById(R.id.month_value_tv);
+            month_kwh_unit = itemView.findViewById(R.id.month_kwh_unit);
             stateTv = itemView.findViewById(R.id.device_state_tv);
             item_parent_rl = itemView.findViewById(R.id.item_parent_rl);
             move_home_ll = itemView.findViewById(R.id.move_ll);
@@ -251,4 +276,4 @@
 
     }
 
-}
+}
\ No newline at end of file

--
Gitblit v1.8.0