/**
 * @(#)file    BidIngBiz.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 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.hsnc.common.base.WAFLogger;
import kr.co.hsnc.common.sql.persistent.Persistent;
import kr.co.hsnc.common.sql.persistent.PersistentImpl;
import kr.co.hsnc.common.util.ValueObject;
import kr.co.udapsoft.ebid.buyer.bid.purchase.biz.BidCommonBiz;
import oracle.toplink.internal.ox.StrBuffer;

   
public class SuccessBidSaveBiz extends Biz {

	public SuccessBidSaveBiz(HandlerStorage storage) {
		super(storage);
	}
	ValueObject rtnVo = new ValueObject();
	public void doBiz() throws Exception {
        ValueObject user = new ValueObject();
		boolean success = false;
		
		if(storage.compareEvent("SAVE_APPR") || storage.compareEvent("SAVE_SHEET")){//저장
			
				/**
				 *                        결제
				 */

			//업체 업데이트
			 success = saveProc(storage.getEvent());
			//마스터 업데이트
		}else if(storage.compareEvent("FORM_CANCEL_UPDATE")){//유찰
        	success = BidmasterStatusUpdate(params,storage.getEvent());
        	if("B".equals(params.get("DEMANDED_KIND"))) {
				update_mrreq_po(conn.getConnection(),"91");//유찰일경우 상태 취소로 전달
        	}

        	if(success){
	        	// SMS // // E-MAIL //
	        	ScrchInfoBiz ScrchInfo = new ScrchInfoBiz(storage);
	        	ScrchInfo.Send(params, storage.getEvent());
        	}
        }else if(storage.compareEvent("SAVE_PLAN")){//입찰계획으로 상태값 변경
        	success = updateMasterStatus(conn.getConnection());
        }else if(storage.compareEvent("SET_REPORT_EMP_DELETE")){
			String[] status = super.gets("sheet3.STATUS");
			try {
				super.conn.begin();
				
				for (int i = 0; i < status.length; i++) {
					if (IBSheet7Utils.equalStatusDelete(status[i])) {
						success = report_emp_delete(super.conn.getConnection(), IBSheet7Utils.getIBSheet7SqlParams("SHEET3", params, i));
					}
				}
				super.storage.setSuccess(success);
				storage.addObject("ibsheet7Data", IBSheet7Factory.createIBSheet7(params, storage.request));
			} catch (Exception e) {
				WAFLogger.error(e);
				super.conn.setRollback();
				throw new Exception(e);
				
			} finally {
				super.conn.close();
			}
		}else if(storage.compareEvent("REPORT_EMP_UPDATE")){
            //유관부서 담당자 정보
			try{
				super.conn.begin();
	        	String[] status3 = super.gets("sheet3.STATUS");
	            for (int i = 0; i < status3.length; i++) {
					if (IBSheet7Utils.equalStatusInsert(status3[i])) {
						saveData3(super.conn.getConnection(), IBSheet7Utils.getIBSheet7SqlParams("SHEET3", params, i));
					}
					if (IBSheet7Utils.equalStatusDelete(status3[i])) {
						deleteData3(super.conn.getConnection(), IBSheet7Utils.getIBSheet7SqlParams("SHEET3", params, i));
					}
				}
	            super.storage.setSuccess(success);
				storage.addObject("ibsheet7Data", IBSheet7Factory.createIBSheet7(params, storage.request));
			}catch(Exception e){	            
	        	WAFLogger.error(e);
				super.conn.setRollback();
				throw new Exception(e);
			}finally {
				super.conn.close();
			}
    	}
		super.storage.setSuccess(success);
		if(success)
			storage.addObject("ibsheet7Data", IBSheet7Factory.createIBSheet7(params, storage.request));
	}
	
	  /**
     * 사용자 정보 저장
	 * @param event
	 * @param valueObject
	 * @return
	 */
	public boolean saveProc(String event) {
        try {
            conn.begin();
            
            BidCommonBiz com = new BidCommonBiz(storage);
            String dupCnt = com.getDupCnt1("ebid_opoD", params.get("BID_NO"),params.get("BID_DEG"));
            
            if( !"0".equals(dupCnt) ){
            	storage.setMessage("시행결의중 입니다.");
            	throw new Exception("시행결의중 입니다.");
            }
            
            String[] status = super.gets("sheet1.STATUS");
            for (int i = 0; i < status.length; i++) {
				if (IBSheet7Utils.equalStatusUpdate(status[i])) {
					ValueObject vo = IBSheet7Utils.getIBSheet7SqlParams("SHEET1", params, i);
					saveData(super.conn.getConnection(), vo);
					WAFLogger.debug(params.get("ONBID_YN"));
					WAFLogger.debug(vo.get("EVAL_RESULT"));
					if(!vo.get("EVAL_RESULT").isEmpty() && "N".equals(params.get("ONBID_YN")))
						TBESave(super.conn.getConnection(), vo);
				}
			}
            saveBidMaster(super.conn.getConnection());
            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();
        }
    }
	
	/**
     * 원화 저장 여부 BID_MASTER에 업데이트
	 * @param connection
	 * @throws Exception
	 */
	public void saveBidMaster(Connection connection) throws Exception {
        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("  UPDATE BID_MASTER 	\n");
        	sqlstr.append("  SET DELI_START_DT = ?	\n"); 
        	sqlstr.append("  ,DELI_END_DT =?	\n"); 
        	sqlstr.append("  ,DELI_FROM_DY = ?	\n"); //2016.12.8
        	sqlstr.append("  ,DELI_TO_DY =?   	\n"); 
        	sqlstr.append("  ,INNER_REMARKS =?	\n"); 
        	sqlstr.append("  ,OUTER_REMARKS = ?	\n");
        	sqlstr.append("  ,CONT_AMT = ?	\n");  //도급금액
        	sqlstr.append("  ,ACT_AMT = ?	\n");  //실행예산
        	sqlstr.append("  ,ACT_RATE = ?	\n");  //실행율 2018.04.09
        	sqlstr.append("  ,PUR_AMT = ?	\n");  //2015.3.2 외주예산추가 MKLEE
        	sqlstr.append("  ,CONF_NO = ?	\n");  //2015.3.30 계약번호 추가
        	sqlstr.append("  ,MAIN_PR_CONTENTS  = ? \n");
        	sqlstr.append("  ,BID_SUPP_SELECT_REASON  = ? \n");
        	sqlstr.append("  ,PO_PRC  = ? \n");
        	sqlstr.append("  ,RES_PRC  = ? \n");
        	sqlstr.append("  WHERE BID_NO = ?	\n");
        	sqlstr.append("  AND BID_DEG = ?	\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(params.get("DELI_START_DT").replaceAll("-", ""));
            persistent.addParameter(params.get("DELI_END_DT").replaceAll("-", ""));
            persistent.addParameter(params.get("DELI_START_DT").replaceAll("-", ""));  //2016.12.8
            persistent.addParameter(params.get("DELI_END_DT").replaceAll("-", ""));
            persistent.addParameter(params.get("INNER_REMARKS"));
            persistent.addParameter(params.get("OUTER_REMARKS"));
            persistent.addParameter(StringUtils.replace(params.get("CONT_AMT"),",",""));    //2015.02.27 구매예산 시행결의전 수정 mklee 
            persistent.addParameter(StringUtils.replace(params.get("ACT_AMT"),",",""));    //2015.02.27 구매예산 시행결의전 수정 mklee 
            persistent.addParameter(params.get("ACT_RATE"));                               //2018.04.09 
            persistent.addParameter(StringUtils.replace(params.get("PUR_AMT"),",",""));    //2015.02.27 구매예산 시행결의전 수정 mklee 
            persistent.addParameter(params.get("CONF_NO"));	//2015.3.30 계약번호 추가
            persistent.addParameter(params.get("MAIN_PR_CONTENTS"));
            persistent.addParameter(params.get("BID_SUPP_SELECT_REASON"));
            persistent.addParameter(params.get("PO_PRC"));
            persistent.addParameter(params.get("RES_PRC"));
            persistent.addParameter(params.get("BID_NO"));
            persistent.addParameter(params.get("BID_DEG"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> saveBidMaster() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
	/**
     * BID_SUPP 업데이트
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void TBESave(Connection connection, ValueObject valueObject) throws Exception {
        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("  MERGE INTO TBE_SUPP T USING	\n");
        	sqlstr.append("  (SELECT ? AS BID_NO					\n");
        	sqlstr.append("  , ? AS BID_DEG							\n");
        	sqlstr.append("  , ? AS VENDOR_CD						\n");
        	sqlstr.append("  , ? AS EVAL_RESULT					\n");
        	sqlstr.append("  FROM DUAL) D ON (T.BID_NO = D.BID_NO AND T.BID_DEG = D.BID_DEG AND T.VENDOR_CD = D.VENDOR_CD)					\n");
        	sqlstr.append("  WHEN MATCHED THEN					\n");
        	sqlstr.append("  UPDATE					\n");
        	sqlstr.append("  SET EVAL_RESULT = D.EVAL_RESULT					\n");
        	sqlstr.append("  WHEN NOT MATCHED THEN					\n");
        	sqlstr.append("  INSERT ( BID_NO,BID_DEG,VENDOR_CD,EVAL_RESULT)					\n");
        	sqlstr.append("  VALUES					\n");
        	sqlstr.append("  (D.BID_NO,D.BID_DEG,D.VENDOR_CD,D.EVAL_RESULT)					\n");
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(valueObject.get("BID_NO"));
            persistent.addParameter(valueObject.get("BID_DEG"));
            persistent.addParameter(valueObject.get("VENDOR_CD"));
            persistent.addParameter(valueObject.get("EVAL_RESULT"));
            persistent.execute();
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> TBESave() : " + 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 {
        	
        	String SUCC_YN = "";
        	sqlstr.append("  UPDATE BID_SUPP	\n");
        	sqlstr.append("  SET SUCC_YN = ?	\n");
        	sqlstr.append("  ,DISQ_REASON = ?	\n");
        	sqlstr.append("  ,WON_ESTI_TOT_AMT = ?	\n");  //2015.11.23
        	sqlstr.append("  ,EXCHANGE = ?	\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());
            if(valueObject.get("SUCC_YN_CK").equals("1"))
            	SUCC_YN = "Y";
            else if(valueObject.get("SUCC_YN_CK").equals("0"))
            	SUCC_YN = "N";
            persistent.addParameter(SUCC_YN);
            persistent.addParameter(valueObject.get("DISQ_REASON"));
            persistent.addParameter(valueObject.get("WON_ESTI_TOT_AMT"));  //2015.11.23
            persistent.addParameter(valueObject.get("EXCHANGE"));
            persistent.addParameter(storage.getUser().get("ACCT_ID"));
            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 = '10'		\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());
            persistent.addParameter(storage.getUser().get("ACCT_ID"));
            persistent.addParameter(params.get("BID_NO"));
            persistent.addParameter(params.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 event
	 * @param valueObject
	 * @return
	 */
	public boolean BidmasterStatusUpdate(ValueObject valueObject,String event) {
		conn.begin(); 
		StrBuffer sqlstr = new StrBuffer();
        try {
        	
        	Persistent persistent = new PersistentImpl(conn.getConnection());
            sqlstr.append("UPDATE BID_MASTER		\n");
        	sqlstr.append("SET STATUS_CD = ?			\n");
       		sqlstr.append(",FIB_REASON = ?				\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());
            persistent.addParameter("91");
            persistent.addParameter(valueObject.get("FIBREASON"));
            persistent.addParameter(storage.getUser().get("ACCT_ID"));
            persistent.addParameter(valueObject.get("BID_NO"));
            persistent.addParameter(valueObject.get("BID_DEG"));
            persistent.execute();
            
            String demandedId = InterfaceOutERPiU.getDemandedId(valueObject.get("BID_NO"), valueObject.get("BID_DEG"));
            InterfaceOutERPiU.updateStatusPMM(demandedId, "91");
            
            return true;
        }
        catch(Exception e) {
        	storage.addObject("ibsheet7Data", IBSheet7Utils.exceptionHandle(storage.request, e));
            WAFLogger.error(this.getClass().getName() + " --> BidmasterStatusUpdate() : " + e.getMessage());
            WAFLogger.error(e);
            conn.setRollback();
            storage.setDetailMessage(e);
            return false;
        }
        finally {
        	
            conn.end();
        }
    }
	
	  /**
     * 견적대상업체 저장
	 * @param event
	 * @param valueObject
	 * @return
	 */
	public boolean save(String event) {
        try {
            conn.begin();

            if( event.equals("SAVE_SHEET") ) {
                String[] status = super.gets("sheet1.STATUS");
                for (int i = 0; i < status.length; i++) {
					if (IBSheet7Utils.equalStatusUpdate(status[i])) {
						saveData(super.conn.getConnection(), IBSheet7Utils.getIBSheet7SqlParams("SHEET1", params, i));
					}
				}
                update_BidMaster(conn.getConnection(), params);
        	}
            return true;
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> save() : " + e.getMessage());
            WAFLogger.error(e);
            conn.setRollback();

            storage.setDetailMessage(e);
            return false;
        }
        finally {
        	
            conn.end();
        }
    }
	
	public boolean update_mrreq_po(Connection connection,String ebid_staus_code) throws Exception {
		return update_mrreq_po(connection,ebid_staus_code,"");
	}

	/**
	 * 발주의뢰 상태값 업데이트
	 * @return
	 */
	public boolean update_mrreq_po(Connection connection,String ebid_staus_code,String status_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");
				if("9".equals(status_code))
					sqlstr.append("	, REQ_STATUS = ?										\n");
				sqlstr.append("	WHERE BUYREQNO = ?									\n");
		       	pstmt.setStatement(sqlstr.toString());
		       	pstmt.addParameter(ebid_staus_code);
		       	if("9".equals(status_code))
		       		pstmt.addParameter("9");
				pstmt.addParameter(params.get("DEMANDED_ID"));
				pstmt.execute();
				return true;
	        }catch (Exception e){
				WAFLogger.error(e);
				throw new Exception(e);
	        }
	}
	
	/**
     * 입찰계획으로 상태값 변경
	 * @param event
	 * @param valueObject
	 * @return
	 */
	public boolean updateMasterStatus(Connection connection) {
		conn.begin(); 
		StrBuffer sqlstr = new StrBuffer();
        try {
        	
        	Persistent persistent = new PersistentImpl(conn.getConnection());
            sqlstr.append("UPDATE BID_MASTER		\n");
        	sqlstr.append("SET STATUS_CD = '00'		\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());
            persistent.addParameter(storage.getUser().get("ACCT_ID"));
            persistent.addParameter(params.get("BID_NO"));
            persistent.addParameter(params.get("BID_DEG"));
            persistent.execute();
            
            String demandedId = InterfaceOutERPiU.getDemandedId(params.get("BID_NO"), params.get("BID_DEG"));
            InterfaceOutERPiU.updateStatusPMM(demandedId, "00");
            
            
            return true;
        }
        catch(Exception e) {
        	storage.addObject("ibsheet7Data", IBSheet7Utils.exceptionHandle(storage.request, e));
            WAFLogger.error(this.getClass().getName() + " --> BidmasterStatusUpdate() : " + e.getMessage());
            WAFLogger.error(e);
            conn.setRollback();
            storage.setDetailMessage(e);
            return false;
        }
        finally {
        	
            conn.end();
        }
    }
	
	private boolean report_emp_delete(Connection connection, ValueObject valueObject) throws Exception{
		Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        
		try{
			sqlstr.append("DELETE BID_DECIDE_MAIL_LIST					\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();
			return true;
		} catch (Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> report_emp_delete() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
		}
	}
	
	/**
     * 유관부서 담당자 저장
	 * @param connection
	 * @param valueObject
	 * @throws Exception
	 */
	public void saveData3(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_DECIDE_MAIL_LIST WHERE BID_NO='" + params.get("BID_NO") + "' AND BID_DEG='" + params.get("BID_DEG") + "'";
        	
        	sqlstr.append(" INSERT									\n");
        	sqlstr.append("   INTO BID_DECIDE_MAIL_LIST					\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();
            System.out.println(sqlstr);
        }
        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 deleteData3(Connection connection, ValueObject valueObject) throws Exception {

        Persistent persistent = new PersistentImpl(connection);
        StrBuffer sqlstr = new StrBuffer();
        try {
        	sqlstr.append("DELETE FROM BID_DECIDE_MAIL_LIST				\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();
            System.out.println(sqlstr);
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> deleteData() : " + e.getMessage());
            WAFLogger.error("SQL : " + sqlstr);
            WAFLogger.error(e);
            throw e;
        }
    }
	
}