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 StudyFormUtil {
    private static final Logger logger = LoggerFactory.getLogger(StudyFormUtil.class.getName());
    private static HashMap<String,String> mapLang=new HashMap<>();
    static {
        mapLang.put("字段名","Field");
        mapLang.put("原值","Old Value");
        mapLang.put("新值","New Value");
        mapLang.put("原因","Reason");
        mapLang.put("生长情况","Growth Status");
        mapLang.put("新归属人","New Owner");
        mapLang.put("原归属人","Old Owner");
        mapLang.put("填入值","Input Data");
        mapLang.put("填写人","Data Entry Person");
        mapLang.put("更换归属人","Change Owner");
        mapLang.put("良好","Good");
        mapLang.put("中","Average");
        mapLang.put("差","Bad");
        mapLang.put("修改","Edit");
        mapLang.put("修改记录","Change Data");
        mapLang.put("填写","Fill in");
        mapLang.put("意见回复","Reply to Remark");
        mapLang.put("复核意见","Verification Remark");
        mapLang.put("免复核通过","Pass (no Verification Requirement)");
        mapLang.put("复核拒绝","Verification Reject");
        mapLang.put("复核通过","Verification Pass");
        mapLang.put("填写并提交记录","Create and Submit Record");
        mapLang.put("废止拒绝","Reject Record Abolition");
        mapLang.put("废止通过","Approve Record Abolition");
        mapLang.put("申请废止","Apply Abolition");
        mapLang.put("开始现场复核","Start on-Site Verification");
        mapLang.put("结束现场复核","End on-Site Verification");
        mapLang.put("申明协作","Declaration of Collaboration");
        mapLang.put("已审阅","Reviewed");
        mapLang.put("审核通过","Approved");
        mapLang.put("补充说明","Additional Remark");
        mapLang.put("审核拒绝","Reject after Review");
        mapLang.put("制作保存预制表单","Save Record Preset");
        mapLang.put("制作提交预制表单","Submit Record Preset");
        mapLang.put("创建记录","Create Record");
        mapLang.put("填写并保存记录","Create and Save Record");
        mapLang.put("申请关闭","Apply Close");
        mapLang.put("关闭拒绝","Close Reject");
        mapLang.put("关闭同意","Close Approve");


    }

    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;
    }

}
