Ejemplo n.º 1
0
  /**
   * 由id获取唯一对应的部门简称abbrname
   *
   * @param pID 部门id
   * @return String 部门简称
   * @throws SQLException
   */
  public static String getAbbrNameByID(String pID) throws CDealException {
    Connection mConn = null;
    Statement mStmt = null;
    ResultSet rs = null;
    String abbrname = "";
    try {
      mConn = CDBManager.getConn(); // 创建数据库连接
      String sSQL = "select * from t_sys_department where ID=" + pID;
      mStmt = mConn.createStatement();
      rs = mStmt.executeQuery(sSQL);
      if (rs.next()) abbrname = rs.getString("AbbrName");
    } catch (Exception e) {
      e.printStackTrace();

    } finally {
      if (mStmt != null)
        try {
          mStmt.close();
        } catch (Exception e) {
        }
      ;
      if (mConn != null)
        try {
          mConn.close();
        } catch (Exception e) {
        }

      return abbrname;
    }
  }
Ejemplo n.º 2
0
  public static BaseInfoObj getBaseInfoObj(String pBusinessID) throws Exception {

    Connection mConn = null;
    PreparedStatement mPstmt = null;
    try {
      mConn = CDBManager.getConn();
      String mSql =
          "SELECT PLANID,FROMID,PURCHASESTATUS,PROJECTID,PURCHASECONTENT,PURCHASETYPE,PURCHASEMONEY,MONEYFROM,PURCHASEDEPARTID,PROCLAIMNAME,MARKBOTTOMMONEY,THROWMOTHED,to_char(OPENMARKTIME,'"
              + DATAFORMAT
              + "'),to_char(JUDGEMARKTIME,'"
              + DATAFORMAT
              + "') FROM T_JC_ZFCG_BUSINDEX WHERE BUSINESSID=?";
      mPstmt = mConn.prepareStatement(mSql);
      mPstmt.setString(1, pBusinessID);
      ResultSet mRs = mPstmt.executeQuery();
      if (mRs.next()) {
        BaseInfoObj mBaseInfoObj = new BaseInfoObj();
        mBaseInfoObj.setBUSINESSID(pBusinessID);
        mBaseInfoObj.setPLANID(mRs.getString(1));
        mBaseInfoObj.setFROMID(mRs.getString(2));
        mBaseInfoObj.setPURCHASESTATUS(mRs.getString(3));
        mBaseInfoObj.setPROJECTID(mRs.getString(4));
        mBaseInfoObj.setPURCHASECONTENT(mRs.getString(5));
        mBaseInfoObj.setPURCHASETYPE(mRs.getString(6));
        mBaseInfoObj.setPURCHASEMONEY(mRs.getString(7));
        mBaseInfoObj.setMONEYFROM(mRs.getString(8));
        mBaseInfoObj.setPURCHASEDEPARTID(mRs.getString(9));
        mBaseInfoObj.setPROCLAIMNAME(mRs.getString(10));
        mBaseInfoObj.setMARKBOTTOMMONEY(mRs.getString(11));
        mBaseInfoObj.setTHROWMOTHED(mRs.getString(12));
        mBaseInfoObj.setOPENMARKTIME(mRs.getString(13));
        mBaseInfoObj.setJUDGEMARKTIME(mRs.getString(14));

        convertKey2Value(mBaseInfoObj);
        return mBaseInfoObj;
      } else {
        throw new Exception("根据BusinessID " + pBusinessID + " 未能找到政府采购监察的基本信息");
      }
    } catch (Exception e) {
      throw e;
    } finally {
      if (mPstmt != null)
        try {
          mPstmt.close();
        } catch (Exception e) {
        }
      if (mConn != null)
        try {
          mConn.close();
        } catch (Exception e) {
        }
    }
  }
Ejemplo n.º 3
0
  /**
   * 查看处理
   *
   * @param actionForm ActionForm 表单From
   * @param request HttpServletRequest Web请求
   * @param response HttpServletResponse Web结果
   * @throws CDealException 处理异常
   */
  public static void doYuDelView(
      EditForm pEditForm, HttpServletRequest request, HttpServletResponse response)
      throws CDealException {
    String deptID = request.getParameter("ZHJCDEPARTMENTID");
    Connection mConn = null;
    PreparedStatement mPstmt = null;
    try {
      pEditForm.setBaseInfoObj(CommonDeal.getBaseInfoObj(pEditForm.getBusinessID()));
      if (deptID != null && !deptID.equals("")) {
        pEditForm.setFlowInfoObj(
            CommonDeal.getFlowInfoObj(pEditForm.getBaseInfoObj().getItemid(), deptID));
      } else {
        pEditForm.setFlowInfoObj(CommonDeal.getFlowInfoObj(pEditForm.getBaseInfoObj().getItemid()));
      }

      // 取时限监察信息
      mConn = CDBManager.getConn();
      String mSql =
          "select a.SUBBUSIINDEXID,a.BUSIINDEXID,to_char(a.BEGINDATE,'"
              + CommonDeal.DATAFORMAT
              + "'),"
              + "to_char(a.ENDDATE,'"
              + CommonDeal.DATAFORMAT
              + "'),a.LIMITTYPE,to_char(a.LAWENDDATE,'"
              + CommonDeal.DATAFORMAT
              + "'),a.LEAVINGSDAY,a.LIMITUNIT,a.RINGSTATS,a.RINGDATE,a.YELLOWSTATUS,"
              + "a.YELLOWDATE,a.REDSTATUS,a.REDDATE,a.CURSTATUSTYPE,a.SPECIALDAY,b.begindatedesc,b.enddatedesc,b.describe,"
              + "a.DEPARTID,c.ABBRNAME from T_JC_ZDSX_DCK_BUSINDEXLIMIT a,T_JC_ZDSX_DCK_PARAMETERLIMIT b,T_SYS_DEPARTMENT c "
              + "where a.limittype=b.limittype and a.PARAMETERSVERSION=b.PARAMETERSVERSION and a.DEPARTID=c.id and a.SPARE1='1' and a.BUSIINDEXID=? ";
      if (deptID != null && !deptID.equals("")) {
        mSql += " and a.DEPARTID = '" + deptID + "' ";
      }
      mSql += " order by a.departid";
      mPstmt = mConn.prepareStatement(mSql);
      mPstmt.setString(1, pEditForm.getBusinessID());
      ResultSet mRs = mPstmt.executeQuery();
      ArrayList mTimeLimitObjList = new ArrayList();
      while (mRs.next()) {
        TimeLimitObj aTimeLimitObj = new TimeLimitObj();
        aTimeLimitObj.setSUBBUSIINDEXID(mRs.getString(1));
        aTimeLimitObj.setBUSIINDEXID(mRs.getString(2));
        aTimeLimitObj.setBEGINDATE(mRs.getString(3));
        aTimeLimitObj.setENDDATE(mRs.getString(4));
        aTimeLimitObj.setLIMITTYPE(mRs.getString(5));
        aTimeLimitObj.setLAWENDDATE(mRs.getString(6));
        aTimeLimitObj.setLEAVINGSDAY(mRs.getString(7));
        aTimeLimitObj.setLIMITUNIT(mRs.getString(8));
        aTimeLimitObj.setRINGSTATS(mRs.getString(9));
        aTimeLimitObj.setRINGDATE(mRs.getString(10));
        aTimeLimitObj.setYELLOWSTATUS(mRs.getString(11));
        aTimeLimitObj.setYELLOWDATE(mRs.getString(12));
        aTimeLimitObj.setREDSTATUS(mRs.getString(13));
        aTimeLimitObj.setREDDATE(mRs.getString(14));
        aTimeLimitObj.setCURSTATUSTYPE(mRs.getString(15));
        aTimeLimitObj.setSPECIALDAY(mRs.getString(16));
        aTimeLimitObj.setBEGINDATEDESC(mRs.getString(17));
        aTimeLimitObj.setENDDATEDESC(mRs.getString(18));
        aTimeLimitObj.setLIMITTYPEDESC(mRs.getString(19));
        aTimeLimitObj.setDEPARTID(mRs.getString(20));
        aTimeLimitObj.setABBRNAME(mRs.getString(21));
        if (aTimeLimitObj.getLEAVINGSDAY().indexOf("-") > -1) {
          aTimeLimitObj.setLEAVINGSDAY(
              "<font color=red><b>" + aTimeLimitObj.getLEAVINGSDAY() + "</b></font>");
        }

        TreeMap TempTm = CCodeMap.getMapByType("政府采购监察当前预警黄牌红牌状态PIC");
        aTimeLimitObj.setCURSTATUSTYPE((String) TempTm.get(aTimeLimitObj.getCURSTATUSTYPE()));
        TempTm = CCodeMap.getMapByType("应急预案监察时限单位");
        aTimeLimitObj.setLIMITUNIT((String) TempTm.get(aTimeLimitObj.getLIMITUNIT()));
        mTimeLimitObjList.add(aTimeLimitObj);
      }

      pEditForm.getSuperviseObj().setTimeLimitObjList(mTimeLimitObjList);

      // 定期反馈信息
      Iterator taskIterator = pEditForm.getFlowInfoObj().getTTaskBreakDckList().iterator();
      ArrayList mTermLimitObjList = new ArrayList();
      while (taskIterator.hasNext()) {
        TTaskBreakDck taskBreak = (TTaskBreakDck) taskIterator.next();
        int termlyFlag = taskBreak.getTERMLY();
        String taskID = taskBreak.getTASKBREAKID();
        CLog.println("termlyFlag:::" + termlyFlag);
        CLog.println("taskID:::" + taskID);
        if (termlyFlag == 1) {
          // 查询本月
          mSql =
              "select main.LIMITFOREWARN,main.LIMITYELLOW,main.LIMITRED,main.TASKBREAKID,main.TRANSACTDEPARTMENT,dept.abbrname,main.TERMLYTYPE,"
                  + "sub.CURSTATUSTYPE,sub.termlytype,sub.TERMLYMONTH,sub.DEPARTID,sub.BUSIINDEXID,to_char(sub.ENDDATE,'yyyy-mm-dd') ENDDATE,"
                  + "to_char(sub.LAWENDDATE,'yyyy-mm-dd') LAWENDDATE,sub.LEAVINGSDAY,decode(sub.LIMITUNIT,0,'工作日',1,'自然日',2,'表示小时',3,'表示分钟') LIMITUNIT,"
                  + "sub.STATUS,sub.nianfen,sub.yuefen,sub.jidu "
                  + "from t_jc_zdsx_dck_termly_busindex  main,t_jc_zdsx_dck_ty_busindexlimit sub,t_sys_department dept "
                  + " where main.itemid =? and main.TASKBREAKID = ? and  main.TRANSACTDEPARTMENT = dept.id  ";
          if (deptID != null && !deptID.equals("")) {
            mSql += " and dept.id = '" + deptID + "' ";
          }
          String temp =
              " and sub.busiindexid = main.busiindexid(+) and sub.nianfen || '-' || sub.yuefen =  to_char(trunc(sysdate, 'mm'),'yyyy-mm') ";
          CLog.println("query statement:" + mSql + temp);
          mPstmt = mConn.prepareStatement(mSql + temp);
          mPstmt.setString(1, pEditForm.getBaseInfoObj().getItemid());
          mPstmt.setString(2, taskID);
          mRs = mPstmt.executeQuery();
          while (mRs.next()) {
            TermlyLimitObj aTermlyLimitObj = new TermlyLimitObj();
            aTermlyLimitObj.setTranId(mRs.getString("TASKBREAKID"));
            aTermlyLimitObj.setCURSTATUSTYPE(mRs.getString("CURSTATUSTYPE"));
            aTermlyLimitObj.setDEPARTID(mRs.getString("TRANSACTDEPARTMENT"));
            aTermlyLimitObj.setLIMITTYPE(mRs.getString("TERMLYTYPE"));
            aTermlyLimitObj.setABBRNAME(mRs.getString("abbrname"));
            aTermlyLimitObj.setENDDATE(mRs.getString("ENDDATE"));
            aTermlyLimitObj.setLAWENDDATE(mRs.getString("LAWENDDATE"));
            mTermLimitObjList.add(aTermlyLimitObj);
          }

          // 查询上月
          temp =
              " and sub.busiindexid = main.busiindexid(+) and sub.nianfen || '-' || sub.yuefen =  to_char(trunc(trunc(sysdate,'mm')-1, 'mm'),'yyyy-mm') ";
          mPstmt = mConn.prepareStatement(mSql + temp);
          mPstmt.setString(1, pEditForm.getBaseInfoObj().getItemid());
          mPstmt.setString(2, taskID);
          mRs = mPstmt.executeQuery();
          while (mRs.next()) {
            String tid = mRs.getString("TASKBREAKID").trim();
            String type = mRs.getString("CURSTATUSTYPE");
            String lawdate = mRs.getString("LAWENDDATE");
            String enddate = mRs.getString("ENDDATE");
            Iterator it = mTermLimitObjList.iterator();
            while (it.hasNext()) {
              TermlyLimitObj aTermlyLimitObj = (TermlyLimitObj) it.next();
              if (tid.equals(aTermlyLimitObj.getTranId())) {
                aTermlyLimitObj.setPreviousStatusType(type);
                aTermlyLimitObj.setPreviousLAWENDDATE(lawdate);
                aTermlyLimitObj.setPreviousENDDATE(enddate);
              }
            }
          }
        } else if (termlyFlag == 2) {
          // 查询本季度
          mSql =
              "select main.LIMITFOREWARN,main.LIMITYELLOW,main.LIMITRED,main.TASKBREAKID,main.TRANSACTDEPARTMENT,dept.abbrname,main.TERMLYTYPE,"
                  + "sub.CURSTATUSTYPE,sub.termlytype,sub.TERMLYMONTH,sub.DEPARTID,sub.BUSIINDEXID,to_char(sub.ENDDATE,'yyyy-mm-dd') ENDDATE,"
                  + "to_char(sub.LAWENDDATE,'yyyy-mm-dd') LAWENDDATE,sub.LEAVINGSDAY,decode(sub.LIMITUNIT,0,'工作日',1,'自然日',2,'表示小时',3,'表示分钟') LIMITUNIT,"
                  + "sub.STATUS,sub.nianfen,sub.yuefen,sub.jidu "
                  + "from t_jc_zdsx_dck_termly_busindex main,t_jc_zdsx_dck_ty_busindexlimit sub,t_sys_department dept "
                  + " where main.itemid =? and main.TASKBREAKID = ? and  main.TRANSACTDEPARTMENT = dept.id ";
          if (deptID != null && !deptID.equals("")) {
            mSql += " and dept.id = '" + deptID + "' ";
          }
          String temp =
              " and sub.busiindexid = main.busiindexid(+) and sub.jidu = decode(to_char(trunc(sysdate,'mm'),'mm'),01,1,02,1,03,1,04,2,05,2,06,2,07,3,08,3,09,3,10,4,11,4,12,4) "
                  + " and sub.nianfen =  to_char(trunc(sysdate,'mm'),'yyyy') ";
          CLog.println("query statement:" + mSql + temp);
          mPstmt = mConn.prepareStatement(mSql + temp);
          mPstmt.setString(1, pEditForm.getBaseInfoObj().getItemid());
          mPstmt.setString(2, taskID);
          mRs = mPstmt.executeQuery();
          while (mRs.next()) {
            TermlyLimitObj aTermlyLimitObj = new TermlyLimitObj();
            aTermlyLimitObj.setTranId(mRs.getString("TASKBREAKID"));
            aTermlyLimitObj.setCURSTATUSTYPE(mRs.getString("CURSTATUSTYPE"));
            aTermlyLimitObj.setDEPARTID(mRs.getString("TRANSACTDEPARTMENT"));
            aTermlyLimitObj.setLIMITTYPE(mRs.getString("TERMLYTYPE"));
            aTermlyLimitObj.setABBRNAME(mRs.getString("abbrname"));
            aTermlyLimitObj.setENDDATE(mRs.getString("ENDDATE"));
            aTermlyLimitObj.setLAWENDDATE(mRs.getString("LAWENDDATE"));
            mTermLimitObjList.add(aTermlyLimitObj);
          }

          // 查询上季度
          temp =
              " and sub.busiindexid = main.busiindexid(+) and sub.jidu = decode(to_char(trunc(sysdate,'mm'),'mm'),04,1,05,1,06,1,07,2,08,2,09,2,10,3,11,3,12,3) "
                  + " and sub.nianfen =  to_char(trunc(sysdate,'mm'),'yyyy') ";
          mPstmt = mConn.prepareStatement(mSql + temp);
          mPstmt.setString(1, pEditForm.getBaseInfoObj().getItemid());
          mPstmt.setString(2, taskID);
          mRs = mPstmt.executeQuery();
          while (mRs.next()) {
            String tid = mRs.getString("TASKBREAKID").trim();
            String type = mRs.getString("CURSTATUSTYPE");
            String lawdate = mRs.getString("LAWENDDATE");
            String enddate = mRs.getString("ENDDATE");
            Iterator it = mTermLimitObjList.iterator();
            while (it.hasNext()) {
              TermlyLimitObj aTermlyLimitObj = (TermlyLimitObj) it.next();
              if (tid.equals(aTermlyLimitObj.getTranId())) {
                aTermlyLimitObj.setPreviousStatusType(type);
                aTermlyLimitObj.setPreviousLAWENDDATE(lawdate);
                aTermlyLimitObj.setPreviousENDDATE(enddate);
              }
            }
          }
        }
      }

      pEditForm.getSuperviseObj().setTermlyLimitObjList(mTermLimitObjList);

      UploadForm aUploadForm = new UploadForm();
      aUploadForm.setType("重大事项督查科");
      aUploadForm.setBid(Long.parseLong(pEditForm.getBaseInfoObj().getItemid()));
      com.tjsoft.system.upload.CDeal.setUploadDefault(aUploadForm, request, response);
      pEditForm.setUploadedFile(aUploadForm.getUploadedFile());

      UploadForm aMyUploadForm = new UploadForm();
      aMyUploadForm.setType("重大事项督查科承办部门");
      aMyUploadForm.setBid(Long.parseLong(pEditForm.getBaseInfoObj().getItemid()));
      if (deptID != null) {
        aMyUploadForm.setBid1(deptID);
      }
      com.tjsoft.system.upload.CDeal.setUploadDefault(aMyUploadForm, request, response);
      pEditForm.setMyUploadedFile(aMyUploadForm.getUploadedFile());

    } catch (Exception e) {
      throw new CDealException("进入详细信息查看时失败。", e);
    } finally {
      if (mPstmt != null) {
        try {
          mPstmt.close();
        } catch (Exception e) {
        }
      }
      if (mConn != null) {
        try {
          mConn.close();
        } catch (Exception e) {
        }
      }
    }
  }
Ejemplo n.º 4
0
  /**
   * 设置进入查看详细信息页面的初始值 setEditDefault
   *
   * @param aWebForm EditForm
   * @param request HttpServletRequest
   * @param response HttpServletResponse
   */
  public static void setEditDefault(
      EditForm pWebForm, HttpServletRequest request, HttpServletResponse response)
      throws CDealException {
    try {
      // 初始化页面,初始化投诉形式下拉菜单
      int type = 0;
      Connection mConn = null;
      PreparedStatement pstmt = null;

      try {
        mConn = CDBManager.getConn(); // 创建数据库连接
        // 设置进入修改页面的初始值SQL
        String mSQL =
            "select A.CHENGPIID,A.COMPLAINEDPERSON,A.COMPLAINPERSON, A.COMPLAINEDUNIT, A.COMPLAINUNIT, A.COMPLAINEDDUTY, A.COMPLAINDUTY, A.QUESTIONKIND, A.COMPLAINVERSION, "
                + "  A.CONTENTABSTRACT,   A.SUGGESTION,   A.SIGN1,  to_char(A.DATE1, 'yyyy-mm-dd') DATE1,A.LEADERCONFIRM, A.SIGN2,   to_char(A.DATE2, 'yyyy-mm-dd') DATE2, A.REMARK,   A.BUSINESSID, "
                + " decode(A.BUSINESSTYPE,'1','建设工程','2','行政许可','3','政府采购','4','重大事项','5','行政执法','6','财政预算','7','信访','8','应急预案') BUSINESSTYPE,"
                + "   t.abbrname,A.COMPLAINEDGRADE,A.XZGCXYFL,A.SUBXZGCXYFL,A.XZGLFL,A.XZGCBXXS from T_YW_ZDSX_JCJ_TSCHENGPIBIAO A,t_Sys_Department t where  A.COMPLAINEDUNIT = t.id  and A.CHENGPIID = ?";
        pstmt = mConn.prepareStatement(mSQL);
        pstmt.setString(1, pWebForm.getCHENGPIID()); // 主键
        ResultSet rs = pstmt.executeQuery();
        if (rs.next()) {
          pWebForm.getTTsChengpibiao().setCHENGPIID(rs.getString(1)); // 呈批表编号
          pWebForm.getTTsChengpibiao().setCOMPLAINEDPERSON(rs.getString(2)); // 呈批表被投诉人姓名
          pWebForm.getTTsChengpibiao().setCOMPLAINPERSON(rs.getString(3)); // 呈批表投诉人姓名
          pWebForm.getTTsChengpibiao().setCOMPLAINEDUNIT(rs.getString(4)); // 呈批表被投诉人单位
          pWebForm.getTTsChengpibiao().setCOMPLAINUNIT(rs.getString(5)); // 呈批表投诉人单位
          pWebForm.getTTsChengpibiao().setCOMPLAINEDDUTY(rs.getString(6)); // 呈批表被投诉人职务
          pWebForm.getTTsChengpibiao().setCOMPLAINDUTY(rs.getString(7)); // 呈批表投诉人职务
          pWebForm.getTTsChengpibiao().setQUESTIONKIND(rs.getString(8)); // 呈批表问题性质
          pWebForm.getTTsChengpibiao().setCOMPLAINVERSION(rs.getInt(9)); // 呈批表投诉形式
          type = rs.getInt(9);
          pWebForm.getTTsChengpibiao().setCONTENTABSTRACT(rs.getString(10)); // 呈批表内容摘要
          pWebForm.getTTsChengpibiao().setSUGGESTION(rs.getString(11)); // 呈批表拟办意见
          pWebForm.getTTsChengpibiao().setSIGN1(rs.getString(12)); // 呈批表拟办人签字
          pWebForm.getTTsChengpibiao().setDATE1_STR(rs.getString(13)); // 呈批表拟办人签字日期
          pWebForm.getTTsChengpibiao().setLEADERCONFIRM(rs.getString(14)); // 呈批表局领导批示
          pWebForm.getTTsChengpibiao().setSIGN2(rs.getString(15)); // 呈批表局领导签字
          pWebForm.getTTsChengpibiao().setDATE2_STR(rs.getString(16)); // 呈批表局领导签字日期
          pWebForm.getTTsChengpibiao().setREMARK(rs.getString(17)); // 呈批表备注
          pWebForm.getTTsChengpibiao().setBUSINESSID(rs.getString(18));
          pWebForm.setTypename(rs.getString(19));
          pWebForm.setDepartmentname(rs.getString(20));
          pWebForm.getTTsChengpibiao().setCOMPLAINEDGRADE(rs.getInt(21));
          pWebForm.getTTsChengpibiao().setXZGCXYFL(rs.getInt(22));
          pWebForm.getTTsChengpibiao().setSUBXZGCXYFL(rs.getInt(23));
          pWebForm.getTTsChengpibiao().setXZGLFL(rs.getInt(24));
          pWebForm.getTTsChengpibiao().setXZGCBXXS(rs.getInt(25));

        } else {
          throw new CDealException(
              "使用编号 " + pWebForm.getCHENGPIID() + "未能找到数据。", new Exception("查询数据失败。"));
        }
        TreeMap COMPLAINVERSIONList = new TreeMap();
        CCodeMap aCodeMap = new CCodeMap();
        COMPLAINVERSIONList = aCodeMap.getMapByType("行政效能投诉形式");
        String busitypename = (String) COMPLAINVERSIONList.get("" + type);
        pWebForm.setTsxingshu(busitypename);
        // 处理附件
        UploadForm aUploadForm = new UploadForm();
        aUploadForm.setType("行政效能");
        aUploadForm.setBid2("办理呈批表");
        aUploadForm.setBid(Long.parseLong(pWebForm.getTTsChengpibiao().getCHENGPIID()));
        com.tjsoft.system.upload.CDeal.setUploadDefault(aUploadForm, request, response);
        pWebForm.setUploadedFile(aUploadForm.getUploadedFile());
      } 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);
    }
  }
Ejemplo n.º 5
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;
    }
  }
Ejemplo n.º 6
0
 /**
  * 处理增加
  *
  * @param actionForm ActionForm 表单From
  * @param request HttpServletRequest Web请求
  * @param response HttpServletResponse Web结果
  * @throws CDealException 处理异常
  */
 public static long doAdd(
     AddForm pWebForm, HttpServletRequest request, HttpServletResponse response)
     throws CDealException, SQLException {
   long chapterid;
   Connection mconn = null;
   PreparedStatement pstmt = null;
   try {
     CUserBean loginUser =
         (CUserBean) request.getSession().getAttribute(CConstants.USER_BEAN); // 用户BEAN
     /*TPubFlfggl aPoBean = webForm2PoForm(pWebForm);  // 将页面的Form的数据拷内到实体对象
     aPoBean.setId(CTools.getNewNumID());
     aPoBean.setCreateperson(loginUser.getId());  // 用户 ID
     aPoBean.setCreatetime(CTools.getCurrentTimestamp());  // 当前时间
     CHibernateUtil.saveObject(aPoBean);  // 调用 PO 层进行增加 */
     chapterid = CTools.getNewNumID();
     mconn = CDBManager.getConn();
     mconn.setAutoCommit(false); // 将自动提交设置为否
     String sql =
         "insert into t_pub_law (id,createperson,createtime,title,classification,issuedate,orderno,spare1,spare2,spare3,spare4,businesstype,bigcontent) values(?,?,?,?,?,?,?,?,?,?,?,?,?)";
     pstmt = mconn.prepareStatement(sql);
     pstmt.setLong(1, chapterid);
     pstmt.setLong(2, loginUser.getId());
     pstmt.setTimestamp(3, CTools.getCurrentTimestamp());
     pstmt.setString(4, pWebForm.getTPubFlfggl().getTitle());
     CLog.println("4====title=" + pWebForm.getTPubFlfggl().getTitle());
     pstmt.setInt(5, pWebForm.getTPubFlfggl().getClassification());
     CLog.println("5====classification=" + pWebForm.getTPubFlfggl().getClassification());
     pstmt.setTimestamp(
         6,
         CTools.convertStringToTimestamp(
             pWebForm.getTPubFlfggl().getIssueTime_str(), "yyyy-mm-dd"));
     pstmt.setLong(7, pWebForm.getTPubFlfggl().getOrderno());
     pstmt.setString(8, pWebForm.getTPubFlfggl().getSpare1());
     pstmt.setString(9, pWebForm.getTPubFlfggl().getSpare2());
     pstmt.setString(10, pWebForm.getTPubFlfggl().getSpare3());
     pstmt.setString(11, pWebForm.getTPubFlfggl().getSpare4());
     pstmt.setInt(12, pWebForm.getTPubFlfggl().getBusinesstype());
     pstmt.setClob(13, CLOB.empty_lob()); // 构造空CLOB对象
     pstmt.executeUpdate();
     pstmt.close();
     // =======================再次从库表中读出,获得CLOB句柄
     pstmt =
         mconn.prepareStatement("select a.bigcontent from t_pub_law a where a.id = ? for update");
     pstmt.setLong(1, chapterid);
     ResultSet rs = pstmt.executeQuery();
     rs.next();
     CLOB textClob = (CLOB) rs.getClob(1);
     textClob.putString(
         1,
         pWebForm
             .getTPubFlfggl()
             .getBigContent_str()
             .replaceAll("\n", "<br>")); // 将页面的法律法规内容写入Clob
     pstmt = mconn.prepareStatement("update t_pub_law set bigcontent=? where id=?");
     pstmt.setClob(1, textClob);
     pstmt.setLong(2, chapterid);
     pstmt.executeUpdate();
     return chapterid;
   } catch (Exception e) {
     throw new CDealException("执行增加" + mModuleName + "时失败。", e);
   } finally {
     if (pstmt != null) {
       pstmt.close();
     }
     mconn.commit();
     if (mconn != null) {
       mconn.close();
     }
   }
 }
Ejemplo n.º 7
0
  /**
   * 处理修改
   *
   * @param actionForm ActionForm 表单From
   * @param request HttpServletRequest Web请求
   * @param response HttpServletResponse Web结果
   * @throws CDealException 处理异常
   */
  public static void doEdit(
      EditForm pWebForm, HttpServletRequest request, HttpServletResponse response)
      throws CDealException, SQLException {
    CUserBean loginUser =
        (CUserBean) request.getSession().getAttribute(CConstants.USER_BEAN); // 用户BEAN
    long chapterid = pWebForm.getTPubFlfggl().getId();
    Connection mconn = null;
    PreparedStatement pstmt = null;
    try {
      /*TPubFlfggl aPoBean = webForm2PoForm(pWebForm);  // 将页面的Form的数据拷内到实体对象
      aPoBean.setModperson(loginUser.getId());  // 用户 ID
      aPoBean.setModtime(CTools.getCurrentTimestamp());  // 当前时间
      CHibernateUtil.updateObject(aPoBean);  // 调用 PO 层进行修改 */
      mconn = CDBManager.getConn();
      mconn.setAutoCommit(false); // 将自动提交设置为否
      String sql =
          "update t_pub_law a set a.modperson=?,a.modtime=?,a.title=?,a.classification=?,a.businesstype=?,a.issuedate=?,a.orderno=?,a.bigcontent = ? where a.id = ? ";
      pstmt = mconn.prepareStatement(sql);
      pstmt.setLong(1, loginUser.getId());
      pstmt.setTimestamp(2, CTools.getCurrentTimestamp());
      pstmt.setString(3, pWebForm.getTPubFlfggl().getTitle());
      pstmt.setInt(4, pWebForm.getTPubFlfggl().getClassification());
      pstmt.setInt(5, pWebForm.getTPubFlfggl().getBusinesstype());
      pstmt.setTimestamp(
          6,
          CTools.convertStringToTimestamp(
              pWebForm.getTPubFlfggl().getIssueTime_str(), "yyyy-MM-dd"));
      pstmt.setLong(7, pWebForm.getTPubFlfggl().getOrderno());
      pstmt.setClob(8, CLOB.empty_lob());
      pstmt.setLong(9, chapterid);
      pstmt.executeUpdate();
      pstmt.close();

      // =======================再次从库表中读出,获得CLOB句柄
      pstmt =
          mconn.prepareStatement("select a.bigcontent from t_pub_law a where a.id = ? for update");
      pstmt.setLong(1, chapterid);
      ResultSet rs = pstmt.executeQuery();
      rs.next();
      CLOB textClob = (CLOB) rs.getClob(1);
      if (textClob == null) {
        CLog.println("340========textClob is null");
      }
      if (pWebForm.getTPubFlfggl().getBigContent_str() == null) {
        CLog.println("343========BigContent_str is null");
      }
      textClob.putString(
          1,
          pWebForm
              .getTPubFlfggl()
              .getBigContent_str()
              .replaceAll("\n", "<br>")); // 将页面的法律法规内容写入Clob
      pstmt = mconn.prepareStatement("update t_pub_law set bigcontent=? where id=?");
      pstmt.setClob(1, textClob);
      pstmt.setLong(2, chapterid);
      pstmt.executeUpdate();
    } catch (Exception e) {
      throw new CDealException("执行修改" + mModuleName + "时失败。", e);
    } finally {
      if (pstmt != null) {
        pstmt.close();
      }
      mconn.commit();
      if (mconn != null) {
        mconn.close();
      }
    }
  }
Ejemplo n.º 8
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 {

      // 初始化页面,初始化法律类别下拉菜单
      TreeMap classificationList = new TreeMap();
      classificationList = CCodeMap.getMapByType("法律类别");
      pWebForm.setClassificationList(classificationList);
      CLog.println("\n111111111法律类别");
      // 初始化页面,初始化业务类别下拉菜单
      TreeMap businesstypeList = new TreeMap();
      businesstypeList = CCodeMap.getMapByType("法律法规业务类别");
      pWebForm.setBusinesstypeList(businesstypeList);
      CLog.println("\n业务类别");

      // UploadForm aUploadForm = new UploadForm();
      // aUploadForm.setType("重大事项");
      // aUploadForm.setBid(pWebForm.getTPubFlfggl().getId());
      // CLog.println("\n公共管理333333");
      // com.tjsoft.system.upload.CDeal.setUploadDefault(aUploadForm, request, response);
      // CLog.println("\n公共管理55555555");
      // pWebForm.setUploadedFile(aUploadForm.getUploadedFile());
      // CLog.println("\n111111111hhhhhhhrrrr");

      Connection mConn = null;
      PreparedStatement pstmt = null;
      String content_str = "";
      try {
        mConn = CDBManager.getConn(); // 创建数据库连接
        // String mSQL = "SELECT
        // t.title,t.classification,t.businesstype,to_char(t.Issuedate,'yyyy-mm-dd'),t.orderno,t.content,spare1,spare2,spare3,spare4,to_char(t.createtime,'yyyy-mm-dd') FROM t_pub_law t WHERE t.id=?";
        String mSQL =
            "SELECT t.title,t.classification,t.businesstype,to_char(t.Issuedate,'yyyy-mm-dd'),t.orderno,t.content,spare1,spare2,spare3,spare4,to_char(t.createtime,'yyyy-mm-dd'),t.bigcontent FROM t_pub_law t WHERE t.id=?";
        pstmt = mConn.prepareStatement(mSQL);
        pstmt.setLong(1, pWebForm.getTPubFlfggl().getId()); // 主键
        ResultSet rs = pstmt.executeQuery();
        if (rs.next()) {
          // pWebForm.getTPubFlfggl().setId(rs.getLong(1));
          pWebForm.getTPubFlfggl().setTitle(rs.getString(1)); // 标题
          pWebForm.getTPubFlfggl().setClassification(rs.getInt(2)); // 类别
          pWebForm.getTPubFlfggl().setBusinesstype(rs.getInt(3)); // 业务类别
          pWebForm.getTPubFlfggl().setIssueTime_str(rs.getString(4)); // 颁布日期
          pWebForm.getTPubFlfggl().setOrderno(rs.getLong(5)); // 排序号
          pWebForm.getTPubFlfggl().setContent(rs.getString(6)); // 内容
          pWebForm.getTPubFlfggl().setSpare1(rs.getString(7)); // 备用字段
          pWebForm.getTPubFlfggl().setSpare2(rs.getString(8)); // 备用字段
          pWebForm.getTPubFlfggl().setSpare3(rs.getString(9)); // 备用字段
          pWebForm.getTPubFlfggl().setSpare4(rs.getString(10)); // 备用字段
          pWebForm.getTPubFlfggl().setCreateTime_str(rs.getString(11)); // 录入时间
          // pWebForm.getTPubFlfggl().setBigContent(rs.getClob(12));
          CLOB content = (CLOB) rs.getClob(12);
          if (content != null) {
            Reader is = content.getCharacterStream();
            BufferedReader br = new BufferedReader(is);
            String s = br.readLine();
            while (s != null) {
              content_str += s;
              s = br.readLine();
            }
          }
          pWebForm.getTPubFlfggl().setBigContent_str(content_str.replaceAll("<br>", "\n"));
        } else {
          throw new CDealException(
              "使用编号 " + pWebForm.getTPubFlfggl().getId() + "未能找到数据。", new Exception("查询数据失败。"));
        }
      } catch (Exception e) {
        throw e;
      }

    } catch (Exception e) {
      throw new CDealException("进入修改" + mModuleName + "时失败。", e);
    }
  }