package com.sifang.modules.customer.utils;

import com.sifang.modules.customer.constant.PartnerConstants;

import java.math.BigInteger;
import java.util.HashMap;
import java.util.Map;

public class CustomerEntryUtil {

    private static final Map<String, String> statusMap = new HashMap<>();
    private static final Map<String, String> filingTypeMap = new HashMap<>();

    static {
        statusMap.put("0", "暂存");
        statusMap.put("1", "待审核");
        statusMap.put("2", "审核驳回");
        statusMap.put("3", "待下单");
        statusMap.put("5", "待安装验收");
        statusMap.put("f", "安装验收退回");
        statusMap.put("6", "待并网");
        statusMap.put("7", "待并网验收");
        statusMap.put("10", "验收驳回");
        statusMap.put("a", "已完成");
        statusMap.put("e", "待签署合同");
        statusMap.put("h", "勘测设计自审");
        statusMap.put("i", "安装自审");

        filingTypeMap.put("1", "农户备案");
        filingTypeMap.put("2", "项目公司备案");
    }

    public static String parseStatus(String status) {
        String s = statusMap.get(status);
        if (s == null) {
            return "--";
        }
        return s;
    }

    public static String parseFilingType(String filingType) {
        String s = filingTypeMap.get(filingType);
        if (s == null) {
            return "--";
        }
        return s;
    }

    public static String getJJPrefix(String partnerId) {
        switch (partnerId) {
            case PartnerConstants.PARTNER_ID_YX:
                return "NH";
            case PartnerConstants.PARTNER_ID_GF:
                return "NHGF";
            case PartnerConstants.PARTNER_ID_HR:
                return "NHHR";
            default:
                return "NHJJ";
        }
    }

    /**
     * 红太阳进件序号获取  位数补全在前面补零 处理
     * 0代表前面要补位的字符、7代表字符串的长度、d表示参数为整数类型
     */

    public static String addZero(String prefix,Long version){
        String s = String.format("%07d", version);
        return prefix+s;
    }

    public static String addZeroGF(Long version){
        String s = String.format("%07d", version);
        return "NHGF"+s;
    }

    /**
     * 结算基础价  获取方案编号
     */
    public static String addZero2(Long version){
        String s = String.format("%07d", version);
        return "JS"+s;
    }

    public static void main(String[] arr){
    }

}
