wjc
2024-12-25 1a8ba64b9cca5aaa98c4f84602f0fb78d3b6b6b4
app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java
@@ -41,6 +41,7 @@
import com.hdl.photovoltaic.ui.home.aachart.BasicChartComposer;
import com.hdl.photovoltaic.uni.HDLUniMP;
import com.hdl.photovoltaic.utils.TimeUtils;
import com.hdl.photovoltaic.widget.FlashingBoxDialog;
import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
import org.greenrobot.eventbus.EventBus;
@@ -312,7 +313,9 @@
                Calendar calendar = TimeUtils.stringToCalendar(currDate, timeDateFormat);
                String time = TimeUtils.addDayMonthYearToDate(calendar, 1, timeDateFormat, timeType);
                if (TimeUtils.stringDateToTimestamp(time, timeDateFormat) > TimeUtils.getCurrentTimestamp()) {
                    HdlThreadLogic.toast(_mActivity, getString(R.string.the_query_date_is_exceeded));
                    FlashingBoxDialog flashingBoxDialog = new FlashingBoxDialog(_mActivity, 1500);
                    flashingBoxDialog.setContent(getString(R.string.the_query_date_is_exceeded));
                    flashingBoxDialog.show();
                    return;
                }
@@ -513,8 +516,9 @@
                        if (dataOverBean == null) {
                            return;
                        }
                        viewBinding.infoRl1Text1Tv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getInstalledCapacity()));
                        viewBinding.infoRl1Text3Tv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getPower(), UnitType.kW, false));
                        String capacityValue = HdlCommonLogic.getBigDecimal(dataOverBean.getInstalledCapacity()).toString();
                        viewBinding.infoRl1Text1Tv.setText(capacityValue);
                        viewBinding.infoRl1Text3Tv.setText(HdlCommonLogic.convertDoubleValue(dataOverBean.getPower()));
//                        String str = dataOverBean.getPowerRatio() + "%";
//                        int startIndex = str.lastIndexOf("%");
@@ -543,10 +547,14 @@
                        } catch (Exception ignored) {
                        }
                        viewBinding.day.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getTodayElectricity()));
                        viewBinding.month.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getMonthElectricity()));
                        viewBinding.year.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getYearElectricity(), UnitType.kW));
                        viewBinding.Total.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getTotalElectricity(), UnitType.kW));
                        viewBinding.day.setText(HdlCommonLogic.convertDoubleValue(dataOverBean.getTodayElectricity()));
                        viewBinding.dayUnit.setText(HdlCommonLogic.convertUnit(dataOverBean.getTodayElectricity(), UnitType.kWh));
                        viewBinding.month.setText(HdlCommonLogic.convertDoubleValue(dataOverBean.getMonthElectricity()));
                        viewBinding.monthUnit.setText(HdlCommonLogic.convertUnit(dataOverBean.getMonthElectricity(), UnitType.kWh));
                        viewBinding.year.setText(HdlCommonLogic.convertDoubleValue(dataOverBean.getYearElectricity()));
                        viewBinding.yearUnit.setText(HdlCommonLogic.convertUnit(dataOverBean.getYearElectricity(), UnitType.kWh));
                        viewBinding.Total.setText(HdlCommonLogic.convertDoubleValue(dataOverBean.getTotalElectricity()));
                        viewBinding.TotalUnit.setText(HdlCommonLogic.convertUnit(dataOverBean.getTotalElectricity(), UnitType.kWh));
                    }
                });