Преглед изворни кода

Merge branch 'develop' of http://112.172.147.34:4936/style24/style24.admin into develop

card007 пре 5 година
родитељ
комит
712fc876e5

+ 29 - 0
src/main/java/com/style24/admin/biz/dao/TsaWithdrawDao.java

@@ -89,6 +89,35 @@ public interface TsaWithdrawDao {
 	WmsWithdraw getOptionInfo(WmsWithdraw wmswithdraw);
 		
 	
+	/**
+	 * 회수지시 목록 건수
+	 * 
+	 * @param Withdraw
+	 * @return int
+	 * @author moon
+	 * @since 2021. 05. 10
+	 */
+	int getWithdrawDirectiveListCount(Withdraw withdraw);
+
+	/**
+	 * 회수지시 목록 
+	 * 
+	 * @param Withdraw
+	 * @return Collection<WmsWithdraw>
+	 * @author moon
+	 * @since 2021. 05. 10
+	 */
+	Collection<Withdraw> getWithdrawDirectiveList(Withdraw withdraw);
+	
+	/**
+	 * 재회수지시
+	 * 
+	 * @param Withdraw
+	 * @return 
+	 * @author moon
+	 * @since 2021. 05. 11
+	 */
+	void updateReRecallOrder(Withdraw withdraw);
 	
 	
 	/**

+ 66 - 19
src/main/java/com/style24/admin/biz/service/TsaWithdrawService.java

@@ -4,37 +4,23 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import lombok.extern.slf4j.Slf4j;
-
-//import com.gagaframework.web.parameter.GagaMap;
-//import com.gagaframework.web.util.GagaDateUtil;
-
 import com.style24.admin.biz.dao.TsaDeliveryDao;
-//import com.style24.admin.biz.dao.TsaOrderDao;
 import com.style24.admin.biz.dao.TsaWithdrawDao;
-import com.style24.persistence.domain.Delivery;
-//import com.style24.persistence.domain.Coupon;
-//import com.style24.persistence.domain.Delivery;
-//import com.style24.persistence.domain.Order;
-//import com.style24.persistence.domain.PayGate;
-//import com.style24.persistence.domain.Point;
+import com.style24.admin.support.security.session.TsaSession;
+import com.style24.persistence.domain.OrderChange;
 import com.style24.persistence.domain.Withdraw;
 import com.style24.persistence.domain.WithdrawExc;
 import com.style24.persistence.domain.WmsWithdraw;
+import com.style24.core.support.env.TscConstants.OrderChangeStat;
+import com.style24.core.biz.dao.TscOrderChangeDao;
+import com.style24.core.support.env.TscConstants.OrderChangeGb;
 
-//import com.style24.admin.support.env.TsaConstants;
-//import com.style24.admin.support.env.TsaConstants.OrderStat;
-//import com.style24.admin.support.env.TsaConstants.PayMeans;
-//import com.style24.admin.support.env.TsaConstants.PaymentStat;
-//import com.style24.admin.support.env.TsaConstants.PurchaseReturnGb;
-//import com.style24.admin.support.env.TsaConstants.UsacGb;
 
 import com.style24.core.support.message.TscMessageByLocale;
-//import com.style24.admin.support.security.session.TsaSession;
 
 /**
  * 회수관리 Service
@@ -55,6 +41,9 @@ public class TsaWithdrawService {
 	@Autowired
 	private TsaDeliveryDao deliveryDao;
 
+	@Autowired
+	private TscOrderChangeDao orderChangeDao;
+	
 	//@Autowired
 	//private TsaOrderDao orderDao;
 
@@ -152,6 +141,64 @@ public class TsaWithdrawService {
 		return wmsWithdrawList; 
 	}	
 	
+	
+	/**
+	 * 회수지시목록 건수
+	 *
+	 * @param Withdraw
+	 * @return
+	 * @author moon
+	 * @since 2021. 05. 10
+	 */
+	public int getWithdrawDirectiveListCount(Withdraw withdraw) {
+		return withdrawDao.getWithdrawDirectiveListCount(withdraw);
+	}
+	
+	/**
+	 * 회수지시 목록 
+	 *
+	 * @param Withdraw
+	 * @return
+	 * @author moon 
+	 * @since 2021. 05. 10
+	 */
+	public Collection<Withdraw> getWithdrawDirectiveList(Withdraw withdraw) {
+		return withdrawDao.getWithdrawDirectiveList(withdraw);
+	}
+	
+	/**
+	 * 재회수지시
+	 *
+	 * @param Withdraw
+	 * @return void
+	 * @author moon
+	 * @since 2021. 05. 11
+	 */
+	@Transactional("shopTxnManager")
+	public void reRecallOrder(Withdraw withdraw) {
+		Integer userNo = TsaSession.getInfo().getUserNo();
+		withdraw.setUpdNo(userNo);
+		if(OrderChangeGb.RETURN.value().equals(withdraw.getChgGb())) { // 반품요청
+			withdraw.setChgStat(OrderChangeStat.RETURN.value()); // 반품접수
+		} else { //교환요청
+			withdraw.setChgStat(OrderChangeStat.EXCHANGE.value()); // 교환접수 
+		}
+		withdrawDao.updateReRecallOrder(withdraw);
+		
+		// 주문상세변경 이력 
+		OrderChange ordChg = new OrderChange();
+		ordChg.setRegNo(userNo);
+		ordChg.setUpdNo(userNo);
+		ordChg.setOrdChgSq(withdraw.getOrdChgSq()); 
+		ordChg.setOrdDtlNo(withdraw.getOrdDtlNo()); 
+		ordChg.setChgStat(withdraw.getChgStat());
+		orderChangeDao.createOrderChangeDetailHst(ordChg);
+		
+	}
+	
+	
+	
+	
 	/**
 	 * 회수등록 - 조회(송장번호용)
 	 *

+ 70 - 0
src/main/java/com/style24/admin/biz/web/TsaWithdrawController.java

@@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
 import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.rest.server.GagaResponse;
 import com.style24.persistence.TscPageRequest;
+import com.style24.persistence.domain.CommonCode;
 import com.style24.persistence.domain.Delivery;
 import com.style24.persistence.domain.Pos;
 import com.style24.persistence.domain.Withdraw;
@@ -220,6 +221,75 @@ public class TsaWithdrawController extends TsaBaseController {
 	}	
 	
 	
+	/**
+	 * 회수지시목록 화면 
+	 *
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author moon
+	 * @since 2021. 05. 10
+	 */
+	@GetMapping("/directive/form")
+	@ResponseBody
+	public ModelAndView withdrawDirectiveListForm() throws Exception {
+		ModelAndView mav = new ModelAndView();
+
+		mav.addObject("wdShipStateList", rendererService.getAvailCommonCodeList("G320"));
+
+		mav.setViewName("/withdraw/WithdrawDirectiveListForm");
+
+		return mav;
+	}
+	
+	/**
+	 *회수목록 조회 
+	 * 
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author moon
+	 * @since 2021. 05. 10
+	 */
+	@PostMapping("/direct/list")
+	@ResponseBody
+	public GagaMap withdrawDirectiveList(@RequestBody Withdraw withdraw) throws Exception {
+		
+		GagaMap result = new GagaMap();
+		withdraw.setPageable(new TscPageRequest(withdraw.getPageNo() - 1, withdraw.getPageSize()));
+		
+		withdraw.getPageable().setTotalCount(withdrawService.getWithdrawDirectiveListCount(withdraw));
+		
+		if ("N".equals(withdraw.getPageingYn())) {
+			withdraw.setPageable(null);
+		}
+		result.set("pageing", withdraw);
+		log.info("withdraw {}"+withdraw);
+		Collection<Withdraw> list = withdrawService.getWithdrawDirectiveList(withdraw);
+		
+		result.set("directList", list);
+		
+
+		return result;
+	}	
+	
+	/**
+	 * 출고처지정 취소 
+	 *
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author moon
+	 * @since 2020. 04. 20
+	 */
+	@PostMapping("/direct/recallorder")
+	@ResponseBody
+	public GagaResponse reRecallOrder(@RequestBody Withdraw param) throws Exception {
+		withdrawService.reRecallOrder(param);
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+	
+	
 	
 	/**
 	 * 회수등록 화면

+ 28 - 2
src/main/java/com/style24/persistence/domain/Withdraw.java

@@ -25,8 +25,9 @@ public class Withdraw extends TscBaseDomain {
 	private int pageUnit = 10;
 	private int rnum;
 	
+
 	
-	// 환불컨펌 
+	// 회수 
 
 	private String wdInvoiceNo; 
 	private String rfndStat; 
@@ -41,10 +42,32 @@ public class Withdraw extends TscBaseDomain {
 	private String goodsCd;
 	private String optCd1;
 	private String optCd2;
-
 	private String chgMemo;
 	private String chgReason;
 	private String completeDt;
+	private String chgGbNm;
+	private String chgReasonNm;
+	private String wdShipStateNm;
+	private String wdReasonCdNm;
+	private String chgStatNm; 
+	private String chgGb;                               // 변경구분 g680
+	private String wdShipState;                         // 배송업체회수상태 g320
+	private String wdStateDt;                           // 회수상태 수신일시 
+	private String wdReasonCd;                          // 미회수사유 g321 g322
+	private String wdBfSendYn;                          // 교환 선발송 여부 
+	private String sendYn;         					    // 전송여부
+	private String chgStat;                             // 변경상태 g685
+	private String goodsNm;                             // 상품명
+	private String wdStdt;  							// 배송시작일시
+	private String recipNm;        					  	// 수취인명
+	private String chgerNm;                             // 변경자명
+	private String chgerPhnno;                          // 변경자휴대전화번호
+	private String chgerTelno;                          // 변경자전화번호
+	private String chgerZipcode;                        // 변경자우편번호
+	private String chgerBaseAddr;                       // 변경자기본주소
+	private String chgerDtlAddr;                        // 변경자상세주소
+	private String ordTelno;                            // 주문자전화번호
+	private String ordEmail;                            // 주문자이메일	
 	
 	private Integer ordNo;
 	private Integer ordDtlNo; 
@@ -60,6 +83,9 @@ public class Withdraw extends TscBaseDomain {
 	
 	
 	
+								 
+	
+	
 	
 	/*
 	// 회수

+ 10 - 15
src/main/java/com/style24/persistence/mybatis/shop/TsaDelivery.xml

@@ -558,12 +558,11 @@
 						     , O.SITE_CD                                         -- 사이트코드
 						     , O.ORD_NO                                          -- 주문번호
 						     , OD.ORD_DTL_NO                                     -- 주문상세번호
-						     , IT.ITEM_CD AS GOODS_CD                            -- 상품코드
+						     , OD.GOODS_CD                                       -- 상품코드
 						FROM   TB_ORDER O
 						 JOIN  TB_ORDER_DETAIL OD      ON O.ORD_NO = OD.ORD_NO
 						 JOIN  TB_DELIVERY_ADDR DA     ON OD.DELV_ADDR_SQ = DA.DELV_ADDR_SQ AND OD.DELV_ADDR_SQ = DA.DELV_ADDR_SQ
-						 JOIN  TB_ORDER_DETAIL_ITEM IT ON OD.ORD_NO       = IT.ORD_NO       AND OD.ORD_DTL_NO   = IT.ORD_DTL_NO
-						 JOIN  TB_GOODS G              ON IT.ITEM_CD      = G.GOODS_CD
+						 JOIN  TB_GOODS G              ON OD.GOODS_CD      = G.GOODS_CD
 						WHERE 1=1 
 						<if test="delvGb != null and delvGb != ''">
 						AND    'D' = #{delvGb} -- 배송지시
@@ -591,13 +590,12 @@
 						     , O.SITE_CD                                -- 사이트코드
 						     , O.ORD_NO                                 -- 주문번호
 						     , OCD.ORD_DTL_NO                           -- 주문상세번호
-						     , IT.ITEM_CD AS GOODS_CD                   -- 상품코드
+						     , 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_ORDER_DETAIL_ITEM IT    ON OD.ORD_NO      = IT.ORD_NO     AND OD.ORD_DTL_NO     = IT.ORD_DTL_NO
-						JOIN   TB_GOODS G                 ON IT.ITEM_CD     = G.GOODS_CD
+						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 
 						<if test="delvGb != null and delvGb != ''">
@@ -613,7 +611,7 @@
 						<if test="edDate != null and edDate != ''">
 						AND    OC.REG_DT <![CDATA[<]]> STR_TO_DATE(REPLACE(#{edDate},'-','')+1 , '%Y%m%d%H%i%s')
 						</if>
-						AND    OCD.CHG_STAT IN ('G685_30','G685_40') -- 반품요청,교환요청
+						AND    OCD.CHG_STAT IN ('G685_30','G685_31') -- 회수요청 상품검수중
 						<if test="siteCd != null and siteCd != ''">
 						AND    O.SITE_CD = #{siteCd}
 						</if>
@@ -638,12 +636,11 @@
 						     , O.SITE_CD                                         -- 사이트코드
 						     , O.ORD_NO                                          -- 주문번호
 						     , OD.ORD_DTL_NO                                     -- 주문상세번호
-						     , IT.ITEM_CD AS GOODS_CD                            -- 상품코드
+						     , OD.GOODS_CD                                       -- 상품코드
 						     , G.GOODS_NM                                        -- 상품명
 						     , DA.RECIP_NM                                       -- 수취인명
 						     , DA.RECIP_PHNNO                                    -- 수취인휴대전화번호
 						     , DA.RECIP_TELNO                                    -- 수취인전화번호
-						  --   , DA.RECIP_EMAIL                                    -- 수취인이메일
 						     , DA.RECIP_ZIPCODE                                  -- 수취인우편번호
 						     , DA.RECIP_BASE_ADDR                                -- 수취인기본주소
 						     , DA.RECIP_DTL_ADDR                                 -- 수취인상세주소
@@ -654,8 +651,7 @@
 						FROM   TB_ORDER O
 						 JOIN  TB_ORDER_DETAIL OD      ON O.ORD_NO = OD.ORD_NO
 						 JOIN  TB_DELIVERY_ADDR DA     ON OD.DELV_ADDR_SQ = DA.DELV_ADDR_SQ AND OD.DELV_ADDR_SQ = DA.DELV_ADDR_SQ
-						 JOIN  TB_ORDER_DETAIL_ITEM IT ON OD.ORD_NO       = IT.ORD_NO       AND OD.ORD_DTL_NO   = IT.ORD_DTL_NO
-						 JOIN  TB_GOODS G              ON IT.ITEM_CD      = G.GOODS_CD
+						 JOIN  TB_GOODS G              ON OD.GOODS_CD      = G.GOODS_CD
 						WHERE 1=1 
 						<if test="delvGb != null and delvGb != ''">
 						AND    'D' = #{delvGb} -- 배송지시
@@ -683,7 +679,7 @@
 						     , O.SITE_CD                                -- 사이트코드
 						     , O.ORD_NO                                 -- 주문번호
 						     , OCD.ORD_DTL_NO                           -- 주문상세번호
-						     , IT.ITEM_CD AS GOODS_CD                   -- 상품코드
+						     , OD.GOODS_CD                              -- 상품코드
 						     , G.GOODS_NM                               -- 상품명
 						     , D.RTN_LOC_NM          AS RECIP_NM        -- 수취인명
 						     , NULL                  AS RECIP_PHNNO     -- 수취인휴대전화번호
@@ -699,8 +695,7 @@
 						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_ORDER_DETAIL_ITEM IT    ON OD.ORD_NO      = IT.ORD_NO     AND OD.ORD_DTL_NO     = IT.ORD_DTL_NO
-						JOIN   TB_GOODS G                 ON IT.ITEM_CD     = G.GOODS_CD
+						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 
 						<if test="delvGb != null and delvGb != ''">
@@ -716,7 +711,7 @@
 						<if test="edDate != null and edDate != ''">
 						AND    OC.REG_DT <![CDATA[<]]> STR_TO_DATE(REPLACE(#{edDate},'-','')+1 , '%Y%m%d%H%i%s')
 						</if>
-						AND    OCD.CHG_STAT IN ('G685_30','G685_40') -- 반품요청,교환요청
+						AND    OCD.CHG_STAT IN ('G685_30','G685_31') -- 회수요청 상품검수중
 						<if test="siteCd != null and siteCd != ''">
 						AND    O.SITE_CD = #{siteCd}
 						</if>

+ 137 - 1
src/main/java/com/style24/persistence/mybatis/shop/TsaWithdraw.xml

@@ -218,7 +218,7 @@
 
 	<!-- 회수예외 처리완료-->
 	<update id="updateWithdrawException" parameterType="WithdrawExc" >
-		/* TsaWithdraw.deleteBangoods */
+		/* TsaWithdraw.updateWithdrawException */
 		UPDATE TB_ORDER_RECALL_EXCEPTION SET
 		  RECALL_STAT = #{recallStat}
 		, RECALL_STAT_DT = NOW()
@@ -234,5 +234,141 @@
 			WHERE OPT_CD = #{skucode} 
 	</select>
 	
+	<!-- 회수지시 목록 건수 -->
+	<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>
 	
+	<!-- 회수지시 목록 -->
+	<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
+		     , 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
+		     , FN_GET_CODE_NM('G685', Z.CHG_STAT) AS CHG_STAT_NM
+		FROM (
+		    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.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                              -- 주문자이메일
+						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
+				ORDER BY A.ORD_CHG_SQ, 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}
+		</if>
+		<if test="ordNo != null and ordNo != ''">
+			AND O.ORD_NO = #{ordNo}
+		</if>
+		<if test="ordChgSq != null and ordChgSq != ''">
+			AND OC.ORD_CHG_SQ = #{ordChgSq}
+		</if>		
+		<if test="chgGb == null or chgGb == ''">
+			AND    OC.CHG_GB IN ('G680_30','G680_40') -- 반품요청,교환요청
+		</if>
+		<if test="chgGb != null and chgGb != ''">
+			AND OC.CHG_GB = #{chgGb}
+		</if>
+		
+		<if test="chgStat != null and chgStat != ''">
+			AND OCD.CHG_STAT = #{chgStat}
+		</if>
+		<if test="chgStat == null or chgStat == ''">
+			AND OCD.CHG_STAT IN('G685_20','G685_50','G685_30','G685_40','G685_60','G685_49','G685_69')
+		</if>
+		
+		<if test="wdGb != null and wdGb != ''">
+			AND OC.WD_GB = #{wdGb}
+		</if>	
+		<if test="sendYn != null and sendYn != ''">
+		AND    OC.WD_INVOICE_SEND_YN = #{sendYn}
+		</if>
+		<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>
+		<if test="edDate != null and edDate != ''">
+		AND    OC.REG_DT <![CDATA[<]]> STR_TO_DATE(REPLACE(#{edDate},'-','')+1 , '%Y%m%d%H%i%s')
+		</if>
+		AND    G.SELF_GOODS_YN = 'Y' -- 자사상품만
+		AND    OCD.DEL_YN      = 'N'	
+	</sql>		
+			
+	<!-- 재회수지시-->
+	<update id="updateReRecallOrder" parameterType="Withdraw" >
+		/* TsaWithdraw.updateReRecallOrder */
+		UPDATE TB_ORDER_CHANGE_DETAIL SET
+		  CHG_STAT = #{chgStat}
+		, UPD_NO   = #{updNo}
+		, UPD_DT   = NOW()
+		WHERE ORD_CHG_SQ = #{ordChgSq} 
+		  AND ORD_DTL_NO = #{ordDtlNo}
+
+	</update>
+
 </mapper>

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

@@ -29,7 +29,7 @@
 	<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>

+ 8 - 12
src/main/webapp/WEB-INF/views/pos/PosMainForm.html

@@ -1,36 +1,32 @@
 <!DOCTYPE html>
 <html lang="ko"
-	  xmlns:th="http://www.thymeleaf.org">
-<head th:replace="common/fragments/header :: header"></head>
-<body>
-<th:block th:replace="common/fragments/variables :: variables"></th:block>
-
+	xmlns:th="http://www.thymeleaf.org">
 <!--
  *******************************************************************************
  * @source  : PosMainForm.html
  * @desc    : POS Main Page
  *============================================================================
- * ISTYLE24
+ * STYLE24
  * Copyright(C) 2020 TSIT, All rights reserved.
  *============================================================================
  * VER  DATE         AUTHOR      DESCRIPTION
  * ===  ===========  ==========  =============================================
- * 1.0  2020.11.13   moon        최초 작성
+ * 1.0  2021.05.07   moon        최초 작성
  *******************************************************************************
  -->
 
-<div id="main" style="padding-top:0;">
-		<!-- TITLE -->
+<div id="main">
+		<!-- 메인타이틀 영역 -->
 		<div class="main-title">
 			<h1>매장명 : <span th:text="${delvLocNm}"></span></h1>
 		</div>
-		<!-- //TITLE -->
+		<!-- //메인타이틀 영역 -->
 	
 		<!-- TABS SPACE -->
 		<div class="tabs">
 			<!-- TABS NAVI -->
 			<ul class="tabsNav p-left">
-				<li class="on"><a href="#tab1#top" id="tab1-1">출고대기목록</a></li>
+				<li class="on"><a href="#tab1#top" id="tab1">출고대기목록</a></li>
 				<li><a href="#tab2#top">출고목록</a></li>
 				<li><a href="#tab3#top">정산내역</a></li>
 				<li><a href="#tab4#top">출고거부이력</a></li>
@@ -511,7 +507,7 @@
 	});
 
 	var fnSetDelvCallback = function() {
-		$('#tab1-1').trigger('click');
+		$('#tab1').trigger('click');
 		$('#btnWaitSearch').trigger('click');
 	};
 

+ 349 - 0
src/main/webapp/WEB-INF/views/withdraw/WithdrawDirectiveListForm.html

@@ -0,0 +1,349 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : WithdrawDirectiveListForm.html
+ * @desc    : 회수지시 목록 Page
+ *=============================================================
+ * ISTYLE24
+ * Copyright(C) 2021 TSIT, All rights reserved.
+ *=============================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  ==================================
+ * 1.0  2021.05.10   moon        최초 작성
+ *******************************************************************************
+ -->
+ 	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc">
+		</div>
+		<!-- //메뉴 설명 -->
+		
+		<!-- 검색조건 영역 -->
+		<form id="searchForm" name="searchForm" action="#" th:action="@{'/withdraw/direct/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+		<div class="panelStyle">
+			<!-- TITLE -->
+			<div class="panelTitle">
+				<h3><i class="fa fa-info-circle"></i>아래 검색조건  <font color="red">주문번호,주문변경번호,회수요청일</font>중 하나를 꼭 입력해 주세요.</h3>
+				<span class="panelControl">
+					<i class="fa fa-chevron-up"></i>
+				</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="" name="ordNm" placeholder="" maxlength="20"/>
+							</td>
+							<th>주문번호</th>
+							<td>
+								<input type="text" class="" name="ordNo" data-valid-type="integer" placeholder="" maxlength="20"/>
+							</td>
+							<th>주문변경번호</th>
+							<td>
+								<input type="text" class="" name="ordChgSq" data-valid-type="integer" placeholder="" maxlength="20"/>
+							</td>
+						</tr>
+						<tr>	
+							<th>회수구분</th>
+							<td>
+								<select name="chgGb">
+									<option value="">&nbsp;전체&nbsp;</option>
+									<option value="G680_30"> 반품 </option>
+									<option value="G680_40"> 교환 </option>
+								</select>
+							</td>
+							<th>진행상태</th>
+							<td>
+								<select name="chgStat">
+									<option value="">전체</option>
+									<option value="G685_20">교환접수</option>
+									<option value="G685_50">반품접수</option>
+									<option value="G685_30">회수요청</option>
+									<option value="G685_40">교환완료</option>
+									<option value="G685_60">반품완료</option>
+									<option value="G685_49">교환철회</option>
+									<option value="G685_69">반품철회</option>
+									
+								</select>
+							</td>
+							<th>반품방식</th>
+							<td>
+								<select name="wdGb">
+									<option value="">&nbsp;전체&nbsp;</option>
+									<option value="W">방문회수</option>
+									<option value="D">직접배송</option>
+									
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<th>택배사전송여부</th>
+							<td>
+								<select name="sendYn">
+									<option value="">전체</option>
+									<option value="Y">전송</option>
+									<option value="N">미전송</option>
+									
+								</select>
+							</td>
+							<th>회수상태</th>
+							<td colspan="3">
+								<select name="wdShipState">
+									<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">
+						<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>
+		</div>
+		<!-- //검색조건 영역 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelStyle">
+			<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="10" selected="selected">10개씩 보기</option>
+						<option value="20">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: 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 columnDefs = [
+		{headerName: "주문변경번호", 	field: "ordChgSq", 		width: 100, cellClass: "text-center"},
+		{headerName: "주문번호", 		field: "ordNo", 		width: 100, cellClass: "text-center",
+			cellRenderer: function(params) { return gagajf.isNull(params.value) ? '' : '<a href="javascript:void(0);">' + params.value + '</a>'; }
+		},
+		{headerName: "주문상세번호", 	field: "ordDtlNo", 		width: 100, cellClass: "text-center"},		
+		{headerName: "회수구분", 		field: "chgGb", 		width: 80, cellClass: "text-center",
+			cellRenderer: function (params) { return params.value == 'G680_30' ? '반품' : '교환'; }
+		},
+		
+		{headerName: "사유", 			field: "chgReasonNm", 	width: 150, cellClass: "text-left"},
+		{headerName: "진행상태", 		field: "chgStatNm", 	width: 100, 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: "wdGb", 			width: 80, cellClass: "text-center",
+			cellRenderer: function (params) { return params.value == 'W' ? '방문회수' : '직접배송'; }
+		},
+		{headerName: "택배사전송", 	field: "sendYn", 		width: 80, cellClass: "text-center"},
+		{headerName: "회수송장번호", 	field: "wdInvoiceNo", 	width: 100, cellClass: "text-center"},
+		{headerName: "회수상태", 		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',
+			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+'\');">&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: "chgerNm", 		width: 100, cellClass: "text-center"},
+		{headerName: "변경자휴대전화", 	field: "chgerPhnno", 	width: 120, cellClass: "text-center"},
+		{headerName: "변경자전화번호", 	field: "chgerTelno", 	width: 120, cellClass: "text-center"},
+		{headerName: "변경자우편번호", 	field: "chgerZipcode", 	width: 120, cellClass: "text-center"},
+		{headerName: "변경자기본주소", 	field: "chgerBaseAddr", width: 300, cellClass: "text-left"},
+		{headerName: "변경자상세주소", 	field: "chgerDtlAddr", 	width: 200, cellClass: "text-left"},
+		{headerName: "주문자명", 		field: "ordNm", 		width: 100, cellClass: "text-center"},
+		{headerName: "주문자휴대전화", 	field: "ordPhnno", 		width: 120, cellClass: "text-center"},
+		{headerName: "주문자전화번호", 	field: "ordTelno", 		width: 120, cellClass: "text-center"},
+		{headerName: "주문자이메일", 	field: "ordEmail", 		width: 120, cellClass: "text-left"}
+	];
+
+	var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// 셀 클릭 이벤트
+	gridOptions.onCellClicked = function(event) {
+		if (event.colDef.field == 'ordNo') {
+			// 주문 상세
+			cfnOpenOrderDetailPopup(event.data.ordNo);
+		} else if (event.colDef.field == 'goodsCd') {
+			// 상품 상세
+			cfnOpenGoodsDetailPopup('U', event.data.goodsCd);
+		}
+	};
+
+	// 조회
+	$('#btnSearch').on('click', function() {
+		// Fetch data
+		//gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
+		fnSearchList();
+	});
+
+	/*************************************************************************
+	*  조회 
+	**************************************************************************/
+	var fnSearchList = function() {
+		
+		var searchChk = "N";
+		
+
+		if ($('#searchForm input[name=ordNo]').val() != '') {
+			searchChk = "Y";
+		}		
+		
+		if ($('#searchForm input[name=ordChgSq]').val() != '') {
+			searchChk = "Y";
+		}
+		
+		
+		if(searchChk == "N"){
+			if($('#stDate').val() == ''){
+				mcxDialog.alert('시작 기간을 입력하세요.');
+				return;
+			}
+	
+			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());
+	    gagaPaging.load($("#searchForm input[name=pageNo]").val());
+	}
+	
+	/*************************************************************************
+	*  조회 콜백
+	**************************************************************************/
+	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);
+		
+	}
+	
+	/*************************************************************************
+	*  재회수지시
+	**************************************************************************/	
+	var fnReRecallOrder = function(chgGb, ordDtlNo,ordChgSq ){
+		mcxDialog.confirm("재회수지시 하시겠습니까?", {
+		    cancelBtnText: "취소",
+		    sureBtnText: "확인",
+		    sureBtnClick: function() {
+	            var param = new Object;
+	            param.chgGb    = chgGb;
+	            param.ordDtlNo = ordDtlNo;
+	            param.ordChgSq = ordChgSq;
+	            var jsonData = JSON.stringify(param);
+	            gagajf.ajaxJsonSubmit('/withdraw/direct/recallorder', jsonData, fnSearchList);
+	        }
+		});
+	}
+
+	//엑셀다운로드
+	$('#btnExcel').on('click', function() {
+		gagaAgGrid.exportToExcel('회수지시 목록', gridOptions);
+		
+		var totalRows = gridOptions.api.getDisplayedRowCount();
+		if(totalRows==0){
+			mcxDialog.alert('조회된 내역이 없습니다.');
+			return;
+		}
+
+		var date = new Date().format("YYYYMMDDHHmmss");
+		var params = {
+			fileName : "회수지시목록_"+ date,
+			sheetName: "DATA"
+		}
+		gridOptions.excelStyles = [
+			{
+				id: 'dateFormat',
+				dataType: 'dateTime',
+				numberFormat: {
+					format: 'YYYY-MM-DD;@'
+				}
+			},
+			{
+				id: 'textFormat',
+				dataType: 'string'
+			}
+		]
+		gridOptions.api.exportDataAsExcel(params);
+		
+	});
+
+	$(document).ready(function() {
+		// Create a agGrid
+		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', 't');
+
+		//fnDatepickerDisabled();
+	});
+
+/*]]>*/
+</script>
+
+</html>

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

@@ -336,4 +336,4 @@
 
 /*]]>*/
 </script>
-</html>
+</html>