예제 #1
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();
     }
   }
 }
예제 #2
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();
     }
   }
 }
예제 #3
0
 public void Delete(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) {
   Table table = dataDom.getTable("YXDBJYMST");
   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();
     dataDom.refresh(sessionInfo);
     serviceRequest.getMessage().addInfo("删除数据成功");
   } catch (Exception e) {
     if (db != null) {
       db.rollback();
     }
     Log.error(e);
     serviceRequest.getMessage().addInfo("发生异常,请联系管理员");
   } finally {
     if (db != null) {
       db.cleanup();
     }
     dataDom.refresh(sessionInfo);
   }
   init(dataDom, sessionInfo, serviceRequest);
 }
예제 #4
0
  public void Delete(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) {
    Table table = dataDom.getTable("YXPBPFMST");
    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();
      serviceRequest.getMessage().addInfo("删除成功!");
    } catch (Exception e) {
      if (db != null) {
        db.rollback();
      }
      Log.error(e);
      serviceRequest.getMessage().addInfo("删除失败,请重试或联系系统管理员!");
    } finally {
      if (db != null) db.cleanup();
    }
  }
예제 #5
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();
      }
    }
  }
예제 #6
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();
     }
   }
 }
예제 #7
0
 public void rowSave(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest)
     throws Exception {
   Table table = dataDom.getTable("YXDBJYMST");
   String pkValue = table.getPkValue();
   if ((pkValue == null) || ("".equals(pkValue)) || ("-1".equals(pkValue)))
     serviceRequest.getMessage().addError("??????????????");
   else
     try {
       String tableName = serviceRequest.getParameter("tableName");
       super.save(tableName, dataDom, sessionInfo, serviceRequest);
     } catch (Exception e) {
       Log.error(e);
       serviceRequest.getMessage().addInfo("保存子表失败");
     }
 }
예제 #8
0
 public void initData(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) {
   Table table = dataDom.getRootTable();
   Row row = table.getRow(0L);
   if (row == null) {
     row = new Row(false, 0, 0, "new");
     table.addRow(row);
   }
   String pkValue = table.getPkValue();
   if ((pkValue == null) || ("".equals(pkValue)) || ("-1".equals(pkValue))) {
     String STA = table.getSafeRowColumnValue("DBJY_STA");
     if ("".equals(STA)) {
       table.getSafeRow().addColumn("DBJY_EXT01", sessionInfo.getUserId());
       table.setSafeRowColumnValue("DBJY_STA", "00");
     }
   }
 }
예제 #9
0
 public void DeleteAllSubTable(
     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("delete from YXPRJLIN where PRJ_NO = " + pk);
     db.commit();
   } catch (Exception ex) {
     db.rollback();
     Log.error(ex);
   } finally {
     if (db != null) {
       db.cleanup();
     }
   }
   setFirstRowSubTable(dataDom, sessionInfo, serviceRequest);
 }
예제 #10
0
 /**
  * 子表行记录保存 @Override
  *
  * @param dataDom DataDom
  * @param sessionInfo SessionInfo
  * @param serviceRequest ServiceRequest
  * @throws LiemsException
  */
 public void rowSave(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest)
     throws Exception {
   Table table = dataDom.getTable("YXPBPFLIN");
   String pkValue = table.getPkValue();
   if (null == pkValue || "".equals(pkValue) || "-1".equals(pkValue)) {
     serviceRequest.getMessage().addError("请先维护主信息!");
   } else {
     try {
       String tableName = serviceRequest.getParameter("tableName");
       Table childTable = dataDom.getTable(tableName);
       // 添加whereLimit的判断,这里目前不加任何过滤字段由研发人员自行添加
       if (null != childTable) {
         WhereLimit whereLimit = childTable.getWhereLimit();
         if (null == whereLimit) {
           whereLimit = new WhereLimit();
         }
         super.save(tableName, dataDom, sessionInfo, serviceRequest);
       }
     } catch (Exception e) {
       Log.error(e);
       serviceRequest.getMessage().addInfo("保存失败,请重试或联系系统管理员!");
     }
   }
 }