package com.ningdatech.pmapi.dashboard.helper;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.dashboard.constant.AnalysisBasicConstant;
import com.ningdatech.pmapi.sys.model.entity.Region;
import com.ningdatech.pmapi.sys.service.IRegionService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

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

/**
 * @author liuxinxin
 * @date 2023/8/3 下午3:13
 */

@Component
@RequiredArgsConstructor
public class DashboardHelper {

    private final IRegionService iRegionService;

    /**
     * 获取丽水区域相关信息
     */
    public Map<String, String> getLiShuiRegionCodeNameMap() {
        List<Region> regionList = iRegionService.list(Wrappers.lambdaQuery(Region.class)
                .eq(Region::getParentCode, AnalysisBasicConstant.LS_REGION_CODE));
        Map<String, String> regionCodeNameMap = regionList.stream().collect(Collectors.toMap(Region::getRegionCode, Region::getRegionName));
        return regionCodeNameMap;
    }

    /**
     * 获取增补情况键值表
     */
    public Map<Integer, String> getTemporaryAugmentMap() {
//        0:否 1:是
        Map<Integer, String> map = new HashMap<>();
        map.put(1, "增补项目");
        map.put(0, "非增补项目");
        return map;
    }


    /**
     * 获取项目类型键值表
     */
    public Map<Integer, String> getProjectTypeMap() {
        // "项目类型 1:建设 2:运维
        Map<Integer, String> map = new HashMap<>();
        map.put(1, "建设");
        map.put(2, "运维");
        return map;
    }

    /**
     * 获取项目类型键值表
     */
    public Map<Integer, String> getBizDomainMap() {
        // 综合业务领域 1: '党政机关整体智治',2: '数字政府',3: '数字经济',4: '数字社会',7: '数字文化',5: '数字法治',6: '一体化智能化公共数据平台', 8: '基层智治'
        Map<Integer, String> map = new HashMap<>();
        map.put(1, "党政机关整体智治");
        map.put(2, "数字政府");
        map.put(3, "数字经济");
        map.put(4, "数字社会");
        map.put(5, "数字文化");
        map.put(6, "数字法治");
        map.put(7, "一体化智能化公共数据平台");
        map.put(8, "基层智治");
        return map;
    }


}
