moon 5 лет назад
Родитель
Сommit
d27b3ffd8e

+ 22 - 10
src/main/java/com/style24/admin/biz/dao/TsaWithdrawDao.java

@@ -24,6 +24,28 @@ import org.springframework.stereotype.Repository;
 public interface TsaWithdrawDao {
 
 	
+	/**
+	 * 환불관리 목록 건수
+	 * 
+	 * @param WithdrawExc
+	 * @return int
+	 * @author moon
+	 * @since 2021. 03. 04
+	 */
+	int getRefundListCount(Withdraw withdraw);
+	
+	/**
+	 * 환불관리 목록
+	 * 
+	 * @param withdraw
+	 * @return Collection<Withdraw>
+	 * @author moon
+	 * @since 2020. 11. 16
+	 */
+	Collection<Withdraw> getRefundList(Withdraw withdraw);
+	
+	
+	
 	/**
 	 * 회수예외 목록 건수
 	 * 
@@ -134,16 +156,6 @@ public interface TsaWithdrawDao {
 	 */
 	//Collection<Withdraw> getWdInvoiceNo(Withdraw withdraw);
 
-	/**
-	 * 환불관리 목록
-	 * 
-	 * @param withdraw
-	 * @return Collection<Withdraw>
-	 * @author moon
-	 * @since 2020. 11. 16
-	 */
-	Collection<Withdraw> getRefundList(Withdraw withdraw);
-	//Collection<Withdraw> getWithdrawRegisterList(Withdraw withdraw);
 	/**
 	 * 회수관리 회수데이터 삭제처리
 	 * 

+ 8 - 1
src/main/java/com/style24/admin/biz/service/TsaDeliveryService.java

@@ -16,7 +16,6 @@ import com.style24.admin.support.security.session.TsaSession;
 import com.style24.admin.support.util.TsitUtil;
 import com.style24.admin.support.env.TsaConstants;
 import com.style24.persistence.domain.Delivery;
-import com.style24.core.biz.service.TscOrderChangeService;
 import com.style24.core.biz.service.TscWmsService;
 import com.style24.core.biz.service.TscDeliveryService;
 import com.style24.persistence.domain.WmsDelivery;
@@ -24,6 +23,10 @@ import com.style24.core.support.env.TscConstants.OrderDetailStat;
 import com.style24.core.support.message.TscMessageByLocale;
 import com.style24.core.biz.dao.TscOrderDao;
 import com.style24.persistence.domain.Order;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.core.env.Environment;
+import java.io.IOException;
+
 
 
 import lombok.extern.slf4j.Slf4j;
@@ -59,7 +62,11 @@ public class TsaDeliveryService {
 	@Autowired
 	private TscDeliveryService coreDeliveryService;	
 	
+	@Autowired
+	private RestTemplate restTemplate;
 	
+	@Autowired
+	private Environment env;
 	
 	/**
 	 * 배송 목록 건수

+ 28 - 12
src/main/java/com/style24/admin/biz/service/TsaWithdrawService.java

@@ -67,8 +67,34 @@ public class TsaWithdrawService {
 	//@Autowired
 	//private TsaKakaoService kakaoService;
 
+	/**
+	 * 환불관리 목록 건수
+	 *
+	 * @param Delivery
+	 * @return
+	 * @author moon
+	 * @since 2021. 05. 03
+	 */
+	public int getRefundListCount(Withdraw withdraw) {
+		return withdrawDao.getRefundListCount(withdraw);
+	}
+	
+	
+	
+	/**
+	 * 환불관리 목록
+	 *
+	 * @param withdraw
+	 * @return Collection<Withdraw>
+	 * @author moon
+	 * @since 2020. 11. 16
+	 */
+	public Collection<Withdraw> getRefundList(Withdraw withdraw) {
+		return withdrawDao.getRefundList(withdraw);
+	}
+	
+	
 	
-
 	/**
 	 * 회수예외 목록 건수
 	 *
@@ -222,17 +248,7 @@ public class TsaWithdrawService {
 //		return withdrawDao.getWdInvoiceNo(withdraw);
 //	}
 
-	/**
-	 * 환불관리 목록
-	 *
-	 * @param withdraw
-	 * @return Collection<Withdraw>
-	 * @author moon
-	 * @since 2020. 11. 16
-	 */
-	public Collection<Withdraw> getRefundList(Withdraw withdraw) {
-		return withdrawDao.getRefundList(withdraw);
-	}
+
 
 	/**
 	 * 환불관리 회수데이터 삭제처리

+ 1 - 2
src/main/java/com/style24/admin/biz/web/TsaDeliveryController.java

@@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.servlet.ModelAndView;
 
@@ -186,7 +185,7 @@ public class TsaDeliveryController extends TsaBaseController {
 			throw new IllegalStateException(message.getMessage("FAIL_1002"));
 		}
 		deliveryService.cancelSoldout(deliveryList);
-	
+
 		return super.ok(message.getMessage("SUCC_0004"));
 	}
 	

+ 162 - 143
src/main/java/com/style24/admin/biz/web/TsaWithdrawController.java

@@ -59,6 +59,168 @@ public class TsaWithdrawController extends TsaBaseController {
 	@Autowired
 	private TsaWmsWithdrawService wmsWithdrawService;
 
+	
+	/**
+	 * 환불관리 목록 화면
+	 * 
+	 * @return
+	 * @throws Exception
+	 * @author moon
+	 * @since 2020. 11. 16
+	 */
+	@RequestMapping(value = "/refund/form")
+	public ModelAndView withdrawRefundForm() throws Exception {
+		ModelAndView mav = new ModelAndView();
+
+		// 사이트구분
+		mav.addObject("siteCdList", rendererService.getAvailCommonCodeList("G000"));
+
+		mav.setViewName("withdraw/RefundRegisterListForm");
+
+		return mav;
+	}
+
+	/**
+	 * 환불관리 목록
+	 * 
+	 * @param  withdraw
+	 * @return Collection<Withdraw>
+	 * @author moon
+	 * @since 2020. 11. 16
+	 */
+	@PostMapping("/refund/list")
+	@ResponseBody
+	public GagaMap getRefundList(@RequestBody Withdraw withdraw) {
+		
+		GagaMap result = new GagaMap();
+		withdraw.setPageable(new TscPageRequest(withdraw.getPageNo() - 1, withdraw.getPageSize()));
+		withdraw.getPageable().setTotalCount(withdrawService.getRefundListCount(withdraw));
+		if ("N".equals(withdraw.getPageingYn())) {
+			withdraw.setPageable(null);
+		}
+		result.set("pageing", withdraw);
+		result.set("refundList", withdrawService.getRefundList(withdraw));
+		
+		
+		return result;
+	}
+	
+	
+	/**
+	 * 회수예외관리 화면 
+	 *
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author moon
+	 * @since 2021. 02. 19
+	 */
+	@GetMapping("/exception/form")
+	@ResponseBody
+	public ModelAndView withdrawExceptionListForm() throws Exception {
+		ModelAndView mav = new ModelAndView();
+		
+		mav.setViewName("/withdraw/WithdrawExceptionListForm");
+
+		return mav;
+	}
+	
+	/**
+	 * 회수예외관리 조회 
+	 * 
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author moon
+	 * @since 2021. 03. 04
+	 */
+	@PostMapping("/exception/list")
+	@ResponseBody
+	public GagaMap getWithdrawExceptionList(@RequestBody WithdrawExc withdrawExc) throws Exception {
+		
+		GagaMap result = new GagaMap();
+		withdrawExc.setPageable(new TscPageRequest(withdrawExc.getPageNo() - 1, withdrawExc.getPageSize()));
+		withdrawExc.getPageable().setTotalCount(withdrawService.getWithdrawExceptionListCount(withdrawExc));
+		if ("N".equals(withdrawExc.getPageingYn())) {
+			withdrawExc.setPageable(null);
+		}
+		result.set("pageing", withdrawExc);
+		result.set("withdrawExceptionList", withdrawService.getWithdrawExceptionList(withdrawExc));
+		
+
+		return result;
+	}
+	
+	
+	/**
+	 * 회수예외관리 - 완료처리
+	 * 
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author moon
+	 * @since 2021. 03. 04
+	 */
+	@PostMapping("/exception/complete")
+	@ResponseBody
+	public GagaResponse updateWithdrawException(@RequestBody WithdrawExc withdrawExc) {
+		withdrawService.createWithdrawInfo(withdrawExc);
+		
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+	
+	
+	/**
+	 * WMS회수목록 화면 
+	 *
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author moon
+	 * @since 2021. 03. 10
+	 */
+	@GetMapping("/wms/list/form")
+	@ResponseBody
+	public ModelAndView wmsWithdrawListForm() throws Exception {
+		ModelAndView mav = new ModelAndView();
+		
+		mav.setViewName("/withdraw/WmsWithdrawListForm");
+
+		return mav;
+	}
+	
+	/**
+	 *WMS회수목록 조회 
+	 * 
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author moon
+	 * @since 2021. 03. 10
+	 */
+	@PostMapping("/wms/list")
+	@ResponseBody
+	public GagaMap getWmsWithdrawList(@RequestBody WmsWithdraw wmsWithdraw) throws Exception {
+		
+		GagaMap result = new GagaMap();
+		wmsWithdraw.setPageable(new TscPageRequest(wmsWithdraw.getPageNo() - 1, wmsWithdraw.getPageSize()));
+		wmsWithdraw.getPageable().setTotalCount(wmsWithdrawService.getWmsWithdrawListCount(wmsWithdraw));
+		if ("N".equals(wmsWithdraw.getPageingYn())) {
+			wmsWithdraw.setPageable(null);
+		}
+		result.set("pageing", wmsWithdraw);
+		Collection<WmsWithdraw> wmsList = wmsWithdrawService.getWmsWithdrawList(wmsWithdraw);
+		
+		wmsList = withdrawService.getOptionInfo(wmsList);
+		
+		result.set("wmsWithdrawList", wmsList);
+		
+
+		return result;
+	}	
+	
+	
+	
 	/**
 	 * 회수등록 화면
 	 * 
@@ -179,39 +341,7 @@ public class TsaWithdrawController extends TsaBaseController {
 //		return super.ok(message.getMessage("SUCC_0002"));
 //	}
 
-	/**
-	 * 환불관리 목록 화면
-	 * 
-	 * @return
-	 * @throws Exception
-	 * @author moon
-	 * @since 2020. 11. 16
-	 */
-	@RequestMapping(value = "/refund/form")
-	public ModelAndView withdrawRefundForm() throws Exception {
-		ModelAndView mav = new ModelAndView();
 
-		// 사이트구분
-		mav.addObject("siteCdList", rendererService.getAvailCommonCodeList("G000"));
-
-		mav.setViewName("withdraw/RefundRegisterListForm");
-
-		return mav;
-	}
-
-	/**
-	 * 환불관리 목록
-	 * 
-	 * @param  withdraw
-	 * @return Collection<Withdraw>
-	 * @author moon
-	 * @since 2020. 11. 16
-	 */
-	@PostMapping("/refund/list")
-	@ResponseBody
-	public Collection<Withdraw> getRefundList(@RequestBody Withdraw withdraw) {
-		return withdrawService.getRefundList(withdraw);
-	}
 
 	/**
 	 * 환불관리 회수 데이터 삭제처리
@@ -432,116 +562,5 @@ public class TsaWithdrawController extends TsaBaseController {
 //	}
 
 	
-	/**
-	 * 회수예외관리 화면 
-	 *
-	 * @param
-	 * @return
-	 * @throws Exception
-	 * @author moon
-	 * @since 2021. 02. 19
-	 */
-	@GetMapping("/exception/form")
-	@ResponseBody
-	public ModelAndView withdrawExceptionListForm() throws Exception {
-		ModelAndView mav = new ModelAndView();
-		
-		mav.setViewName("/withdraw/WithdrawExceptionListForm");
-
-		return mav;
-	}
-	
-	/**
-	 * 회수예외관리 조회 
-	 * 
-	 * @param
-	 * @return
-	 * @throws Exception
-	 * @author moon
-	 * @since 2021. 03. 04
-	 */
-	@PostMapping("/exception/list")
-	@ResponseBody
-	public GagaMap getWithdrawExceptionList(@RequestBody WithdrawExc withdrawExc) throws Exception {
-		
-		GagaMap result = new GagaMap();
-		withdrawExc.setPageable(new TscPageRequest(withdrawExc.getPageNo() - 1, withdrawExc.getPageSize()));
-		withdrawExc.getPageable().setTotalCount(withdrawService.getWithdrawExceptionListCount(withdrawExc));
-		if ("N".equals(withdrawExc.getPageingYn())) {
-			withdrawExc.setPageable(null);
-		}
-		result.set("pageing", withdrawExc);
-		result.set("withdrawExceptionList", withdrawService.getWithdrawExceptionList(withdrawExc));
-		
-
-		return result;
-	}
-	
-	
-	/**
-	 * 회수예외관리 - 완료처리
-	 * 
-	 * @param
-	 * @return
-	 * @throws Exception
-	 * @author moon
-	 * @since 2021. 03. 04
-	 */
-	@PostMapping("/exception/complete")
-	@ResponseBody
-	public GagaResponse updateWithdrawException(@RequestBody WithdrawExc withdrawExc) {
-		withdrawService.createWithdrawInfo(withdrawExc);
-		
-		return super.ok(message.getMessage("SUCC_0001"));
-	}
-	
-	
-	/**
-	 * WMS회수목록 화면 
-	 *
-	 * @param
-	 * @return
-	 * @throws Exception
-	 * @author moon
-	 * @since 2021. 03. 10
-	 */
-	@GetMapping("/wms/list/form")
-	@ResponseBody
-	public ModelAndView wmsWithdrawListForm() throws Exception {
-		ModelAndView mav = new ModelAndView();
-		
-		mav.setViewName("/withdraw/WmsWithdrawListForm");
-
-		return mav;
-	}
-	
-	/**
-	 *WMS회수목록 조회 
-	 * 
-	 * @param
-	 * @return
-	 * @throws Exception
-	 * @author moon
-	 * @since 2021. 03. 10
-	 */
-	@PostMapping("/wms/list")
-	@ResponseBody
-	public GagaMap getWmsWithdrawList(@RequestBody WmsWithdraw wmsWithdraw) throws Exception {
-		
-		GagaMap result = new GagaMap();
-		wmsWithdraw.setPageable(new TscPageRequest(wmsWithdraw.getPageNo() - 1, wmsWithdraw.getPageSize()));
-		wmsWithdraw.getPageable().setTotalCount(wmsWithdrawService.getWmsWithdrawListCount(wmsWithdraw));
-		if ("N".equals(wmsWithdraw.getPageingYn())) {
-			wmsWithdraw.setPageable(null);
-		}
-		result.set("pageing", wmsWithdraw);
-		Collection<WmsWithdraw> wmsList = wmsWithdrawService.getWmsWithdrawList(wmsWithdraw);
-		
-		wmsList = withdrawService.getOptionInfo(wmsList);
-		
-		result.set("wmsWithdrawList", wmsList);
-		
 
-		return result;
-	}	
 }

+ 49 - 0
src/main/java/com/style24/persistence/domain/Withdraw.java

@@ -3,6 +3,7 @@ package com.style24.persistence.domain;
 import lombok.Data;
 
 import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TscPageRequest;
 
 /**
  * 회수 Domain
@@ -14,6 +15,53 @@ import com.style24.persistence.TscBaseDomain;
 @Data
 public class Withdraw extends TscBaseDomain {
 
+	// 페이징 
+	private String pageingYn;
+	private int startRow;
+	private int endRow;
+	private TscPageRequest pageable;
+	private int pageNo = 1;
+	private int pageSize = 50;
+	private int pageUnit = 10;
+	private int rnum;
+	
+	
+	// 환불컨펌 
+
+	private String wdInvoiceNo; 
+	private String rfndStat; 
+	private String wdGb;
+	private String ordNm;
+	private String ordPhnno;
+	private String senderNm;
+	private String senderPhnno;
+	private String arrivalDt;
+	private String wdEddt;
+	private String wdMemo;
+	private String goodsCd;
+	private String optCd1;
+	private String optCd2;
+
+	private String chgMemo;
+	private String chgReason;
+	private String completeDt;
+	
+	private Integer ordNo;
+	private Integer ordDtlNo; 
+	private Integer ordChgSq;
+	
+	private int chgQty;
+	private int wdQty;
+	
+	private String stDate;					// 조회 시작 기간
+	private String edDate;					// 조회 종료 기간
+	private String searchType;
+	private String withdrawType;
+	
+	
+	
+	
+	/*
 	// 회수
 	private String wdInvoiceNo;				// 회수송장번호
 	private String senderNm;				// 발송자 명
@@ -247,5 +295,6 @@ public class Withdraw extends TscBaseDomain {
 	private int orgRealOrdAmt;
 	private int itemQty;	// 단품수량
 	private int itemPrice;	// 단품단가
+	*/
 
 }

+ 8 - 5
src/main/java/com/style24/persistence/mybatis/shop/TsaDelivery.xml

@@ -276,7 +276,7 @@
             </foreach>
         </if>
 		<if test='orderNm != null and orderNm != ""'>
-		AND   A.ORDER_NM = #{orderNm}
+		AND   A.ORD_NM = #{orderNm}
 		</if>
 		<if test='orderPhnno != null and orderPhnno != ""'>
 		AND   REPLACE(A.ORDER_PHNNO, '-', '') = REPLACE(#{orderPhnno}, '-', '')
@@ -288,13 +288,16 @@
 		AND (
 		<choose>
 		     <when test='search != null and search == "searchOrdNo"'>
-		         <foreach collection="conditions" item="item" index="index" separator="or">
-		      ORD_NO REGEXP CONCAT('[',#{item},']')  
+		         A.ORD_NO IN 
+		          <foreach collection="conditions" item="item" index="index"  open="(" close=")" separator=",">
+		      		#{item}
 		         </foreach>
+		     
 		     </when>
 		     <when test='search != null and search == "searchExtmallOrderId"'>
-		         <foreach collection="conditions" item="item" index="index" separator="or">
-		      EXTMALL_ORDER_ID REGEXP CONCAT('[',#{item},']')      
+		         B.EXTMALL_ORDER_ID IN 
+		         <foreach collection="conditions" item="item" index="index"  open="(" close=")" separator=",">
+		      		#{item}
 		         </foreach>
 		      </when>
 		</choose>

+ 104 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaWithdraw.xml

@@ -16,7 +16,111 @@
 		</choose>
 	</sql>
 	
+	<!-- 환불관리 목록 건수 -->
+	<select id="getRefundListCount" parameterType="WithdrawExc" resultType="int">
+		/* TsaWithdraw.getRefundListCount */
+		SELECT COUNT(*) AS TOTCNT
+		  FROM (
+			SELECT
+				  O.ORD_NO        -- 주문번호
+				, C.ORD_DTL_NO    -- 주문상세번호 
+				, D.ORD_CHG_SQ    -- 주문변경일련번호 
+			  FROM TB_WITHDRAW A
+			  JOIN TB_WITHDRAW_DETAIL B ON A.WD_INVOICE_NO  = B.WD_INVOICE_NO AND A.ORD_CHG_SQ = B.ORD_CHG_SQ 
+			  JOIN TB_ORDER_CHANGE_DETAIL C ON B.ORD_CHG_SQ = C.ORD_CHG_SQ AND B.ORD_DTL_NO = C.ORD_DTL_NO AND C.DEL_YN ='N'
+			  JOIN TB_ORDER_CHANGE        D ON C.ORD_CHG_SQ = D.ORD_CHG_SQ 
+			  JOIN TB_ORDER_DETAIL        O ON B.ORD_DTL_NO = O.ORD_DTL_NO 
+			  JOIN TB_ORDER               I ON O.ORD_NO = I.ORD_NO
+			 WHERE D.CHG_GB  = 'G680_30' -- 반품요청
+			 <include refid="getRefundListCondition_sql"/>
+			 	
+			) A	
+		
+	</select>
+
+	<!-- 환불관리 목록  -->
+	<select id="getRefundList" parameterType="WmsWithdraw" resultType="WmsWithdraw">
+		/* TsaWithdraw.getRefundList */
+		
+		SELECT Z.*
+		    , FN_GET_CODE_NM('G688', Z.CHG_REASON) AS CHG_REASON -- 요청사유   
+		FROM (
+		    SELECT A.*, ROW_NUMBER() OVER(ORDER BY  A.ORD_NO DESC, A.ORD_DTL_NO) RNUM 
+		    FROM (
+				SELECT
+					  O.ORD_NO        -- 주문번호
+					, C.ORD_DTL_NO    -- 주문상세번호 
+					, A.WD_INVOICE_NO -- 회수송장번호	
+					, CASE WHEN C.COMPLETE_DT IS NOT NULL THEN '환불완료' ELSE '환불대기' END AS RFND_STAT -- 환불상태 
+					, CASE WHEN D.WD_GB = 'W' THEN '회수요청' ELSE '직접배송' END AS WD_GB   -- 회수구분(W:회수요청, D:직접배송)
+					, D.ORD_CHG_SQ    -- 주문변경일련번호 
+					, I.ORD_NM        -- 주문자명
+					, I.ORD_PHNNO     -- 주문자연락처	
+					, A.SENDER_NM     -- 보내는사람
+					, A.SENDER_PHNNO  -- 보낸연락처
+					, A.ARRIVAL_DT    -- 도착일시
+					, D.WD_EDDT       -- 환불확정일자
+					, A.WD_MEMO       -- wms회수메모
+					, B.GOODS_CD      -- 상품코드
+					, B.OPT_CD1       -- 옵션1
+					, B.OPT_CD2       -- 옵션2
+					, C.CHG_QTY       -- 반품수량
+					, B.WD_QTY        -- 회수수량
+					, d.CHG_MEMO      -- 클레임메모
+					, D.CHG_REASON    -- 요청사유 
+					, C.COMPLETE_DT   -- 반품완료일자 
+				  FROM TB_WITHDRAW A
+				  JOIN TB_WITHDRAW_DETAIL B ON A.WD_INVOICE_NO  = B.WD_INVOICE_NO AND A.ORD_CHG_SQ = B.ORD_CHG_SQ 
+				  JOIN TB_ORDER_CHANGE_DETAIL C ON B.ORD_CHG_SQ = C.ORD_CHG_SQ AND B.ORD_DTL_NO = C.ORD_DTL_NO AND C.DEL_YN ='N'
+				  JOIN TB_ORDER_CHANGE        D ON C.ORD_CHG_SQ = D.ORD_CHG_SQ 
+				  JOIN TB_ORDER_DETAIL        O ON B.ORD_DTL_NO = O.ORD_DTL_NO 
+				  JOIN TB_ORDER               I ON O.ORD_NO = I.ORD_NO
+				 WHERE D.CHG_GB  = 'G680_30' -- 반품요청		
+				 <include refid="getRefundListCondition_sql"/>
+		<include refid="getListPagingCondition_sql"/>
+	</select>
+	
 
+    <!-- 환불관리 목록 조회 조건  -->
+	<sql id="getRefundListCondition_sql">
+		<if test="stDate != null and stDate != '' and edDate != null and edDate != ''">
+			<if test="searchType == 'withdrawDt'"> -- 회수등록일자
+			AND    B.REG_DT BETWEEN STR_TO_DATE(REPLACE(#{stDate},'-',''), '%Y%m%d%H%i%s') AND STR_TO_DATE(REPLACE(#{edDate},'-','') +1, '%Y%m%d%H%i%s')
+			</if>
+			<if test="searchType == 'returnDt'">   -- 반품접수일자
+			AND    D.REG_DT BETWEEN STR_TO_DATE(REPLACE(#{stDate},'-',''), '%Y%m%d%H%i%s') AND STR_TO_DATE(REPLACE(#{edDate},'-','') +1, '%Y%m%d%H%i%s')
+			</if>
+			<if test="searchType == 'confirmDt'">  -- 반품완료일자
+			AND    D.WD_EDDT BETWEEN STR_TO_DATE(REPLACE(#{stDate},'-',''), '%Y%m%d%H%i%s') AND STR_TO_DATE(REPLACE(#{edDate},'-','') +1, '%Y%m%d%H%i%s')
+			</if>
+		</if>
+		<if test="ordNo != null and ordNo != ''">
+			AND O.ORD_NO = #{ordNo}
+		</if>
+		<if test="wdInvoiceNo != null and wdInvoiceNo != ''">
+			AND A.WD_INVOICE_NO = #{wdInvoiceNo}
+		</if>
+		<if test="withdrawType != null and withdrawType != ''">
+			<choose>
+				<when test='withdrawType == "N"'> -- 환불대기
+				AND C.COMPLETE_DT IS NULL
+				</when>
+				<when test='withdrawType == "Y"'> -- 환불완료
+				AND C.COMPLETE_DT IS NOT NULL
+				</when>
+			</choose>
+		</if>
+		<if test="goodsCd != null and goodsCd != ''">
+			AND B.GOODS_CD = #{goodsCd}
+		</if>
+		<if test="ordNm != null and ordNm != ''">
+			AND I.ORD_NM = #{ordNm}
+		</if>
+		<if test="senderNm != null and senderNm != ''">
+			AND A.SENDER_NM = #{senderNm}
+		</if>
+	</sql>
+	
 	<!-- 회수예외목록 건수 -->
 	<select id="getWithdrawExceptionListCount" parameterType="WithdrawExc" resultType="int">
 		/* TsaWithdraw.getWithdrawExceptionListCount */

+ 12 - 9
src/main/webapp/WEB-INF/views/delivery/DeliveryListForm.html

@@ -141,10 +141,10 @@
 						<th>주문상세상태</th>
 						<td>
 							<div class="multiCheckBox" style="width:270px">
-								<button type="button" class="sltBtn" style="overflow-x: hidden; padding-right:5px;">[전체]</button>
-								<ul style="display: none; box-shadow: 3px 3px 3px; overflow-y: scroll; height: 112px;">
+								<button type="button" class="sltBtn" data-name="[전체]" style="overflow-x: hidden; padding-right:5px;">[전체]</button>
+								<ul style="display: none; box-shadow: 3px 3px 3px; overflow-y: scroll; height: 112px;" id="group1">
 									<li th:if="${ordDtlStatList}" th:each="oneData, status : ${ordDtlStatList}">
-										<label class="chkBox">
+										<label class="chkBox" data-group="group1">
 											<input type="checkbox" name="multiOrdDtlStat" th:value="${oneData.cd}" th:text="|[${oneData.cd}] ${oneData.cdNm}|">
 										</label>
 									</li>
@@ -327,8 +327,9 @@
 		{headerName: "송장등록수정", 	field: "invoiceNo", 	width: 120, cellClass: 'text-center'
 			, cellRenderer : function (params) {
 				var buttonTag = '';
-				if (params.data.ordDtlStat === 'G013_30' || params.data.ordDtlStat === 'G013_40' || params.data.ordDtlStat === 'G013_50' || params.data.ordDtlStat === 'G013_55') {
+				if (params.data.ordDtlStat == 'G013_30' || params.data.ordDtlStat == 'G013_40' || params.data.ordDtlStat == 'G013_50' || params.data.ordDtlStat == 'G013_55') {
 					buttonTag = '<button type="button"class="btn btn-success" onClick="fnSaveInvoiceNo('+params.data.ordDtlNo+');">송장등록수정</button>';
+				
 				}
 				return buttonTag;
 			}
@@ -336,8 +337,9 @@
 		{headerName: "배송완료처리", 	field: "ordDtlStat", width: 120, cellClass: 'text-center'
 			, cellRenderer: function(params) {
 				var buttonTag = '';
-				if (params.data.ordDtlStat === 'G013_50' || params.data.ordDtlStat === 'G013_55'  ) {
-					buttonTag = '<button type="button"class="btn btn-success" onClick="deliveryComplete('+params.data.ordDtlStat+', '+params.data.ordNo+', '+params.data.ordDtlNo+');">배송완료</button>';
+				if (params.value == 'G013_50' || params.value == 'G013_55'  ) {
+					buttonTag = '<button type="button"class="btn btn-success" onClick="deliveryComplete(\''+params.data.ordNo+ '\' , \''+params.data.ordDtlNo+'\' , \'' + params.data.ordDtlStat + '\');">배송완료</button>';
+					
 				}
 				return buttonTag;
 			}
@@ -462,6 +464,7 @@
 	* 품절처리
 	**************************************************************************/		
 	$('#btnSoldout').on('click', function () {
+		alert("1");
 		var selectedData = gridOptions.api.getSelectedRows();
 
 		if (selectedData.length == 0) {
@@ -469,7 +472,6 @@
 			return;
 		}
 		
-		return;
 		mcxDialog.confirm('품절 처리하시겠습니까?', {
 			cancelBtnText: "취소",
 			sureBtnText: "확인",
@@ -488,7 +490,8 @@
 	/*************************************************************************
 	* 배송완료처리 -수동
 	**************************************************************************/		
-	var deliveryComplete = function (orgOrdDtlStat, ordNo, ordDtlNo) {
+	var deliveryComplete = function (ordNo,ordDtlNo, odStat) {
+		
 		mcxDialog.confirm('배송완료 처리를 하시겠습니까?', {
 			cancelBtnText: "취소",
 			sureBtnText: "확인",
@@ -496,7 +499,7 @@
 				var jsonData = {
 					"ordNo": ordNo,
 					"ordDtlNo": ordDtlNo,
-					"orgOrdDtlStat": orgOrdDtlStat
+					"orgOrdDtlStat": odStat
 				};
 				var tranData = JSON.stringify(jsonData);
 				gagajf.ajaxJsonSubmit('/delivery/complete/save', tranData, fnSearchList);

+ 105 - 71
src/main/webapp/WEB-INF/views/withdraw/RefundRegisterListForm.html

@@ -24,10 +24,12 @@
 		<div class="infoBox menu-desc">
 		</div>
 		<!-- //메뉴 설명 -->
+		
+		<form id="searchForm" name="searchForm" action="#" th:action="@{'/withdraw/refund/list'}" onsubmit="fnSearch(); return false;" >
 		<div class="panelStyle">
 			<!-- TITLE -->
 			<div class="panelTitle">
-				<h3><i class="fa fa-info-circle"></i>아래 검색조건 중 <font color="red">기간, 키워드</font>중 하나를 꼭 입력해 주세요.</h3>
+				<h3><i class="fa fa-info-circle"></i>아래 검색조건 중 <font color="red">구분</font>은 꼭 입력해 주세요.</h3>
 				<span class="panelControl">
 					<i class="fa fa-chevron-up"></i>
 				</span>
@@ -35,7 +37,7 @@
 			<!-- //TITLE -->
 			<div class="panelContent">
 
-				<form id="searchForm" name="searchForm" action="#">
+				
 					<table class="frmStyle">
 						<colgroup>
 							<col style="width:10%" />
@@ -45,12 +47,12 @@
 						</colgroup>
 						<tbody>
 							<tr>
-								<th>구분</th>
+								<th>구분<em class="required" title="필수"></em></th>
 								<td colspan="3">
 									<select id="searchType" name="searchType">
 										<option value="withdrawDt">회수등록일자</option>
-										<option value="returnDt">교환/반품신청일자</option>
-										<option value="confirmDt">회수확정일자</option>
+										<option value="returnDt">반품신청일자</option>
+										<option value="confirmDt">반품완료일자</option>
 									</select>
 									<span id="terms">
 										<input type="text" class="schDate w100" id="stDate" name="stDate" maxlength="10"/>
@@ -70,13 +72,12 @@
 								</td>
 							</tr>
 							<tr>
-								<th>회수상태</th>
+								<th>환불상태</th>
 								<td >
 									<select id="withdrawType" name="withdrawType">
 										<option value="">전체</option>
-										<option value="B">교환/반품접수완료(실물입고)</option>
-										<option value="A">교환/반품접수대기(실물입고)</option>
-										<option value="D">회수컨펌완료</option>
+										<option value="N" selected>환불대기</option>
+										<option value="Y">환불완료</option>
 									</select>
 								</td>
 								<th>상품코드</th>
@@ -85,19 +86,13 @@
 								</td>
 							</tr>
 							<tr>
-								<th>회수컨펌지연일</th>
+								<th>주문자명</th>
 								<td>
-									<input type="text" class="w50" id="delayDt" name="delayDt" value="" data-valid-type="numeric"/>일
-									<select id="delayDtType" name="delayDtType">
-										<option value="U">이상</option>
-										<option value="D">미만</option>
-									</select>
+									<input type="text" id="ordNm" name="ordNm" class="w200" />
 								</td>
-								<th>등록ID</th>
+								<th>보내는사람</th>
 								<td>
-									<select id="regId" name="regId">
-										<option value="">[전체]</option>
-									</select>
+									<input type="text" id="senderNm" name="senderNm" class="w200" />
 								</td>
 							</tr>
 						</tbody>
@@ -108,67 +103,68 @@
 						<button type="button" class="btn btn-base btn-lg btn-lg" id="btnSearch">조회</button>
 						</li>
 					</ul>
-	
-				</form>
 			</div>
 		</div>
+		<!-- 리스트 영역 -->
 		<div class="panelStyle">
-			<div class="panelContent" style="overflow: hidden;">
-				<div id="gridList" style="width:100%; height: 570px;" class="ag-theme-balham"></div>
-			</div>
+			<ul class="panelBar">
+				<li class="right">
+					검색결과 : <strong><span id="gridRowTotalCount">0</span> 건</strong>&nbsp;
+					쪽번호 <span id="pgNo">0</span>/ <strong id="endPgNo">0</strong>&nbsp;&nbsp;
+					<select id="pageSize" name="pageSize">
+						<option value="20" selected="selected">20개씩 보기</option>
+						<option value="50">50개씩 보기</option>
+						<option value="100">100개씩 보기</option>
+						<option value="500">500개씩 보기</option>
+						<option value="1000">1000개씩 보기</option>
+					</select>
+					<input type="hidden" name="pageNo" id="pageNo" value ="1"/>
+				</li>
+			</ul>		
+			
+			<div id="gridList" style="width:100%; height: 570px;" class="ag-theme-balham"></div>
+			<ul class="panelBar">
+				<li class="center">
+					<div class="tablePaging" id="withdrawExceptionListPagination"></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[*/
 	// specify the columns
 	var columnDefs = [
-// 		주문자 미상 사용 할 경우 주석 풀 것.
-		{headerName: "", field: "delete", width: 70, minWidth: 60, cellClass: 'text-center',
-			cellRenderer: function(params) {
-				if (params.data.chgGb == "미상") {
-					return '<button type="button" class="btn btn-danger btn-sm" onclick="fnWithdrawDelete(\'' + params.data.wdInvoiceNo + '\' , \'' + params.data.goodsCd + '\' , \'' + params.data.sizeCd +'\');">삭제</button>';
-				} else {
-					return params.value;
-				}
-			}
-		},
-		{headerName: "회수지연일", 	field: "delayDt", 	width: 120, minWidth: 100, cellClass: 'text-center'},
-		{headerName: "회수구분", 		field: "chgGb", 	width: 120, minWidth: 100, cellClass: 'text-center'},
-		{headerName: "주문변경일련번호", field: "ordChgSq", 	width: 130, minWidth: 100, cellClass: 'text-center'},
-		{headerName: "주문번호", 		field: "ordNo", 	width: 130, minWidth: 190, cellClass: 'text-center'},
-		{headerName: "변경요청주문번호", field: "ordChgSq", 	width: 100, minWidth: 100, cellClass: 'text-center',
+		{headerName: "환불상태 ",		field: "rfndStat",	width: 80, minWidth: 100, cellClass: 'text-center'},
+		{headerName: "회수구분", 		field: "wdGb",		width: 80, minWidth: 100, cellClass: 'text-center'},
+		{headerName: "주문번호", 		field: "ordNo",		width: 100, minWidth: 190, cellClass: 'text-center'},
+		{headerName: "주문상세번호", 	field: "ordDtlNo",	width: 100, minWidth: 190, cellClass: 'text-center'},
+		{headerName: "반품요청일련번호", field: "ordChgSq",	width: 120, minWidth: 100, cellClass: 'text-center',
 			cellRenderer: function(params) {
-				if (gagajf.isNull(params.value)) { // 주문자 미상일 경우
-					if (gagajf.isNull(params.data.orgGoodsCd)) {
-						return "오반품";
-					} else {
-						return "<a href=\"javascript:void(0);\" class=\"btn btn-danger btn-sm\">회수등록</a>";
-					}
-				} else {
-					if (params.data.delayDt == '컨펌완료') {
-						return "<a href=\"javascript:void(0);\" class=\"btn btn-dark btn-sm\">컨펌완료</a>";
-					}else{
-						return "<a href=\"javascript:void(0);\" class=\"btn btn-base btn-sm\">회수컨펌</a>";
-					}
+				if (params.data.rfndStat == '환불완료') {
+					return "<a href=\"javascript:void(0);\" class=\"btn btn-dark btn-sm\">환불완료</a>";
+				}else{
+					return "<a href=\"javascript:void(0);\" class=\"btn btn-base btn-sm\">환불컨펌</a>";
 				}
 			}
 		},
-		{headerName: "회수송장번호", 	field: "wdInvoiceNo", 	width: 150, minWidth: 100, cellClass: 'text-center'},
-		{headerName: "접수송장번호", 	field: "invoiceNo", 	width: 150, minWidth: 100, cellClass: 'text-center'},
+		{headerName: "회수송장번호", 	field: "wdInvoiceNo", 	width: 100, minWidth: 100, cellClass: 'text-center'},
 		{headerName: "보내는사람", 	field: "senderNm", 		width: 100, minWidth: 100, cellClass: 'text-center'},
-		{headerName: "요청성명", 		field: "chgerNm",		width: 100, minWidth: 100, cellClass: 'text-center'},
-		{headerName: "보낸연락처", 	field: "senderPhnno", 	width: 150, minWidth: 100, cellClass: 'text-center'},
-		{headerName: "도착일시", 		field: "arrivalDt", 	width: 190, minWidth: 120, cellClass: 'text-center'},
-		{headerName: "회수확정일자", 	field: "wdEddt",	 	width: 190, minWidth: 120, cellClass: 'text-center'},
-		{headerName: "회수메모", 		field: "wdMemo", 		width: 150, minWidth: 100, cellClass: 'text-lecenterft'},
+		{headerName: "보낸연락처", 	field: "senderPhnno", 	width: 120, minWidth: 100, cellClass: 'text-center'},
+		{headerName: "주문자명", 		field: "ordNm",			width: 100, minWidth: 100, cellClass: 'text-center'},
+		{headerName: "주문자연락처", 	field: "ordPhnno",		width: 120, minWidth: 100, cellClass: 'text-center'},
+		{headerName: "도착일시", 		field: "arrivalDt", 	width: 100, minWidth: 120, cellClass: 'text-center'},
+		{headerName: "환불확정일자", 	field: "wdEddt",	 	width: 100, minWidth: 120, cellClass: 'text-center'},
+		{headerName: "WMS회수메모", 	field: "wdMemo", 		width: 200, minWidth: 100, cellClass: 'text-lecenterft'},
 		{headerName: "상품코드", 		field: "goodsCd", 		width: 150, minWidth: 100, cellClass: 'text-center'},
-		{headerName: "사이즈", 		field: "sizeCd", 		width: 80, minWidth: 100, cellClass: 'text-center'},
+		{headerName: "옵션1", 		field: "sizeCd", 		width: 80, minWidth: 100, cellClass: 'text-center'},
+		{headerName: "옵션2", 		field: "sizeCd", 		width: 80, minWidth: 100, cellClass: 'text-center'},
 		{headerName: "반품수량", 		field: "chgQty", 		width: 80, minWidth: 100, cellClass: 'text-center'},
 		{headerName: "회수수량", 		field: "wdQty", 		width: 80, minWidth: 100, cellClass: 'text-center'},
+		{headerName: "요청사유",		field: "chgReason", 	width: 150, minWidth: 100, cellClass: 'text-center'},
 		{headerName: "클레임메모", 	field: "chgMemo", 		width: 200, minWidth: 100, cellClass: 'text-lecenterft'},
-		{headerName: "접수변경요청사유", field: "wdReqReason", 	width: 150, minWidth: 100, cellClass: 'text-center'},
 	];
 
 	// Get GridOptions
@@ -177,11 +173,10 @@
 	// Grid editable
 	withDrawGridOptions.defaultColDef.editable = false;
 
-	//일자조회구분 변경시 처리
-	$('#searchType').on('change', function() {
-		$('#delayDt').val('');
-	});
 
+	/*************************************************************************
+	*  init
+	**************************************************************************/	
 	$(document).ready(function() {
 		cfnCreateCalendar('#terms', 'stDate', 'edDate', true, '조회');
 
@@ -190,20 +185,53 @@
 
 		gagajf.setDate('#terms', 'stDate', 'edDate', '3m');
 
-		//uifnFitGrid('auto');
 	});
 
-	//조회버튼 클릭
+	/*************************************************************************
+	*  조회 버튼 클릭 시
+	**************************************************************************/
 	$('#btnSearch').on('click', function() {
 		fnSearch();
 	});
 
+	/*************************************************************************
+	*  조회 
+	**************************************************************************/	
 	var fnSearch = function() {
-		var formId = '#searchForm';
-		gagaAgGrid.fetch("/withdraw/refund/list", withDrawGridOptions, formId);
+		var searchNm = $('#searchType option:selected').text();
+		
+		if($('#stDate').val() == ''){
+			mcxDialog.alert(searchNm+' 시작 기간을 입력하세요.');
+			return;
+		}
+
+		if($('#edDate').val() == ''){
+			mcxDialog.alert(searchNm+' 종료 기간을 입력하세요.');
+			return;
+		}
+		
+		gagaPaging.init('searchForm', fnSearchCallBack, 'withdrawExceptionListPagination', $('#searchForm').find('#pageSize').val());
+	    gagaPaging.load($("#searchForm input[name=pageNo]").val());
+	    
 	};
 
-	// cell Click
+	/*************************************************************************
+	*  조회 콜백
+	**************************************************************************/
+	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());
+		withDrawGridOptions.api.setRowData(result.refundList);
+		gagaPaging.createPagination(result.pageing.pageable);
+		
+	}
+	
+	/*************************************************************************
+	*  cell Click
+	**************************************************************************/	
 	withDrawGridOptions.onCellClicked = function(event) {
 		if (event.colDef.field != 'ordChgSq') return;
 
@@ -214,7 +242,10 @@
 		} 
 	}
 
-	// 회수 상세 화면
+
+	/*************************************************************************
+	*  회수 상세 화면
+	**************************************************************************/		
 	var detailPopup = function(ordChgSq, ordNo) {
 		if (ordChgSq == 0) return;
 
@@ -222,6 +253,8 @@
 		cfnOpenModalPopup(actionUrl, "popupWithdrawDetail");
 	}
 
+	
+	/*   회수 삭제 필요성이 현재 없어보임!!!
 	// 회수 삭제
 	var fnWithdrawDelete = function(wdInvoiceNo, goodsCd, sizeCd) {
 		var params = new Object();
@@ -238,6 +271,7 @@
 			}
 		});
 	}
+	*/
 
 /*]]>*/
 </script>

+ 0 - 1
src/main/webapp/WEB-INF/views/withdraw/WithdrawExceptionListForm.html

@@ -108,7 +108,6 @@
 					<div class="tablePaging" id="withdrawExceptionListPagination"></div>
 				</li>
 			</ul>
-					 
 		</div>
 		</form>
 		<!-- //리스트 영역 -->