Example #1
1
  public void loadForm(JParamObject PO, EFFormDataModel formDataModel) {

    JConnection conn = null;
    JStatement stmt = null;
    Object object = null;
    try {
      conn = JConnection.getInstance(jdbcTemplate.getDataSource().getConnection());

      stmt = conn.createStatement();

      object =
          formServiceUtil.loadFormService(request, PO.GetValueByParamName(SYS_MODEL.SERVICE_ID));

      EMPComposeFormInfo formInfo = (EMPComposeFormInfo) object;
      pluginsMap = (HashMap) formInfo.getDataContainerStub().getRefCompStubMap();

      prepareSaveForm(PO, stmt, formDataModel);

      saveBillData(PO, stmt, formDataModel);

      finishSaveForm(PO, stmt, formDataModel);
    } catch (Exception ce) {
      ce.printStackTrace();
      formDataModel.setFormSaveMessage(ce.getCause().getMessage());
    } finally {
      closeAllResources(null, stmt, conn);
    }
  }
Example #2
0
  /**
   * 获取自列表的列与掩码的Map
   *
   * @param conn
   * @param PO
   * @param dictMetadata
   * @param DOMeta
   * @throws Exception
   */
  protected static java.util.Map getSelfEnumColViewMap(
      JConnection conn, JParamObject PO, DictMetadata dictMetadata) throws Exception {
    if (dictMetadata == null) {
      return null;
    }
    TableMetadata tableMetadata = dictMetadata.getTableMetadata();
    if (tableMetadata == null) {
      return null;
    }
    java.util.List colList = tableMetadata.getColList();
    if (colList == null) return null;

    // 获取各列的掩码
    java.util.Map map = new java.util.HashMap();
    String objid = tableMetadata.getString("OBJ_ID", "");
    Statement st = null;
    ResultSet rs = null;
    String sql = " select * from SYS_SELFENUM" + " where OBJ_ID='" + objid + "' order by COL_DISP";
    try {
      st = conn.createStatement();
      rs = st.executeQuery(sql);
      while (rs.next()) {
        String colid = rs.getString("COL_ID");
        String colval = rs.getString("COL_VAL");
        String colnote = rs.getString("F_NOTE");
        if (colval == null || colval.length() == 0) {
          colval = " ";
        }
        if (colnote == null || colnote.length() == 0) {
          colnote = colval;
        }
        String view = (String) map.get(colid);
        if (view == null) {
          map.put(colid, colval + ":" + colnote);
        } else {
          if (view.endsWith(";")) {
            view = view.substring(0, view.length() - 1);
          }
          map.put(colid, view + ";" + colval + ":" + colnote);
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      conn.BackStatement(st, rs);
    }
    return map;
  }
Example #3
0
 /** 取数据字典的自定义属性列表STUBOBJECT */
 private static List getDictCST(JConnection conn, JParamObject PO, String dctid) {
   java.util.List maps = new ArrayList();
   Statement stmt = null;
   try {
     stmt = conn.createStatement();
     HashMap map = new HashMap();
     map.put("TABLE", "SYS_DCT_CST");
     map.put("WHERE", "DCT_ID = '" + dctid + "'");
     map.put("ORDER", "UNIT_ID,DCT_KEY");
     maps.add(map);
     return DBUtils.SimpleQuery(conn, PO, maps, stmt);
   } catch (Exception ex) {
     ex.printStackTrace();
   } finally {
     conn.BackStatement(stmt, null);
   }
   return null;
 }