moon 5 lat temu
rodzic
commit
014378e33e

+ 52 - 8
src/main/java/com/style24/admin/biz/dao/TsaDeliveryDao.java

@@ -4,6 +4,7 @@ import java.util.Collection;
 
 import com.style24.core.support.annotation.ShopDs;
 import com.style24.persistence.domain.Delivery;
+import com.style24.persistence.domain.GoodsSearch;
 
 
 /**
@@ -15,6 +16,18 @@ import com.style24.persistence.domain.Delivery;
 @ShopDs
 public interface TsaDeliveryDao {
 
+	
+	/**
+	 * 배송 목록 건수
+	 *
+	 * @param goodsSearch
+	 * @return
+	 * @author moon
+	 * @since 2021. 02. 26
+	 */
+	int getDeliveryListCount(Delivery delivery);
+
+	
 	/**
 	 * 배송 목록
 	 *
@@ -26,14 +39,14 @@ public interface TsaDeliveryDao {
 	Collection<Delivery> getDeliveryList(Delivery delivery);
 
 	/**
-	 * 주문 상세
+	 * 주문상세 단품 목록
 	 *
-	 * @param ordDtlNo - 주문상세번호
+	 * @param delivery - 배송정보
 	 * @return Collection<Delivery>
 	 * @author moon
-	 * @since 2020. 11. 05
+	 * @since 2021. 03. 05
 	 */
-	Collection<Delivery> getOrderDetail(long ordDtlNo);	
+	Collection<Delivery> getDelvDetailItemList(Delivery ordDtlNo);
 	
 	/**
 	 * 주문상세 상태 값 변경
@@ -46,14 +59,45 @@ public interface TsaDeliveryDao {
 	int updateOrderDetailStat(Delivery delivery);
 	
 	/**
-	 * 주문 상세 이력 등록
+	 * 송장번호 변경
 	 *
-	 * @param delivery
-	 * @return void
+	 * @param delivery 
+	 * @return int
+	 * @author moon
+	 * @since 2020. 11. 05
+	 */
+	int saveChangeInvoice(Delivery delivery);
+	
+	
+	/**
+	 * 주문 상태 값 변경
+	 *
+	 * @param delivery 
+	 * @return int
+	 * @author moon
+	 * @since 2020. 11. 05
+	 */
+	int updateOrderStat(Delivery delivery);
+	
+
+	/**************************************************************************************/
+	
+	int createOrderDetailHst(Delivery delivery);
+	
+	/**
+	 * 주문 상세
+	 *
+	 * @param ordDtlNo - 주문상세번호
+	 * @return Collection<Delivery>
 	 * @author moon
 	 * @since 2020. 11. 05
 	 */
-	void createOrderDetailHst(Delivery delivery);	
+	Collection<Delivery> getOrderDetail(Integer ordDtlNo);	
+	
+
+	
+
+	
 	
 	/**
 	 * 출고금지상품 목록

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

@@ -4,8 +4,10 @@ import java.util.Collection;
 
 import org.springframework.dao.DataAccessException;
 
+import com.style24.persistence.domain.Delivery;
 //import com.style24.persistence.domain.Order;
 import com.style24.persistence.domain.Withdraw;
+import com.style24.persistence.domain.WithdrawExc;
 import com.style24.core.support.annotation.ShopDs;
 import org.springframework.stereotype.Repository;
 
@@ -19,6 +21,38 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface TsaWithdrawDao {
 
+	
+	/**
+	 * 회수예외 목록 건수
+	 * 
+	 * @param WithdrawExc
+	 * @return int
+	 * @author moon
+	 * @since 2021. 03. 04
+	 */
+	int getWithdrawExceptionListCount(WithdrawExc withdrawExc);
+
+	/**
+	 * 회수예외 목록 
+	 * 
+	 * @param WithdrawExc
+	 * @return Collection<WithdrawExc>
+	 * @author moon
+	 * @since 2021. 03. 04
+	 */
+	Collection<WithdrawExc> getWithdrawExceptionList(WithdrawExc withdrawExc);
+	
+	
+	/**
+	 * 회수예외 완료처리 
+	 * 
+	 * @param WithdrawExc
+	 * @return 
+	 * @author moon
+	 * @since 2021. 03. 04
+	 */
+	void updateWithdrawException(WithdrawExc withdrawExc);
+	
 	/**
 	 * 회수등록 - 조회(송장번호용)
 	 * 

+ 108 - 16
src/main/java/com/style24/admin/biz/service/TsaDeliveryService.java

@@ -8,14 +8,20 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.stereotype.Service;
 import org.apache.commons.lang3.StringUtils;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.style24.admin.biz.dao.TsaDeliveryDao;
 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.TscPageRequest;
 import com.style24.persistence.domain.Delivery;
+import com.style24.persistence.domain.GoodsSearch;
+
 import com.style24.core.support.env.TscConstants.OrderDetailStat;
-import com.style24.admin.support.env.TsaConstants;
 import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.core.biz.dao.TscOrderDao;
+import com.style24.persistence.domain.Order;
+
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -34,7 +40,27 @@ public class TsaDeliveryService {
 	
 	@Autowired
 	private TsaDeliveryDao deliveryDao;
+	
+	@Autowired
+	private TscOrderDao orderDao;
+	
 
+	@Autowired
+	private ObjectMapper mapper;
+	
+	
+	/**
+	 * 배송 목록 건수
+	 *
+	 * @param goodsSearch
+	 * @return
+	 * @author moon
+	 * @since 2021. 02. 26
+	 */
+	public int getDeliveryListCount(Delivery delivery) {
+		return deliveryDao.getDeliveryListCount(delivery);
+	}
+	
 	/**
 	 * 배송 목록
 	 *
@@ -53,14 +79,82 @@ public class TsaDeliveryService {
 		}
 
 		// 외부몰권한일 때 외부몰벤더ID 설정
-		if (TsaSession.getInfo().getRoleCd().startsWith("C")) {
+		if (TsaSession.getInfo().getRoleCd().startsWith("G001_C")) {
 			delivery.setMallGb(TsaConstants.MallGb.EXTMALL.value());
 			delivery.setVendorId(TsaSession.getInfo().getVendorId());
 		}
 		
+		if (!StringUtils.isBlank(delivery.getBrandList())) {
+			try {
+				String [] arrBrandCd = mapper.readValue(delivery.getBrandList(), String[].class);
+				delivery.setMultiBrand(arrBrandCd);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("브랜드코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}
+
+		if (!StringUtils.isBlank(delivery.getSupplyCompList())) {
+			try {
+				String [] arrSupplyComp = mapper.readValue(delivery.getSupplyCompList(), String[].class);
+				delivery.setMultiSupplyCompCd(arrSupplyComp);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("업체코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}
+		
+		
 		return deliveryDao.getDeliveryList(delivery);
 	}
 	
+	/**
+	 * 주문상세 단품 목록
+	 *
+	 * @param  ordDtlNo
+	 * @return Collection<Delivery>
+	 * @author moon
+	 * @since 2021. 03. 05
+	 */
+	public Collection<Delivery> getDelvDetailItemList(Integer ordDtlNo) {
+		
+		Delivery delivery = new Delivery();
+		delivery.setOrdDtlNo(ordDtlNo);
+		return deliveryDao.getDelvDetailItemList(delivery);
+	}	
+	
+	/**
+	 * 배송완료처리
+	 *
+	 * @param -TsaDelivery
+	 * @return void
+	 * @author moon
+	 * @since 2021. 03. 05
+	 */
+	@Transactional("shopTxnManager")
+	public void saveDeliveryComplete(Delivery delivery) {
+
+		Integer userNo = TsaSession.getInfo().getUserNo();
+		
+		delivery.setUpdNo(userNo);
+		delivery.setRegNo(userNo);
+		// 주문상세상태 => 배송완료
+		delivery.setOrdDtlStat(OrderDetailStat.DELIVERY_COMPLETE.value());
+		delivery.setHstMemo("수기배송완료처리");
+
+		// 주문상세 상태 값 수정
+		deliveryDao.updateOrderDetailStat(delivery);
+
+		// 주문상세이력 - 주문Dao 사용
+		Order order = new Order();
+		order.setOrdDtlNo(delivery.getOrdDtlNo());
+		order.setUpdNo(userNo);
+		order.setRegNo(userNo);
+		orderDao.createOrderDetailHst(order);
+
+	}
+	
+	
 	/**
 	 * 주문상세
 	 *
@@ -69,7 +163,7 @@ public class TsaDeliveryService {
 	 * @author moon
 	 * @since 2020. 11. 05
 	 */
-	public Collection<Delivery> getOrderDetail(long ordDtlNo) {
+	public Collection<Delivery> getOrderDetail(Integer ordDtlNo) {
 		return deliveryDao.getOrderDetail(ordDtlNo);
 	}	
 	
@@ -82,26 +176,24 @@ public class TsaDeliveryService {
 	 * @since 2020. 11. 05
 	 */
 	@Transactional("shopTxnManager")
-	public void saveOrderDetail(Collection<Delivery> deliveryList) {
+	public void saveChangeInvoice(Collection<Delivery> deliveryList) {
 	
 		int userId = TsaSession.getInfo().getUserNo();
 
 		for (Delivery oneDelivery : deliveryList) {
 			oneDelivery.setUpdNo(userId);
 			oneDelivery.setRegNo(userId);
-			// 배송 준비중, 배송중이면 해당 상태값으로 업데이트
-			if (OrderDetailStat.DELIVERY_PREPARE.equals(oneDelivery.getOrgOrdDtlStat()) || OrderDetailStat.SHIPPING.equals(oneDelivery.getOrgOrdDtlStat())) {
-				oneDelivery.setOrdDtlStat(oneDelivery.getOrgOrdDtlStat());
-			} else {
-				oneDelivery.setOrdDtlStat(OrderDetailStat.DELIVERY_PREPARE.value());
-			}
-			oneDelivery.setHstMemo("수기송장 수정");
-			// 주문상세수정
-			deliveryDao.updateOrderDetailStat(oneDelivery);
+			
+			// 송장번호 변경
+			deliveryDao.saveChangeInvoice(oneDelivery);
+			
 			// 주문상세이력
-			deliveryDao.createOrderDetailHst(oneDelivery);
+			Order order = new Order();
+			order.setOrdDtlNo(oneDelivery.getOrdDtlNo());
+			order.setUpdNo(userId);
+			order.setRegNo(userId);
+			orderDao.createOrderDetailHst(order);			
 		}
-
 	}	
 	
 	/**

+ 51 - 13
src/main/java/com/style24/admin/biz/service/TsaWithdrawService.java

@@ -5,33 +5,29 @@ 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.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.admin.biz.dao.TsaWmsWithdrawDao;
-
-
-
-//import com.style24.persistence.domain.Coupon;
 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.persistence.domain.Withdraw;
+import com.style24.persistence.domain.WithdrawExc;
 
 
-
-import com.style24.admin.support.env.TsaConstants;
+//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;
@@ -39,7 +35,7 @@ import com.style24.admin.support.env.TsaConstants;
 //import com.style24.admin.support.env.TsaConstants.UsacGb;
 
 import com.style24.core.support.message.TscMessageByLocale;
-import com.style24.admin.support.security.session.TsaSession;
+//import com.style24.admin.support.security.session.TsaSession;
 
 /**
  * 회수관리 Service
@@ -69,9 +65,51 @@ public class TsaWithdrawService {
 	//@Autowired
 	//private TsaWmsWithdrawDao wmsWithdrawDao;
 
-	@Autowired
-	private TsaKakaoService kakaoService;
+	//@Autowired
+	//private TsaKakaoService kakaoService;
 
+	
+
+	/**
+	 * 회수예외 목록 건수
+	 *
+	 * @param Delivery
+	 * @return
+	 * @author moon
+	 * @since 2021. 03. 04
+	 */
+	public int getWithdrawExceptionListCount(WithdrawExc withdrawExc) {
+		return withdrawDao.getWithdrawExceptionListCount(withdrawExc);
+	}
+	
+	/**
+	 * 회수예외 목록 
+	 *
+	 * @param Delivery
+	 * @return
+	 * @author moon
+	 * @since 2021. 03. 04
+	 */
+	public Collection<WithdrawExc> getWithdrawExceptionList(WithdrawExc withdrawExc) {
+		return withdrawDao.getWithdrawExceptionList(withdrawExc);
+	}
+	
+	/**
+	 * 회수예외 완료처리 
+	 *
+	 * @param Delivery
+	 * @return
+	 * @author moon
+	 * @since 2021. 03. 04
+	 */	
+	@Transactional("shopTxnManager")
+	public void createWithdrawInfo(WithdrawExc withdrawExc) {
+		withdrawExc.setRecallStat("S");
+		withdrawDao.updateWithdrawException(withdrawExc);
+		
+	}
+	
+	
 	/**
 	 * 회수등록 - 조회(송장번호용)
 	 *

+ 96 - 9
src/main/java/com/style24/admin/biz/web/TsaDeliveryController.java

@@ -14,6 +14,7 @@ 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;
 
 import com.style24.admin.biz.service.TsaRendererService;
@@ -21,11 +22,13 @@ import com.style24.admin.biz.service.TsaDeliveryService;
 import com.style24.admin.support.controller.TsaBaseController;
 import com.style24.admin.support.security.session.TsaSession;
 import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.persistence.TscPageRequest;
 import com.style24.persistence.domain.Delivery;
 import com.style24.persistence.domain.DeliveryLoc;
 
 import lombok.extern.slf4j.Slf4j;
 
+import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.rest.server.GagaResponse;
 
 /**
@@ -82,7 +85,7 @@ public class TsaDeliveryController extends TsaBaseController {
 		mav.addObject("delvTypeList", rendererService.getAvailCommonCodeList("G024"));
 		
 		String supplyCompCd = "";
-		if ("B000".equals(TsaSession.getInfo().getRoleCd())) {
+		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
 			supplyCompCd = TsaSession.getInfo().getSupplyCompCd();
 		}
 		
@@ -106,11 +109,67 @@ public class TsaDeliveryController extends TsaBaseController {
 	 */
 	@PostMapping("/list")
 	@ResponseBody
-	public Collection<Delivery> getDeliveryList(@RequestBody Delivery delivery) throws Exception {
-		Collection<Delivery> dataList = deliveryService.getDeliveryList(delivery);
-		return dataList;
+	public GagaMap getDeliveryList(@RequestBody Delivery delivery) throws Exception {
+		
+		GagaMap result = new GagaMap();
+
+		delivery.setPageable(new TscPageRequest(delivery.getPageNo() - 1, delivery.getPageSize()));
+		delivery.getPageable().setTotalCount(deliveryService.getDeliveryListCount(delivery));
+
+
+		if ("N".equals(delivery.getPageingYn())) {
+			delivery.setPageable(null);
+		}		
+		
+		result.set("pageing", delivery);
+		result.set("deliveryList", deliveryService.getDeliveryList(delivery));
+		
+		return result;
 	}
 
+	/**
+	 * 주문상세 단품 목록
+	 *
+	 * @param ordDtlNo - 주문상세번호
+	 * @return ModelAndView
+	 * @author moon
+	 * @since 2021. 03. 05
+	 */
+	@GetMapping("/detail/item/form/{ordDtlNo}")
+	@ResponseBody
+	public ModelAndView detailItemFrom(@PathVariable(value = "ordDtlNo") Integer ordDtlNo) {
+		ModelAndView mav = new ModelAndView();
+		Collection<Delivery> delvDetailItemList = deliveryService.getDelvDetailItemList(ordDtlNo);
+		
+		mav.addObject("delvDetailItemList", delvDetailItemList);
+		
+		mav.setViewName("delivery/DeliveryDetailItemForm");
+		return mav;
+	}
+	
+	/**
+	 * 배송완료처리
+	 *
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author moon
+	 * @since 2021. 03. 05
+	 */
+	@PostMapping("/complete/save")
+	@ResponseBody
+	public GagaResponse saveDeliveryComplete(@RequestBody Delivery delivery) throws Exception {
+
+		if (delivery == null) {
+			throw new IllegalStateException(message.getMessage("FAIL_1002"));
+		}
+
+		deliveryService.saveDeliveryComplete(delivery);
+
+		return super.ok(message.getMessage("SUCC_0004"));
+	}
+
+	
 	/**
 	 * 배송 목록 화면 - 품절처리
 	 *
@@ -197,10 +256,11 @@ public class TsaDeliveryController extends TsaBaseController {
 	 * @return
 	 * @throws Exception
 	 * @author moon
-	 * @since 2020. 11. 05
+	 * @since 2021. 03. 06
 	 */
-	@GetMapping("/save/invoice/form")
-	public ModelAndView saveInvoiceForm(@RequestParam(value = "ordDtlNo", required = true)long ordDtlNo) {
+	@GetMapping("/save/invoice/form/{ordDtlNo}")
+	@ResponseBody
+	public ModelAndView saveInvoiceForm(@PathVariable(value = "ordDtlNo") Integer ordDtlNo) {
 		ModelAndView mav = new ModelAndView();
 		Collection<Delivery> ordDeliveryList = deliveryService.getOrderDetail(ordDtlNo);
 		Delivery ordDelivery = ordDeliveryList.iterator().next();
@@ -219,7 +279,7 @@ public class TsaDeliveryController extends TsaBaseController {
 	 * @return
 	 * @throws Exception
 	 * @author moon
-	 * @since 2020. 11. 05
+	 * @since 2021. 03. 06
 	 */
 	@PostMapping("/orderDetail/save")
 	@ResponseBody
@@ -229,7 +289,7 @@ public class TsaDeliveryController extends TsaBaseController {
 			throw new IllegalStateException(message.getMessage("FAIL_1002"));
 		}
 
-		deliveryService.saveOrderDetail(deliveryList);
+		deliveryService.saveChangeInvoice(deliveryList);
 
 		return super.ok(message.getMessage("SUCC_0004"));
 	}
@@ -349,4 +409,31 @@ public class TsaDeliveryController extends TsaBaseController {
 		return super.ok(message.getMessage("SUCC_0001"));
 	}
 	
+	/**
+	 * 출고예외관리 화면 
+	 *
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author moon
+	 * @since 2021. 02. 19
+	 */
+	@GetMapping("/exception/form")
+	@ResponseBody
+	public ModelAndView deliveryExceptionListForm() throws Exception {
+		ModelAndView mav = new ModelAndView();
+
+		// 공급업체
+		//mav.addObject("supplyCompList", rendererService.getSupplyCompanyList());
+		// 출고처 목록
+		//DeliveryLoc deliLoc = new DeliveryLoc(); 
+		//deliLoc.mav.addObject("getDeliveryLocList", rendererService.getDeliveryLocList(deliLoc));
+		
+		mav.setViewName("/delivery/DeliveryExceptionListForm");
+
+		return mav;
+	}
+
+	
+		
 }

+ 73 - 1
src/main/java/com/style24/admin/biz/web/TsaWithdrawController.java

@@ -17,9 +17,13 @@ import org.springframework.web.servlet.ModelAndView;
 
 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.Delivery;
+import com.style24.persistence.domain.Pos;
 import com.style24.persistence.domain.Withdraw;
+import com.style24.persistence.domain.WithdrawExc;
 import com.style24.admin.biz.service.TsaDeliveryService;
 import com.style24.admin.biz.service.TsaRendererService;
 import com.style24.admin.biz.service.TsaWithdrawService;
@@ -422,4 +426,72 @@ public class TsaWithdrawController extends TsaBaseController {
 //		return dataList;
 //	}
 
+	
+	/**
+	 * 회수예외관리 화면 
+	 *
+	 * @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) {
+		Delivery delivery = new Delivery();
+
+		withdrawService.createWithdrawInfo(withdrawExc);
+		
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+	
+	
+	
 }

+ 87 - 29
src/main/java/com/style24/persistence/domain/Delivery.java

@@ -4,6 +4,7 @@ import java.util.Collection;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TscPageRequest;
 
 import lombok.Data;
 
@@ -31,8 +32,8 @@ public class Delivery extends TscBaseDomain {
 	private String goodsStat;
 	private String delvBanStdt;
 	private String delvBanEddt;   
-	private int    delvBanGoodsSq;
-	private String GoodsStatNm;
+	private Integer  delvBanGoodsSq;
+	private String goodsStatNm;
 	private String supplyCompCd;
 	private String searchTxt;
 	private String colorCd;
@@ -49,6 +50,68 @@ public class Delivery extends TscBaseDomain {
 	private String delYn;
 	private Integer custNo;
 	private Integer custDelvAddrSq;
+	private String goodsType;
+	private String goodsTypeNm;
+	private String sellStoreCd;
+	private String sellStoreNm;
+	private String mallGbNm;
+	private String ordDtlStatNm;
+	private String ordDtlStat;
+	
+	private String itemCd; 
+	private String optCd1; 
+	private String optCd2; 
+	private String itemQty; 
+	private String itemPrice; 
+	
+	private String shipCompCd;
+	private String invoiceNo;
+	
+	
+	
+	private String brandList;
+	private String supplyCompList;
+	
+	
+	private int delvDelayDays;
+	private String delvLocClsf;
+	private String siteCd;
+	private String mallGb;
+	private String orderNm;
+	private String orderPhnno;
+	private Integer ordDtlNo;
+	private Integer ordNo;
+	private String search;
+	private String condition;			// 키워드 검색
+	private String delvLocCd;
+	private String soldoutYn;
+	private String termGb;
+	private String stDate;
+	private String edDate;
+	
+	
+	private String[] conditions = null;
+	
+	
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiOrdDtlStat = null;
+	
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiBrand;
+	
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiSupplyCompCd;
+	
+	private String pageingYn;
+
+	// Pagination
+	private int startRow;
+	private int endRow;
+	
+	private TscPageRequest pageable;
+	private int pageNo = 1;
+	private int pageSize = 50;
+	private int pageUnit = 10;
 	
 	/* 위로  작성  ('' ) ( '')*/
 	
@@ -56,18 +119,17 @@ public class Delivery extends TscBaseDomain {
 	
 	
 	/* 아래는 참고용!!*/
-	private Long ordNo;
-	private Long ordDtlNo;
-	private String siteCd;
+	
+
+
 	private String siteNm;
-	private String sellStoreCd;
-	private String sellStoreNm;
+
 	private String ordDt;
 	private String payDt;
-	private String mallGb;
-	private String mallGbNm;
+
+	
 	private String ordStat;
-	private String orderNm;
+
 	private String orderEmail;
 	private String colorKnm;
 
@@ -75,13 +137,13 @@ public class Delivery extends TscBaseDomain {
 	private Integer cnclRtnQty;
 	private Integer saleQty;
 	private Integer saleAmt;
-	private String ordDtlStat;
-	private String ordDtlStatNm;
-	private String delvLocCd;
+	
+
+
 
 	private String sbagEncloseYn;
-	private String invoiceNo;
-	private String soldoutYn;
+
+
 	private String dstrbtNote;
 	private String ordExchGbNm;
 	private String extmallOrderId;
@@ -90,11 +152,10 @@ public class Delivery extends TscBaseDomain {
 	private String supplyGoodsCd;
 	private String ordExchGb;
 	private String frontGb;
-	private String termGb;
-	private String orderPhnno;
-	private Integer delvDelayDays;
-	private String stDate;
-	private String edDate;
+
+
+
+
 	private Long ordChgSq;
 	private String chgGb;
 	private String chgReason;
@@ -141,7 +202,6 @@ public class Delivery extends TscBaseDomain {
 	private String delvAssignStat;
 	private String delvStdt;
 	private String delvEddt;
-	private String shipCompCd;
 	private String shipCompNm;
 	private String invoiceSendYn;
 	private String sellFeeRate;
@@ -184,7 +244,7 @@ public class Delivery extends TscBaseDomain {
 	private Integer currStockQty;
 	private Integer baseStockQty;
 	private String delvArGb;
-	private String delvLocClsf;
+
 	private Integer assignQty;
 	private String delvArId;
 	private String rejectReason;
@@ -192,7 +252,6 @@ public class Delivery extends TscBaseDomain {
 	private String ordExchGbYn;
 	private String payStDate;
 	private String payEdDate;
-	private String goodsStatNm;
 
 	private String stDt;
 	private String edDt;
@@ -242,7 +301,7 @@ public class Delivery extends TscBaseDomain {
 	private String applySttmDip;
 	private String applyEdtmDip;
 
-	private Integer itemPrice;
+
 
 	private String pResult;
 
@@ -278,9 +337,9 @@ public class Delivery extends TscBaseDomain {
 	private String outSongjang;
 	private String outResult;
 
-	private String condition;			// 키워드 검색
-	private String[] conditions = null;
-	private String search;
+
+
+
 	private String regNm;
 
 	private String invoiceGb;
@@ -290,8 +349,7 @@ public class Delivery extends TscBaseDomain {
 	private String hstMemo;
 
 
-	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
-	private String[] multiOrdDtlStat = null;
+
 	
 	// 출고처 정보
 	private String delvAssignGrade;

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

@@ -25,8 +25,8 @@ public class Pos extends TscBaseDomain {
 
 	private String supplyCompCd;
 	private double sellFeeRate;
-	private Long ordNo;
-	private Long ordDtlNo;
+	private Integer ordNo;
+	private Integer ordDtlNo;
 	private String orderNm;
 	private String ordDtlStat;
 	private String recipNm;

+ 326 - 203
src/main/java/com/style24/persistence/mybatis/shop/TsaDelivery.xml

@@ -2,178 +2,285 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.style24.admin.biz.dao.TsaDeliveryDao">
 
+	<!-- 목록 페이징 정보 -->
+	<sql id="getListPagingCondition_sql">
+		<choose>
+		<when test="pageable != null">
+		    ) A
+		    JOIN ( SELECT @rownum := 0) R
+		)Z WHERE RNUM BETWEEN  #{pageable.startRow} AND #{pageable.endRow}
+		</when>
+		<otherwise>
+		    ) A
+		    JOIN ( SELECT @rownum := 0) R
+		)Z
+		</otherwise>
+		</choose>
+	</sql>
+	
+	<!-- 배송목록 건수 -->
+	<select id="getDeliveryListCount" parameterType="Delivery" resultType="int">
+		/* TsaDelivery.getDeliveryList */
+		SELECT COUNT(*) AS TOTCNT
+		  FROM (		
+				SELECT A.* 
+				  FROM (
+					SELECT 
+							  CASE WHEN ORD_DTL_STAT IN('G013_20','G013_30','G013_35','G013_40')
+							       THEN FN_GET_BIZDAYS(IF(A.ORD_EXCH_GB='O',DATE_FORMAT(A.PAY_DT,'%Y%m%d'),DATE_FORMAT(A.WD_EDDT,'%Y%m%d')),DATE_FORMAT(NOW(),'%Y%m%d')) - 1 
+							       ELSE NULL END AS DELV_DELAY_DAYS
+							, FN_GET_CODE_NM('G024', (SELECT B.DELV_LOC_CLSF FROM TB_DELIVERY_LOC B WHERE  A.DELV_LOC_CD = B.DELV_LOC_CD AND A.SUPPLY_COMP_CD = B.SUPPLY_COMP_CD ) ) AS DELV_LOC_CLSF  -- 출고처 분류 G024  물류창고, 일반매장, 직송매장, 입점업체 
+					  FROM (
+							SELECT 
+								  A.PAY_DT         -- 결제일시
+								, B.SUPPLY_COMP_CD -- 공급업체
+								, B.ORD_DTL_STAT  -- 주문상세상태
+								, B.DELV_LOC_CD   -- 출고처
+								, (SELECT MAX(CH.WD_EDDT) FROM TB_ORDER_CHANGE CH INNER JOIN TB_ORDER_CHANGE_DETAIL CHD ON CH.ORD_CHG_SQ = CHD.ORD_CHG_SQ WHERE CHD.ORD_DTL_NO =  B.ORG_ORD_DTL_NO) AS WD_EDDT
+					            , B.ORD_EXCH_GB
+							FROM  TB_ORDER A 
+							      INNER JOIN TB_ORDER_DETAIL B        ON A.ORD_NO       = B.ORD_NO
+							      INNER JOIN TB_GOODS C               ON B.GOODS_CD     = C.GOODS_CD
+							      INNER JOIN TB_DELIVERY_ADDR D       ON B.DELV_ADDR_SQ = D.DELV_ADDR_SQ
+							WHERE 1=1
+							<include refid="getDeliveryListCondition_sql"/>  
+					) A
+				) A
+				WHERE 1=1
+				<if test='delvDelayDays != null and delvDelayDays != ""'>
+				<![CDATA[
+				AND A.DELV_DELAY_DAYS >= #{delvDelayDays}
+				]]>
+				</if>
+				<if test='delvLocClsf != null and delvLocClsf != ""'>
+				AND   A.DELV_LOC_CLSF = #{delvLocClsf}
+				</if>
+			) A
+
+	</select>
+		
 	<!-- 배송목록 -->
 	<select id="getDeliveryList" parameterType="Delivery" resultType="Delivery">
 		/* TsaDelivery.getDeliveryList */
-		SELECT  CASE WHEN ORD_DTL_STAT IN('50','55','60')
-		        THEN NULL
-		        ELSE FN_GET_BIZDAYS(DECODE(ORD_EXCH_GB,'O',TO_CHAR(A.PAY_DT,'YYYYMMDD'),TO_CHAR(WD_EDDT,'YYYYMMDD')),TO_CHAR(SYSDATE,'YYYYMMDD')) - 1
-		        END AS DELV_DELAY_DAYS
-		      , ORD_NO
-		      , ORD_DTL_NO
-		      , SITE_CD
-		      , FN_GET_CODE_NM('G000', SITE_CD) AS SITE_NM
-		      , SELL_STORE_CD
-		      , (
-		          SELECT SELL_STORE_NM
-		          FROM   TB_SELL_STORE
-		          WHERE  SUPPLY_COMP_CD = A.SUPPLY_COMP_CD
-		          AND    SELL_STORE_CD = A.SELL_STORE_CD
-		         ) AS SELL_STORE_NM
-		      , ORD_DT
-		      , PAY_DT
-		      , MALL_GB
-		      , FN_GET_CODE_NM('G011', MALL_GB) AS MALL_GB_NM
-		      , CUST_NO
-		      , ORDER_NM
-		      , RECIP_NM
-		      , GOODS_CD
-		      , GOODS_NM
-		      , (
-		         SELECT COLOR_KNM
-		         FROM TB_COLOR
-		         WHERE SUPPLY_COMP_CD = A.SUPPLY_COMP_CD
-		         AND COLOR_CD = A.COLOR_CD AND BRAND_CD = A.BRAND_CD
-		         ) AS COLOR_KNM
-		      , SIZE_CD
-		      , SUPPLY_GOODS_CD
-		      , ORD_QTY
-		      , CNCL_RTN_QTY
-		      , SALE_QTY
-		      , SALE_AMT
-		      , ORD_DTL_STAT
-		      , FN_GET_CODE_NM('G013', ORD_DTL_STAT) AS ORD_DTL_STAT_NM
-		      , A.DELV_LOC_CD
-		      , B.DELV_LOC_NM
-		      , SBAG_ENCLOSE_YN
-		      , INVOICE_NO
-		      , SOLDOUT_YN
-		      , DSTRBT_NOTE
-		      , DECODE(ORD_EXCH_GB, 'E', 'Y', '') AS ORD_EXCH_GB
-		      , EXTMALL_ORDER_ID
-		      , EXTMALL_ORD_DTL_NO
-		      , AGENT_ORDER_ID
-		      , A.SUPPLY_COMP_CD
-		      , (
-		         SELECT SUPPLY_COMP_NM
-		         FROM TB_SUPPLY_COMPANY
-		         WHERE SUPPLY_COMP_CD = A.SUPPLY_COMP_CD
-		         ) AS SUPPLY_COMP_NM
-		      , DELV_MEMO
-		      , A.SHIP_COMP_CD
-		      , A.DELV_STDT
-		      , A.REAL_ORD_AMT
-		      , A.EXTMALL_NM
-		      , A.ORDER_PHNNO
-		      , A.ORDER_TELNO
-		      , A.ORDER_EMAIL
-		      , B.DELV_LOC_CLSF
-		FROM
-		(
-		 SELECT A.ORD_NO
-		      , ODI.ORD_DTL_NO
-		      , A.SITE_CD
-		      , B.SELL_STORE_CD
-		      , A.ORD_DT
-		      , A.PAY_DT
-		      , A.MALL_GB
-		      , A.CUST_NO
-		      , A.ORDER_NM
-		      , D.RECIP_NM
-		      , ODI.ITEM_CD     AS GOODS_CD
-		      , C.GOODS_NM
-		      , C.COLOR_CD
-		      , ODI.SIZE_CD
-		      , C.SUPPLY_GOODS_CD
-		      , B.ORD_QTY
-		      , B.CNCL_RTN_QTY
-		      , (B.ORD_QTY - B.CNCL_RTN_QTY) AS SALE_QTY
-		      , (B.ORD_AMT - B.CNCL_RTN_AMT) AS SALE_AMT
-		      , B.ORD_DTL_STAT
-		      , B.DELV_LOC_CD
-		      , A.SBAG_ENCLOSE_YN
-		      , B.INVOICE_NO
-		      , B.SOLDOUT_YN
-		      , B.DSTRBT_NOTE
-		      , B.ORD_EXCH_GB
-		      , B.EXTMALL_ORDER_ID
-		      , B.EXTMALL_ORD_DTL_NO
-		      , B.AGENT_ORDER_ID
-		      , B.SUPPLY_COMP_CD
-		      , D.DELV_MEMO
-		      , B.SHIP_COMP_CD
-		      , B.DELV_STDT
-		      , B.REAL_ORD_AMT
-		      , NVL((SELECT MAX(EXTMALL_NM)
-		              FROM TB_EXTMALL WHERE VENDOR_ID = B.VENDOR_ID
-		              AND  EXTMALL_ID = B.EXTMALL_ID), 'PASTELmall'
-		            )  AS EXTMALL_NM
-		      , C.BRAND_CD
-		      , (SELECT MAX(WD_EDDT) FROM TB_ORDER_CHANGE CH, TB_ORDER_CHANGE_DETAIL CHD WHERE CH.ORD_CHG_SQ = CHD.ORD_CHG_SQ AND CHD.ORD_DTL_NO =  B.ORG_ORD_DTL_NO) AS WD_EDDT
-		      , A.ORDER_PHNNO
-		      , A.ORDER_TELNO
-		      , A.ORDER_EMAIL
-		FROM  TB_ORDER A
-			, TB_ORDER_DETAIL_ITEM ODI
-		    , TB_ORDER_DETAIL B
-		    , TB_GOODS C
-		    , TB_DELIVERY_ADDR D
-		WHERE A.ORD_NO = B.ORD_NO
-		AND   B.ORD_DTL_NO = ODI.ORD_DTL_NO
-		AND   ODI.ITEM_CD = C.GOODS_CD
-		AND   B.DELV_ADDR_SQ = D.DELV_ADDR_SQ
-		<if test='ordDtlNo != null and ordDtlNo != ""'>
-		AND   ODI.ORD_DTL_NO = #{ordDtlNo}
-		</if>
-		<if test='termGb == "ordDt"'>
-		    <if test='stDate != null and stDate != ""'>
-		AND   A.REG_DT >= TO_DATE(#{stDate}, 'YYYY/MM/DD HH24 MI SS')
-		    </if>
-		    <if test='edDate != null and edDate != ""'>
-		AND   A.REG_DT <![CDATA[<]]> TO_DATE(#{edDate}, 'YYYY/MM/DD HH24 MI SS') + 1
-		    </if>
-		</if>
-		<if test='termGb == "delvDt"'>
-		    <if test='stDate != null and stDate != ""'>
-		AND   B.DELV_EDDT >= TO_DATE(#{stDate}, 'YYYY/MM/DD HH24 MI SS')
-		    </if>
-		    <if test='edDate != null and edDate != ""'>
-		AND   B.DELV_EDDT <![CDATA[<]]> TO_DATE(#{edDate}, 'YYYY/MM/DD HH24 MI SS') + 1
-		    </if>
+		SELECT Z.*
+		    , FN_GET_CODE_NM('G000', Z.SITE_CD) AS SITE_NM
+			, ( SELECT SELL_STORE_NM
+		      FROM   TB_SELL_STORE
+		      WHERE  SUPPLY_COMP_CD = Z.SUPPLY_COMP_CD
+		      AND    SELL_STORE_CD = Z.SELL_STORE_CD
+		     ) AS SELL_STORE_NM
+		    , FN_GET_CODE_NM('G011', Z.MALL_GB) AS MALL_GB_NM
+		    , FN_GET_CODE_NM('G013', Z.ORD_DTL_STAT) AS ORD_DTL_STAT_NM
+		    , (SELECT B.DELV_LOC_NM FROM TB_DELIVERY_LOC B WHERE  Z.DELV_LOC_CD = B.DELV_LOC_CD AND Z.SUPPLY_COMP_CD = B.SUPPLY_COMP_CD ) AS DELV_LOC_NM   -- 출고처명
+		    , (SELECT BD.BRAND_KNM FROM TB_BRAND BD WHERE BD.BRAND_CD = Z.BRAND_CD ) AS BRAND_NM
+		    , FN_GET_CODE_NM('G056', Z.GOODS_TYPE ) AS GOODS_TYPE_NM 
+		FROM (
+		    SELECT A.*, @rownum := @rownum + 1  RNUM 
+		    FROM (
+				SELECT A.* 
+				  FROM (
+					SELECT 
+							  CASE WHEN ORD_DTL_STAT IN('G013_20','G013_30','G013_35','G013_40')
+							       THEN FN_GET_BIZDAYS(IF(A.ORD_EXCH_GB='O',DATE_FORMAT(A.PAY_DT,'%Y%m%d'),DATE_FORMAT(A.WD_EDDT,'%Y%m%d')),DATE_FORMAT(NOW(),'%Y%m%d')) - 1 
+							       ELSE NULL END AS DELV_DELAY_DAYS
+							, A.ORD_NO     -- 주문번호
+							, A.ORD_DTL_NO -- 주문상세번호
+							, A.SITE_CD    -- 사이트
+							, A.SELL_STORE_CD -- 판매몰
+							, A.EXTMALL_NM  -- 판매몰명     
+							, A.ORD_DT         -- 주문일시
+							, A.PAY_DT         -- 결제일시
+							, A.MALL_GB        -- 몰구분
+							, A.ORD_NM         -- 주문자
+							, A.RECIP_NM       -- 수령인
+							, A.SUPPLY_COMP_CD -- 공급업체
+							, A.GOODS_CD       -- 상품코드
+							, A.GOODS_TYPE     -- 구성유형 
+							, A.GOODS_NM       -- 상품명
+							, A.OPT_CD1        -- 옵션1
+							, A.OPT_CD2        -- 옵션2 
+							, A.OPT_CD         -- SKU 
+							, A.SKU_MODEL_NO
+							, A.PRODUCT_NO
+							, A.PRODUCT_CODE
+							, A.ORD_QTY        -- 주문수량
+							, A.CNCL_RTN_QTY   -- 취소수량
+							, A.SALE_QTY       -- 판매수량
+							, A.SALE_AMT       -- 판매금액
+							, A.REAL_ORD_AMT   -- 실결제금액
+							, A.ORD_DTL_STAT   -- 주문상세상태
+							, FN_GET_CODE_NM('G024', (SELECT B.DELV_LOC_CLSF FROM TB_DELIVERY_LOC B WHERE  A.DELV_LOC_CD = B.DELV_LOC_CD AND A.SUPPLY_COMP_CD = B.SUPPLY_COMP_CD ) ) AS DELV_LOC_CLSF           -- 출고처 분류 G024  물류창고, 일반매장, 직송매장, 입점업체 
+				            , A.DELV_LOC_CD   -- 출고처
+							, A.SHIP_COMP_CD  -- 출고택배사
+							, A.INVOICE_NO    -- 출고송장
+							-- 송장등록수정
+							-- 배송완료처리
+							, A.EXTMALL_ORDER_ID -- 외부몰주문번호
+							-- , B.EXTMALL_ORD_DTL_NO-- 외부몰부주문번호
+							, A.SOLDOUT_YN    -- 결품여부
+							, A.DELV_MEMO     -- 배송메모
+							, A.ORD_EXCH_GB   -- 교환여부
+							, A.DELV_STDT     -- 배송시작일  
+							, A.BRAND_CD      -- 브랜드	
+
+					  FROM (
+							SELECT 
+								  A.ORD_NO     -- 주문번호
+								, B.ORD_DTL_NO -- 주문상세번호
+								, A.SITE_CD    -- 사이트
+								, B.SELL_STORE_CD -- 판매몰
+								, IFNULL((SELECT MAX(EXTMALL_NM) FROM TB_EXTMALL WHERE VENDOR_ID = B.VENDOR_ID
+								          AND  EXTMALL_ID = B.EXTMALL_ID), '아이스타일24')  AS EXTMALL_NM  -- 판매몰명
+								, A.ORD_DT         -- 주문일시
+								, A.PAY_DT         -- 결제일시
+								, A.MALL_GB        -- 몰구분
+								, A.ORD_NM         -- 주문자
+								, D.RECIP_NM       -- 수령인
+								, B.SUPPLY_COMP_CD -- 공급업체
+								, B.GOODS_CD       -- 상품코드
+								, B.GOODS_TYPE     -- 구성유형 
+								, C.GOODS_NM       -- 상품명
+								, ODI.OPT_CD1      -- 옵션1
+								, ODI.OPT_CD2      -- 옵션2 
+								, ODI.OPT_CD       -- SKU 
+								, ODI.SKU_MODEL_NO
+								, ODI.PRODUCT_NO
+								, ODI.PRODUCT_CODE
+								, ODI.ITEM_QTY * B.ORD_QTY      AS ORD_QTY      -- 주문수량
+								, ODI.ITEM_QTY * B.CNCL_RTN_QTY AS CNCL_RTN_QTY -- 취소수량
+								, (ODI.ITEM_QTY * B.ORD_QTY  - ODI.ITEM_QTY * B.CNCL_RTN_QTY) SALE_QTY -- 판매수량
+								, B.ORD_AMT - B.CNCL_RTN_AMT  AS SALE_AMT       -- 판매금액
+								, B.REAL_ORD_AMT  -- 실결제금액
+								, B.ORD_DTL_STAT  -- 주문상세상태
+								, B.DELV_LOC_CD   -- 출고처
+								, B.SHIP_COMP_CD  -- 출고택배사
+								, B.INVOICE_NO    -- 출고송장
+								, B.EXTMALL_ORDER_ID -- 외부몰주문번호
+								, B.SOLDOUT_YN    -- 결품여부
+								, D.DELV_MEMO     -- 배송메모
+								, B.ORD_EXCH_GB   -- 교환여부
+								, B.DELV_STDT     -- 배송시작일  
+								, (SELECT MAX(CH.WD_EDDT) FROM TB_ORDER_CHANGE CH INNER JOIN TB_ORDER_CHANGE_DETAIL CHD ON CH.ORD_CHG_SQ = CHD.ORD_CHG_SQ WHERE CHD.ORD_DTL_NO =  B.ORG_ORD_DTL_NO) AS WD_EDDT
+							    , C.BRAND_CD
+							FROM  TB_ORDER A 
+							      INNER JOIN TB_ORDER_DETAIL B        ON A.ORD_NO       = B.ORD_NO
+								  INNER JOIN TB_ORDER_DETAIL_ITEM ODI ON B.ORD_DTL_NO   = ODI.ORD_DTL_NO
+							      INNER JOIN TB_GOODS C               ON ODI.ITEM_CD    = C.GOODS_CD
+							      INNER JOIN TB_DELIVERY_ADDR D       ON B.DELV_ADDR_SQ = D.DELV_ADDR_SQ
+							WHERE ODI.ORD_DTL_NO = '5'
+							  AND B.GOODS_TYPE NOT IN ('G056_S')
+					        <include refid="getDeliveryListCondition_sql"/>
+							
+							UNION ALL
+							
+							SELECT 
+								  A.ORD_NO     -- 주문번호
+								, B.ORD_DTL_NO -- 주문상세번호
+								, A.SITE_CD    -- 사이트
+								, B.SELL_STORE_CD -- 판매몰
+								, IFNULL((SELECT MAX(EXTMALL_NM) FROM TB_EXTMALL WHERE VENDOR_ID = B.VENDOR_ID
+								          AND  EXTMALL_ID = B.EXTMALL_ID), '아이스타일24')  AS EXTMALL_NM  -- 판매몰명
+								, A.ORD_DT         -- 주문일시
+								, A.PAY_DT         -- 결제일시
+								, A.MALL_GB        -- 몰구분
+								, A.ORD_NM         -- 주문자
+								, D.RECIP_NM       -- 수령인
+								, B.SUPPLY_COMP_CD -- 공급업체
+								, B.GOODS_CD       -- 상품코드
+								, B.GOODS_TYPE     -- 구성유형 
+								, C.GOODS_NM       -- 상품명
+								, '-' AS OPT_CD1   -- 옵션1
+								, '-' AS OPT_CD2   -- 옵션2 
+								, '-' AS OPT_CD    -- SKU 
+								, '-' AS SKU_MODEL_NO
+								, NULL  AS PRODUCT_NO
+								, '-'  AS PRODUCT_CODE
+								, B.ORD_QTY      AS ORD_QTY      -- 주문수량
+								, B.CNCL_RTN_QTY AS CNCL_RTN_QTY -- 취소수량
+								, B.ORD_QTY  - B.CNCL_RTN_QTY   AS SALE_QTY   -- 판매수량
+								, B.ORD_AMT - B.CNCL_RTN_AMT    AS SALE_AMT   -- 판매금액
+								, B.REAL_ORD_AMT  -- 실결제금액
+								, B.ORD_DTL_STAT  -- 주문상세상태
+								, B.DELV_LOC_CD   -- 출고처
+								, B.SHIP_COMP_CD  -- 출고택배사
+								, B.INVOICE_NO    -- 출고송장
+								, B.EXTMALL_ORDER_ID -- 외부몰주문번호
+								, B.SOLDOUT_YN    -- 결품여부
+								, D.DELV_MEMO     -- 배송메모
+								, B.ORD_EXCH_GB   -- 교환여부
+								, B.DELV_STDT     -- 배송시작일  
+								, (SELECT MAX(CH.WD_EDDT) FROM TB_ORDER_CHANGE CH INNER JOIN TB_ORDER_CHANGE_DETAIL CHD ON CH.ORD_CHG_SQ = CHD.ORD_CHG_SQ WHERE CHD.ORD_DTL_NO =  B.ORG_ORD_DTL_NO) AS WD_EDDT
+							    , C.BRAND_CD 
+							FROM  TB_ORDER A 
+							      INNER JOIN TB_ORDER_DETAIL B        ON A.ORD_NO       = B.ORD_NO
+							      INNER JOIN TB_GOODS C               ON B.GOODS_CD     = C.GOODS_CD
+							      INNER JOIN TB_DELIVERY_ADDR D       ON B.DELV_ADDR_SQ = D.DELV_ADDR_SQ
+							WHERE B.ORD_DTL_NO = '5'
+							  AND B.GOODS_TYPE IN ('G056_S')
+							<include refid="getDeliveryListCondition_sql"/>  
+					) A
+				) A
+				WHERE 1=1
+				<if test='delvDelayDays != null and delvDelayDays != ""'>
+				<![CDATA[
+				AND A.DELV_DELAY_DAYS >= #{delvDelayDays}
+				]]>
+				</if>
+				<if test='delvLocClsf != null and delvLocClsf != ""'>
+				AND   A.DELV_LOC_CLSF = #{delvLocClsf}
+				</if>
+				ORDER BY A.ORD_NO DESC, A.ORD_DTL_NO
+	<include refid="getListPagingCondition_sql"/>
+	</select>
+
+    <!-- 배송목록 조회 조건  -->
+	<sql id="getDeliveryListCondition_sql">
+		<if test='siteCd != null and siteCd != ""'>
+		AND  A.SITE_CD = #{siteCd}
 		</if>
-		<if test='termGb == "delvStDt"'>
-		    <if test='stDate != null and stDate != ""'>
-		AND   B.DELV_STDT >= TO_DATE(#{stDate}, 'YYYY/MM/DD HH24 MI SS')
-		    </if>
-		    <if test='edDate != null and edDate != ""'>
-		AND   B.DELV_STDT <![CDATA[<]]> TO_DATE(#{edDate}, 'YYYY/MM/DD HH24 MI SS') + 1
-		    </if>
+		<if test='mallGb != null and mallGb != ""'>
+		AND  A.MALL_GB = #{mallGb}
 		</if>
+        <if test="multiSupplyCompCd != null and multiSupplyCompCd != ''">
+        AND B.SUPPLY_COMP_CD IN
+            <foreach collection="multiSupplyCompCd" item="item" index="index"  open="(" close=")" separator=",">
+        	#{item}
+            </foreach>
+        </if>
+        <if test="multiBrand != null and multiBrand != ''">
+        AND C.BRAND_CD IN
+            <foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
+        	#{item}
+            </foreach>
+        </if>
 		<if test='orderNm != null and orderNm != ""'>
 		AND   A.ORDER_NM = #{orderNm}
 		</if>
-		<if test='recipNm != null and recipNm != ""'>
-		AND   D.RECIP_NM = #{recipNm}
-		</if>
 		<if test='orderPhnno != null and orderPhnno != ""'>
 		AND   REPLACE(A.ORDER_PHNNO, '-', '') = REPLACE(#{orderPhnno}, '-', '')
 		</if>
+		<if test='ordDtlNo != null and ordDtlNo != ""'>
+		AND   B.ORD_DTL_NO = #{ordDtlNo}
+		</if>
 		<if test='conditions != null and conditions != "" '>
 		AND (
 		<choose>
 		     <when test='search != null and search == "searchOrdNo"'>
 		         <foreach collection="conditions" item="item" index="index" separator="or">
-		      REGEXP_LIKE(UPPER(A.ORD_NO), UPPER(#{item}))
+		      ORD_NM REGEXP CONCAT('[',#{item},']')  
 		         </foreach>
 		     </when>
 		     <when test='search != null and search == "searchExtmallOrderId"'>
 		         <foreach collection="conditions" item="item" index="index" separator="or">
-		      REGEXP_LIKE(UPPER(B.EXTMALL_ORDER_ID), UPPER(#{item}))
+		      EXTMALL_ORDER_ID REGEXP CONCAT('[',#{item},']')      
 		         </foreach>
 		      </when>
 		</choose>
 		      )
 		</if>
+		<if test='recipNm != null and recipNm != ""'>
+		AND   D.RECIP_NM = #{recipNm}
+		</if>
 		<if test='invoiceNo != null and invoiceNo != ""'>
 		AND   B.INVOICE_NO = #{invoiceNo}
 		</if>
@@ -183,80 +290,96 @@
 		<if test='delvLocCd != null and delvLocCd != ""'>
 		AND   B.DELV_LOC_CD = #{delvLocCd}
 		</if>
-		<if test='frontGb != null and frontGb != ""'>
-		AND   A.FRONT_GB = #{frontGb}
-		</if>
-		<if test='siteCd != null and siteCd != ""'>
-		AND  A.SITE_CD = #{siteCd}
-		</if>
-		<if test='soldoutYn != null and soldoutYn != ""'>
-		AND  B.SOLDOUT_YN = #{soldoutYn}
-		</if>
-		<if test='mallGb != null and mallGb != ""'>
-		AND  A.MALL_GB = #{mallGb}
-		</if>
 		<if test="multiOrdDtlStat != null and multiOrdDtlStat !=''">
 		AND  B.ORD_DTL_STAT IN
 		    <foreach collection="multiOrdDtlStat" item="item" index="index"  open="(" close=")" separator=",">
 		     #{item}
 		    </foreach>
+		</if>		
+		<if test='soldoutYn != null and soldoutYn != ""'>
+		AND  B.SOLDOUT_YN = #{soldoutYn}
 		</if>
-		<if test='supplyCompCd != null and supplyCompCd != ""'>
-		AND  B.SUPPLY_COMP_CD = #{supplyCompCd}
-		</if>
-		<if test='vendorId != null and vendorId != ""'>
-		AND  B.VENDOR_ID = #{vendorId}
-		</if>
-		<if test='extmallId != null and extmallId != ""'>
-		AND  B.EXTMALL_ID = #{extmallId}
+		<if test='termGb == "ordDt"'>
+		    <if test='stDate != null and stDate != ""'>
+		AND   A.REG_DT >= STR_TO_DATE(REPLACE(#{stDate},'-',''), '%Y%m%d%H%i%s')    
+		    </if>
+		    <if test='edDate != null and edDate != ""'>
+		AND   A.REG_DT <![CDATA[<]]> STR_TO_DATE(REPLACE(#{edDate},'-','') +1, '%Y%m%d%H%i%s') 
+		    </if>
 		</if>
-		<choose>
-			<when test='soldoutYn == "Y"'>
-				AND B.ORD_DTL_STAT = '99'
-			</when>
-			<otherwise>
-				<choose>
-					<when test='delvDelayDays != null and delvDelayDays != ""'>
-						AND B.ORD_DTL_STAT IN ('20', '30', '34', '35', '40')
-					</when>
-					<when test='multiOrdDtlStat == null or multiOrdDtlStat == ""'>
-						AND B.ORD_DTL_STAT != '00'
-					</when>
-				</choose>
-			</otherwise>
-		</choose>
-		) A
-		, TB_DELIVERY_LOC B
-		WHERE A.DELV_LOC_CD = B.DELV_LOC_CD (+)
-		AND A.SUPPLY_COMP_CD = B.SUPPLY_COMP_CD(+)
-		<if test='delvDelayDays != null and delvDelayDays != ""'>
-		AND   CASE WHEN ORD_DTL_STAT IN('50','55','60') THEN NULL
-		      ELSE FN_GET_BIZDAYS(DECODE(ORD_EXCH_GB,'O',TO_CHAR(A.PAY_DT,'YYYYMMDD'),TO_CHAR(WD_EDDT,'YYYYMMDD')),TO_CHAR(SYSDATE,'YYYYMMDD')) END >= #{delvDelayDays}
+		<if test='termGb == "delvDt"'>
+		    <if test='stDate != null and stDate != ""'>
+		AND   B.DELV_EDDT >= STR_TO_DATE(REPLACE(#{stDate},'-',''), '%Y%m%d%H%i%s')
+		    </if>
+		    <if test='edDate != null and edDate != ""'>
+		AND   B.DELV_EDDT <![CDATA[<]]> STR_TO_DATE(REPLACE(#{edDate},'-','')+1, '%Y%m%d%H%i%s')
+		    </if>
 		</if>
-		<if test='delvLocClsf != null and delvLocClsf != ""'>
-		AND   B.DELV_LOC_CLSF = #{delvLocClsf}
+		<if test='termGb == "delvStDt"'>
+		    <if test='stDate != null and stDate != ""'>
+		AND   B.DELV_STDT >= STR_TO_DATE(REPLACE(#{stDate},'-',''), '%Y%m%d%H%i%s')
+		    </if>
+		    <if test='edDate != null and edDate != ""'>
+		AND   B.DELV_STDT <![CDATA[<]]> STR_TO_DATE(REPLACE(#{edDate},'-','')+1 , '%Y%m%d%H%i%s') 
+		    </if>
 		</if>
-		ORDER BY A.ORD_NO DESC, A.ORD_DTL_NO
-		
-	</select>
+		AND B.ORD_DTL_STAT != '00'
+	</sql>
 
-	<!-- 주문상세 -->
-	<select id="getOrderDetail" parameterType="Delivery" resultType="Delivery">
-		/* TsaDelivery.getOrderDetail */
-		SELECT '1' FROM DUAL
+
+	<!-- 주문상세 단품 목록 -->
+	<select id="getDelvDetailItemList" parameterType="Delivery" resultType="Delivery">
+		/* TsaDelivery.getDelvDetailItemList */
+		SELECT 
+		     B.ITEM_CD 
+		   , (SELECT G.GOODS_NM FROM TB_GOODS G WHERE G.GOODS_CD = B.ITEM_CD) AS GOODS_NM
+		   , B.OPT_CD1 
+		   , B.OPT_CD2 
+		   , B.ITEM_QTY 
+		   , B.ITEM_PRICE 
+		 FROM TB_ORDER_DETAIL A
+		 JOIN TB_ORDER_DETAIL_ITEM B ON A.ORD_DTL_NO = B.ORD_DTL_NO 
+	    WHERE A.ORD_DTL_NO  = #{ordDtlNo}
+	    ORDER BY DISP_ORD 
 	</select>
 
+
 	<!-- 주문상세 상태 값 변경 -->
 	<update id="updateOrderDetailStat" parameterType="Delivery" >
 		/* TsaDelivery.updateOrderDetailStat */
-		SELECT '1' FROM DUAL
+		UPDATE TB_ORDER_DETAIL
+		SET    ORD_DTL_STAT = #{ordDtlStat}
+		     , DELV_EDDT    = IFNULL(DELV_EDDT, NOW()) 
+		     , UPD_NO       = #{updNo}
+		     , UPD_DT       = NOW()
+		WHERE  ORD_DTL_NO   = #{ordDtlNo}
 	</update>
+
+	<!-- 주문상세 -->
+	<select id="getOrderDetail" parameterType="Integer" resultType="Delivery">
+		/* TsaDelivery.getOrderDetail */
+		SELECT 
+			  A.ORD_NO
+			, A.ORD_DTL_NO
+			, A.ORD_DTL_STAT 
+			, A.SHIP_COMP_CD 
+			, A.INVOICE_NO 
+		  FROM TB_ORDER_DETAIL A
+		 WHERE ORD_DTL_NO  = #{ordDtlNo}
+	</select>
 	
-	<!-- 주문 상세 이력 등록-->
-	<update id="createOrderDetailHst" parameterType="Delivery" >
-		/* TsaDelivery.createOrderDetailHst */
-		SELECT '1' FROM DUAL
+	<!-- 송장번호  변경 -->
+	<update id="saveChangeInvoice" parameterType="Delivery" >
+		/* TsaDelivery.saveChangeInvoice */
+		UPDATE TB_ORDER_DETAIL
+		SET    SHIP_COMP_CD = #{shipCompCd}
+		     , INVOICE_NO   = #{invoiceNo}
+		     , UPD_NO       = #{updNo}
+		     , UPD_DT       = NOW()
+		WHERE  ORD_DTL_NO   = #{ordDtlNo}
 	</update>
+		
+
 	
 	<!-- 출고금지상품 목록 -->
 	<select id="getBangoodsList" parameterType="Delivery" resultType="Delivery">

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

@@ -264,7 +264,7 @@
 	 	});
 		
 		
-		mcxDialog.confirm("저장하시겠습니까?", {
+		mcxDialog.confirm("삭제하시겠습니까?", {
 		    cancelBtnText: "취소",
 		    sureBtnText: "확인",
 		    sureBtnClick: function() {

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

@@ -25,7 +25,7 @@
 	</div>
 	<!-- //메뉴 설명 -->
 	<!-- 검색조건 영역 -->
-
+	<form id="searchForm" name="searchForm" action="#" th:action="@{'/delivery/list/'}" onsubmit="fnSearchList(); return false;">
 	<div class="panelStyle">
 		<!-- TITLE -->
 		<div class="panelTitle">
@@ -36,7 +36,7 @@
 		</div>
 		<!-- //TITLE -->
 		<div class="panelContent">	
-			<form id="searchForm" name="searchForm" action="#" th:action="@{'/delivery/list/'}" onsubmit="fnSearchList(); return false;">
+			
 				<table class="frmStyle">
 					<colgroup>
 						<col style="width:8%;"/>
@@ -47,8 +47,7 @@
 						<col style="width:12%;"/>
 						<col style="width:8%;"/>
 						<col style="width:12%;"/>
-						<col style="width:8%;"/>
-						<col style="width:12%;"/>
+
 					</colgroup>
 					<tr>
 						<th>사이트</th>
@@ -59,34 +58,34 @@
 							</select>
 						</td>
 						<th>몰구분</th>
-						<td colspan="3">
+						<td>
 							<select name="mallGb" style="width: 100px;">
-								<option value="" th:if="${sessionInfo.roleCd} != 'B000' and ${sessionInfo.roleCd} != 'C000'">[전체]</option>
-								<option th:if="${mallGbList}" th:each="oneData, status : ${mallGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+								<option value="" th:if="${sessionInfo.roleCd} != 'G001_B000' and ${sessionInfo.roleCd} != 'G001_C000'">[전체]</option>
+								<option th:if="${mallGbList}" th:each="oneData, status : ${mallGbList}" th:value="${oneData.cd}" th:text="${oneData.cdNm}"></option>
 							</select>
-							<span id="selfmall">
-								<select name="supplyCompCd">
-									<option value="" th:if="${sessionInfo.roleCd} != 'B000' and ${sessionInfo.roleCd} != 'C000'">[전체]</option>
-									<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-								</select>
-							</span>
-							<span id="extmallVendor">
-								<select name="vendorId">
-									<option value="" th:if="${sessionInfo.roleCd} != 'B000' and ${sessionInfo.roleCd} != 'C000'">[전체]</option>
-									<option th:if="${vendorList}" th:each="oneData, status : ${vendorList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-								</select>
-								<select name="extmallId" style="width: 150px;">
-									<option value="">[전체]</option>
-								</select>
-							</span>
 						</td>
-						<th>프론트구분</th>
-						<td colspan="3">
-							<select class="w130" name="frontGb" id="frontGb">
-								<option value="">[전체]</option>
-								<option value="P">PC</option>
-								<option value="M">Mobile</option>
+
+						<th>업체<em class="required" title="필수"></em></th>
+						<td>
+							<input type="text" class="w100" name="supplyCompSearchTxt" id="supplyCompSearchTxt" maxlength="20" />
+							<button type="button" class="btn icn" id="btnSearchSupplyComp"><i class="fa fa-search"></i></button>
+							<span id="supplyCompText"></span>
+							<input type="hidden" name="supplyCompList"/>
+							<!-- <label class="rdoBtn"><input type="radio" name="selfYn" id="selfYnY" value="Y"  checked/>자사</label>
+							<label class="rdoBtn"><input type="radio" name="selfYn" id="selfYnN" value="N"/>입점</label>
+							<select name="supplyCompCd" id="supplyCompCd">
+								<option value="" th:if="${sessionInfo.roleCd} != 'G001_B000'">[전체]</option>
+								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
+							<span id="multiBrand"></span> -->
+						</td>
+						<th>브랜드<em class="required" title="필수"></em></th>
+						<td>
+							<input type="text" class="w100" name="searchTxt" id="searchTxt" maxlength="20" />
+							<button type="button" class="btn icn" id="btnSearchBrand"><i class="fa fa-search"></i></button>
+							<!-- <input type="text" class="w100" name="brandCd" readonly="readonly"/> -->
+							<span id="brandText"></span>
+							<input type="hidden" name="brandList"/>
 						</td>
 					</tr>
 					<tr>
@@ -130,7 +129,7 @@
 						<td>
 							<select class="w150" name="delvLocClsf" id="delvLocClsf">
 								<option value="">[전체]</option>
-								<option th:if="${delvTypeList}" th:each="oneData, status : ${delvTypeList}" th:value="${oneData.cd}" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
+								<option th:if="${delvTypeList}" th:each="oneData, status : ${delvTypeList}" th:value="${oneData.cd}" th:text="| ${oneData.cdNm}|"></option>
 							</select>
 						</td>
 						<th>출고처</th>
@@ -188,7 +187,7 @@
 					<button type="button" id="btnExcel" class="btn btn-info btn-lg">엑셀다운로드</button>
 					</li>
 				</ul>
-			</form>
+			
 		</div>
 	</div>
 	<!-- //검색조건 영역 -->
@@ -201,19 +200,37 @@
 				<!-- <button type="button" id="btnSave" class="btn btn-success btn-lg btnRight" onclick="deliveryInfoSave();">저장</button>
 				<button type="button" id="btnWith" class="btn btn-success btn-lg btnRight">T</button> -->
 			</li>
+			<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="50" selected="selected">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="gridDeliveryList" style="width:100%; height: 700px;" class="ag-theme-balham"></div>
+		<ul class="panelBar">
+			<li class="center">
+				<div class="tablePaging" id="deliveryListPagination"></div>
+			</li>
 		</ul>
-		<div class="panelContent" style="overflow: hidden;">
-			<div id="gridDeliveryList" style="width:100%; height: 700px;" class="ag-theme-balham"></div>
-		</div>
 	</div>
+	</form>
 	<!-- //리스트 영역 -->
 </div>
-
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=20210114"></script>
 <script th:inline="javascript">
 	/*<![CDATA[*/
-
+	/*************************************************************************
+	* AG-GRID 영역 
+	**************************************************************************/
 	var shipCompanyList =  gagajf.convertToArray([[${shipCompanyList}]]);
-
+	var roleCd = [[${sessionInfo.roleCd}]];
 	var columnDefs = [
 		{
 			headerName: "결품",
@@ -224,15 +241,13 @@
 			headerCheckboxSelectionFilteredOnly: true
 			,
 			checkboxSelection: function (params) {
-				return (params.data.ordDtlStat == '20' || params.data.ordDtlStat == '25' || params.data.ordDtlStat == '30' || params.data.ordDtlStat == '34') ? true : false;
+				return (params.data.ordDtlStat == 'G013_20' || params.data.ordDtlStat == 'G013_25') ? true : false;
 			}
 		},
 		{headerName: "지연일", field: "delvDelayDays", width: 85, cellClass: 'text-center'},
-		{
-			headerName: "주문번호", field: "ordNo", width: 95, cellClass: 'text-center',
+		{headerName: "주문번호", field: "ordNo", width: 95, cellClass: 'text-center',
 			cellRenderer: function (params) {
-				var roleCd = [[${sessionInfo.roleCd}]];
-				if (!roleCd.startsWith("C")) {
+				if (roleCd.indexOf("C") < 0) {
 					return "<a href=\"javascript:void(0);\" onclick=\"cfnOpenOrderDetailPopup('" + params.value + "');\">" + params.value + "</a>";
 				} else {
 					return params.value;
@@ -243,24 +258,20 @@
 		{headerName: "사이트", field: "siteNm", width: 120, cellClass: 'text-center'},
 		{headerName: "판매몰", field: "sellStoreNm", width: 150, cellClass: 'text-left'},
 		{headerName: "판매몰명", field: "extmallNm", width: 150, cellClass: 'text-left'},
-		{
-			headerName: "주문일시", field: "ordDt", width: 150, cellClass: 'text-center',
+		{headerName: "주문일시", field: "ordDt", width: 150, cellClass: 'text-center',
 			cellRenderer: function (params) {
 				return !gagajf.isNull(params.value) ? gagaAgGrid.toDateTimeFormat(params.value) : '';
 			}
 		},
-		{
-			headerName: "결제일시", field: "ordDt", width: 150, cellClass: 'text-center',
+		{headerName: "결제일시", field: "ordDt", width: 150, cellClass: 'text-center',
 			cellRenderer: function (params) {
 				return !gagajf.isNull(params.value) ? gagaAgGrid.toDateTimeFormat(params.value) : '';
 			}
 		},
 		{headerName: "몰구분", field: "mallGbNm", width: 70, cellClass: 'text-center'},
-		{
-			headerName: "주문자", field: "orderNm", width: 100, cellClass: 'text-center',
+		{headerName: "주문자", field: "orderNm", width: 100, cellClass: 'text-center',
 			cellRenderer: function (params) {
-				var roleCd = [[${sessionInfo.roleCd}]];
-				if (!roleCd.startsWith("C") && !gagajf.isNull(params.value) && params.data.mallGb === '10') {
+				if (roleCd.indexOf("C") < 0 && !gagajf.isNull(params.value) && params.data.mallGb === 'G011_10') {
 					return '<a href="javascript:void(0);" onclick=\"cfnOpenCustDetailPopup(' + params.data.custNo + ');\">' + params.data.orderNm + '</a>';
 				} else {
 					return params.data.orderNm;
@@ -269,31 +280,38 @@
 		},
 		{headerName: "수령인", field: "recipNm", width: 100, cellClass: 'text-center'},
 		{headerName: "공급업체", field: "supplyCompNm", width: 150, cellClass: 'text-center'},
-		{
-			headerName: "상품코드", field: "goodsCd", width: 120, cellClass: 'text-center',
+		{headerName: "상품코드", field: "goodsCd", width: 120, cellClass: 'text-center',
 			cellRenderer: function (params) {
-				var roleCd = [[${sessionInfo.roleCd}]];
-				if (!roleCd.startsWith("C")) {
+				if (roleCd.indexOf("C") < 0) {
 					return "<a href=\"javascript:void(0);\" onclick=\"cfnOpenGoodsDetailPopup('U','" + params.value + "');\">" + params.value + "</a>";
 				} else {
 					return params.value;
 				}
 			}
 		},
+		{headerName: "구성유형", field: "goodsTypeNm", width: 130, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				var option;
+				if (params.data.goodsType == 'G056_S') {
+					option = "<a href=\"javascript:void(0);\" onclick=\"fnOrderDetailItemForm('" + params.data.ordDtlNo + "');\">" + params.value + "</a>";
+				} else {
+					option = params.value
+				}
+				return option;
+			}
+		},
 		{headerName: "상품명", field: "goodsNm", width: 280, cellClass: 'text-left'},
 		{headerName: "색상", field: "colorKnm", width: 120, cellClass: 'text-center'},
 		{headerName: "사이즈", field: "sizeCd", width: 70, cellClass: 'text-center'},
 		{headerName: "주문수량", field: "ordQty", width: 80, cellClass: 'text-center'},
 		{headerName: "취소수량", field: "cnclRtnQty", width: 80, cellClass: 'text-center'},
 		{headerName: "판매수량", field: "saleQty", width: 80, cellClass: 'text-center'},
-		{
-			headerName: "판매금액", field: "saleAmt", width: 100, cellClass: 'text-center'
+		{headerName: "판매금액", field: "saleAmt", width: 100, cellClass: 'text-center'
 			, valueFormatter: function (params) {
 				return params.value.addComma();
 			}
 		},
-		{
-			headerName: "실결제금액", field: "realOrdAmt", width: 100, cellClass: 'text-center'
+		{headerName: "실결제금액", field: "realOrdAmt", width: 100, cellClass: 'text-center'
 			, valueFormatter: function (params) {
 				return params.value.addComma();
 			}
@@ -302,15 +320,14 @@
 		{headerName: "출고처", field: "delvLocCd", width: 100, cellClass: 'text-center'},
 		{headerName: "출고처명", field: "delvLocNm", width: 100, cellClass: 'text-center'},
 		{headerName: "쇼핑백", field: "sbagEncloseYn", width: 80, cellClass: 'text-center'},
-		{
-			headerName: "출고택배사", field: "shipCompCd", width: 170, cellClass: 'text-center'
+		{headerName: "출고택배사", field: "shipCompCd", width: 170, cellClass: 'text-center'
 			, valueGetter: function (params) { return gagaAgGrid.lookupValue(shipCompanyList, params.data.shipCompCd); }
 		},
 		{headerName: "출고송장", field: "invoiceNo", width: 150, cellClass: 'text-left'},
 		{headerName: "송장등록수정", field: "invoiceNo", width: 120, cellClass: 'text-center'
 			, cellRenderer : function (params) {
 				var buttonTag = '';
-				if (Number(params.data.ordDtlStat) >= 20 && Number(params.data.ordDtlStat) <= 50 ) {
+				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;
@@ -319,7 +336,7 @@
 		{headerName: "배송완료처리", field: "ordDtlStat", width: 120, cellClass: 'text-center'
 			, cellRenderer: function(params) {
 				var buttonTag = '';
-				if (params.data.ordDtlStat === '40' || params.data.ordDtlStat === '50' || params.data.ordDtlStat === '55' ) {
+				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>';
 				}
 				return buttonTag;
@@ -340,9 +357,9 @@
 	//gridOptions.defaultColDef.editable = true;
 
 	gridOptions.suppressRowClickSelection = true;
-	gridOptions.rowSelection = 'multiple';
+	//gridOptions.rowSelection = 'multiple';
 	gridOptions.isRowSelectable = function(rowNode) {
-		return rowNode.data.ordDtlStat == '20' || rowNode.data.ordDtlStat == '25' || rowNode.data.ordDtlStat == '30' || rowNode.data.ordDtlStat == '34' || rowNode.data.ordDtlStat == '35';
+		return rowNode.data.ordDtlStat == 'G013_20' || rowNode.data.ordDtlStat == 'G013_25';
 	}
 	gridOptions.getRowStyle = function (params) {
 		if (params.data.ordExchGb === 'Y') {
@@ -353,13 +370,19 @@
 	var fnInitCalendar = function () {
 		$(".btnToday").trigger('click');
 	}
-
-	// 조회
+	
+	/*************************************************************************
+	* 조회 클릭
+	**************************************************************************/
 	$('#btnSearch').on('click', function () {
 		fnSearchList();
 	});
 
+	/*************************************************************************
+	* 조회 
+	**************************************************************************/	
 	var fnSearchList = function () {
+	
 		if ($('#searchForm input[name=ordNo]').val() == '') {
 			if ($('#stDate').val() == '') {
 				mcxDialog.alert('시작 기간을 입력하세요.');
@@ -372,19 +395,44 @@
 			}
 		}
 
-		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', function () {
-		});
+		gagaPaging.init('searchForm', fnSearchCallBack, 'deliveryListPagination', $('#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.deliveryList);
+		gagaPaging.createPagination(result.pageing.pageable);
+		
+	}
+	
+
+	/*************************************************************************
+	* 구성상품 내역 팝업 호출 
+	**************************************************************************/	
+	var fnOrderDetailItemForm = function (ordDtlNo) {
+		var actionUrl = "/delivery/detail/item/form/" + ordDtlNo;
+		cfnOpenModalPopup(actionUrl, 'popupDeliveryDetailItemForm');
+	}
+	
+	
+	/*************************************************************************
+	* 엑셀다운로드 
+	**************************************************************************/		
 	$('#btnExcel').on('click', function () {
 		var totalRows = gridOptions.api.getDisplayedRowCount();
 		if (totalRows == 0) {
 			mcxDialog.alert('조회된 내역이 없습니다.');
 			return;
 		}
-
-
 		var date = new Date().format("YYYYMMDDHHmmss");
 		var params = {
 
@@ -404,11 +452,13 @@
 				dataType: 'string'
 			}
 		]
-
 		gridOptions.api.exportDataAsExcel(params);
 	});
 
-	// 결품처리 버튼 클릭 시
+
+	/*************************************************************************
+	* 품절처리
+	**************************************************************************/		
 	$('#btnSoldout').on('click', function () {
 		var removedData = gagaAgGrid.removeRowData(gridOptions);
 
@@ -440,7 +490,10 @@
 		});
 	});
 
-	// 배송완료처리
+	
+	/*************************************************************************
+	* 배송완료처리 -수동
+	**************************************************************************/		
 	var deliveryComplete = function (orgOrdDtlStat, ordNo, ordDtlNo) {
 		mcxDialog.confirm('배송완료 처리를 하시겠습니까?', {
 			cancelBtnText: "취소",
@@ -458,79 +511,23 @@
 
 	}
 
-	// 송장변경 팝업
+
+	/*************************************************************************
+	* 송장변경 팝업호출
+	**************************************************************************/			
 	var fnSaveInvoiceNo = function (ordDtlNo) {
-		var actionUrl = "/delivery/save/invoice/form?ordDtlNo=" + ordDtlNo ;
-		cfnOpenModalPopup(actionUrl, 'popupSaveInvoice');
+		var actionUrl = "/delivery/save/invoice/form/" + ordDtlNo ;
+		cfnOpenModalPopup(actionUrl, 'popupChangeInvoice');
 	};
 
-
-	// 배송정보 저장
-	var deliveryInfoSave = function () {
-
-		var changeData = gagaAgGrid.getChangedData(gridOptions);
-
-		if (changeData.length < 1) {
-			mcxDialog.alert('변경 된 데이터가 없습니다.');
-			return;
-		}
-
-		mcxDialog.confirm('저장 하시겠습니까?', {
-			cancelBtnText: "취소",
-			sureBtnText: "확인",
-			sureBtnClick: function () {
-				var updatedData = [];
-
-				$.each(changeData, function (idx, item) {
-					var param = new Object;
-					param.shipCompCd = item.shipCompCd;
-					param.invoiceNo = item.invoiceNo;
-					param.ordDtlNo = item.ordDtlNo;
-
-					updatedData.push(param);
-				});
-
-				var jsonData = JSON.stringify(updatedData);
-				gagajf.ajaxJsonSubmit('/delivery/orderDetail/save', jsonData, fnSearchList);
-			}
-		});
-	}
-
-
-	// 벤더 콤보박스 변경 시
-	$('#searchForm select[name=vendorId]').on('change', function () {
-		var actionUrl = '/renderer/vendor/extmall/list/' + $(this).val();
-		cfnCreateCombo(actionUrl, $('#searchForm select[name=extmallId]'), "[전체]");
-	});
-
-
-	// 몰구분 콤보박스 변경 시
-	$('#searchForm select[name=mallGb]').on('change', function () {
-		if ($(this).val() == '10') { // 자사몰
-			$('#extmallVendor').hide();
-			$('#selfmall').show();
-			$('#searchForm select[name=vendorId]').val('');
-			$('#searchForm select[name=extmallId]').val('');
-		} else if ($(this).val() == '20') { // 외부몰
-			$('#selfmall').hide();
-			$('#extmallVendor').show();
-			$('#searchForm select[name=supplyCompCd]').val('');
-		} else {
-			$('#selfmall').hide();
-			$('#extmallVendor').hide();
-			$('#searchForm select[name=vendorId]').val('');
-			$('#searchForm select[name=supplyCompCd]').val('');
-			$('#searchForm select[name=extmallId]').val('');
-		}
-	});
-
+	/*************************************************************************
+	* init
+	**************************************************************************/	
 	$(document).ready(function () {
 		gagaAgGrid.createGrid('gridDeliveryList', gridOptions);
 		var hideList = ["btnThisWeek", "btnYesterWeek", "btnRecentMonth", "btnThisMonth", "btnYesterMonth", "btnRecent3Month"];
 		cfnCreateCalendar('#terms', 'stDate', 'edDate', true, '주문', '', hideList);
 		$(".btnToday").trigger('click');
-		$('#extmallVendor').hide();
-		$('#selfmall').hide();
 		$('#searchForm select[name=mallGb]').trigger('change');
 		//uifnFitGrid('auto'); // TO-BE 지워야됨  
 	});

+ 4 - 1
src/main/webapp/ux/css/admin.ui.css

@@ -926,4 +926,7 @@ table.mtz-monthpicker {border:1px solid #ddd; border-top:none;}
   input[type="date"], input[type="month"], input[type="time"],
   input[type="week"], input[type="number"], input[type="email"],
   input[type="url"]{ font-size:16px;}
-}
+}
+.cell-span {
+	background-color: #FFFFFF;
+}