/**
 * @(#)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 com.udapsoft.waf.common.ui.HTMLMaker;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
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 com.udapsoft.modular.web.ibsheet7.IBSheet7Factory;
import com.udapsoft.modular.web.ibsheet7.util.IBSheet7Utils;
import com.udapsoft.waf.system.Biz;
import com.udapsoft.waf.system.HandlerStorage;






public class SuppJoinRequestListBiz extends Biz {

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

	/* (non-Javadoc)
	 * @see kr.co.hwenc.system.Biz#doBiz()
	 */
	public void doBiz() throws Exception {

		
		
		WAFLogger.debug("event==============>" + storage.getEvent());
		
		if(storage.compareEvent(""))
		{
	        RowSet suppStatusRowSet = getSuppStatusRowSet(params);
	        storage.addRowSet("SuppStatusRowSet", suppStatusRowSet);
		    
		    
		 // 상태 콤보 박스
//            String suppStatusSelectTag =  getSuppStatusSelectTag(params.get("status"), "style='width:50%;height=18;'");
//            storage.addObject("suppStatusSelectTag", suppStatusSelectTag);
		    
		    params.set("job_div", params.get("job_div"));
		    
		    
            
		}
		else if(storage.compareEvent("GET_LIST"))
        {
		    params.set("sheet1", getList(params));
            storage.addObject("ibsheet7Data", IBSheet7Factory.createIBSheet7(params, storage.request));
        }
		else if(storage.compareEvent("DELETE_DATA"))
        {
	        boolean success = false;
            
            String[] status = super.gets("sheet1.STATUS");
            
            for (int i = 0; i < status.length; i++) 
            {
//                if (IBSheet7Utils.equalStatusInsert(status[i])) 
//                {
//                    success = saveItemData(IBSheet7Utils.getIBSheet7SqlParams("SHEET2", params, i));
//                }
//                
//                if (IBSheet7Utils.equalStatusUpdate(status[i])) 
//                {
//                    success = updateItemData(IBSheet7Utils.getIBSheet7SqlParams("SHEET2", params, i));
//                }
                
                if (IBSheet7Utils.equalStatusDelete(status[i])) 
                {
                    success = deleteChargeData(IBSheet7Utils.getIBSheet7SqlParams("SHEET1", params, i));
                }
            }
            
            super.storage.setSuccess(success);
            storage.addObject("ibsheet7Data", IBSheet7Factory.createIBSheet7(params, storage.request));
        }
		else if(storage.compareEvent("ALL_CONFIRM"))
        {
	        boolean success = false;
	        
            String[] status = super.gets("sheet1.STATUS");
            
            String[] hp_no = super.gets("sheet1.HP_NUM");
            
            String[] email = super.gets("sheet1.EMAIL");
            
		    for (int i = 0; i < status.length; i++) 
            {
//                if (IBSheet7Utils.equalStatusInsert(status[i])) 
//                {
//                    success = saveItemData(IBSheet7Utils.getIBSheet7SqlParams("SHEET2", params, i));
//                }
//                
                if (IBSheet7Utils.equalStatusUpdate(status[i])) 
                {
                    success = updateStatus(IBSheet7Utils.getIBSheet7SqlParams("SHEET1", params, i));
                    
                    if(success == true)
                    {
        				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("=================================");
                        	
                        	sendEmail(email[i], "test", subject, subject_in, contentBase, null);
                        	
                        	WAFLogger.debug("email[i]="+email[i]);
                        	WAFLogger.debug("=================================");
                			
                            //SMS
                            String smsContent = "SGC이앤씨 협력업체포탈 시스템 가입요청.'||CHR(13)||CHR(10)||'시스템에 접속하시어 확인바랍니다."; 
                            String re_phon_no = "024898247"; //SGC이앤씨 번호
                            
                            sendSMS(hp_no[i], 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");
                			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");
                            
                			WAFLogger.debug("=================================");
                			WAFLogger.debug("email[i]="+email[i]);
                			WAFLogger.debug("=================================");
                			
                			if(!email[i].equals("")){
                				sendEmail(email[i], "test", subject, subject_in, contentBase, null);
                			}
                            
                            //SMS
                			String smsContent = "SGC이앤씨 협력업체포탈 시스템 가입요청.'||CHR(13)||CHR(10)||'시스템에 접속하시어 확인바랍니다."; 
                            String re_phon_no = "024898270"; //SGC이앤씨 번호
                            
                            sendSMS(hp_no[i],storage.getUser().get("USER_PHONE"),  storage.getUser().get("ACCT_ID"), smsContent); //2015.9.21 re_phon_no
                        }
                    }
                }
                
//                if (IBSheet7Utils.equalStatusDelete(status[i])) 
//                {
//                    success = deleteChargeData(IBSheet7Utils.getIBSheet7SqlParams("SHEET1", params, i));
//                }
            }
		    
		    super.storage.setSuccess(success);
            storage.addObject("ibsheet7Data", IBSheet7Factory.createIBSheet7(params, storage.request));
        }
	}
	
	
	private boolean updateStatus(ValueObject sqlParams) throws Exception {
        Persistent persistent = null;
        StringBuffer sql = new StringBuffer();
        
        
        try {
            
            conn.begin();
            persistent = new PersistentImpl(super.conn.getConnection());
            
            sql.append("    UPDATE SUPP_INFO SET          \n ");
            sql.append("    STATUS = '00'          \n ");
            sql.append("        WHERE CORP_ID = ?                          \n ");
            
            persistent.setStatement(sql.toString());
            persistent.addParameter(sqlParams.get("CORP_ID"));
            
            WAFLogger.debug(sql.toString());
            WAFLogger.debug(persistent.getParameters());
            
            persistent.execute();
            persistent.clearParameters();
            
            return true;
        } catch(Exception e) {
//          e.printStackTrace();
            WAFLogger.error(this.getClass().getName() + " --> deleteChargeData() : " + e.getMessage());
            WAFLogger.error("SQL : " + persistent.toString());
            WAFLogger.error(e);
            conn.setRollback();
            throw e;
            
        }
        
        finally {
            super.conn.end();
        }
    }
	
	
	private boolean deleteChargeData(ValueObject sqlParams) throws Exception {
        Persistent persistent = null;
        StringBuffer sql = new StringBuffer();
        
        
        try {
            
            conn.begin();
            persistent = new PersistentImpl(super.conn.getConnection());
            
            sql.append("    DELETE FROM  SUPP_CHARGE          \n ");
            sql.append("        WHERE CORP_ID = ?                          \n ");
            
            persistent.setStatement(sql.toString());
            persistent.addParameter(sqlParams.get("CORP_ID"));
            
            WAFLogger.debug(sql.toString());
            WAFLogger.debug(persistent.getParameters());
            
            persistent.execute();
            persistent.clearParameters();
            
            return true;
        } catch(Exception e) {
//          e.printStackTrace();
            WAFLogger.error(this.getClass().getName() + " --> deleteChargeData() : " + e.getMessage());
            WAFLogger.error("SQL : " + persistent.toString());
            WAFLogger.error(e);
            conn.setRollback();
            throw e;
            
        }
        
        finally {
            boolean sucss2 = deleteSuppInfo(sqlParams);
            if(sucss2 == false) conn.setRollback();
            super.conn.end();
        }
    }
	
	private boolean deleteSuppInfo(ValueObject sqlParams) throws Exception {
        Persistent persistent = null;
        StringBuffer sql = new StringBuffer();
        
        
        try {
            
            conn.begin();
            persistent = new PersistentImpl(super.conn.getConnection());
            
            sql.append("    DELETE FROM  SUPP_INFO          \n ");
            sql.append("        WHERE CORP_ID = ?                          \n ");
            
            persistent.setStatement(sql.toString());
            persistent.addParameter(sqlParams.get("CORP_ID"));
            
            WAFLogger.debug(sql.toString());
            WAFLogger.debug(persistent.getParameters());
            
            
            persistent.execute();
            persistent.clearParameters();
            
            return true;
        } catch(Exception e) {
//          e.printStackTrace();
            WAFLogger.error(this.getClass().getName() + " --> deleteSuppInfo() : " + e.getMessage());
            WAFLogger.error("SQL : " + persistent.toString());
            WAFLogger.error(e);
            conn.setRollback();
            throw e;
            
        }
        
        finally {
            super.conn.end();
        }
    }
	
	
	private RowSet getSuppStatusRowSet(ValueObject Params) throws Exception
	{
	    Search search = new SearchImpl();
        RowSet rowSet = new RowSetImpl();
        StringBuffer sqlStr = new StringBuffer();
        
        
        try
        {           
            sqlStr.append(" SELECT DETAILCD, DETAILNM FROM EBID_COM911T WHERE BASECD = 'SUPP_INFO_STATUS' AND DETAILCD IN('AA', '00')                                 \n");
            
            
            search.setStatement(sqlStr.toString());
            rowSet = search.execute();
        }
        catch (Exception se) {
        	WAFLogger.error(se);
            super.doException(se);
            this.storage.setSuccess(false);
            this.storage.setMessage(se.getMessage());
            storage.setDetailMessage(se);
            
            se.printStackTrace();
            throw new Exception(se);
        }
        finally {    
            if(rowSet == null) rowSet = new RowSetImpl();
            return rowSet;
        }
	}
	
	
	
	/**
     * 목록을 검색하여 리턴
     * @param Params
     * @return
     */
    private RowSet getList(ValueObject Params) throws Exception {
        Search search = new SearchImpl();
        RowSet rowSet = new RowSetImpl();
        StringBuffer sqlStr = new StringBuffer();
        
        try {
            sqlStr.append(" SELECT                                                          \n")
                    .append("             A.CORP_ID                                            \n")
                    .append("           , A.CORP_REG_NO                                            \n")
                    .append("           , A.CORP_KOR                                                       \n")
                    .append("           , A.REP_NAME                                                        \n")
                    .append("           , B.USER_NAME                                                        \n")
                    .append("           , B.EMAIL                                                        \n")
                    .append("           , B.HP1 || '-' ||  B.HP2 || '-' ||  B.HP3 HP_NUM                                                        \n")
                    .append("           , DECODE(A.CORP_DIV_CD, '1', '법인', '개인') CORP_DIV_CD           \n")
                    .append("           , A.REG_REQ_DT                                                                          \n")
                    .append("           , A.REG_DT                                                                          \n")
                    .append("           , DECODE(A.STATUS, '', 'AA',  '00', '가입요청', '01', '대기', '02', '가등록', '03', '등록', '91', '거래중지', '99', '거래취소', '작성중')  STATUS_CODE           \n")
                    .append("           , DECODE(A.STATUS, '', '작성중',  '00', '가입요청', '01', '대기', '02', '가등록', '03', '등록', '91', '거래중지', '99', '거래취소', '작성중')  STATUS_NM           \n")
                    .append("           FROM SUPP_INFO A, SUPP_CHARGE B                                          \n")
                    .append("        WHERE A.CORP_ID = B.CORP_ID                                           \n")
                    .append("        AND B.DEFAULT_YN = 'Y'                                            \n")
                    .append("        AND A.JOB_DIV = ?                                           \n")
                    .append("        AND A.IN_OUT_DIV != 'O'                                      \n")
                    .append("        AND  NVL(A.STATUS,'AA') IN ('AA', '00')						\n");
            if(!params.get("corp_no").equals(""))
            {
                sqlStr.append("         AND A.CORP_REG_NO LIKE '%' || ? || '%'        \n");
            }
            if(!params.get("corp_name").equals(""))
            {
                sqlStr.append("         AND A.CORP_KOR LIKE '%' || ? || '%'        \n");
            }
            if(!params.get("corp_status").equals(""))
            {
                if(params.get("corp_status").equals("AA"))
                {
                    sqlStr.append("         AND (A.STATUS = ? OR STATUS IS NULL)                            \n");
                }
                else
                {
                    sqlStr.append("         AND A.STATUS = ?                            \n");
                }
            }
            
            sqlStr.append("         ORDER BY NVL(STATUS_CODE,'AA') DESC,  NVL(TO_CHAR(REG_REQ_DT,'YYYYMMDD'),'00000000') DESC,  NVL(TO_CHAR(REG_DT,'YYYYMMDD'),'00000000') DESC, CORP_ID DESC   	\n");
            
            WAFLogger.debug(sqlStr.toString());
            WAFLogger.debug(params.get("corp_status").trim());
            
            search.addParameter(params.get("job_div").trim());
            
            if(!params.get("corp_no").equals(""))
            {
            search.addParameter(params.get("corp_no").trim());
            }
            if(!params.get("corp_name").equals(""))
            {
                search.addParameter(params.get("corp_name").trim());
            }
            if(!params.get("corp_status").equals(""))
            {
                search.addParameter(params.get("corp_status").trim().toString());
            }
            
            search.setStatement(sqlStr.toString());
            WAFLogger.debug(search.getParameters());
              
            /*
            //Paging 처리를 위한 Helper Object 생성
            super.createPageAnchorInfo();
            //한페이지에 가져올 목록의 갯수 지정(미지정시  waf.properties 파일의 기본값을 사용)
            //super.anchor.range = 200;
            //Paging 처리에 사용될 Parameter를  세팅
            super.anchor.setParams(this.params);
            //검색할  SQL 세팅 : SQL은 Paging처리를 하지 않고 작성
            super.anchor.setSQL(sqlStr.toString());
            //전체 Record 숫자를 조회
            super.anchor.doTotalCountSQL(); // 전체 숫자를 조회
            
            //Paging처리가 된 SQL을 Helper Object에서 가져옴
            String temp = super.anchor.getPagingSQL();
            
            search.setStatement(temp);
            */
            
            
            rowSet = search.execute();
            
        }
        catch (Exception se) {
        	WAFLogger.error(se);
            super.doException(se);
            this.storage.setSuccess(false);
            this.storage.setMessage(se.getMessage());
            storage.setDetailMessage(se);
            
            se.printStackTrace();
            throw new Exception(se);
        }
        finally {    
            if(rowSet == null) rowSet = new RowSetImpl();
            return rowSet;
        }
    }
    
    /*
    public String getSuppStatusSelectTag(String selectedValue, String style) {

        RowSet rowSet = getDemandRowSet();

        return HTMLMaker.getSelectTag(rowSet, "DETAILCD", "DETAILNM", "system_id", "style='width:50%;'", "<OPTION value=''>-- 전체 --</OPTION>", selectedValue, 7);
    }
    */
    /*
    public RowSet getDemandRowSet() {
        
        Search search = new SearchImpl();
        RowSet sysRowSet = null;
        String sqlstr = "";
        try {

            sqlstr = " SELECT  DETAILNM, DETAILCD                   \n"
                    + " FROM     EBID_COM911T                   \n"
                    + " WHERE BASECD = 'DEMANDED_STATUS'                \n"
                    + " ORDER BY SORT_NO ASC                            \n";
            search.setStatement(sqlstr);
            sysRowSet = search.execute();
        }
        catch(Exception e) {

            WAFLogger.error(this.getClass().getName() + " --> getSystemRowSet() : " + e.getMessage());
            WAFLogger.error("SQL : " + search.getStatement());
            WAFLogger.error(e);
            return null;
        }
        finally {

            if( sysRowSet == null ) sysRowSet = new RowSetImpl();
            return sysRowSet;
        }
    }
    */
    
    
    /**
	 * 이메일 전송 메소드(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){
		
    	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 link = "http://ebid.sgcenc.co.kr";
		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();
				
		String[] email_domain = toEmail.split("@");
		
		
		if(gubun == null){
			if("HOTMAIL.COM".equals(email_domain[1].toUpperCase())||"GMAIL.COM".equals(email_domain[1].toUpperCase())){
				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' background='"+link+"/img/email/img_mail_title.gif' style='width:800px; height:62px;background-repeat:no-repeat;'>                                                                                             \n");
				contentBase.append("				     <tr>                                                                                                                                                                                                                                                       \n");
				contentBase.append("				      <td class='popup_logo'  width='232' background='"+link+"/img/email/popup_logo.gif' style='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' background='"+link+"/img/email/img_h_bg.gif' style='height:100%; padding:20px;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;'>"+mailContent+"</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 background='"+link+"/img/email/img_h_bg.gif' style='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");
			}else{
				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;'>"+mailContent+"</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");
			}
		}else{
			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;'>"+mailContent+"</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='"+link+"'><img src="+link+"/img/email/btn_go2.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");
		}

		
		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("euc-kr"), "8859_1")));							// 보내는 사람 메일주소 설정

			
			msg.setRecipients(Message.RecipientType.TO, to_address);				// 받는 사람 메일 주소를 메일 객체에 매핑
			msg.setContent(contentBase.toString(), "text/html; charset=euc-kr");					// 메일 내용을 설정하며 메일 형식을 HTML로 지정
			msg.setSubject(mailSubject,"euc-kr");									// 메일 제목 설정
			msg.setSentDate(new Date());											// 보내는 날짜 설정
			
			Transport.send(msg);													// 메일 전송 부분
			
		} catch(MessagingException me) {
			 WAFLogger.error(this.getClass().getName() + " --> sendEmail() : \n" + me.getMessage());
	         WAFLogger.error(me);
		} catch(Exception e) {
			WAFLogger.error(this.getClass().getName() + " --> sendEmail() : \n" + e.getMessage());
            WAFLogger.error(e);
		}
	}

    /**
     * 이메일 전송 메소드(Javamail 사용)
     * @param user
     * @param from_email
     * @param to_name
     * @param to_email
     */
	public RowSet getUserInfo(String acctId) throws Exception{
	    	
	    	Search search = new SearchImpl();
	    	RowSet rowSet = new RowSetImpl();
	    	
	    	StringBuffer sqlstr = new StringBuffer();       
	    	
	    	try {
	    		sqlstr.append(" SELECT  BUSEO       \n");
	    		sqlstr.append("         ,GRADE_NAME              \n");
	    		sqlstr.append("         ,USER_NAME             \n");
	    		sqlstr.append("         ,TEL_NO              \n");
	    		sqlstr.append("         ,HAND_TEL_NO         \n");
	    		sqlstr.append("         ,E_MAIL              \n");
	    		sqlstr.append(" FROM    PUB0120T             \n");
	    		sqlstr.append(" WHERE   ACCT_ID = "+acctId+" \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;
	    	}
	}

    public void sendSMS(String sendAddress, String recvAddress,  String sendUser, String mailContent) {
    	
    	
    	try{
    		super.conn.begin();
    		
    		
    		/*2015.3.6 주석
    		if(!sendUser.trim().equals("")){
    			RowSet userInfo = getUserInfo(sendUser); 
    		    recvAddress = userInfo.getRow(0).get("TEL_NO").replaceAll("-", "");
    		} */
    		
    		
    		if(!sendAddress.equals("")){
    			PersistentImpl persistent = new PersistentImpl(super.conn.getConnection());
    			
    			StringBuffer smsInsert = new StringBuffer();
    			
    			
    			smsInsert.append("				INSERT INTO T_SEND(NREGID,                                              \n");
    			smsInsert.append("				                   NSVCTYPE,                                            \n");
    			smsInsert.append("				                   NADDRTYPE,                                           \n");
    			smsInsert.append("				                   SADDRS,                                              \n");
    			smsInsert.append("				                   NCONTSTYPE,                                          \n");
    			smsInsert.append("				                   SCONTS,                                              \n");
    			smsInsert.append("				                   SFROM                                                \n");
    			smsInsert.append("				                   )VALUES(                                             \n");
    			smsInsert.append("				                   UMSBIZ_SENDSEQ.NEXTVAL,                              \n");
    			smsInsert.append("				                   3,                                                   \n");
    			smsInsert.append("				                   0,                                                   \n");
    			smsInsert.append("				                   ?,                                                   \n");
    			smsInsert.append("				                   0,                                                   \n");
    			smsInsert.append("				                   '"+mailContent+"',                                   \n");
    			smsInsert.append("				                   ?                                                    \n");
    			smsInsert.append("				                   )													\n");
    			
    			persistent.setStatement(smsInsert.toString());
    			
    			persistent.addParameter(sendAddress);
    			persistent.addParameter(recvAddress);
    			
    			persistent.execute();
    			persistent.clearParameters();
    		}
    	}catch(Exception e){
    		WAFLogger.error(e);
    		e.printStackTrace();
    		super.conn.setRollback();
    	}finally{
    		super.conn.end();
    	}
    }
    
private RowSet getSmtpInfo() {
        
    	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());
       }
        finally {
            if( rowSet == null ) rowSet = new RowSetImpl();
            return rowSet;
        }
    }
    
}