SAP单例
/**
*
* @Description: 获取物料描述信息
* @param itemRef
* @return
* @throws Exception
*/
@WebMethod
public String getItemInfos(@WebParam(name = "itemRef") String itemRef) throws Exception {
DataCoreServiceInterface dataCoreService = Services.getService("com.sapdev.service", "DataCoreService", "1000");
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(" SELECT I.DESCRIPTION ");
stringBuffer.append(" FROM WIP.ITEM I WHERE I.CURRENT_REVISION = 'true' AND I.SITE = '1000' AND I.ITEM = '" + itemRef + "'");
List<Map<String, Object>> itemInfos = dataCoreService.getResultByTSQL(stringBuffer.toString(), new HashMap<String, Object>());
JSONObject jsonObject = new JSONObject();
if (!itemInfos.isEmpty()) {
jsonObject.put("ITEM_DESCRIPTION", itemInfos.get(0).get("DESCRIPTION"));
} else {
jsonObject.put("ITEM_DESCRIPTION", "");
}
return jsonObject.toString();
}