Exemplo n.º 1
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);
  }
Exemplo n.º 2
0
 /**
  * 初始化处理 @Override
  *
  * @param dataDom DataDom
  * @param sessionInfo SessionInfo
  * @param serviceRequest ServiceRequest
  */
 public void init(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) {
   super.init(dataDom, sessionInfo, serviceRequest);
   DataRule.setOrg(dataDom, sessionInfo, serviceRequest, "FINCWGWMST", "", true);
   Table table = dataDom.getRootTable();
   table.setOrderBy("FSTUSR_DTM@desc");
   table.refresh(dataDom.getProgramInfo().getProgramNo(), sessionInfo);
 }
Exemplo n.º 3
0
  public void init(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) {
    super.init(dataDom, sessionInfo, serviceRequest);
    DataRule.setOrg(dataDom, sessionInfo, serviceRequest, "YXDBJYMST", "", true);

    initSel(dataDom, sessionInfo);

    YXTools.initWhereLimit(dataDom, sessionInfo, serviceRequest);

    Table table = dataDom.getTable("YXDBJYMST");

    Orderby orderby1 = new Orderby("FSTUSR_DTM", "desc");
    table.clearOrderby();
    table.addOrderby(orderby1);

    table.refresh("B1YXM00200", sessionInfo);

    setReadOnly(dataDom);
    initData(dataDom, sessionInfo, serviceRequest);
  }
Exemplo n.º 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();
      }
    }
  }
Exemplo n.º 5
0
  public void save(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest)
      throws LiemsException {
    Table table = dataDom.getTable("YXDBJYMST");
    Table cTable = dataDom.getTable("YXDBJYLIN");
    Row currRow = table.getRow(0L);
    if (currRow == null) {
      table.addRow(new Row(false, 0, 0, "new"));
      currRow = table.getRow(0L);
    }

    currRow.setFirstLastUserInfo(sessionInfo.getUserId());
    String prjNo = currRow.getColumnValue("PRJ_NO");
    Database db = null;
    try {
      db = Tools.getDatabase(false);
      if (currRow.getDataStatus().equals("new")) {
        currRow.addColumn("ORG_NO", sessionInfo.getDefaultOrg());
        if ((currRow.getColumn("DBJY_ID") == null)
            || (currRow.getColumn("DBJY_ID").getValue() == null)
            || (currRow.getColumn("DBJY_ID").getValue().equals(""))) {
          CommCodeNumber KLTYPID =
              new CommCodeNumber("DBJY", sessionInfo.getCurrentLanguage(), sessionInfo.getUserId());
          currRow.addColumn(new Column("DBJY_ID", KLTYPID.getNextValue()));
        }
      } else if ((currRow.getDataStatus().equals("modified"))
          && (CheckDate.isPrjNoChange(dataDom, db))) {
        deleteChildTable(dataDom, sessionInfo, serviceRequest, db);
      }
      String isSplit = Database.getValue(db, "select IS_SPLIT from YXPRJMST where PRJ_NO=" + prjNo);
      if ((prjNo != null) && (!(prjNo.equals(""))) && (Integer.parseInt(prjNo) > 0)) {
        if ((isSplit.equals("Y"))
            && (CheckDate.isTableEmpty(
                "YXDBJYLIN", dataDom, db, "PRJ_NO=" + prjNo, currRow.getPkValue("DBJY_NO"))))
          initTBRTable(dataDom, prjNo, db);
        else if ((isSplit.equals("N"))
            && (CheckDate.isTableEmpty(
                "YXDBJYLIN", dataDom, db, "PRJ_NO=" + prjNo, currRow.getPkValue("DBJY_NO")))) {
          initNoSplitTbrTab(dataDom, prjNo, db);
        }
      }
      super.save(dataDom, sessionInfo, serviceRequest, db);
      String pkValue = dataDom.getRootTable().getPkValue();
      //
      String selString =
          "select PRJL_NO,dlf_sum from YXDBJYLIN where DBJY_NO="
              + pkValue
              + " and dlf_sum is not null";
      Rowset rs = db.getRS(selString);
      Vector<String> vc = new Vector<String>();
      while (rs.next()) {
        String PRJL_NO = rs.getString("PRJL_NO");
        String dlf_sum = Charset.nullToEmpty(rs.getString("dlf_sum"));
        if (!"".equals(dlf_sum)) {
          String upPrjInfoString =
              "update yxprjlin set DLFL_AMT="
                  + dlf_sum
                  + " where PRJ_NO="
                  + prjNo
                  + " and prjl_no="
                  + PRJL_NO;
          vc.add(upPrjInfoString);
        }
      }
      if (vc.size() > 0) {
        db.execSqlUpdateBatch(vc);
      }
      db.commit();
    } catch (Exception e) {
      db.rollback();
      table.refresh("B1YXM00200", sessionInfo);
      Log.error(e);
      serviceRequest.getMessage().addInfo("保存失败");
    } finally {
      if (db != null) {
        db.cleanup();
      }
    }
    initSel(dataDom, sessionInfo);
    dataDom.getChildTable().refresh("B1YXM00200", sessionInfo);
  }