var imp=JavaImporter(); imp.importPackage(Packages.java.lang); imp.importPackage(Packages.org.apache.commons.lang3); imp.importPackage(Packages.com.kingdee.bos.webframework.context); imp.importPackage(Packages.com.kingdee.eas.util.app); imp.importPackage(Packages.com.kingdee.bos.webframework.json); imp.importPackage(Packages.java.util); with(imp){ var companyId = request.getParameter("companyId"); var ctx = WafContext.getInstance().getContext(); var cuId = ContextUtil.getCurrentCtrlUnit(ctx).getId().toString(); var sql = "select CFEXPENSETYPEID from CT_CW_Ysfylx where FCONTROLUNITID = '"+companyId+"'"; var rowSet = DbUtil.executeQuery(ctx, sql); var ysfylxList = new ArrayList(); while (rowSet.next()) { ysfylxList.add(rowSet.getString("CFEXPENSETYPEID")); } var hsql = "select CFEXPENSETYPEID from CT_CW_Hsfylx where FCONTROLUNITID ='"+companyId+"'"; var hsRowSet = DbUtil.executeQuery(ctx, hsql); var hsfylxList = new ArrayList(); while (hsRowSet.next()) { hsfylxList.add(hsRowSet.getString("CFEXPENSETYPEID")); } var rst = new HashMap(); rst.put("ysfylx",ysfylxList); rst.put("hsfylx",hsfylxList); JSONUtils.SUCCESS(rst); }
标签:传参,WEB,imp,ctx,rst,获取,var,Packages,importPackage From: https://www.cnblogs.com/ketoli/p/18214889