Beispiel #1
0
 public static List findAll(String status) throws CDealException {
   String query = "from TJxDckPerformance po where 1=1";
   try {
     if (status != null) {
       query += " and po.zt = ? order by po.pxh";
       return CHibernateUtil.find(query, new Object[] {status});
     } else {
       return CHibernateUtil.find(query);
     }
   } catch (Exception e) {
     throw new CDealException("进行查询时失败。", e);
   }
 }
Beispiel #2
0
 public static void update(TJxDckPerformance po) throws CDealException {
   try {
     CHibernateUtil.updateObject(po);
   } catch (Exception e) {
     throw new CDealException("执行更新" + mModuleName + "时失败。", e);
   }
 }
Beispiel #3
0
 public static TJxDckPerformance get(String strId) throws CDealException {
   try {
     return (TJxDckPerformance) CHibernateUtil.load(TJxDckPerformance.class, strId);
   } catch (Exception e) {
     throw new CDealException("删除数据(编号" + strId + ")失败," + e.getMessage(), e);
   }
 }
Beispiel #4
0
 /**
  * 处理删除
  *
  * @param actionForm ActionForm 表单From
  * @param request HttpServletRequest Web请求
  * @param response HttpServletResponse Web结果
  * @throws CDealException 处理异常
  */
 public static void doDel(
     EditForm pWebForm, HttpServletRequest request, HttpServletResponse response)
     throws CDealException {
   try {
     TPubFlfggl aPoBean = webForm2PoForm(pWebForm); // 将页面的Form的数据拷内到实体对象
     CHibernateUtil.deleteObject(aPoBean); // 调用 PO 层进行删除
   } catch (Exception e) {
     throw new CDealException("执行删除" + mModuleName + "时失败。", e);
   }
 }
Beispiel #5
0
  /**
   * 设置进入修改页面的初始值
   *
   * @param actionForm ActionForm 表单From
   * @param request HttpServletRequest Web请求
   * @param response HttpServletResponse Web结果
   * @throws CDealException 处理异常
   */
  public static void setEditDefault(
      EditForm pWebForm, HttpServletRequest request, HttpServletResponse response)
      throws CDealException {
    try {
      Connection mConn = null;
      PreparedStatement pstmt = null;

      try {
        // 设置进入修改页面的初始值SQL
        String YWLSH = pWebForm.getYWLSH(); // 设置业务流水号
        pWebForm.setYWLSH(YWLSH);

        // 设置异常已查看标志 开始
        TJcXzxkBusiindex busindexpo =
            (TJcXzxkBusiindex) CHibernateUtil.load(TJcXzxkBusiindex.class, YWLSH);
        busindexpo.setYccheck("Y");
        CHibernateUtil.updateObject(busindexpo);
        // 设置异常已查看标志 结束

      } catch (Exception e) {
        throw e;
      } finally {
        if (pstmt != null)
          try {
            pstmt.close();
          } catch (Exception e) {
          }
        ;
        if (mConn != null)
          try {
            mConn.close();
          } catch (Exception e) {
          }
        ;
      }
    } catch (Exception e) {
      throw new CDealException("进入修改" + mModuleName + "时失败。", e);
    }
  }
Beispiel #6
0
  public static FlowInfoObj getFlowInfoObj(String pPlanID) throws Exception {
    try {
      FlowInfoObj mFlowInfoObj = new FlowInfoObj();
      // 政府采购计划
      String mSql = "from TYwZfcgPurchasePlan t where t.PLANID='" + pPlanID + "'";
      Iterator it = CHibernateUtil.selectObject(mSql).iterator();
      if (it.hasNext()) {
        mFlowInfoObj.setTYwZfcgPurchasePlan((TYwZfcgPurchasePlan) it.next());
        mFlowInfoObj.setPurchasePlanTabName("<b>政府采购计划</b>");
        TYwZfcgPurchasePlan aTYwZfcgPurchasePlan = mFlowInfoObj.getTYwZfcgPurchasePlan();
        aTYwZfcgPurchasePlan.setPURCHASETYPE_VALUE(
            (String)
                CCodeMap.getMapByType("政府采购类别").get("" + aTYwZfcgPurchasePlan.getPURCHASETYPE()));
        aTYwZfcgPurchasePlan.setMONEYFROM_VALUE(
            (String)
                CCodeMap.getMapByType("政府采购资金来源").get("" + aTYwZfcgPurchasePlan.getMONEYFROM()));
        aTYwZfcgPurchasePlan.setPURCHASEDEPARTID_VALUE(
            (String)
                CCodeMap.getMapByType("政府采购的采购单位列表")
                    .get("" + aTYwZfcgPurchasePlan.getPURCHASEDEPARTID()));
        aTYwZfcgPurchasePlan.setNETFLAG_VALUE(
            (String) CCodeMap.getMapByType("网络标记").get("" + aTYwZfcgPurchasePlan.getNETFLAG()));
        aTYwZfcgPurchasePlan.setINPUTMODE_VALUE(
            (String)
                CCodeMap.getMapByType("政府采购的录入方式").get("" + aTYwZfcgPurchasePlan.getINPUTMODE()));
        aTYwZfcgPurchasePlan.setSPARE1("1"); // 利用备用字段作为标志,表示该表有数据
      } else {
        mFlowInfoObj.setPurchasePlanTabName("<font color=" + TABNAMECOLOR + ">政府采购计划</font>");
      }
      // 招标公告
      mSql = "from TYwZfcgProclaim t where t.PLANID='" + pPlanID + "'";
      it = CHibernateUtil.selectObject(mSql).iterator();
      if (it.hasNext()) {
        mFlowInfoObj.setTYwZfcgProclaim((TYwZfcgProclaim) it.next());
        mFlowInfoObj.setProclaimTabName("<b>招标公告</b>");
        TYwZfcgProclaim aTYwZfcgProclaim = mFlowInfoObj.getTYwZfcgProclaim();
        aTYwZfcgProclaim.setTHROWMOTHED_VALUE(
            (String) CCodeMap.getMapByType("政府采购招标方式").get("" + aTYwZfcgProclaim.getTHROWMOTHED()));
        aTYwZfcgProclaim.setSENDMARKMOTHED_VALUE(
            (String)
                CCodeMap.getMapByType("政府采购提交投标文件方式")
                    .get("" + aTYwZfcgProclaim.getSENDMARKMOTHED()));
        aTYwZfcgProclaim.setNETFLAG_VALUE(
            (String) CCodeMap.getMapByType("网络标记").get("" + aTYwZfcgProclaim.getNETFLAG()));
        aTYwZfcgProclaim.setINPUTMODE_VALUE(
            (String) CCodeMap.getMapByType("政府采购的录入方式").get("" + aTYwZfcgProclaim.getINPUTMODE()));
        aTYwZfcgProclaim.setSPARE1("1"); // 利用备用字段作为标志,表示该表有数据
        // 把Timestamp数型转换成String来显示
        if (isNotNull(aTYwZfcgProclaim.getISSUETIME()))
          aTYwZfcgProclaim.setISSUETIME_str(
              aTYwZfcgProclaim.getISSUETIME().toString().substring(0, 10));
        if (isNotNull(aTYwZfcgProclaim.getOPENMARKTIME()))
          aTYwZfcgProclaim.setOPENMARKTIME_str(
              aTYwZfcgProclaim.getOPENMARKTIME().toString().substring(0, 10));
        if (isNotNull(aTYwZfcgProclaim.getJUDGEMARKTIME()))
          aTYwZfcgProclaim.setJUDGEMARKTIME_str(
              aTYwZfcgProclaim.getJUDGEMARKTIME().toString().substring(0, 10));
        if (isNotNull(aTYwZfcgProclaim.getSTARTTHROWTIME()))
          aTYwZfcgProclaim.setSTARTTHROWTIME_str(
              aTYwZfcgProclaim.getSTARTTHROWTIME().toString().substring(0, 10));
        if (isNotNull(aTYwZfcgProclaim.getENDTHROWTIME()))
          aTYwZfcgProclaim.setENDTHROWTIME_str(
              aTYwZfcgProclaim.getENDTHROWTIME().toString().substring(0, 10));
      } else {
        mFlowInfoObj.setProclaimTabName("<font color=" + TABNAMECOLOR + ">招标公告</font>");
      }
      // 投标
      mSql = "from TYwZfcgCastmark t where t.PLANID='" + pPlanID + "'";
      it = CHibernateUtil.selectObject(mSql).iterator();
      if (it.hasNext()) {
        mFlowInfoObj.setTYwZfcgCastmark((TYwZfcgCastmark) it.next());
        mFlowInfoObj.setCastmarkTabName("<b>投标</b>");
        TYwZfcgCastmark aTYwZfcgCastmark = mFlowInfoObj.getTYwZfcgCastmark();
        aTYwZfcgCastmark.setNETFLAG_VALUE(
            (String) CCodeMap.getMapByType("网络标记").get("" + aTYwZfcgCastmark.getNETFLAG()));
        aTYwZfcgCastmark.setINPUTMODE_VALUE(
            (String) CCodeMap.getMapByType("政府采购的录入方式").get("" + aTYwZfcgCastmark.getINPUTMODE()));
        aTYwZfcgCastmark.setSPARE1("1"); // 利用备用字段作为标志,表示该表有数据
        // 把Timestamp数型转换成String来显示
        if (isNotNull(aTYwZfcgCastmark.getSTARTMARKTIME()))
          aTYwZfcgCastmark.setSTARTMARKTIME_str(
              aTYwZfcgCastmark.getSTARTMARKTIME().toString().substring(0, 10));
        if (isNotNull(aTYwZfcgCastmark.getENDMARKTIME()))
          aTYwZfcgCastmark.setENDMARKTIME_str(
              aTYwZfcgCastmark.getENDMARKTIME().toString().substring(0, 10));
      } else {
        mFlowInfoObj.setCastmarkTabName("<font color=" + TABNAMECOLOR + ">投标</font>");
      }
      // 开标评标
      mSql = "from TYwZfcgOpenandjudge t where t.PLANID='" + pPlanID + "'";
      it = CHibernateUtil.selectObject(mSql).iterator();
      if (it.hasNext()) {
        mFlowInfoObj.setTYwZfcgOpenandjudge((TYwZfcgOpenandjudge) it.next());
        mFlowInfoObj.setOpenandjudgeTabName("<b>开标评标</b>");
        TYwZfcgOpenandjudge aTYwZfcgOpenandjudge = mFlowInfoObj.getTYwZfcgOpenandjudge();
        aTYwZfcgOpenandjudge.setJUDGEMARKMOTHED_VALUE(
            (String)
                CCodeMap.getMapByType("政府采购评标方法")
                    .get("" + aTYwZfcgOpenandjudge.getJUDGEMARKMOTHED()));
        aTYwZfcgOpenandjudge.setNETFLAG_VALUE(
            (String) CCodeMap.getMapByType("网络标记").get("" + aTYwZfcgOpenandjudge.getNETFLAG()));
        aTYwZfcgOpenandjudge.setINPUTMODE_VALUE(
            (String)
                CCodeMap.getMapByType("政府采购的录入方式").get("" + aTYwZfcgOpenandjudge.getINPUTMODE()));
        aTYwZfcgOpenandjudge.setSPARE1("1"); // 利用备用字段作为标志,表示该表有数据
      } else {
        mFlowInfoObj.setOpenandjudgeTabName("<font color=" + TABNAMECOLOR + ">开标评标</font>");
      }
      // 中标结果
      mSql = "from TYwZfcgBidresult t where t.PLANID='" + pPlanID + "'";
      it = CHibernateUtil.selectObject(mSql).iterator();
      if (it.hasNext()) {
        mFlowInfoObj.setTYwZfcgBidresult((TYwZfcgBidresult) it.next());
        mFlowInfoObj.setBidresultTabName("<b>中标结果</b>");
        TYwZfcgBidresult aTYwZfcgBidresult = mFlowInfoObj.getTYwZfcgBidresult();
        aTYwZfcgBidresult.setBIDDEPARTID_VALUE(
            (String)
                CCodeMap.getMapByType("政府采购的供应商列表").get("" + aTYwZfcgBidresult.getBIDDEPARTID()));
        aTYwZfcgBidresult.setNETFLAG_VALUE(
            (String) CCodeMap.getMapByType("网络标记").get("" + aTYwZfcgBidresult.getNETFLAG()));
        aTYwZfcgBidresult.setINPUTMODE_VALUE(
            (String) CCodeMap.getMapByType("政府采购的录入方式").get("" + aTYwZfcgBidresult.getINPUTMODE()));
        aTYwZfcgBidresult.setSPARE1("1"); // 利用备用字段作为标志,表示该表有数据
        // 把Timestamp数型转换成String来显示
        if (aTYwZfcgBidresult.getBIDTIME() != null)
          aTYwZfcgBidresult.setBIDTIME_str(
              aTYwZfcgBidresult.getBIDTIME().toString().substring(0, 10));
        if (isNotNull(aTYwZfcgBidresult.getBIDINFORMTIME()))
          aTYwZfcgBidresult.setBIDINFORMTIME_str(
              aTYwZfcgBidresult.getBIDINFORMTIME().toString().substring(0, 10));
      } else {
        mFlowInfoObj.setBidresultTabName("<font color=" + TABNAMECOLOR + ">中标结果</font>");
      }
      // 签订合同
      mSql = "from TYwZfcgSigncontract t where t.PLANID='" + pPlanID + "'";
      it = CHibernateUtil.selectObject(mSql).iterator();
      if (it.hasNext()) {
        mFlowInfoObj.setTYwZfcgSigncontract((TYwZfcgSigncontract) it.next());
        mFlowInfoObj.setSigncontractTabName("<b>签订合同</b>");
        TYwZfcgSigncontract aTYwZfcgSigncontract = mFlowInfoObj.getTYwZfcgSigncontract();
        aTYwZfcgSigncontract.setBIDDEPARTID_VALUE(
            (String)
                CCodeMap.getMapByType("政府采购的供应商列表")
                    .get("" + aTYwZfcgSigncontract.getBIDDEPARTID()));
        aTYwZfcgSigncontract.setNETFLAG_VALUE(
            (String) CCodeMap.getMapByType("网络标记").get("" + aTYwZfcgSigncontract.getNETFLAG()));
        aTYwZfcgSigncontract.setINPUTMODE_VALUE(
            (String)
                CCodeMap.getMapByType("政府采购的录入方式").get("" + aTYwZfcgSigncontract.getINPUTMODE()));
        aTYwZfcgSigncontract.setSPARE1("1"); // 利用备用字段作为标志,表示该表有数据
        // 把Timestamp数型转换成String来显示
        if (isNotNull(aTYwZfcgSigncontract.getSIGNCONTRACTTIME()))
          aTYwZfcgSigncontract.setSIGNCONTRACTTIME_str(
              aTYwZfcgSigncontract.getSIGNCONTRACTTIME().toString().substring(0, 10));
      } else {
        mFlowInfoObj.setSigncontractTabName("<font color=" + TABNAMECOLOR + ">签订合同</font>");
      }
      // 付款
      mSql = "from TYZfcgPaymoney t where t.PLANID='" + pPlanID + "'";
      it = CHibernateUtil.selectObject(mSql).iterator();
      if (it.hasNext()) {
        mFlowInfoObj.setPaymoneyTabName("<b>付款</b>");
        TYZfcgPaymoney aTYZfcgPaymoney = (TYZfcgPaymoney) it.next();
        mFlowInfoObj.getTYZfcgPaymoneyList().add(aTYZfcgPaymoney);
        aTYZfcgPaymoney.setPAYTYPE_VALUE(
            (String) CCodeMap.getMapByType("政府采购付款类型").get("" + aTYZfcgPaymoney.getPAYTYPE()));
        aTYZfcgPaymoney.setNETFLAG_VALUE(
            (String) CCodeMap.getMapByType("网络标记").get("" + aTYZfcgPaymoney.getNETFLAG()));
        aTYZfcgPaymoney.setINPUTMODE_VALUE(
            (String) CCodeMap.getMapByType("政府采购的录入方式").get("" + aTYZfcgPaymoney.getINPUTMODE()));
        aTYZfcgPaymoney.setSUPPLYID(
            (String) CCodeMap.getMapByType("政府采购的供应商列表").get("" + aTYZfcgPaymoney.getSUPPLYID()));
        aTYZfcgPaymoney.setSPARE1("1"); // 利用备用字段作为标志,表示该表有数据
        while (it.hasNext()) {
          aTYZfcgPaymoney = (TYZfcgPaymoney) it.next();
          mFlowInfoObj.getTYZfcgPaymoneyList().add(aTYZfcgPaymoney);
          aTYZfcgPaymoney.setPAYTYPE_VALUE(
              (String) CCodeMap.getMapByType("政府采购付款类型").get("" + aTYZfcgPaymoney.getPAYTYPE()));
          aTYZfcgPaymoney.setNETFLAG_VALUE(
              (String) CCodeMap.getMapByType("网络标记").get("" + aTYZfcgPaymoney.getNETFLAG()));
          aTYZfcgPaymoney.setINPUTMODE_VALUE(
              (String) CCodeMap.getMapByType("政府采购的录入方式").get("" + aTYZfcgPaymoney.getINPUTMODE()));
          aTYZfcgPaymoney.setSUPPLYID(
              (String) CCodeMap.getMapByType("政府采购的供应商列表").get("" + aTYZfcgPaymoney.getSUPPLYID()));
        }
      } else {
        mFlowInfoObj.setPaymoneyTabName("<font color=" + TABNAMECOLOR + ">付款</font>");
      }
      // 归档
      mSql = "from TYwZfcgArchive t where t.PLANID='" + pPlanID + "'";
      it = CHibernateUtil.selectObject(mSql).iterator();
      if (it.hasNext()) {
        mFlowInfoObj.setTYwZfcgArchive((TYwZfcgArchive) it.next());
        mFlowInfoObj.setArchiveTabName("<b>归档</b>");
        TYwZfcgArchive aTYwZfcgArchive = mFlowInfoObj.getTYwZfcgArchive();
        aTYwZfcgArchive.setNETFLAG_VALUE(
            (String) CCodeMap.getMapByType("网络标记").get("" + aTYwZfcgArchive.getNETFLAG()));
        aTYwZfcgArchive.setINPUTMODE_VALUE(
            (String) CCodeMap.getMapByType("政府采购的录入方式").get("" + aTYwZfcgArchive.getINPUTMODE()));
        aTYwZfcgArchive.setSPARE1("1"); // 利用备用字段作为标志,表示该表有数据
        aTYwZfcgArchive.setARCHIVETIME_str(
            aTYwZfcgArchive.getARCHIVETIME().toString().substring(0, 10));
      } else {
        mFlowInfoObj.setArchiveTabName("<font color=" + TABNAMECOLOR + ">归档</font>");
      }
      // 投标单位
      mFlowInfoObj.setSupplyTabName("<font color=" + TABNAMECOLOR + ">投标单位</font>");
      mSql = "from TYwZfcgCastsupply t where t.PLANID='" + pPlanID + "'";
      it = CHibernateUtil.selectObject(mSql).iterator();
      while (it.hasNext()) {
        mFlowInfoObj.setSupplyTabName("<b>投标单位</b>");
        mFlowInfoObj.getTYwZfcgArchive().setSPARE2("1"); // 利用归档的备用字段确作为标志,表示投标单位表有数据
        TYwZfcgCastsupply aTYwZfcgCastsupply = (TYwZfcgCastsupply) it.next();
        mSql = "from TYwZfcgSupply t where t.SUPPLYID='" + aTYwZfcgCastsupply.getSUPPLYID() + "'";
        Iterator innerIt = CHibernateUtil.selectObject(mSql).iterator();
        if (innerIt.hasNext()) {
          TYwZfcgSupply aTYwZfcgSupply = (TYwZfcgSupply) innerIt.next();
          mFlowInfoObj.getTYwZfcgSupplyList().add(aTYwZfcgSupply);
        }
      }
      // 评标专家
      mFlowInfoObj.setExpertTabName("<font color=" + TABNAMECOLOR + ">评标专家</font>");
      mSql = "from TYwZfcgJudgeexpertlist t where t.PLANID='" + pPlanID + "'";
      it = CHibernateUtil.selectObject(mSql).iterator();
      while (it.hasNext()) {
        mFlowInfoObj.setExpertTabName("<b>评标专家</b>");
        mFlowInfoObj.getTYwZfcgArchive().setSPARE3("1"); // 利用归档的备用字段确作为标志,表示投标单位表有数据
        TYwZfcgJudgeexpertlist aTYwZfcgJudgeexpertlist = (TYwZfcgJudgeexpertlist) it.next();
        mSql =
            "from TYwZfcgExpert t where t.EXPERTID='" + aTYwZfcgJudgeexpertlist.getEXPARTID() + "'";
        Iterator innerIt = CHibernateUtil.selectObject(mSql).iterator();
        if (innerIt.hasNext()) {
          TYwZfcgExpert aTYwZfcgExpert = (TYwZfcgExpert) innerIt.next();
          aTYwZfcgExpert.setSEX_VALUE(
              (String) CCodeMap.getMapByType("性别").get("" + aTYwZfcgExpert.getSEX()));
          aTYwZfcgExpert.setDUTY_VALUE(
              (String) CCodeMap.getMapByType("政府采购专家职位").get("" + aTYwZfcgExpert.getDUTY()));
          mFlowInfoObj.getTYwZfcgExpertList().add(aTYwZfcgExpert);
        }
      }

      // 处理付款的统计
      Connection mConn = null;
      PreparedStatement mPstmt = null;
      try {
        mConn = CDBManager.getConn();
        mSql =
            "select a.contractmoney,sum(b.paymoney) from t_yw_zfcg_signcontract a,t_yw_zfcg_paymoney b WHERE a.planid = b.planid AND a.planid = ? GROUP BY a.contractmoney";
        mPstmt = mConn.prepareStatement(mSql);
        mPstmt.setString(1, pPlanID);
        ResultSet mRs = mPstmt.executeQuery();
        if (mRs.next()) {
          TYZfcgPaymoney aTYZfcgPaymoney = mFlowInfoObj.getTYZfcgPaymoney();
          aTYZfcgPaymoney.setContractMoney(mRs.getString(1));
          aTYZfcgPaymoney.setPayMoneySum(mRs.getString(2));
        }
      } catch (Exception e) {
        throw e;
      } finally {
        if (mPstmt != null)
          try {
            mPstmt.close();
          } catch (Exception e) {
          }
        if (mConn != null)
          try {
            mConn.close();
          } catch (Exception e) {
          }
      }

      return mFlowInfoObj;
    } catch (Exception e) {
      throw e;
    }
  }