jsshin 5 лет назад
Родитель
Сommit
cbc83a6b86

+ 45 - 6
src/main/java/com/style24/admin/biz/dao/TsaCustomerDao.java

@@ -3,6 +3,8 @@ package com.style24.admin.biz.dao;
 import com.style24.core.support.annotation.ShopDs;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.CustomerSearch;
+import com.style24.persistence.domain.Delivery;
+import com.style24.persistence.domain.Order;
 import org.springframework.stereotype.Repository;
 
 import java.util.Collection;
@@ -22,7 +24,7 @@ public interface TsaCustomerDao {
 	 * @param customerSearch - 검색조건
 	 * @return Collection<Customer>
 	 * @author jsshin
-	 * @since 2020. 01. 12
+	 * @since 2021. 01. 12
 	 */
 	Collection<Customer> getCustomerActiveList(CustomerSearch customerSearch);
 
@@ -31,24 +33,61 @@ public interface TsaCustomerDao {
 	 * @param custNo - 고객번호
 	 * @return Customer
 	 * @author jsshin
-	 * @since 2020. 01. 18
+	 * @since 2021. 01. 18
 	 */
-	Customer getCustomerInfo(String custNo);
+	Customer getCustomerInfo(Integer custNo);
 
 	/**
 	 * 회원정보 수정
 	 * @param customer - 고객정보
 	 * @author jsshin
-	 * @since 2020. 01. 20
+	 * @since 2021. 01. 20
 	 */
 	void updateCustomerInfo(Customer customer);
 
+	/**
+	 * 회원 주문내역
+	 * @param custNo - 고객번호
+	 * @return Collection<Order>
+	 * @author jsshin
+	 * @since 2021. 01. 21
+	 */
+	Collection<Order> getCustomerOrderList(Integer custNo);
+
+	/**
+	 * 회원상세-주소정보
+	 *
+	 * @param custNo - 고객번호
+	 * @return Collection<Delivery>
+	 * @author jsshin
+	 * @since 2021. 01. 21
+	 */
+	Collection<Delivery> getCustomerDeliveryAddrList(Integer custNo);
+
+	/**
+	 * 회원상세- 기본배송지 초기화
+	 *
+	 * @param delivery -배송지정보
+	 * @author jsshin
+	 * @since 2021. 01. 21
+	 */
+	void updateCustomerDeliveryAddrDefaultInit(Delivery delivery);
+
+	/**
+	 * 회원상세- 배송지 등록/수정
+	 *
+	 * @param delivery -배송지정보
+	 * @author jsshin
+	 * @since 2021. 01. 21
+	 */
+	void saveCustomerDeliveryAddr(Delivery delivery);
+
 	/**
 	 * 탈퇴회원 목록
 	 * @param customerSearch - 검색조건
 	 * @return Collection<Customer>
 	 * @author jsshin
-	 * @since 2020. 01. 14
+	 * @since 2021. 01. 14
 	 */
 	Collection<Customer> getCustomerSecedeList(CustomerSearch customerSearch);
 
@@ -57,7 +96,7 @@ public interface TsaCustomerDao {
 	 * @param customerSearch - 검색조건
 	 * @return Collection<Customer>
 	 * @author jsshin
-	 * @since 2020. 01. 14
+	 * @since 2021. 01. 14
 	 */
 	Collection<Customer> getCustomerDormantList(CustomerSearch customerSearch);
 

+ 45 - 1
src/main/java/com/style24/admin/biz/service/TsaCustomerService.java

@@ -6,6 +6,8 @@ import com.style24.core.biz.dao.TscCustomerDao;
 import com.style24.core.biz.service.TscCustomerService;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.CustomerSearch;
+import com.style24.persistence.domain.Delivery;
+import com.style24.persistence.domain.Order;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -47,7 +49,7 @@ public class TsaCustomerService {
 	 * @author jsshin
 	 * @since 2020. 01. 18
 	 */
-	public Customer getCustomerInfo(String custNo) {
+	public Customer getCustomerInfo(Integer custNo) {
 		return customerDao.getCustomerInfo(custNo);
 	}
 
@@ -79,6 +81,48 @@ public class TsaCustomerService {
 		coreCustomerService.updateCustomerPassword(customer);
 	}
 
+	/**
+	 * 회원 주문내역
+	 * @param custNo - 고객번호
+	 * @return Collection<Order>
+	 * @author jsshin
+	 * @since 2021. 01. 21
+	 */
+	public Collection<Order> getCustomerOrderList(Integer custNo) {
+		return customerDao.getCustomerOrderList(custNo);
+	}
+
+	/**
+	 * 회원상세-주소정보
+	 *
+	 * @param custNo - 고객번호
+	 * @return Collection<Delivery>
+	 * @author jsshin
+	 * @since 2021. 01. 21
+	 */
+	public Collection<Delivery> getCustomerDeliveryAddrList(Integer custNo) {
+		return customerDao.getCustomerDeliveryAddrList(custNo);
+	}
+
+	/**
+	 * 회원상세-주소정보 수정
+	 *
+	 * @param delivery - 배송지정보
+	 * @author jsshin
+	 * @since 2021. 1 21.
+	 */
+	@Transactional("shopTxnManager")
+	public void saveCustomerDeliveryAddr(Delivery delivery) {
+		Integer userNo = TsaSession.getInfo().getUserNo();
+		delivery.setRegNo(userNo);
+		delivery.setUpdNo(userNo);
+		if ("Y".equals(delivery.getDefaultYn())) {
+			customerDao.updateCustomerDeliveryAddrDefaultInit(delivery);
+		}
+		customerDao.saveCustomerDeliveryAddr(delivery);
+	}
+
+
 	/**
 	 * 탈퇴회원 목록
 	 * @param customerSearch - 검색조건

+ 35 - 30
src/main/java/com/style24/admin/biz/service/TsaKakaoService.java

@@ -65,6 +65,40 @@ public class TsaKakaoService {
 			// Do nothing
 		}
 	}
+
+	/**
+	 * 기본 LMS 발송
+	 * @param customer - LMS 정보
+	 * @author jsshin
+	 * @since 2021. 01. 21
+	 */
+	@Transactional("shopTxnManager")
+	public void sendCustomerBasicLms(Customer customer) {
+		SsgDirectMessage dm = new SsgDirectMessage();
+		dm.setFdestine(customer.getCellPhnno());
+
+		GagaMap replaceInfo = new GagaMap();
+		replaceInfo.setString("siteNm", TscConstants.Style24Infomation.SITE_NAME.value());
+		replaceInfo.setString("custNm", customer.getCustNm());
+		replaceInfo.setString("content", customer.getContent());
+		replaceInfo.setString("callcenterTelNo", TscConstants.CALLCENTER_TEL_NO);
+		kakaoSender.sendLms(SsgKakaoSender.KakaoAnswerSq.BasicLms.value(), dm, replaceInfo);
+
+		try {
+			// 고객접촉이력 정보
+			CustContactHst custContactHst = new CustContactHst();
+			custContactHst.setContactType(TscConstants.ContactType.BASIC_LMS.value()); // 접촉유형:회원-기본LMS안내발송
+			custContactHst.setContactMethod(TscConstants.ContactMethod.LMS.value()); // 접촉방법:LMS(공통코드G055)
+			custContactHst.setContactContents("기본LMS안내발송");
+			custContactHst.setReceiverNo(customer.getCustNo());
+			custContactHst.setSenderNo(TsaSession.getInfo().getUserNo());
+			coreCustomerService.createCustomerContactHistory(custContactHst);
+		} catch (Exception e) {
+			log.error("error", e);
+			// Do nothing
+		}
+	}
+
 //
 //	/**
 //	 * 일대일문의 답변 알림톡 발송
@@ -213,35 +247,6 @@ public class TsaKakaoService {
 //		}
 //	}
 //
-//	/**
-//	 * 기본 LMS 발송
-//	 * @param customer - LMS 정보
-//	 * @author gagamel
-//	 * @since 2020. 11. 9
-//	 */
-//	@Transactional("shopTxnManager")
-//	public void sendCustomerBasicLms(AdmCustomer customer) {
-//		SsgDirectMessage dm = new SsgDirectMessage();
-//		dm.setFdestine(customer.getCellPhnno());
-//
-//		GagaMap replaceInfo = new GagaMap();
-//		replaceInfo.setString("siteNm", customer.getSiteNm());
-//		replaceInfo.setString("custNm", customer.getCustNm());
-//		replaceInfo.setString("content", customer.getContent());
-//		replaceInfo.setString("callcenterTelNo", TscConstants.CALLCENTER_TEL_NO);
-//		kakaoSender.sendLms(SsgKakaoSender.KakaoAnswerSq.BasicLms.value(), dm, replaceInfo);
-//
-//		try {
-//			// 고객접촉이력 정보
-//			customer.setContactType("207"); // 접촉유형:회원-기본LMS안내발송
-//			customer.setContactMethod(TscConstants.ContactMethod.LMS.value()); // 접촉방법:LMS(공통코드G055)
-//			customer.setContactContents("기본LMS안내발송");
-//			customer.setReceiverId(customer.getCustNo());
-//			customerService.createCustomerContactHistory(customer);
-//		} catch (Exception e) {
-//			log.error("error", e);
-//			// Do nothing
-//		}
-//	}
+
 
 }

+ 58 - 64
src/main/java/com/style24/admin/biz/web/TsaCustomerController.java

@@ -13,7 +13,6 @@ import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.CustomerSearch;
 import com.style24.persistence.domain.Delivery;
 import com.style24.persistence.domain.Order;
-import com.sun.xml.internal.bind.v2.TODO;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -313,7 +312,7 @@ public class TsaCustomerController extends TsaBaseController {
 	 * @since 2021. 01. 14
 	 */
 	@GetMapping("/detail/form/{custNo}")
-	public ModelAndView getCustomerDetailForm(@PathVariable String custNo) {
+	public ModelAndView getCustomerDetailForm(@PathVariable Integer custNo) {
 		ModelAndView mav = new ModelAndView();
 
 		// 사이트 목록
@@ -390,7 +389,7 @@ public class TsaCustomerController extends TsaBaseController {
 	 */
 	@GetMapping("/info/{custNo}")
 	@ResponseBody
-	public Customer getCustomerInfo(@PathVariable String custNo) {
+	public Customer getCustomerInfo(@PathVariable Integer custNo) {
 		TscSession.setAttribute("maskingYn", TsaSession.getInfo().getMaskingYn());
 		return customerService.getCustomerInfo(custNo);
 	}
@@ -432,8 +431,9 @@ public class TsaCustomerController extends TsaBaseController {
 		customerService.updateCustomerPassword(customer);
 
 		// 카카오 알림톡
-		kakaoService.sendCustomerTempPassword(customer);
-
+		if (StringUtils.isNotBlank(customer.getCellPhnno())) {
+			kakaoService.sendCustomerTempPassword(customer);
+		}
 		// TODO: 2021.1.20 메일발송 서비스 붙여야함 - jsshin
 
 		return ok(message.getMessage("SUCC_0005"));
@@ -482,16 +482,13 @@ public class TsaCustomerController extends TsaBaseController {
 	@PostMapping("/message/send")
 	@ResponseBody
 	public GagaResponse sendMessage(@RequestBody Customer customer) {
-//		TsaCustomer custInfo = customerService.getCustomerInfo(customer.getCustNo());
-//		customer.setCustNm(custInfo.getCustNm());
-//		customer.setSiteNm(custInfo.getSiteNm());
-//		if (StringUtils.isNotBlank(customer.getCellPhnno())) {
-//			try {
-//				kakaoService.sendCustomerBasicLms(customer);
-//			} catch (Exception e) {
-//				log.error(e.getMessage());
-//			}
-//		}
+		Customer custInfo = customerService.getCustomerInfo(customer.getCustNo());
+		customer.setCustNm(custInfo.getCustNm());
+
+		if (StringUtils.isNotBlank(customer.getCellPhnno())) {
+			kakaoService.sendCustomerBasicLms(customer);
+		}
+
 		return super.ok(message.getMessage("SUCC_0005"));
 	}
 
@@ -550,7 +547,6 @@ public class TsaCustomerController extends TsaBaseController {
 	 * 메일 발송 팝업 화면
 	 *
 	 * @param elementEmail  - 이메일
-	 * @param elementCustNm - 고객명
 	 * @param elementCustNo - 고객일련번호
 	 * @param division - 호출화면구분
 	 * @return ModelAndView
@@ -559,7 +555,6 @@ public class TsaCustomerController extends TsaBaseController {
 	 */
 	@GetMapping("/email/popup/form")
 	public ModelAndView emailPopupForm(@RequestParam(value = "elementEmail") String elementEmail
-									, @RequestParam(value = "elementCustNm", required = false) String elementCustNm
 									, @RequestParam(value = "elementCustNo") String elementCustNo
 									, @RequestParam(value = "division", required = false) String division) {
 
@@ -568,19 +563,16 @@ public class TsaCustomerController extends TsaBaseController {
 		// 받는사람 이메일
 		mav.addObject("elementEmail", elementEmail);
 
-		// 받는사람 이름
-		mav.addObject("elementCustNm", elementCustNm);
-
-		// 고객 아이디
+		// 고객 번호
 		mav.addObject("elementCustNo", elementCustNo);
 
 		mav.addObject("sendEmail", TscConstants.REP_EMAIL);
 
-		mav.setViewName("customer/EmailPopupForm");
-
 		// 접속유형 구분값
 		mav.addObject("division", division);
 
+		mav.setViewName("customer/EmailPopupForm");
+
 		return mav;
 	}
 
@@ -596,10 +588,14 @@ public class TsaCustomerController extends TsaBaseController {
 	@PostMapping("/email/send")
 	@ResponseBody
 	public GagaResponse sendEmail(@RequestBody Customer customer) throws Exception {
+		Customer custInfo = customerService.getCustomerInfo(customer.getCustNo());
+		customer.setCustNm(custInfo.getCustNm());
+
 		// 메일 발송
 		if (StringUtils.isNotBlank(customer.getEmail())) {
 			//mailService.sendBasicMail(customer);
 		}
+
 		return super.ok(message.getMessage("SUCC_0005"));
 	}
 
@@ -613,9 +609,37 @@ public class TsaCustomerController extends TsaBaseController {
 	 */
 	@GetMapping("/order/list/{custNo}")
 	@ResponseBody
-	public Collection<Order> getCustomerOrderList(@PathVariable String custNo) {
-		//return customerService.getCustomerOrderList(custNo);
-		return null;
+	public Collection<Order> getCustomerOrderList(@PathVariable Integer custNo) {
+		return customerService.getCustomerOrderList(custNo);
+	}
+
+	/**
+	 * 회원상세-주소정보
+	 *
+	 * @param custNo -고객일련번호
+	 * @return Collection<Delivery>
+	 * @author jsshin
+	 * @since 2021. 01. 21
+	 */
+	@GetMapping("/delivery/list/{custNo}")
+	@ResponseBody
+	public Collection<Delivery> getCustomerDeliveryList(@PathVariable Integer custNo) {
+		return customerService.getCustomerDeliveryAddrList(custNo);
+	}
+
+	/**
+	 * 회원상세 - 주소지 저장
+	 *
+	 * @param delivery -배송지정보
+	 * @return GagaResponse
+	 * @author jsshin
+	 * @since 2021. 1. 21.
+	 */
+	@PostMapping("/delivery/addr/save")
+	@ResponseBody
+	public GagaResponse saveCustomerDeliveryAddr(@RequestBody Delivery delivery) {
+		customerService.saveCustomerDeliveryAddr(delivery);
+		return super.ok(message.getMessage("SUCC_0001"));
 	}
 
 	/**
@@ -628,7 +652,7 @@ public class TsaCustomerController extends TsaBaseController {
 	 */
 	@GetMapping("/counsel/list/{custNo}")
 	@ResponseBody
-	public Collection<Counsel> getCustomerCounselList(@PathVariable String custNo) {
+	public Collection<Counsel> getCustomerCounselList(@PathVariable Integer custNo) {
 		//return customerService.getCustomerCounselList(custNo);
 		return null;
 	}
@@ -643,7 +667,7 @@ public class TsaCustomerController extends TsaBaseController {
 	 */
 	@GetMapping("/goodsQna/list/{custNo}")
 	@ResponseBody
-	public Collection<Counsel> getCustomerGoodsQnaList(@PathVariable String custNo) {
+	public Collection<Counsel> getCustomerGoodsQnaList(@PathVariable Integer custNo) {
 		//return customerService.getCustomerGoodsQnaList(custNo);
 		return null;
 	}
@@ -675,7 +699,7 @@ public class TsaCustomerController extends TsaBaseController {
 	 */
 	@GetMapping("/coupon/list/{custNo}")
 	@ResponseBody
-	public Collection<Coupon> getCustomerCouponList(@PathVariable String custNo) {
+	public Collection<Coupon> getCustomerCouponList(@PathVariable Integer custNo) {
 		//return customerService.getCustomerCouponList(custNo);
 		return null;
 	}
@@ -690,7 +714,7 @@ public class TsaCustomerController extends TsaBaseController {
 	 */
 //	@GetMapping("/point/{custNo}")
 //	@ResponseBody
-//	public Point getCustomerPoint(@PathVariable String custNo) {
+//	public Point getCustomerPoint(@PathVariable Integer custNo) {
 //		return customerService.getCustomerPoint(custNo);
 //	}
 
@@ -704,7 +728,7 @@ public class TsaCustomerController extends TsaBaseController {
 	 */
 //	@GetMapping("/point/list/{custNo}")
 //	@ResponseBody
-//	public Collection<TsaPoint> getCustomerPointList(@PathVariable String custNo) {
+//	public Collection<TsaPoint> getCustomerPointList(@PathVariable Integer custNo) {
 //		return customerService.getCustomerPointList(custNo);
 //	}
 
@@ -718,7 +742,7 @@ public class TsaCustomerController extends TsaBaseController {
 	 */
 //	@GetMapping("/review/list/{custNo}")
 //	@ResponseBody
-//	public Collection<Review> getCustomerReviewList(@PathVariable String custNo) {
+//	public Collection<Review> getCustomerReviewList(@PathVariable Integer custNo) {
 //		return customerService.getCustomerReviewList(custNo);
 //	}
 
@@ -732,24 +756,10 @@ public class TsaCustomerController extends TsaBaseController {
 	 */
 //	@GetMapping("/change/grade/list/{custNo}")
 //	@ResponseBody
-//	public Collection<TsaCustomer> getCustomerChageGradeList(@PathVariable String custNo) {
+//	public Collection<TsaCustomer> getCustomerChageGradeList(@PathVariable Integer custNo) {
 //		return customerService.getCustomerChangeGradeList(custNo);
 //	}
 
-	/**
-	 * 회원상세-주소정보
-	 *
-	 * @param custNo -고객일련번호
-	 * @return Collection<Delivery>
-	 * @author jsshin
-	 * @since 2021. 01. 21
-	 */
-	@GetMapping("/delivery/list/{custNo}")
-	@ResponseBody
-	public Collection<Delivery> getCustomerDeliveryList(@PathVariable String custNo) {
-		//return customerService.getCustomerDeliveryAddrList(custNo);
-		return null;
-	}
 
 	/**
 	 * 회원상세-회원접촉이력
@@ -761,7 +771,7 @@ public class TsaCustomerController extends TsaBaseController {
 	 */
 	@GetMapping("/contact/list/{custNo}")
 	@ResponseBody
-	public Collection<Customer> getCustomerContactList(@PathVariable String custNo) {
+	public Collection<Customer> getCustomerContactList(@PathVariable Integer custNo) {
 		//return customerService.getCustomerContactList(custNo);
 		return null;
 	}
@@ -782,22 +792,6 @@ public class TsaCustomerController extends TsaBaseController {
 		return super.ok(message.getMessage("SUCC_0001"));
 	}
 
-	/**
-	 * 회원상세 - 주소지 저장
-	 *
-	 * @param delivery -배송지정보
-	 * @return GagaResponse
-	 * @author jsshin
-	 * @since 22021. 01. 21
-	 */
-	@PostMapping("/delivery/addr/save")
-	@ResponseBody
-	public GagaResponse saveCustomerDeliveryAddr(@RequestBody Delivery delivery) {
-		//log.debug("delivery : {}", delivery);
-		//customerService.saveCustomerDeliveryAddr(delivery);
-		return super.ok(message.getMessage("SUCC_0001"));
-	}
-
 
 	/**
 	 * 탈퇴회원

+ 13 - 19
src/main/java/com/style24/persistence/domain/Delivery.java

@@ -37,7 +37,18 @@ public class Delivery extends TscBaseDomain {
 	private String searchTxt;
 	private String colorCd;
 	private String sysImgNm;
-	
+	private String delvAddrNm;
+	private String defaultYn;
+	private String recipNm;
+	private String recipTelno;
+	private String recipPhnno;
+	private String recipZipNo;
+	private String recipBaseAddr;
+	private String recipDtlAddr;
+	private String delvMemo;
+	private String delYn;
+	private Integer custNo;
+	private Integer custDelvAddrSq;
 	
 	/* 위로  작성  ('' ) ( '')*/
 	
@@ -56,10 +67,8 @@ public class Delivery extends TscBaseDomain {
 	private String mallGb;
 	private String mallGbNm;
 	private String ordStat;
-	private String custNo;
 	private String orderNm;
 	private String orderEmail;
-	private String recipNm;
 	private String colorKnm;
 
 	private Integer ordQty;
@@ -79,7 +88,6 @@ public class Delivery extends TscBaseDomain {
 	private String extmallOrdDtlNo;
 	private String supplyCompNm;
 	private String supplyGoodsCd;
-	private String delvMemo;
 	private String ordExchGb;
 	private String frontGb;
 	private String termGb;
@@ -158,11 +166,7 @@ public class Delivery extends TscBaseDomain {
 	private String extmallNm;
 	private String productId;
 
-	private String recipTelno;
-	private String recipPhnno;
-	private String recipPostNo;
-	private String recipBaseAddr;
-	private String recipDtlAddr;
+
 	private String dasRecipStsCd;
 	private String dasRecipIngDt;
 	private String dasRecipCplDt;
@@ -185,14 +189,9 @@ public class Delivery extends TscBaseDomain {
 	private String delvArId;
 	private String rejectReason;
 	private String chulgoQty;
-
 	private String ordExchGbYn;
 	private String payStDate;
 	private String payEdDate;
-
-	private String delYn;
-
-
 	private String goodsStatNm;
 
 	private String stDt;
@@ -201,11 +200,6 @@ public class Delivery extends TscBaseDomain {
 	private String goodsGb;
 
 	private String colorGrpFile;
-
-	private String custDelvAddrSq;
-	private String delvAddrNm;
-	private String defaultYn;
-	private String recipEmail;
 	private Integer invoiceQty;
 
 	private String delayDt;

+ 124 - 1
src/main/java/com/style24/persistence/mybatis/shop/TsaCustomer.xml

@@ -106,7 +106,7 @@
 	</select>
 
 	<!-- 회원기본정보 -->
-	<select id="getCustomerInfo" parameterType="String" resultType="Customer">
+	<select id="getCustomerInfo" parameterType="Integer" resultType="Customer">
 		/* TsaCustomer.getCustomerInfo */
 		SELECT CUST_NO
 		     , CUST_ID
@@ -225,6 +225,129 @@
 		WHERE CUST_NO = #{custNo}
 	</update>
 
+	<!-- 회원 주문내역 -->
+	<select id="getCustomerOrderList" parameterType="Integer" resultType="Order">
+		/* TsaCustomer.getCustomerOrderList */
+		SELECT O.SITE_CD
+		     , O.ORD_NO
+		     , O.MALL_GB
+		     , OD.ORD_DTL_NO
+		     , DATE_FORMAT(O.PAY_DT, '%Y%m%d%H%i%S') AS PAY_DT
+		     , OD.DELV_STDT
+		     , OD.DELV_EDDT
+		     , O.ORD_TELNO
+		     , O.ORD_PHNNO
+		     , OD.ORD_DTL_STAT
+		     , OD.GOODS_CD
+		     , ODI.OPT_CD1              -- 색상
+		     , ODI.OPT_CD2              -- 사이즈
+		     , E.GOODS_NM
+		     , OD.ORD_QTY
+		     , OD.CURR_PRICE
+		     , C.CUST_NO
+		     , DA.RECIP_NM
+		FROM   TB_CUSTOMER C
+		     , TB_ORDER O
+		     , TB_ORDER_DETAIL OD
+		     , TB_ORDER_DETAIL_ITEM ODI
+		     , TB_GOODS E
+		     , TB_DELIVERY_ADDR DA
+		WHERE  C.CUST_NO = O.CUST_NO
+		AND    O.ORD_NO = OD.ORD_NO
+		AND    OD.ORD_NO = ODI.ORD_NO
+		AND    OD.ORD_DTL_NO = ODI.ORD_DTL_NO
+		AND    OD.GOODS_CD = E.GOODS_CD
+		AND    OD.DELV_ADDR_SQ = DA.DELV_ADDR_SQ
+		AND    C.CUST_NO = #{custNo}
+		ORDER BY O.ORD_NO DESC, OD.ORD_DTL_NO
+	</select>
+
+	<!-- 주소정보 내역 -->
+	<select id="getCustomerDeliveryAddrList" parameterType="Integer" resultType="Delivery">
+		/* TsaCustomer.getCustomerDeliveryAddrList */
+		SELECT C.CUST_ID
+		     , C.CUST_NO
+		     , CDA.CUST_DELV_ADDR_SQ
+		     , CDA.CUST_NO
+		     , CDA.DELV_ADDR_NM
+		     , CDA.DEFAULT_YN
+		     , CDA.RECIP_NM
+		     , CDA.RECIP_PHNNO
+		     , CDA.RECIP_TELNO
+		     , CDA.RECIP_BASE_ADDR
+		     , CDA.RECIP_DTL_ADDR
+		     , CDA.DEL_YN
+		     , FN_GET_USER_NM(CDA.REG_NO)              AS REG_NM
+		     , DATE_FORMAT(CDA.REG_DT, '%Y%m%d%H%i%S') AS REG_DT
+		     , FN_GET_USER_NM(CDA.UPD_NO)              AS UPD_NM
+		     , DATE_FORMAT(CDA.UPD_DT, '%Y%m%d%H%i%S') AS UPD_DT
+		FROM   TB_CUSTOMER C
+		     , TB_CUST_DELIVERY_ADDR CDA
+		WHERE  C.CUST_NO = CDA.CUST_NO
+		AND    C.CUST_NO = #{custNo}
+	</select>
+
+	<!-- 주소정보 - 기본배송지 초기화 -->
+	<update id="updateCustomerDeliveryAddrDefaultInit" parameterType="Delivery">
+		/* TsaCustomer.updateCustomerDeliveryAddrDefaultInit */
+		UPDATE TB_CUST_DELIVERY_ADDR
+		SET    DEFAULT_YN = 'N'
+		WHERE  CUST_NO = #{custNo}
+		AND    DEFAULT_YN = 'Y'
+		AND    DEL_YN = 'N'
+	</update>
+
+	<!--주소정보 등록/수정 -->
+	<update id="saveCustomerDeliveryAddr" parameterType="Delivery">
+		/* TsaCustomer.saveCustomerDeliveryAddr */
+		INSERT INTO TB_CUST_DELIVERY_ADDR (
+		       CUST_NO
+		     , DELV_ADDR_NM
+		     , DEFAULT_YN
+		     , RECIP_NM
+		     , RECIP_PHNNO
+		     , RECIP_TELNO
+		     , RECIP_ZIP_NO
+		     , RECIP_BASE_ADDR
+		     , RECIP_DTL_ADDR
+		     , DELV_MEMO
+		     , DEL_YN
+		     , REG_NO
+		     , REG_DT
+		     , UPD_NO
+		     , UPD_DT
+		)
+		VALUES (
+		       #{custNo}
+		     , #{delvAddrNm}
+		     , #{defaultYn}
+		     , #{recipNm}
+		     , #{recipPhnno}
+		     , #{recipTelno}
+		     , #{recipZipNo}
+		     , #{recipBaseAddr}
+		     , #{recipDtlAddr}
+		     , #{delvMemo}
+		     , #{delYn}
+		     , #{regNo}
+		     , NOW()
+		     , #{updNo}
+		     , NOW()
+		)
+		ON DUPLICATE KEY UPDATE
+		       DELV_ADDR_NM = #{delvAddrNm}
+		     , DEFAULT_YN = IFNULL(#{defaultYn}, 'N')
+		     , RECIP_NM = #{recipNm}
+		     , RECIP_PHNNO = #{recipPhnno}
+		     , RECIP_TELNO = #{recipTelno}
+		     , RECIP_ZIP_NO = #{recipZipNo}
+		     , RECIP_BASE_ADDR = #{recipBaseAddr}
+		     , RECIP_DTL_ADDR  = #{recipDtlAddr}
+		     , DEL_YN = IFNULL(#{delYn}, 'N')
+		     , UPD_NO = #{updNo}
+		     , UPD_DT = NOW()
+	</update>
+
 	<!-- 탈퇴회원목록 -->
 	<select id="getCustomerSecedeList" parameterType="CustomerSearch" resultType="Customer">
 		/* TsaCustomer.getSecedeCustomerList */

+ 158 - 162
src/main/webapp/WEB-INF/views/customer/CustomerDetailForm.html

@@ -82,7 +82,6 @@
 						<div class="panelStyle">
 							<form id="custInfoForm" name="custInfoForm" action="#" method="post">
 								<input type="hidden" id="custNo" name="custNo" th:value="${custNo}"/>
-								<input type="hidden" id="custNm" name="custNm"/>
 								<h4>기본정보</h4>
 								<table class="frmStyle">
 									<colgroup>
@@ -160,14 +159,14 @@
 										<th class="dashR">휴대전화번호<i class="star"></i></th>
 										<td class="dashR">
 											<input type="hidden" name="cellPhnno" data-valid-name="휴대전화"/>
-											<select id="firstNumber" name="firstNumber">
+											<select id="firstNo" name="firstNo">
 												<option value="">선택</option>
 												<option th:if="${nationalHpNumberList}" th:each="oneData, status : ${nationalHpNumberList}"
 														th:value="${oneData.cd}" th:text="|${oneData.cd}|"></option>
 											</select> -
-											<input type="text" id="middleNumber" name="middleNumber" class="w50" maxlength="4" required="required"
+											<input type="text" id="middleNo" name="middleNo" class="w50" maxlength="4" required="required"
 												   data-valid-type="numeric" data-valid-name="휴대전화번호"/> -
-											<input type="text" id="lastNumber" name="lastNumber" class="w50" maxlength="4" required="required"
+											<input type="text" id="lastNo" name="lastNo" class="w50" maxlength="4" required="required"
 												   data-valid-type="numeric" data-valid-name="휴대전화번호"/>
 											<button type="button" id="btnCustSendLms" class="btn btn-info btn-lg">LMS전송</button>
 											<button type="button" id="btnCustCrtfd" class="btn btn-info btn-lg">번호변경</button>
@@ -242,80 +241,79 @@
 					<li id="tab3" class="tab">
 						<!-- TAB3 PANELSTYLE -->
 						<div class="panelStyle">
-							<h4>배송지정보</h4>
-							<div id="custAddrList" class="ag-theme-balham" style="width: 100%; height: 300px;" ></div>
+							<form id="custAddrForm" name="custAddrForm" action="#" method="post">
+								<h4>배송지정보</h4>
+								<div id="custAddrList" class="ag-theme-balham" style="width: 100%; height: 300px;" ></div>
+								<table class="frmStyle">
+									<colgroup>
+										<col style="width:5%;"/>
+										<col style="width:25%;"/>
+										<col style="width:5%;"/>
+										<col style="width:25%;"/>
+										<col style="width:5%;"/>
+										<col style="width:25%;"/>
+										<col/>
+									</colgroup>
+									<tbody>
+									<tr>
+										<th>배송지명<i class="star"></i></th>
+										<td>
+											<input type="text" class="w200" name="delvAddrNm" maxlength="30" required="required" data-valid-name="배송지명"/>
+											<label class="chkBox">
+												<input type="checkbox" name="defaultYn" value="Y"/>기본
+											</label>
+										</td>
+										<th>수령인<i class="star"></i></th>
+										<td>
+											<input type="text" class="w200" name="recipNm" maxlength="10" required="required" data-valid-name="수령인"/>
+										</td>
+										<th>삭제여부</th>
+										<td>
+											<label class="chkBox">
+												<input type="checkbox" name="delYn" value="Y"/>
+											</label>
+										</td>
+									</tr>
+									<tr>
+										<th>전화번호</th>
+										<td>
+											<input type="text" class="w100" name="telFirstNo" maxlength="4" data-valid-type="numeric"
+												   data-valid-name="전화번호"/> -
+											<input type="text" class="w100" name="telMiddleNo" maxlength="4" data-valid-type="numeric"
+												   data-valid-name="전화번호"/> -
+											<input type="text" class="w100" name="telLastNo" maxlength="4" data-valid-type="numeric"
+												   data-valid-name="전화번호"/>
+										</td>
+										<th>휴대전화번호<i class="star"></i></th>
+										<td colspan="4">
+											<input type="text" class="w100" name="recipFirstNo" maxlength="4" required="required" data-valid-type="numeric"
+												   data-valid-name="휴대전화번호"/> -
+											<input type="text" class="w100" name="recipMiddleNo" maxlength="4" required="required" data-valid-type="numeric"
+												   data-valid-name="휴대전화번호"/> -
+											<input type="text" class="w100" name="recipLastNo" maxlength="4" required="required" data-valid-type="numeric"
+												   data-valid-name="휴대전화번호"/>
+										</td>
+									</tr>
+									<tr>
+										<th>주소<i class="star"></i></th>
+										<td colspan="5">
+											<input type="text" id="recipZipNo" name="recipZipNo" class="w100" maxlength="10" required="required" data-valid-name="주소"/>
+											<button type="button" class="btn btn-info btn-lg" onclick="fnOpenDaumAddr('custAddrForm');">우편번호찾기</button>
+											<br/>
+											<input type="text" id="recipBaseAddr" name="recipBaseAddr" class="w300" maxlength="50" required="required" data-valid-name="주소"/>
+											<input type="text" id="recipDtlAddr" name="recipDtlAddr" class="w300" maxlength="30" required="required" data-valid-name="상세주소"/>
+										</td>
+									</tr>
+									</tbody>
+								</table>
+								<ul class="panelBar">
+									<li class="right">
+										<button type="button" class="btn btn-info btn-lg" id="btnCustAddrNew">신규</button>
+										<button type="button" class="btn btn-success btn-lg" id="btnCustAddrSave">저장</button>
+									</li>
+								</ul>
+							</form>
 						</div>
-						<ul class="panelBar">
-							<li class="right">
-								<button type="button" class="btn btn-info btn-lg" id="btnCustAddrNew">신규</button>
-								<button type="button" class="btn btn-success btn-lg" id="btnCustAddrSave">저장</button>
-							</li>
-						</ul>
-						<table class="frmStyle">
-							<colgroup>
-								<col style="width:5%;"/>
-								<col style="width:25%;"/>
-								<col style="width:5%;"/>
-								<col style="width:25%;"/>
-								<col style="width:5%;"/>
-								<col style="width:25%;"/>
-								<col/>
-							</colgroup>
-							<tbody>
-							<tr>
-								<th>배송지명<i class="star"></i></th>
-								<td>
-									<input type="text" class="w200" name="delvAddrNm" maxlength="30" required="required" data-valid-name="배송지명"/>
-									<label><input type="checkbox" name="defaultYn" value="Y"/>기본</label>
-								</td>
-
-								<th>이메일</th>
-								<td>
-									<input type="text" class="w200" name="recipEmail" maxlength="50" data-valid-type="email" data-valid-name="이메일"/>
-								</td>
-
-								<th>삭제여부</th>
-								<td>
-									<label><input type="checkbox" name="delYn" value="Y"/></label>
-								</td>
-							</tr>
-							<tr>
-								<th>수령인<i class="star"></i></th>
-								<td>
-									<input type="text" class="w200" name="recipNm" maxlength="10" required="required" data-valid-name="수령인"/>
-								</td>
-
-								<th>전화번호</th>
-								<td>
-									<input type="text" class="w100" name="recipTelno1" maxlength="4" data-valid-type="numeric"
-										   data-valid-name="전화번호"/> -
-									<input type="text" class="w100" name="recipTelno2" maxlength="4" data-valid-type="numeric"
-										   data-valid-name="전화번호"/> -
-									<input type="text" class="w100" name="recipTelno3" maxlength="4" data-valid-type="numeric"
-										   data-valid-name="전화번호"/>
-								</td>
-								<th>휴대전화번호<i class="star"></i></th>
-								<td>
-									<input type="text" class="w100" name="recipPhnno1" maxlength="4" required="required" data-valid-type="numeric"
-										   data-valid-name="휴대전화번호"/> -
-									<input type="text" class="w100" name="recipPhnno2" maxlength="4" required="required" data-valid-type="numeric"
-										   data-valid-name="휴대전화번호"/> -
-									<input type="text" class="w100" name="recipPhnno3" maxlength="4" required="required" data-valid-type="numeric"
-										   data-valid-name="휴대전화번호"/>
-								</td>
-							</tr>
-							<tr>
-								<th>주소<i class="star"></i></th>
-								<td colspan="5">
-									<input type="text" name="recipPostNo" class="w100" maxlength="10" required="required" data-valid-name="주소"/>
-									<button type="button" class="btn btn-info btn-lg" onclick="fnOpenDaumAddr('custAddr');">우편번호찾기</button>
-									<br/>
-									<input type="text" name="recipBaseAddr" class="w300" maxlength="50" required="required" data-valid-name="주소"/>
-									<input type="text" name="recipDtlAddr" class="w300" maxlength="30" required="required" data-valid-name="상세주소"/>
-								</td>
-							</tr>
-							</tbody>
-						</table>
 						<!-- //TAB3 PANELSTYLE -->
 					</li>
 					<!-- //TAB3 : 배송지정보 -->
@@ -544,8 +542,8 @@
 				return gagaAgGrid.toDateTimeFormat(params.value);
 			}
 		},
-		{headerName: "주문자전화번호", field: "orderTelno", width: 120, cellClass: 'text-center'},
-		{headerName: "주문자휴대폰", field: "orderPhnno", width: 130, cellClass: 'text-center'},
+		{headerName: "주문자전화번호", field: "ordTelno", width: 120, cellClass: 'text-center'},
+		{headerName: "주문자휴대폰", field: "ordPhnno", width: 130, cellClass: 'text-center'},
 		{
 			headerName: "주문상세상태", field: "ordDtlStat", width: 100, cellClass: 'text-center',
 			valueFormatter: function (params) {
@@ -559,11 +557,11 @@
 				return '<a href="javascript:void(0);">' + params.value + '</a>';
 			}
 		},
-		{headerName: "사이즈", field: "sizeCd", width: 100, cellClass: 'text-center'},
+		{headerName: "색상", field: "optCd1", width: 100, cellClass: 'text-center'},
+		{headerName: "사이즈", field: "optCd2", width: 100, cellClass: 'text-center'},
 		{headerName: "상품명", field: "goodsNm", width: 250, cellClass: 'text-left'},
 		{headerName: "주문수량", field: "ordQty", width: 100, cellClass: 'text-center'},
 		{headerName: "판매상품가격", field: "currPrice", width: 100, cellClass: 'text-center'},
-		{headerName: "총 판매 상품가격", field: "totCurrPrice", width: 150, cellClass: 'text-center'}
 	];
 
 	// 1:1문의 내역 그리드
@@ -835,11 +833,10 @@
 
 	gridCouponOptions.rowSelection = 'multiple';
 
-	// 비밀번호 초기화 버튼
+	// 기본정보 - 비밀번호 초기화 버튼
 	$('#btnResetPassword').on('click', function () {
-		let custInfoForm = '#custInfoForm';
 
-		if (!fnCheckValidationEmail(custInfoForm)) {
+		if (!fnCheckValidationEmail('#custInfoForm')) {
 			return false;
 		}
 
@@ -847,44 +844,43 @@
 			cancelBtnText: "취소",
 			sureBtnText: "확인",
 			sureBtnClick: function () {
-				let jsonData = JSON.stringify($(custInfoForm).serializeObject());
+				let jsonData = JSON.stringify($('#custInfoForm').serializeObject());
 				gagajf.ajaxJsonSubmit('/customer/password/reset', jsonData, fnSearchCustInfo);
 			}
 		});
 
 	});
 
-	// LMS발송 버튼
+	// 기본정보 - LMS발송 버튼
 	$('#btnCustSendLms').on('click', function () {
-		let custInfoForm = '#custInfoForm';
 
-		if (!fnCheckValidationPhnno(custInfoForm)) {
+		if (!fnCheckValidationPhnno('#custInfoForm')) {
 			return false;
 		}
 
 		let param = {};
-		param.elementCellPhnno = custInfoForm + ' input[name=cellPhnno]';
-		param.elementCustNo = custInfoForm + ' input[name=custNo]';
+		param.elementCellPhnno = '#custInfoForm input[name=cellPhnno]';
+		param.elementCustNo = '#custInfoForm input[name=custNo]';
+
 		cfnOpenLmsPopup(param);
 	});
 
 
-	// 이메일발송 버튼
+	// 기본정보 - 이메일발송 버튼
 	$('#btnCustSendEmail').on('click', function () {
-		let custInfoForm = '#custInfoForm';
 
-		if (!fnCheckValidationEmail(custInfoForm)) {
+		if (!fnCheckValidationEmail('#custInfoForm')) {
 			return false;
 		}
 
 		let param = {};
-		param.elementEmail = custInfoForm +' input[name=email]';
-		param.elementCustNm = custInfoForm +' input[name=custNm]';
-		param.elementCustNo = custInfoForm +' input[name=custNo]';
+		param.elementEmail = '#custInfoForm input[name=email]';
+		param.elementCustNo ='#custInfoForm input[name=custNo]';
+
 		cfnOpenEmailPopup(param);
 	});
 
-	// 이메일 도메인 선택 이벤트
+	// 기본정보 - 이메일 도메인 선택 이벤트
 	$('#emailDomainList').on('change', function () {
 		let domain = $(this).val();
 		let $emailDomain = $('#emailDomain');
@@ -897,7 +893,7 @@
 
 	});
 
-	// 저장 버튼
+	// 기본정보 - 저장버튼
 	$('#btnCustInfoSave').on('click', function () {
 		let custInfoFrom = '#custInfoForm';
 
@@ -928,6 +924,43 @@
 		});
 	});
 
+	// 배송지정보 - 신규버튼
+	$('#btnCustAddrNew').on('click', function () {
+		$('#custAddrForm')[0].reset();
+		$('#custAddrForm input[name=custDelvAddrSq]').val('');
+		$('#custAddrForm input[name=recipPhnno]').val('');
+		$('#custAddrForm input[name=recipTelno]').val('');
+	});
+
+	// 배송지정보 - 저장버튼
+	$('#btnCustAddrSave').on('click', function () {
+		if (!gagajf.validation('#custAddrForm'))
+			return false;
+
+		// 전화번호
+		let telFirstNo = $('#custAddrForm input[name=telFirstNo]').val();
+		let telMiddleNo = $('#custAddrForm input[name=telMiddleNo]').val();
+		let telLastNo = $('#custAddrForm input[name=telLastNo]').val();
+		$('#custAddrForm input[name=recipTelno]').val(telFirstNo + '-' + telMiddleNo + '-' + telLastNo);
+
+		// 핸드폰번호 필수값 validation 함수에서 null 체크
+		let recipFirstNo = $('#custAddrForm input[name=recipFirstNo]').val();
+		let recipMiddleNo = $('#custAddrForm input[name=recipMiddleNo]').val();
+		let recipLastNo = $('#custAddrForm input[name=recipLastNo]').val();
+		$('#custAddrForm input[name=recipPhnno]').val(recipFirstNo + '-' + recipMiddleNo + '-' + recipLastNo);
+
+		mcxDialog.confirm("저장하시겠습니까?", {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function () {
+				gagajf.removeCommaAtNumberFormattedInput('#custAddrForm');
+				let jsonData = JSON.stringify($('#custAddrForm').serializeObject());
+				gagajf.ajaxJsonSubmit('/customer/delivery/addr/save', jsonData, fnSearchDelivery);
+			}
+		});
+
+	});
+
 	// 쿠폰삭제 버튼
 	$('#btnCustCouponDelete').on('click', function () {
 		let removedData = gagaAgGrid.removeRowData(gridCouponOptions);
@@ -965,46 +998,8 @@
 		cfnCpnPubForCustPopup();
 	});
 
-	// 배송지정보 신규
-	$('#btnCustAddrNew').on('click', function () {
-		$('#custAddr')[0].reset();
-		$('#custAddr input[name=custDelvAddrSq]').val('');
-		$('#custAddr input[name=recipPhnno]').val('');
-		$('#custAddr input[name=recipTelno]').val('');
-	});
-
-	// 배송지정보 저장
-	$('#btnCustAddrSave').on('click', function () {
-
-		if (!gagajf.validation('#custAddr'))
-			return false;
-
-		// 전화번호
-		let recipTelno1 = $('#custAddr input[name=recipTelno1]').val();
-		let recipTelno2 = $('#custAddr input[name=recipTelno2]').val();
-		let recipTelno3 = $('#custAddr input[name=recipTelno3]').val();
-
-		$('#custAddr input[name=recipTelno]').val(recipTelno1 + '-' + recipTelno2 + '-' + recipTelno3);
 
 
-		// 핸드폰번호 필수값 validation 함수에서 null 체크
-		let recipPhnno1 = $('#custAddr input[name=recipPhnno1]').val();
-		let recipPhnno2 = $('#custAddr input[name=recipPhnno2]').val();
-		let recipPhnno3 = $('#custAddr input[name=recipPhnno3]').val();
-		$('#custAddr input[name=recipPhnno]').val(recipPhnno1 + '-' + recipPhnno2 + '-' + recipPhnno3);
-
-		mcxDialog.confirm("저장하시겠습니까?", {
-			cancelBtnText: "취소",
-			sureBtnText: "확인",
-			sureBtnClick: function () {
-				gagajf.removeCommaAtNumberFormattedInput('#custAddr');
-				let jsonData = JSON.stringify($('#custAddr').serializeObject());
-				gagajf.ajaxJsonSubmit('/customer/delivery/addr/save', jsonData, fnSearchDelivery);
-			}
-		});
-
-	});
-
 	// 회원접촉이력 저장
 	$('#btnSaveContact').on('click', function () {
 		if (!gagajf.validation('#custContact')) {
@@ -1062,34 +1057,34 @@
 			return;
 
 		if (!gagajf.isNull(event.data)) {
-			$('#custAddr input[name=custDelvAddrSq]').val(event.data.custDelvAddrSq);
-			$('#custAddr input[name=delvAddrNm]').val(event.data.delvAddrNm);
-			$('#custAddr input[name=recipEmail]').val(event.data.recipEmail);
-			$('#custAddr input[name=recipNm]').val(event.data.recipNm);
+			$('#custAddrForm input[name=custDelvAddrSq]').val(event.data.custDelvAddrSq);
+			$('#custAddrForm input[name=delvAddrNm]').val(event.data.delvAddrNm);
+			$('#custAddrForm input[name=recipEmail]').val(event.data.recipEmail);
+			$('#custAddrForm input[name=recipNm]').val(event.data.recipNm);
 
 			if (!gagajf.isNull(event.data.recipPhnno)) {
-				let recipPhnno = event.data.recipPhnno.split("-");
-				$('#custAddr input[name=recipPhnno1]').val(recipPhnno[0]);
-				$('#custAddr input[name=recipPhnno2]').val(recipPhnno[1]);
-				$('#custAddr input[name=recipPhnno3]').val(recipPhnno[2]);
+				let phnNoSplit = event.data.recipPhnno.split("-");
+				$('#custAddrForm input[name=recipFirstNo]').val(phnNoSplit[0]);
+				$('#custAddrForm input[name=recipMiddleNo]').val(phnNoSplit[1]);
+				$('#custAddrForm input[name=recipLastNo]').val(phnNoSplit[2]);
 			}
 
 			if (!gagajf.isNull(event.data.recipTelno)) {
-				let recipTelno = event.data.recipTelno.split("-");
-				$('#custAddr input[name=recipTelno1]').val(recipTelno[0]);
-				$('#custAddr input[name=recipTelno2]').val(recipTelno[1]);
-				$('#custAddr input[name=recipTelno3]').val(recipTelno[2]);
+				let telNoSplit = event.data.recipTelno.split("-");
+				$('#custAddrForm input[name=telFirstNo]').val(telNoSplit[0]);
+				$('#custAddrForm input[name=telMiddleNo]').val(telNoSplit[1]);
+				$('#custAddrForm input[name=telLiastNo]').val(telNoSplit[2]);
 			}
 
-			$('#custAddr input[name=recipPostNo]').val(event.data.recipPostNo);
-			$('#custAddr input[name=recipBaseAddr]').val(event.data.recipBaseAddr);
-			$('#custAddr input[name=recipDtlAddr]').val(event.data.recipDtlAddr);
+			$('#custAddrForm input[name=recipZipNo]').val(event.data.recipZipNo);
+			$('#custAddrForm input[name=recipBaseAddr]').val(event.data.recipBaseAddr);
+			$('#custAddrForm input[name=recipDtlAddr]').val(event.data.recipDtlAddr);
 
 			let defaultYn = event.data.defaultYn === 'Y' ? true : false;
 			let delYn = event.data.delYn === 'Y' ? true : false;
 
-			$('#custAddr input:checkbox[name=defaultYn]').prop('checked', defaultYn);
-			$('#custAddr input:checkbox[name=delYn]').prop('checked', delYn);
+			$('#custAddrForm input:checkbox[name=defaultYn]').prop('checked', defaultYn);
+			$('#custAddrForm input:checkbox[name=delYn]').prop('checked', delYn);
 
 		}
 	};
@@ -1221,9 +1216,10 @@
 					$('#homeDtlAddr').focus();
 				}
 
-				if (id === 'custAddr') {
-					$('#recipPostNo').val(data.zonecode);
+				if (id === 'custAddrForm') {
+					$('#recipZipNo').val(data.zonecode);
 					$('#recipBaseAddr').val(cfnGetDaumRoadAddr(data));
+					$('#recipDtlAddr').focus();
 				}
 
 				cfnCloseDaumAddr();
@@ -1238,10 +1234,10 @@
 	var fnCheckValidationPhnno = function (formId) {
 		let result = true;
 
-		let firstNumber = $(formId + ' select[name=firstNumber]').val();
-		let middleNumber = $(formId + ' input[name=middleNumber]').val();
-		let lastNumber = $(formId + ' input[name=lastNumber]').val();
-		let cellPhnno = firstNumber + '-' + middleNumber + '-' + lastNumber;
+		let firstNo = $(formId + ' select[name=firstNo]').val();
+		let middleNo = $(formId + ' input[name=middleNo]').val();
+		let lastNo = $(formId + ' input[name=lastNo]').val();
+		let cellPhnno = firstNo + '-' + middleNo + '-' + lastNo;
 		$(formId + ' input[name=cellPhnno]').val(cellPhnno);
 
 		if (!gagajf.testRegexp($(formId + ' input[name=cellPhnno]'), /^(01(?:0|1|[6-9])-(?:\d{3}|\d{4})-\d{4})$/)) {
@@ -1323,9 +1319,9 @@
 	var fnDisplayCellPhnno = function (cellPhnno) {
 		if (!gagajf.isNull(cellPhnno)) {
 			let cellPhSplit = cellPhnno.split("-");
-			$('#firstNumber').val(cellPhSplit[0]);
-			$('#middleNumber').val(cellPhSplit[1]);
-			$('#lastNumber').val(cellPhSplit[2]);
+			$('#firstNo').val(cellPhSplit[0]);
+			$('#middleNo').val(cellPhSplit[1]);
+			$('#lastNo').val(cellPhSplit[2]);
 		}
 	};
 

+ 148 - 0
src/main/webapp/WEB-INF/views/customer/EmailPopupForm.html

@@ -0,0 +1,148 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : EmailPopupForm.html
+ * @desc    : 메일발송팝업 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2021 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.01.21   jsshin     최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" id="popupEmailForm" data-width="800">
+	<div class="panelStyle">
+		<!-- TITLE -->
+		<div class="panelTitle">
+			<strong >메일 발송</strong>
+			<button type="button" class="close" onclick="uifnPopupClose('popupEmailForm')"><em class="fa fa-times"></em></button>
+		</div>
+		<!-- //TITLE -->
+		<!-- CONTENT -->
+		<div class="panelContent">
+			<div class="tabs">
+				<!-- TABS CONTENT -->
+				<ul class="tabsCont">
+					<li class="tab on" id="tab1">
+						<div class="panelStyle">
+							<form id="emailForm" name="emailForm">
+								<input type="hidden" name="sendEmail" th:value="${sendEmail}"/>
+								<input type="hidden" name="email"/>
+								<table class="frmStyle">
+									<colgroup>
+										<col style="width:1%"/>
+										<col style="width:40%"/>
+									</colgroup>
+									<tbody>
+									<tr >
+										<th>보내는사람</th>
+										<td>
+											<span name="sendEmail" th:text="${sendEmail}"></span>
+										</td>
+									</tr>
+									<tr>
+										<th>받는사람</th>
+										<td>
+											<span name="email"></span>
+										</td>
+									</tr>
+									<tr>
+										<th>제목<em class="star"></em></th>
+										<td>
+											<input type="text" class="w150" name="title" value="" required="required" data-valid-name="제목"/>
+										</td>
+									</tr>
+									<tr>
+										<th>내용<em class="star"></em></th>
+										<td>
+											<textarea class="textareaR4" style="resize: none;" name ="content" ></textarea>
+										</td>
+									</tr>
+									</tbody>
+								</table>
+							</form>
+						</div>
+					</li>
+				</ul>
+				<!-- //TABS CONTENT -->
+			</div>
+			<ul class="panelBar">
+				<li class="right">
+					<button type="button" class="btn btn-success btn-lg" id="btnSendEmail">발송</button>
+					<button type="button" class="btn btn-gray btn-lg" onclick="uifnPopupClose('popupEmailForm')">취소</button>
+				</li>
+			</ul>
+		</div>
+		<!-- //CONTENT -->
+	</div>
+</div>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	const elementEmail = [[${elementEmail}]];
+	const elementCustNo = [[${elementCustNo}]];
+
+	// 메시지 전송
+	$("#btnSendEmail").on("click",function() {
+		let formId = '#emailForm';
+		let $content = $(formId+' textarea[name=content]');
+		let $email = $(formId+' input[name=email]');
+
+
+		if(gagajf.isNull($content.val())) {
+			mcxDialog.alertC("내용을 입력해 주세요.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$content.focus();
+				}
+			});
+			return;
+		}
+
+		if(gagajf.isNull($email.val())) {
+			mcxDialog.alertC("수신메일을 입력해 주세요.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$email.focus();
+				}
+			});
+			return;
+		}
+
+		if(!gagajf.validation(formId)){
+			return;
+		}
+
+		mcxDialog.confirm("메일을 발송하시겠습니까?", {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function() {
+				let params = $(formId).serializeObject();
+				params.custNo = $(elementCustNo).val();
+				let jsonData = JSON.stringify(params);
+				gagajf.ajaxJsonSubmit('/customer/email/send', jsonData, uifnPopupClose('popupEmailForm'));
+			}
+		});
+
+	});
+
+	// 데이터 셋팅
+	var fnInitDataSet = function () {
+		let email = $(elementEmail).val();
+
+		if(!gagajf.isNull(email)) {
+			$('#emailForm input[name=email]').val(email);
+			$('#emailForm span[name=email]').text(email);
+		}
+	}
+
+	$(document).ready(function() {
+		fnInitDataSet();
+	});
+
+	/*]]>*/
+</script>
+</html>

+ 55 - 52
src/main/webapp/WEB-INF/views/customer/LmsPopupForm.html

@@ -14,7 +14,7 @@
  * 1.0  2021.01.21   jsshin     최초 작성
  *******************************************************************************
  -->
-<div class="modalPopup" id="popupLmsForm" data-width="800" data-height="460">
+<div class="modalPopup" id="popupLmsForm" data-width="800">
 	<div class="panelStyle">
 		<!-- TITLE -->
 		<div class="panelTitle">
@@ -25,43 +25,47 @@
 		<!-- CONTENT -->
 		<div class="panelContent">
 			<div class="tabs">
-				<ul class="tabsNav p-left">
-					<li class="on"><a href="#tab1">LMS 발송</a></li>
-				</ul>
+				<div class="tabsNav">
+					<ul >
+						<li class="on"><a href="#tab1">LMS 발송</a></li>
+					</ul>
+				</div>
 				<!-- //TABS NAVI -->
 				<!-- TABS CONTENT -->
 				<ul class="tabsCont">
 					<!-- LMS 발송 -->
 					<li class="tab on" id="tab1">
-						<form id="lmsForm" >
-							<table class="frmStyle">
-								<colgroup>
-									<col style="width:1%"/>
-									<col style="width:40%"/>
-								</colgroup>
-								<tbody>
-								<tr >
-									<th>수신자번호 <em class="star"></em></th>
-									<td>
-										<input type="text" class="w150" name="cellPhnno" data-valid-name="수신번호"  required="required"  maxlength="13"/>
-									</td>
-								</tr>
-								<tr style="height:60px;">
-									<th>발신자번호<em class="star"></em></th>
-									<td>
-										<input type="text" class="w150" name="callBack" th:value="${callBack}" maxlength="11" readonly="readonly"/>
-									</td>
-								<tr>
-									<th>메시지<em class="star"></em></th>
-									<td>
-										<textarea class="textareaR4"  style="resize: none;" name ="content" ></textarea>
-										<span name="count">0</span> / 2000 byte
-									</td>
-								</tr>
-								</tr>
-								</tbody>
-							</table>
-						</form>
+						<div class="panelStyle">
+							<form id="lmsForm" name="lmsForm">
+								<table class="frmStyle">
+									<colgroup>
+										<col style="width:1%"/>
+										<col style="width:40%"/>
+									</colgroup>
+									<tbody>
+									<tr >
+										<th>수신자번호 <em class="star"></em></th>
+										<td>
+											<input type="text" class="w150" name="cellPhnno" data-valid-name="수신번호"  required="required"  maxlength="13"/>
+										</td>
+									</tr>
+									<tr>
+										<th>발신자번호<em class="star"></em></th>
+										<td>
+											<input type="text" class="w150" name="callBack" th:value="${callBack}" maxlength="11" readonly="readonly"/>
+										</td>
+									<tr>
+										<th>메시지<em class="star"></em></th>
+										<td>
+											<textarea class="textareaR4"  style="resize: none;" name ="content" ></textarea>
+											<span name="count">0</span> / 2000 byte
+										</td>
+									</tr>
+									</tr>
+									</tbody>
+								</table>
+							</form>
+						</div>
 					</li>
 					<!-- //LMS발송 -->
 				</ul>
@@ -70,26 +74,24 @@
 			<ul class="panelBar">
 				<li class="right">
 					<button type="button" class="btn btn-success btn-lg" id="btnSendSms">발송</button>
-					<button type="button" class="btn btn-gray btn-lg" onclick="uifnPopClose('popupLmsForm')">취소</button>
+					<button type="button" class="btn btn-gray btn-lg" onclick="uifnPopupClose('popupLmsForm')">취소</button>
 				</li>
 			</ul>
 		</div>
-
+		<!-- //CONTENT -->
 	</div>
 </div>
 <script th:inline="javascript">
 	/*<![CDATA[*/
-	var elementContent = [[${elementContent}]];
-	var elementCellPhnno = [[${elementCellPhnno}]];
-	var elementCustNo = [[${elementCustNo}]];
+	const elementCellPhnno = [[${elementCellPhnno}]];
+	const elementCustNo = [[${elementCustNo}]];
 
 	// 메시지 전송
 	$("#btnSendSms").on("click",function() {
-		var formId = '#lmsForm';
-		var custNo = $(elementCustNo).val();
-		var $content;
+		let formId = '#lmsForm';
+		let custNo = $(elementCustNo).val();
+		const $content = $(formId+' textarea[name=content]');
 
-		$content = $(formId+' textarea[name=content]');
 		if(gagajf.isNull($content.val())) {
 			mcxDialog.alertC("보낼 메시지를 입력해 주세요.", {
 				sureBtnText: "확인",
@@ -99,17 +101,19 @@
 			});
 			return;
 		}
+
 		if(!gagajf.validation(formId)){
 			return;
 		}
+
 		mcxDialog.confirm("저장하시겠습니까?", {
 			cancelBtnText: "취소",
 			sureBtnText: "확인",
 			sureBtnClick: function() {
-				var params = $(formId).serializeObject();
+				let params = $(formId).serializeObject();
 				params.custNo = custNo;
-				var jsonData = JSON.stringify(params);
-				gagajf.ajaxJsonSubmit('/customer/message/send', jsonData, uifnPopClose('popupLmsForm'));
+				let jsonData = JSON.stringify(params);
+				gagajf.ajaxJsonSubmit('/customer/message/send', jsonData, uifnPopupClose('popupLmsForm'));
 			}
 		});
 
@@ -120,16 +124,15 @@
 		cfnGetTextLength($(this), 2000, $('#lmsForm span[name=count]'));
 	});
 
-	$(document).ready(function() {
-		var content = $(elementContent).val();
-		var cellPhnno = $(elementCellPhnno).val();
-
+	var fnInitDataSet = function () {
+		let cellPhnno = $(elementCellPhnno).val();
 		if(!gagajf.isNull(cellPhnno)) {
 			$('#lmsForm input[name=cellPhnno]').val(cellPhnno);
 		}
-		if(!gagajf.isNull(content)) {
-			$('#lmsForm textarea[name=content]').val(content);
-		}
+	}
+
+	$(document).ready(function() {
+		fnInitDataSet();
 
 		cfnGetTextLength("#lmsForm textarea[name=content]", 2000, $('#lmsForm span[name=count]'));
 	});

+ 0 - 1
src/main/webapp/ux/js/admin.popup.js

@@ -420,7 +420,6 @@ var cfnOpenLmsPopup = function(param, division) {
  */
 var cfnOpenEmailPopup = function(param, division) {
 	var actionUrl = '/customer/email/popup/form?elementEmail=' + encodeURIComponent(param.elementEmail)
-	+ '&elementCustNm=' + encodeURIComponent(param.elementCustNm)
 	+ '&elementCustNo=' + encodeURIComponent(param.elementCustNo);
 	+ '&division=' + division;
 	cfnOpenModalPopup(actionUrl, 'popupEmailForm');