/**
 * @(#)file    BidPlanSaveBiz.java
 * @(#)author  Son Hyung Min 
 * @(#)version 1.0
 * @(#)date    2014-06-23
 * @(#)since   JDK 1.4.2
 */
package kr.co.udapsoft.ebid.buyer.bid.outside.biz;



import java.sql.Connection;

import oracle.toplink.internal.ox.StrBuffer;
import kr.co.hsnc.common.base.WAFLogger;
import kr.co.hsnc.common.sql.RowSet;
import kr.co.hsnc.common.sql.RowSetImpl;
import kr.co.hsnc.common.sql.persistent.Persistent;
import kr.co.hsnc.common.sql.persistent.PersistentImpl;
import kr.co.hsnc.common.sql.search.Search;
import kr.co.hsnc.common.sql.search.SearchImpl;
import kr.co.hsnc.common.util.ValueObject;

import com.udapsoft.modular.web.ibsheet7.IBSheet7Factory;
import com.udapsoft.modular.web.ibsheet7.util.IBSheet7Utils;
import com.udapsoft.waf.common.util.StringUtils;
import com.udapsoft.waf.system.Biz;
import com.udapsoft.waf.system.HandlerStorage;

import kr.co.udapsoft.common.sender.MessageSend;

   
public class BidPlanSaveBiz extends Biz {

	public BidPlanSaveBiz(HandlerStorage storage) {
		super(storage);
	}

	public void doBiz() throws Exception {
		boolean success = false;
		params.set("login_user", storage.getUser().get("ACCT_ID"));
        success = saveProc(storage.getEvent(), params);
        super.storage.setSuccess(success);
        if(success){
        	storage.addObject("ibsheet7Data", IBSheet7Factory.createIBSheet7(params, storage.request));
        }
	}
	  /**
     * 사용자 정보 저장
	 * @param event
	 * @param valueObject
	 * @return
	 */
	public boolean saveProc(String event, ValueObject valueObject) {
        try {
            conn.begin();

            String dupCnt = getDupCnt1("ebid_oinqD", params.get("BID_NO"),params.get("BID_DEG"));
            if( !"0".equals(dupCnt) ){
            	storage.setMessage("결재중인 입찰 입니다.");
            	throw new Exception("결재중인 입찰 입니다.");
            }

            if( event.equals("UPDATE") ) {
            	params.get("BID_NO");
                updUser(conn.getConnection(), params);
                if("Y".equals(params.get("TBE_FLAG"))){
                	tbeinfosave(conn.getConnection(), params);
                }
                
                String[] status = super.gets("sheet1.STATUS");
                
                for (int i = 0; i < status.length; i++) {
					if (IBSheet7Utils.equalStatusInsert(status[i])) {
						saveData(super.conn.getConnection(), IBSheet7Utils.getIBSheet7SqlParams("SHEET1", params, i));
					}
					
					if (IBSheet7Utils.equalStatusUpdate(status[i])) {
						updateData(super.conn.getConnection(), IBSheet7Utils.getIBSheet7SqlParams("SHEET1", params, i));
					}
					
					if (IBSheet7Utils.equalStatusDelete(status[i])) {
						deleteData(super.conn.getConnection(), IBSheet7Utils.getIBSheet7SqlParams("SHEET1", params, i));
					}
				}
                //공개경쟁일때 모든 업체 삭제
                if("01".equals(params.get("CMPT_CD"))){
                	deleteData(conn.getConnection());
                }
            }else if ( event.equals("FORM_DELETE") ){
            	//첨부파일 삭제
            	PUB0500T_del(conn.getConnection(), params);
            	//첨부파일 맵 삭제
            	PUB0510T_del(conn.getConnection(), params);
            	//견적대상업체 삭제
            	BID_SUPP_del(conn.getConnection(), params);
            	//기술검토 삭제
            	TBE_INFO_del(conn.getConnection(), params);
            	//입찰 내역 삭제
            	BID_ITEM_del(conn.getConnection(), params);
            	//마스터 삭제
            	BID_MASTER_del(conn.getConnection(), params);
            	//보고자 삭제
            	BID_OPEN_REPORT_del(conn.getConnection(), params);
            	//
            	PMM_DEMANDED_REQUEST_update(conn.getConnection());
        	}else if ( event.equals("MASTER_UPDATE") ){
            	//데이터 먼저 저장
        		params.get("BID_NO");
                updUser(conn.getConnection(), params);
                if("Y".equals(params.get("TBE_FLAG"))){
                	tbeinfosave(conn.getConnection(), params);
                }
                String[] status = super.gets("sheet1.STATUS");
                
                for (int i = 0; i < status.length; i++) {
					if (IBSheet7Utils.equalStatusInsert(status[i])) {
						saveData(super.conn.getConnection(), IBSheet7Utils.getIBSheet7SqlParams("SHEET1", params, i));
					}
					
					if (IBSheet7Utils.equalStatusUpdate(status[i])) {
						updateData(super.conn.getConnection(), IBSheet7Utils.getIBSheet7SqlParams("SHEET1", params, i));
					}
					
					if (IBSheet7Utils.equalStatusDelete(status[i])) {
						deleteData(super.conn.getConnection(), IBSheet7Utils.getIBSheet7SqlParams("SHEET1", params, i));
					}
				}
                //공개경쟁일때 모든 업체 삭제
                if("01".equals(params.get("CMPT_CD"))){
                	deleteData(conn.getConnection());
                }
                /*
                //상태값 업데이트
                if("N".equals(params.get("ONBID_YN"))){
                	update_BidMaster(conn.getConnection(), params);
                	insert_BidItem(conn.getConnection(), params);
                }*/
                //상태값 업데이트
        		
        	}else if(event.equals("REPORT_EMP_UPDATE")){
                //보고자 정보
            	String[] status2 = super.gets("sheet2.STATUS");
                for (int i = 0; i < status2.length; i++) {
					if (IBSheet7Utils.equalStatusInsert(status2[i])) {
						saveData2(super.conn.getConnection(), IBSheet7Utils.getIBSheet7SqlParams("SHEET2", params, i));
					}
					if (IBSheet7Utils.equalStatusDelete(status2[i])) {
						deleteData2(super.conn.getConnection(), IBSheet7Utils.getIBSheet7SqlParams("SHEET2", params, i));
					}
				}
        	}
            return true;
        }
        catch(Exception e) {
        	storage.addObject("ibsheet7Data", IBSheet7Utils.exceptionHandle(storage.request, e));
            WAFLogger.error(this.getClass().getName() + " --> saveProc() : " + e.getMessage());
            WAFLogger.error(e);
            conn.setRollback();

            storage.setDetailMessage(e);
            return false;
        }
        finally {
        	
            conn.end();
        }
    }

	/**
     * 사용자 수정
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void updUser(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
			sqlstr.append(" UPDATE BID_MASTER 											\n");
			sqlstr.append("      SET BID_MASTER_NM=?					--						\n");
			sqlstr.append("      , CMPT_CD=?						--					\n");
			sqlstr.append("      , SUCC_CD=?						--					\n");
			sqlstr.append("      , NOTI_DY=?											\n");
			sqlstr.append("      , CONT_AMT=?											\n");
			sqlstr.append("      , ACT_AMT=?											\n");
			sqlstr.append("      , PUR_AMT=?											\n");  //2015.3.2 외주예산추가 MKLEE
			sqlstr.append("      , SITEDESC_FLAG=?			--								\n");
			sqlstr.append("      , SITEDESCCHRGPRSNID=?		--									\n");
			sqlstr.append("      , SITEDESC_CRG_NM=?		--									\n");
			sqlstr.append("      , SITEDESCTELNO=?		--									\n");
			sqlstr.append("      , SITEDESCEMAIL=?		--									\n");
			sqlstr.append("      , SITEDESCDATE=TO_DATE(?||?||?,'YYYYMMDDHH24MI')			--								\n");
			sqlstr.append("      , SITEDESCPLACE=?											\n");
			sqlstr.append("      , BID_FROM_DT=TO_DATE(?||?||?,'YYYYMMDDHH24MI')		--									\n");
			sqlstr.append("      , BID_TO_DT=TO_DATE(?||?||?,'YYYYMMDDHH24MI')											\n");
			sqlstr.append("      , PUREMPNO=?											\n");
			sqlstr.append("      , PO_EMPNM=?											\n");
			sqlstr.append("      , OPEN_EMPNM=?											\n");
			sqlstr.append("      , OPEN_EMPID=?											\n");
			sqlstr.append("      , TBE_FLAG=?											\n");
			sqlstr.append("      , CURRENCY_GB=?											\n");
			sqlstr.append("      , CURRENCY_GB_YN=?											\n");
			sqlstr.append("      , CONTFUL_RATE=?											\n");
			sqlstr.append("      , CONTFUL_CONDI=?											\n");
			sqlstr.append("      , WARR_RATE=?											\n");
			sqlstr.append("      , WARR_CONDI=?											\n");
			sqlstr.append("      , INNER_REMARKS=?											\n");
			sqlstr.append("      , OUTER_REMARKS=?											\n");
			sqlstr.append("      , BID_APP_DATE=?											\n");
			sqlstr.append("      , BID_APP_NO=?											\n");
			sqlstr.append("      , STATUS_CD=?											\n");
			sqlstr.append("      , ACT_RATE=?											\n");
			sqlstr.append("      , PBC_DEFECT_CONDI= ?			\n");
			sqlstr.append("      , CBC_DERECT_TERM_CD= ?			\n");
			sqlstr.append("      , CBC_DEFECT_DAY= ?			\n");
			sqlstr.append("      , PBC_FRSTGUAR_RATE= ?			\n");
			sqlstr.append("      , PBC_FRSTGUAR_CONDI= ?			\n");
			sqlstr.append("      , PBC_REST_RATE= ?				\n");
			sqlstr.append("      , PBC_REST_CONDI= ?			\n");
			sqlstr.append("      , CPC_MID_RATE= ?				\n");
			sqlstr.append("      , PBC_MID_CONDI= ?				\n");
			sqlstr.append("      , CBC_FIRST_RATE= ?			\n");
			sqlstr.append("      , PBC_FIRST_CONDI= ?			\n");
			sqlstr.append("      , PAY_CON_RATE= ?				\n");
			sqlstr.append("      , CBC_DAMAGE_RATE= ?			\n");
			sqlstr.append("      , CBC_DAMAGE_MAXRATE= ?			\n");
			sqlstr.append("      , PBC_OPTION_COMMENT= ?			\n");
			sqlstr.append("      , PBC_OPTION_YN= ?				\n");
			sqlstr.append("      , PBC_FEE_YN= ?				\n");
			sqlstr.append("      , DELIVERY_CONDITION= ?			\n");
			sqlstr.append("      , DELIVERY_CONDITION_YN= ?			\n");
			sqlstr.append("      , PBC_LANDTRAN_YN= ?			\n");
			sqlstr.append("      , PBC_PACK_YN= ?				\n");
			sqlstr.append("      , PBC_DOC_YN= ?				\n");
			sqlstr.append("      , PBC_TEST_YN= ?				\n");
			sqlstr.append("      , PBC_SPETOOL_YN= ?			\n");
			sqlstr.append("      , PBC_COMMISS_YN= ?			\n");
			sqlstr.append("      , PBC_INSTALL_YN= ?			\n");
			sqlstr.append("      , PBC_CBE_TYPE_CD= ?			\n");
			sqlstr.append("      , DIV_PO_YN= ?				\n");
			sqlstr.append("      , OBC_CONT_TYPE_CD= ?				\n");
			sqlstr.append("      , OBC_FRST_CASH_RATE= ?				\n");
			sqlstr.append("      , OBC_FRST_CONDI= ?				\n");
			sqlstr.append("      , OBC_FRST_CNT_CONDI= ?				\n");
			sqlstr.append("      , OBC_MID_CASH_RATE= ?				\n");
			sqlstr.append("      , OBC_MID_BILL_RATE= ?				\n");
			sqlstr.append("      , OBC_MID_PAYDAY= ?				\n");
			sqlstr.append("      , OBC_MID_REQ_MONTH= ?				\n");
			sqlstr.append("      , OBC_MID_CNT= ?				\n");
			sqlstr.append("      , OBC_MID_BILL_DATE= ?				\n");
			sqlstr.append("      , OBC_FIN_CASH_RATE= ?				\n");
			sqlstr.append("      , OBC_FIN_BILL_RATE= ?				\n");
			sqlstr.append("      , OBC_FIN_PAYDAY= ?				\n");
			sqlstr.append("      , OBC_FIN_CONDI= ?				\n");
			sqlstr.append("      , OBC_EMP_RATE= ?				\n");
			sqlstr.append("      , OBC_EMP_YN= ?					\n");
			sqlstr.append("      , OBC_PENSION_RATE= ?				\n");
			sqlstr.append("      , OBC_PENSION_YN= ?				\n");
			sqlstr.append("      , OBC_HEALTH_RATE= ?				\n");
			sqlstr.append("      , OBC_HEALTH_YN= ?				\n");
			sqlstr.append("      , OBC_ELDER_RATE= ?				\n");
			sqlstr.append("      , OBC_ELDER_YN= ?				\n");
			sqlstr.append("      , OBC_WORK_RATE= ?				\n");
			sqlstr.append("      , OBC_WORK_YN= ?				\n");
			sqlstr.append("      , OBC_RESIGN_RATE= ?				\n");
			sqlstr.append("      , OBC_RESIGN_YN= ?				\n");
			sqlstr.append("      , OBC_SAFE_RATE= ?				\n");
			sqlstr.append("      , OBC_SAFE_YN= ?				\n");
			sqlstr.append("      , OBC_ENV_RATE= ?				\n");
			sqlstr.append("      , OBC_ENV_YN= ?				\n");
			sqlstr.append("      , OBC_SITE_RATE= ?				\n");
			sqlstr.append("      , OBC_SITE_YN= ?				\n");
			sqlstr.append("      , OBC_DUTY_RATE= ?				\n");
			sqlstr.append("      , OBC_DUTY_YN= ?				\n");
			sqlstr.append("      , OBC_WARR_YN= ?				\n");
			sqlstr.append("      , OBC_FRST_CONT_RATE= ?		\n");
			sqlstr.append("      , OBC_IND_YN= ?				\n");
			sqlstr.append("      , UPD_BY=?						\n");
			sqlstr.append("      , UPD_DATE=SYSDATE 			\n");
			sqlstr.append("      , DELI_FROM_DY=?				\n"); //2016.11.14
			sqlstr.append("      , DELI_TO_DY=? 				\n"); //2016.11.14
			sqlstr.append("      , DELI_START_DT=?				\n"); //2016.11.14
			sqlstr.append("      , DELI_END_DT=? 				\n"); //2016.11.14
			sqlstr.append("      , MAIN_PR_CONTENTS=?			\n");
			sqlstr.append("      , BID_SUPP_SELECT_REASON=? 	\n");			
			sqlstr.append("      , CONT_APP_REQ_DATE=? 			\n");			
			sqlstr.append("  WHERE BID_NO = ?					\n");
			sqlstr.append("  AND BID_DEG = ?					\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(valueObject.get("BID_MASTER_NM"));
            persistent.addParameter(valueObject.get("CMPT_CD"));
            persistent.addParameter(valueObject.get("SUCC_CD"));
            persistent.addParameter(StringUtils.replace(valueObject.get("NOTI_DY"),"-",""));
            persistent.addParameter(StringUtils.replace(valueObject.get("CONT_AMT"),",",""));
            persistent.addParameter(StringUtils.replace(valueObject.get("ACT_AMT"),",",""));
            persistent.addParameter(StringUtils.replace(valueObject.get("PUR_AMT"),",","")); //2015.3.2 외주예산추가 MKLEE
            persistent.addParameter(valueObject.get("SITEDESC_FLAG"));
            persistent.addParameter(valueObject.get("SITEDESCCHRGPRSNID"));
            persistent.addParameter(valueObject.get("SITEDESC_CRG_NM"));
            persistent.addParameter(valueObject.get("SITEDESCTELNO"));
            persistent.addParameter(valueObject.get("SITEDESCEMAIL"));
            persistent.addParameter(StringUtils.replace(valueObject.get("SITEDESCDATE"),"-",""));
            persistent.addParameter(valueObject.get("SITEDESCDATE_HH"));
            persistent.addParameter(valueObject.get("SITEDESCDATE_MI"));
            persistent.addParameter(valueObject.get("SITEDESCPLACE"));
            persistent.addParameter(StringUtils.replace(valueObject.get("BID_FROM_DT"),"-",""));
            persistent.addParameter(valueObject.get("BID_FROM_HH"));
            persistent.addParameter(valueObject.get("BID_FROM_MI"));
            persistent.addParameter(StringUtils.replace(valueObject.get("BID_TO_DT"),"-",""));
            persistent.addParameter(valueObject.get("BID_TO_HH"));
            persistent.addParameter(valueObject.get("BID_TO_MI"));
            persistent.addParameter(valueObject.get("PUREMPNO"));
            persistent.addParameter(valueObject.get("PO_EMPNM"));
            persistent.addParameter(valueObject.get("OPEN_EMPNM"));
            persistent.addParameter(valueObject.get("OPEN_EMPID"));
            persistent.addParameter(valueObject.get("TBE_FLAG"));
            persistent.addParameter(valueObject.get("CURRENCY_GB"));
            persistent.addParameter(valueObject.get("CURRENCY_GB_YN"));
            persistent.addParameter(valueObject.get("CONTFUL_RATE"));
            persistent.addParameter(valueObject.get("CONTFUL_CONDI"));
            persistent.addParameter(valueObject.get("WARR_RATE"));
            persistent.addParameter(valueObject.get("WARR_CONDI"));
            persistent.addParameter(valueObject.get("INNER_REMARKS"));
            persistent.addParameter(valueObject.get("OUTER_REMARKS"));
            persistent.addParameter(valueObject.get("BID_APP_DATE"));
            persistent.addParameter(valueObject.get("BID_APP_NO"));
            persistent.addParameter(valueObject.get("STATUS_CD"));
            persistent.addParameter(valueObject.get("ACT_RATE"));
            persistent.addParameter(valueObject.get("PBC_DEFECT_CONDI"));
            persistent.addParameter(valueObject.get("CBC_DERECT_TERM_CD"));
            persistent.addParameter(valueObject.get("CBC_DEFECT_DAY"));
            persistent.addParameter(valueObject.get("PBC_FRSTGUAR_RATE"));
            persistent.addParameter(valueObject.get("PBC_FRSTGUAR_CONDI"));
            persistent.addParameter(valueObject.get("PBC_REST_RATE"));
            persistent.addParameter(valueObject.get("PBC_REST_CONDI"));
            persistent.addParameter(valueObject.get("CPC_MID_RATE"));
            persistent.addParameter(valueObject.get("PBC_MID_CONDI"));
            persistent.addParameter(valueObject.get("CBC_FIRST_RATE"));
            persistent.addParameter(valueObject.get("PBC_FIRST_CONDI"));
            persistent.addParameter(valueObject.get("PAY_CON_RATE"));
            persistent.addParameter(valueObject.get("CBC_DAMAGE_RATE"));
            persistent.addParameter(valueObject.get("CBC_DAMAGE_MAXRATE"));
            persistent.addParameter(valueObject.get("PBC_OPTION_COMMENT"));
            persistent.addParameter(valueObject.get("PBC_OPTION_YN"));
            persistent.addParameter(valueObject.get("PBC_FEE_YN"));
            persistent.addParameter(valueObject.get("DELIVERY_CONDITION"));
            persistent.addParameter(valueObject.get("DELIVERY_CONDITION_YN"));
            persistent.addParameter(valueObject.get("PBC_LANDTRAN_YN"));
            persistent.addParameter(valueObject.get("PBC_PACK_YN"));
            persistent.addParameter(valueObject.get("PBC_DOC_YN"));
            persistent.addParameter(valueObject.get("PBC_TEST_YN"));
            persistent.addParameter(valueObject.get("PBC_SPETOOL_YN"));
            persistent.addParameter(valueObject.get("PBC_COMMISS_YN"));
            persistent.addParameter(valueObject.get("PBC_INSTALL_YN"));
            persistent.addParameter(valueObject.get("PBC_CBE_TYPE_CD"));
            persistent.addParameter(valueObject.get("DIV_PO_YN"));
            persistent.addParameter(valueObject.get("OBC_CONT_TYPE_CD"));
            persistent.addParameter(valueObject.get("OBC_FRST_CASH_RATE"));
            persistent.addParameter(valueObject.get("OBC_FRST_CONDI"));
            persistent.addParameter(valueObject.get("OBC_FRST_CNT_CONDI"));
            persistent.addParameter(valueObject.get("OBC_MID_CASH_RATE"));
            persistent.addParameter(valueObject.get("OBC_MID_BILL_RATE"));
            persistent.addParameter(valueObject.get("OBC_MID_PAYDAY"));
            persistent.addParameter(valueObject.get("OBC_MID_REQ_MONTH"));
            persistent.addParameter(valueObject.get("OBC_MID_CNT"));
            persistent.addParameter(valueObject.get("OBC_MID_BILL_DATE"));
            persistent.addParameter(valueObject.get("OBC_FIN_CASH_RATE"));
            persistent.addParameter(valueObject.get("OBC_FIN_BILL_RATE"));
            persistent.addParameter(valueObject.get("OBC_FIN_PAYDAY"));
            persistent.addParameter(valueObject.get("OBC_FIN_CONDI"));
            persistent.addParameter(valueObject.get("OBC_EMP_RATE"));
            persistent.addParameter(valueObject.get("OBC_EMP_YN"));
            persistent.addParameter(valueObject.get("OBC_PENSION_RATE"));
            persistent.addParameter(valueObject.get("OBC_PENSION_YN"));
            persistent.addParameter(valueObject.get("OBC_HEALTH_RATE"));
            persistent.addParameter(valueObject.get("OBC_HEALTH_YN"));
            persistent.addParameter(valueObject.get("OBC_ELDER_RATE"));
            persistent.addParameter(valueObject.get("OBC_ELDER_YN"));
            persistent.addParameter(valueObject.get("OBC_WORK_RATE"));
            persistent.addParameter(valueObject.get("OBC_WORK_YN"));
            persistent.addParameter(valueObject.get("OBC_RESIGN_RATE"));
            persistent.addParameter(valueObject.get("OBC_RESIGN_YN"));
            persistent.addParameter(valueObject.get("OBC_SAFE_RATE"));
            persistent.addParameter(valueObject.get("OBC_SAFE_YN"));
            persistent.addParameter(valueObject.get("OBC_ENV_RATE"));
            persistent.addParameter(valueObject.get("OBC_ENV_YN"));
            persistent.addParameter(valueObject.get("OBC_SITE_RATE"));
            persistent.addParameter(valueObject.get("OBC_SITE_YN"));
            persistent.addParameter(valueObject.get("OBC_DUTY_RATE"));
            persistent.addParameter(valueObject.get("OBC_DUTY_YN"));
            persistent.addParameter(valueObject.get("OBC_WARR_YN"));
            persistent.addParameter(valueObject.get("OBC_FRST_CONT_RATE"));
            persistent.addParameter(valueObject.get("OBC_IND_YN"));
            persistent.addParameter(valueObject.get("login_user"));
            persistent.addParameter(StringUtils.replace(valueObject.get("DELI_FROM_DY"),"-",""));
            persistent.addParameter(StringUtils.replace(valueObject.get("DELI_TO_DY"),"-",""));
            persistent.addParameter(StringUtils.replace(valueObject.get("DELI_FROM_DY"),"-",""));
            persistent.addParameter(StringUtils.replace(valueObject.get("DELI_TO_DY"),"-",""));
            persistent.addParameter(valueObject.get("MAIN_PR_CONTENTS"));
            persistent.addParameter(valueObject.get("BID_SUPP_SELECT_REASON"));
            persistent.addParameter(StringUtils.replace(valueObject.get("CONT_APP_REQ_DATE"),"-",""));
            persistent.addParameter(valueObject.get("BID_NO"));
            persistent.addParameter(valueObject.get("BID_DEG"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
     * 사용자 수정
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void tbeinfosave(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("MERGE INTO TBE_INFO TI USING (									\n");
        	sqlstr.append("		        SELECT ? AS BID_NO										\n");
        	sqlstr.append("                ,? AS EVAL_EMPNM										\n");
        	sqlstr.append("                ,? AS BID_DEG												\n");
        	sqlstr.append("            	,TO_DATE(?,'YYYYMMDDHH24MISS') AS SUPP_REQ_DY										\n");
        	sqlstr.append("            	,? AS STATUS_CD											\n");
        	sqlstr.append("            	,? AS EVAL_EMPID										\n");
        	sqlstr.append("             	,NVL(?,(SELECT HAND_TEL_NO FROM PUB0120T WHERE ACCT_ID = ?)) AS EVAL_TEL											\n");
        	sqlstr.append("            	,(SELECT E_MAIL FROM PUB0120T WHERE ACCT_ID = ?) AS EVAL_EMAIL										\n");
        	sqlstr.append("		        FROM DUAL													\n");
        	sqlstr.append("		    ) T ON (T.BID_NO = TI.BID_NO AND T.BID_DEG = TI.BID_DEG)	\n");
        	sqlstr.append("		WHEN MATCHED THEN													\n");
        	sqlstr.append("		    UPDATE SET TI.EVAL_EMPNM = T.EVAL_EMPNM								\n");
        	sqlstr.append("            ,TI.SUPP_REQ_DY = T.SUPP_REQ_DY							\n");
        	sqlstr.append("            ,TI.EVAL_EMPID = T.EVAL_EMPID								\n");
        	sqlstr.append("            ,TI.EVAL_TEL = T.EVAL_TEL										\n");
        	sqlstr.append("            ,TI.EVAL_EMAIL = T.EVAL_EMAIL									\n");
        	sqlstr.append("		WHEN NOT MATCHED THEN											\n");
        	sqlstr.append("			INSERT (TI.BID_NO,TI.BID_DEG,TI.EVAL_EMPNM,TI.SUPP_REQ_DY,TI.STATUS_CD,TI.EVAL_EMPID,TI.EVAL_TEL,TI.EVAL_EMAIL)									\n");
        	sqlstr.append("			VALUES (T.BID_NO,T.BID_DEG,T.EVAL_EMPNM,T.SUPP_REQ_DY,T.STATUS_CD,T.EVAL_EMPID,T.EVAL_TEL,T.EVAL_EMAIL)											\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(valueObject.get("BID_NO"));
            persistent.addParameter(valueObject.get("EVAL_EMPNM"));
            persistent.addParameter(valueObject.get("BID_DEG"));
            persistent.addParameter(StringUtils.replace(valueObject.get("SUPP_REQ_DY"),"-",""));
            persistent.addParameter("01");
            persistent.addParameter(valueObject.get("EVAL_EMPID"));
            persistent.addParameter(valueObject.get("EVAL_TEL"));
            persistent.addParameter(valueObject.get("EVAL_EMPID"));
            persistent.addParameter(valueObject.get("EVAL_EMPID"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
     * 파일 삭제
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void PUB0500T_del(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("DELETE PUB0500T						\n");
        	sqlstr.append("WHERE FILE_ID IN (SELECT FILE_ID FROM PUB0510T 						\n");
        	sqlstr.append("WHERE O_FILE_GB IN (?,?)						\n");
        	sqlstr.append("AND O_ID = ?)						\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(valueObject.get("DOC_ETC_IN"));
            persistent.addParameter(valueObject.get("DOC_ETC_OUT"));
            persistent.addParameter(valueObject.get("DEMANDED_ID"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
     * 파일 맵 삭제
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void PUB0510T_del(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("DELETE PUB0510T 						\n");
        	sqlstr.append("WHERE O_FILE_GB IN (?,?)						\n");
        	sqlstr.append("AND O_ID = ?						\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(valueObject.get("DOC_ETC_IN"));
            persistent.addParameter(valueObject.get("DOC_ETC_OUT"));
            persistent.addParameter(valueObject.get("DEMANDED_ID"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
     * 기술 검토 삭제
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void BID_SUPP_del(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        Persistent persistent2 = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        StrBuffer sqlstr2 = new StrBuffer();
        try {
        	sqlstr.append("DELETE TBE_SUPP						\n");
        	sqlstr.append("WHERE BID_NO = ?						\n");
        	
        	sqlstr2.append("DELETE TBE_INFO						\n");
        	sqlstr2.append("WHERE BID_NO = ?						\n");
        	
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(valueObject.get("BID_NO"));
            persistent.execute();
            
            persistent2.setStatement(sqlstr2.toString());
            persistent2.addParameter(valueObject.get("BID_NO"));
            persistent2.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
     * 입찰업체 삭제
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void TBE_INFO_del(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("DELETE BID_SUPP						\n");
        	sqlstr.append("WHERE BID_NO = ?						\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(valueObject.get("BID_NO"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
     * 입찰 내역 삭제
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void BID_ITEM_del(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("DELETE BID_ITEM						\n");
        	sqlstr.append("WHERE BID_NO = ?						\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(valueObject.get("BID_NO"));

            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	
	/**
     * 입찰 마스터 삭제
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void BID_MASTER_del(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("DELETE  BID_MASTER						\n");
        	sqlstr.append("WHERE BID_NO = ?						\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(valueObject.get("BID_NO"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
     * 경적대상업체 저장
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void saveData(Connection connection, ValueObject valueObject) throws Exception {
        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append(" INSERT										\n");
        	sqlstr.append("   INTO BID_SUPP							\n");
        	sqlstr.append("        (										\n");
        	sqlstr.append("            BID_NO							\n");
        	sqlstr.append("          ,BID_DEG							\n");
        	sqlstr.append("          ,VENDOR_CD						\n");
        	sqlstr.append("          ,VENDOR_NO						\n");
        	sqlstr.append("          ,VENDOR_NAME					\n");
        	sqlstr.append("          ,REPRE_NO						\n");
        	sqlstr.append("          ,CHARGE_NAME					\n");
        	sqlstr.append("          ,CHAGE_HP						\n");
        	sqlstr.append("          ,CHARGE_EMAIL					\n");
        	sqlstr.append("          ,RECOMMEND_REASON			\n");
        	sqlstr.append("          ,RECM_DEPT_ID					\n");
        	sqlstr.append("          ,RECM_DEPT_NM				\n");
        	sqlstr.append("          ,SITE_ATTEND_YN				\n");
        	sqlstr.append("          ,SITEPARTI_YN					\n");
        	sqlstr.append("          ,CRE_BY							\n");
        	sqlstr.append("          ,CRE_DATE						\n");
        	sqlstr.append("        )										\n");
        	sqlstr.append("        VALUES								\n");
        	sqlstr.append("        ( ?										\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,?									\n");
        	sqlstr.append("          ,SYSDATE							\n");
        	sqlstr.append("        )										\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(params.get("BID_NO"));
            persistent.addParameter(params.get("BID_DEG"));
            persistent.addParameter(valueObject.get("VENDOR_CD"));
            persistent.addParameter(valueObject.get("VENDOR_NO"));
            persistent.addParameter(valueObject.get("VENDOR_NAME"));
            persistent.addParameter(valueObject.get("REPRE_NO"));
            persistent.addParameter(valueObject.get("CHARGE_NAME"));
            persistent.addParameter(valueObject.get("CHAGE_HP"));
            persistent.addParameter(valueObject.get("CHARGE_EMAIL"));
            persistent.addParameter(valueObject.get("RECOMMEND_REASON"));
            persistent.addParameter(valueObject.get("RECM_DEPT_ID"));
            persistent.addParameter(valueObject.get("RECM_DEPT_NM"));
            persistent.addParameter(valueObject.get("SITE_ATTEND_YN"));
            persistent.addParameter(valueObject.get("SITEPARTI_YN"));
            persistent.addParameter(storage.getUser().get("ACCT_ID"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
     * 경적대상업체 저장
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void updateData(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("UPDATE BID_SUPP								\n");
        	sqlstr.append("       SET VENDOR_NO=?						\n");
        	sqlstr.append("     , VENDOR_NAME=?							\n");
        	sqlstr.append("     , REPRE_NO=?									\n");
        	sqlstr.append("     , CHARGE_NAME=?							\n");
        	sqlstr.append("     , CHAGE_HP=?								\n");
        	sqlstr.append("     , CHARGE_EMAIL=?							\n");
        	sqlstr.append("     , RECOMMEND_REASON=?					\n");
        	sqlstr.append("     , RECM_DEPT_ID=?					\n");
        	sqlstr.append("     , RECM_DEPT_NM=?					\n");
        	sqlstr.append("     , UPD_BY=?									\n");
        	sqlstr.append("     , UPD_DATE=SYSDATE						\n");
        	sqlstr.append(" WHERE BID_NO = ?								\n");
        	sqlstr.append(" AND BID_DEG = ?									\n");
        	sqlstr.append(" AND VENDOR_CD = ?							\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(valueObject.get("VENDOR_NO"));
            persistent.addParameter(valueObject.get("VENDOR_NAME"));
            persistent.addParameter(valueObject.get("REPRE_NO"));
            persistent.addParameter(valueObject.get("CHARGE_NAME"));
            persistent.addParameter(valueObject.get("CHAGE_HP"));
            persistent.addParameter(valueObject.get("CHARGE_EMAIL"));
            persistent.addParameter(valueObject.get("RECOMMEND_REASON"));
            persistent.addParameter(valueObject.get("RECM_DEPT_ID"));
            persistent.addParameter(valueObject.get("RECM_DEPT_NM"));
            persistent.addParameter(storage.getUser().get("ACCT_ID"));
            persistent.addParameter(params.get("BID_NO"));
            persistent.addParameter(params.get("BID_DEG"));
            persistent.addParameter(valueObject.get("VENDOR_CD"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }

	
	/**
     * 경적대상업체 삭제
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void deleteData(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("DELETE FROM BID_SUPP				\n");
        	sqlstr.append(" WHERE  BID_NO = ?						\n");
        	sqlstr.append(" AND BID_DEG = ?							\n");
        	sqlstr.append(" AND VENDOR_CD = ?					\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(valueObject.get("BID_NO"));
            persistent.addParameter(valueObject.get("BID_DEG"));
            persistent.addParameter(valueObject.get("VENDOR_CD"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
     * 결제 상태 업데이트
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void update_BidMaster(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("UPDATE BID_MASTER					\n");
        	sqlstr.append(" SET STATUS_CD = ?					\n");
        	sqlstr.append(" ,UPD_BY = ?								\n");
        	sqlstr.append(" ,UPD_DATE = SYSDATE					\n");
        	sqlstr.append(" WHERE BID_NO = ?						\n");
        	sqlstr.append(" AND BID_DEG = ?							\n");
        	
            persistent.setStatement(sqlstr.toString());
            if("Y".equals(valueObject.get("SITEDESC_FLAG"))){
            	persistent.addParameter("03");
            }else{
            	persistent.addParameter("04");
            }
            persistent.addParameter(storage.getUser().get("ACCT_ID"));
            persistent.addParameter(valueObject.get("BID_NO"));
            persistent.addParameter(valueObject.get("BID_DEG"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
	 * 발주의뢰 접수
	 * @return
	 */
	private void PMM_DEMANDED_REQUEST_update(Connection connection) throws Exception{
		StrBuffer sqlstr = new StrBuffer();
		Persistent pstmt = new PersistentImpl(connection);
        try{
			pstmt.clear();
			sqlstr = new StrBuffer();
			sqlstr.append("     UPDATE PMM_DEMANDED_REQUEST			\n");
			sqlstr.append("       SET DEMANDED_STATUS = '3'					\n");				
			sqlstr.append("            ,ONBID_YN = ''									\n");
			sqlstr.append("            ,RECEIPT_DATE = ''							\n");
			sqlstr.append("            ,RECEIPT_NO = ''								\n");
			sqlstr.append("            ,UPD_BY = ?									\n");
			sqlstr.append("            ,UPD_DATE = SYSDATE 						\n");
			sqlstr.append("            WHERE DEMANDED_ID = ?					\n");
        	pstmt.setStatement(sqlstr.toString());
			pstmt.addParameter(storage.getUser().get("acct_id"));
			pstmt.addParameter(params.get("DEMANDED_ID"));
			pstmt.execute();
        }catch (Exception e){
			WAFLogger.error(e);
			throw new Exception(e);
        }
	}
	
	/**
     * 경적대상업체 삭제
	 * @param connection
	 * @throws Exception
	 */
	public void deleteData(Connection connection) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("DELETE FROM BID_SUPP				\n");
        	sqlstr.append(" WHERE  BID_NO = ?						\n");
        	sqlstr.append(" AND BID_DEG = ?							\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(params.get("BID_NO"));
            persistent.addParameter(params.get("BID_DEG"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> deleteData() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
	 * 			결제중인지 확인 합니다.
	 */
	private String getDupCnt1(String signClassCd, String key_col1, String key_col2) {

		Search search = new SearchImpl(); 
		RowSet rowSet = new RowSetImpl();
		StringBuffer sqlstr = new StringBuffer();
		String rtnStr = "";
		try {
			sqlstr.append(" SELECT  COUNT(*) AS CNT                                                                   	\n");
			sqlstr.append(" FROM    SIGN001T                                                                     	\n");
			sqlstr.append("	WHERE SIGN_CLASS_CD = '"+signClassCd+"'												\n");
			if(!key_col1.isEmpty())
				sqlstr.append("	AND KEY_COL1 = '"+key_col1+"'	 														\n");
			if(!key_col2.isEmpty())
				sqlstr.append("	AND KEY_COL2 = '"+key_col2+"'	 														\n");
			sqlstr.append("	AND ATTR_6  = '0'  																				\n");
			search.setStatement(sqlstr);
			rowSet = search.execute();
			if(rowSet != null && rowSet.size() > 0 ) {
				rtnStr = rowSet.getRow(0).get("CNT");
			}
		}
		catch (Exception e) {
			super.doException(e);
			this.storage.setSuccess(false);
			this.storage.setMessage(e.getMessage());
			storage.setDetailMessage(e);
		}

		return rtnStr;
	}
 
	/**
	 * 발주의뢰 상태값 업데이트
	 * @return
	 */
	public boolean update_mrreq_po(Connection connection,String ebid_staus_code) throws Exception {
		StrBuffer sqlstr = new StrBuffer();
		Persistent pstmt = new PersistentImpl(connection);
		try{
			sqlstr.append("	UPDATE ETECEPC.MR_REQ_PO							\n");
			sqlstr.append("	SET EBID_STATUS = ?									\n");
			sqlstr.append("	WHERE BUYREQNO = ?									\n");
			pstmt.setStatement(sqlstr.toString());
			pstmt.addParameter(ebid_staus_code);
			pstmt.addParameter(params.get("DEMANDED_ID"));
			pstmt.execute();
			return true;
		}catch (Exception e){
			WAFLogger.error(e);
			throw new Exception(e);
		}
	}
	/**
	 * 발주의뢰 상태값 업데이트
	 * @return
	 */
	private boolean update_pmm_demanded_request(Connection connection,String status_code) throws Exception {
		StrBuffer sqlstr = new StrBuffer();
		Persistent pstmt = new PersistentImpl(connection);
		try{
			sqlstr.append("	UPDATE PMM_DEMANDED_REQUEST					\n");
			sqlstr.append("	SET EBID_STATUS_CD = ?											\n");
			sqlstr.append("	WHERE DEMANDED_ID = ?											\n");
			pstmt.setStatement(sqlstr.toString());
			pstmt.addParameter(status_code);
			pstmt.addParameter(params.get("DEMANDED_ID"));
			pstmt.execute();
			return true;
		}catch (Exception e){
			WAFLogger.error(e);
			throw new Exception(e);
		}
	}

	/**
     * 보고자 저장
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void saveData2(Connection connection, ValueObject valueObject) throws Exception {
        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	String seq = "SELECT DECODE(MAX(OPEN_NO)+1, '', 1, MAX(OPEN_NO)+1) FROM BID_OPEN_REPORT WHERE BID_NO='" + params.get("BID_NO") + "' AND BID_DEG='" + params.get("BID_DEG") + "'";
        	
        	sqlstr.append(" INSERT									\n");
        	sqlstr.append("   INTO BID_OPEN_REPORT					\n");
        	sqlstr.append("        (								\n");
        	sqlstr.append("           BID_NO						\n");
        	sqlstr.append("          ,BID_DEG						\n");
        	sqlstr.append("          ,EMP_ID						\n");
        	sqlstr.append("          ,USER_NAME						\n");
        	sqlstr.append("          ,GRADE_NAME					\n");
        	sqlstr.append("          ,DEPART_DEPT_NM				\n");
        	sqlstr.append("          ,OPEN_NO						\n");
        	sqlstr.append("          ,CRE_BY						\n");
        	sqlstr.append("          ,CRE_DATE						\n");
        	sqlstr.append("        )								\n");
        	sqlstr.append("        VALUES							\n");
        	sqlstr.append("        ( ?								\n");
        	sqlstr.append("          ,?								\n");
        	sqlstr.append("          ,?								\n");
        	sqlstr.append("          ,?								\n");
        	sqlstr.append("          ,?								\n");
        	sqlstr.append("          ,?								\n");
        	sqlstr.append("          ,(" + seq + ")					\n");
        	sqlstr.append("          ,?								\n");
        	sqlstr.append("          ,SYSDATE						\n");
        	sqlstr.append("        )								\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(params.get("BID_NO"));
            persistent.addParameter(params.get("BID_DEG"));
            persistent.addParameter(valueObject.get("ACCT_ID"));
            persistent.addParameter(valueObject.get("USER_NAME"));
            persistent.addParameter(valueObject.get("GRADE_NAME"));
            persistent.addParameter(valueObject.get("BUSEO_NAME"));
            persistent.addParameter(storage.getUser().get("ACCT_ID"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> saveData3() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }

	
	/**
     * 보고자 삭제
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void deleteData2(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("DELETE FROM BID_OPEN_REPORT				\n");
        	sqlstr.append(" WHERE  BID_NO = ?						\n");
        	sqlstr.append(" AND BID_DEG = ?							\n");
        	sqlstr.append(" AND EMP_ID = ?					\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(params.get("BID_NO"));
            persistent.addParameter(params.get("BID_DEG"));
            persistent.addParameter(valueObject.get("ACCT_ID"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> deleteData() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
     * 보고자 전체 삭제
	 * @param connection
	 * @throws Exception
	 */
	public void BID_OPEN_REPORT_del(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("DELETE  BID_OPEN_REPORT						\n");
        	sqlstr.append("WHERE BID_NO = ?						\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(valueObject.get("BID_NO"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> updUser() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
}