导航菜单

页面标题

页面副标题

爱心e站 v1.0.0 - EvaluateActivity.java 源代码

正在查看: 爱心e站 v1.0.0 应用的 EvaluateActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.newheyd.JZKFcanjiren.Activity;

import android.os.Bundle;
import android.widget.TextView;
import com.igexin.assist.sdk.AssistPushConsts;
import com.newheyd.JZKFcanjiren.BaseActivity;
import com.newheyd.JZKFcanjiren.Bean.RehabilitationTrainOrEffectEvaluationBean;
import com.newheyd.JZKFcanjiren.Bean.UserInfo;
import com.newheyd.JZKFcanjiren.MyApplication;
import com.newheyd.JZKFcanjiren.R;
import com.newheyd.JZKFcanjiren.Utils.DataUtil;
import com.newheyd.JZKFcanjiren.Utils.StastisticUtil;
import com.newheyd.JZKFcanjiren.Utils.ToastUtils;
import com.newheyd.JZKFcanjiren.Utils.locationUtil.LocationAddrUtil;
import com.newheyd.JZKFcanjiren.View.TitleView;
import com.newheyd.JZKFcanjiren.config.NewHYConfig;
import com.newheyd.JZKFcanjiren.model.BaseResult;
import com.newheyd.JZKFcanjiren.model.DataParser;
import com.newheyd.JZKFcanjiren.net.CommonDataListTask;
import com.newheyd.JZKFcanjiren.net.NewHYTask;
import com.newheyd.JZKFcanjiren.net.RequestServiceList;
import java.util.HashMap;

public class EvaluateActivity extends BaseActivity {
    private String id;
    private TitleView mTitleview;
    private TextView mTvClass;
    private TextView mTvEndDate;
    private TextView mTvEvaluateContent;
    private TextView mTvEvaluateDate;
    private TextView mTvEvaluateName;
    private TextView mTvIdcard;
    private TextView mTvName;
    private TextView mTvStartDate;
    private TextView mTvTeacher;
    private RehabilitationTrainOrEffectEvaluationBean rehabilitationTrainOrEffectEvaluationBean;
    private UserInfo userInfo = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_evaluate);
        super.onCreate(savedInstanceState);
        this.userInfo = MyApplication.getInstance().getUserInfo();
        getEvaluate();
        goStatistics();
    }

    public void goStatistics() {
        HashMap<String, String> map = LocationAddrUtil.getInstance().getLocationParam(this.mContext);
        StastisticUtil.getInstance().onEvent(this.mContext, "EvaluateActivity", map);
    }

    public void getEvaluate() {
        HashMap<String, String> params = new HashMap<>();
        params.put(AssistPushConsts.MSG_TYPE_TOKEN, this.userInfo == null ? "" : this.userInfo.getToken());
        params.put("id", this.id);
        NewHYTask task = new CommonDataListTask(RequestServiceList.SERVICE_VIEWEVALUATE, params, RehabilitationTrainOrEffectEvaluationBean.class);
        executeRequest(task);
    }

    @Override
    public void onResponseBefore(NewHYTask task) {
        switch (task.getService()) {
            case SERVICE_VIEWEVALUATE:
                showProgress(NewHYConfig.LOADING_HINT, false);
                break;
        }
    }

    @Override
    public void onResponseAfter(NewHYTask task) {
        switch (task.getService()) {
            case SERVICE_VIEWEVALUATE:
                cancleProgress();
                break;
        }
    }

    @Override
    public void onResponseSuccessful(NewHYTask task, BaseResult object) {
        switch (task.getService()) {
            case SERVICE_VIEWEVALUATE:
                DataParser<RehabilitationTrainOrEffectEvaluationBean> mResult = (DataParser) object;
                if (mResult.getObjects().size() != 0) {
                    this.rehabilitationTrainOrEffectEvaluationBean = mResult.getObjects().get(0);
                    freshData();
                    break;
                }
                break;
        }
    }

    public void freshData() {
        this.mTvName.setText(this.rehabilitationTrainOrEffectEvaluationBean.getName());
        this.mTvIdcard.setText(this.rehabilitationTrainOrEffectEvaluationBean.getCitizenId());
        this.mTvTeacher.setText(this.rehabilitationTrainOrEffectEvaluationBean.getServiceName());
        this.mTvClass.setText("");
        this.mTvStartDate.setText(DataUtil.formatDateOther(this.rehabilitationTrainOrEffectEvaluationBean.getStartDate()));
        this.mTvEndDate.setText(DataUtil.formatDateOther(this.rehabilitationTrainOrEffectEvaluationBean.getEndDate()));
        this.mTvEvaluateName.setText(this.rehabilitationTrainOrEffectEvaluationBean.getEvaluateName());
        this.mTvEvaluateDate.setText(DataUtil.formatDateOther(this.rehabilitationTrainOrEffectEvaluationBean.getEvaluateDate()));
        this.mTvEvaluateContent.setText(this.rehabilitationTrainOrEffectEvaluationBean.getEvaluateContent());
    }

    @Override
    public void onResponseError(NewHYTask task, BaseResult object) {
        switch (task.getService()) {
            case SERVICE_VIEWEVALUATE:
                ToastUtils.showShortToast(this.mContext, object.getMsg());
                break;
        }
    }

    @Override
    public void onServerError(NewHYTask task, int failedType) {
        switch (task.getService()) {
            case SERVICE_VIEWEVALUATE:
                onResultShow(failedType);
                break;
        }
    }

    @Override
    public void getExtraParam() {
        this.id = getIntent().getStringExtra("id");
    }

    @Override
    public void initViews() {
        this.mTitleview = (TitleView) findViewById(R.id.titleview);
        this.mTvName = (TextView) findViewById(R.id.tv_name);
        this.mTvIdcard = (TextView) findViewById(R.id.tv_idcard);
        this.mTvTeacher = (TextView) findViewById(R.id.tv_teacher);
        this.mTvClass = (TextView) findViewById(R.id.tv_class);
        this.mTvStartDate = (TextView) findViewById(R.id.tv_start_date);
        this.mTvEndDate = (TextView) findViewById(R.id.tv_end_date);
        this.mTvEvaluateName = (TextView) findViewById(R.id.tv_evaluate_name);
        this.mTvEvaluateDate = (TextView) findViewById(R.id.tv_evaluate_date);
        this.mTvEvaluateContent = (TextView) findViewById(R.id.tv_evaluate_content);
    }

    @Override
    public void setListener() {
        this.mTitleview.setOnTitleClik(new TitleView.BackListenner() {
            @Override
            public void BackSet() {
                EvaluateActivity.this.finish();
            }
        }, null);
    }
}