package com.casic.PgInterface.intelPlan.dto;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;

import java.util.List;

public class PgPlanParams {

    private List<PgPlanTask> pgPlanTaskList;

    public List<PgPlanTask> getPgPlanTaskList() {
        return pgPlanTaskList;
    }

    public void setPgPlanTaskList(List<PgPlanTask> pgPlanTaskList) {
        this.pgPlanTaskList = pgPlanTaskList;
    }

    public List<PgPlanTask> getPgPlanParamsByString(String paramsStr){

        try {
            String jsonString=String.valueOf(JSON.parse(paramsStr));
            PgPlanParams pgPlanParams = JSONObject.parseObject(jsonString, new TypeReference<PgPlanParams>() {});
            List<PgPlanTask> pgPlanTaskList = pgPlanParams.getPgPlanTaskList();
            return pgPlanTaskList;
        }
        catch(Exception ex){
            return null;
        }
    }

}