Example #1
0
 public void DeleteAllSubTable_FB(
     DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws Exception {
   Table table = dataDom.getTable("YXPRJMST");
   Database db = null;
   String pk = "";
   try {
     db = Tools.getDatabase(false);
     save(dataDom, sessionInfo, serviceRequest);
     serviceRequest.getMessage().clear();
     pk = table.getPkValue();
     if ((pk != null) && (!"".equals(pk))) {
       db.execSqlUpdate("delete from YXPRJLIN where IS_FB='Y' and PRJ_NO = " + pk);
     }
     db.commit();
     WhereLimit wr = new WhereLimit();
     wr.addColumn(new Column("PRJ_NO", pk));
     dataDom.getTable("YXPRJLIN").setWhereLimit(wr);
     dataDom.getTable("YXPRJLIN").refresh("B1YXM00030", sessionInfo);
   } catch (Exception ex) {
     if (db != null) {
       db.rollback();
     }
     Log.error(ex);
   } finally {
     if (db != null) {
       db.cleanup();
     }
   }
 }
Example #2
0
 public void clearDLFL_AMT(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest)
     throws Exception {
   Table table = dataDom.getTable("YXPRJMST");
   Database db = null;
   String pk = "";
   try {
     db = Tools.getDatabase(false);
     save(dataDom, sessionInfo, serviceRequest);
     serviceRequest.getMessage().clear();
     pk = table.getPkValue();
     db.execSqlUpdate("update YXPRJLIN set DLFL_AMT='' where PRJ_NO = " + pk);
     db.commit();
     pk = table.getPkValue();
     WhereLimit wr = new WhereLimit();
     wr.addColumn(new Column("PRJ_NO", pk));
     dataDom.getTable("YXPRJLIN").setWhereLimit(wr);
     dataDom.getTable("YXPRJLIN").refresh("B1YXM00030", sessionInfo);
   } catch (Exception ex) {
     db.rollback();
     Log.error(ex);
   } finally {
     if (db != null) {
       db.cleanup();
     }
   }
 }
Example #3
0
  public void init(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) {
    try {
      super.init(dataDom, sessionInfo, serviceRequest);
      String pkValue = dataDom.getTable("YXPBPFMST").getPkValue();
      Table table = dataDom.getTable("YXSWPFLIN");
      WhereLimit lw = new WhereLimit();
      if ((pkValue == null) || (pkValue.equals(""))) {
        pkValue = "-1";
      }
      lw.addColumn("PBPF_NO", pkValue);
      // 子表业务类型,B 商务评分,T 技术评分 Z 总报价评分,P 报价质量评分
      lw.addColumn("PBYS_TYP", "T");

      String PRJL_TYP = dataDom.getRootTable().getSafeRowColumnValue("PRJL_TYP");
      if (PRJL_TYP.equals("A")) {
        // 综合评分
        dataDom.getExtend().getSelect("evalSelector").setReadonly(true);
      } else {
        // 独立评分
        dataDom.getExtend().getSelect("evalSelector").setReadonly(false);
        // 初始化评委
        String prjNo = dataDom.getTable("YXPBPFMST").getSafeRow().getColumnValue("PRJ_NO");
        String prjlNo = dataDom.getTable("YXPBPFMST").getSafeRow().getColumnValue("PRJL_NO");
        if (!"".equals(prjNo)) {
          initEvalSelector(dataDom, prjlNo, prjNo);
        }
      }
      table.setWhereLimit(lw);
      table.refresh("B1YXM00173", sessionInfo);
    } catch (Exception e) {
      Log.error(e);
    }
    setReadOnly(dataDom);
  }
Example #4
0
  public void Delete(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) {
    Table table = dataDom.getTable("YXPRJMST");
    Row row = table.getRow(0L);
    if (row == null) {
      serviceRequest.getMessage().addInfo("没有需要删除的数据!");
      return;
    }
    String pkValue = table.getPkValue();
    if ((pkValue == null) || ("".equals(pkValue.trim()))) {
      serviceRequest.getMessage().addInfo("没有需要删除的数据!");
      return;
    }
    Database db = null;
    try {
      db = Tools.getDatabase(false);
      deleteChildTable(dataDom, sessionInfo, serviceRequest, db);
      super.Delete(dataDom, sessionInfo, serviceRequest, db);
      db.commit();

      String pk = table.getPkValue();
      table.refreshG(pk);

      pk = table.getPkValue();
      WhereLimit wl = new WhereLimit();
      wl.addColumn("new_sql_wherelimit", "PRJ_NO =" + pk);
      Log.info("PRJ_NO:" + pk);
      dataDom.getTable("YXPRJLIN").setWhereLimit(wl);
      dataDom.getTable("YXPRJLIN").refresh2("B1YXM00030", sessionInfo);
    } catch (Exception e) {
      if (db != null) {
        db.rollback();
      }
      Log.error(e);
      serviceRequest.getMessage().addInfo("删除失败,请重试或联系系统管理员!");
      table.refresh("B1YXM00030", sessionInfo);
      ;
    } finally {
      if (db != null) {
        db.cleanup();
      }
    }
  }
Example #5
0
 public void setFirstRowSubTable(
     DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws Exception {
   String ZB_ID = serviceRequest.getParameter("ZB_ID");
   String PRJ_NAM = serviceRequest.getParameter("PRJ_NAM");
   Table table = dataDom.getTable("YXPRJMST");
   Database db = null;
   String pk = "";
   try {
     db = Tools.getDatabase(false);
     pk = table.getPkValue();
     String nextPkValue = CommSequence.getInstance("YXPRJLIN_SEQ").getNextValue();
     db.execSqlUpdate(
         "insert into YXPRJLIN(PRJL_NO,PRJ_NO,PRJL_ID,PRJL_NAM,IS_FB) values( "
             + nextPkValue
             + ","
             + pk
             + ",'"
             + ZB_ID
             + "','"
             + PRJ_NAM
             + "','Y') ");
     db.commit();
     pk = table.getPkValue();
     WhereLimit wr = new WhereLimit();
     wr.addColumn(new Column("PRJ_NO", pk));
     dataDom.getTable("YXPRJLIN").setWhereLimit(wr);
     dataDom.getTable("YXPRJLIN").refresh("B1YXM00030", sessionInfo);
   } catch (Exception ex) {
     db.rollback();
     Log.error(ex);
   } finally {
     if (db != null) {
       db.cleanup();
     }
   }
 }