/**
 * @(#)file    UserListBiz.java
 * @(#)author  Joung Kyu Park
 * @(#)version 1.0
 * @(#)date    May 31, 2007
 * @(#)since   JDK 1.4.2
 *
 * Copyright (c) www.hwenc.co.kr, Inc.
 * All rights reserved.
 * This software is the proprietary information of Hanwha E&C, Inc.
 */
package kr.co.udapsoft.ebid.buyer.supplier.purchase.biz;



import java.sql.Connection;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;

import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

import kr.co.hsnc.common.base.WAFLogger;
import kr.co.hsnc.common.base.WAFMessages;
import kr.co.hsnc.common.logger.Logger;
import kr.co.hsnc.common.sql.RowSet;
import kr.co.hsnc.common.sql.RowSetImpl;
import kr.co.hsnc.common.sql.WAFSQLException;
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.sql.util.RowSetUtility;
import kr.co.hsnc.common.util.ValueObject;
import kr.co.udapsoft.common.sender.MessageSend;
import kr.co.udapsoft.common.sender.SmtpAuth;
import kr.co.udapsoft.ebid.buyer.supplier.purchase.biz.SuppJoinRequestListBiz;



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





public class SuppJoinRequestSaveBiz extends Biz {

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

	public void doBiz() throws Exception {

		WAFLogger.debug("event==============>" + storage.getEvent());
		
		if(storage.compareEvent(""))
		{

		}
		else if(storage.compareEvent("SAVE_DATA"))
        {
			saveData();
        }
		else if(storage.compareEvent("SAVE_DATA2"))
        {
			saveData2();
        }
		else if(storage.compareEvent("UPDATE_DATA"))
        {
			updateData();
        }
		else if(storage.compareEvent("DELETE_DATA"))
        {
		   deleteData();
		    
        }else if ( storage.compareEvent("NEW_SAVE_DATA") ) {
        	newSaveData();
        }else if ( storage.compareEvent("NEW_UPDATE_DATA") ) {
        	newUpdateData();
        }
	}
	
	private void newSaveData() throws Exception{

	    boolean success = false;
	    boolean success2 = false;
	    
	    try 
        {
            conn.begin();
            
            String yyyymmdd = (new java.text.SimpleDateFormat ("yyyyMMdd")).format (new java.util.Date());
            params.set("user_id", yyyymmdd);
            
            String corp_no = params.get("corp_reg_no");
            String corp_gubun = "";
            
            corp_no = corp_no.substring(3, 5);
            
            if(corp_no.equals("81") || corp_no.equals("82") || corp_no.equals("83") ||corp_no.equals("84") || corp_no.equals("85") || corp_no.equals("86") || corp_no.equals("87") || corp_no.equals("88"))
            {
                corp_gubun = "1";
            }
            else
            {
                corp_gubun = "2";
            }
            params.set("corp_gubun", corp_gubun); 
            
            
            ValueObject corp_id = getCorp_no(conn.getConnection()); 
            
            if(!corp_id.get("cnt").equals("0"))
            {
                String message = "이미 등록된 사업자 번호 입니다.";
                //                WAFLogger.error(message);
                Exception e = new Exception(message);

                
                ValueObject errMsg = new ValueObject();
                errMsg.set("errMsg", message);
                
                storage.addValueObject("VALUEOBJECT", errMsg);
                super.storage.setSuccess(false);
            }
            else
            {
                try 
                {
                    success = save_info(params); 
                    success2 = save_charge(params);
                    
                } catch (Exception e) {
                    e.printStackTrace();
                }
                
                
                if(success == true && success2 == true)
                {
                    String message = "등록성공";
                    ValueObject errMsg = new ValueObject();
                    errMsg.set("errMsg", message);
                    storage.addValueObject("VALUEOBJECT", errMsg);
                    
                    super.storage.setSuccess(success);
                }
                else
                {
                    String message = "등록실패";
                    //                WAFLogger.error(message);
                    Exception e = new Exception(message);
                    
                    ValueObject errMsg = new ValueObject();
                    errMsg.set("errMsg", message);
                    storage.addValueObject("VALUEOBJECT", errMsg);
                    
                    
                    super.storage.setSuccess(false);
                    throw e;
                }
            }
            
        } catch (Exception e) {
            WAFLogger.error(e);
            e.printStackTrace();
            conn.setRollback();
            throw new Exception(e);
            
        } finally {
            conn.end();
        }   
		
	}
	
	private void newUpdateData() throws Exception{
		
		boolean success = false;
		boolean success2 = false;
		
		try 
		{
			conn.begin();
			
			String yyyymmdd = (new java.text.SimpleDateFormat ("yyyyMMdd")).format (new java.util.Date());
			params.set("user_id", yyyymmdd);
			
			String corp_no = params.get("corp_reg_no");
			String corp_gubun = "";
			
			corp_no = corp_no.substring(3, 5);
			
			if(corp_no.equals("81") || corp_no.equals("82") || corp_no.equals("83") ||corp_no.equals("84") || corp_no.equals("85") || corp_no.equals("86") || corp_no.equals("87") || corp_no.equals("88"))
			{
				corp_gubun = "1";
			}
			else
			{
				corp_gubun = "2";
			}
			params.set("corp_gubun", corp_gubun); 
			
			
			try 
			{
				success = update_info(params); 
				success2 = update_charge(params);
				
			} catch (Exception e) {
				e.printStackTrace();
			}
			
			
			if(success == true && success2 == true)
			{
				String message = "수정성공";
				ValueObject errMsg = new ValueObject();
				errMsg.set("errMsg", message);
				storage.addValueObject("VALUEOBJECT", errMsg);
				
				super.storage.setSuccess(success);
			}
			else
			{
				String message = "수정실패";
				//                WAFLogger.error(message);
				Exception e = new Exception(message);
				
				ValueObject errMsg = new ValueObject();
				errMsg.set("errMsg", message);
				storage.addValueObject("VALUEOBJECT", errMsg);
				
				
				super.storage.setSuccess(false);
				throw e;
			}
			
		} catch (Exception e) {
			WAFLogger.error(e);
			e.printStackTrace();
			conn.setRollback();
			throw new Exception(e);
			
		} finally {
			conn.end();
		}   
		
	}
	
	private void saveData() throws Exception{

	    boolean success = false;
	    boolean success2 = false;
	    
	    try 
        {
            conn.begin();
            
            String yyyymmdd = (new java.text.SimpleDateFormat ("yyyyMMdd")).format (new java.util.Date());
            params.set("user_id", yyyymmdd);
            
            String corp_no = params.get("corp_reg_no");
            String corp_gubun = "";
            
            corp_no = corp_no.substring(3, 5);
            
            if(corp_no.equals("81") || corp_no.equals("82") || corp_no.equals("83") ||corp_no.equals("84") || corp_no.equals("85") || corp_no.equals("86") || corp_no.equals("87") || corp_no.equals("88"))
            {
                corp_gubun = "1";
            }
            else
            {
                corp_gubun = "2";
            }
            params.set("corp_gubun", corp_gubun); 
            
            
            
            ValueObject corp_id = getCorp_no(conn.getConnection()); 
            
            if(!corp_id.get("cnt").equals("0"))
            {
                String message = "이미 등록된 사업자 번호 입니다.";
                //                WAFLogger.error(message);
                Exception e = new Exception(message);

                
                ValueObject errMsg = new ValueObject();
                errMsg.set("errMsg", message);
                
                storage.addValueObject("VALUEOBJECT", errMsg);
                super.storage.setSuccess(false);
            }
            else
            {
                try 
                {
                    success = save_info(params); 
                    success2 = save_charge(params);
                    
                    WAFLogger.debug(success);
                    WAFLogger.debug(success2);
                    
                } catch (Exception e) {
                	WAFLogger.debug("e=eeee=====>" + e);
                    e.printStackTrace();
                }
                
                
                if(success == true && success2 == true)
                {
                    String message = "등록성공";
                    ValueObject errMsg = new ValueObject();
                    errMsg.set("errMsg", message);
                    storage.addValueObject("VALUEOBJECT", errMsg);
                    
                    super.storage.setSuccess(success);
                }
                else
                {
                    String message = "등록실패";
                    //                WAFLogger.error(message);
                    Exception e = new Exception(message);
                    
                    ValueObject errMsg = new ValueObject();
                    errMsg.set("errMsg", message);
                    storage.addValueObject("VALUEOBJECT", errMsg);
                    
                    
                    super.storage.setSuccess(false);
                    throw e;
                }
            }
            
        } catch (Exception e) {
            WAFLogger.error(e);
            e.printStackTrace();
            conn.setRollback();
            throw new Exception(e);
            
        } finally {
            conn.end();
        }   
		
	}
	
	private void saveData2() throws Exception{

        boolean success = false;
        boolean success2 = false;
        
        try 
        {
            conn.begin();
            
            String yyyymmdd = (new java.text.SimpleDateFormat ("yyyyMMdd")).format (new java.util.Date());
            params.set("user_id", yyyymmdd);
            
            String corp_no = params.get("corp_reg_no");
            String corp_gubun = "";
            
            corp_no = corp_no.substring(3, 5);
            
            if(corp_no.equals("81") || corp_no.equals("82") || corp_no.equals("83") ||corp_no.equals("84") || corp_no.equals("85") || corp_no.equals("86") || corp_no.equals("87") || corp_no.equals("88"))
            {
                corp_gubun = "1";
            }
            else
            {
                corp_gubun = "2";
            }
            params.set("corp_gubun", corp_gubun); 
            
            
            
            ValueObject corp_id = getCorp_no(conn.getConnection()); 
            
            if(!corp_id.get("cnt").equals("0"))
            {
                String message = "이미 등록된 사업자 번호 입니다.";
                //                WAFLogger.error(message);
                Exception e = new Exception(message);

                
                ValueObject errMsg = new ValueObject();
                errMsg.set("errMsg", message);
                
                storage.addValueObject("VALUEOBJECT", errMsg);
                super.storage.setSuccess(false);
            }
            else
            {
                try 
                {
                    
                    success = save_info(params); 
                    success2 = save_charge(params);
                    
                    WAFLogger.debug(success);
                    WAFLogger.debug(success2);
                    
                } catch (Exception e) {
                	WAFLogger.debug("e=eeee=====>" + e);
                    e.printStackTrace();
                }
                
                
                if(success == true && success2 == true)
                {
                	SuppJoinRequestListBiz biz  = new SuppJoinRequestListBiz(storage);
                	
                    String message = "등록성공";
                    ValueObject errMsg = new ValueObject();
                    errMsg.set("errMsg", message);
                    storage.addValueObject("VALUEOBJECT", errMsg);
                    
                    
                    /*
                    MessageSend messageSend = new MessageSend(storage);
                    
                    
                    String subject = WAFMessages.getMessage("Register.Supplier.Request.Mail.Title");
                    String subject_in = WAFMessages.getMessage("Register.Supplier.Request.Mail.Title.in");
                    
                    StringBuffer mailContent = new StringBuffer();
                    mailContent.append("<span class='style4'>"+params.get("corp_kor") + " 업체님</span><br/>    \n");
                    mailContent.append( WAFMessages.getMessage("Register.Supplier.Request.Mail.Content") );
                    
                    messageSend.sendEmail(params.get("email"), "test", subject, subject_in, mailContent);
                    
                    */
                    
                    String subject = "* 협력업체 가입요청 안내 메일입니다.";
    				String subject_in = "* 협력업체 가입요청 안내 메일입니다.";
                    
                    StringBuffer contentBase = new StringBuffer();
                    
                    if("P".equals(params.get("job_div"))) {
                    	contentBase.append("	<table style=\"font-size:12px;font-weight:normal;\" border=\"0\">                                                                                                                    																		\n");																												                                                                                                                                   	 
                		contentBase.append("	<colgroup>                                                                                                                                                                                                                                                  \n");
                		contentBase.append("		<col width=\"5px\"/>                                                                                                                                                                                                                                    \n");
                		contentBase.append("		<col width=\"5px\"/>                                                                                                                                                                                                                                    \n");
                		contentBase.append("		<col width=\"5px\"/>                                                                                                                                                                                                                                    \n");
                		contentBase.append("		<col/>                                                                                                                                                                                                                                                  \n");
                		contentBase.append("	</colgroup>                                                                                                                                                                                                                                                 \n");
                		contentBase.append("	<tr>                                                                                                                                                                                                                                                        \n");	 
                		contentBase.append("	<td style=\"font-size:15px;font-weight:bold;\" align=\"center\" colspan=\"4\">                                                                                                                                                                              \n");           	 
                		contentBase.append("	[ ㈜SGC이앤씨 협력업체(구매) 포탈 시스템 가입 안내 ]                                                                                                                                                                                                                     \n");
                		contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");
                		contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");
                		contentBase.append("	<tr><td height=\"20px\" colspan=\"4\"></td></tr>                                                                                                                                                                                                            \n");
                		contentBase.append("	<tr>                                                                                                                                                                                                                                                        \n");
                		contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                          \n");   	 
                		contentBase.append("	귀사의 무궁한 발전을 기원합니다.	                                                                                                                                                                                                                                    \n");
                		contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");
                		contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");
                		contentBase.append("	<tr><td height=\"5px\" colspan=\"4\"></td></tr>                                                                                                                                                                                                             \n");                                                   	 
                		contentBase.append("	<tr>                                                                                                                                                                                                                                                        \n");
                		contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                          \n");   	 
                		contentBase.append("	안녕하십니까 ㈜SGC이앤씨 구매팀입니다.		                                                                                                                                                                                                                            \n");
                		contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");           	 
                		contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                	 
                		contentBase.append("	<tr>                                                                                                                                                                                                                                                        \n");                     	 
                		contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                          \n");                            	 
                		contentBase.append("	아래와 같이 당사의 협력사 가입 안내드리오니, 절차에 따라 진행해주시기 바랍니다. 가입하신 업체는 당사의 협력업체 관리 절차에 따라 계속 거래여부 등이 결정됨을 참고하시기 바랍니다. 	 	\n");																
                		contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                     	 
                		contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                          	 
                		contentBase.append("	<tr><td height=\"5px\" colspan=\"4\"></td></tr>                                                                                                                                                                                                             \n");                                                   	 
                		contentBase.append("	<tr>                                                                                                                                                                                                                                                        \n");                                                    	 
                		contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                                                           	 
                		contentBase.append("	<span style=\"font-weight:bold\">1. 가입신청 : </span>당사 협력업체 포탈 시스템에서 신청 → <a href=\"http://partner.sgcenc.co.kr\">http://partner.sgcenc.co.kr</a>                                                                                       	 	\n");
                		contentBase.append("	</td>                                                                                                                                                                                                                                                       \n"); 
                		contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");    	 
                		contentBase.append("	<tr>                                                                                                                                                                                                                                                        \n");                                                    	 
                		contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                		contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                          \n");                                                           	 
                		contentBase.append("	자세한 신청방법은 상기 인터넷 주소로 접속하시어 협력업체 등록절차를 클릭 후, 신규협력업체 등록절차 매뉴얼을 다운받아 확인하실 수 있습니다.                                                                                       	 	\n");
                		contentBase.append("	</td>                                                                                                                                                                                                                                                       \n"); 
                		contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");    	 
                		contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                                                                                       	\n");
                    	contentBase.append("	<span style=\"font-weight:bold\">2. 제출(첨부) 서류</span>                                                                                                                                                                                                                               	\n");
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  	\n");
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  	\n");
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       	\n");
                    	contentBase.append("	1) 신용평가사 자료 : 서울신용평가정보㈜,㈜나이스디앤비,㈜이크레더블,한국기업데이터,나이스평가정보 5개 기관 중 1개 이상에서 신용평가를 받아야 하며 평가서는 각 기관에서 자동으로 연계되어 협력업체 포탈시스템에 등록됨. (추후 업데이트 가능하므로, 시간이 오래 소요될 시 비워두시고 가입 후 추후 업데이트 요망)                                                                                                                                                                                                                             	\n");
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  	\n");
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  	\n");
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       	\n");
                    	contentBase.append("	 2)납품실적 (도급순위 100위 이내 업체 및 대기업 군)                                                                                                                                                                                                                             	\n");
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  	\n");
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  	\n");
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       	\n");
                    	contentBase.append("	3)가장 최근 3개년도 계약건수 (도급순위 100위 이내 업체 및 대기업 군)                                                                                                                                                                                                                               	\n");
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  	\n");
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  	\n");
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       	\n");
                    	contentBase.append("	4)사업자 등록증                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  	\n");
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  	\n");
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                    	contentBase.append("	<td>                                                                                                                                                                                                                                                                                                       	\n");
                    	contentBase.append("	※ 신용평가서를 제출한 모든 서류는 전자파일의 형태로 협력업체 포탈 시스템 가입 시 첨부 자료로 반드시 등록하시기 바랍니다.                                                                                                                                                                                                                               	\n");
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  	\n");
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  	\n");
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                    	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                    	contentBase.append("	<span style=\"font-weight:bold\">3. 부가정보 : </span>신용평가사 연계된 경우 수정 불가                                                                               \n");                         	 
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                    	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                    	contentBase.append("	<span style=\"font-weight:bold\">4. 주력분야 필수 : </span>상단 주택, 공통주택, 산업플랜트 등등 중 선택                                                                            \n");                         	 
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                    	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                    	contentBase.append("	<span style=\"font-weight:bold\">5. 공종선택 필수 : </span> 대표종공 체크 필수                                                                              \n");                         	 
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                    	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                    	contentBase.append("	<span style=\"font-weight:bold\">6. 인터넷 Explorer 8이상부터 정상작동</span>  (7이하 버전인 경우 업그레이드 진행)                                                                              \n");                         	 
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                    	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                          \n");                               	 
                    	contentBase.append("	(버전확인방법 도움말 -> explorer 정보)                                                                              \n");                         	 
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                    	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                    	contentBase.append("	<span style=\"font-weight:bold\">7. 법인, 개인인 경우 사업자 번호로 자동체크</span>(저장하면 자동 체크됨)                                                                               \n");                         	 
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                    	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                    	contentBase.append("	<span style=\"font-weight:bold\">8. 가입대상 업체가 아닙니다.</span> -> 외주, 구매 선택여부 확인 -> 구매 선택                                                                               \n");                         	 
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                    	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                    	contentBase.append("	<span style=\"font-weight:bold\">9. 상세사항 : </span> 포탈시스템 우측 상단 고객센터 - 자료실의 매뉴얼 참조                                                                              \n");                         	 
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                    	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                    	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                    	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                          \n");                               	 
                    	contentBase.append("	<span style=\"font-weight:bold\"><a href=\"http://fs.sgcenc.co.kr:80/ohd/pm/disk/linkdown.html?reginfo=20160811091243516307\" style=\"font-weight:bold\">(신규 협력업체 등록 매뉴얼 다운로드)</a>                                                                             \n");                         	 
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                    	contentBase.append("	<tr><td height=\"20px\" colspan=\"4\"></td></tr>                                                                                                                                                                                                            \n");
                		contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                    	contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                          \n");                               	 
                    	contentBase.append("	감사합니다.                                                                         \n");                         	 
                    	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                    	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                    	contentBase.append("	</table>																																																													\n");                                                                                                                                                                               	                                                                                                                                	 
                		
                    	
                    	WAFLogger.debug("=================================");
                    	
                    	if(!params.get("email").equals("")) {
                    		biz.sendEmail(params.get("email"), "partner@sgc.co.kr", subject, subject_in, contentBase, null);
                    		
                    	}
                    	
                    	WAFLogger.debug("email[i]="+params.get("email"));
                    	WAFLogger.debug("=================================");
            			
                        //SMS
                        String smsContent = "SGC이앤씨(주)'||CHR(13)||CHR(10)||'당사 협력업체 포털시스템 가입 안내 메일 확인바랍니다.'||CHR(13)||CHR(10)||'윤현석 과장"; 
                        String re_phon_no = "024898247"; //SGC이앤씨 번호
                        String phon_no = params.get("h_phon_1") + params.get("h_phon_2") + params.get("h_phon_3");
                        
                        if(!"".equals(phon_no)) {
                        	biz.sendSMS(phon_no, storage.getUser().get("USER_PHONE"), storage.getUser().get("acct_id"), smsContent); //2015.9.21 re_phon_no
                        	
                        }
                        
                    } else {
                    	contentBase.append("	<table style=\"font-size:12px;font-weight:normal;\" border=\"0\">                                                                                                                                                                                                                                                          		\n");
            			contentBase.append("	<colgroup>                                                                                                                                                                                                                                                                                                             		\n");
            			contentBase.append("		<col width=\"5px\"/>                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("		<col width=\"5px\"/>                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("		<col width=\"5px\"/>                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("		<col/>                                                                                                                                                                                                                                                                                                               		\n");
            			contentBase.append("	</colgroup>                                                                                                                                                                                                                                                                                                            		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td style=\"font-size:15px;font-weight:bold;\" align=\"center\" colspan=\"4\">                                                                                                                                                                                                                                               		\n");
            			contentBase.append("	[ SGC이앤씨㈜ 협력업체(외주) 포탈 시스템 가입 공고 ]                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	                                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<tr><td height=\"20px\" colspan=\"4\"></td></tr>                                                                                                                                                                                                                                                                           		\n");
            			contentBase.append("	                                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	귀사의 무궁한 발전을 기원합니다.	                                                                                                                                                                                                                                                                                     		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	                                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	안녕하십니까 SGC이앤씨㈜ 외주팀입니다.		                                                                                                                                                                                                                                                                             		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	당사와의 입찰,계약 등의 전산업무를 위한 협력업체포탈시스템 가입을 다음과 같이 요청 드리오니 담당자께서는 내용 숙지 후 진행하시기 바랍니다.\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr><td height=\"5px\" colspan=\"4\"></td></tr>                                                                                                                                                                                                                                                                            		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">1.	마감 일시 : 등록요청 메일 수신 즉시</span>                                                                                                                                                                                                                              		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">2.	자격 요건</span>                                                                                                                                                                                                                                                                     		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">1)	가입 대상 :</span> 본 등록요청 메일 수신 협력업체		                                                                                                                                                                                                 		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">2)	신용 평가 등급 :</span> B 이상                                                                                                                                                                                                                                                    		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			//2017.03.09 현금흐름등급 삭제
            			//contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			//contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			//contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			//contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			//contentBase.append("	<span style=\"font-weight:bold\">	현금 흐름 등급 :</span> 나이스디앤비 C+ (CFR4) 이상, 이크레더블 C- (CR-4) 이상.                                                                                                                                                                                                      		\n");
            			//contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			//contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">3.	가입 방법</span>                                                                                                                                                                                                                                                                     		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">1)	가입 신청 :</span> 당사 협력업체 포탈 시스템에서 신청 → <a href=\"http://partner.sgcenc.co.kr\" style=\"font-weight:bold\">http://partner.sgcenc.co.kr</a>                                                                                                                                		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	상기 주소로 접속하시어 '협력사 등록'을 누르신 후 '외주'로 등록하시기 바랍니다.</br><a href=\"https://fs.sgcenc.co.kr/pm/linkdown.htm?lid=663b28945ec830574501\" style=\"font-weight:bold\">(신규 협력업체 등록 매뉴얼 다운로드)</a>                                                                                                  \n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">2)	제출 서류</span>                                                                                                                                                                                                                                                                     		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">① 신용평가서</span>                                                                                                                                                                                                                                                                    		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	이크레더블,나이스디앤비,나이스평가정보, 한국평가데이터 4개 기관 중 택하여 해당 신용평가사 사이트에서 '원청사 신용평가서 제출'동의하시면 익일 당사 시스템과 연동됩니다.                                                                                                                                                   		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">② 공사 지명원</span>                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">③ 시공능력 순위 확인서 (최근년도 협회 발급본, 설계 및 용역 업체 제외)</span>                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">④ 건설업실적 총괄표 (최근년도 협회 발급본, 설계 및 용역 업체 제외)</span>                                                                                                                                                                                                                                          		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">⑤ 기술자보유현황표 (최근년도 협회 발급본, 설계 및 용역 업체 제외)</span>                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">⑥ 인증서 (ISO, KOSHA, KS 등 보유시)</span>                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">⑦ 사업자등록증</span>                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">⑧ 통장사본</span>                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">⑨ 기타(신용평가서 미발급 업체는 전년도 재무제표 첨부)</span>                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	※	신용평가서를 제출한 모든 서류는 전자파일의 형태로 협력업체 포탈 시스템 가입 시 첨부 자료로 반드시 등록하시기 바랍니다.                                                                                                                                                                                             		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	<span style=\"font-weight:bold\">4.	문의 사항</span>                                                                                                                                                                                                                                                                     		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
            			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
            			contentBase.append("	협력업체 포탈시스템 가입관련 문의 사항은 당사 오연지 매니저에게 문의하시기 바랍니다.<br/>(02-489-8270/ohyj@sgc.co.kr)                                                                                                                                                                               		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</table>                                                                                                                                                                                                                                                                                                               		\n");
            			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td height='20' colspan='3'>&nbsp;</td>                                                                                                                                                                                                                                                                                		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                  	                                                                               		\n");
            			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
            			contentBase.append("	<td height='20' colspan='3'>&nbsp;</td>                                                                                                                                                                                                                                                                                		\n");
            			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
            			contentBase.append("	</table>                                                                                                                                                                                                                                                                                                          		\n");
                        
            			if(!params.get("email").equals("")){
            				biz.sendEmail(params.get("email"), "partner@sgc.co.kr", subject, subject_in, contentBase, null);
            			}
                    	
                    	WAFLogger.debug("email[i]="+params.get("email"));
                    	WAFLogger.debug("=================================");
            			
                        //SMS
                    	String smsContent = "SGC이앤씨(주)'||CHR(13)||CHR(10)||'당사 협력업체 포털시스템 가입 안내 메일 확인바랍니다.'||CHR(13)||CHR(10)||'오연지 매니저"; 
                        String re_phon_no = "024898270"; //SGC이앤씨 번호
                        String phon_no = params.get("h_phon_1") + params.get("h_phon_2") + params.get("h_phon_3");
                        
                        if(!"".equals(phon_no)) {
                        	biz.sendSMS(phon_no, storage.getUser().get("USER_PHONE"), storage.getUser().get("acct_id"), smsContent); //2015.9.21 re_phon_no
                        	
                        }
                        
                        
                    }
                    
                    super.storage.setSuccess(success);
                    
                }
                else
                {
                    String message = "등록실패";
                    //                WAFLogger.error(message);
                    Exception e = new Exception(message);
                    
                    ValueObject errMsg = new ValueObject();
                    errMsg.set("errMsg", message);
                    storage.addValueObject("VALUEOBJECT", errMsg);
                    
                    
                    super.storage.setSuccess(false);
                    throw e;
                }
            }
            
        } catch (Exception e) {
//            WAFLogger.error(e);
            e.printStackTrace();
            super.conn.setRollback();
            throw new Exception(e);
            
        } finally {
            super.conn.end();
        }   
	}
	
	private void updateData() throws Exception{

	    boolean success = false;
        boolean success2 = false;
        
        
	    super.conn.begin();
        
        
        String corp_no = params.get("corp_reg_no");
        String corp_gubun = "";
        
        corp_no = corp_no.substring(3, 5);
        
        if(corp_no.equals("81") || corp_no.equals("82") || corp_no.equals("83") ||corp_no.equals("84") || corp_no.equals("85") || corp_no.equals("86") || corp_no.equals("87")|| corp_no.equals("88"))
        {
            corp_gubun = "1";
        }
        else
        {
            corp_gubun = "2";
        }
        
        params.set("corp_gubun", corp_gubun); 
        params.set("p_charge_seq", params.get("p_charge_seq"));
        
        
        try {
			success = update_info(params);
			success2 = update_charge(params);
			
			WAFLogger.debug(success);
			WAFLogger.debug(success2);
			
			if(success == true && success2 == true)
			{
				SuppJoinRequestListBiz biz  = new SuppJoinRequestListBiz(storage);
				
				/*
				MessageSend messageSend = new MessageSend(storage);
				
				
				String subject = WAFMessages.getMessage("Register.Supplier.Request.Mail.Title");
				String subject_in = WAFMessages.getMessage("Register.Supplier.Request.Mail.Title.in");
				
				StringBuffer mailContent = new StringBuffer();
	            
				mailContent.append("<span class='style4'>"+params.get("corp_kor") + " 업체님</span><br/>    \n");
	            mailContent.append( WAFMessages.getMessage("Register.Supplier.Request.Mail.Content") );
				
	            messageSend.sendEmail(params.get("email"), "test", subject, subject_in, mailContent, params.get("job_div"));
				*/
				
				
				String subject = "* 협력업체 가입요청 안내 메일입니다.";
				String subject_in = "* 협력업체 가입요청 안내 메일입니다.";
                
                StringBuffer contentBase = new StringBuffer();
                
                if("P".equals(params.get("job_div"))) {
                	contentBase.append("	<table style=\"font-size:12px;font-weight:normal;\" border=\"0\">                                                                                                                    																		\n");																												                                                                                                                                   	 
            		contentBase.append("	<colgroup>                                                                                                                                                                                                                                                  \n");
            		contentBase.append("		<col width=\"5px\"/>                                                                                                                                                                                                                                    \n");
            		contentBase.append("		<col width=\"5px\"/>                                                                                                                                                                                                                                    \n");
            		contentBase.append("		<col width=\"5px\"/>                                                                                                                                                                                                                                    \n");
            		contentBase.append("		<col/>                                                                                                                                                                                                                                                  \n");
            		contentBase.append("	</colgroup>                                                                                                                                                                                                                                                 \n");
            		contentBase.append("	<tr>                                                                                                                                                                                                                                                        \n");	 
            		contentBase.append("	<td style=\"font-size:15px;font-weight:bold;\" align=\"center\" colspan=\"4\">                                                                                                                                                                              \n");           	 
            		contentBase.append("	[ ㈜SGC이앤씨 협력업체(구매) 포탈 시스템 가입 안내 ]                                                                                                                                                                                                                     \n");
            		contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");
            		contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");
            		contentBase.append("	<tr><td height=\"20px\" colspan=\"4\"></td></tr>                                                                                                                                                                                                            \n");
            		contentBase.append("	<tr>                                                                                                                                                                                                                                                        \n");
            		contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                          \n");   	 
            		contentBase.append("	귀사의 무궁한 발전을 기원합니다.	                                                                                                                                                                                                                                    \n");
            		contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");
            		contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");
            		contentBase.append("	<tr><td height=\"5px\" colspan=\"4\"></td></tr>                                                                                                                                                                                                             \n");                                                   	 
            		contentBase.append("	<tr>                                                                                                                                                                                                                                                        \n");
            		contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                          \n");   	 
            		contentBase.append("	안녕하십니까 ㈜SGC이앤씨 구매팀입니다.		                                                                                                                                                                                                                            \n");
            		contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");           	 
            		contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                	 
            		contentBase.append("	<tr>                                                                                                                                                                                                                                                        \n");                     	 
            		contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                          \n");                            	 
            		contentBase.append("	아래와 같이 당사의 협력사 가입 안내드리오니, 절차에 따라 진행해주시기 바랍니다. 가입하신 업체는 당사의 협력업체 관리 절차에 따라 계속 거래여부 등이 결정됨을 참고하시기 바랍니다. 	 	\n");																
            		contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                     	 
            		contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                          	 
            		contentBase.append("	<tr><td height=\"5px\" colspan=\"4\"></td></tr>                                                                                                                                                                                                             \n");                                                   	 
            		contentBase.append("	<tr>                                                                                                                                                                                                                                                        \n");                                                    	 
            		contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                                                           	 
            		contentBase.append("	<span style=\"font-weight:bold\">1. 가입신청 : </span>당사 협력업체 포탈 시스템에서 신청 → <a href=\"http://partner.sgcenc.co.kr\">http://partner.sgcenc.co.kr</a>                                                                                       	 	\n");
            		contentBase.append("	</td>                                                                                                                                                                                                                                                       \n"); 
            		contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");    	 
            		contentBase.append("	<tr>                                                                                                                                                                                                                                                        \n");                                                    	 
            		contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
            		contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                          \n");                                                           	 
            		contentBase.append("	자세한 신청방법은 상기 인터넷 주소로 접속하시어 협력업체 등록절차를 클릭 후, 신규협력업체 등록절차 매뉴얼을 다운받아 확인하실 수 있습니다.                                                                                       	 	\n");
            		contentBase.append("	</td>                                                                                                                                                                                                                                                       \n"); 
            		contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");    	 
            		contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                                                                                       	\n");
                	contentBase.append("	<span style=\"font-weight:bold\">2. 제출(첨부) 서류</span>                                                                                                                                                                                                                               	\n");
                	contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  	\n");
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  	\n");
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       	\n");
                	contentBase.append("	1) 신용평가사 자료 : 서울신용평가정보㈜,㈜나이스디앤비,㈜이크레더블,한국기업데이터,나이스평가정보 5개 기관 중 1개 이상에서 신용평가를 받아야 하며 평가서는 각 기관에서 자동으로 연계되어 협력업체 포탈시스템에 등록됨. (추후 업데이트 가능하므로, 시간이 오래 소요될 시 비워두시고 가입 후 추후 업데이트 요망)                                                                                                                                                                                                                             	\n");
                	contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  	\n");
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  	\n");
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       	\n");
                	contentBase.append("	 2)납품실적 (도급순위 100위 이내 업체 및 대기업 군)                                                                                                                                                                                                                             	\n");
                	contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  	\n");
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  	\n");
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       	\n");
                	contentBase.append("	3)가장 최근 3개년도 계약건수 (도급순위 100위 이내 업체 및 대기업 군)                                                                                                                                                                                                                               	\n");
                	contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  	\n");
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  	\n");
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       	\n");
                	contentBase.append("	4)사업자 등록증                                                                                                                                                                                                                              	\n");
                	contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  	\n");
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  	\n");
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              	\n");
                	contentBase.append("	<td>                                                                                                                                                                                                                                                                                                       	\n");
                	contentBase.append("	※ 신용평가서를 제출한 모든 서류는 전자파일의 형태로 협력업체 포탈 시스템 가입 시 첨부 자료로 반드시 등록하시기 바랍니다.                                                                                                                                                                                                                               	\n");
                	contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  	\n");
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  	\n");
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                	contentBase.append("	<span style=\"font-weight:bold\">3. 부가정보 : </span>신용평가사 연계된 경우 수정 불가                                                                               \n");                         	 
                	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                	contentBase.append("	<span style=\"font-weight:bold\">4. 주력분야 필수 : </span>상단 주택, 공통주택, 산업플랜트 등등 중 선택                                                                            \n");                         	 
                	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                	contentBase.append("	<span style=\"font-weight:bold\">5. 공종선택 필수 : </span> 대표종공 체크 필수                                                                              \n");                         	 
                	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                	contentBase.append("	<span style=\"font-weight:bold\">6. 인터넷 Explorer 8이상부터 정상작동</span>  (7이하 버전인 경우 업그레이드 진행)                                                                              \n");                         	 
                	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                          \n");                               	 
                	contentBase.append("	(버전확인방법 도움말 -> explorer 정보)                                                                              \n");                         	 
                	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                	contentBase.append("	<span style=\"font-weight:bold\">7. 법인, 개인인 경우 사업자 번호로 자동체크</span>(저장하면 자동 체크됨)                                                                               \n");                         	 
                	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                	contentBase.append("	<span style=\"font-weight:bold\">8. 가입대상 업체가 아닙니다.</span> -> 외주, 구매 선택여부 확인 -> 구매 선택                                                                               \n");                         	 
                	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                	contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                          \n");                               	 
                	contentBase.append("	<span style=\"font-weight:bold\">9. 상세사항 : </span> 포탈시스템 우측 상단 고객센터 - 자료실의 매뉴얼 참조                                                                              \n");                         	 
                	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                	contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                	contentBase.append("	<td></td>                                                                                                                                                                                                                                                   \n");                   	 
                	contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                          \n");                               	 
                	contentBase.append("	<span style=\"font-weight:bold\"><a href=\"http://fs.sgcenc.co.kr:80/ohd/pm/disk/linkdown.html?reginfo=20160811091243516307\" style=\"font-weight:bold\">(신규 협력업체 등록 매뉴얼 다운로드)</a>                                                                             \n");                         	 
                	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                	contentBase.append("	<tr><td height=\"20px\" colspan=\"4\"></td></tr>                                                                                                                                                                                                            \n");
            		contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   	\n");
                	contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                          \n");                               	 
                	contentBase.append("	감사합니다.                                                                         \n");                         	 
                	contentBase.append("	</td>                                                                                                                                                                                                                                                       \n");                                       	 
                	contentBase.append("	</tr>                                                                                                                                                                                                                                                       \n");                                            	 
                	contentBase.append("	</table>																																																													\n");                                                                                                                                                                               	                                                                                                                                	 
            		
                	
                	WAFLogger.debug("=================================");
                	
                	if(!"".equals(params.get("email"))) {
                		biz.sendEmail(params.get("email"), "partner@sgc.co.kr", subject, subject_in, contentBase, null);
                		
                	}
                	
                	
                	WAFLogger.debug("email[i]="+params.get("email"));
                	WAFLogger.debug("=================================");
        			
                    //SMS
                	String smsContent = "SGC이앤씨 협력업체포탈 시스템 가입요청.'||CHR(13)||CHR(10)||'시스템에 접속하시어 확인바랍니다."; 
                    String re_phon_no = "024898247"; //SGC이앤씨 번호
                    String phon_no = params.get("h_phon_1") + params.get("h_phon_2") + params.get("h_phon_3");
                    
                    if(!"".equals(phon_no)) {
                    	biz.sendSMS(phon_no, storage.getUser().get("USER_PHONE"), storage.getUser().get("acct_id"), smsContent); //2015.9.21 re_phon_no
                    	
                    }
                    
                } else {
                		
                	contentBase.append("	<table style=\"font-size:12px;font-weight:normal;\" border=\"0\">                                                                                                                                                                                                                                                          		\n");
        			contentBase.append("	<colgroup>                                                                                                                                                                                                                                                                                                             		\n");
        			contentBase.append("		<col width=\"5px\"/>                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("		<col width=\"5px\"/>                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("		<col width=\"5px\"/>                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("		<col/>                                                                                                                                                                                                                                                                                                               		\n");
        			contentBase.append("	</colgroup>                                                                                                                                                                                                                                                                                                            		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td style=\"font-size:15px;font-weight:bold;\" align=\"center\" colspan=\"4\">                                                                                                                                                                                                                                               		\n");
        			contentBase.append("	[ SGC이앤씨㈜ 협력업체(외주) 포탈 시스템 가입 공고 ]                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	                                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<tr><td height=\"20px\" colspan=\"4\"></td></tr>                                                                                                                                                                                                                                                                           		\n");
        			contentBase.append("	                                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	귀사의 무궁한 발전을 기원합니다.	                                                                                                                                                                                                                                                                                     		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	                                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	안녕하십니까 SGC이앤씨㈜ 외주팀입니다.		                                                                                                                                                                                                                                                                             		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td colspan=\"4\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	당사와의 입찰,계약 등의 전산업무를 위한 협력업체포탈시스템 가입을 다음과 같이 요청 드리오니 담당자께서는 내용 숙지 후 진행하시기 바랍니다.\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr><td height=\"5px\" colspan=\"4\"></td></tr>                                                                                                                                                                                                                                                                            		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">1.	마감 일시 : 등록요청 메일 수신 즉시</span>                                                                                                                                                                                                                              		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">2.	자격 요건</span>                                                                                                                                                                                                                                                                     		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">1)	가입 대상 :</span> 본 등록요청 메일 수신 협력업체		                                                                                                                                                                                                 		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">2)	신용 평가 등급 :</span> B 이상                                                                                                                                                                                                                                                    		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			//2017.03.09삭제
        			//contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			//contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			//contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			//contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			//contentBase.append("	<span style=\"font-weight:bold\">	현금 흐름 등급 :</span> 나이스디앤비 C+ (CFR4) 이상, 이크레더블 C- (CR-4) 이상.                                                                                                                                                                                                      		\n");
        			//contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			//contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">3.	가입 방법</span>                                                                                                                                                                                                                                                                     		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">1)	가입 신청 :</span> 당사 협력업체 포탈 시스템에서 신청 → <a href=\"http://partner.sgcenc.co.kr\" style=\"font-weight:bold\">http://partner.sgcenc.co.kr</a>                                                                                                                                		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	상기 주소로 접속하시어 '협력사 등록'을 누르신 후 '외주'로 등록하시기 바랍니다.</br><a href=\"https://fs.sgcenc.co.kr/pm/linkdown.htm?lid=663b28945ec830574501\" style=\"font-weight:bold\">(신규 협력업체 등록 매뉴얼 다운로드)</a>                                                                                                  \n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">2)	제출 서류</span>                                                                                                                                                                                                                                                                     		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">① 신용평가서</span>                                                                                                                                                                                                                                                                    		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	이크레더블,나이스디앤비,나이스평가정보, 한국평가데이터 4개 기관 중 택하여 해당 신용평가사 사이트에서 '원청사 신용평가서 제출'동의하시면 익일 당사 시스템과 연동됩니다.                                                                                                                                                   		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">② 공사 지명원</span>                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">③ 시공능력 순위 확인서 (최근년도 협회 발급본, 설계 및 용역 업체 제외)</span>                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">④ 건설업실적 총괄표 (최근년도 협회 발급본, 설계 및 용역 업체 제외)</span>                                                                                                                                                                                                                                          		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">⑤ 기술자보유현황표 (최근년도 협회 발급본, 설계 및 용역 업체 제외)</span>                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">⑥ 인증서 (ISO, KOSHA, KS 등 보유시)</span>                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">⑦ 사업자등록증</span>                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">⑧ 통장사본</span>                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">⑨ 기타(신용평가서 미발급 업체는 전년도 재무제표 첨부)</span>                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	※	신용평가서를 제출한 모든 서류는 전자파일의 형태로 협력업체 포탈 시스템 가입 시 첨부 자료로 반드시 등록하시기 바랍니다.                                                                                                                                                                                             		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"3\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	<span style=\"font-weight:bold\">4.	문의 사항</span>                                                                                                                                                                                                                                                                     		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td></td>                                                                                                                                                                                                                                                                                                              		\n");
        			contentBase.append("	<td colspan=\"2\">                                                                                                                                                                                                                                                                                                       		\n");
        			contentBase.append("	협력업체 포탈시스템 가입관련 문의 사항은 당사 오연지 매니저에게 문의하시기 바랍니다.<br/>(02-489-8270/ohyj@sgc.co.kr)                                                                                                                                                                               		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</table>                                                                                                                                                                                                                                                                                                               		\n");
        			contentBase.append("	</td>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td height='20' colspan='3'>&nbsp;</td>                                                                                                                                                                                                                                                                                		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                  	                                                                               		\n");
        			contentBase.append("	<tr>                                                                                                                                                                                                                                                                                                                   		\n");
        			contentBase.append("	<td height='20' colspan='3'>&nbsp;</td>                                                                                                                                                                                                                                                                                		\n");
        			contentBase.append("	</tr>                                                                                                                                                                                                                                                                                                                  		\n");
        			contentBase.append("	</table>                                                                                                                                                                                                                                                                                                          		\n");
                    
                	
                	if(!params.get("email").equals("")){
        				biz.sendEmail(params.get("email"), "partner@sgc.co.kr", subject, subject_in, contentBase, null);
        			}
                	
                	WAFLogger.debug("email[i]="+params.get("email"));
                	WAFLogger.debug("=================================");
        			
                    //SMS
                	String smsContent = "SGC이앤씨 협력업체포탈 시스템 가입요청.'||CHR(13)||CHR(10)||'시스템에 접속하시어 확인바랍니다."; 
                    String re_phon_no = "024898270"; //SGC이앤씨 번호
                    String phon_no = params.get("h_phon_1") + params.get("h_phon_2") + params.get("h_phon_3");
                    
                    if(!"".equals(phon_no)) {
                    	biz.sendSMS(phon_no, storage.getUser().get("USER_PHONE"), storage.getUser().get("acct_id"), smsContent); //2015.9.21 re_phon_no
                    	
                    }
                }
				storage.setSuccess(success);
			}
			else
			{
			}
		} catch (Exception e1) {
			conn.setRollback();
			
			String message = "등록실패";
			//                WAFLogger.error(message);
			Exception e = new Exception(message);
			
			storage.setMessage(message.replace("\"", ""));
			storage.setSuccess(false);
			throw new Exception(e);
			// TODO Auto-generated catch block
        } finally {
            super.conn.end();
        }   
        
	}
	
	private void deleteData() throws Exception{
		boolean success = false;
		boolean success2 = false;
		    
	    super.conn.begin();
	    
	    
	    try {
			success = delete_charge(params);
			success2 = delete_info(params);
			
			WAFLogger.debug(success);
			WAFLogger.debug(success2);
			
			super.storage.setSuccess(true);

		} catch (Exception e1) {
			ValueObject errMsg = new ValueObject();
			errMsg.set("errMsg", e1.getMessage());
			storage.addValueObject("VALUEOBJECT", errMsg);
			
			storage.setSuccess(false);
			conn.setRollback();
			throw new Exception(e1);
		}finally{
			conn.end();
		}
		    
         
	}
	
	
	/**
	 * 협력업체 마스터 저장
	 * @param params
	 * @return
	 * @throws Exception
	 */
	private boolean save_info(ValueObject params) throws Exception
    {
        
        Persistent persistent = null;
        StringBuffer sqlstr = new StringBuffer();
        
        
        try{
            persistent = new PersistentImpl(super.conn.getConnection());
            
            sqlstr.append("     INSERT INTO SUPP_INFO              \n")
                   .append("     (                                              \n")
                   .append("          CORP_ID                               \n")
                   .append("         ,JOB_DIV --P:구매. O:외주           \n")
                   .append("         ,IN_OUT_DIV --I:국내, O:국외     \n")
                   .append("         ,CORP_REG_NO                       \n")
                   .append("         ,CORP_KOR                            \n")
                   .append("         ,REP_NAME                            \n")
                   .append("         ,CORP_DIV_CD                       \n")
                   .append("         ,STATUS                               \n")
                   .append("         ,CRE_BY                                \n")
                   .append("         ,CRE_DATE                            \n")
                   .append("     )VALUES(                                  \n")
                   .append("          ?                                        \n")
                   .append("         ,?                                        \n")
                   .append("         ,?                                        \n")
                   .append("         ,?                                        \n")
                   .append("         ,?                                        \n")
                   .append("         ,?                                        \n")
                   .append("         ,?                                        \n")
                   .append("         ,?                                        \n")
                   .append("         ,?                                        \n")
                   .append("         ,SYSDATE                             \n")
                   .append("     )                                             \n");
            
            
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(params.get("p_corp_id"));
            persistent.addParameter(params.get("job_div"));
            persistent.addParameter("I");
            persistent.addParameter(params.get("corp_reg_no"));
            persistent.addParameter(params.get("corp_kor"));
            persistent.addParameter(params.get("rep_name"));
            persistent.addParameter(params.get("corp_gubun"));
            persistent.addParameter(params.get("p_status"));
            persistent.addParameter(storage.getUser().get("acct_id"));
            
            WAFLogger.debug(persistent.getParameters());
            WAFLogger.debug(sqlstr.toString());
            persistent.execute();
            persistent.clearParameters();
            
            return true;
            
            
        } catch(Exception e) {
        	WAFLogger.error("save_info========>" + e);
            e.printStackTrace();
            return false;            
        }
    }
	
	
	private boolean update_info(ValueObject params) throws Exception
    {
        
        Persistent persistent = null;
        StringBuffer sqlstr = new StringBuffer();
        
        
        try{
            
            conn.begin();
            persistent = new PersistentImpl(super.conn.getConnection());
            
            
            sqlstr.append("     UPDATE SUPP_INFO SET              \n")
                   .append("          CORP_REG_NO = ?                   \n")
                   .append("         ,CORP_KOR = ?                            \n")
                   .append("         ,REP_NAME = ?                            \n");
                   if("00".equals(params.get("p_status").trim())){
                	   sqlstr.append("         ,STATUS = ?                            \n");
                   }
            sqlstr.append("         ,JOB_DIV = ?                            \n")
                   .append("         ,REG_REQ_DT = SYSDATE                            \n")
                   .append("         ,UPD_BY = ?                                \n")
                   .append("         ,UPD_DATE = TO_CHAR(SYSDATE, 'YYYY-MM-DD')                            \n")
                   .append("     WHERE CORP_ID = ?               \n");
            
            
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(params.get("corp_reg_no").trim());
            persistent.addParameter(params.get("corp_kor").trim());
            persistent.addParameter(params.get("rep_name").trim());
            if("00".equals(params.get("p_status").trim())){
            	persistent.addParameter(params.get("p_status").trim());
            }
            persistent.addParameter(params.get("job_div").trim());
            persistent.addParameter(storage.getUser().get("acct_id").trim());
            persistent.addParameter(params.get("p_corp_id").trim());
            
            persistent.execute();
            persistent.clearParameters();
            
            return true;
            
            
        } catch(Exception e) {
        	WAFLogger.error("update_info====>" + e);
            e.printStackTrace();
            conn.setRollback();
            return false;            
        }
        
        finally {
            super.conn.end();
        }
    }
	
	
	/**
	 * 협력업체 담당자정보 저장
	 * @param params
	 * @return
	 * @throws Exception
	 */
	private boolean save_charge(ValueObject params) throws Exception
    {
        
        Persistent persistent = null;
        StringBuffer sqlstr = new StringBuffer();
        
        
        try{
            
            persistent = new PersistentImpl(super.conn.getConnection());
            
            
            sqlstr.append("                                                        \n")
                   .append("         INSERT INTO SUPP_CHARGE          \n")
                   .append("         (                                              \n")
                   .append("             CHARGE_SEQ                          \n")
                   .append("            ,CORP_ID                                \n")
                   .append("            ,USER_ID                                \n")
                   .append("            ,DEFAULT_YN -- Y                    \n")
                   .append("            ,USER_NAME                            \n")
                   .append("            ,HP1                                       \n")
                   .append("            ,HP2                                       \n")
                   .append("            ,HP3                                       \n") 
                   .append("            ,EMAIL                                    \n")
                   .append("            ,USE_YN                                  \n")
                   .append("            ,RIGHT_ID                                \n")
                   .append("            ,CRE_BY                                  \n")
                   .append("            ,CRE_DATE                              \n")
                   .append("         )VALUES(                                   \n")
//                   .append("             SUPP_CHARGE_S.nextval           \n")
                   .append("            (SELECT DECODE(MAX(CHARGE_SEQ), '', 1, MAX(CHARGE_SEQ)+1)  SEQ FROM SUPP_CHARGE WHERE CORP_ID = ?  )          \n")
                   .append("            ,?                                          \n")
                   .append("            ,?                                          \n")
                   .append("            ,?                                          \n")
                   .append("            ,?                                          \n")
                   .append("            ,?                                          \n")
                   .append("            ,?                                          \n")
                   .append("            ,?                                          \n")
                   .append("            ,?                                          \n")
                   .append("            ,?                                          \n")
                   .append("            ,?                                          \n")
                   .append("            ,?                                          \n")
                   .append("            ,TO_CHAR(SYSDATE, 'YYYY-MM-DD')                                          \n")
                   .append("         )                                              \n");

            
            
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(params.get("p_corp_id"));
            persistent.addParameter(params.get("p_corp_id"));
            persistent.addParameter(params.get("user_id") + "_" +  params.get("p_corp_id"));
            persistent.addParameter("Y");
            persistent.addParameter(params.get("user_name"));
            persistent.addParameter(params.get("h_phon_1"));
            persistent.addParameter(params.get("h_phon_2"));
            persistent.addParameter(params.get("h_phon_3"));
            persistent.addParameter(params.get("email"));
            persistent.addParameter("");
            persistent.addParameter("159");
            persistent.addParameter(storage.getUser().get("acct_id"));
            
            WAFLogger.debug(persistent.getParameters());
            WAFLogger.debug(sqlstr.toString());
            persistent.execute();
            persistent.clearParameters();
            
            return true;
            
            
        } catch(Exception e) {
        	WAFLogger.error("save_charge======>" + e);
            e.printStackTrace();
            return false;
        }
    }
	
	/**
	 * 담당자 정보 update
	 * @param params
	 * @return
	 * @throws Exception
	 */
	private boolean update_charge(ValueObject params) throws Exception
    {
        
        Persistent persistent = null;
        StringBuffer sqlstr = new StringBuffer();
        
        
        try{
            
            conn.begin();
            persistent = new PersistentImpl(super.conn.getConnection());
            
            
            sqlstr.append("     UPDATE SUPP_CHARGE SET              \n")
                   .append("          USER_NAME = ?                   \n")
                   .append("         ,EMAIL = ?                            \n")
                   .append("         ,HP1 = ?                            \n")
                   .append("         ,HP2 = ?                                \n")
                   .append("         ,HP3 = ?                           \n")
                   .append("         ,RIGHT_ID = ?                           \n")
                   .append("         ,UPD_BY = ?                           \n")
                   .append("         ,UPD_DATE = TO_CHAR(SYSDATE, 'YYYY-MM-DD')                           \n")
                   .append("     WHERE CORP_ID = ?               \n")
                   .append("     AND CHARGE_SEQ = ?               \n");
            
            
            persistent.setStatement(sqlstr.toString());
            
            persistent.addParameter(params.get("user_name"));
            persistent.addParameter(params.get("email"));
            persistent.addParameter(params.get("h_phon_1"));
            persistent.addParameter(params.get("h_phon_2"));
            persistent.addParameter(params.get("h_phon_3"));
            persistent.addParameter("159");
            persistent.addParameter(storage.getUser().get("acct_id"));
            persistent.addParameter(params.get("p_corp_id"));
            persistent.addParameter(params.get("p_charge_seq"));
            
            
            WAFLogger.debug(sqlstr.toString());
            WAFLogger.debug(persistent.getParameters());
            
            
            persistent.execute();
            persistent.clearParameters();
            
            return true;
            
            
        } catch(Exception e) {
        	WAFLogger.error("update_charge====>" + e);
            e.printStackTrace();
            conn.setRollback();
            return false;            
        }
        
        finally {
            super.conn.end();
        }
    }
	
	
	
	
	private boolean delete_info(ValueObject params) throws Exception
    {
        
        Persistent persistent = null;
        StringBuffer sqlstr = new StringBuffer();
        
        
        try{
            
            conn.begin();
            persistent = new PersistentImpl(super.conn.getConnection());
            
            
            sqlstr.append("     DELETE FROM  SUPP_INFO              \n")
                   .append("     WHERE CORP_ID = ?               \n");
            
            
            persistent.setStatement(sqlstr.toString());
            persistent.addParameter(params.get("p_corp_id").trim());
            
            persistent.execute();
            persistent.clearParameters();
            
            return true;
            
            
        } catch(Exception e) {
        	WAFLogger.error("delete_info====>" + e);
            e.printStackTrace();
            conn.setRollback();
            return false;            
        }
        
        finally {
            super.conn.end();
        }
    }
    
        
        private boolean delete_charge(ValueObject params) throws Exception
        {
            
            Persistent persistent = null;
            StringBuffer sqlstr = new StringBuffer();
            
            
            try{
                
                persistent = new PersistentImpl(conn.getConnection());
                
                
                sqlstr.append("     DELETE FROM  SUPP_CHARGE              \n")
                       .append("     WHERE CORP_ID = ?               \n");
                
                
                persistent.setStatement(sqlstr.toString());
                persistent.addParameter(params.get("p_corp_id").trim());
                
                                
                persistent.execute();
                persistent.clearParameters();
                
                return true;
                
                
            } catch(Exception e) {
            	WAFLogger.error("delete_charge====>" + e);
                storage.setMessage(e.getMessage());
                e.printStackTrace();
                throw new Exception(e);
            }
            
        }
        
	
	
	public ValueObject getCorp_no(Connection con) throws Exception{
        
        Persistent persistent_q = null;
        
        
        ValueObject vo = new ValueObject();
        ValueObject row = null;
        StringBuffer sqlstr =  new StringBuffer();
        
        try{
            persistent_q = new PersistentImpl(con);
            
            sqlstr.append("         SELECT COUNT(*) CNT FROM SUPP_INFO WHERE CORP_REG_NO = ? AND JOB_DIV = ?                              \n");
            
            persistent_q.setStatement(sqlstr.toString()); 
            persistent_q.addParameter(params.get("corp_reg_no"));
            persistent_q.addParameter(params.get("job_div"));
            
            row = RowSetUtility.getValueObject(persistent_q.query().getRow(0));
            vo.set("cnt", row.get("cnt"));
        }
        catch(Exception e) {
            e.printStackTrace();
        }finally{
            if(vo == null) vo = new ValueObject();
        }
        return vo;
    }
	
	
	
	/**
   	 * 이메일 전송 메소드(Javamail 사용)
   	 * @param user
   	 * @param from_email
   	 * @param to_name
   	 * @param to_email
   	 */
       public void sendEmail(String toEmail, String sendUser, String mailSubject, String subSubject, StringBuffer mailContent, String gubun) throws Exception{
   		
       	Date today=new Date();
           SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");       
           String date = formater.format(today);
           
   		// 메일서버 정보와 실제 서버의 주소를 가져온다.
   		RowSet smtpInfo = getSmtpInfo(); 
   		String smtpIp 	= smtpInfo.getRow(0).get("CHG_CODE01");
   		String smtpUser = smtpInfo.getRow(0).get("CHG_CODE02");
   		String smtpPw 	= smtpInfo.getRow(0).get("CHG_CODE03");
   		String link 	= smtpInfo.getRow(0).get("CHG_CODE04");
   		String linkPortal 	= smtpInfo.getRow(0).get("CHG_CODE05");
   		 	   sendUser = smtpInfo.getRow(0).get("CHG_CODE06");
   		/*
   		RowSet userInfo = getUserInfo(sendUser); 
   		String fromEmail = userInfo.getRow(0).get("E_MAIL");
   		String fromName = userInfo.getRow(0).get("USER_NM");
   		String fromDuty = userInfo.getRow(0).get("A_DUTY");
   		String fromDept = userInfo.getRow(0).get("DEPART_DEPT_NM");
   		String fromTel = userInfo.getRow(0).get("TEL_NO");
   		*/
   		Properties properties = new Properties();									// Properties 객체 설정
   		properties.put("mail.transport.protocol", "smtp");							// SMTP 프로토콜 사용
   		properties.put("mail.smtp.host", smtpIp);									// 메일서버 주소 설정
   		properties.put("mail.smtp.port", "25");										// 메일서버 포트 설정
   		properties.put("mail.smtp.auth", true);										// 인증 사용 여부
   		
   		SmtpAuth auth = new SmtpAuth(smtpUser, smtpPw);								// SMTP 인증을 위해서 반드시 필요하다
   		
   		StringBuffer contentBase = new StringBuffer();
   				
   		
   		if(gubun.equals("P")){
   			//구매
   			contentBase.append("				<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>																																		\n");
   			contentBase.append("				<html xmlns='http://www.w3.org/1999/xhtml'>                                                                                                                                                                                                                     \n");
   			contentBase.append("				<head>                                                                                                                                                                                                                                                          \n");
   			contentBase.append("				<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />                                                                                                                                                                                          \n");
   			contentBase.append("				<title>:::협력업체포탈_mailing:::</title>                                                                                                                                                                                                                       	\n");
   			contentBase.append("				<style type='text/css'>                                                                                                                                                                                                                                         \n");
   			contentBase.append("				<!--                                                                                                                                                                                                                                                            \n");
   			contentBase.append("				.style1 {color: #3366CC;font-weight: bold;font-size: 24px; border-bottom:#3366CC dotted 2px;}                                                                                                                                                                   \n");
   			contentBase.append("				.popup_table{width:800px; font-family:dotum; font-size:12px; color:#666666; text-align:left;}                                                                                                                                                                   \n");
   			contentBase.append("				.text_red{font-size:12px; color:#cc0000; height:25px; text-align:left; vertical-align:top; text-indent:10px;}                                                                                                                                                   \n");
   			contentBase.append("				.popup_logo{ background-image:url("+link+"/img/email/popup_logo.gif) ; background-repeat:no-repeat; width:232px;}                                                                                                                                                              \n");
   			contentBase.append("				.popup_title{font-family:dotum; font-size:12px;  text-indent:10px;}                                                                                                                                                                                             \n");
   			contentBase.append("				.td_01{ height:28px; background-color:#f5f9fe; line-height:28px; text-indent:20px; border-top:#cccccc solid 1px; border-right:#cccccc solid 1px; width:130px; font-weight:bold; color:#333333;}                                                                 \n");
   			contentBase.append("				.td_01_2{ height:28px; background-color:#f5f9fe; line-height:28px; text-indent:20px; border-top:#cccccc solid 1px; border-right:#cccccc solid 1px;border-bottom:#cccccc solid 1px; width:130px; font-weight:bold; color:#333333;}                               \n");
   			contentBase.append("				.td_02{ height:28px;line-height:28px;border-top:#cccccc solid 1px; text-indent:20px; font-weight:bold; color:#2f63ac;}                                                                                                                                          \n");
   			contentBase.append("				.td_02_2{ height:28px;line-height:28px; text-indent:5px; color:#2f63ac;}                                                                                                                                                                                        \n");
   			contentBase.append("				.td_02_3{ line-height:16px; color:#2f63ac; font-size:11px;}                                                                                                                                                                                                     \n");
   			contentBase.append("				.td_03{ height:300px;line-height:20px;border-top:#cccccc solid 1px; color:#333333; padding:20px;}                                                                                                                                                               \n");
   			contentBase.append("				.td_04{ height:28px;line-height:28px;border-top:#cccccc solid 1px; text-indent:20px; color:#666666;border-bottom:#cccccc solid 1px;}                                                                                                                            \n");
   			contentBase.append("				.text01{width:auto; font-size:12px; line-height:18px; padding:5px; text-align:left;}                                                                                                                                                                            \n");
   			contentBase.append("				.text_icon4{color:#ccc; font-size:12px; line-height:16px; width:15px; font-weight:bold;}                                                                                                                                                                        \n");
   			contentBase.append("				.style2 {                                                                                                                                                                                                                                                       \n");
   			contentBase.append("					font-size: 18px;                                                                                                                                                                                                                                            \n");
   			contentBase.append("					font-weight: bold;                                                                                                                                                                                                                                          \n");
   			contentBase.append("				}                                                                                                                                                                                                                                                               \n");
   			contentBase.append("				.style3 {font-size:12px; color:#3366CC; height:25px; text-align:left; vertical-align:top; text-indent:10px;}                                                                                                                                                    \n");
   			contentBase.append("				.style4 {color: #3366CC;font-weight: bold;font-size: 14px;}                                                                                                                                                                                                     \n");
   			contentBase.append("				</style>                                                                                                                                                                                                                                                        \n");
   			contentBase.append("				</head>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				<body style='padding:0px; margin:0px;'>                                                                                                                                                                                                                         \n");
   			contentBase.append("				<div align='center'>                                                                                                                                                                                                                                            \n");
   			contentBase.append("				 <table border='0' cellpadding='0' cellspacing='0' class='popup_table' style='width:800px; font-family:dotum; font-size:12px; color:#666666; text-align:left;'>                                                                                                                                                                                         \n");
   			contentBase.append("				  <tr>                                                                                                                                                                                                                                                          \n");
   			contentBase.append("				   <td>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				    <table border='0' cellpadding='0' cellspacing='0' style='width:800px; height:62px; background-image:url("+link+"/img/email/img_mail_title.gif); background-repeat:no-repeat;'>                                                                                             \n");
   			contentBase.append("				     <tr>                                                                                                                                                                                                                                                       \n");
   			contentBase.append("				      <td class='popup_logo'  width='232' style=' background-image:url("+link+"/img/email/popup_logo.gif) ; background-repeat:no-repeat; width:232px;'>&nbsp;</td>                                                                                                                                                                                                           \n");
   			contentBase.append("				      <td class='popup_title' style='font-family:dotum; font-size:12px;  text-indent:10px;'>"+subSubject+"</td>                                                                                                                                                                                                           		\n");
   			contentBase.append("				     </tr>                                                                                                                                                                                                                                                      \n");
   			contentBase.append("				    </table>                                                                                                                                                                                                                                                    \n");
   			contentBase.append("				   </td>                                                                                                                                                                                                                                                        \n");
   			contentBase.append("				  </tr>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				  <tr>                                                                                                                                                                                                                                                          \n");
   			contentBase.append("				    <td align='center' style='height:100%; padding:20px; background-image:url("+link+"/img/email/img_h_bg.gif); background-repeat:repeat-y;'>                                                                                                                                  \n");
   			contentBase.append("				     <table width='700' border='0' cellspacing='0' cellpadding='0'>                                                                                                                                                                                             \n");
   			contentBase.append("				        <tr>                                                                                                                                                                                                                                                    \n");
   			contentBase.append("				        <td height='50' align='center'  class='style1' style='color: #3366CC;font-weight: bold;font-size: 24px; border-bottom:#3366CC dotted 2px;'>"+subSubject+"</td>                                                                                                                                                                                       	\n");
   			contentBase.append("				       </tr>                                                                                                                                                                                                                                                    \n");
   			contentBase.append("				      <tr>                                                                                                                                                                                                                                                      \n");
   			contentBase.append("				        <td style='padding:30px 20px 20px 20px;'>                                                                                                                                                                                                               \n");
   			contentBase.append("				         <table width='98%' border='0' cellpadding='0' cellspacing='0' style='border:#CCCCCC dotted 1px;'>                                                                                                                                                      \n");
   			contentBase.append("				                 <tr>                                                                                                                                                                                                                                           \n");
   			contentBase.append("				                    <td height='20' colspan='3' style='line-height:24px; font-size:14px; font-weight:bold; text-align:left; padding:15px;'>구매테스트</td>                                                                                                                                                                                              \n");
   			contentBase.append("				                 </tr>                                                                                                                                                                                                                                          \n");
   			contentBase.append("				                 <tr>                                                                                                                                                                                                                                           \n");
   			contentBase.append("				                    <td height='20' colspan='3'>&nbsp;</td>                                                                                                                                                                                                     \n");
   			contentBase.append("				                 </tr>                                                                                                                                                                                                                                  		\n");
   			contentBase.append("				                 <tr>                                                                                                                                                                                                                                           \n");
   			contentBase.append("				                    <td height='20' colspan='3'>&nbsp;</td>                                                                                                                                                                                                     \n");
   			contentBase.append("				      			</tr>                                                                                                                                                                                                                                                     \n");
   			contentBase.append("				    	</table></td>                                                                                                                                                                                                                                               \n");
   			contentBase.append("				  		</tr>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				  		</table></td>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				  <tr>                                                                                                                                                                                                                                                          \n");
   			contentBase.append("				    <td align=center style='background-image:url("+link+"/img/email/img_h_bg.gif); background-repeat:repeat-y; padding-bottom:20px;'>                                                                                                                                        \n");
   			contentBase.append("				    <table border='0' cellspacing='0' cellpadding='0'>                                                                                                                                                                                                          \n");
   			contentBase.append("				      <tr>                                                                                                                                                                                                                                                      \n");
   			contentBase.append("				        <td><a href='"+linkPortal+"'><img src="+link+"/img/email/btn_go.gif alt='사이트접속하기' border='0'  /></a></td>                                                                                                                                                                  	\n");
   			contentBase.append("				      </tr>                                                                                                                                                                                                                                                     \n");
   			contentBase.append("				    </table></td>                                                                                                                                                                                                                                               \n");
   			contentBase.append("				  </tr>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				   <tr>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				    <td align='center' style='height:50px; vertical-align:top;'>                                                                                                                                                                                                \n");
   			contentBase.append("				    <table border='0' cellspacing='0' cellpadding='0'>                                                                                                                                                                                                          \n");
   			contentBase.append("				      <tr>                                                                                                                                                                                                                                                      \n");
   			contentBase.append("				        <td><img src="+link+"/img/email/img_mail_footter.jpg /></td>                                                                                                                                                                                                         \n");
   			contentBase.append("				      </tr>                                                                                                                                                                                                                                                     \n");
   			contentBase.append("				      <tr>                                                                                                                                                                                                                                                      \n");
   			contentBase.append("				        <td align='center' height='30' style='font-size:11px;'>본메일은 발신전용 메일이므로 회신되지 않습니다.</td>                                                                                                                                             				\n");
   			contentBase.append("				      </tr>                                                                                                                                                                                                                                                     \n");
   			contentBase.append("				                                                                                                                                                                                                                                                                \n");
   			contentBase.append("				    </table></td>                                                                                                                                                                                                                                               \n");
   			contentBase.append("				  </tr>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				 </table>                                                                                                                                                                                                                                                       \n");
   			contentBase.append("				</div>                                                                                                                                                                                                                                                          \n");
   			contentBase.append("				</body>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				</html>																																																															\n");
   		}else{
   			//외주
   			contentBase.append("				<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>																																		\n");
   			contentBase.append("				<html xmlns='http://www.w3.org/1999/xhtml'>                                                                                                                                                                                                                     \n");
   			contentBase.append("				<head>                                                                                                                                                                                                                                                          \n");
   			contentBase.append("				<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />                                                                                                                                                                                          \n");
   			contentBase.append("				<title>:::전자조달_mailing:::</title>                                                                                                                                                                                                                       	\n");
   			contentBase.append("				<style type='text/css'>                                                                                                                                                                                                                                         \n");
   			contentBase.append("				<!--                                                                                                                                                                                                                                                            \n");
   			contentBase.append("				.style1 {color: #3366CC;font-weight: bold;font-size: 24px; border-bottom:#3366CC dotted 2px;}                                                                                                                                                                   \n");
   			contentBase.append("				.popup_table{width:800px; font-family:dotum; font-size:12px; color:#666666; text-align:left;}                                                                                                                                                                   \n");
   			contentBase.append("				.text_red{font-size:12px; color:#cc0000; height:25px; text-align:left; vertical-align:top; text-indent:10px;}                                                                                                                                                   \n");
   			contentBase.append("				.popup_logo{ background-image:url("+link+"/img/email/popup_logo.gif) ; background-repeat:no-repeat; width:232px;}                                                                                                                                                              \n");
   			contentBase.append("				.popup_title{font-family:dotum; font-size:12px;  text-indent:10px;}                                                                                                                                                                                             \n");
   			contentBase.append("				.td_01{ height:28px; background-color:#f5f9fe; line-height:28px; text-indent:20px; border-top:#cccccc solid 1px; border-right:#cccccc solid 1px; width:130px; font-weight:bold; color:#333333;}                                                                 \n");
   			contentBase.append("				.td_01_2{ height:28px; background-color:#f5f9fe; line-height:28px; text-indent:20px; border-top:#cccccc solid 1px; border-right:#cccccc solid 1px;border-bottom:#cccccc solid 1px; width:130px; font-weight:bold; color:#333333;}                               \n");
   			contentBase.append("				.td_02{ height:28px;line-height:28px;border-top:#cccccc solid 1px; text-indent:20px; font-weight:bold; color:#2f63ac;}                                                                                                                                          \n");
   			contentBase.append("				.td_02_2{ height:28px;line-height:28px; text-indent:5px; color:#2f63ac;}                                                                                                                                                                                        \n");
   			contentBase.append("				.td_02_3{ line-height:16px; color:#2f63ac; font-size:11px;}                                                                                                                                                                                                     \n");
   			contentBase.append("				.td_03{ height:300px;line-height:20px;border-top:#cccccc solid 1px; color:#333333; padding:20px;}                                                                                                                                                               \n");
   			contentBase.append("				.td_04{ height:28px;line-height:28px;border-top:#cccccc solid 1px; text-indent:20px; color:#666666;border-bottom:#cccccc solid 1px;}                                                                                                                            \n");
   			contentBase.append("				.text01{width:auto; font-size:12px; line-height:18px; padding:5px; text-align:left;}                                                                                                                                                                            \n");
   			contentBase.append("				.text_icon4{color:#ccc; font-size:12px; line-height:16px; width:15px; font-weight:bold;}                                                                                                                                                                        \n");
   			contentBase.append("				.style2 {                                                                                                                                                                                                                                                       \n");
   			contentBase.append("					font-size: 18px;                                                                                                                                                                                                                                            \n");
   			contentBase.append("					font-weight: bold;                                                                                                                                                                                                                                          \n");
   			contentBase.append("				}                                                                                                                                                                                                                                                               \n");
   			contentBase.append("				.style3 {font-size:12px; color:#3366CC; height:25px; text-align:left; vertical-align:top; text-indent:10px;}                                                                                                                                                    \n");
   			contentBase.append("				.style4 {color: #3366CC;font-weight: bold;font-size: 14px;}                                                                                                                                                                                                     \n");
   			contentBase.append("				</style>                                                                                                                                                                                                                                                        \n");
   			contentBase.append("				</head>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				<body style='padding:0px; margin:0px;'>                                                                                                                                                                                                                         \n");
   			contentBase.append("				<div align='center'>                                                                                                                                                                                                                                            \n");
   			contentBase.append("				 <table border='0' cellpadding='0' cellspacing='0' class='popup_table' style='width:800px; font-family:dotum; font-size:12px; color:#666666; text-align:left;'>                                                                                                                                                                                         \n");
   			contentBase.append("				  <tr>                                                                                                                                                                                                                                                          \n");
   			contentBase.append("				   <td>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				    <table border='0' cellpadding='0' cellspacing='0' style='width:800px; height:62px; background-image:url("+link+"/img/email/img_mail_title2.gif); background-repeat:no-repeat;'>                                                                                             \n");
   			contentBase.append("				     <tr>                                                                                                                                                                                                                                                       \n");
   			contentBase.append("				      <td class='popup_logo'  width='232' style=' background-image:url("+link+"/img/email/popup_logo.gif) ; background-repeat:no-repeat; width:232px;'>&nbsp;</td>                                                                                                                                                                                                           \n");
   			contentBase.append("				      <td class='popup_title' style='font-family:dotum; font-size:12px;  text-indent:10px;'>"+subSubject+"</td>                                                                                                                                                                                                           		\n");
   			contentBase.append("				     </tr>                                                                                                                                                                                                                                                      \n");
   			contentBase.append("				    </table>                                                                                                                                                                                                                                                    \n");
   			contentBase.append("				   </td>                                                                                                                                                                                                                                                        \n");
   			contentBase.append("				  </tr>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				  <tr>                                                                                                                                                                                                                                                          \n");
   			contentBase.append("				    <td align='center' style='height:100%; padding:20px; background-image:url("+link+"/img/email/img_h_bg.gif); background-repeat:repeat-y;'>                                                                                                                                  \n");
   			contentBase.append("				     <table width='700' border='0' cellspacing='0' cellpadding='0'>                                                                                                                                                                                             \n");
   			contentBase.append("				        <tr>                                                                                                                                                                                                                                                    \n");
   			contentBase.append("				        <td height='50' align='center'  class='style1' style='color: #3366CC;font-weight: bold;font-size: 24px; border-bottom:#3366CC dotted 2px;'>"+subSubject+"</td>                                                                                                                                                                                       	\n");
   			contentBase.append("				       </tr>                                                                                                                                                                                                                                                    \n");
   			contentBase.append("				      <tr>                                                                                                                                                                                                                                                      \n");
   			contentBase.append("				        <td style='padding:30px 20px 20px 20px;'>                                                                                                                                                                                                               \n");
   			contentBase.append("				         <table width='98%' border='0' cellpadding='0' cellspacing='0' style='border:#CCCCCC dotted 1px;'>                                                                                                                                                      \n");
   			contentBase.append("				                 <tr>                                                                                                                                                                                                                                           \n");
   			contentBase.append("				                    <td height='20' colspan='3' style='line-height:24px; font-size:14px; font-weight:bold; text-align:left; padding:15px;'>외주테스트</td>                                                                                                                                                                                              \n");
   			contentBase.append("				                 </tr>                                                                                                                                                                                                                                          \n");
   			contentBase.append("				                 <tr>                                                                                                                                                                                                                                           \n");
   			contentBase.append("				                    <td height='20' colspan='3'>&nbsp;</td>                                                                                                                                                                                                     \n");
   			contentBase.append("				                 </tr>                                                                                                                                                                                                                                  		\n");
   			contentBase.append("				                 <tr>                                                                                                                                                                                                                                           \n");
   			contentBase.append("				                    <td height='20' colspan='3'>&nbsp;</td>                                                                                                                                                                                                     \n");
   			contentBase.append("				      			</tr>                                                                                                                                                                                                                                                     \n");
   			contentBase.append("				    	</table></td>                                                                                                                                                                                                                                               \n");
   			contentBase.append("				  		</tr>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				  		</table></td>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				  <tr>                                                                                                                                                                                                                                                          \n");
   			contentBase.append("				    <td align=center style='background-image:url("+link+"/img/email/img_h_bg.gif); background-repeat:repeat-y; padding-bottom:20px;'>                                                                                                                                        \n");
   			contentBase.append("				    <table border='0' cellspacing='0' cellpadding='0'>                                                                                                                                                                                                          \n");
   			contentBase.append("				      <tr>                                                                                                                                                                                                                                                      \n");
   			contentBase.append("				        <td><a href='"+linkPortal+"'><img src="+link+"/img/email/btn_go.gif alt='사이트접속하기' border='0'  /></a></td>                                                                                                                                                                  	\n");
   			contentBase.append("				      </tr>                                                                                                                                                                                                                                                     \n");
   			contentBase.append("				    </table></td>                                                                                                                                                                                                                                               \n");
   			contentBase.append("				  </tr>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				   <tr>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				    <td align='center' style='height:50px; vertical-align:top;'>                                                                                                                                                                                                \n");
   			contentBase.append("				    <table border='0' cellspacing='0' cellpadding='0'>                                                                                                                                                                                                          \n");
   			contentBase.append("				      <tr>                                                                                                                                                                                                                                                      \n");
   			contentBase.append("				        <td><img src="+link+"/img/email/img_mail_footter.jpg /></td>                                                                                                                                                                                                         \n");
   			contentBase.append("				      </tr>                                                                                                                                                                                                                                                     \n");
   			contentBase.append("				      <tr>                                                                                                                                                                                                                                                      \n");
   			contentBase.append("				        <td align='center' height='30' style='font-size:11px;'>본메일은 발신전용 메일이므로 회신되지 않습니다.</td>                                                                                                                                             				\n");
   			contentBase.append("				      </tr>                                                                                                                                                                                                                                                     \n");
   			contentBase.append("				                                                                                                                                                                                                                                                                \n");
   			contentBase.append("				    </table></td>                                                                                                                                                                                                                                               \n");
   			contentBase.append("				  </tr>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				 </table>                                                                                                                                                                                                                                                       \n");
   			contentBase.append("				</div>                                                                                                                                                                                                                                                          \n");
   			contentBase.append("				</body>                                                                                                                                                                                                                                                         \n");
   			contentBase.append("				</html>																																																															\n");
   		}

   		
   		try {
   			
   			Session session = Session.getInstance(properties, auth);				// Properties 객체와 auth(인증)객체로 메일전송 세션 생성
   			MimeMessage msg = new MimeMessage(session);								// 메일 객체를 세션을 통해 생성
   			
   			InternetAddress[] to_address = {new InternetAddress(toEmail)};			// 받는 사람 메일 주소 객체 생성
   		//	msg.setFrom(new InternetAddress(sendUser));							// 보내는 사람 메일주소 설정
   			
   			//msg.setFrom(new InternetAddress(sendUser, "SGC이앤씨(주)"));
   			msg.setFrom(new InternetAddress(new String(sendUser.getBytes("utf-8"), "8859_1")));							// 보내는 사람 메일주소 설정
   			

   			
   			msg.setRecipients(Message.RecipientType.TO, to_address);				// 받는 사람 메일 주소를 메일 객체에 매핑
   			msg.setContent(contentBase.toString(), "text/html; charset=utf-8");					// 메일 내용을 설정하며 메일 형식을 HTML로 지정
   			msg.setSubject(mailSubject,"utf-8");									// 메일 제목 설정
   			msg.setSentDate(new Date());											// 보내는 날짜 설정
   			
   			Transport.send(msg);													// 메일 전송 부분
   			
   		} catch(MessagingException me) {
   			 WAFLogger.error(this.getClass().getName() + " --> sendEmail() : \n" + me.getMessage());
   	         WAFLogger.error(me);
   			 throw me;
   		} catch(Exception e) {
   			WAFLogger.error(this.getClass().getName() + " --> sendEmail() : \n" + e.getMessage());
               WAFLogger.error(e);
               throw e;
   		}
   	}
    
   private RowSet getSmtpInfo() throws Exception{
       
   	Search search = new SearchImpl();
       RowSet rowSet = new RowSetImpl();
       
       StringBuffer sqlstr = new StringBuffer();       
       
       try {
       	sqlstr.append(" SELECT  CHG_CODE01             \n");
       	sqlstr.append("         ,CHG_CODE02            \n");
       	sqlstr.append("         ,CHG_CODE03            \n");
       	sqlstr.append("         ,CHG_CODE04            \n");
       	sqlstr.append("         ,CHG_CODE05            \n");
       	sqlstr.append("         ,CHG_CODE06            \n");
       	sqlstr.append(" FROM    EBID_COM910T A              \n");
       	sqlstr.append("         ,EBID_COM911T B             \n");
       	sqlstr.append(" WHERE   A.BASECD = B.BASECD    \n");
       	sqlstr.append(" AND     A.BASECD = 'EMAIL'     \n");
       	sqlstr.append(" AND     B.DETAILCD = '001'     \n");
       	
           search.setStatement(sqlstr.toString());
           rowSet = search.execute();            
       }
       catch(WAFSQLException se) {
           Logger.err.println("SQL : \n" + se.getStatement());
           Logger.err.println("PARAM : \n" + se.getParameter());
           throw se;
      }
       finally {
           if( rowSet == null ) rowSet = new RowSetImpl();
           return rowSet;
       }
   }
   
   
	
}