package com.yem.wm.es.Util;

import com.yem.wm.utils.RequestCmmp;
import com.yem.wm.utils.YEM;
import kd.bos.context.RequestContext;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author xwudd
 * @date 11:34
 * @Description
 **/
public class QualityUserInfo {
    public final static String materialCode = "mater_code";
    public final static String qualityUserCode = "checker_code";//质检员编码
    public final static String qualityUserName = "checker_name";//质检员名称

    public static List<Map> qualityInfo(Map<String,Object> map,Long id){
        String sql = "select mater_code,checker_code,checker_name from "+ViewInterfaceDocking.QUALITY_USER_INFO+" ";
        long orgId = RequestContext.get().getOrgId();
        String material = (String)map.get(materialCode);//物料编码
        if(YEM.isEmpty(material)){
            return new ArrayList<>();
        }
        StringBuffer where = new StringBuffer(String.format("where %s = '%s'",materialCode,material));
        sql = sql + where;
        List<Map> fromCmmp = RequestCmmp.getFromCmmp(orgId, sql,id);
        return fromCmmp;
    }
}
