package com.docus.server.gzzxyjh;

import com.alibaba.fastjson.JSON;
import com.docus.core.util.Func;
import com.docus.server.util.TableJsonRead;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wyb
 */
public class AssortConfig {
    private final static String CONFIG_FILE_PATH = "data-config";
    private final static String CONFIG_FILE_NAME = "gzzxyjh-pmrs-emrtype-alis";

    public static List<Config> getConfig() {
        TableJsonRead jsonReader = new TableJsonRead();
        String configJson = jsonReader.ReadContent(CONFIG_FILE_PATH, CONFIG_FILE_NAME);
        if (configJson == null) {
            return new ArrayList<>();
        }
        List<Config> configs = JSON.parseArray(configJson, Config.class);
        if (Func.isEmpty(configs)) {
            return new ArrayList<>();
        }
        return configs;
    }

    @Data
    public static class Config {
        private String emrTypeCode;
        private String assortId;
    }

    public static void main(String[] args)
    {
        List<Config> taskConfig = getConfig();
        System.out.println(taskConfig);
    }
}
