EAS_WEB获取传参,获取上下文,获取控制单元

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

 

posted @ 2024-05-27 09:40  凉了记忆  阅读(18)  评论(0编辑  收藏  举报