| | |
| | | import static com.hdl.photovoltaic.ui.home.aachart.CustomStyleChartComposer.configureColorfulColumnChart; |
| | | |
| | | import android.os.Bundle; |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | | import android.os.SystemClock; |
| | | import android.text.SpannableString; |
| | | import android.text.Spanned; |
| | | import android.text.TextUtils; |
| | | import android.text.style.AbsoluteSizeSpan; |
| | | import android.text.style.ClickableSpan; |
| | | import android.text.style.ForegroundColorSpan; |
| | | import android.text.style.StyleSpan; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.appcompat.content.res.AppCompatResources; |
| | | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; |
| | | |
| | |
| | | import com.github.AAChartModel.AAChartCore.AAChartCreator.AAChartView; |
| | | import com.github.AAChartModel.AAChartCore.AAChartCreator.AAMoveOverEventMessageModel; |
| | | import com.hdl.linkpm.sdk.core.exception.HDLException; |
| | | import com.hdl.photovoltaic.HDLApp; |
| | | import com.hdl.photovoltaic.R; |
| | | import com.hdl.photovoltaic.base.CustomBaseFragment; |
| | | import com.hdl.photovoltaic.config.ConstantManage; |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.databinding.FragmentHomePageBinding; |
| | | import com.hdl.photovoltaic.enums.HomepageTitleTabSwitch; |
| | | import com.hdl.photovoltaic.enums.PowerStationStatus; |
| | | import com.hdl.photovoltaic.enums.TimeType; |
| | | import com.hdl.photovoltaic.enums.UnitType; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | |
| | | import com.hdl.photovoltaic.ui.home.aachart.BasicChartComposer; |
| | | import com.hdl.photovoltaic.uni.HDLUniMP; |
| | | import com.hdl.photovoltaic.utils.TimeUtils; |
| | | import com.hdl.photovoltaic.utils.UnitConversionUtils; |
| | | import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | import org.greenrobot.eventbus.ThreadMode; |
| | | |
| | | import java.lang.ref.WeakReference; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | |
| | | @Override |
| | | public void onBindView(Bundle savedInstanceState) { |
| | | |
| | | //初始化 |
| | | initView(); |
| | | //初始化界面监听器 |
| | |
| | | HdlUniLogic.getInstance().openUniMP(HDLUniMP.UNI_EVENT_OPEN_HOME_CREATION, null); |
| | | } |
| | | }); |
| | | |
| | | //全部 |
| | | viewBinding.homeAllIl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | HdlCommonLogic.getInstance().postEventBus(ConstantManage.homepage_title_tab_switch, ConstantManage.station_page, PowerStationStatus.All); |
| | | |
| | | } |
| | | }); |
| | | //故障 |
| | | viewBinding.homeFaultsIl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | HdlCommonLogic.getInstance().postEventBus(ConstantManage.homepage_title_tab_switch, ConstantManage.station_page, PowerStationStatus.malfunction); |
| | | } |
| | | }); |
| | | //离线 |
| | | viewBinding.homeOfflineIl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | HdlCommonLogic.getInstance().postEventBus(ConstantManage.homepage_title_tab_switch, ConstantManage.station_page, PowerStationStatus.off); |
| | | } |
| | | }); |
| | | //待接入 |
| | | viewBinding.homeConnectedIl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | HdlCommonLogic.getInstance().postEventBus(ConstantManage.homepage_title_tab_switch, ConstantManage.station_page, PowerStationStatus.connecting); |
| | | } |
| | | }); |
| | | //时间选择器 |
| | | viewBinding.yearMonthDayTv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | |
| | | return; |
| | | } |
| | | timeType = TimeType.day; |
| | | |
| | | viewBinding.unitTv.setText(UnitType.kW); |
| | | viewBinding.unitTextTv.setText(getString(R.string.pv_power)); |
| | | viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_38c494)); |
| | | viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_38C494)); |
| | | viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_E6FFFFFF)); |
| | | |
| | | viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | |
| | | viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | |
| | | viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | |
| | | viewBinding.v1.setVisibility(View.GONE); |
| | | viewBinding.v2.setVisibility(View.VISIBLE); |
| | |
| | | return; |
| | | } |
| | | timeType = TimeType.month; |
| | | viewBinding.unitTv.setText(UnitType.kWh); |
| | | viewBinding.unitTextTv.setText(getString(R.string.generation)); |
| | | viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | |
| | | viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_38c494)); |
| | | viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_38C494)); |
| | | viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_E6FFFFFF)); |
| | | |
| | | viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | |
| | | viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | |
| | | viewBinding.v1.setVisibility(View.GONE); |
| | | viewBinding.v2.setVisibility(View.GONE); |
| | |
| | | return; |
| | | } |
| | | timeType = TimeType.year; |
| | | viewBinding.unitTv.setText(UnitType.kWh); |
| | | viewBinding.unitTextTv.setText(getString(R.string.generation)); |
| | | viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | |
| | | viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | |
| | | viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_38c494)); |
| | | viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_38C494)); |
| | | viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_E6FFFFFF)); |
| | | |
| | | viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | |
| | | viewBinding.v1.setVisibility(View.VISIBLE); |
| | | viewBinding.v2.setVisibility(View.GONE); |
| | |
| | | return; |
| | | } |
| | | timeType = TimeType.all; |
| | | viewBinding.unitTv.setText(UnitType.kWh); |
| | | viewBinding.unitTextTv.setText(getString(R.string.generation)); |
| | | viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | |
| | | viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | |
| | | viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | |
| | | viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_38c494)); |
| | | viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_38C494)); |
| | | viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_E6FFFFFF)); |
| | | |
| | | viewBinding.v1.setVisibility(View.VISIBLE); |
| | | viewBinding.v2.setVisibility(View.VISIBLE); |
| | |
| | | String timeDateFormat = TimeUtils.getTimeDateFormat(timeType); |
| | | Calendar calendar = TimeUtils.stringToCalendar(currDate, timeDateFormat); |
| | | String time = TimeUtils.subtractDayMonthYearFromDate(calendar, 1, timeDateFormat, timeType); |
| | | //不需要限制最小日期,因为是查询账号下所有电站,无法知道最小建站日期 |
| | | viewBinding.yearMonthDayTv.setText(time); |
| | | getStatistics(); |
| | | |
| | |
| | | * 时间选择器 |
| | | */ |
| | | private void selectedTimePickerBuilder() { |
| | | |
| | | String currDate = viewBinding.yearMonthDayTv.getText().toString(); |
| | | //时间选择器 |
| | | Calendar selectedDate = TimeUtils.stringToCalendar(currDate, TimeUtils.getTimeDateFormat(timeType)); |
| | |
| | | /** |
| | | * 图表加载 |
| | | */ |
| | | private void setUpAAChartView() { |
| | | private void setUpAAChartView(boolean needDelay) { |
| | | aaChartView = viewBinding.autoSizeMyAAChart; |
| | | aaChartView.callBack = this; |
| | | if (TimeType.day.equals(timeType)) { |
| | | aaChartModel = BasicChartComposer.configureAreaChart(getString(R.string.pv_power), fieldNames, fieldValues); |
| | | } else if (TimeType.month.equals(timeType) |
| | | || TimeType.year.equals(timeType) |
| | | || TimeType.all.equals(timeType)) { |
| | | aaChartModel = configureColorfulColumnChart(getString(R.string.pv_power), fieldNames, fieldValues); |
| | | } else if (TimeType.month.equals(timeType) || TimeType.year.equals(timeType) || TimeType.all.equals(timeType)) { |
| | | aaChartModel = configureColorfulColumnChart(getString(R.string.generation), fieldNames, fieldValues); |
| | | } |
| | | aaChartView.aa_drawChartWithChartModel(aaChartModel); |
| | | |
| | | |
| | | if(needDelay) { |
| | | viewBinding.autoSizeMyAAChart.setX(10000);//直接打开有闪屏,在不显示的地方先显示,再移动到正常的位置。TODO 后续找到根源问题后去掉这个用法 |
| | | aaChartView.aa_drawChartWithChartOptions(aaChartModel.aa_toAAOptions()); |
| | | mHandler.sendEmptyMessageDelayed(100,800); |
| | | } |
| | | else{ |
| | | aaChartView.aa_drawChartWithChartOptions(aaChartModel.aa_toAAOptions()); |
| | | } |
| | | } |
| | | |
| | | FHandler mHandler=new FHandler(this); |
| | | |
| | | private static class FHandler extends Handler{ |
| | | //定义弱引用实例 |
| | | private WeakReference<HomePageFragment> reference; |
| | | |
| | | //在构造方法中传入需要持有的fragment实例 |
| | | public FHandler(HomePageFragment fragment) { |
| | | reference = new WeakReference<HomePageFragment>(fragment); } |
| | | |
| | | //通过复写handlerMessage()从而决定如何进行更新UI操作 |
| | | @Override |
| | | public void handleMessage(Message msg) { |
| | | //省略代码 |
| | | |
| | | switch (msg.what){ |
| | | case 100: |
| | | if(reference.get()!=null) { |
| | | reference.get().viewBinding.autoSizeMyAAChart.setX(0);//移动到正确的位置 |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onDestroy() { |
| | | super.onDestroy(); |
| | | mHandler.removeCallbacksAndMessages(null); |
| | | } |
| | | |
| | | private void initView() { |
| | | |
| | | |
| | | viewBinding.homeAllIl.stationTitleTv.setText(getString(R.string.message_all)); |
| | | viewBinding.homeFaultsIl.stationTitleTv.setText(getString(R.string.my_power_station_malfunction)); |
| | | viewBinding.homeOfflineIl.stationTitleTv.setText(getString(R.string.my_power_station_off_line)); |
| | | viewBinding.homeConnectedIl.stationTitleTv.setText(getString(R.string.to_be_added)); |
| | | |
| | | String dataStr = TimeUtils.getDateTimestamp(TimeUtils.getCurrentTimestamp(), TimeUtils.getTimeDateFormat(timeType)); |
| | | viewBinding.yearMonthDayTv.setText(dataStr); |
| | | |
| | | String installed_capacity = getString(R.string.installed_capacity) + "(" + UnitType.kWp + ")"; |
| | | viewBinding.infoRl1Text2Tv.setText(installed_capacity); |
| | | String generated_power = getString(R.string.generated_power) + "(" + UnitType.kW + ")"; |
| | | viewBinding.infoRl1Text4Tv.setText(generated_power); |
| | | String generation = getString(R.string.generation) + "(" + UnitType.kWh + ")"; |
| | | viewBinding.homePageStationInfoRl1TitleTv.setText(generation); |
| | | // String installed_capacity = getString(R.string.string_capacity) + "(" + UnitType.kWp + ")"; |
| | | // viewBinding.infoRl1Text2Tv.setText(installed_capacity); |
| | | // String generated_power = getString(R.string.generated_power) + "(" + UnitType.kW + ")"; |
| | | // viewBinding.infoRl1Text4Tv.setText(generated_power); |
| | | // String generation = getString(R.string.generation) + "/" + UnitType.kWh; |
| | | // viewBinding.homePageStationInfoRl1TitleTv.setText(generation); |
| | | |
| | | viewBinding.homePageStationInfoRl2DayIc.dataTypeTv.setText(R.string.day_power_generation); |
| | | viewBinding.homePageStationInfoRl2MonIc.dataTypeTv.setText(R.string.month_power_generation); |
| | | viewBinding.homePageStationInfoRl2YearIc.dataTypeTv.setText(R.string.year_power_generation); |
| | | viewBinding.homePageStationInfoRl2CumulativeIc.dataTypeTv.setText(R.string.cumulative_power_generation); |
| | | |
| | | // viewBinding.day.setText(R.string.day_power_generation); |
| | | // viewBinding.month.setText(R.string.month_power_generation); |
| | | // viewBinding.year.setText(R.string.year_power_generation); |
| | | // viewBinding.Total.setText(R.string.cumulative_power_generation); |
| | | // |
| | | viewBinding.unitTv.setText(UnitType.kW); |
| | | |
| | | |
| | | viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_38c494)); |
| | | viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_38C494)); |
| | | viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_E6FFFFFF)); |
| | | viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000)); |
| | | viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66000000)); |
| | | viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66FFFFFF)); |
| | | viewBinding.v1.setVisibility(View.GONE); |
| | | viewBinding.v2.setVisibility(View.VISIBLE); |
| | | viewBinding.v3.setVisibility(View.VISIBLE); |
| | | viewBinding.homePageStationSelectTimeLl.setVisibility(View.VISIBLE); |
| | | setUpAAChartView();//图表加载 |
| | | setUpAAChartView(true);//图表加载 |
| | | } |
| | | |
| | | |
| | |
| | | // 取消粘性事件 |
| | | EventBus.getDefault().removeStickyEvent(eventBus); |
| | | HdlLogLogic.print("正在点击【首页】"); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 电站状态概览 |
| | |
| | | if (statusOverviewBean == null) { |
| | | return; |
| | | } |
| | | viewBinding.homeAllIl.stationTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getTotal())); |
| | | viewBinding.homeFaultsIl.stationTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getFault())); |
| | | viewBinding.homeOfflineIl.stationTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getOffline())); |
| | | viewBinding.homeConnectedIl.stationTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getConnecting())); |
| | | viewBinding.stationAllTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getTotal())); |
| | | viewBinding.stationFaultsTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getFault())); |
| | | viewBinding.stationOfflineTitleTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getOffline())); |
| | | viewBinding.stationConnectedTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getConnecting())); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return; |
| | | } |
| | | viewBinding.infoRl1Text1Tv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getInstalledCapacity())); |
| | | viewBinding.infoRl1Text3Tv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getPower())); |
| | | viewBinding.infoRl1FText1Tv.setText(dataOverBean.getPowerRatio()); |
| | | viewBinding.infoRl1Text3Tv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getPower(), UnitType.kW, false)); |
| | | |
| | | viewBinding.homePageStationInfoRl2DayIc.dataTv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getTodayElectricity())); |
| | | viewBinding.homePageStationInfoRl2MonIc.dataTv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getMonthElectricity())); |
| | | viewBinding.homePageStationInfoRl2YearIc.dataTv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getYearElectricity())); |
| | | viewBinding.homePageStationInfoRl2CumulativeIc.dataTv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getTotalElectricity())); |
| | | // String str = dataOverBean.getPowerRatio() + "%"; |
| | | // int startIndex = str.lastIndexOf("%"); |
| | | // int endIndex = str.lastIndexOf("%") + 1; |
| | | // SpannableString spannableString = new SpannableString(str); |
| | | // //设置第一部分文字的字体大小 |
| | | // spannableString.setSpan(new AbsoluteSizeSpan((int) UnitConversionUtils.dpToPx(HDLApp.getInstance(), 12)), startIndex, endIndex, 0); |
| | | // // 创建一个ForegroundColorSpan对象,参数是颜色值 |
| | | // ForegroundColorSpan colorSpan = new ForegroundColorSpan(HDLApp.getInstance().getColor(R.color.text_66FFFFFF)); |
| | | // spannableString.setSpan(colorSpan, startIndex, endIndex, 0); |
| | | // viewBinding.infoRl1FText1Tv.setText(spannableString); |
| | | viewBinding.infoRl1FText1Tv.setText(dataOverBean.getPowerRatio()); |
| | | try { |
| | | int progress = 0; |
| | | if (!TextUtils.isEmpty(dataOverBean.getPowerRatio())) { |
| | | progress = (int) Double.parseDouble(dataOverBean.getPowerRatio()); |
| | | if (progress > 100) { |
| | | progress = 100; |
| | | } |
| | | if (progress < 0) { |
| | | progress = 0; |
| | | } |
| | | viewBinding.progressBar.setProgress(progress); |
| | | } |
| | | |
| | | } catch (Exception ignored) { |
| | | } |
| | | |
| | | viewBinding.day.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getTodayElectricity())); |
| | | viewBinding.month.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getMonthElectricity())); |
| | | viewBinding.year.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getYearElectricity())); |
| | | viewBinding.Total.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getTotalElectricity())); |
| | | |
| | | } |
| | | }); |
| | | } |
| | |
| | | Object[] values = new Object[list.size()]; |
| | | for (int i = 0; i < list.size(); i++) { |
| | | keys[i] = list.get(i).getFieldName(); |
| | | values[i] = HdlCommonLogic.getBigDecimal(list.get(i).getFieldValue()).intValue();//获取整数部分 |
| | | if (TimeType.day.equals(timeType)) { |
| | | values[i] = HdlCommonLogic.divideByOneThousandAndFormat(list.get(i).getFieldValue());// HdlCommonLogic.getBigDecimal(list.get(i).getFieldValue()).intValue();//获取整数部分 |
| | | } else { |
| | | values[i] = HdlCommonLogic.getBigDecimal(list.get(i).getFieldValue()); |
| | | } |
| | | } |
| | | fieldNames = keys; |
| | | fieldValues = values; |
| | | setUpAAChartView(); |
| | | setUpAAChartView(false); |
| | | } |
| | | }); |
| | | |
| | |
| | | } |
| | | viewBinding.socialContributionData1Tv.setText(HdlCommonLogic.convertString(HdlCommonLogic.getBigDecimal(socialContributionBean.getCoal()))); |
| | | viewBinding.socialContributionData2Tv.setText(HdlCommonLogic.convertString(HdlCommonLogic.getBigDecimal(socialContributionBean.getCo2()))); |
| | | viewBinding.socialContributionData3Tv.setText(HdlCommonLogic.convertString(HdlCommonLogic.getBigDecimal(socialContributionBean.getTreePlanting()))); |
| | | viewBinding.socialContributionData3Tv.setText(HdlCommonLogic.convertString(socialContributionBean.getTreePlanting())); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |