/**
 * @(#)file    GetEhrDataBiz.java
 * @(#)author  gyeongmo an
 * @(#)date    2014.6.30
 */

package kr.co.udapsoft.ebid.buyer.sycs.user.biz;

import java.sql.CallableStatement;

import kr.co.hsnc.common.base.WAFLogger;
import kr.co.hsnc.common.util.ValueObject;

import com.udapsoft.waf.system.Biz;
import com.udapsoft.waf.system.HandlerStorage;


public class GetEhrDataBiz extends Biz {

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

	public void doBiz() throws Exception {
		
		String event = storage.getEvent();
        boolean success = false;

        success = saveUserProc(event, params);
        storage.setSuccess(success);
	}
	
	
	 /**
     * 사용자 정보 동기화
	 * @param event
	 * @param valueObject
	 * @return
	 */
	public boolean saveUserProc(String event, ValueObject valueObject) {

        try {
            conn.begin();
            
            if( event.equals("GET_EHR_DATA") ) {
        		CallableStatement cs 	= null;
        		String pssql			= "";
        		
            	pssql = "{call SP_GET_EHR_EMPDATA()}";
            	cs = super.conn.getConnection().prepareCall(pssql);
            	cs.execute();
            	
            }

            return true;
        }
        catch(Exception e) {
    
            WAFLogger.error(this.getClass().getName() + " --> saveUserProc() : " + e.getMessage());
            WAFLogger.error(e);
            conn.setRollback();

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