Forráskód Böngészése

제휴몰검색기능

jsh77b 4 éve
szülő
commit
c8626da262

+ 22 - 1
src/main/java/com/style24/admin/biz/service/TsaWithdrawService.java

@@ -244,7 +244,28 @@ public class TsaWithdrawService {
 	 * @since 2021. 05. 10
 	 */
 	public Collection<Withdraw> getWithdrawDirectiveList(Withdraw withdraw) {
-		return withdrawDao.getWithdrawDirectiveList(withdraw);
+		
+		// 2021.11.18 제휴몰검색 기능 추가
+		Collection<Withdraw> withdrawList = withdrawDao.getWithdrawDirectiveList(withdraw);
+		
+		for (Withdraw withdrawVo : withdrawList) {
+			// 1.1 세트상품 옵션별 배열로 담기
+			if (withdrawVo.getOptCd().contains(",")) {
+				withdrawVo.setOptCdArr(withdrawVo.getOptCd().split(","));
+				withdrawVo.setOptCd1Arr(withdrawVo.getOptCd1().split(","));
+				withdrawVo.setOptCd2Arr(withdrawVo.getOptCd2().split(","));
+			} else {
+				String[]  arr1 = {withdrawVo.getOptCd()};
+				String[]  arr2 = {withdrawVo.getOptCd1()};
+				String[]  arr3 = {withdrawVo.getOptCd2()};
+				
+				withdrawVo.setOptCdArr(arr1);
+				withdrawVo.setOptCd1Arr(arr2);
+				withdrawVo.setOptCd2Arr(arr3);
+			}
+		}
+		
+		return withdrawList;
 	}
 	
 	/**

+ 19 - 6
src/main/java/com/style24/admin/biz/web/TsaWithdrawController.java

@@ -515,8 +515,7 @@ public class TsaWithdrawController extends TsaBaseController {
 
 		return result;
 	}	
-	
-	
+
 	/**
 	 * 회수지시목록 화면 
 	 *
@@ -534,6 +533,15 @@ public class TsaWithdrawController extends TsaBaseController {
 		mav.addObject("wdShipStateList", rendererService.getAvailCommonCodeList("G320"));
 		mav.addObject("chgStatList", rendererService.getAvailCommonCodeList("G685"));
 		
+		// 2021.11.17 제휴몰 검색기능 추가
+		// 제휴몰벤더
+		mav.addObject("vendorList", rendererService.getCommonCodeList("G003", "Y", TsaSession.getInfo().getSupplyCompCd()));
+
+		// 제휴몰
+		Extmall extmall = new Extmall();
+		extmall.setVendorId(TscConstants.VendorId.SHOPLINKER.value()); // 샵링커
+		mav.addObject("extmallList", ocmService.getExtmallList(extmall));
+		mav.addObject("vendorId", TscConstants.VendorId.SHOPLINKER.value());
 		
 		mav.setViewName("/withdraw/WithdrawDirectiveListForm");
 
@@ -556,19 +564,24 @@ public class TsaWithdrawController extends TsaBaseController {
 		GagaMap result = new GagaMap();
 		withdraw.setPageable(new TscPageRequest(withdraw.getPageNo() - 1, withdraw.getPageSize()));
 		
+		log.info("withdraw.getVendorId() >>> {}", withdraw.getVendorId());
+		log.info("withdraw.getExtmallId() >>> {}", withdraw.getExtmallId());
+		log.info("withdraw.getExtmallOrderId() >>> {}", withdraw.getExtmallOrderId());
+		log.info("withdraw.getOptCd() >>> {}", withdraw.getOptCd());
+		
 		withdraw.getPageable().setTotalCount(withdrawService.getWithdrawDirectiveListCount(withdraw));
 		TscSession.setAttribute("maskingYn", TsaSession.getInfo().getMaskingYn());
-		
-		
+
 		if ("N".equals(withdraw.getPageingYn())) {
 			withdraw.setPageable(null);
 		}
+		
 		result.set("pageing", withdraw);
-		log.info("withdraw {}"+withdraw);
+		log.info("withdraw {}" + withdraw);
+		
 		Collection<Withdraw> list = withdrawService.getWithdrawDirectiveList(withdraw);
 		
 		result.set("directList", list);
-		
 
 		return result;
 	}	

+ 14 - 5
src/main/java/com/style24/persistence/domain/Withdraw.java

@@ -1,5 +1,6 @@
 package com.style24.persistence.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.style24.core.support.session.TscSession;
 import com.style24.core.support.util.MaskingUtils;
 import com.style24.persistence.TscBaseDomain;
@@ -26,11 +27,8 @@ public class Withdraw extends TscBaseDomain {
 	private int pageSize = 50;
 	private int pageUnit = 10;
 	private int rnum;
-	
 
-	
 	// 회수 
-
 	private String wdInvoiceNo; 
 	private String rfndStat; 
 	private String wdGb;
@@ -121,9 +119,7 @@ public class Withdraw extends TscBaseDomain {
 	private String searchType;
 	private String withdrawType;
 
-	
 	// Masking
-
 	public String getMaskingRecipNm() {
 		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.name(this.recipNm) : this.recipNm;
 	}
@@ -159,5 +155,18 @@ public class Withdraw extends TscBaseDomain {
 	public String getMaskingSenderPhnno() {
 		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.phoneNo(this.senderPhnno) : this.senderPhnno;
 	}	
+	
+	// 2021.11.17 제휴몰검색정보 추가
+	private String vendorId;
+	private String agentOrderId;
+	private String chgRegDt;
+	private String npayOrdYn;
+	
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] optCdArr;		// 옵션코드
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] optCd1Arr;		// 옵션코드
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] optCd2Arr;		// 옵션코드
 
 }

+ 207 - 83
src/main/java/com/style24/persistence/mybatis/shop/TsaWithdraw.xml

@@ -508,115 +508,230 @@
 	<!-- 회수지시 목록 건수 -->
 	<select id="getWithdrawDirectiveListCount" parameterType="Withdraw" resultType="int">
 		/* TsaWithdraw.getWithdrawDirectiveListCount */
-				SELECT COUNT(*) AS TOTCNT
-				  FROM (		
-						SELECT 
-						       O.ORD_NO                                 -- 주문번호
-						     , OCD.ORD_DTL_NO                           -- 주문상세번호
-						     , OD.GOODS_CD                   -- 상품코드
-						FROM   TB_ORDER_CHANGE OC          
-						JOIN   TB_ORDER_CHANGE_DETAIL OCD ON OC.ORD_CHG_SQ  = OCD.ORD_CHG_SQ 
-						JOIN   TB_ORDER_DETAIL OD         ON OCD.ORD_DTL_NO = OD.ORD_DTL_NO
-						JOIN   TB_ORDER O                 ON OD.ORD_NO      = O.ORD_NO
-						JOIN   TB_GOODS G                 ON OD.GOODS_CD     = G.GOODS_CD
-						JOIN   TB_DELIVERY_LOC D          ON OD.DELV_LOC_CD = D.DELV_LOC_CD AND OD.SUPPLY_COMP_CD = D.SUPPLY_COMP_CD
-						WHERE  1=1 
-						<include refid="getWithdrawDirectiveCondition_sql"/>
-					) A
-
+		SELECT COUNT(1) AS TOTCNT
+		FROM (
+		    SELECT Y.ORD_NO
+		         , Y.ORD_DTL_NO
+		         , Y.GOODS_CD
+		    FROM (
+		    SELECT O.ORD_NO                                 -- 주문번호
+		         , OCD.ORD_DTL_NO                           -- 주문상세번호
+		         , OD.GOODS_CD                              -- 상품코드
+		    FROM   TB_ORDER_CHANGE OC          
+		    JOIN   TB_ORDER_CHANGE_DETAIL OCD ON OC.ORD_CHG_SQ  = OCD.ORD_CHG_SQ 
+		    JOIN   TB_ORDER_DETAIL OD         ON OCD.ORD_DTL_NO = OD.ORD_DTL_NO
+		    JOIN   TB_ORDER O                 ON OD.ORD_NO      = O.ORD_NO
+		    JOIN   TB_GOODS G                 ON OD.GOODS_CD     = G.GOODS_CD
+		    JOIN   TB_DELIVERY_LOC D          ON OD.DELV_LOC_CD = D.DELV_LOC_CD AND OD.SUPPLY_COMP_CD = D.SUPPLY_COMP_CD
+		    JOIN   TB_ORDER_DETAIL_ITEM ODI   ON OD.ORD_DTL_NO  = ODI.ORD_DTL_NO
+		    WHERE  1=1 
+			<include refid="getWithdrawDirectiveCondition_sql"/>
+			) Y
+			GROUP  BY Y.ORD_NO
+		         , Y.ORD_DTL_NO
+		         , Y.GOODS_CD
+		) A
 	</select>
 	
-	<!-- 회수지시 목록 -->
+	<!-- 회수지시 목록 2021.11.18 제휴몰검색기능 및 옵션정보 추가 쿼리 수정 -->
 	<select id="getWithdrawDirectiveList" parameterType="Withdraw" resultType="Withdraw">
 		/* TsaWithdraw.getWithdrawDirectiveList */
 		SELECT Z.*
 		     , FN_GET_CODE_NM('G680', Z.CHG_GB) AS CHG_GB_NM
-		     , CASE WHEN CHG_GB = 'G680_30' THEN FN_GET_CODE_NM('G688', Z.CHG_REASON) ELSE FN_GET_CODE_NM('G689', Z.CHG_REASON) END AS CHG_REASON_NM
+		     , CASE WHEN CHG_GB = 'G680_30' 
+		            THEN FN_GET_CODE_NM('G688', Z.CHG_REASON) 
+		            ELSE FN_GET_CODE_NM('G689', Z.CHG_REASON) 
+		            END AS CHG_REASON_NM
 		     , FN_GET_CODE_NM('G320', Z.WD_SHIP_STATE) AS WD_SHIP_STATE_NM
-		     , CASE WHEN WD_SHIP_STATE = '12' THEN   FN_GET_CODE_NM('G321', Z.WD_REASON_CD)
-		            WHEN WD_SHIP_STATE = '84' THEN   FN_GET_CODE_NM('G322', Z.WD_REASON_CD) ELSE '' END AS WD_REASON_CD_NM
+		     , CASE WHEN WD_SHIP_STATE = '12' THEN FN_GET_CODE_NM('G321', Z.WD_REASON_CD)
+		            WHEN WD_SHIP_STATE = '84' THEN FN_GET_CODE_NM('G322', Z.WD_REASON_CD) 
+		            ELSE '' 
+		            END AS WD_REASON_CD_NM
 		     , FN_GET_CODE_NM('G685', Z.CHG_STAT) AS CHG_STAT_NM
-		     , CASE WHEN Z.WD_GB = 'W' THEN '방문회수' ELSE '직접배송' END AS WD_GB_NM 
+		     , CASE WHEN Z.WD_GB = 'W' 
+		            THEN '방문회수' 
+		            ELSE '직접배송' 
+		            END AS WD_GB_NM 
 		FROM (
-		    SELECT A.*, ROW_NUMBER() OVER(ORDER BY  A.ORD_CHG_SQ, A.ORD_NO DESC, A.ORD_DTL_NO )  RNUM 
+		    SELECT A.*
+		         , ROW_NUMBER() OVER(ORDER BY A.ORD_CHG_SQ, A.ORD_NO DESC, A.ORD_DTL_NO ) RNUM 
 		    FROM ( 
-				SELECT A.* 
-				  FROM (
-						SELECT DISTINCT
-						       OC.ORD_CHG_SQ                            -- 주문변경번호 
-						     , OC.CHG_GB                                -- 변경구분 G680
-						     , OC.CHG_REASON                            -- 변경사유 반품G688 교환G689
-						     , OC.WD_GB                                 -- 직접배송여부
-						     , DATE_FORMAT(OC.REG_DT, '%Y-%m-%d') AS REG_DT  -- 회수요청일
-						     , OC.SHIP_COMP_CD
-						     , OC.WD_INVOICE_NO                         -- 회수송장번호
-						     , OC.WD_SHIP_STATE                         -- 배송업체회수상태 G320
-						     , OC.WD_STATE_DT                           -- 회수상태 수신일시 
-						     , OC.WD_REASON_CD                          -- 미회수사유 G321 G322
-						     , OC.WD_BF_SEND_YN                         -- 교환 선발송 여부 
-						     , OC.WD_INVOICE_SEND_YN AS SEND_YN         -- 전송여부
-						     , O.ORD_NO                                 -- 주문번호
-						     , OCD.ORD_DTL_NO                           -- 주문상세번호
-						     , OCD.CHG_STAT                             -- 변경상태 G685
-						     , OD.GOODS_CD                              -- 상품코드
-						     , G.GOODS_NM                               -- 상품명
-						     , OCD.CHG_QTY                              -- 변경수량
-						     , DATE_FORMAT(OC.WD_STDT, '%Y-%m-%d %H:%i:%S') AS WD_STDT  -- 배송시작일시
-						     , DATE_FORMAT(OC.WD_EDDT, '%Y-%m-%d %H:%i:%S') AS WD_EDDT  -- 배송종료일시
-						     , D.RTN_LOC_NM          AS RECIP_NM        -- 수취인명
-						     , OC.CHGER_NM                              -- 변경자명
-						     , OC.CHGER_PHNNO                           -- 변경자휴대전화번호
-						     , OC.CHGER_TELNO                           -- 변경자전화번호
-						     , OC.CHGER_ZIPCODE                         -- 변경자우편번호
-						     , OC.CHGER_BASE_ADDR                       -- 변경자기본주소
-						     , OC.CHGER_DTL_ADDR                        -- 변경자상세주소
-						     , O.ORD_NM                                 -- 주문자명
-						     , O.ORD_PHNNO                              -- 주문자휴대전화번호
-						     , O.ORD_TELNO                              -- 주문자전화번호
-						     , O.ORD_EMAIL                              -- 주문자이메일
-						     , OD.DELV_FEE_CD
-						     , O.CUST_NO
-						     , CASE WHEN G.SELF_GOODS_YN = 'Y'
-						            THEN 'WMS'
-						            ELSE OD.DELV_FEE_CD
-						            END  DELV_FEE_CD_GRP
-						FROM   TB_ORDER_CHANGE OC          
-						JOIN   TB_ORDER_CHANGE_DETAIL OCD ON OC.ORD_CHG_SQ  = OCD.ORD_CHG_SQ 
-						JOIN   TB_ORDER_DETAIL OD         ON OCD.ORD_DTL_NO = OD.ORD_DTL_NO
-						JOIN   TB_ORDER O                 ON OD.ORD_NO      = O.ORD_NO
-						JOIN   TB_GOODS G                 ON OD.GOODS_CD     = G.GOODS_CD
-						JOIN   TB_DELIVERY_LOC D          ON OD.DELV_LOC_CD = D.DELV_LOC_CD AND OD.SUPPLY_COMP_CD = D.SUPPLY_COMP_CD
-						WHERE  1=1 
+		        SELECT A.* 
+		        FROM (
+		            SELECT Y.ORD_CHG_SQ
+		                 , Y.CHG_GB
+		                 , Y.CHG_REASON
+		                 , Y.WD_GB
+		                 , Y.REG_DT -- 회수요청일
+		                 , Y.SHIP_COMP_CD
+		                 , Y.WD_INVOICE_NO
+		                 , Y.WD_SHIP_STATE
+		                 , Y.WD_STATE_DT 
+		                 , Y.WD_REASON_CD
+		                 , Y.WD_BF_SEND_YN 
+		                 , Y.SEND_YN
+		                 , Y.ORD_NO
+		                 , Y.ORD_DTL_NO
+		                 , Y.CHG_STAT
+		                 , Y.GOODS_CD
+		                 , Y.GOODS_NM
+		                 , Y.CHG_QTY
+		                 , Y.WD_STDT
+		                 , Y.WD_EDDT
+		                 , Y.RECIP_NM
+		                 , Y.CHGER_NM
+		                 , Y.CHGER_PHNNO
+		                 , Y.CHGER_TELNO
+		                 , Y.CHGER_ZIPCODE
+		                 , Y.CHGER_BASE_ADDR
+		                 , Y.CHGER_DTL_ADDR
+		                 , Y.ORD_NM
+		                 , Y.ORD_PHNNO
+		                 , Y.ORD_TELNO
+		                 , Y.ORD_EMAIL
+		                 , Y.DELV_FEE_CD
+		                 , Y.CUST_NO
+		                 , Y.DELV_FEE_CD_GRP
+		                 , Y.MALL_GB
+		                 , Y.EXTMALL_NM
+		                 , Y.EXTMALL_ORDER_ID
+		                 , Y.CHG_REG_DT
+		                 , GROUP_CONCAT(Y.OPT_CD ORDER BY Y.ORD_DTL_ITEM_SQ) AS OPT_CD
+		                 , GROUP_CONCAT(Y.OPT_CD1 ORDER BY Y.ORD_DTL_ITEM_SQ) AS OPT_CD1
+		                 , GROUP_CONCAT(Y.OPT_CD2 ORDER BY Y.ORD_DTL_ITEM_SQ) AS OPT_CD2
+		                 , Y.NPAY_ORD_YN
+		            FROM (
+		                SELECT OC.ORD_CHG_SQ                            -- 주문변경번호 
+		                     , OC.CHG_GB                                -- 변경구분 G680
+		                     , OC.CHG_REASON                            -- 변경사유 반품G688 교환G689
+		                     , OC.WD_GB                                 -- 직접배송여부
+		                     , DATE_FORMAT(OC.REG_DT, '%Y-%m-%d') AS REG_DT  -- 회수요청일
+		                     , OC.SHIP_COMP_CD
+		                     , OC.WD_INVOICE_NO                         -- 회수송장번호
+		                     , OC.WD_SHIP_STATE                         -- 배송업체회수상태 G320
+		                     , OC.WD_STATE_DT                           -- 회수상태 수신일시 
+		                     , OC.WD_REASON_CD                          -- 미회수사유 G321 G322
+		                     , OC.WD_BF_SEND_YN                         -- 교환 선발송 여부 
+		                     , OC.WD_INVOICE_SEND_YN AS SEND_YN         -- 전송여부
+		                     , O.ORD_NO                                 -- 주문번호
+		                     , OCD.ORD_DTL_NO                           -- 주문상세번호
+		                     , OCD.CHG_STAT                             -- 변경상태 G685
+		                     , OD.GOODS_CD                              -- 상품코드
+		                     , G.GOODS_NM                               -- 상품명
+		                     , OCD.CHG_QTY                              -- 변경수량
+		                     , DATE_FORMAT(OC.WD_STDT, '%Y-%m-%d %H:%i:%S') AS WD_STDT  -- 배송시작일시
+		                     , DATE_FORMAT(OC.WD_EDDT, '%Y-%m-%d %H:%i:%S') AS WD_EDDT  -- 배송종료일시
+		                     , D.RTN_LOC_NM          AS RECIP_NM        -- 수취인명
+		                     , OC.CHGER_NM                              -- 변경자명
+		                     , OC.CHGER_PHNNO                           -- 변경자휴대전화번호
+		                     , OC.CHGER_TELNO                           -- 변경자전화번호
+		                     , OC.CHGER_ZIPCODE                         -- 변경자우편번호
+		                     , OC.CHGER_BASE_ADDR                       -- 변경자기본주소
+		                     , OC.CHGER_DTL_ADDR                        -- 변경자상세주소
+		                     , O.ORD_NM                                 -- 주문자명
+		                     , O.ORD_PHNNO                              -- 주문자휴대전화번호
+		                     , O.ORD_TELNO                              -- 주문자전화번호
+		                     , O.ORD_EMAIL                              -- 주문자이메일
+		                     , OD.DELV_FEE_CD
+		                     , O.CUST_NO
+		                     , CASE WHEN G.SELF_GOODS_YN = 'Y'
+		                            THEN 'WMS'
+		                            ELSE OD.DELV_FEE_CD
+		                            END  DELV_FEE_CD_GRP
+		                     , O.MALL_GB
+		                     , (SELECT EXTMALL_NM
+		                        FROM   TB_EXTMALL X
+		                        WHERE  1=1
+		                        AND    X.VENDOR_ID = OD.VENDOR_ID
+		                        AND    X.EXTMALL_ID = OD.EXTMALL_ID) AS EXTMALL_NM
+		                     , OD.EXTMALL_ORDER_ID
+		                     , OC.REG_DT AS CHG_REG_DT
+		                     , ODI.ORD_DTL_ITEM_SQ
+		                     , ODI.OPT_CD
+		                     , ODI.OPT_CD1
+		                     , ODI.OPT_CD2
+		                     , CASE WHEN OD.NPAY_ORD_DTL_NO IS NOT NULL
+		                            THEN 'Y'
+		                            ELSE 'N'
+		                            END  NPAY_ORD_YN
+		                FROM   TB_ORDER_CHANGE OC          
+		                JOIN   TB_ORDER_CHANGE_DETAIL OCD ON OC.ORD_CHG_SQ  = OCD.ORD_CHG_SQ 
+		                JOIN   TB_ORDER_DETAIL OD         ON OCD.ORD_DTL_NO = OD.ORD_DTL_NO
+		                JOIN   TB_ORDER O                 ON OD.ORD_NO      = O.ORD_NO
+		                JOIN   TB_GOODS G                 ON OD.GOODS_CD    = G.GOODS_CD
+		                JOIN   TB_DELIVERY_LOC D          ON OD.DELV_LOC_CD = D.DELV_LOC_CD AND OD.SUPPLY_COMP_CD = D.SUPPLY_COMP_CD
+		                JOIN   TB_ORDER_DETAIL_ITEM ODI   ON OD.ORD_DTL_NO  = ODI.ORD_DTL_NO
+		                WHERE  1=1 
 						<include refid="getWithdrawDirectiveCondition_sql"/>
-					) A
-				ORDER BY A.ORD_CHG_SQ desc, A.ORD_NO DESC, A.ORD_DTL_NO
+		            ) Y
+		            GROUP  BY Y.ORD_CHG_SQ
+		                 , Y.CHG_GB
+		                 , Y.CHG_REASON
+		                 , Y.WD_GB
+		                 , Y.REG_DT -- 회수요청일
+		                 , Y.SHIP_COMP_CD
+		                 , Y.WD_INVOICE_NO
+		                 , Y.WD_SHIP_STATE
+		                 , Y.WD_STATE_DT 
+		                 , Y.WD_REASON_CD
+		                 , Y.WD_BF_SEND_YN 
+		                 , Y.SEND_YN
+		                 , Y.ORD_NO
+		                 , Y.ORD_DTL_NO
+		                 , Y.CHG_STAT
+		                 , Y.GOODS_CD
+		                 , Y.GOODS_NM
+		                 , Y.CHG_QTY
+		                 , Y.WD_STDT
+		                 , Y.WD_EDDT
+		                 , Y.RECIP_NM
+		                 , Y.CHGER_NM
+		                 , Y.CHGER_PHNNO
+		                 , Y.CHGER_TELNO
+		                 , Y.CHGER_ZIPCODE
+		                 , Y.CHGER_BASE_ADDR
+		                 , Y.CHGER_DTL_ADDR
+		                 , Y.ORD_NM
+		                 , Y.ORD_PHNNO
+		                 , Y.ORD_TELNO
+		                 , Y.ORD_EMAIL
+		                 , Y.DELV_FEE_CD
+		                 , Y.CUST_NO
+		                 , Y.DELV_FEE_CD_GRP
+		                 , Y.MALL_GB
+		                 , Y.EXTMALL_NM
+		                 , Y.EXTMALL_ORDER_ID
+		                 , Y.CHG_REG_DT
+		                 , Y.NPAY_ORD_YN
+		        ) A
+		        ORDER BY A.ORD_CHG_SQ DESC
+		               , A.ORD_NO DESC
+		               , A.ORD_DTL_NO
 				<include refid="getListPagingCondition_sql"/>
 	</select>
 
-    <!-- 회수지시 목록 조회 조건  -->
+	<!-- 회수지시 목록 조회 조건  -->
 	<sql id="getWithdrawDirectiveCondition_sql">
 		<if test="ordNm != null and ordNm != ''">
-			AND O.ORD_NM = #{ordNm}
+		AND    O.ORD_NM = #{ordNm}
 		</if>
 		<if test="ordNo != null and ordNo != ''">
-			AND O.ORD_NO = #{ordNo}
+		AND    O.ORD_NO = #{ordNo}
 		</if>
 		<if test="ordChgSq != null and ordChgSq != ''">
-			AND OC.ORD_CHG_SQ = #{ordChgSq}
+		AND    OC.ORD_CHG_SQ = #{ordChgSq}
 		</if>		
 		<if test="chgGb == null or chgGb == ''">
-			AND    OC.CHG_GB IN ('G680_30','G680_40') -- 반품요청,교환요청
+		AND    OC.CHG_GB IN ('G680_30','G680_40') -- 반품요청,교환요청
 		</if>
 		<if test="chgGb != null and chgGb != ''">
-			AND OC.CHG_GB = #{chgGb}
+		AND    OC.CHG_GB = #{chgGb}
 		</if>
-		
 		<if test="chgStat != null and chgStat != ''">
-			AND OCD.CHG_STAT = #{chgStat}
+		AND    OCD.CHG_STAT = #{chgStat}
 		</if>
-		
 		<if test="wdGb != null and wdGb != ''">
-			AND OC.WD_GB = #{wdGb}
+		AND    OC.WD_GB = #{wdGb}
 		</if>	
 		<if test="sendYn != null and sendYn != ''">
 		AND    OC.WD_INVOICE_SEND_YN = #{sendYn}
@@ -624,7 +739,6 @@
 		<if test="wdShipState != null and wdShipState != ''">
 		AND    OC.WD_SHIP_STATE = #{wdShipState}
 		</if>
-		
 		<if test="stDate != null and stDate != ''">
 		AND    OC.REG_DT <![CDATA[>=]]> STR_TO_DATE(REPLACE(#{stDate},'-','') , '%Y%m%d%H%i%s')
 		</if>
@@ -632,7 +746,17 @@
 		AND    OC.REG_DT <![CDATA[<]]> DATE_ADD(STR_TO_DATE(REPLACE(#{edDate},'-','') , '%Y%m%d%H%i%s'), INTERVAL 1 DAY)
 		</if>
 		AND    G.SELF_GOODS_YN = 'Y' -- 자사상품만
-		AND    OCD.DEL_YN      = 'N'	
+		AND    OCD.DEL_YN      = 'N'
+		<if test="extmallId != null and extmallId != ''">
+		AND    OD.VENDOR_ID = #{vendorId}
+		AND    OD.EXTMALL_ID = #{extmallId}
+		</if>
+		<if test="extmallOrderId != null and extmallOrderId != ''">
+		AND    OD.EXTMALL_ORDER_ID LIKE CONCAT('%',#{extmallOrderId},'%')
+		</if>
+		<if test="optCd != null and optCd != ''">
+		AND    ODI.OPT_CD LIKE CONCAT('%',#{optCd},'%')
+		</if>
 	</sql>		
 			
 	<!-- 재회수지시 Detail-->

+ 188 - 147
src/main/webapp/WEB-INF/views/withdraw/WithdrawDirectiveListForm.html

@@ -19,6 +19,7 @@
 		<div class="main-title">
 		</div>
 		<!-- //메인타이틀 영역 -->
+		
 		<!-- 메뉴 설명 -->
 		<div class="infoBox menu-desc">
 		</div>
@@ -26,6 +27,7 @@
 		
 		<!-- 검색조건 영역 -->
 		<form id="searchForm" name="searchForm" action="#" th:action="@{'/withdraw/direct/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+		
 		<div class="panelStyle">
 			<!-- TITLE -->
 			<div class="panelTitle">
@@ -35,91 +37,108 @@
 				</span>
 			</div>
 			<!-- //TITLE -->
-			<div class="panelContent">	
-				
-					<table class="frmStyle">
-						<colgroup>
-							<col style="width:8%;"/>
-							<col style="width:12%;"/>
-							<col style="width:8%;"/>
-							<col style="width:12%;"/>
-							<col style="width:8%;"/>
-							<col style="width:12%;"/>
-						</colgroup>
-						<tr>
-							<th>주문자명</th>
-							<td>
-								<input type="text" class="w40p" name="ordNm" placeholder="" maxlength="20"/>
-							</td>
-							<th>주문번호</th>
-							<td>
-								<input type="text" class="w40p" name="ordNo" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" placeholder="" maxlength="20"/>
-							</td>
-							<th>주문변경번호</th>
-							<td>
-								<input type="text" class="w40p" name="ordChgSq" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" placeholder="" maxlength="20"/>
-							</td>
-						</tr>
-						<tr>	
-							<th>회수구분</th>
-							<td>
-								<select name="chgGb"class="w100">
-									<option value="">&nbsp;전체&nbsp;</option>
-									<option value="G680_30"> 반품요청 </option>
-									<option value="G680_40"> 교환요청 </option>
-								</select>
-							</td>
-							<th>진행상태</th>
-							<td>
-								<select name="chgStat" class="w100">
-									<option value="">전체</option>
-									<option th:if="${chgStatList}" th:each="oneData, status : ${chgStatList}" th:value="${oneData.cd}" th:text="${oneData.cdNm}"></option>	
-								</select>
-							</td>
-							<th>반품방식</th>
-							<td>
-								<select name="wdGb" class="w100">
-									<option value="">&nbsp;전체&nbsp;</option>
-									<option value="W">방문회수</option>
-									<option value="D">직접배송</option>
-									
-								</select>
-							</td>
-						</tr>
-						<tr>
-							<th>택배사전송여부</th>
-							<td>
-								<select name="sendYn" class="w100">
-									<option value="">전체</option>
-									<option value="Y">전송</option>
-									<option value="N">미전송</option>
-									
-								</select>
-							</td>
-							<th>CJ회수상태</th>
-							<td colspan="3">
-								<select name="wdShipState" class="w100">
-									<option value="">전체</option>
-									<option th:if="${wdShipStateList}" th:each="oneData, status : ${wdShipStateList}" th:value="${oneData.cd}" th:text="${oneData.cdNm}"></option>
-								</select>
-							</td>
-						</tr>
-						<tr>
-							<th>회수요청일</th>
-							<td colspan="5" id="terms">
-							</td>
-						</tr>
-					</table>
+			
+			<div class="panelContent">
+				<table class="frmStyle">
+					<colgroup>
+						<col style="width:8%;"/>
+						<col style="width:12%;"/>
+						<col style="width:8%;"/>
+						<col style="width:12%;"/>
+						<col style="width:8%;"/>
+						<col style="width:12%;"/>
+					</colgroup>
+					<tr>
+						<th>주문자명</th>
+						<td>
+							<input type="text" class="w40p" name="ordNm" placeholder="" maxlength="20"/>
+						</td>
+						<th>주문번호</th>
+						<td>
+							<input type="text" class="w40p" name="ordNo" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" placeholder="" maxlength="20"/>
+						</td>
+						<th>주문변경번호</th>
+						<td>
+							<input type="text" class="w40p" name="ordChgSq" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" placeholder="" maxlength="20"/>
+						</td>
+					</tr>
+					<tr>
+						<th>제휴몰명</th>
+						<td>
+							<input type="hidden" class="w40p" name="vendorId" placeholder="" maxlength="20" th:value="${vendorId}"/>
+							<select name="extmallId">
+								<option value="">선택안함</option>
+								<option th:if="${extmallList}" th:each="oneData, status : ${extmallList}" th:value="${oneData.extmallId}" th:text="${'[' + oneData.extmallId + '] ' + oneData.extmallNm}"></option>
+							</select>
+						</td>
+						<th>제휴몰 주문번호</th>
+						<td>
+							<input type="text" class="w40p" name="extmallOrderId" placeholder="" maxlength="40"/>
+						</td>
+						<th>SKU-CODE</th>
+						<td>
+							<input type="text" class="w40p" name="optCd" placeholder="" maxlength="40"/>
+						</td>
+					</tr>
+					<tr>	
+						<th>회수구분</th>
+						<td>
+							<select name="chgGb"class="w100">
+								<option value="">&nbsp;전체&nbsp;</option>
+								<option value="G680_30"> 반품요청 </option>
+								<option value="G680_40"> 교환요청 </option>
+							</select>
+						</td>
+						<th>진행상태</th>
+						<td>
+							<select name="chgStat" class="w100">
+								<option value="">전체</option>
+								<option th:if="${chgStatList}" th:each="oneData, status : ${chgStatList}" th:value="${oneData.cd}" th:text="${oneData.cdNm}"></option>	
+							</select>
+						</td>
+						<th>반품방식</th>
+						<td>
+							<select name="wdGb" class="w100">
+								<option value="">&nbsp;전체&nbsp;</option>
+								<option value="W">방문회수</option>
+								<option value="D">직접배송</option>
+								
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<th>택배사전송여부</th>
+						<td>
+							<select name="sendYn" class="w100">
+								<option value="">전체</option>
+								<option value="Y">전송</option>
+								<option value="N">미전송</option>
+								
+							</select>
+						</td>
+						<th>CJ회수상태</th>
+						<td colspan="3">
+							<select name="wdShipState" class="w100">
+								<option value="">전체</option>
+								<option th:if="${wdShipStateList}" th:each="oneData, status : ${wdShipStateList}" th:value="${oneData.cd}" th:text="${oneData.cdNm}"></option>
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<th>회수요청일</th>
+						<td colspan="5" id="terms">
+						</td>
+					</tr>
+				</table>
 	
-					<ul class="panelBar">
-						<li class="center">
+				<ul class="panelBar">
+					<li class="center">
 						<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
 						<button type="button" class="btn btn-gray btn-lg" onclick="$('#searchForm')[0].reset(); fnInitCalendar();">초기화</button>
 						<button type="button" id="btnExcel" class="btn btn-info btn-lg" >엑셀다운로드</button>
-						</li>
-					</ul>
-
-				</div>
+					</li>
+				</ul>
+			</div>
 		</div>
 		<!-- //검색조건 영역 -->
 
@@ -143,26 +162,46 @@
 				</li>
 			</ul>
 			<div id="gridList" style="width:100%; height: 500px;" class="ag-theme-balham"></div>
+			
 			<ul class="panelBar">
 				<li class="center">
 					<div class="tablePaging" id="delvWithdrawListPagination"></div>
 				</li>
 			</ul>
-					 
+			
 		</div>
 		</form>
 		<!-- //리스트 영역 -->
 	</div>
 <script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=20210114"></script>
+
 <script th:inline="javascript">
 /*<![CDATA[*/
 	// 사이트목록
 	var currOrdNo =0;
 	var columnDefs = [
-		{headerName: "주문변경번호", 	field: "ordChgSq", 		width: 100, cellClass: "text-center",
+		{headerName: "회수구분", 			field: "chgGbNm", 			width: 80, cellClass: "text-center"},
+		{headerName: "진행상태", 			field: "chgStatNm", 		width: 100, cellClass: "text-center"},
+		{headerName: "CJ회수상태", 		field: "wdShipStateNm", 	width: 120, cellClass: "text-center"},
+		{headerName: "몰구분", 			field: "mallGb", 			width: 100, cellClass: "text-center",
+			cellRenderer: function(params) {
+				var rtnStr = "자사몰";
+				if (params.value == 'G011_20') {
+					rtnStr = "외부몰";
+				}
+				return rtnStr;
+			}
+		},
+		{headerName: "제휴몰명", 			field: "extmallNm", 		width: 120, cellClass: "text-center"},
+		{headerName: "제휴몰주문번호", 		field: "extmallOrderId", 	width: 120, cellClass: "text-center"},
+		{headerName: "주문번호", 			field: "ordNo", 			width: 100, cellClass: "text-center",
+			cellRenderer: function(params) { 
+				return gagajf.isNull(params.value) ? '' : "<a href=\"javascript:void(0);\" onclick=\"fnOrderDetailPopup('" + params.data.ordNo + "');\">" + params.data.ordNo + "</a>";
+			}
+		},
+		{headerName: "주문변경번호", 		field: "ordChgSq", 			width: 100, cellClass: "text-center",
 			cellRenderer	: function(params) {
 				var rtnStr = "";
-				
 				var paramData 	= params.data.ordNo;
 				paramData 		+= '@' + params.data.ordDtlNo;
 				paramData 		+= '@' + params.data.delvFeeCd;
@@ -182,28 +221,26 @@
 					rtnStr = params.value;
 				}
 				return  rtnStr;
-			}			
-		
-		},
-		{headerName: "주문번호", 		field: "ordNo", 		width: 100, cellClass: "text-center",
-			cellRenderer: function(params) { 
-				return gagajf.isNull(params.value) ? '' : "<a href=\"javascript:void(0);\" onclick=\"fnOrderDetailPopup('" + params.data.ordNo + "');\">" + params.data.ordNo + "</a>";
 			}
 		},
-		{headerName: "주문상세번호", 	field: "ordDtlNo", 		width: 100, cellClass: "text-center"},		
-		{headerName: "회수구분", 		field: "chgGbNm", 		width: 80, cellClass: "text-center"},
-		
-		{headerName: "사유", 			field: "chgReasonNm", 	width: 150, cellClass: "text-left"},
-		{headerName: "회수요청일", 		field: "regDt", 	width: 100, cellClass: "text-center"},
-		{headerName: "진행상태", 		field: "chgStatNm", 	width: 100, cellClass: "text-center"},
-		{headerName: "상품코드", 		field: "goodsCd", 		width: 120, cellClass: "text-center",
+		{headerName: "주문상세번호", 		field: "ordDtlNo", 			width: 100, cellClass: "text-center"},
+		{headerName: "주문자명", 			field: "maskingOrdNm", 		width: 100, cellClass: "text-center"},
+		{headerName: "클레임접수일", 		field: "chgRegDt", 			width: 100, cellClass: "text-center"},
+		{headerName: "회수요청일", 		field: "regDt", 			width: 100, cellClass: "text-center"},
+		{headerName: "회수상태수신일시", 	field: "wdStateDt", 		width: 120, cellClass: "text-center"},
+		{headerName: "상품코드", 			field: "goodsCd", 			width: 120, cellClass: "text-center",
 			cellRenderer: function(params) { return gagajf.isNull(params.value) ? '' : '<a href="javascript:void(0);">' + params.value + '</a>'; }
 		},
-		{headerName: "상품명", 			field: "goodsNm", 		width: 200, cellClass: "text-left"},
-		{headerName: "수량", 			field: "chgQty", 		width: 80, cellClass: "text-center"},
-		{headerName: "반품방식", 		field: "wdGbNm", 			width: 80, cellClass: "text-center"},
-		{headerName: "택배사전송", 		field: "sendYn", 		width: 80, cellClass: "text-center"},
-		{headerName: "회수송장번호", 	field: "wdInvoiceNo", 	width: 100, cellClass: "text-center"
+		{headerName: "SKU-CODE", 		field: "optCd", 			width: 80, cellClass: "text-left"},
+		{headerName: "상품명", 			field: "goodsNm", 			width: 200, cellClass: "text-left"},
+		{headerName: "옵션1", 			field: "optCd1", 			width: 80, cellClass: "text-left"},
+		{headerName: "옵션2", 			field: "optCd2", 			width: 80, cellClass: "text-left"},
+		{headerName: "수량", 			field: "chgQty", 			width: 80, cellClass: "text-center"},
+		{headerName: "사유", 			field: "chgReasonNm", 		width: 150, cellClass: "text-left"},
+		{headerName: "반품방식", 			field: "wdGbNm", 			width: 80, cellClass: "text-center"},
+		{headerName: "네이버주문형", 		field: "npayOrdYn", 		width: 80, cellClass: "text-center"},
+		{headerName: "택배사전송", 		field: "sendYn", 			width: 80, cellClass: "text-center"},
+		{headerName: "회수송장번호", 		field: "wdInvoiceNo", 		width: 100, cellClass: "text-center"
 			, cellRenderer	: function (params) {
 				var retStr = '';
 				if (!gagajf.isNull(params.value) && !gagajf.isNull(params.data.shipCompCd)) {
@@ -212,19 +249,17 @@
 				return retStr;
 			}			
 		},
-		{headerName: "CJ회수상태", 		field: "wdShipStateNm", width: 120, cellClass: "text-center"},
-		{headerName: "회수상태수신일시", field: "wdStateDt", 		width: 120, cellClass: "text-center"},
-		{headerName: "미회수사유", 		field: "wdReasonCdNm", 	width: 100, cellClass: "text-center"},
-		{headerName: "재회수지시", 		field: "wdShipState", 	width: 100,	cellClass: 'text-center',
+		{headerName: "미회수사유", 		field: "wdReasonCdNm", 		width: 100, cellClass: "text-center"},
+		{headerName: "재회수지시", 		field: "wdShipState", 		width: 100,	cellClass: 'text-center',
 			cellRenderer: function(params) {
 				return params.value == '12' && params.data.chgStat == 'G685_30' ? '<button type="button" class="btn btn-base btn-sm" onclick="fnReRecallOrder(\'' + params.data.chgGb + '\',\'' + params.data.ordDtlNo + '\',\''+params.data.ordChgSq+'\',\''+params.data.ordNo+'\');">&nbsp;재회수지시&nbsp;</button>' : "";
 			}
 		},	
-		{headerName: "교환선발송여부 ", 	field: "wdBfSendYn", 	width: 110, cellClass: "text-center"},
-		{headerName: "배송시작일시", 	field: "wdStdt", 		width: 120, cellClass: "text-center"},
-		{headerName: "배송종료일시", 	field: "wdEddt", 		width: 120, cellClass: "text-center"},
-		{headerName: "수취인명", 		field: "recipNm", 		width: 120, cellClass: "text-center"},
-		{headerName: "알림톡", 			field: "", 				width: 140, cellClass: "text-center",
+		{headerName: "교환선발송여부 ", 	field: "wdBfSendYn", 		width: 110, cellClass: "text-center"},
+		{headerName: "배송시작일시", 		field: "wdStdt", 			width: 120, cellClass: "text-center"},
+		{headerName: "배송종료일시", 		field: "wdEddt", 			width: 120, cellClass: "text-center"},
+		{headerName: "수취인명", 			field: "recipNm", 			width: 120, cellClass: "text-center"},
+		{headerName: "알림톡", 			field: "", 					width: 140, cellClass: "text-center",
 			cellRenderer: function(params) {
 				if (params.data.wdShipState == '12' && params.data.chgStat == 'G685_30') {
 					
@@ -232,9 +267,12 @@
 					paramData 		+= '@' + params.data.wdReasonCd;
 					paramData 		+= '@' + params.data.chgGb;
 					
-					if(params.data.chgGb == 'G680_30'){ // 반품요청 
+					// 반품요청
+					if (params.data.chgGb == 'G680_30'){  
 						return '<button type="button" class="btn btn-base btn-sm" onclick="fnKaKao(\'' + paramData + '\');">&nbsp;반품철회알림톡&nbsp;</button>';
-					} else if(params.data.chgGb == 'G680_40'){ // 교환요청 
+					} 
+					// 교환요청
+					else if(params.data.chgGb == 'G680_40'){  
 						return '<button type="button" class="btn btn-base btn-sm" onclick="fnKaKao(\'' + paramData + '\');">&nbsp;교환철회알림톡&nbsp;</button>';
 					}
 				}
@@ -245,12 +283,11 @@
 				return '<button type="button" class="btn btn-base btn-sm" onclick="fnLms(\'' + params.data.chgerPhnno + '\',\'' + params.data.custNo + '\');">&nbsp;LMS&nbsp;</button>';
 			}			
 		},
-		{headerName: "보내시는분", 			field: "maskingChgerNm", 		width: 100, cellClass: "text-center"},
+		{headerName: "보내시는분", 		field: "maskingChgerNm", 		width: 100, cellClass: "text-center"},
 		{headerName: "반품회수지휴대전화", 	field: "maskingChgerPhnno", 	width: 120, cellClass: "text-center"},
 		{headerName: "반품회수지우편번호", 	field: "chgerZipcode", 			width: 120, cellClass: "text-center"},
 		{headerName: "반품회수지기본주소", 	field: "chgerBaseAddr", 		width: 300, cellClass: "text-left"},
 		{headerName: "변경자상세주소", 		field: "maskingChgerDtlAddr", 	width: 200, cellClass: "text-left"},
-		{headerName: "주문자명", 			field: "maskingOrdNm", 			width: 100, cellClass: "text-center"},
 		{headerName: "주문자휴대전화", 		field: "maskingOrdPhnno", 		width: 120, cellClass: "text-center"},
 		{headerName: "주문자전화번호", 		field: "ordTelno", 				width: 120, cellClass: "text-center"},
 		{headerName: "주문자이메일", 		field: "maskingOrdEmail", 		width: 120, cellClass: "text-left"}
@@ -298,7 +335,6 @@
 		
 		var searchChk = "N";
 		
-
 		if ($('#searchForm input[name=ordNo]').val() != '') {
 			searchChk = "Y";
 		}		
@@ -307,22 +343,22 @@
 			searchChk = "Y";
 		}
 		
-		
-		if(searchChk == "N"){
-			if($('#stDate').val() == ''){
+		if (searchChk == "N") {
+			if ($('#stDate').val() == '') {
 				mcxDialog.alert('시작 기간을 입력하세요.');
 				return;
 			}
 	
-			if($('#edDate').val() == ''){
+			if ($('#edDate').val() == '') {
 				mcxDialog.alert('종료 기간을 입력하세요.');
 				return;
 			}
+			
 			// 날짜 유효성 체크
 			if (Number($('#stDate').val().replaceAll("-", "")) > Number($('#edDate').val().replaceAll("-", ""))) {
 				mcxDialog.alert("시작일은 종료일보다 클 수 없습니다.");
 				return;
-			}			
+			}
 		}
 
 		gagaPaging.init('searchForm', fnSearchCallBack, 'delvWithdrawListPagination', $('#searchForm').find('#pageSize').val());
@@ -333,14 +369,13 @@
 	*  조회 콜백
 	**************************************************************************/
 	var fnSearchCallBack = function(result){
-
 		$('#searchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
 		$('#searchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
 		$('#searchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
 		$('#searchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
+		
 		gridOptions.api.setRowData(result.directList);
 		gagaPaging.createPagination(result.pageing.pageable);
-		
 	}
 	
 	// 페이징
@@ -348,29 +383,27 @@
 		$("#searchForm input[name=pageNo]").val('1');
 		fnSearchList();
 	});
-	
-	
+
 	/*************************************************************************
 	*  재회수지시
 	**************************************************************************/	
 	var fnReRecallOrder = function(chgGb, ordDtlNo, ordChgSq, ordNo ){
 		mcxDialog.confirm("재회수지시 하시겠습니까?", {
-		    cancelBtnText: "취소",
-		    sureBtnText: "확인",
+		    cancelBtnText	: "취소",
+		    sureBtnText		: "확인",
 		    sureBtnClick: function() {
 	            var param = new Object;
 	            param.chgGb    = chgGb;
 	            param.ordDtlNo = ordDtlNo;
 	            param.ordNo    = ordNo;
 	            param.ordChgSq = ordChgSq;
+	            
 	            var jsonData = JSON.stringify(param);
 	            gagajf.ajaxJsonSubmit('/withdraw/direct/recallorder', jsonData, fnSearchList);
 	        }
 		});
 	}
 
-	
-	
 	/*************************************************************************
 	*  KAKAO(알림톡)
 	**************************************************************************/	
@@ -384,32 +417,41 @@
 		var ordChgSq	= paramArr[0];
 		var wdReasonCd  = paramArr[1];
 		var chgGb       = paramArr[2];
-
-		if(chgGb == "G680_30"){ // 반품 
-			if(wdReasonCd == "18" || wdReasonCd == "14" || wdReasonCd == "16" || wdReasonCd == "25"){ // 고객부재 
+		
+		// 반품
+		if (chgGb == "G680_30") {  
+			// 고객부재
+			if (wdReasonCd == "18" || wdReasonCd == "14" || wdReasonCd == "16" || wdReasonCd == "25") {
 				gubun = "RETURN_CANCEL_CUSTOMER";
-			} else if(wdReasonCd == "21" ){ // 고객정보(주소) 오류 
+			}
+			// 고객정보(주소) 오류
+			else if (wdReasonCd == "21" ){  
 				gubun = "RETURN_CANCEL_ADDR";
 			}
-			msg = "반품 철회 알림톡 발송 하시겠습니까?";
 			
-		} else if(chgGb == "G680_40"){ // 교환 
-			if(wdReasonCd == "18" || wdReasonCd == "14" || wdReasonCd == "16" || wdReasonCd == "25"){ // 고객부재 
+			msg = "반품 철회 알림톡 발송 하시겠습니까?";
+		} 
+		// 교환
+		else if (chgGb == "G680_40") {
+			// 고객부재
+			if (wdReasonCd == "18" || wdReasonCd == "14" || wdReasonCd == "16" || wdReasonCd == "25") {  
 				gubun = "EXCHANGE_CANCEL_CUSTOMER";
-			} else if(wdReasonCd == "21" ){ // 고객정보(주소) 오류 
+			}
+			// 고객정보(주소) 오류
+			else if(wdReasonCd == "21" ) {  
 				gubun = "EXCHANGE_CANCEL_ADDR";
 			}
 			msg = "교환 철회 알림톡 발송 하시겠습니까?";
 		}
 
-		if(gubun == ""){
+		if (gubun == "") {
 			mcxDialog.alert('알림톡 대상이 아닙니다.');
 			return false;
 		}
 
 		mcxDialog.confirm(msg, {
-		    cancelBtnText: "취소",
-		    sureBtnText: "확인",
+		    cancelBtnText	: "취소",
+		    sureBtnText		: "확인",
 		    sureBtnClick: function() {
 	            var param = new Object;
 	            param.ordChgSq   = ordChgSq;
@@ -421,7 +463,6 @@
 		});
 	}
 	
-	
 	/*************************************************************************
 	*  LMS
 	**************************************************************************/	
@@ -477,12 +518,11 @@
 		cfnOpenModalPopup(actionUrl, 'popupExchangeRequestForm');
 	};
 	
-	//엑셀다운로드
+	// 엑셀다운로드
 	$('#btnExcel').on('click', function() {
-
-		
 		var totalRows = gridOptions.api.getDisplayedRowCount();
-		if(totalRows==0){
+		
+		if (totalRows == 0) {
 			mcxDialog.alert('조회된 내역이 없습니다.');
 			return;
 		}
@@ -492,6 +532,7 @@
 			fileName : "회수지시목록_"+ date,
 			sheetName: "DATA"
 		}
+		
 		gridOptions.excelStyles = [
 			{
 				id: 'dateFormat',
@@ -506,10 +547,9 @@
 			}
 		]
 		gridOptions.api.exportDataAsExcel(params);
-		
 	});
 	
-	// 2021.06.17스윗트래커 송장조회
+	// 2021.06.17 스윗트래커 송장조회
 	var fnSweetTracker = function (shipCompCd, invoiceNo) {
 		var actionUrl = "/order/delivery/sweetTrackerDeliveryInfo?shipCompCd=" + shipCompCd + "&invoiceNo=" + invoiceNo;
 		cfnOpenModalPopup(actionUrl, 'popupSweetTrackerDeliveryInfo');
@@ -521,6 +561,7 @@
 		gagaAgGrid.createGrid('gridList', gridOptions);
 		var hideList = ["btnThisWeek", "btnYesterWeek", "btnThisMonth", "btnYesterMonth", "btnRecent3Month"];
 		cfnCreateCalendar('#terms', 'stDate', 'edDate', true, '','',  hideList);
+		
 		// grid 높이 조절
 		//uifnFitGrid('auto');
 		gagajf.setDate('#terms', 'stDate', 'edDate', '7d');