package com.wd.workoffice.ui.activity.mes.analysis;

import android.os.Bundle;
import android.widget.TextView;

import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.mesBean.AnalysisBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.ReportAnalysisBadAdapter;
import com.wd.workoffice.ui.adapter.ReportTopAdapter;
import com.wd.workoffice.util.WorkUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.disposables.Disposable;

/**
 * author : flexible
 * email : lgd19940421@163.com
 * github: https://github.com/FlexibleXd
 **/
public class MesAnalysisDetailActivity extends WorkToolBarActivity {
    @BindView(R.id.tv_code)
    TextView tvCode;
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.tv_pro_type)
    TextView tvProType;
    @BindView(R.id.tv_severity)
    TextView tvSeverity;
    @BindView(R.id.tv_detectability)
    TextView tvDetectability;
    @BindView(R.id.tv_effective)
    TextView tvEffective;
    @BindView(R.id.tv_main_reason)
    TextView tvMainReason;
    @BindView(R.id.tv_main_remark)
    TextView tvMainRemark;

    @Override
    protected void initView() {
        ButterKnife.bind(this);
    }


    @Override
    protected void initData() {
        AnalysisBean.ListBean info = JSON.parseObject(getIntent().getStringExtra("info"), AnalysisBean.ListBean.class);
        tvCode.setText(info.getDefectCode());
        tvName.setText(info.getDefectCode());
        tvProType.setText(WorkUtils.getClazzType(info.getProductClassType()));
        tvSeverity.setText(info.getSeverity()+"");
        tvEffective.setText(info.isEnable()?"有效":"无效");
        tvDetectability.setText(info.getDetectionValue());
        tvMainReason.setText(info.getMainCause());
        tvMainRemark.setText(info.getRemark());
    }


    @Override
    protected void initEvent() {
    }

    @Override
    protected int layoutId() {
        return R.layout.activity_analysis_detail;
    }

}
