package com.liang.common.config;


import com.liang.common.constants.CommonConstant;
import com.liang.common.utils.SpringUtil;
import com.liang.dao.BaseProjectbudgetDao;
import com.liang.vo.dto.Ndysbm;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import static com.liang.common.config.SFTYProperties.PREFIX;

@Component
@ConfigurationProperties(PREFIX)
@Data
@NoArgsConstructor
@Slf4j
public class SFTYProperties {
    static Map<String, Map<String, String>> NDYSBM = new HashMap<>();

/*    static {
        BaseProjectbudgetDao baseProjectbudgetDao = SpringUtil.getBean("baseProjectbudgetDao");

        List<Ndysbm> ndysbms = baseProjectbudgetDao.getNDYSBM();
        Map<String, List<Ndysbm>> collect = ndysbms.stream().collect(Collectors.groupingBy(Ndysbm::getXmlx));
        collect.forEach((k, v) -> {
            Map<String, String> bm = new HashMap<>();
            v.forEach(item -> {
                bm.put(item.getMc(), item.getBm());
            });
            NDYSBM.put(k, bm);
        });
        log.info("============NDYSBM 初始化成功 :{}================", NDYSBM);
    }*/

/*    public static String getNDYSBM(String xmlx,String bmmc) {
        Map<String, String> map = NDYSBM.get(xmlx);
        return map.get(bmmc);
    }*/

    public static final String PREFIX = "sfty";

    private String uploadFilePath;

    private String initPassword;


}
