mac
2024-06-22 ffb521e1ef0dd0802e08975d4f9a0daa5684ebbf
2024年06月22日16:14:41

备份代码
1个文件已添加
6个文件已修改
252 ■■■■■ 已修改文件
app/src/main/java/com/hdl/photovoltaic/enums/UserRightType.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/other/HdlMemberLogic.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMP.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/values-en/strings.xml 166 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/values-zh/strings.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/enums/UserRightType.java
New file
@@ -0,0 +1,9 @@
package com.hdl.photovoltaic.enums;
/**
 * (B端)员工权限类型
 */
public @interface UserRightType {
    String MANAGER = "MANAGER";//公司管理员
    String USER = "USER";// 普通员工
}
app/src/main/java/com/hdl/photovoltaic/other/HdlMemberLogic.java
@@ -120,7 +120,7 @@
     * @param userId        -
     * @param cloudCallBeak -
     */
    public void getStaffInfo(String userId, CloudCallBeak<PageNumberObject<StaffBean>> cloudCallBeak) {
    public void getStaffInfo(String userId, CloudCallBeak<StaffBean> cloudCallBeak) {
        String requestUrl = HttpApi.B_POST_GET_MANAGE_INFO;
        JsonObject json = new JsonObject();
        json.addProperty("userId", userId);
@@ -129,15 +129,14 @@
            public void onSuccess(String jsonStr) {
                if (TextUtils.isEmpty(jsonStr)) {
                    if (cloudCallBeak != null) {
                        cloudCallBeak.onSuccess(new PageNumberObject<>());
                        cloudCallBeak.onSuccess(new StaffBean());
                    }
                }
                Gson gson = new Gson();
                Type type = new TypeToken<PageNumberObject<StaffBean>>() {
                }.getType();
                PageNumberObject<StaffBean> pageNumberObject = gson.fromJson(jsonStr, type);
                StaffBean staffBean = gson.fromJson(jsonStr, StaffBean.class);
                if (cloudCallBeak != null) {
                    cloudCallBeak.onSuccess(pageNumberObject);
                    cloudCallBeak.onSuccess(staffBean);
                }
            }
@@ -300,6 +299,7 @@
    }
    /**
     * 添加成员(C端)
     *
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -555,6 +555,13 @@
                    }
                    break;
                    //员工详情获取
                    case HDLUniMP.UNI_EVENT_REPLY_STAFF_DETAIL: {
                        uniGetStaffInfo(type, data, callback);
                    }
                    break;
                    //员工删除
                    case HDLUniMP.UNI_EVENT_REPLY_STAFF_DELETE: {
@@ -857,6 +864,24 @@
    }
    /**
     * 获取员工详情
     */
    private void uniGetStaffInfo(String type, Object data, DCUniMPJSCallback callback) {
        String userId = getKeyValue("userId", getKeyValue("data", data));
        HdlMemberLogic.getInstance().getStaffInfo(userId, new CloudCallBeak<StaffBean>() {
            @Override
            public void onSuccess(StaffBean obj) {
                uniSuccessCallback(type, obj, callback);
            }
            @Override
            public void onFailure(HDLException e) {
                uniExceptionCallback(type, e, callback);
            }
        });
    }
    /**
     * 获取员工列表
     */
    private void uniGetStaffList(String type, Object data, DCUniMPJSCallback callback) {
@@ -875,6 +900,7 @@
        });
    }
    /**
     * 成员编辑
     */
app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java
@@ -17,14 +17,17 @@
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.databinding.FragmentMeBinding;
import com.hdl.photovoltaic.enums.HomepageTitleTabSwitch;
import com.hdl.photovoltaic.enums.UserRightType;
import com.hdl.photovoltaic.listener.CloudCallBeak;
import com.hdl.photovoltaic.other.HdlAccountLogic;
import com.hdl.photovoltaic.other.HdlLogLogic;
import com.hdl.photovoltaic.other.HdlMemberLogic;
import com.hdl.photovoltaic.other.HdlResidenceLogic;
import com.hdl.photovoltaic.other.HdlThreadLogic;
import com.hdl.photovoltaic.other.HdlUniLogic;
import com.hdl.photovoltaic.ui.bean.BUserInfo;
import com.hdl.photovoltaic.ui.bean.CUserInfo;
import com.hdl.photovoltaic.ui.bean.UserRightTypeBean;
import com.hdl.photovoltaic.ui.test.TestMainActivity;
import com.hdl.photovoltaic.uni.HDLUniMP;
import com.hdl.photovoltaic.utils.GlideUtils;
@@ -302,10 +305,35 @@
                } else {
                    this.getCMemberInfo();
                }
                getUserRightType();
            }
            }
        }
    /**
     * 员工权限类型(B端)
     * MANAGER : 公司管理员
     * USER : 普通员工
     */
    private void getUserRightType() {
        HdlMemberLogic.getInstance().getUserRightType(new CloudCallBeak<UserRightTypeBean>() {
            @Override
            public void onSuccess(UserRightTypeBean obj) {
//                if (obj.getUserRightType().equals(UserRightType.MANAGER)) {
//                    viewBinding.fragmentMeLineUserManagementIl.getRoot().setVisibility(View.VISIBLE);
//                } else {
//                    viewBinding.fragmentMeLineUserManagementIl.getRoot().setVisibility(View.GONE);
//                }
            }
            @Override
            public void onFailure(HDLException e) {
            }
        });
    }
    /**
app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMP.java
@@ -105,6 +105,7 @@
    public final static String UNI_EVENT_REPLY_MEMBER_EDIT = "member_edit";//成员编辑(包含备注、权限修改)
    public final static String UNI_EVENT_REPLY_STAFF_LIST = "staff_list";//员工列表
    public final static String UNI_EVENT_REPLY_STAFF_ADD = "staff_add";//员工添加
    public final static String UNI_EVENT_REPLY_STAFF_DETAIL = "staff_detail";//员工详情获取
    public final static String UNI_EVENT_REPLY_STAFF_DELETE = "staff_delete";//员工删除
    public final static String UNI_EVENT_REPLY_STAFF_EDIT = "staff_edit";//员工编辑
    public final static String UNI_EVENT_REPLY_USERRIGHTTYPe = "user_right_type";//获取当前账号在公司的身份
app/src/main/res/values-en/strings.xml
@@ -24,7 +24,7 @@
    <string name="home_login_change_password">Change password</string>
    <string name="home_login_logoin">Log in</string>
    <string name="home_login_be_logging_in">Logging in…</string>
    <string name="home_login_power_station">Guest mode</string>
    <string name="home_login_power_station">Demo Sites</string>
    <string name="home_login_consent_service_agreement">Agree to the 《Service Agreement》 and 《User Information Protection Regulations》</string>
    <string name="home_login_error_account_null">Account cannot be empty.</string>
    <string name="home_login_error_password_null">Password cannot be empty.</string>
@@ -44,7 +44,7 @@
    <string name="home_login_null_verification_code">Verification code cannot be empty.</string>
    <string name="home_login_phone_null">Phone number cannot be empty.</string>
    <string name="home_login_mail_null">Email cannot be empty.</string>
    <string name="home_login_psw_unlikeliness">Passwords do not match.</string>
    <string name="home_login_psw_unlikeliness">The two passwords are different</string>
    <string name="home_login_psw_verification_repeater">Resend later</string>
    <string name="home_login_verification_regain">Reacquire</string>
    <string name="home_login_pws_reset_succeeded"> Password reset successful</string>
@@ -59,10 +59,10 @@
    <string name="home_login_input_old_pws">Please enter your current password</string>
    <string name="home_login_input_new_pws">Please enter your new password</string>
    <string name="home_login_input_affirm_psw">Please enter your new password again</string>
    <string name="home_login_input_unlike_psw">New password and confirm password do not match.</string>
    <string name="home_login_input_unlike_psw">New password and confirm password  are different</string>
    <string name="home_login_change_name_succeed">Remark successfully updated.</string>
    <string name="verification">Verification code</string>
    <string name="home_phone_number">Area code</string>
    <string name="home_phone_number">Country Code</string>
    <string name="home_chinese_mainland">Mainland China</string>
    <string name="home_password_changed_successfully_log_in">The password has been successfully changed. Please log in again.</string>
    <string name="home_old_password_not_new_password">The original password and the new password should not be identical.</string>
@@ -71,17 +71,17 @@
    <!--我的电站-->
    <string name="power_shome_page">Homepage</string>
    <string name="power_station">Power station</string>
    <string name="power_station_me">Mine</string>
    <string name="my_power_station">My power station</string>
    <string name="power_station">Plants</string>
    <string name="power_station_me">Me</string>
    <string name="my_power_station">My Plants</string>
    <string name="power_station_generated_power">Power generation</string>
    <string name="power_station_Power_generation_today">Today power generation</string>
    <string name="power_station_creation_time">Established at</string>
    <string name="power_station_Power_generation_today">Yield Today</string>
    <string name="power_station_creation_time">Startup Time</string>
    <string name="my_power_station_installed_capacity1">Installed capacity</string>
    <string name="my_power_station_connecting">Connecting</string>
    <string name="my_power_station_off_line">Offline</string>
    <string name="my_power_station_malfunction">Malfunction</string>
    <string name="my_power_station_operation">Operating</string>
    <string name="my_power_station_operation">Running</string>
    <string name="my_power_station_await">Standby</string>
    <string name="my_power_station_data_null">Data is empty, create one now!</string>
@@ -100,7 +100,7 @@
    <string name="messagealarm_details_content">Alarm content</string>
    <string name="messagealarm_details_device">Alarm device</string>
    <string name="message_alarm_detailsaffect_region">Impact area</string>
    <string name="message_alarm_detailspower_station_location">Power station location</string>
    <string name="message_alarm_detailspower_station_location">Plant  location</string>
    <string name="message_alarm_details_time">Alarm time</string>
    <string name="message_alarm_details_back">Back</string>
    <string name="message_alarm_details_resolved">Solved</string>
@@ -109,7 +109,7 @@
    <!--我的-->
    <string name="me">Mine</string>
    <string name="me">Me</string>
    <string name="me_set">Settings</string>
    <string name="me_regard">About</string>
    <string name="set_account">Account Security</string>
@@ -121,8 +121,8 @@
    <string name="set_general_setting">General Settings</string>
    <string name="set_multilingual">Multi-language</string>
    <string name="set_data_centre">Data Center</string>
    <string name="set_system_rights_managemen">System Permissions Management</string>
    <string name="set_3_msg_sharing">Third-Party Information Sharing List</string>
    <string name="set_system_rights_managemen">Permissions Management</string>
    <string name="set_3_msg_sharing">Data Shared with Third-Parties</string>
    <string name="set_account_security">Account and Security</string>
    <string name="set_temperature_unit">Temperature Unit</string>
    <string name="set_logout">Log Out</string>
@@ -150,7 +150,7 @@
    <!--app更新-->
    <string name="app_version_number">Version number</string>
    <string name="app_scan_code_download">Scan to download the Smart Energy App</string>
    <string name="app_scan_code_download">app_scan_code_download</string>
    <string name="app_version_upgrade">Version update</string>
    <string name="app_new_version">Already the latest version</string>
    <string name="app_service_agreement">Service agreement</string>
@@ -162,11 +162,11 @@
    <string name="app_stop_current_download">Stop current download?</string>
    <string name="app_version">Version</string>
    <string name="app_package_size">Size</string>
    <string name="app_update_content">In order to upgrade the HDL APP normally, please click the Settings button to allow the installation of applications from unknown sources. This function is only available for APP upgrades. Android versions 11 and above need to be re-downloaded and installed after authorization.</string>
    <string name="app_update_content">In order to upgrade the HDL APP successfully, please click the Settings button to allow the installation of applications from unknown sources. This function is only available for APP upgrades. Android versions 11 and above need to be re-downloaded and installed after authorization.</string>
    <string name="app_update_fail">Authorization failed, unable to install the application</string>
    <!--ota-->
    <string name="ota_binding_cloud_upgrade_fails">The inverter has not been bound before, upgrade failed.</string>
    <string name="ota_binding_cloud_upgrade_fails">The inverter is not bound, upgrade failed</string>
    <string name="ota_not_cloud_upgrade_fails">The inverter is not connected to the cloud, upgrade failed.</string>
@@ -180,8 +180,8 @@
    <string name="loading_on_agree">Disagree</string>
    <string name="loading_privacy">Privacy policy and terms of service</string>
    <string name="loading_privacy_server">To better protect your legitimate rights and interests, please read and agree to the following agreements: 《Privacy Policy》 and 《Terms of Service》.</string>
    <string name="kill_app">Press again to exit the application</string>
    <string name="loading_not_supported">Sorry, not supported at the moment.</string>
    <string name="kill_app">Press again to exit</string>
    <string name="loading_not_supported">Sorry, not supported yet</string>
    <string name="loading_title_tip">Prompt</string>
    <string name="loading_app_restart">Confirm to restart the App.</string>
    <string name="loading_log_out">Confirm logout?</string>
@@ -195,9 +195,9 @@
    <!--    图片上传       -->
    <string name="camera_album_file_get_fial">Failed to retrieve image</string>
    <string name="camera_album_system_fial">System failed to process image, please retry</string>
    <string name="apk_update_content">In order to upgrade the HDL APP normally, please click the Settings button to allow the installation of applications from unknown sources. This function is only available for APP upgrades. Android versions 11 and above need to be re-downloaded and installed after authorization.</string>
    <string name="apk_update_content">In order to upgrade the  APP successfully, please click the Settings button to allow the installation of applications from unknown sources. This function is only available for APP upgrades. Android versions 11 and above need to be re-downloaded and installed after authorization.</string>
    <string name="apk_update_sure">Settings</string>
    <string name="permission_open">Please authorize permission in settings</string>
    <string name="permission_open">Please go to Settings to enable permission</string>
    <string name="please_go_set_permissions">Please set permissions.</string>
@@ -248,63 +248,73 @@
    <string name="port_conflict">Application conflicts. You need to close onpro or other versions of debugging application and then restart the this to try</string>
    <string name="cancel_download_successfully">取消下载成功.</string>
    <string name="writing_firmware_upgrade_memory_succeeded">写入新固件文件到内存成功.</string>
    <string name="download_firmware_upgrade_file_failed">下载固件升级文件失败.</string>
    <string name="found_locally_firmware_upgrade_file">本地找不到升级固件文件,请下载好固件文件,再重新升级.</string>
    <string name="notify_gateway_firmware_upgrade_failed">通知给网关升级固件文件地址失败,无法升级.</string>
    <string name="local_service_fails">本地服务有异常失败,无法升级.</string>
    <string name="writing_drive_memory_succeeded">写入新驱动文件到内存成功.</string>
    <string name="download_drive_file_failed">下载驱动升级文件失败.</string>
    <string name="found_locally_drive_file">本地找不到升级驱动文件,请下载好驱动文件,再重新升级.</string>
    <string name="notify_gateway_drive_failed">通知给网关升级驱动文件地址失败,无法升级.</string>
    <string name="time_selectd">时间选择</string>
    <string name="life_cycle">生命期</string>
    <string name="year">年</string>
    <string name="month">月</string>
    <string name="day">日</string>
    <string name="hour">时</string>
    <string name="minutc">分</string>
    <string name="seconds">秒</string>
    <string name="the_query_date_is_exceeded">超出查询日期.</string>
    <string name="energy_generation_statistics">发电量统计</string>
    <string name="social_contribution">社会贡献</string>
    <string name="day_power_generation">当日发电量</string>
    <string name="month_power_generation">当月发电量</string>
    <string name="year_power_generation">当年发电量</string>
    <string name="cumulative_power_generation">累计发电量</string>
    <string name="generated_power">发电功率</string>
    <string name="generation">发电量</string>
    <string name="station_name">电站名称</string>
    <string name="search">搜索</string>
    <string name="history_search">历史搜索</string>
    <string name="search_content_null">搜索内容不能为空.</string>
    <string name="no_equipment">暂无设备.</string>
    <string name="filtering">筛选</string>
    <string name="reset">重置</string>
    <string name="string_capacity">组串容量</string>
    <string name="grid_connected_state">并网状态</string>
    <string name="grid_connected">并网</string>
    <string name="off_network">离网</string>
    <string name="the_input_value_has_been_exceeded">输入值已经超过</string>
    <string name="all_read">全部已读</string>
    <string name="contact_us">联系我们</string>
    <string name="wechat_id">微信号</string>
    <string name="email_address">邮箱地址</string>
    <string name="successful_replication">已复制到剪切板</string>
    <string name="to_be_added">待接入</string>
    <string name="saving_standard_coal">节约标准煤</string>
    <string name="co_reduction_rate">CO2减排</string>
    <string name="quantity_of_equivalent_values">等效植树量</string>
    <string name="pv_power">发电功率</string>
    <string name="device_run_state">设备运行状态</string>
    <string name="search_station">搜索电站</string>
    <string name="enter_the_device_sn_and_device_name">输入设备SN号/设备名称</string>
    <string name="enter_alarm_name">输入报警名称</string>
    <string name="device">设备</string>
    <string name="Offline_fault">离线有故障</string>
    <string name="active_power">有功功率</string>
    <string name="t">t</string>
    <string name="cancel_download_successfully">Cancel downloading successfully</string>
    <string name="writing_firmware_upgrade_memory_succeeded">write new firmware successfully</string>
    <string name="download_firmware_upgrade_file_failed">downloading new firmware failed</string>
    <string name="found_locally_firmware_upgrade_file">firmware upgrade file cannot be found locally, please download it and upgrade again</string>
    <string name="notify_gateway_firmware_upgrade_failed">Failed to notify the gateway of the firmware  upgrade address. upgrade failed</string>
    <string name="local_service_fails"> local service error, cannot be upgraded</string>
    <string name="writing_drive_memory_succeeded">write new drive file to flash successfully</string>
    <string name="download_drive_file_failed">downloading new drive file failed</string>
    <string name="found_locally_drive_file">drive upgrade file cannot be found locally, please download it and upgrade again</string>
    <string name="notify_gateway_drive_failed">Failed to notify the gateway of the drive  upgrade address. upgrade failed</string>
    <string name="time_selectd">Select</string>
    <string name="life_cycle">Lifetime</string>
    <string name="year">Year</string>
    <string name="month">Month</string>
    <string name="day">Day</string>
    <string name="hour">Hour</string>
    <string name="minutc">Minute</string>
    <string name="seconds">Second</string>
    <string name="the_query_date_is_exceeded">Out of query date</string>
    <string name="energy_generation_statistics">Enviromentail Benefits</string>
    <string name="social_contribution">Statistics</string>
    <string name="day_power_generation">Yield Today</string>
    <string name="month_power_generation">Yield this month</string>
    <string name="year_power_generation">Yield this year</string>
    <string name="cumulative_power_generation">Total yield</string>
    <string name="generated_power">Power generated</string>
    <string name="generation">Power Generation </string>
    <string name="station_name">Name</string>
    <string name="search">Search</string>
    <string name="history_search">Search history</string>
    <string name="search_content_null">Search content cannot be empty</string>
    <string name="no_equipment">No equipment!</string>
    <string name="filtering">Select</string>
    <string name="reset">Reset</string>
    <string name="string_capacity">String capacity</string>
    <string name="grid_connected_state">Grid-connected state</string>
    <string name="grid_connected">Grid-Tied</string>
    <string name="off_network">Off grid</string>
    <string name="the_input_value_has_been_exceeded">Input value exceeded</string>
    <string name="all_read">All  read</string>
    <string name="contact_us">contact us</string>
    <string name="wechat_id">Wechat ID</string>
    <string name="email_address">email address</string>
    <string name="successful_replication">Copied to clipboard</string>
    <string name="to_be_added">To be added</string>
    <string name="saving_standard_coal">Stanard Coal Saved</string>
    <string name="co_reduction_rate">CO2 Emission Saved</string>
    <string name="quantity_of_equivalent_values">Equivalent Trees Planted</string>
    <string name="pv_power">Generation capacity</string>
    <string name="device_run_state">equipment operational Status</string>
    <string name="search_station">Search Plants</string>
    <string name="enter_the_device_sn_and_device_name">Enter the device SN/device name</string>
    <string name="enter_alarm_name">Enter alarm name</string>
    <string name="device">Device</string>
    <string name="Offline_fault">Offline with fault</string>
    <string name="active_power">Active power</string>
    <string name="t">Ton</string>
    <string name="number"></string>
    <string name="device_off">Device Offline!</string>
    <string name="summarize">Summary</string>
    <string name="qr_code_business_card">QR Code</string>
    <string name="save_qr_code_successfully">Succeed to save QC code</string>
    <string name="failed_to_save_qr_code">failed to save QC code</string>
    <string name="staff_management">Staff Account management</string>
    <string name="alarm">alarm</string>
    <string name="add_power_station">Additional power station</string>
    <string name="add_power_station_failing">Adding power station failed</string>
    <string name="add_power_station_succeed">Adding the power station succeeded</string>
</resources>
app/src/main/res/values-zh/strings.xml
@@ -304,6 +304,16 @@
    <string name="active_power">有功功率</string>
    <string name="t">吨</string>
    <string name="number">棵</string>
    <string name="device_off">设备已离线!</string>
    <string name="summarize">概览</string>
    <string name="qr_code_business_card">二维码名片</string>
    <string name="save_qr_code_successfully">保存二维码成功.</string>
    <string name="failed_to_save_qr_code">保存二维码失败.</string>
    <string name="staff_management">员工管理</string>
    <string name="alarm">报警</string>
    <string name="add_power_station">添加电站</string>
    <string name="add_power_station_failing">添加电站失败.</string>
    <string name="add_power_station_succeed">添加电站成功.</string>
</resources>