package com.zztrapp.zztrapp.ui.index.activity;

import android.text.TextUtils;
import android.view.View;

import com.zztrapp.zztrapp.base.BaseActivity;
import com.zztrapp.zztrapp.bean.WrdkPageListBean;
import com.zztrapp.zztrapp.databinding.ActivityWrdkListDetailBinding;

/**
 * Describe 污染地块详情
 * Created by Bby on 2022/7/17
 * Email bby0856@163.com
 */
public class WrdkListDetailActivity extends BaseActivity {

    private int jumpType = 2;//1编辑 2查看详情
    private WrdkPageListBean.RecordsBean detail;

    private ActivityWrdkListDetailBinding binding;

    @Override
    public View getLayoutId() {
        return binding.getRoot();
    }

    @Override
    protected void initBinding() {
        binding = ActivityWrdkListDetailBinding.inflate(getLayoutInflater());
    }

    @Override
    protected void init() {
        binding.navView.navTitle.setText(getIntent().getStringExtra("navName"));
        binding.navView.navBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        detail = (WrdkPageListBean.RecordsBean) getIntent().getSerializableExtra("detail");

        binding.wrdkbm.setText(detail.getWrdkbm());
//        binding.tdsyqrqymc.setText(this.detail.get);
//        binding.tdsyqrtyshxxdm.setText(this.detail.get);
//        binding.qdtdsyqrq.setText(this.detail.get);
//        binding.qrtdsyqrqymc.setText(this.detail.get);
//        binding.qrtdsyqrtyshxxdm.setText(this.detail.get);
//        binding.xrdtdsyqr.setText(this.detail.get);
        binding.hylb.setText(detail.getHylb());
//        binding.xzydlx.setText(this.detail.get);
//        binding.dkwz.setText(this.detail.get);
//        binding.dkzdmj.setText(this.detail.get);
        binding.zbxsm.setText(detail.getZbsm());
        binding.zxjd.setText(String.valueOf(detail.getWrdkzxjd()));
        binding.zxwd.setText(String.valueOf(detail.getWrdkzxwd()));
//        binding.dkszfw.setText(detail.get);
//        binding.fddbr.setText(detail.get);
//        binding.lxr.setText(detail.get);
//        binding.dh.setText(detail.get);
//        binding.yb.setText(detail.get);
//        binding.dkytgh.setText(detail.get);
        //法理依据,新增时必填 1-《污染地块土壤环境管理办法》、《土壤污染防治法》和《工矿用地土壤环境管理办法》2-《土壤污染防治法》第67条（只备案） 3-省级条例或其他
        if (!TextUtils.isEmpty(detail.getFaliYiju())) {
            switch (Integer.parseInt(detail.getFaliYiju())) {//政策依据
                case 1:
                    binding.zcyj.setText("《污染地块土壤环境管理办法》");
                    break;
                case 2:
                    binding.zcyj.setText("《土壤污染防治法》第67条（只备案）");
                    break;
                case 3:
                    binding.zcyj.setText("省级条例或其他");
                    break;
            }
        }
        //涉及的专项工作,新增时必填 1-危险化学品搬迁 2-长江经济带整治 3-黄河流域整治 4-其他
        if (!TextUtils.isEmpty(detail.getGzlx())) {
            switch (Integer.parseInt(detail.getGzlx())) {//涉及的专项工作
                case 1:
                    binding.sjdzxgz.setText("危险化学品搬迁");
                    break;
                case 2:
                    binding.sjdzxgz.setText("长江经济带整治");
                    break;
                case 3:
                    binding.sjdzxgz.setText("黄河流域整治");
                    break;
                case 4:
                    binding.sjdzxgz.setText("其他Î");
                    break;
            }
        }
        //涉及的重点区域 1-长江经济带 2-黄河流域 3-粤港澳大湾区 4-其他
        if (!TextUtils.isEmpty(detail.getGzfw())) {
            switch (Integer.parseInt(detail.getGzfw())) {//涉及的重点区域
                case 1:
                    binding.sjdzdqy.setText("长江经济带");
                    break;
                case 2:
                    binding.sjdzdqy.setText("黄河流域");
                    break;
                case 3:
                    binding.sjdzdqy.setText("粤港澳大湾区");
                    break;
                case 4:
                    binding.sjdzdqy.setText("其他");
                    break;
            }
        }

    }

    @Override
    protected void initOnClick() {

    }
}