package com.hxhq.business.utils.lang;

import com.hxhq.business.utils.JctUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author tanfei
 */
public class TemplateUtil {
    private static final Logger logger = LoggerFactory.getLogger(TemplateUtil.class.getName());
    private static HashMap<String,String> mapLang=new HashMap<>();
    static {
        mapLang.put("试验基本信息","Test Basic Information");
        mapLang.put("试验试剂信息","Test Reagent Information");
        mapLang.put("仪器使用信息","Instrument Usage Information");
        mapLang.put("存储条件","Storage Conditions");
        mapLang.put("操作步骤","Operation Steps");
        mapLang.put("备注","Remarks");

        mapLang.put("试验名称","Study Name");
        mapLang.put("试验编号","Study Number");
        mapLang.put("方法编号","Method Code");
        mapLang.put("版本号","Version Number");
        mapLang.put("试验配制条件","Study Configuration Conditions");
        mapLang.put("预填","Pre-Fill");
        mapLang.put("实际","Actual");
        mapLang.put("配置时间","Configuration Time");
        mapLang.put("开始时间","Start Time");
        mapLang.put("结束时间","End Time");
        mapLang.put("目标溶液名称","Target Solution Name");
        mapLang.put("目标溶液编号","Target Solution Code");
        mapLang.put("目标溶液预计浓度","Target Solution Expected Concentration");
        mapLang.put("目标溶液实际浓度","Target Solution Actual Concentration");
        mapLang.put("目标溶液预计体积","Target Solution Expected Volume");
        mapLang.put("目标溶液实际体积","Target Solution Actual Volume");
        mapLang.put("有效周期","Effective Period");
        mapLang.put("失效日","Expiry Date");
        mapLang.put("处理批编号","Analysis Batch Number");
        mapLang.put("容器材质","Container Material");
        mapLang.put("处理时间","Work Time");

        mapLang.put("试剂名称","Reagent Name");
        mapLang.put("编号","Code");
        mapLang.put("批号","Batch Number");
        mapLang.put("浓度/含量/纯度","Concentration/Content/Purity");
        mapLang.put("来源","Source");


        mapLang.put("仪器名称","Instrument Name");
        mapLang.put("仪器型号","Instrument Model");
        mapLang.put("仪器编号","Instrument Number");
        mapLang.put("下次测试/校准/检定日期","Next Test/Calibration/Verification Date");

        mapLang.put("给药剂量或组别","Administration Dose or Group");
        mapLang.put("配制浓度","Preparation Concentration");
        mapLang.put("配制体积","Preparation Volume");
        mapLang.put("其他","Other");
        mapLang.put("其他信息","Other Information");
        mapLang.put("单位","unit");

        mapLang.put("签名人","Signed By");
        mapLang.put("签名意义","Meaning of Signature");
        mapLang.put("签名时间","Date");
        mapLang.put("备注原因","Comment/Reason");



    }

    public static void main(String[] args) {
        Map<String, String> formData = new LinkedHashMap<>();
        formData.put("申请备注", "1111");
        formData.put("审核备注", "22");
        logger.info(getJcnrEn(formData));
    }
    /**
     * 获取英文
     * @param qmyy
     * @return
     */
    public static String getEn(String qmyy) {
        return   mapLang.get(qmyy);
    }

    /**
     * 获取稽查内容英文
     * @param map
     * @return
     */
    public static String getJcnrEn(Map<String, String> map) {
        Map<String, String> result =new LinkedHashMap<>();
        for (Map.Entry<String, String> entry : map.entrySet()) {
            result.put(mapLang.get(entry.getKey()),entry.getValue());
        }
        return JctUtil.formatStr(result);
    }

    /**
     * 获取稽查内容英文
     * @param map
     * @return
     */
    public static Map<String, String> getMapEn(Map<String, String> map) {
        Map<String, String> result =new LinkedHashMap<>();
        for (Map.Entry<String, String> entry : map.entrySet()) {
            result.put(mapLang.get(entry.getKey()),entry.getValue());
        }
        return result;
    }

}
