ensign/src/main/java/com/yem/wm/es/Util/MaterialProperty.java
2024-08-27 14:23:51 +08:00

37 lines
1.3 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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:07
* @Description 根据物料编码获取物料属性结果集List<Map<String,Object>>
**/
public class MaterialProperty {
public final static String materialcode = "mater_code";
public final static String materialProperty = "property";
public static List<Map> materialWarehouse(Map<String,Object> map,Long id){
String sql = "select mater_code,property from VIEW_MATER_PRO_WM ";
long orgId = RequestContext.get().getOrgId();
String material = (String)map.get(materialcode);//物料编码
String property = (String)map.get(materialProperty);//物料属性
if(YEM.isEmpty(material)){
return new ArrayList<>();
}
StringBuffer where = new StringBuffer(String.format("where %s = '%s' ",materialcode,material));
if(YEM.isNotEmpty(property)){
where.append(String.format("and %s = '%s'",materialProperty,property));
}
sql = sql + where.toString();
List<Map> fromCmmp = RequestCmmp.getFromCmmp(orgId, sql,id);
return fromCmmp;
}
}