Просмотр исходного кода

Merge branch 'develop' into card007

card007 4 лет назад
Родитель
Сommit
06ff20f0ab

+ 46 - 36
src/main/java/com/style24/admin/biz/dao/TsaSettleDao.java

@@ -1,36 +1,46 @@
-package com.style24.admin.biz.dao;
-
-import java.util.Collection;
-
-import com.style24.core.support.annotation.ShopDs;
-import com.style24.persistence.domain.AflinkFee;
-import com.style24.persistence.domain.GoodsSettle;
-
-/**
- * 정산 Dao
- *
- * @author gagamel
- * @since 2021. 1. 20
- */
-@ShopDs
-public interface TsaSettleDao {
-
-	/**
-	 * 상품정산 목록
-	 * @param goodsSettle - 상품정산 정보
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 7. 5
-	 */
-	Collection<GoodsSettle> getGoodsSettleList(GoodsSettle goodsSettle);
-
-	/**
-	 * 제휴채널정산 목록
-	 * @param afLinkFee - 제휴채널정산 정보
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 1. 20
-	 */
-	Collection<AflinkFee> getAfLinkFeeList(AflinkFee afLinkFee);
-
-}
+package com.style24.admin.biz.dao;
+
+import java.util.Collection;
+
+import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.AflinkFee;
+import com.style24.persistence.domain.DelvFeeSettle;
+import com.style24.persistence.domain.GoodsSettle;
+
+/**
+ * 정산 Dao
+ *
+ * @author gagamel
+ * @since 2021. 1. 20
+ */
+@ShopDs
+public interface TsaSettleDao {
+
+	/**
+	 * 상품정산 목록
+	 * @param goodsSettle - 상품정산 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 7. 5
+	 */
+	Collection<GoodsSettle> getGoodsSettleList(GoodsSettle goodsSettle);
+
+	/**
+	 * 배송비정산 목록
+	 * @param delvFeeSettle - 배송비정산 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 7. 6
+	 */
+	Collection<DelvFeeSettle> getDeliveryFeeSettleList(DelvFeeSettle delvFeeSettle);
+
+	/**
+	 * 제휴채널정산 목록
+	 * @param afLinkFee - 제휴채널정산 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	Collection<AflinkFee> getAfLinkFeeList(AflinkFee afLinkFee);
+
+}

+ 61 - 49
src/main/java/com/style24/admin/biz/service/TsaSettleService.java

@@ -1,49 +1,61 @@
-package com.style24.admin.biz.service;
-
-import java.util.Collection;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.style24.admin.biz.dao.TsaSettleDao;
-import com.style24.persistence.domain.AflinkFee;
-import com.style24.persistence.domain.GoodsSettle;
-
-import lombok.extern.slf4j.Slf4j;
-
-/**
- * 정산 Service
- *
- * @author gagamel
- * @since 2021. 1. 20
- */
-@Service
-@Slf4j
-public class TsaSettleService {
-
-	@Autowired
-	private TsaSettleDao settleDao;
-
-	/**
-	 * 상품정산 목록
-	 * @param goodsSettle - 상품정산 정보
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 7. 5
-	 */
-	public Collection<GoodsSettle> getGoodsSettleList(GoodsSettle goodsSettle) {
-		return settleDao.getGoodsSettleList(goodsSettle);
-	}
-
-	/**
-	 * 제휴채널정산 목록
-	 * @param afLinkFee - 제휴채널수수료 정보
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 1. 20
-	 */
-	public Collection<AflinkFee> getAfLinkFeeList(AflinkFee afLinkFee) {
-		return settleDao.getAfLinkFeeList(afLinkFee);
-	}
-
-}
+package com.style24.admin.biz.service;
+
+import java.util.Collection;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.style24.admin.biz.dao.TsaSettleDao;
+import com.style24.persistence.domain.AflinkFee;
+import com.style24.persistence.domain.DelvFeeSettle;
+import com.style24.persistence.domain.GoodsSettle;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 정산 Service
+ *
+ * @author gagamel
+ * @since 2021. 1. 20
+ */
+@Service
+@Slf4j
+public class TsaSettleService {
+
+	@Autowired
+	private TsaSettleDao settleDao;
+
+	/**
+	 * 상품정산 목록
+	 * @param goodsSettle - 상품정산 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 7. 5
+	 */
+	public Collection<GoodsSettle> getGoodsSettleList(GoodsSettle goodsSettle) {
+		return settleDao.getGoodsSettleList(goodsSettle);
+	}
+
+	/**
+	 * 배송비정산 목록
+	 * @param delvFeeSettle - 배송비정산 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 7. 6
+	 */
+	public Collection<DelvFeeSettle> getDeliveryFeeSettleList(DelvFeeSettle delvFeeSettle) {
+		return settleDao.getDeliveryFeeSettleList(delvFeeSettle);
+	}
+
+	/**
+	 * 제휴채널정산 목록
+	 * @param afLinkFee - 제휴채널수수료 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	public Collection<AflinkFee> getAfLinkFeeList(AflinkFee afLinkFee) {
+		return settleDao.getAfLinkFeeList(afLinkFee);
+	}
+
+}

+ 279 - 245
src/main/java/com/style24/admin/biz/web/TsaSettleController.java

@@ -1,245 +1,279 @@
-package com.style24.admin.biz.web;
-
-import java.util.Collection;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.servlet.ModelAndView;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.style24.admin.biz.service.TsaRendererService;
-import com.style24.admin.biz.service.TsaSettleService;
-import com.style24.admin.support.controller.TsaBaseController;
-import com.style24.admin.support.security.session.TsaSession;
-import com.style24.persistence.domain.AflinkFee;
-import com.style24.persistence.domain.GoodsSettle;
-
-import lombok.extern.slf4j.Slf4j;
-
-/**
- * 정산 Controller
- *
- * @author jaewonHo
- * @since 2020. 10. 22
- */
-@Controller
-@RequestMapping("/settle")
-@Slf4j
-public class TsaSettleController extends TsaBaseController {
-
-	@Autowired
-	private TsaSettleService settleService;
-
-	@Autowired
-	private TsaRendererService rendererService;
-
-	@Autowired
-	private ObjectMapper mapper;
-
-	/**
-	 * 상품정산 화면
-	 * @return
-	 * @author gagamel
-	 * @since 2020. 10. 22
-	 */
-	@GetMapping("/goods/form")
-	public ModelAndView goodsSettleForm() {
-		ModelAndView mav = new ModelAndView();
-
-		// 몰구분
-		mav.addObject("mallGbList", rendererService.getCommonCodeList("G011"));
-
-		// 외부몰벤더 콤보박스 목록
-		mav.addObject("vendorList", rendererService.getCommonCodeList("G003"));
-
-		// 공급업체
-		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
-
-		// 유통구분
-		mav.addObject("distributionGbList", rendererService.getCommonCodeList("G065"));
-
-		mav.setViewName("settle/GoodsSettleForm");
-
-		return mav;
-	}
-
-	/**
-	 * 상품정산 목록
-	 * @param goodsSettle - 상품정산 정보
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 7. 5
-	 */
-	@PostMapping("/goods/list")
-	@ResponseBody
-	public Collection<GoodsSettle> getGoodsSettleList(@RequestBody GoodsSettle goodsSettle) {
-		if (!StringUtils.isBlank(goodsSettle.getSupplyCompList())) {
-			try {
-				String[] arrSupplyComp = mapper.readValue(goodsSettle.getSupplyCompList(), String[].class);
-				goodsSettle.setMultiSupplyComp(arrSupplyComp);
-			} catch (Exception e) {
-				e.printStackTrace();
-				throw new IllegalStateException("업체코드 검색중 오류로 인해 조회되지 않았습니다.");
-			}
-		}
-
-		if (!StringUtils.isBlank(goodsSettle.getBrandList())) {
-			try {
-				String[] arrBrandCd = mapper.readValue(goodsSettle.getBrandList(), String[].class);
-				goodsSettle.setMultiBrand(arrBrandCd);
-			} catch (Exception e) {
-				e.printStackTrace();
-				throw new IllegalStateException("브랜드코드 검색중 오류로 인해 조회되지 않았습니다.");
-			}
-		}
-
-		return settleService.getGoodsSettleList(goodsSettle);
-	}
-
-	/**
-	 * 배송비정산 화면
-	 * @return
-	 * @author gagamel
-	 * @since 2020. 10. 22
-	 **/
-	@GetMapping("/delivery/fee/form")
-	public ModelAndView deliveryFeeSettleForm() {
-		ModelAndView mav = new ModelAndView();
-
-		// 공급업체
-		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
-
-		// 유통구분
-		mav.addObject("distributionGbList", rendererService.getCommonCodeList("G065"));
-
-		mav.setViewName("settle/DeliveryFeeSettleForm");
-
-		return mav;
-	}
-
-	/**
-	 * 정산확정관리 화면
-	 * @return
-	 * @author gagamel
-	 * @since 2020. 10. 22
-	 */
-	@GetMapping("/confirm/form")
-	public ModelAndView settleConfirmForm() {
-		ModelAndView mav = new ModelAndView();
-
-		// 공급업체
-		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
-
-		// 유통구분
-		mav.addObject("distributionGbList", rendererService.getCommonCodeList("G065"));
-
-		// 은행
-		mav.addObject("bankList", rendererService.getCommonCodeList("G940"));
-
-		mav.setViewName("settle/SettleConfirmForm");
-
-		return mav;
-	}
-
-	/**
-	 * 업체별정산내역 화면
-	 * @return
-	 * @author gagamel
-	 * @since 2020. 10. 22
-	 */
-	@GetMapping("/supply/company/form")
-	public ModelAndView supplyCompanySettleForm() {
-		ModelAndView mav = new ModelAndView();
-
-		// 공급업체
-		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
-
-		mav.setViewName("settle/SupplyCompanySettleForm");
-
-		return mav;
-	}
-
-	/**
-	 * PG입금정산 화면
-	 * @return
-	 * @author gagamel
-	 * @since 2020. 10. 22
-	 */
-	@GetMapping("/pg/deposit/form")
-	public ModelAndView paygateDepositForm() {
-		ModelAndView mav = new ModelAndView();
-
-		// 공급업체
-		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
-
-		// PG구분
-		mav.addObject("pgGbList", rendererService.getCommonCodeList("G015"));
-
-		// 결제수단
-		mav.addObject("payMeansList", rendererService.getCommonCodeList("G014"));
-
-		mav.setViewName("settle/PgDepositSettleForm");
-
-		return mav;
-	}
-
-	/**
-	 * 상품권정산 화면
-	 * @return
-	 * @author gagamel
-	 * @since 2020. 10. 22
-	 */
-	@GetMapping("/giftcard/form")
-	public ModelAndView giftcardForm() {
-		ModelAndView mav = new ModelAndView();
-
-		// 공급업체
-		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
-
-		// PG구분
-		mav.addObject("pgGbList", rendererService.getCommonCodeList("G015"));
-
-		// 결제수단
-		mav.addObject("payMeansList", rendererService.getCommonCodeList("G014"));
-
-		mav.setViewName("settle/GiftcardSettleForm");
-
-		return mav;
-	}
-
-	/**
-	 * 제휴채널정산 화면
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 1. 20
-	 */
-	@GetMapping("/aflink/fee/form")
-	public ModelAndView afLinkFeeForm() {
-		ModelAndView mav = new ModelAndView("settle/AfLinkSettleForm");
-
-		// 제휴채널 목록
-		mav.addObject("afChannelList", rendererService.getAvailCommonCodeList("G053"));
-
-		return mav;
-	}
-
-	/**
-	 * 제휴채널정산 목록
-	 * @param aflinkFee - 제휴채널수수료 정보
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 1. 20
-	 */
-	@PostMapping("/aflink/fee/list")
-	@ResponseBody
-	public Collection<AflinkFee> getAfLinkFeeList(@RequestBody AflinkFee aflinkFee) {
-		return settleService.getAfLinkFeeList(aflinkFee);
-	}
-
-}
+package com.style24.admin.biz.web;
+
+import java.util.Collection;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.style24.admin.biz.service.TsaRendererService;
+import com.style24.admin.biz.service.TsaSettleService;
+import com.style24.admin.support.controller.TsaBaseController;
+import com.style24.admin.support.security.session.TsaSession;
+import com.style24.persistence.domain.AflinkFee;
+import com.style24.persistence.domain.DelvFeeSettle;
+import com.style24.persistence.domain.GoodsSettle;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 정산 Controller
+ *
+ * @author jaewonHo
+ * @since 2020. 10. 22
+ */
+@Controller
+@RequestMapping("/settle")
+@Slf4j
+public class TsaSettleController extends TsaBaseController {
+
+	@Autowired
+	private TsaSettleService settleService;
+
+	@Autowired
+	private TsaRendererService rendererService;
+
+	@Autowired
+	private ObjectMapper mapper;
+
+	/**
+	 * 상품정산 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 22
+	 */
+	@GetMapping("/goods/form")
+	public ModelAndView goodsSettleForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 몰구분
+		mav.addObject("mallGbList", rendererService.getCommonCodeList("G011"));
+
+		// 외부몰벤더 콤보박스 목록
+		mav.addObject("vendorList", rendererService.getCommonCodeList("G003"));
+
+		// 공급업체
+		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
+
+		// 유통구분
+		mav.addObject("distributionGbList", rendererService.getCommonCodeList("G065"));
+
+		mav.setViewName("settle/GoodsSettleForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품정산 목록
+	 * @param goodsSettle - 상품정산 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 7. 5
+	 */
+	@PostMapping("/goods/list")
+	@ResponseBody
+	public Collection<GoodsSettle> getGoodsSettleList(@RequestBody GoodsSettle goodsSettle) {
+		if (!StringUtils.isBlank(goodsSettle.getSupplyCompList())) {
+			try {
+				String[] arrSupplyComp = mapper.readValue(goodsSettle.getSupplyCompList(), String[].class);
+				goodsSettle.setMultiSupplyComp(arrSupplyComp);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("업체코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}
+
+		if (!StringUtils.isBlank(goodsSettle.getBrandList())) {
+			try {
+				String[] arrBrandCd = mapper.readValue(goodsSettle.getBrandList(), String[].class);
+				goodsSettle.setMultiBrand(arrBrandCd);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("브랜드코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}
+
+		return settleService.getGoodsSettleList(goodsSettle);
+	}
+
+	/**
+	 * 배송비정산 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 22
+	 **/
+	@GetMapping("/delivery/fee/form")
+	public ModelAndView deliveryFeeSettleForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 공급업체
+		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
+
+		// 유통구분
+		mav.addObject("distributionGbList", rendererService.getCommonCodeList("G065"));
+
+		mav.setViewName("settle/DeliveryFeeSettleForm");
+
+		return mav;
+	}
+
+	/**
+	 * 배송비정산 목록
+	 * @param delvFeeSettle - 배송비정산 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 7. 6
+	 */
+	@PostMapping("/delivery/fee/list")
+	@ResponseBody
+	public Collection<DelvFeeSettle> getDeliveryFeeSettleList(@RequestBody DelvFeeSettle delvFeeSettle) {
+		if (!StringUtils.isBlank(delvFeeSettle.getSupplyCompList())) {
+			try {
+				String[] arrSupplyComp = mapper.readValue(delvFeeSettle.getSupplyCompList(), String[].class);
+				delvFeeSettle.setMultiSupplyComp(arrSupplyComp);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("업체코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}
+
+		if (!StringUtils.isBlank(delvFeeSettle.getBrandList())) {
+			try {
+				String[] arrBrandCd = mapper.readValue(delvFeeSettle.getBrandList(), String[].class);
+				delvFeeSettle.setMultiBrand(arrBrandCd);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("브랜드코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}
+
+		return settleService.getDeliveryFeeSettleList(delvFeeSettle);
+	}
+
+	/**
+	 * 정산확정관리 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 22
+	 */
+	@GetMapping("/confirm/form")
+	public ModelAndView settleConfirmForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 공급업체
+		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
+
+		// 유통구분
+		mav.addObject("distributionGbList", rendererService.getCommonCodeList("G065"));
+
+		// 은행
+		mav.addObject("bankList", rendererService.getCommonCodeList("G940"));
+
+		mav.setViewName("settle/SettleConfirmForm");
+
+		return mav;
+	}
+
+	/**
+	 * 업체별정산내역 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 22
+	 */
+	@GetMapping("/supply/company/form")
+	public ModelAndView supplyCompanySettleForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 공급업체
+		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
+
+		mav.setViewName("settle/SupplyCompanySettleForm");
+
+		return mav;
+	}
+
+	/**
+	 * PG입금정산 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 22
+	 */
+	@GetMapping("/pg/deposit/form")
+	public ModelAndView paygateDepositForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 공급업체
+		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
+
+		// PG구분
+		mav.addObject("pgGbList", rendererService.getCommonCodeList("G015"));
+
+		// 결제수단
+		mav.addObject("payMeansList", rendererService.getCommonCodeList("G014"));
+
+		mav.setViewName("settle/PgDepositSettleForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품권정산 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 22
+	 */
+	@GetMapping("/giftcard/form")
+	public ModelAndView giftcardForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 공급업체
+		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
+
+		// PG구분
+		mav.addObject("pgGbList", rendererService.getCommonCodeList("G015"));
+
+		// 결제수단
+		mav.addObject("payMeansList", rendererService.getCommonCodeList("G014"));
+
+		mav.setViewName("settle/GiftcardSettleForm");
+
+		return mav;
+	}
+
+	/**
+	 * 제휴채널정산 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	@GetMapping("/aflink/fee/form")
+	public ModelAndView afLinkFeeForm() {
+		ModelAndView mav = new ModelAndView("settle/AfLinkSettleForm");
+
+		// 제휴채널 목록
+		mav.addObject("afChannelList", rendererService.getAvailCommonCodeList("G053"));
+
+		return mav;
+	}
+
+	/**
+	 * 제휴채널정산 목록
+	 * @param aflinkFee - 제휴채널수수료 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	@PostMapping("/aflink/fee/list")
+	@ResponseBody
+	public Collection<AflinkFee> getAfLinkFeeList(@RequestBody AflinkFee aflinkFee) {
+		return settleService.getAfLinkFeeList(aflinkFee);
+	}
+
+}

+ 38 - 0
src/main/java/com/style24/persistence/domain/DelvFeeSettle.java

@@ -0,0 +1,38 @@
+package com.style24.persistence.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.style24.persistence.TscBaseDomain;
+
+import lombok.Data;
+
+/**
+ * 배송비정산 Domain
+ *
+ * @author gagamel
+ * @since 2021. 7. 6
+ */
+@SuppressWarnings("serial")
+@Data
+public class DelvFeeSettle extends TscBaseDomain {
+
+	private String occurDt;				// 발생(출고/회수)일시
+	private String supplyCompCd;		// 공급업체코드
+	private String supplyCompNm;		// 공급업체명
+	private String distributionGb;		// 유통구분
+	private String distributionGbNm;	// 유통구분명
+	private String delvFeeGb;			// 배송비구분
+	private String delvFeeGbNm;			// 배송비구분명
+	private Integer ordNo;				// 주문번호
+	private int delvFee;				// 배송비
+
+	// 검색조건
+	private String salesStdt;			// 매출시작일자
+	private String salesEddt;			// 매출종료일자
+	private String supplyCompList;		// 공급업체코드목록
+	private String brandList;			// 브랜드코드목록
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiBrand;
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiSupplyComp;
+
+}

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

@@ -135,6 +135,8 @@ public class GoodsCategory extends TscBaseDomain {
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] multiSupplyCompCd;
 
+	private String mdNo;
+
 	// Pagination
 	private TscPageRequest pageable;
 	private int pageNo = 1;

+ 298 - 242
src/main/java/com/style24/persistence/mybatis/shop/TsaSettle.xml

@@ -1,243 +1,299 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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.TsaSettleDao">
-
-	<!-- 상품정산 목록 -->
-	<select id="getGoodsSettleList" parameterType="GoodsSettle" resultType="GoodsSettle">
-		/* TsaSettle.getGoodsSettleList */
-		SELECT ODIH.ORD_NO                                                         /*주문번호*/
-		     , ODIH.ORD_DTL_NO                                                     /*주문상세번호*/
-		     , ODIH.MALL_GB                                                        /*몰구분*/
-		     , ODIH.MALL_GB_NM                                                     /*몰구분명*/
-		     , ODIH.EXTMALL_ORDER_ID                                               /*제휴몰주문번호*/
-		     , ODIH.EXTMALL_ID                                                     /*제휴몰ID*/
-		     , ODIH.EXTMALL_NM                                                     /*제휴몰명*/
-		     , ODIH.SUPPLY_COMP_CD                                                 /*공급업체코드*/
-		     , ODIH.SUPPLY_COMP_NM                                                 /*공급업체명*/
-		     , ODIH.DISTRIBUTION_GB                                                /*유통구분*/
-		     , ODIH.DISTRIBUTION_GB_NM                                             /*유통구분명*/
-		     , ODIH.SETTLE_DAY                                                     /*정산주기*/
-		     , ODIH.SETTLE_DAY_NM                                                  /*정산주기명*/
-		     , ODIH.ORD_DT                                                         /*주문일시*/
-		     , ODIH.SETTLE_GB                                                      /*정산구분*/
-		     , ODIH.SETTLE_GB_NM                                                   /*정산구분명*/
-		     , ODIH.OCCUR_DT                                                       /*발생일시*/
-		     , ODIH.GOODS_CD                                                       /*상품코드*/
-		     , ODIH.GOODS_NM                                                       /*상품명*/
-		     , ODIH.BRAND_CD                                                       /*브랜드코드*/
-		     , ODIH.BRAND_ENM                                                      /*브랜드명*/
-		     , ODIH.MD_NM                                                          /*담당MD*/
-		     , ODIH.ITEM_CD                                                        /*단품코드*/
-		     , ODIH.OPT_CD1                                                        /*옵션코드1*/
-		     , ODIH.OPT_CD2                                                        /*옵션코드2*/
-		     , ODIH.SELL_PRICE                                                     /*판매가*/
-		     , ODIH.SELL_QTY                                                       /*판매수량*/
-		     , ODIH.SELL_AMT                                                       /*판매금액(ORD_AMT에는 CPN1_DC_AMT가 빠진 금액이 들어가 있음)*/
-		     , ODIH.CPN1_DC_AMT                                                    /*즉시사용쿠폰금액*/
-		     , ODIH.GOODS_CPN_DC_AMT                                               /*상품쿠폰사용금액*/
-		     , ODIH.CART_CPN_DC_AMT                                                /*주문서쿠폰사용금액*/
-		     , ODIH.PNT_DC_AMT                                                     /*포인트사용금액*/
-		     , ODIH.TMTB_DC_AMT                                                    /*다다익선할인금액*/
-		     , ODIH.GFCD_USE_AMT                                                   /*상품권사용금액*/
-		     , ODIH.SELF_CPN_DC_AMT                                                /*자사쿠폰분담액*/
-		     , ODIH.SUPPLY_COMP_CPN_DC_AMT                                         /*입점쿠폰분담액*/
-		     , CASE WHEN ODIH.SELL_QTY = 0 THEN 0
-		            ELSE
-		                (ODIH.SELL_AMT
-		                 - (ODIH.CPN1_DC_AMT + ODIH.GOODS_CPN_DC_AMT + ODIH.CART_CPN_DC_AMT)
-		                 - ODIH.TMTB_DC_AMT
-		                ) / ODIH.SELL_QTY
-		       END                                       AS REAL_SELL_PRICE        /*실판매가*/
-		     , ODIH.SELL_AMT
-		       - (ODIH.CPN1_DC_AMT + ODIH.GOODS_CPN_DC_AMT + ODIH.CART_CPN_DC_AMT)
-		       - ODIH.TMTB_DC_AMT                        AS REAL_SELL_AMT          /*실판매금액(=상품총액. 쿠폰과 다다익선만 차감. 상품권과 포인트는 포함)*/
-		     , ODIH.SELL_FEE_RATE                                                  /*판매수수료율*/
-		     , ROUND((ODIH.SELL_AMT
-		              - (ODIH.CPN1_DC_AMT + ODIH.GOODS_CPN_DC_AMT + ODIH.CART_CPN_DC_AMT)
-		              - ODIH.TMTB_DC_AMT
-		             ) * (ODIH.SELL_FEE_RATE / 100),0)   AS SELL_FEE_AMT           /*수수료*/
-		     , (ODIH.SELL_AMT
-		        - (ODIH.CPN1_DC_AMT + ODIH.GOODS_CPN_DC_AMT + ODIH.CART_CPN_DC_AMT)
-		        - ODIH.TMTB_DC_AMT)
-		       - ROUND((ODIH.SELL_AMT
-		                - (ODIH.CPN1_DC_AMT + ODIH.GOODS_CPN_DC_AMT + ODIH.CART_CPN_DC_AMT)
-		                - ODIH.TMTB_DC_AMT
-		               ) * (ODIH.SELL_FEE_RATE / 100),0) AS SETTLE_AMT             /*정산대상액(실판매금액 - 수수료)*/
-		FROM   (
-		        SELECT ODIH.ORD_DTL_ITEM_HST_SQ                                                           /*주문상세단품이력일련번호*/
-		             , ODIH.ORD_NO                                                                        /*주문번호*/
-		             , ODIH.ORD_DTL_NO                                                                    /*주문상세번호*/
-		             , O.MALL_GB                                                                          /*몰구분*/
-		             , FN_GET_CODE_NM('G011',O.MALL_GB)                         AS MALL_GB_NM             /*몰구분명*/
-		             , OD.EXTMALL_ORDER_ID                                                                /*제휴몰주문번호*/
-		             , OD.EXTMALL_ID                                                                      /*제휴몰ID*/
-		             , E.EXTMALL_NM                                                                       /*제휴몰명*/
-		             , OD.SUPPLY_COMP_CD                                                                  /*공급업체코드*/
-		             , SC.SUPPLY_COMP_NM                                                                  /*공급업체명*/
-		             , SC.DISTRIBUTION_GB                                                                 /*유통구분*/
-		             , FN_GET_CODE_NM('G065',SC.DISTRIBUTION_GB)                AS DISTRIBUTION_GB_NM     /*유통구분명*/
-		             , SC.SETTLE_DAY                                                                      /*정산주기*/
-		             , FN_GET_CODE_NM('G075',SC.SETTLE_DAY)                     AS SETTLE_DAY_NM          /*정산주기명*/
-		             , DATE_FORMAT(O.ORD_DT,'%Y-%m-%d %H:%i:%S')                AS ORD_DT                 /*주문일시*/
-		             , ODIH.ORD_DTL_STAT                                        AS SETTLE_GB              /*정산구분*/
-		             , FN_GET_CODE_NM('G720',ODIH.ORD_DTL_STAT)                 AS SETTLE_GB_NM           /*정산구분명*/
-		             , DATE_FORMAT(ODIH.REG_DT,'%Y-%m-%d %H:%i:%S')             AS OCCUR_DT               /*발생일시*/
-		             , OD.GOODS_CD                                                                        /*상품코드*/
-		             , G.GOODS_NM                                                                         /*상품명*/
-		             , G.BRAND_CD                                                                         /*브랜드코드*/
-		             , B.BRAND_ENM                                                                        /*브랜드명*/
-		             , (SELECT U.USER_NM
-		                FROM   TB_BRAND_MD BM
-		                     , TB_USER U
-		                WHERE  BM.MD_NO = U.USER_NO
-		                AND    BM.BRAND_CD = G.BRAND_CD
-		                AND    BM.FORMAL_GB = G.FORMAL_GB
-		                LIMIT 1)                                                AS MD_NM                  /*담당MD*/
-		             , ODIH.ITEM_CD                                                                       /*단품코드*/
-		             , ODIH.OPT_CD1                                                                       /*옵션코드1*/
-		             , ODIH.OPT_CD2                                                                       /*옵션코드2*/
-		             , ODIH.ITEM_PRICE                                          AS SELL_PRICE             /*판매가*/
-		             , (CASE WHEN ODIH.ORD_DTL_STAT = 'G720_20' THEN 1 ELSE -1 END)
-		               *
-		               CAST(CASE WHEN ODIH.ORD_DTL_STAT = 'G720_20'/*판매-배송중*/ THEN
-		                             ODIH.ORD_QTY - ODIH.CNCL_RTN_QTY
-		                         ELSE /*환입-반품완료,환입-교환완료*/
-		                             ODIH.CNCL_RTN_QTY
-		                    END AS SIGNED INT)                                  AS SELL_QTY               /*판매수량*/
-		             , (CASE WHEN ODIH.ORD_DTL_STAT = 'G720_20' THEN 1 ELSE -1 END)
-		               *
-		               CAST(CASE WHEN ODIH.ORD_DTL_STAT = 'G720_20'/*판매-배송중*/ THEN
-		                             ODIH.ORD_AMT - ODIH.CNCL_RTN_AMT + ODIH.CPN1_DC_AMT
-		                         ELSE /*환입-반품완료,환입-교환완료*/
-		                             ODIH.CNCL_RTN_AMT + ODIH.CPN1_DC_AMT
-		                    END AS SIGNED INT)                                  AS SELL_AMT               /*판매금액(ORD_AMT에는 CPN1_DC_AMT가 빠진 금액이 들어가 있음)*/
-		             , ODIH.CPN1_DC_AMT                                                                   /*즉시사용쿠폰금액*/
-		             , ODIH.GOODS_CPN_DC_AMT                                                              /*상품쿠폰사용금액*/
-		             , ODIH.CART_CPN_DC_AMT                                                               /*주문서쿠폰사용금액*/
-		             , ODIH.PNT_DC_AMT                                                                    /*포인트사용금액*/
-		             , ODIH.TMTB1_DC_AMT + ODIH.TMTB2_DC_AMT                    AS TMTB_DC_AMT            /*다다익선할인금액*/
-		             , ODIH.GFCD_USE_AMT                                                                  /*상품권사용금액*/
-		             , ((100 - IFNULL(CB1.BURDEN_RATE,0)) / 100) * ODIH.CPN1_DC_AMT
-		               + ((100 - IFNULL(CB2.BURDEN_RATE,0)) / 100) * ODIH.GOODS_CPN_DC_AMT
-		               + ((100 - IFNULL(CB3.BURDEN_RATE,0)) / 100) * ODIH.CART_CPN_DC_AMT AS SELF_CPN_DC_AMT        /*자사쿠폰분담액*/
-		             , (IFNULL(CB1.BURDEN_RATE,0) / 100) * ODIH.CPN1_DC_AMT
-		               + (IFNULL(CB2.BURDEN_RATE,0) / 100) * ODIH.GOODS_CPN_DC_AMT
-		               + (IFNULL(CB3.BURDEN_RATE,0) / 100) * ODIH.CART_CPN_DC_AMT         AS SUPPLY_COMP_CPN_DC_AMT /*입점쿠폰분담액*/
-		             , CASE WHEN O.MALL_GB = 'G011_10' /*자사몰*/ THEN
-		                        SC.SELL_FEE_RATE
-		                    ELSE /*제휴몰*/
-		                        IFNULL(E.SELL_FEE_RATE,0)
-		               END                                                      AS SELL_FEE_RATE          /*판매수수료율*/
-		        FROM   TB_ORDER_DETAIL_ITEM_HST ODIH
-		        INNER JOIN TB_ORDER_DETAIL OD ON ODIH.ORD_DTL_NO = OD.ORD_DTL_NO
-		        INNER JOIN TB_ORDER O ON ODIH.ORD_NO = O.ORD_NO
-		        INNER JOIN TB_SUPPLY_COMPANY SC ON OD.SUPPLY_COMP_CD = SC.SUPPLY_COMP_CD
-		        INNER JOIN TB_GOODS G ON OD.GOODS_CD = G.GOODS_CD
-		        INNER JOIN TB_BRAND B ON G.BRAND_CD = B.BRAND_CD
-		        LEFT OUTER JOIN TB_EXTMALL E ON OD.EXTMALL_ID = E.EXTMALL_ID
-		        LEFT OUTER JOIN TB_COUPON_BURDEN CB1 ON OD.CPN1_CPN_SQ = CB1.CPN_ID
-		                                            AND OD.SUPPLY_COMP_CD = CB1.SUPPLY_COMP_CD
-		        LEFT OUTER JOIN TB_COUPON_BURDEN CB2 ON OD.GOODS_CPN_SQ = CB1.CPN_ID
-		                                            AND OD.SUPPLY_COMP_CD = CB1.SUPPLY_COMP_CD
-		        LEFT OUTER JOIN TB_COUPON_BURDEN CB3 ON OD.CART_CPN_SQ = CB1.CPN_ID
-		                                            AND OD.SUPPLY_COMP_CD = CB1.SUPPLY_COMP_CD
-		        WHERE  1 = 1
-		        AND    ODIH.REG_DT <![CDATA[>=]]> STR_TO_DATE(#{salesStdt},'%Y-%m-%d')
-		        AND    ODIH.REG_DT <![CDATA[<]]> DATE_ADD(STR_TO_DATE(#{salesEddt},'%Y-%m-%d'), INTERVAL 1 DAY)
-		        AND    ODIH.ORD_DTL_STAT IN ('G720_20','G720_50','G720_60') /*판매-배송중,환입-반품완료,환입-교환완료*/
-		        <if test='distributionGb != null and distributionGb != ""'>
-		        AND    SC.DISTRIBUTION_GB = #{distributionGb}
-		        </if>
-		        <if test='mallGb != null and mallGb != ""'>
-		        AND    O.MALL_GB = #{mallGb}
-		        </if>
-		        <if test='extmallId != null and extmallId != ""'>
-		        AND    OD.EXTMALL_ID = #{extmallId}
-		        </if>
-		        <if test="multiSupplyComp != null and multiSupplyComp != ''">
-		        AND    SC.SUPPLY_COMP_CD IN
-		            <foreach collection="multiSupplyComp" item="item" index="index"  open="(" close=")" separator=",">
-		            #{item}
-		            </foreach>
-		        </if>
-		        <if test="multiBrand != null and multiBrand != ''">
-		        AND    B.BRAND_CD IN
-		            <foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
-		            #{item}
-		            </foreach>
-		        </if>
-		       ) ODIH
-		ORDER  BY ODIH.ORD_DTL_ITEM_HST_SQ
-	</select>
-	
-	<!-- 제휴채널정산 목록 -->
-	<select id="getAfLinkFeeList" parameterType="AfLinkFee" resultType="AfLinkFee">
-		/* TsaSettle.getAfLinkFeeList */
-		SELECT AF_CHANNEL                                         /*상위채널코드*/
-		     , FN_GET_CODE_NM('G053',AF_CHANNEL) AS AF_CHANNEL_NM /*상위채널명*/
-		     , AF_LINK_CD                                         /*채널코드*/
-		     , AF_LINK_NM                                         /*채널명*/
-		     , OCCUR_DT                                           /*발생일시*/
-		     , ORD_NO                                             /*주문번호*/
-		     , ORD_DTL_STAT                                       /*주문상세상태*/
-		     , SUM(SELL_AMT)                     AS SELL_AMT      /*판매금액(상품금액.배송비제외)*/
-		     , SUM(CPN1_DC_AMT +
-		           TMTB1_DC_AMT + TMTB2_DC_AMT +
-		           GOODS_CPN_DC_AMT +
-		           CART_CPN_DC_AMT)              AS CPN_DC_AMT     /*쿠폰할인금액*/
-		     , SUM(PNT_DC_AMT + PRE_PNT_DC_AMT)  AS PNT_DC_AMT     /*포인트할인금액*/
-		     , SUM(GFCD_USE_AMT)                 AS GFCD_USE_AMT   /*상품권사용금액*/
-		     , SUM(SELL_AMT - (CPN1_DC_AMT + TMTB1_DC_AMT + TMTB2_DC_AMT + GOODS_CPN_DC_AMT + CART_CPN_DC_AMT + PG_CPN_AMT)
-		                    - (PNT_DC_AMT + PRE_PNT_DC_AMT)
-		                    - GFCD_USE_AMT)      AS PAY_AMT        /*결제금액(VAT포함)*/
-		     , SUM(TRUNCATE((SELL_AMT - (CPN1_DC_AMT + TMTB1_DC_AMT + TMTB2_DC_AMT + GOODS_CPN_DC_AMT + CART_CPN_DC_AMT + PG_CPN_AMT)
-		                              - (PNT_DC_AMT + PRE_PNT_DC_AMT)
-		                              - GFCD_USE_AMT
-		                    ) / 1.1,0))          AS SALES_AMT      /*매출금액(VAT제외). 건별로 1.1로 나누고 소숫점을 절사하여 합계를 낸다.*/
-		FROM   (
-		        SELECT AL.AF_CHANNEL
-		             , ODH.AF_LINK_CD                                              /*제휴링크코드*/
-		             , AL.AF_LINK_NM
-		             , DATE_FORMAT(ODH.REG_DT,'%Y-%m-%d %m:%h:%s') AS OCCUR_DT     /*발생일자*/
-		             , ODH.ORD_NO
-		             , ODH.ORD_DTL_NO
-		             , CASE WHEN ODH.ORD_DTL_STAT = 'G013_20' THEN
-		                        FN_GET_CODE_NM('G013',ODH.ORD_DTL_STAT)
-		                    ELSE
-		                        IFNULL(FN_GET_CODE_NM('G685',OCD.CHG_STAT),'주문취소')
-		               END                                         AS ORD_DTL_STAT /*주문상세상태*/
-		             , (ODH.ORD_AMT - ODH.CNCL_RTN_AMT)            AS SELL_AMT     /*판매금액(상품금액.배송비제외)*/
-		             , ODH.CPN1_DC_AMT                                             /*1차쿠폰(즉시할인쿠폰)할인금액*/
-		             , ODH.TMTB1_DC_AMT                                            /*다다익선할인금액(수량)*/
-		             , ODH.TMTB2_DC_AMT                                            /*다다익선할인금액(금액)*/
-		             , ODH.GOODS_CPN_DC_AMT                                        /*상품쿠폰할인금액*/
-		             , ODH.CART_CPN_DC_AMT                                         /*장바구니할인금액*/
-		             , 0                                           AS PG_CPN_AMT   /*PG쿠폰금액.TODO:바로 아래 쿼리문으로 대체해야 함*/
-		             -- , ODH.PG_CPN_AMT                                              /*PG쿠폰금액*/
-		             , ODH.PNT_DC_AMT                                              /*포인트할인금액*/
-		             , ODH.PRE_PNT_DC_AMT                                          /*선포인트할인금액*/
-		             , ODH.GFCD_USE_AMT                                            /*상품권사용금액*/
-		        FROM   TB_ORDER_DETAIL_HST ODH
-		        INNER JOIN TB_AF_LINK AL
-		                ON ODH.AF_LINK_CD = AL.AF_LINK_CD
-		        LEFT OUTER JOIN TB_ORDER_CHANGE_DETAIL OCD
-		                     ON ODH.ORD_DTL_NO = OCD.ORD_DTL_NO
-		                    AND OCD.CHG_STAT IN ('G685_21','G685_32','G685_42')	/*취소완료,교환완료,반품완료*/
-		        WHERE  ODH.ORD_DTL_STAT IN ('G013_20','G013_99') /*결제완료,주문취소*/
-		        AND    ODH.REG_DT <![CDATA[>=]]> STR_TO_DATE(#{startDt},'%Y-%m-%d')
-		        AND    ODH.REG_DT <![CDATA[<]]> DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'),INTERVAL 1 DAY)
-		        <if test="ordNo != null and ordNo != ''">
-		        AND    ODH.ORD_NO = #{ordNo}
-		        </if>
-		        <if test="afLinkCd != null and afLinkCd != ''">
-		        AND    AL.AF_LINK_CD = #{afLinkCd}
-		        </if>
-		        <if test="afChannel != null and afChannel != ''">
-		        AND    AL.AF_CHANNEL = #{afChannel}
-		        </if>
-		       ) U
-		GROUP  BY AF_CHANNEL, AF_LINK_CD, AF_LINK_NM, OCCUR_DT, ORD_NO, ORD_DTL_STAT
-		ORDER  BY AF_CHANNEL, AF_LINK_CD, AF_LINK_NM, OCCUR_DT, ORD_NO, ORD_DTL_STAT
-	</select>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!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.TsaSettleDao">
+
+	<!-- 상품정산 목록 -->
+	<select id="getGoodsSettleList" parameterType="GoodsSettle" resultType="GoodsSettle">
+		/* TsaSettle.getGoodsSettleList */
+		SELECT ODIH.ORD_NO                                                         /*주문번호*/
+		     , ODIH.ORD_DTL_NO                                                     /*주문상세번호*/
+		     , ODIH.MALL_GB                                                        /*몰구분*/
+		     , ODIH.MALL_GB_NM                                                     /*몰구분명*/
+		     , ODIH.EXTMALL_ORDER_ID                                               /*제휴몰주문번호*/
+		     , ODIH.EXTMALL_ID                                                     /*제휴몰ID*/
+		     , ODIH.EXTMALL_NM                                                     /*제휴몰명*/
+		     , ODIH.SUPPLY_COMP_CD                                                 /*공급업체코드*/
+		     , ODIH.SUPPLY_COMP_NM                                                 /*공급업체명*/
+		     , ODIH.DISTRIBUTION_GB                                                /*유통구분*/
+		     , ODIH.DISTRIBUTION_GB_NM                                             /*유통구분명*/
+		     , ODIH.SETTLE_DAY                                                     /*정산주기*/
+		     , ODIH.SETTLE_DAY_NM                                                  /*정산주기명*/
+		     , ODIH.ORD_DT                                                         /*주문일시*/
+		     , ODIH.SETTLE_GB                                                      /*정산구분*/
+		     , ODIH.SETTLE_GB_NM                                                   /*정산구분명*/
+		     , ODIH.OCCUR_DT                                                       /*발생일시*/
+		     , ODIH.GOODS_CD                                                       /*상품코드*/
+		     , ODIH.GOODS_NM                                                       /*상품명*/
+		     , ODIH.BRAND_CD                                                       /*브랜드코드*/
+		     , ODIH.BRAND_ENM                                                      /*브랜드명*/
+		     , ODIH.MD_NM                                                          /*담당MD*/
+		     , ODIH.ITEM_CD                                                        /*단품코드*/
+		     , ODIH.OPT_CD1                                                        /*옵션코드1*/
+		     , ODIH.OPT_CD2                                                        /*옵션코드2*/
+		     , ODIH.SELL_PRICE                                                     /*판매가*/
+		     , ODIH.SELL_QTY                                                       /*판매수량*/
+		     , ODIH.SELL_AMT                                                       /*판매금액(ORD_AMT에는 CPN1_DC_AMT가 빠진 금액이 들어가 있음)*/
+		     , ODIH.CPN1_DC_AMT                                                    /*즉시사용쿠폰금액*/
+		     , ODIH.GOODS_CPN_DC_AMT                                               /*상품쿠폰사용금액*/
+		     , ODIH.CART_CPN_DC_AMT                                                /*주문서쿠폰사용금액*/
+		     , ODIH.PNT_DC_AMT                                                     /*포인트사용금액*/
+		     , ODIH.TMTB_DC_AMT                                                    /*다다익선할인금액*/
+		     , ODIH.GFCD_USE_AMT                                                   /*상품권사용금액*/
+		     , ODIH.SELF_CPN_DC_AMT                                                /*자사쿠폰분담액*/
+		     , ODIH.SUPPLY_COMP_CPN_DC_AMT                                         /*입점쿠폰분담액*/
+		     , CASE WHEN ODIH.SELL_QTY = 0 THEN 0
+		            ELSE
+		                (ODIH.SELL_AMT
+		                 - (ODIH.CPN1_DC_AMT + ODIH.GOODS_CPN_DC_AMT + ODIH.CART_CPN_DC_AMT)
+		                 - ODIH.TMTB_DC_AMT
+		                ) / ODIH.SELL_QTY
+		       END                                       AS REAL_SELL_PRICE        /*실판매가*/
+		     , ODIH.SELL_AMT
+		       - (ODIH.CPN1_DC_AMT + ODIH.GOODS_CPN_DC_AMT + ODIH.CART_CPN_DC_AMT)
+		       - ODIH.TMTB_DC_AMT                        AS REAL_SELL_AMT          /*실판매금액(=상품총액. 쿠폰과 다다익선만 차감. 상품권과 포인트는 포함)*/
+		     , ODIH.SELL_FEE_RATE                                                  /*판매수수료율*/
+		     , ROUND((ODIH.SELL_AMT
+		              - (ODIH.CPN1_DC_AMT + ODIH.GOODS_CPN_DC_AMT + ODIH.CART_CPN_DC_AMT)
+		              - ODIH.TMTB_DC_AMT
+		             ) * (ODIH.SELL_FEE_RATE / 100),0)   AS SELL_FEE_AMT           /*수수료*/
+		     , (ODIH.SELL_AMT
+		        - (ODIH.CPN1_DC_AMT + ODIH.GOODS_CPN_DC_AMT + ODIH.CART_CPN_DC_AMT)
+		        - ODIH.TMTB_DC_AMT)
+		       - ROUND((ODIH.SELL_AMT
+		                - (ODIH.CPN1_DC_AMT + ODIH.GOODS_CPN_DC_AMT + ODIH.CART_CPN_DC_AMT)
+		                - ODIH.TMTB_DC_AMT
+		               ) * (ODIH.SELL_FEE_RATE / 100),0) AS SETTLE_AMT             /*정산대상액(실판매금액 - 수수료)*/
+		FROM   (
+		        SELECT ODIH.ORD_DTL_ITEM_HST_SQ                                                           /*주문상세단품이력일련번호*/
+		             , ODIH.ORD_NO                                                                        /*주문번호*/
+		             , ODIH.ORD_DTL_NO                                                                    /*주문상세번호*/
+		             , O.MALL_GB                                                                          /*몰구분*/
+		             , FN_GET_CODE_NM('G011',O.MALL_GB)                         AS MALL_GB_NM             /*몰구분명*/
+		             , OD.EXTMALL_ORDER_ID                                                                /*제휴몰주문번호*/
+		             , OD.EXTMALL_ID                                                                      /*제휴몰ID*/
+		             , E.EXTMALL_NM                                                                       /*제휴몰명*/
+		             , OD.SUPPLY_COMP_CD                                                                  /*공급업체코드*/
+		             , SC.SUPPLY_COMP_NM                                                                  /*공급업체명*/
+		             , SC.DISTRIBUTION_GB                                                                 /*유통구분*/
+		             , FN_GET_CODE_NM('G065',SC.DISTRIBUTION_GB)                AS DISTRIBUTION_GB_NM     /*유통구분명*/
+		             , SC.SETTLE_DAY                                                                      /*정산주기*/
+		             , FN_GET_CODE_NM('G075',SC.SETTLE_DAY)                     AS SETTLE_DAY_NM          /*정산주기명*/
+		             , DATE_FORMAT(O.ORD_DT,'%Y-%m-%d %H:%i:%S')                AS ORD_DT                 /*주문일시*/
+		             , ODIH.ORD_DTL_STAT                                        AS SETTLE_GB              /*정산구분*/
+		             , FN_GET_CODE_NM('G720',ODIH.ORD_DTL_STAT)                 AS SETTLE_GB_NM           /*정산구분명*/
+		             , DATE_FORMAT(ODIH.REG_DT,'%Y-%m-%d %H:%i:%S')             AS OCCUR_DT               /*발생일시*/
+		             , OD.GOODS_CD                                                                        /*상품코드*/
+		             , G.GOODS_NM                                                                         /*상품명*/
+		             , G.BRAND_CD                                                                         /*브랜드코드*/
+		             , B.BRAND_ENM                                                                        /*브랜드명*/
+		             , (SELECT U.USER_NM
+		                FROM   TB_BRAND_MD BM
+		                     , TB_USER U
+		                WHERE  BM.MD_NO = U.USER_NO
+		                AND    BM.BRAND_CD = G.BRAND_CD
+		                AND    BM.FORMAL_GB = G.FORMAL_GB
+		                LIMIT 1)                                                AS MD_NM                  /*담당MD*/
+		             , ODIH.ITEM_CD                                                                       /*단품코드*/
+		             , ODIH.OPT_CD1                                                                       /*옵션코드1*/
+		             , ODIH.OPT_CD2                                                                       /*옵션코드2*/
+		             , ODIH.ITEM_PRICE                                          AS SELL_PRICE             /*판매가*/
+		             , (CASE WHEN ODIH.ORD_DTL_STAT = 'G720_20' THEN 1 ELSE -1 END)
+		               *
+		               CAST(CASE WHEN ODIH.ORD_DTL_STAT = 'G720_20'/*판매-배송중*/ THEN
+		                             ODIH.ORD_QTY - ODIH.CNCL_RTN_QTY
+		                         ELSE /*환입-반품완료,환입-교환완료*/
+		                             ODIH.CNCL_RTN_QTY
+		                    END AS SIGNED INT)                                  AS SELL_QTY               /*판매수량*/
+		             , (CASE WHEN ODIH.ORD_DTL_STAT = 'G720_20' THEN 1 ELSE -1 END)
+		               *
+		               CAST(CASE WHEN ODIH.ORD_DTL_STAT = 'G720_20'/*판매-배송중*/ THEN
+		                             ODIH.ORD_AMT - ODIH.CNCL_RTN_AMT + ODIH.CPN1_DC_AMT
+		                         ELSE /*환입-반품완료,환입-교환완료*/
+		                             ODIH.CNCL_RTN_AMT + ODIH.CPN1_DC_AMT
+		                    END AS SIGNED INT)                                  AS SELL_AMT               /*판매금액(ORD_AMT에는 CPN1_DC_AMT가 빠진 금액이 들어가 있음)*/
+		             , ODIH.CPN1_DC_AMT                                                                   /*즉시사용쿠폰금액*/
+		             , ODIH.GOODS_CPN_DC_AMT                                                              /*상품쿠폰사용금액*/
+		             , ODIH.CART_CPN_DC_AMT                                                               /*주문서쿠폰사용금액*/
+		             , ODIH.PNT_DC_AMT                                                                    /*포인트사용금액*/
+		             , ODIH.TMTB1_DC_AMT + ODIH.TMTB2_DC_AMT                    AS TMTB_DC_AMT            /*다다익선할인금액*/
+		             , ODIH.GFCD_USE_AMT                                                                  /*상품권사용금액*/
+		             , ((100 - IFNULL(CB1.BURDEN_RATE,0)) / 100) * ODIH.CPN1_DC_AMT
+		               + ((100 - IFNULL(CB2.BURDEN_RATE,0)) / 100) * ODIH.GOODS_CPN_DC_AMT
+		               + ((100 - IFNULL(CB3.BURDEN_RATE,0)) / 100) * ODIH.CART_CPN_DC_AMT AS SELF_CPN_DC_AMT        /*자사쿠폰분담액*/
+		             , (IFNULL(CB1.BURDEN_RATE,0) / 100) * ODIH.CPN1_DC_AMT
+		               + (IFNULL(CB2.BURDEN_RATE,0) / 100) * ODIH.GOODS_CPN_DC_AMT
+		               + (IFNULL(CB3.BURDEN_RATE,0) / 100) * ODIH.CART_CPN_DC_AMT         AS SUPPLY_COMP_CPN_DC_AMT /*입점쿠폰분담액*/
+		             , CASE WHEN O.MALL_GB = 'G011_10' /*자사몰*/ THEN
+		                        SC.SELL_FEE_RATE
+		                    ELSE /*제휴몰*/
+		                        IFNULL(E.SELL_FEE_RATE,0)
+		               END                                                      AS SELL_FEE_RATE          /*판매수수료율*/
+		        FROM   TB_ORDER_DETAIL_ITEM_HST ODIH
+		        INNER JOIN TB_ORDER_DETAIL OD ON ODIH.ORD_DTL_NO = OD.ORD_DTL_NO
+		        INNER JOIN TB_ORDER O ON ODIH.ORD_NO = O.ORD_NO
+		        INNER JOIN TB_SUPPLY_COMPANY SC ON OD.SUPPLY_COMP_CD = SC.SUPPLY_COMP_CD
+		        INNER JOIN TB_GOODS G ON OD.GOODS_CD = G.GOODS_CD
+		        INNER JOIN TB_BRAND B ON G.BRAND_CD = B.BRAND_CD
+		        LEFT OUTER JOIN TB_EXTMALL E ON OD.EXTMALL_ID = E.EXTMALL_ID
+		        LEFT OUTER JOIN TB_COUPON_BURDEN CB1 ON OD.CPN1_CPN_SQ = CB1.CPN_ID
+		                                            AND OD.SUPPLY_COMP_CD = CB1.SUPPLY_COMP_CD
+		        LEFT OUTER JOIN TB_COUPON_BURDEN CB2 ON OD.GOODS_CPN_SQ = CB1.CPN_ID
+		                                            AND OD.SUPPLY_COMP_CD = CB1.SUPPLY_COMP_CD
+		        LEFT OUTER JOIN TB_COUPON_BURDEN CB3 ON OD.CART_CPN_SQ = CB1.CPN_ID
+		                                            AND OD.SUPPLY_COMP_CD = CB1.SUPPLY_COMP_CD
+		        WHERE  1 = 1
+		        AND    ODIH.REG_DT <![CDATA[>=]]> STR_TO_DATE(#{salesStdt},'%Y-%m-%d')
+		        AND    ODIH.REG_DT <![CDATA[<]]> DATE_ADD(STR_TO_DATE(#{salesEddt},'%Y-%m-%d'), INTERVAL 1 DAY)
+		        AND    ODIH.ORD_DTL_STAT IN ('G720_20','G720_50','G720_60') /*판매-배송중,환입-반품완료,환입-교환완료*/
+		        <if test='distributionGb != null and distributionGb != ""'>
+		        AND    SC.DISTRIBUTION_GB = #{distributionGb}
+		        </if>
+		        <if test='mallGb != null and mallGb != ""'>
+		        AND    O.MALL_GB = #{mallGb}
+		        </if>
+		        <if test='extmallId != null and extmallId != ""'>
+		        AND    OD.EXTMALL_ID = #{extmallId}
+		        </if>
+		        <if test="multiSupplyComp != null and multiSupplyComp != ''">
+		        AND    SC.SUPPLY_COMP_CD IN
+		            <foreach collection="multiSupplyComp" item="item" index="index"  open="(" close=")" separator=",">
+		            #{item}
+		            </foreach>
+		        </if>
+		        <if test="multiBrand != null and multiBrand != ''">
+		        AND    B.BRAND_CD IN
+		            <foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
+		            #{item}
+		            </foreach>
+		        </if>
+		       ) ODIH
+		ORDER  BY ODIH.ORD_DTL_ITEM_HST_SQ
+	</select>
+	
+	<!-- 배송비정산 목록 -->
+	<select id="getDeliveryFeeSettleList" parameterType="DelvFeeSettle" resultType="DelvFeeSettle">
+		/* TsaSettle.getDeliveryFeeSettleList */
+		SELECT DATE_FORMAT(OD.OCCUR_DT,'%Y-%m-%d')       AS OCCUR_DT           /*발생(출고/회수)일시*/
+		     , OD.SUPPLY_COMP_CD                                               /*공급업체코드*/
+		     , SC.SUPPLY_COMP_NM                                               /*공급업체명*/
+		     , FN_GET_CODE_NM('G065',SC.DISTRIBUTION_GB) AS DISTRIBUTION_GB_NM /*유통구분명*/
+		     , DF.DELV_FEE_GB                                                  /*배송비구분*/
+		     , FN_GET_CODE_NM('G018',DF.DELV_FEE_GB)     AS DELV_FEE_GB_NM     /*배송비구분명*/
+		     , OD.ORD_NO                                                       /*주문번호*/
+		     , SUM(DF.DELV_FEE)                          AS DELV_FEE           /*배송비*/
+		FROM   (
+		        SELECT DISTINCT
+		               ODIH.REG_DT       AS OCCUR_DT  /*발생일시*/
+		             , OD.SUPPLY_COMP_CD              /*공급업체코드*/
+		             , ODIH.ORD_NO                    /*주문번호*/
+		             , ODIH.ORD_DTL_STAT AS SETTLE_GB /*정산구분*/
+		        FROM   TB_ORDER_DETAIL_ITEM_HST ODIH
+		             , TB_ORDER_DETAIL OD
+		             , TB_GOODS G
+		        WHERE  ODIH.ORD_DTL_NO = OD.ORD_DTL_NO
+		        AND    OD.GOODS_CD = G.GOODS_CD
+		        AND    ODIH.REG_DT <![CDATA[>=]]> STR_TO_DATE(#{salesStdt},'%Y-%m-%d')
+		        AND    ODIH.REG_DT <![CDATA[<]]> DATE_ADD(STR_TO_DATE(#{salesEddt},'%Y-%m-%d'), INTERVAL 1 DAY)
+		        AND    ODIH.ORD_DTL_STAT IN ('G720_20','G720_50','G720_60') /*판매-배송중,환입-반품완료,환입-교환완료*/
+		        <if test="multiSupplyComp != null and multiSupplyComp != ''">
+		        AND    OD.SUPPLY_COMP_CD IN
+		            <foreach collection="multiSupplyComp" item="item" index="index"  open="(" close=")" separator=",">
+		            #{item}
+		            </foreach>
+		        </if>
+			    <if test="multiBrand != null and multiBrand != ''">
+		        AND    G.BRAND_CD IN
+		            <foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
+		            #{item}
+		            </foreach>
+		        </if>
+			   ) OD
+			 , TB_DELIVERY_FEE DF
+		     , TB_SUPPLY_COMPANY SC
+		WHERE  OD.SUPPLY_COMP_CD = DF.SUPPLY_COMP_CD
+		AND    OD.ORD_NO = DF.ORD_NO
+		AND    OD.OCCUR_DT >= DF.REG_DT /*출고기준의 일자 보다 배송비 발생일자가 적은 넘만*/
+		AND    OD.SUPPLY_COMP_CD = SC.SUPPLY_COMP_CD
+		<if test='distributionGb != null and distributionGb != ""'>
+		AND    SC.DISTRIBUTION_GB = #{distributionGb}
+		</if>
+		GROUP  BY DATE_FORMAT(OD.OCCUR_DT,'%Y-%m-%d')
+		        , OD.SUPPLY_COMP_CD
+		        , SC.SUPPLY_COMP_NM
+		        , SC.DISTRIBUTION_GB
+		        , DF.DELV_FEE_GB
+		        , OD.ORD_NO
+		ORDER  BY DATE_FORMAT(OD.OCCUR_DT,'%Y-%m-%d'), OD.SUPPLY_COMP_CD, DF.DELV_FEE_GB
+	</select>
+	
+	<!-- 제휴채널정산 목록 -->
+	<select id="getAfLinkFeeList" parameterType="AfLinkFee" resultType="AfLinkFee">
+		/* TsaSettle.getAfLinkFeeList */
+		SELECT AF_CHANNEL                                         /*상위채널코드*/
+		     , FN_GET_CODE_NM('G053',AF_CHANNEL) AS AF_CHANNEL_NM /*상위채널명*/
+		     , AF_LINK_CD                                         /*채널코드*/
+		     , AF_LINK_NM                                         /*채널명*/
+		     , OCCUR_DT                                           /*발생일시*/
+		     , ORD_NO                                             /*주문번호*/
+		     , ORD_DTL_STAT                                       /*주문상세상태*/
+		     , SUM(SELL_AMT)                     AS SELL_AMT      /*판매금액(상품금액.배송비제외)*/
+		     , SUM(CPN1_DC_AMT +
+		           TMTB1_DC_AMT + TMTB2_DC_AMT +
+		           GOODS_CPN_DC_AMT +
+		           CART_CPN_DC_AMT)              AS CPN_DC_AMT     /*쿠폰할인금액*/
+		     , SUM(PNT_DC_AMT + PRE_PNT_DC_AMT)  AS PNT_DC_AMT     /*포인트할인금액*/
+		     , SUM(GFCD_USE_AMT)                 AS GFCD_USE_AMT   /*상품권사용금액*/
+		     , SUM(SELL_AMT - (CPN1_DC_AMT + TMTB1_DC_AMT + TMTB2_DC_AMT + GOODS_CPN_DC_AMT + CART_CPN_DC_AMT + PG_CPN_AMT)
+		                    - (PNT_DC_AMT + PRE_PNT_DC_AMT)
+		                    - GFCD_USE_AMT)      AS PAY_AMT        /*결제금액(VAT포함)*/
+		     , SUM(TRUNCATE((SELL_AMT - (CPN1_DC_AMT + TMTB1_DC_AMT + TMTB2_DC_AMT + GOODS_CPN_DC_AMT + CART_CPN_DC_AMT + PG_CPN_AMT)
+		                              - (PNT_DC_AMT + PRE_PNT_DC_AMT)
+		                              - GFCD_USE_AMT
+		                    ) / 1.1,0))          AS SALES_AMT      /*매출금액(VAT제외). 건별로 1.1로 나누고 소숫점을 절사하여 합계를 낸다.*/
+		FROM   (
+		        SELECT AL.AF_CHANNEL
+		             , ODH.AF_LINK_CD                                              /*제휴링크코드*/
+		             , AL.AF_LINK_NM
+		             , DATE_FORMAT(ODH.REG_DT,'%Y-%m-%d %m:%h:%s') AS OCCUR_DT     /*발생일자*/
+		             , ODH.ORD_NO
+		             , ODH.ORD_DTL_NO
+		             , CASE WHEN ODH.ORD_DTL_STAT = 'G013_20' THEN
+		                        FN_GET_CODE_NM('G013',ODH.ORD_DTL_STAT)
+		                    ELSE
+		                        IFNULL(FN_GET_CODE_NM('G685',OCD.CHG_STAT),'주문취소')
+		               END                                         AS ORD_DTL_STAT /*주문상세상태*/
+		             , (ODH.ORD_AMT - ODH.CNCL_RTN_AMT)            AS SELL_AMT     /*판매금액(상품금액.배송비제외)*/
+		             , ODH.CPN1_DC_AMT                                             /*1차쿠폰(즉시할인쿠폰)할인금액*/
+		             , ODH.TMTB1_DC_AMT                                            /*다다익선할인금액(수량)*/
+		             , ODH.TMTB2_DC_AMT                                            /*다다익선할인금액(금액)*/
+		             , ODH.GOODS_CPN_DC_AMT                                        /*상품쿠폰할인금액*/
+		             , ODH.CART_CPN_DC_AMT                                         /*장바구니할인금액*/
+		             , 0                                           AS PG_CPN_AMT   /*PG쿠폰금액.TODO:바로 아래 쿼리문으로 대체해야 함*/
+		             -- , ODH.PG_CPN_AMT                                              /*PG쿠폰금액*/
+		             , ODH.PNT_DC_AMT                                              /*포인트할인금액*/
+		             , ODH.PRE_PNT_DC_AMT                                          /*선포인트할인금액*/
+		             , ODH.GFCD_USE_AMT                                            /*상품권사용금액*/
+		        FROM   TB_ORDER_DETAIL_HST ODH
+		        INNER JOIN TB_AF_LINK AL
+		                ON ODH.AF_LINK_CD = AL.AF_LINK_CD
+		        LEFT OUTER JOIN TB_ORDER_CHANGE_DETAIL OCD
+		                     ON ODH.ORD_DTL_NO = OCD.ORD_DTL_NO
+		                    AND OCD.CHG_STAT IN ('G685_21','G685_32','G685_42')	/*취소완료,교환완료,반품완료*/
+		        WHERE  ODH.ORD_DTL_STAT IN ('G013_20','G013_99') /*결제완료,주문취소*/
+		        AND    ODH.REG_DT <![CDATA[>=]]> STR_TO_DATE(#{startDt},'%Y-%m-%d')
+		        AND    ODH.REG_DT <![CDATA[<]]> DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'),INTERVAL 1 DAY)
+		        <if test="ordNo != null and ordNo != ''">
+		        AND    ODH.ORD_NO = #{ordNo}
+		        </if>
+		        <if test="afLinkCd != null and afLinkCd != ''">
+		        AND    AL.AF_LINK_CD = #{afLinkCd}
+		        </if>
+		        <if test="afChannel != null and afChannel != ''">
+		        AND    AL.AF_CHANNEL = #{afChannel}
+		        </if>
+		       ) U
+		GROUP  BY AF_CHANNEL, AF_LINK_CD, AF_LINK_NM, OCCUR_DT, ORD_NO, ORD_DTL_STAT
+		ORDER  BY AF_CHANNEL, AF_LINK_CD, AF_LINK_NM, OCCUR_DT, ORD_NO, ORD_DTL_STAT
+	</select>
+
 </mapper>

+ 94 - 37
src/main/webapp/WEB-INF/views/settle/DeliveryFeeSettleForm.html

@@ -48,16 +48,27 @@
 						</td>
 					</tr>
 					<tr>
-						<th>공급업체/브랜드</th>
-						<td colspan="3">
-							<select name="supplyCompCd">
-								<option value="">[전체]</option>
-								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-							</select>
-							/
-							<select name="brandCd">
-								<option value="">[전체]</option>
-							</select>
+						<th>공급업체</th>
+						<td>
+<!-- 							<select name="supplyCompCd"> -->
+<!-- 								<option value="">[전체]</option> -->
+<!-- 								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option> -->
+<!-- 							</select> -->
+							<input type="text" class="w100" name="supplyCompSearchTxt" id="supplyCompSearchTxt" maxlength="20"/>
+							<button type="button" class="btn icn" onclick="cfnOpenCompanyListPopup('fnSetSupplyCompInfo', 'M');"><i class="fa fa-search"></i></button>
+							<span id="supplyCompTxt"></span>
+							<input type="hidden" name="supplyCompList"/>
+						</td>
+						<th>브랜드</th>
+						<td>
+<!-- 							<select name="brandCd"> -->
+<!-- 								<option value="">[전체]</option> -->
+<!-- 							</select> -->
+							<input type="text" class="w100" name="brandSearchTxt" id="brandSearchTxt" maxlength="20" />
+							<button type="button" class="btn icn" onclick="cfnOpenBrandListPopup('fnSetBrandInfo', 'M');"><i class="fa fa-search"></i></button>
+							<!-- <input type="text" class="w100" name="brandCd" readonly="readonly"/> -->
+							<span id="brandTxt"></span>
+							<input type="hidden" name="brandList"/>
 						</td>
 					</tr>
 				</table>
@@ -65,7 +76,7 @@
 				<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();">초기화</button>
+						<button type="button" class="btn btn-gray btn-lg" id="btnInit">초기화</button>
 					</li>
 				</ul>
 			</form>
@@ -93,48 +104,94 @@
 	let distributionGbList = gagajf.convertToArray([[${distributionGbList}]]);
 
 	let columnDefs = [
-		{
-			headerName: "출고일자", field: "outgoingDt", width: 100, cellClass: 'text-center',
-			valueGetter: function (params) {
-				return gagaAgGrid.toDateFormat(params.data.outgoingDt);
-			}
-		},
-		{
-			headerName: "공급업체", field: "supplyCompCd", width: 100, cellClass: 'text-center',
-			valueGetter: function (params) {
-				return gagaAgGrid.lookupValue(supplyCompList, params.data.supplyCompCd);
-			}
-		},
-		{
-			headerName: "유통구분", field: "distributionGb", width: 100, cellClass: 'text-center',
-			valueGetter: function (params) {
-				return gagaAgGrid.lookupValue(distributionGbList, params.data.distributionGb);
-			}
-		},
-		{
-			headerName: "배송비구분", field: "delvFeeGb", width: 100, cellClass: 'text-center'/* ,
-			valueGetter: function (params) {
-				return gagaAgGrid.lookupValue(delvFeeGbList, params.data.delvFeeGb);
-			} */
-		},
+		{ headerName: "발생(출고/회수)일자", field: "occurDt", width: 150, cellClass: 'text-center' },
+		{ headerName: "공급업체", field: "supplyCompNm", width: 200, cellClass: 'text-center' },
+		{ headerName: "유통구분", field: "distributionGbNm", width: 150, cellClass: 'text-center' },
+		{ headerName: "배송비구분", field: "delvFeeGbNm", width: 150, cellClass: 'text-center' },
 		{ headerName: "주문번호", field: "ordNo", width: 100, cellClass: 'text-center' },
-		{ headerName: "배송비", field: "delvFee", width: 100, cellClass: 'text-right' }
+		{
+			headerName: "배송비", field: "delvFee", width: 100, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		}
 	];
 
 	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
 
+	// 업체 조회 팝업에서 호출
+	var fnSetSupplyCompInfo = function(result) {
+		var arrSupplyComp = [];
+		var supplyCompTxt = "";
+		var sIndex = 0;
+		$('#supplyCompTxt').html('');
+		$('#searchForm input[name=supplyCompSearchTxt]').val('');
+		
+		result.forEach(function(supplyComp) {
+			sIndex++; 
+			arrSupplyComp.push(supplyComp.supplyCompCd);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리 
+		if (sIndex == 1) {
+			$('#searchForm input[name=supplyCompSearchTxt]').val(arrSupplyComp[0]);
+		} else {
+			supplyCompTxt = sIndex + " 개";
+			$('#supplyCompTxt').html(supplyCompTxt);
+		}
+		
+		var jsonData = JSON.stringify(arrSupplyComp);
+		$("#searchForm input[name=supplyCompList]").val(jsonData);
+	}
+	
+	// 브랜드 조회 팝업에서 호출
+	var fnSetBrandInfo = function(result) {
+		var arrbrandCd = [];
+		var brandTxt = "";
+		var bIndex = 0;
+		$('#brandTxt').html('');
+		$('#searchForm input[name=brandSearchTxt]').val('');
+		
+		result.forEach(function(brand){
+			bIndex++; 
+			arrbrandCd.push(brand.brandCd);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리 
+		if (bIndex == 1) {
+			$('#searchForm input[name=brandSearchTxt]').val(arrbrandCd[0]);
+		} else {
+			brandTxt = bIndex + " 개";
+			$('#searchForm').find('#brandTxt').html(brandTxt);
+		}
+		
+		var jsonData = JSON.stringify(arrbrandCd);
+		$("#searchForm input[name=brandList]").val(jsonData);
+	}
+	
 	// 검색
 	$('#btnSearch').on('click', function() {
+		// 입력 값 체크
+		if (!gagajf.validation($('#searchForm')))
+			return false;
+		
 		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
 	});
 	
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+		$('#searchForm')[0].reset();
+		$('#searchForm input[name=brandList]').val('');
+		$('#searchForm input[name=supplyCompList]').val('');
+		$('#brandTxt').html('');
+		$('#supplyCompTxt').html('');
+	});
+	
 	// 엑셀다운로드
 	$('#btnExcel').on('click', function() {
 		gagaAgGrid.exportToExcel('배송비정산 목록', gridOptions);
 	});
 	
 	$(document).ready(function() {
-		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '매출');
+		cfnCreateCalendar('#terms', 'salesStdt', 'salesEddt', true, '매출');
 		$('.btnToday').trigger('click');
 		
 		// Create a agGrid

+ 346 - 342
src/main/webapp/WEB-INF/views/settle/GoodsSettleForm.html

@@ -1,342 +1,346 @@
-<!DOCTYPE html>
-<html lang="ko"
-	xmlns:th="http://www.thymeleaf.org">
-<!--
- *******************************************************************************
- * @source  : GoodsSettleForm.html
- * @desc    : 상품정산 Page
- *============================================================================
- * STYLE24
- * Copyright(C) 2020 TSIT, All rights reserved.
- *============================================================================
- * VER  DATE         AUTHOR      DESCRIPTION
- * ===  ===========  ==========  =============================================
- * 1.0  2020.10.22   gagamel     최초 작성
- *******************************************************************************
- -->
-	<div id="main">
-		<!-- 메인타이틀 영역 -->
-		<div class="main-title">
-		</div>
-		<!-- //메인타이틀 영역 -->
-		
-		<!-- 메뉴 설명 -->
-		<div class="infoBox menu-desc">
-		</div>
-		<!-- //메뉴 설명 -->
-		
-		<!-- 검색조건 영역 -->
-		<div class="panelStyle">
-			<form id="searchForm" name="searchForm" action="#" th:action="@{'/settle/goods/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
-				<table class="frmStyle" aria-describedby="검색조건">
-					<colgroup>
-						<col style="width:10%;"/>
-						<col/>
-						<col style="width:10%;"/>
-						<col style="width:15%;"/>
-						<col style="width:10%;"/>
-						<col style="width:15%;"/>
-					</colgroup>
-					<tr>
-						<th>매출기간<i class="required" title="필수" aria-hidden="true"></i></th>
-						<td colspan="3" id="terms">
-						</td>
-						<th>유통구분</th>
-						<td>
-							<select name="distributionGb">
-								<option value="">[전체]</option>
-								<option th:if="${distributionGbList}" th:each="oneData, status : ${distributionGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-							</select>
-						</td>
-					</tr>
-					<tr>
-						<th>몰구분</th>
-						<td>
-							<select name="mallGb">
-								<option value="">[전체]</option>
-								<option th:if="${mallGbList}" th:each="oneData, status : ${mallGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-							</select>
-							<span id="extmallVendor">
-								<select name="vendorId">
-									<option value="">[전체]</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">
-									<option value="">[전체]</option>
-								</select>
-							</span>
-						</td>
-						<th>공급업체</th>
-						<td>
-<!-- 							<select name="supplyCompCd"> -->
-<!-- 								<option value="">[전체]</option> -->
-<!-- 								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option> -->
-<!-- 							</select> -->
-							<input type="text" class="w100" name="supplyCompSearchTxt" id="supplyCompSearchTxt" maxlength="20"/>
-							<button type="button" class="btn icn" onclick="cfnOpenCompanyListPopup('fnSetSupplyCompInfo', 'M');"><i class="fa fa-search"></i></button>
-							<span id="supplyCompTxt"></span>
-							<input type="hidden" name="supplyCompList"/>
-						</td>
-						<th>브랜드</th>
-						<td>
-<!-- 							<select name="brandCd"> -->
-<!-- 								<option value="">[전체]</option> -->
-<!-- 							</select> -->
-							<input type="text" class="w100" name="brandSearchTxt" id="brandSearchTxt" maxlength="20" />
-							<button type="button" class="btn icn" onclick="cfnOpenBrandListPopup('fnSetBrandInfo', 'M');"><i class="fa fa-search"></i></button>
-							<!-- <input type="text" class="w100" name="brandCd" readonly="readonly"/> -->
-							<span id="brandTxt"></span>
-							<input type="hidden" name="brandList"/>
-						</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" id="btnInit">초기화</button>
-					</li>
-				</ul>
-			</form>
-		</div>
-		<!-- 검색조건 영역 -->
-
-		<!-- 리스트 영역 -->
-		<div class="panelStyle">
-			<!-- 버튼 배치 영역 -->
-			<ul class="panelBar">
-				<li class="left">
-					<span class="infoTxt cBlue">
-						<i class="fa fa-info-circle" aria-hidden="true"></i><strong>1.상품총액</strong>: 실판매가 * 판매수량<br/>
-						<i class="fa fa-info-circle" aria-hidden="true"></i><strong>2.수수료</strong>: 상품총액(쿠폰할인금액과 다다익선할인금액만 차감. 포인트와 상품권은 포함) * 판매수수료율(%)<br/>
-						<i class="fa fa-info-circle" aria-hidden="true"></i><strong>3.정산대상액</strong>: 상품총액 - 수수료
-					</span>
-				</li>
-				<li class="right">
-					<button type="button" class="btn btn-default btn-lg" id="btnExcel">엑셀다운로드</button>
-				</li>
-			</ul>
-			<!-- //버튼 배치 영역 -->
-			
-			<div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
-		</div>
-		<!-- //리스트 영역 -->
-	</div>
-
-<script th:inline="javascript">
-/*<![CDATA[*/
-	let supplyCompList = gagajf.convertToArray([[${supplyCompList}]]);
-	let distributionGbList = gagajf.convertToArray([[${distributionGbList}]]);
-
-	let columnDefs = [
-		{ headerName: "주문번호", field: "ordNo", width: 100, cellClass: 'text-center' },
-		{ headerName: "주문상세번호", field: "ordDtlNo", width: 150, cellClass: 'text-center' },
-		{ headerName: "몰구분", field: "mallGbNm", width: 100, cellClass: 'text-center' },
-		{ headerName: "제휴몰주문번호", field: "extmallOrderId", width: 150, cellClass: 'text-center' },
-		{ headerName: "제휴몰명", field: "extmallNm", width: 150, cellClass: 'text-center' },
-// 		{
-// 			headerName: "공급업체", field: "supplyCompCd", width: 100, cellClass: 'text-center',
-// 			valueGetter: function (params) {
-// 				return gagaAgGrid.lookupValue(supplyCompList, params.data.supplyCompCd);
-// 			}
-// 		},
-		{ headerName: "공급업체", field: "supplyCompNm", width: 150, cellClass: 'text-center' },
-// 		{
-// 			headerName: "유통구분", field: "distributionGb", width: 100, cellClass: 'text-center',
-// 			valueGetter: function (params) {
-// 				return gagaAgGrid.lookupValue(distributionGbList, params.data.distributionGb);
-// 			}
-// 		},
-		{ headerName: "유통구분", field: "distributionGbNm", width: 100, cellClass: 'text-center'},
-		{ headerName: "정산주기", field: "settleDayNm", width: 100, cellClass: 'text-center' },
-		{ headerName: "주문일시", field: "ordDt", width: 150, cellClass: 'text-center' },
-		{ headerName: "정산구분", field: "settleGbNm", width: 100, cellClass: 'text-center' },
-		{ headerName: "발생(출고/회수)일시", field: "occurDt", width: 150, cellClass: 'text-center' },
-		{ headerName: "상품코드", field: "goodsCd", width: 120, cellClass: 'text-center' },
-		{ headerName: "상품명", field: "goodsNm", width: 300 },
-		{ headerName: "브랜드", field: "brandEnm", width: 100, cellClass: 'text-center' },
-		{ headerName: "담당MD", field: "mdNm", width: 100, cellClass: 'text-center' },
-		{ headerName: "단품코드", field: "itemCd", width: 120, cellClass: 'text-center' },
-		{ headerName: "옵션", field: "optCd1", width: 100, cellClass: 'text-center' },
-		{
-			headerName: "판매가", field: "sellPrice", width: 100, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
-		},
-		{
-			headerName: "판매수량", field: "sellQty", width: 100, cellClass: 'text-center',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
-			cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
-		},
-		{
-			headerName: "판매총액", field: "sellAmt", width: 100, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
-			cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
-		},
-		{
-			headerName: "즉시사용쿠폰금액", field: "cpn1DcAmt", width: 120, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
-		},
-		{
-			headerName: "상품쿠폰사용금액", field: "goodsCpnDcAmt", width: 120, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
-		},
-		{
-			headerName: "주문서쿠폰사용금액", field: "cartCpnDcAmt", width: 130, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
-		},
-		{
-			headerName: "포인트사용금액", field: "pntDcAmt", width: 120, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
-		},
-		{
-			headerName: "다다익선할인금액", field: "tmtbDcAmt", width: 120, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
-		},
-		{
-			headerName: "상품권사용금액", field: "gfcdUseAmt", width: 120, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
-		},	
-		{
-			headerName: "자사쿠폰분담액", field: "selfCpnDcAmt", width: 120, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
-		},
-		{
-			headerName: "입점쿠폰분담액", field: "supplyCompCpnDcAmt", width: 120, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
-		},
-		{
-			headerName: "실판매가", field: "realSellPrice", width: 100, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
-		},
-		{
-			headerName: "상품총액", field: "realSellAmt", width: 100, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
-			cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
-		},
-		{
-			headerName: "판매수수료율(%)", field: "sellFeeRate", width: 120, cellClass: 'text-center',
-			cellRenderer: function (params) { return params.value + '%'; }
-		},
-		{
-			headerName: "수수료", field: "sellFeeAmt", width: 100, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
-			cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
-		},
-		{
-			headerName: "정산대상액", field: "settleAmt", width: 100, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
-			cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
-		}
-	];
-
-	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
-
-	// 몰구분 콤보박스 변경 시
-	$('#searchForm select[name=mallGb]').on('change', function() {
-		if ($(this).val() == 'G011_10') { // 자사몰
-			$('#extmallVendor').hide();
-			$('#searchForm select[name=vendorId]').val('');
-		} else if ($(this).val() == 'G011_20') { // 외부몰
-			$('#extmallVendor').show();
-		} else {
-			$('#extmallVendor').hide();
-			$('#searchForm select[name=vendorId]').val('');
-		}
-	});
-	
-	// 벤더 콤보박스 변경 시
-	$('#searchForm select[name=vendorId]').on('change', function() {
-		$.getJSON('/renderer/vendor/extmall/list/' + $(this).val()
-				, function(result, status) {
-					if (status == 'success') {
-						$('#searchForm select[name=extmallId]').empty().append('<option value="">[전체]</option>');
-						$.each(result, function(idx, data) {
-							var optionHtml = '<option value="' + data.cd + '">[' + data.cd + '] '+ data.cdNm + '</option>\n';
-							$('#searchForm select[name=extmallId]').append(optionHtml);
-						});
-					}
-				});
-	});
-	
-	// 업체 조회 팝업에서 호출
-	var fnSetSupplyCompInfo = function(result) {
-		var arrSupplyComp = [];
-		var supplyCompTxt = "";
-		var sIndex = 0;
-		$('#supplyCompTxt').html('');
-		$('#searchForm input[name=supplyCompSearchTxt]').val('');
-		
-		result.forEach(function(supplyComp) {
-			sIndex++; 
-			arrSupplyComp.push(supplyComp.supplyCompCd);
-		});
-
-		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리 
-		if (sIndex == 1) {
-			$('#searchForm input[name=supplyCompSearchTxt]').val(arrSupplyComp[0]);
-		} else {
-			supplyCompTxt = sIndex + " 개";
-			$('#supplyCompTxt').html(supplyCompTxt);
-		}
-		
-		var jsonData = JSON.stringify(arrSupplyComp);
-		$("#searchForm input[name=supplyCompList]").val(jsonData);
-	}
-	
-	// 브랜드 조회 팝업에서 호출
-	var fnSetBrandInfo = function(result) {
-		var arrbrandCd = [];
-		var brandTxt = "";
-		var bIndex = 0;
-		$('#brandTxt').html('');
-		$('#searchForm input[name=brandSearchTxt]').val('');
-		
-		result.forEach(function(brand){
-			bIndex++; 
-			arrbrandCd.push(brand.brandCd);
-		});
-
-		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리 
-		if (bIndex == 1) {
-			$('#searchForm input[name=brandSearchTxt]').val(arrbrandCd[0]);
-		} else {
-			brandTxt = bIndex + " 개";
-			$('#searchForm').find('#brandTxt').html(brandTxt);
-		}
-		
-		var jsonData = JSON.stringify(arrbrandCd);
-		$("#searchForm input[name=brandList]").val(jsonData);
-	}
-	
-	// 검색
-	$('#btnSearch').on('click', function() {
-		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
-	});
-	
-	// 초기화 클릭시
-	$('#btnInit').on('click', function() {
-		$('#searchForm')[0].reset();
-		$('#searchForm input[name=brandList]').val('');
-		$('#searchForm input[name=supplyCompList]').val('');
-		$('#brandTxt').html('');
-		$('#supplyCompTxt').html('');
-	});
-	
-	// 엑셀다운로드
-	$('#btnExcel').on('click', function() {
-		gagaAgGrid.exportToExcel('상품정산 목록', gridOptions);
-	});
-	
-	$(document).ready(function() {
-		cfnCreateCalendar('#terms', 'salesStdt', 'salesEddt', true, '매출');
-		$('.btnToday').trigger('click');
-		
-		$('#extmallVendor').hide();
-		
-		// Create a agGrid
-		gagaAgGrid.createGrid('gridList', gridOptions);
-	});
-/*]]>*/
-</script>
-
-</html>
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : GoodsSettleForm.html
+ * @desc    : 상품정산 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.10.22   gagamel     최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+		
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc">
+		</div>
+		<!-- //메뉴 설명 -->
+		
+		<!-- 검색조건 영역 -->
+		<div class="panelStyle">
+			<form id="searchForm" name="searchForm" action="#" th:action="@{'/settle/goods/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col/>
+						<col style="width:10%;"/>
+						<col style="width:15%;"/>
+						<col style="width:10%;"/>
+						<col style="width:15%;"/>
+					</colgroup>
+					<tr>
+						<th>매출기간<i class="required" title="필수" aria-hidden="true"></i></th>
+						<td colspan="3" id="terms">
+						</td>
+						<th>유통구분</th>
+						<td>
+							<select name="distributionGb">
+								<option value="">[전체]</option>
+								<option th:if="${distributionGbList}" th:each="oneData, status : ${distributionGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<th>몰구분</th>
+						<td>
+							<select name="mallGb">
+								<option value="">[전체]</option>
+								<option th:if="${mallGbList}" th:each="oneData, status : ${mallGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+							<span id="extmallVendor">
+								<select name="vendorId">
+									<option value="">[전체]</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">
+									<option value="">[전체]</option>
+								</select>
+							</span>
+						</td>
+						<th>공급업체</th>
+						<td>
+<!-- 							<select name="supplyCompCd"> -->
+<!-- 								<option value="">[전체]</option> -->
+<!-- 								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option> -->
+<!-- 							</select> -->
+							<input type="text" class="w100" name="supplyCompSearchTxt" id="supplyCompSearchTxt" maxlength="20"/>
+							<button type="button" class="btn icn" onclick="cfnOpenCompanyListPopup('fnSetSupplyCompInfo', 'M');"><i class="fa fa-search"></i></button>
+							<span id="supplyCompTxt"></span>
+							<input type="hidden" name="supplyCompList"/>
+						</td>
+						<th>브랜드</th>
+						<td>
+<!-- 							<select name="brandCd"> -->
+<!-- 								<option value="">[전체]</option> -->
+<!-- 							</select> -->
+							<input type="text" class="w100" name="brandSearchTxt" id="brandSearchTxt" maxlength="20" />
+							<button type="button" class="btn icn" onclick="cfnOpenBrandListPopup('fnSetBrandInfo', 'M');"><i class="fa fa-search"></i></button>
+							<!-- <input type="text" class="w100" name="brandCd" readonly="readonly"/> -->
+							<span id="brandTxt"></span>
+							<input type="hidden" name="brandList"/>
+						</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" id="btnInit">초기화</button>
+					</li>
+				</ul>
+			</form>
+		</div>
+		<!-- 검색조건 영역 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelStyle">
+			<!-- 버튼 배치 영역 -->
+			<ul class="panelBar">
+				<li class="left">
+					<span class="infoTxt cBlue">
+						<i class="fa fa-info-circle" aria-hidden="true"></i><strong>1.상품총액</strong>: 실판매가 * 판매수량<br/>
+						<i class="fa fa-info-circle" aria-hidden="true"></i><strong>2.수수료</strong>: 상품총액(쿠폰할인금액과 다다익선할인금액만 차감. 포인트와 상품권은 포함) * 판매수수료율(%)<br/>
+						<i class="fa fa-info-circle" aria-hidden="true"></i><strong>3.정산대상액</strong>: 상품총액 - 수수료
+					</span>
+				</li>
+				<li class="right">
+					<button type="button" class="btn btn-default btn-lg" id="btnExcel">엑셀다운로드</button>
+				</li>
+			</ul>
+			<!-- //버튼 배치 영역 -->
+			
+			<div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+	</div>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let supplyCompList = gagajf.convertToArray([[${supplyCompList}]]);
+	let distributionGbList = gagajf.convertToArray([[${distributionGbList}]]);
+
+	let columnDefs = [
+		{ headerName: "주문번호", field: "ordNo", width: 100, cellClass: 'text-center' },
+		{ headerName: "주문상세번호", field: "ordDtlNo", width: 150, cellClass: 'text-center' },
+		{ headerName: "몰구분", field: "mallGbNm", width: 100, cellClass: 'text-center' },
+		{ headerName: "제휴몰주문번호", field: "extmallOrderId", width: 150, cellClass: 'text-center' },
+		{ headerName: "제휴몰명", field: "extmallNm", width: 150, cellClass: 'text-center' },
+// 		{
+// 			headerName: "공급업체", field: "supplyCompCd", width: 100, cellClass: 'text-center',
+// 			valueGetter: function (params) {
+// 				return gagaAgGrid.lookupValue(supplyCompList, params.data.supplyCompCd);
+// 			}
+// 		},
+		{ headerName: "공급업체", field: "supplyCompNm", width: 150, cellClass: 'text-center' },
+// 		{
+// 			headerName: "유통구분", field: "distributionGb", width: 100, cellClass: 'text-center',
+// 			valueGetter: function (params) {
+// 				return gagaAgGrid.lookupValue(distributionGbList, params.data.distributionGb);
+// 			}
+// 		},
+		{ headerName: "유통구분", field: "distributionGbNm", width: 100, cellClass: 'text-center'},
+		{ headerName: "정산주기", field: "settleDayNm", width: 100, cellClass: 'text-center' },
+		{ headerName: "주문일시", field: "ordDt", width: 150, cellClass: 'text-center' },
+		{ headerName: "정산구분", field: "settleGbNm", width: 100, cellClass: 'text-center' },
+		{ headerName: "발생(출고/회수)일시", field: "occurDt", width: 150, cellClass: 'text-center' },
+		{ headerName: "상품코드", field: "goodsCd", width: 120, cellClass: 'text-center' },
+		{ headerName: "상품명", field: "goodsNm", width: 300 },
+		{ headerName: "브랜드", field: "brandEnm", width: 100, cellClass: 'text-center' },
+		{ headerName: "담당MD", field: "mdNm", width: 100, cellClass: 'text-center' },
+		{ headerName: "단품코드", field: "itemCd", width: 120, cellClass: 'text-center' },
+		{ headerName: "옵션", field: "optCd1", width: 100, cellClass: 'text-center' },
+		{
+			headerName: "판매가", field: "sellPrice", width: 100, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: "판매수량", field: "sellQty", width: 100, cellClass: 'text-center',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
+			cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
+		},
+		{
+			headerName: "판매총액", field: "sellAmt", width: 100, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
+			cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
+		},
+		{
+			headerName: "즉시사용쿠폰금액", field: "cpn1DcAmt", width: 120, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: "상품쿠폰사용금액", field: "goodsCpnDcAmt", width: 120, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: "주문서쿠폰사용금액", field: "cartCpnDcAmt", width: 130, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: "포인트사용금액", field: "pntDcAmt", width: 120, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: "다다익선할인금액", field: "tmtbDcAmt", width: 120, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: "상품권사용금액", field: "gfcdUseAmt", width: 120, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},	
+		{
+			headerName: "자사쿠폰분담액", field: "selfCpnDcAmt", width: 120, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: "입점쿠폰분담액", field: "supplyCompCpnDcAmt", width: 120, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: "실판매가", field: "realSellPrice", width: 100, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: "상품총액", field: "realSellAmt", width: 100, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
+			cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
+		},
+		{
+			headerName: "판매수수료율(%)", field: "sellFeeRate", width: 120, cellClass: 'text-center',
+			cellRenderer: function (params) { return params.value + '%'; }
+		},
+		{
+			headerName: "수수료", field: "sellFeeAmt", width: 100, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
+			cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
+		},
+		{
+			headerName: "정산대상액", field: "settleAmt", width: 100, cellClass: 'text-right',
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
+			cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
+		}
+	];
+
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// 몰구분 콤보박스 변경 시
+	$('#searchForm select[name=mallGb]').on('change', function() {
+		if ($(this).val() == 'G011_10') { // 자사몰
+			$('#extmallVendor').hide();
+			$('#searchForm select[name=vendorId]').val('');
+		} else if ($(this).val() == 'G011_20') { // 외부몰
+			$('#extmallVendor').show();
+		} else {
+			$('#extmallVendor').hide();
+			$('#searchForm select[name=vendorId]').val('');
+		}
+	});
+	
+	// 벤더 콤보박스 변경 시
+	$('#searchForm select[name=vendorId]').on('change', function() {
+		$.getJSON('/renderer/vendor/extmall/list/' + $(this).val()
+				, function(result, status) {
+					if (status == 'success') {
+						$('#searchForm select[name=extmallId]').empty().append('<option value="">[전체]</option>');
+						$.each(result, function(idx, data) {
+							var optionHtml = '<option value="' + data.cd + '">[' + data.cd + '] '+ data.cdNm + '</option>\n';
+							$('#searchForm select[name=extmallId]').append(optionHtml);
+						});
+					}
+				});
+	});
+	
+	// 업체 조회 팝업에서 호출
+	var fnSetSupplyCompInfo = function(result) {
+		var arrSupplyComp = [];
+		var supplyCompTxt = "";
+		var sIndex = 0;
+		$('#supplyCompTxt').html('');
+		$('#searchForm input[name=supplyCompSearchTxt]').val('');
+		
+		result.forEach(function(supplyComp) {
+			sIndex++; 
+			arrSupplyComp.push(supplyComp.supplyCompCd);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리 
+		if (sIndex == 1) {
+			$('#searchForm input[name=supplyCompSearchTxt]').val(arrSupplyComp[0]);
+		} else {
+			supplyCompTxt = sIndex + " 개";
+			$('#supplyCompTxt').html(supplyCompTxt);
+		}
+		
+		var jsonData = JSON.stringify(arrSupplyComp);
+		$("#searchForm input[name=supplyCompList]").val(jsonData);
+	}
+	
+	// 브랜드 조회 팝업에서 호출
+	var fnSetBrandInfo = function(result) {
+		var arrbrandCd = [];
+		var brandTxt = "";
+		var bIndex = 0;
+		$('#brandTxt').html('');
+		$('#searchForm input[name=brandSearchTxt]').val('');
+		
+		result.forEach(function(brand){
+			bIndex++; 
+			arrbrandCd.push(brand.brandCd);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리 
+		if (bIndex == 1) {
+			$('#searchForm input[name=brandSearchTxt]').val(arrbrandCd[0]);
+		} else {
+			brandTxt = bIndex + " 개";
+			$('#searchForm').find('#brandTxt').html(brandTxt);
+		}
+		
+		var jsonData = JSON.stringify(arrbrandCd);
+		$("#searchForm input[name=brandList]").val(jsonData);
+	}
+	
+	// 검색
+	$('#btnSearch').on('click', function() {
+		// 입력 값 체크
+		if (!gagajf.validation($('#searchForm')))
+			return false;
+		
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
+	});
+	
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+		$('#searchForm')[0].reset();
+		$('#searchForm input[name=brandList]').val('');
+		$('#searchForm input[name=supplyCompList]').val('');
+		$('#brandTxt').html('');
+		$('#supplyCompTxt').html('');
+	});
+	
+	// 엑셀다운로드
+	$('#btnExcel').on('click', function() {
+		gagaAgGrid.exportToExcel('상품정산 목록', gridOptions);
+	});
+	
+	$(document).ready(function() {
+		cfnCreateCalendar('#terms', 'salesStdt', 'salesEddt', true, '매출');
+		$('.btnToday').trigger('click');
+		
+		$('#extmallVendor').hide();
+		
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+	});
+/*]]>*/
+</script>
+
+</html>