Sfoglia il codice sorgente

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

jsshin 5 anni fa
parent
commit
c81be30196

+ 9 - 0
src/main/java/com/style24/admin/biz/dao/TsaCardPromotionDao.java

@@ -32,5 +32,14 @@ public interface TsaCardPromotionDao {
 	 */
 	Collection<CardPromotion> getCardInterestList(CardPromotion cardPromotion);
 
+	/**
+	 * 카드무이자할부저장
+	 * @param cardPromotion
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 1
+	 */
+	void saveCardInterest(CardPromotion cardPromotion);
+
 
 }

+ 16 - 0
src/main/java/com/style24/admin/biz/service/TsaCardPromotionService.java

@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.style24.admin.biz.dao.TsaCardPromotionDao;
+import com.style24.admin.support.security.session.TsaSession;
 import com.style24.persistence.domain.CardPromotion;
 
 import lombok.extern.slf4j.Slf4j;
@@ -45,5 +46,20 @@ public class TsaCardPromotionService {
 		return cardPromotionDao.getCardInterestList(cardPromotion);
 	}
 
+	/**
+	 * 카드무이자할부 저장
+	 * @param cardPromotion
+	 * @return
+	 * @author eskim
+	 * @since 2021. 02. 1
+	 */
+	public void saveCardInterest(CardPromotion cardPromotion) {
+
+		Integer userNo = TsaSession.getInfo().getUserNo();
+
+
+		cardPromotionDao.saveCardInterest(cardPromotion);
+	}
+
 
 }

+ 61 - 8
src/main/java/com/style24/admin/biz/web/TsaMarketingController.java

@@ -1,19 +1,17 @@
 package com.style24.admin.biz.web;
 
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
 
-import com.gagaframework.web.util.GagaDateUtil;
-import com.style24.admin.biz.service.TsaSystemService;
-import com.style24.core.biz.service.TscPointService;
-import com.style24.core.support.env.TscConstants;
-import com.style24.persistence.domain.Point;
-import com.style24.persistence.domain.User;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -36,6 +34,7 @@ import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.message.TscMessageByLocale;
 import com.style24.persistence.TscPageRequest;
 import com.style24.persistence.domain.CardPromotion;
+import com.style24.persistence.domain.CardPromotionTarget;
 import com.style24.persistence.domain.CommonCode;
 import com.style24.persistence.domain.Coupon;
 import com.style24.persistence.domain.CouponRefval;
@@ -1020,7 +1019,7 @@ public class TsaMarketingController extends TsaBaseController {
 	 */
 	@GetMapping("/card/interest/form")
 	@ResponseBody
-	public ModelAndView pointGrantPopupForm() {
+	public ModelAndView cardInterestForm() {
 		ModelAndView mav = new ModelAndView();
 
 		mav.setViewName("marketing/CardInterestForm");
@@ -1049,6 +1048,60 @@ public class TsaMarketingController extends TsaBaseController {
 		return result;
 	}
 
+	/**
+	 * 카드무이자할부 팝업
+	 * @param
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 1
+	 */
+	@GetMapping("/card/interest/popup/form/{cardPrmtSq}")
+	@ResponseBody
+	public ModelAndView cardInterestPopupForm(@PathVariable Integer cardPrmtSq) {
+
+		ModelAndView mav = new ModelAndView();
+
+		mav.addObject("cardPrmtSq", cardPrmtSq);
+		mav.setViewName("marketing/CardInterestPopupForm");
+		return mav;
+	}
+
+	/**
+	 * 카드목록 팝업
+	 * @param
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 1
+	 */
+	@GetMapping("/card/list/popup/form")
+	@ResponseBody
+	public ModelAndView cardListtPopupForm(CardPromotionTarget cardPromotionTarget) {
+
+		ModelAndView mav = new ModelAndView();
+
+		// 카드목록
+		mav.addObject("cardList", rendererService.getAvailCommonCodeList("G941"));
+
+		mav.addObject("params", cardPromotionTarget);
+
+		mav.setViewName("marketing/CardListPopupForm");
+		return mav;
+	}
+
+	/**
+	 * 카드무이자할부 저장
+	 * @param point - 포인트 정보
+	 * @return ModelAndView
+	 * @author eskim
+	 * @since 2021. 2. 1
+	 */
+	@PostMapping("/card/interest/save")
+	@ResponseBody
+	public GagaResponse saveCardInterest(@RequestBody CardPromotion cardPromotion) {
+		cardPromotionService.saveCardInterest(cardPromotion);
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+
 	/**
 	 *   카드관련 작업 종료 - eskim
 	 */

+ 17 - 0
src/main/java/com/style24/persistence/domain/CardPromotion.java

@@ -1,5 +1,6 @@
 package com.style24.persistence.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.style24.persistence.TscBaseDomain;
 import com.style24.persistence.TscPageRequest;
 
@@ -28,8 +29,24 @@ public class CardPromotion extends TscBaseDomain {
 	// 검색조건
 	private String stDate;
 	private String edDate;
+	private String search; // 키워드 종류
+	private String condition; // 키워드 종류별 값
 	private String beforSkipFlag;
 
+	//무이자 저장용
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] minPayAmt;	// 최소결제금액
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] minNoItrt;	// 최소무이자월수(프로모션구분이 B:무이자 인경우)
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] maxNoItrt;	// 최대무이자월수(프로모션구분이 B:무이자 인경우)
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] arrCardCd;
+
+
 	// Pagination
 	private TscPageRequest pageable;
 	private int pageNo = 1;

+ 3 - 0
src/main/java/com/style24/persistence/domain/CardPromotionTarget.java

@@ -17,4 +17,7 @@ public class CardPromotionTarget extends TscBaseDomain {
 	private Integer cardPrmtCdtSq;	// 카드프로모션행사조건일련번호
 	private String prmtTargetCd;	// 포로모션대상카드(공통코드G941)
 
+	private String callBackFun;
+	private String arrCard;
+
 }

+ 20 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaCardPromotion.xml

@@ -23,6 +23,16 @@
 		SELECT COUNT(1)
 		FROM TB_CARD_PROMOTION 
 		WHERE PRMT_GB = #{prmtGb}
+		<if test="condition != null and condition != ''">
+		    <choose>
+		        <when test='search != null and search == "1"'>
+		AND CARD_PRMT_SQ = #{condition}
+		        </when>
+		        <otherwise >
+		AND UPPER(PRMT_NM) LIKE CONCAT('%',UPPER(#{condition}),'%')
+		        </otherwise>
+		    </choose>
+		</if>
 		<if test="stDate != null and stDate != ''">
 		AND PRMT_EDD >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
 		</if>
@@ -58,6 +68,16 @@
 		             , DATE_FORMAT(UPD_DT, '%Y%m%d%H%i%S') AS UPD_DT
 		        FROM TB_CARD_PROMOTION 
 		        WHERE PRMT_GB = #{prmtGb}
+		        <if test="condition != null and condition != ''">
+		            <choose>
+		                <when test='search != null and search == "1"'>
+		        AND CARD_PRMT_SQ = #{condition}
+		                </when>
+		                <otherwise >
+		        AND UPPER(PRMT_NM) LIKE CONCAT('%',UPPER(#{condition}),'%')
+		                </otherwise>
+		            </choose>
+		        </if>
 		        <if test="stDate != null and stDate != ''">
 		        AND PRMT_EDD >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
 		        </if>

+ 43 - 28
src/main/webapp/WEB-INF/views/marketing/CardInterestForm.html

@@ -22,10 +22,13 @@
 		<!-- 메뉴 설명 -->
 		<div class="infoBox menu-desc">
 		</div>
-		<form id="cardInterestListForm" name="cardInterestListForm" action="#" th:action="@{'/marketing/card/interest/list'}">
+		<form id="cardInterestSearchForm" name="cardInterestSearchForm" action="#" th:action="@{'/marketing/card/interest/list'}">
 		<input type="hidden" id="prmtGb" name="prmtGb" value="B" /> <!-- 무이자 -->
  		<!-- 패널 영역1 -->
 		<div class="panelStyle" >
+			<div class="panelTitle">
+				<h3><i class="fa fa-info-circle"></i>아래 검색조건 중 하나를 꼭 입력해 주세요.</h3>
+			</div>
 			<div class="panelContent">
 				<table class="frmStyle">
 					<colgroup>
@@ -33,14 +36,15 @@
 						<col/>
 					</colgroup>
 					<tr>
-						<th>구분<em class="required" title="필수"></em></th>
+						<th>구분</th>
 						<td>
-							<label class="rdoBtn"><input type="radio" name="sizeGb"  value="1"  checked/>프로모션ID</label>
-							<label class="rdoBtn"><input type="radio" name="sizeGb"  value="2"/>프로모션명</label>
+							<label class="rdoBtn"><input type="radio" name="search"  value="1"  checked/>프로모션ID</label>
+							<label class="rdoBtn"><input type="radio" name="search"  value="2"/>프로모션명</label>
+							<input type="text" class="w300" maxlength="30" name="condition"/>
 						</td>
 					</tr>
 					<tr>
-						<th>기간<em class="required" title="필수"></em></th>
+						<th>기간</th>
 						<td id="sellTerms"></td>
 					</tr>
 				</table>
@@ -94,7 +98,7 @@
 	var columnDefs = [
 		{width: 40, minWidth: 40, cellClass: 'text-right', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
 		{headerName: 'No', width: 60, cellClass: 'text-center',
-			valueGetter: function(params) { return cfnGridNumner('cardInterestListForm',params.node.rowIndex, 'A');}
+			valueGetter: function(params) { return cfnGridNumner('cardInterestSearchForm',params.node.rowIndex, 'A');}
 		},
 		{headerName: "프로모션ID", field: "cardPrmtSq", width: 130, cellClass: 'text-center'},
 		{headerName: "프로모션명", field: "prmtNm", width: 140, cellClass: 'text-center'
@@ -148,12 +152,12 @@
 	});
 	
 	var fnInit = function(){
-		$('#cardInterestListForm')[0].reset();
+		$('#cardInterestSearchForm')[0].reset();
 	}
 	
 	// 조회클릭시
 	$('#btnSearch').on('click', function() {
-		$("#cardInterestListForm input[name=pageNo]").val('1');
+		$("#cardInterestSearchForm input[name=pageNo]").val('1');
 		fnCardPromotionListSearch();
 	});
 
@@ -162,14 +166,14 @@
 		
 		if(!fnConditionCheck()) return;
 		
-		gagaPaging.init('cardInterestListForm', fnSearchCallBack, 'cardListPagination', $('#cardInterestListForm').find('#pageSize').val());
-		gagaPaging.load($("#cardInterestListForm input[name=pageNo]").val());
+		gagaPaging.init('cardInterestSearchForm', fnSearchCallBack, 'cardListPagination', $('#cardInterestSearchForm').find('#pageSize').val());
+		gagaPaging.load($("#cardInterestSearchForm input[name=pageNo]").val());
 	}
 
 	//검색 조건 확인
 	var fnConditionCheck = function(){
-		var formId = '#cardInterestListForm';
-		var form = document.cardInterestListForm;
+		var formId = '#cardInterestSearchForm';
+		var form = document.cardInterestSearchForm;
 
 		var searchFlag = false;
 		var cnt = 0;
@@ -191,8 +195,8 @@
 			return false;
 		}
 		
-		var fromDate = $('#cardInterestListForm input[name=stDate]').val();
-		var toDate = $('#cardInterestListForm input[name=edDate]').val();
+		var fromDate = $('#cardInterestSearchForm input[name=stDate]').val();
+		var toDate = $('#cardInterestSearchForm input[name=edDate]').val();
 		
 		if (!gagajf.isNull(fromDate) || !gagajf.isNull(toDate)) {
 			
@@ -200,7 +204,7 @@
 				mcxDialog.alertC("등록일 조회시 시작일자와 종료일자를 입력하세요.", {
 					sureBtnText: "확인",
 					sureBtnClick: function() {
-						$('#cardInterestListForm input[name=stDate]').focus();
+						$('#cardInterestSearchForm input[name=stDate]').focus();
 					}
 				});
 				return false;
@@ -210,7 +214,7 @@
 				mcxDialog.alert("노출기간 시작일자는 종료일자 보다 클 수 없습니다.", {
 					sureBtnText: "확인",
 					sureBtnClick: function() {
-						$('#cardInterestListForm input[name=stDate]').focus();
+						$('#cardInterestSearchForm input[name=stDate]').focus();
 					}
 				});
 				return false;
@@ -222,26 +226,37 @@
 	
 	var fnSearchCallBack = function(result){
 
-		$('#cardInterestListForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
-		$('#cardInterestListForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
-		$('#cardInterestListForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
-		$('#cardInterestListForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
+		$('#cardInterestSearchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
+		$('#cardInterestSearchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
+		$('#cardInterestSearchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
+		$('#cardInterestSearchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
 		gridOptions.api.setRowData(result.cardPromotionList);
 		gagaPaging.createPagination(result.pageing.pageable);
 	}
 	
 	//페이징 
-	$('#cardInterestListForm select[name=pageSize]').on('change', function() {
-		$("#cardInterestListForm input[name=pageNo]").val('1');
-		fnCardPromotionListSearch($("#cardInterestListForm input[name=searchGb]").val());
+	$('#cardInterestSearchForm select[name=pageSize]').on('change', function() {
+		$("#cardInterestSearchForm input[name=pageNo]").val('1');
+		fnCardPromotionListSearch($("#cardInterestSearchForm input[name=searchGb]").val());
 	});
 	
 	//카드 무이자 팝업
 	$('#btnCardPromotionSave').click(function(e) {
-		var actionUrl = "/marketing/card/interest/popup/form";
-		cfnOpenModalPopup(actionUrl, 'popupCardInterest'); 
+		cardInterestPopup();
 	});
 	
+	var cardInterestPopup = function(cardPrmtSq){
+		var actionUrl = "/marketing/card/interest/popup/form/";
+		if (typeof(cardPrmtSq) != 'undefined' && cardPrmtSq != null ){
+			actionUrl += cardPrmtSq;
+		}else{
+			actionUrl += 0;
+		}
+		
+		cfnOpenModalPopup(actionUrl, 'popupCardInterest'); 
+	}
+	
+	
 	//카드 프로모션 삭제
 	$('#btnCardPromotionDelete').click(function(e) {
 		//상품선택여부 확인처리 추가
@@ -284,7 +299,7 @@
 			return;
 		}
 		
-		mcxDialog.confirm('삭제하시겠습니까?',  {
+		mcxDialog.confirm('삭제하시겠습니까? <br/> 삭제한 프로모션은 복구할수 없습니다.',  {
 			cancelBtnText: "취소",
 			sureBtnText: "확인",
 			sureBtnClick: function(){
@@ -304,9 +319,9 @@
 	
 	$(document).ready(function() {
 
-		cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '기간');
+		cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '기간', 'X');
 		var chkBeforSkipFlag = '&nbsp;&nbsp;<label class="chkBox"><input type="checkbox" name="beforSkipFlag" value="Y" >이전데이터 제외</label>';
-		$("#cardInterestListForm").find('#sellTerms').append(chkBeforSkipFlag);
+		$("#cardInterestSearchForm").find('#sellTerms').append(chkBeforSkipFlag);
 		
 		// Create a agGrid
 		gagaAgGrid.createGrid('gridList', gridOptions);

+ 221 - 0
src/main/webapp/WEB-INF/views/marketing/CardInterestPopupForm.html

@@ -0,0 +1,221 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CardInterestPopupForm.html
+ * @desc    : 카드무이자할부 팝업 화면
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2019 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.02.01   eskim       최초 작성
+ *******************************************************************************
+ -->	
+	<div class="modalPopup" data-width="1000"> <!-- data-width="850"  -->
+		<div class="panelStyle">
+			<div class="panelTitle">
+				<h2>프로모션<th:block th:text="${cardPrmtSq > 0 }?'상세':'등록'"></th:block> </h2>
+				<button type="button" class="close" onclick="uifnPopupClose('popupCardInterest')"><i class="fa fa-times"></i></button>
+			</div>
+			<form id="cardInterestForm" name="cardInterestForm" >
+			<div class="panelContent">
+				<table class="frmStyle">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col style="width:50%;"/>
+						<col style="width:10%;"/>
+						<col/>
+					</colgroup>
+					<tr>
+						<th>프로모션명<em class="required" title="필수"></em></th>
+						<td><input type="text" class="w500" id="prmtNm" name="prmtNm"  maxlength="30" required="required" data-valid-name="프로모션명" /></td>
+						<th>프로모션ID</th>
+						<td><input type="text" class="w100 formControl" id="cardPrmtSq" name="cardPrmtSq"  readonly/></td>
+					</tr>
+					<tr>
+						<th>행사기간<em class="required" title="필수"></em></th>
+						<td >
+							<input name="prmtStdYMD" id="prmtStdYMD" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="행사시작일" />
+							<input name="prmtStd" id="prmtStd" type="hidden" />
+							~
+							<input name="prmtEddYMD" id="prmtEddYMD" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="행사종료일" />
+							<input name="prmtEdd" id="prmtEdd" type="hidden" />
+						</td>
+						<th>노출여부<em class="required" title="필수"></em></th>
+						<td >
+							<label class="rdoBtn"><input type="radio" name="dispYn" value="Y"  checked/>Y</label>
+							<label class="rdoBtn"><input type="radio" name="dispYn" value="N"/>N</label>
+							<input type="hidden" id="dispYnOrg" name="dispYnOrg"/>
+						</td>
+					</tr>
+					<tr>
+						<th>행사조건<em class="required" title="필수"></em><br/>
+							<button type="button" class="btn btn-base btn-sm" id="btnCardContionAdd"><i class="fa fa-plus"></i></button>
+						</th>
+						<td colspan="3" >
+							<div  style="overflow-y:scroll; height:230px;">
+							<table  class="frmStyle">
+								<colgroup>
+									<col style="width:7%;"/>
+									<col/>
+								</colgroup>
+								<tbody id="cardContionList">
+								<tr>
+									<td style="height:100px;"></td>
+									<td><p class="dot">무이자개월 <input type="text" class="w100"  name="minNoItrt" data-valid-type="numeric" required="required" data-valid-name="무이자개월"/>개월 ~
+										<input type="text" class="w100"  name="maxNoItrt" data-valid-type="numeric" required="required" data-valid-name="무이자개월"/>개월</p>
+										<p class="dot">구매금액기준 <input type="text" class="w100"  name="minPayAmt" data-valid-type="numeric" required="required" data-valid-name="구매금액기준"/>원 이상 구매시</p>
+										<p class="dot">대상카드 <button type="button" class="btn btn-base btn-sm" onClick="fnCardAdd(1);">선택</button><br/><span id="arrCardNm1" class="cRed"></span></p>
+										<input type="hidden" name="arrCardCd"/>
+										<input type="hidden" name="cardIdx" id="cardIdx"/>
+									</td>
+								</tr>
+								</tbody>
+							</table>
+							</div>
+						</td>
+					</tr>
+					<tr>
+						<th>부분무이자안내</th>
+						<td  colspan="3">
+						<textarea class="textareaR2" name="note" id="note"></textarea>
+						</td>
+					</tr>
+				</table>
+			</div>
+			<ul class="panelBar">
+				<li class="left">
+					<button type="button" class="btn btn-danger btn-lg" id="btnDeleteGoodsRsvtTnm">상품삭제</button>
+				</li>	
+				<li class="right">
+					<button type="button" class="btnRight btn btn-success btn-lg" id="btnSaveCardInterest">적용</button>
+				</li>
+			</ul>
+			</form>	
+		</div>
+	</div>
+<script type="text/javascript" src="/ux/plugins/summernote/summernote.js?v=2020103001"></script>
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.summernote.js?v=2020103001"></script>	
+<script th:inline="javascript">
+/*<![CDATA[*/
+	
+	//카드행사조건 추가
+	$('#btnCardContionAdd').on('click', function() {
+		var len =  $('#cardInterestForm').find('#cardContionList tr').length;
+		
+		if(len >= 3) {
+			mcxDialog.alert("최대 3개까지 가능합니다.");
+			return false;
+		}
+		
+		var cardHtml = "";
+		cardHtml +='<tr>';
+		cardHtml +='	<td style="height:100px;"><button type="button" class="btn icn"><i class="fa fa-times" aria-hidden="true" onclick="$(this).parent().parent().parent().remove();return false;"></i></button></td>';
+		cardHtml +='	<td><p class="dot">무이자개월 <input type="text" class="w100"  name="minNoItrt" data-valid-type="numeric" required="required" data-valid-name="무이자개월"/>개월 ~';
+		cardHtml +='	<input type="text" class="w100"  name="maxNoItrt" data-valid-type="numeric" required="required" data-valid-name="무이자개월"/>개월</p>';
+		cardHtml +='	<p class="dot">구매금액기준 <input type="text" class="w100"  name="minPayAmt" data-valid-type="numeric" required="required" data-valid-name="구매금액기준"/>원 이상 구매시</p>';
+		cardHtml +='	<p class="dot">대상카드 <button type="button" class="btn btn-base btn-sm" onClick="fnCardAdd('+ (len+1) +');">선택</button><br/><span id="arrCardNm'+(len+1)+'" class="cRed"></span></p>';
+		cardHtml +='	<input type="hidden" name="arrCardCd"/>';
+		cardHtml +='	</td>';
+		cardHtml +='</tr>';
+		
+		$('#cardInterestForm').find('#cardContionList').append(cardHtml);
+		
+	});
+	
+	//카드조회팝업
+	var fnCardAdd = function(idx){
+		$('#cardInterestForm').find('#cardIdx').val(idx);
+		var arrCardCd = $('#cardInterestForm').find("input[name=arrCardCd]").eq(idx-1).val();
+		cfnOpenCardListPopup('fnCardAddCallBakup', arrCardCd);	// /로 구분
+	}
+	
+	// 카드추가/삭제
+	var fnCardAddCallBakup = function(arrCardCd, arrCardNm) {
+		var index = $('#cardInterestForm').find('#cardIdx').val();
+		$('#cardInterestForm').find("#arrCardNm" + (index)).html(arrCardNm);
+		$('#cardInterestForm').find("input[name=arrCardCd]").eq(index-1).val(arrCardCd);
+	};
+	
+	// 저장 클릭 시
+	$('#btnSaveCardInterest').on('click', function() {
+		
+		var optCheck = false;
+		// 입력 값 체크
+		if (!gagajf.validation('#cardInterestForm'))
+			return false;
+		
+		var idx = 0;
+		$('#cardInterestForm').find('#cardContionList tr').each(function() {
+			var minNoItrt = $(this).find("input[name=minNoItrt]").val();
+			var maxNoItrt = $(this).find("input[name=maxNoItrt]").val();
+			var minPayAmt = $(this).find("input[name=minPayAmt]").val();
+			var arrCardCd = $(this).find("input[name=arrCardCd]").val();
+			
+			if (Number(minNoItrt) > Number(maxNoItrt)){
+				optCheck = true;
+				mcxDialog.alertC("무이자개월수를 확인해주세요", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#cardInterestForm').find('#cardContionList tr').find("input[name=maxNoItrt]").eq(idx).focus();
+					}
+				});
+				return false;
+			}
+			
+			if (Number(minPayAmt) < 10000){
+				optCheck = true;
+				mcxDialog.alertC("구매기준금액을 확인해주세요", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#cardInterestForm').find('#cardContionList tr').find("input[name=minPayAmt]").eq(idx).focus();
+					}
+				});
+				return false;
+			}
+			
+			if (gagajf.isNull(arrCardCd)){
+				optCheck = true;
+				mcxDialog.alert((idx+1)+"번째 행사조건의 대상카드를 선택해주세요")
+				return false;
+			}
+			
+			idx++;
+		});
+		
+		if (optCheck){
+			return false;
+		}
+		
+		mcxDialog.confirm('저장하시겠습니까?',  {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function(){
+
+				gagajf.ajaxFormSubmit("/marketing/card/interest/save", "#cardInterestForm", fnSaveCardInterestCallBack); 
+
+			}
+		});
+	});
+
+	
+	//창종료
+	var fnSaveCardInterestCallBack = function(){
+		fnCardPromotionListSearch(); 	//본창 호출
+		uifnPopupClose('popupCardInterest');
+		
+	}
+
+	$(document).ready(function() {
+
+		// Create a summernote
+		var snOptions = gagaSn.getToolbarOptions('media');
+		gagaSn.createSummernote(snOptions, '#note');
+	});
+
+/*]]>*/
+</script>
+</html>

+ 85 - 0
src/main/webapp/WEB-INF/views/marketing/CardListPopupForm.html

@@ -0,0 +1,85 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CardListPopupForm.html
+ * @desc    : 카드목록 팝업 화면
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2019 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.02.01   eskim       최초 작성
+ *******************************************************************************
+ -->	
+	<div class="modalPopup" data-width="700">
+		<div class="panelStyle">
+			<div class="panelTitle">
+				<h2>카드목록</h2>
+				<button type="button" class="close" onclick="uifnPopupClose('popupCardList')"><i class="fa fa-times"></i></button>
+			</div>
+			<form id="cardListForm" name="cardListForm" >
+			<div class="panelContent">
+				<table class="frmStyle">
+					<tr>
+						<td id="cardArea">
+							<th:block th:if="${cardList}" th:each="oneData, status : ${cardList}">
+							<label class="chkBox" th:classappend="${not #strings.isEmpty(params.arrCard) and  #strings.contains(params.arrCard,oneData.cd)?'checked':''}"><input type="checkbox" name="card" th:value="${oneData.cd}" th:text="${oneData.cdNm}" th:checked="${not #strings.isEmpty(params.arrCard) and  #strings.contains(params.arrCard,oneData.cd)}">국민</label>
+							</th:block>
+						</td>
+					</tr>
+				</table>
+			</div>
+			<ul class="panelBar">
+				<li class="right">
+					<button type="button" class="btnRight btn btn-success btn-lg" id="btnSaveCardList">적용</button>
+				</li>
+			</ul>
+			</form>	
+		</div>
+	</div>
+<script th:inline="javascript">
+/*<![CDATA[*/
+	
+	// 적용 클릭 시
+	$('#btnSaveCardList').on('click', function() {
+		var arrCardCd = '';
+		var arrCardNm = '';
+		$("#cardListForm #cardArea label").each(function() {
+			if ($(this).find("input:checkbox[name=card]").is(':checked')){
+				if (gagajf.isNull(arrCardCd)){
+					arrCardCd += $(this).find("input[name=card]").val();
+					arrCardNm += $(this).find("input[name=card]").parent('label').text();	
+				}else{
+					arrCardCd += '/' + $(this).find("input[name=card]").val();
+					arrCardNm += '/' + $(this).find("input[name=card]").parent('label').text();
+				}
+			}
+		});
+		
+		var callback = [[${params.callBackFun}]];
+
+		if( typeof callback != 'undefined' && callback){
+
+			if (typeof callback == 'function') {
+				callback(arrCardCd);
+			}else{
+				if( callback ) {
+					if( callback.indexOf("(") == -1 ) eval( callback +"('" + arrCardCd + "','"+ arrCardNm  +"')");
+					else eval( callback(arrCardCd, arrCardNm) );
+				}
+			}
+			uifnPopupClose('popupCardList');
+		}
+		
+	});
+	
+	$(document).ready(function() {
+	
+	});
+
+/*]]>*/
+</script>
+</html>

+ 126 - 18
src/main/webapp/WEB-INF/views/marketing/CouponPopupForm.html

@@ -177,8 +177,9 @@
 											<td>
 												<input type="hidden" id="downEddt" name="downEddt" required="required" data-valid-name="다운로드종료일시">
 												<input type="text" class="schDate w100" name="downEdDay" id="downEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
-												<select name="downEdHH" id="downEdHH">
+												<select name="downEdHH" id="downEdHH" onclick="fnChangeEdHH(this);">
 													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+													<option th:text="24시" th:value="24"></option>
 												</select>
 												<select name="downEdMM" id="downEdMM">
 													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
@@ -221,8 +222,9 @@
 											<td class="availDateTr">
 												<input type="hidden" id="availEddt" name="availEddt" data-valid-name="유효기간종료일시">
 												<input type="text" class="schDate w100" name="availEdDay" id="availEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
-												<select name="availEdHH" id="availEdHH">
+												<select name="availEdHH" id="availEdHH" onclick="fnChangeEdHH(this);">
 													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+													<option th:text="24시" th:value="24"></option>
 												</select>
 												<select name="availEdMM" id="availEdMM">
 													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
@@ -241,7 +243,7 @@
 										<tr>
 											<th class="buyDateTr">첫구매기간시작일시<em class="required" title="필수"></em></th>
 											<td class="buyDateTr">
-												<input type="hidden" id="buyEddt" name="buyEddt" data-valid-name="첫구매기간종료일시">
+												<input type="hidden" name="buyStdt" id="buyStdt" data-valid-name="첫구매기간시작일시">
 												<input type="text" class="schDate w100" name="buyStDay" id="buyStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
 												<select name="buyStHH" id="buyStHH">
 													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
@@ -251,10 +253,11 @@
 												</select>
 											<th class="buyDateTr">첫구매기간종료일시<em class="required" title="필수"></em></th>
 											<td class="buyDateTr">
-												<input type="hidden" name="buyStdt" id="buyStdt" data-valid-name="첫구매기간시작일시">
+												<input type="hidden" id="buyEddt" name="buyEddt" data-valid-name="첫구매기간종료일시">
 												<input type="text" class="schDate w100" name="buyEdDay" id="buyEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
-												<select name="buyEdHH" id="buyEdHH">
+												<select name="buyEdHH" id="buyEdHH" onclick="fnChangeEdHH(this);">
 													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+													<option th:text="24시" th:value="24"></option>
 												</select>
 												<select name="buyEdMM" id="buyEdMM">
 													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
@@ -285,8 +288,9 @@
 											<td class="custJoinDateTr">
 												<input type="hidden" id="custJoinEddt" name="custJoinEddt" data-valid-name="신규회원기간종료일시">
 												<input type="text" class="schDate w100" name="custJoinEdDay" id="custJoinEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
-												<select name="custJoinEdHH" id="custJoinEdHH">
+												<select name="custJoinEdHH" id="custJoinEdHH" onclick="fnChangeEdHH(this);">
 													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+													<option th:text="24시" th:value="24"></option>
 												</select>
 												<select name="custJoinEdMM" id="custJoinEdMM">
 													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
@@ -627,6 +631,27 @@
 	brandGridOptions.rowSelection = "multiple";
 	inComGridOptions.stopEditingWhenGridLosesFocus = true;
 
+	// 종료시간 클릭시
+	var fnChangeEdHH = function (obj){
+		var selectId = obj.id;
+		var changeId = "";
+		if(selectId == "downEdHH"){
+			changeId = "downEdMM";
+		}else if(selectId == "availEdHH"){
+			changeId = "availEdMM";
+		}else if(selectId == "buyEdHH"){
+			changeId = "buyEdMM";
+		}else{
+			changeId = "custJoinEdMM";
+		}
+		if(obj.value == 24) {
+			$("#CouponForm #"+changeId+" option").hide();
+			$('#CouponForm #'+changeId+' option:first').show().prop("selected", true);
+		} else {
+			$("#CouponForm #"+changeId+" option").show();
+		}
+	};
+
 	// 총발행 제한수량 -> 제한없음 처리
 	$("#CouponForm #chkBoxTotPubQty").bind('click', function (){
 		var chkBox= document.getElementById('chkNoLimitTotPubLimitQty').checked;
@@ -1371,23 +1396,66 @@
 		// 적용범위값 세팅
 		$('#CouponForm #applyScope').val($('#CouponForm input:radio[name="rdoApplyScope"]:checked').val());
 		// 다운로드기간 세팅
-		$('#CouponForm #downStdt').val($('#CouponForm #downStDay').val() + " " + $('#CouponForm #downStHH').val() + ":" + $('#CouponForm #downStMM').val() + ":00");
-		$('#CouponForm #downEddt').val($('#CouponForm #downEdDay').val() + " " + $('#CouponForm #downEdHH').val() + ":" + $('#CouponForm #downEdMM').val() + ":59");
+		let downStdt = "";
+		let downEddt = "";
+		downStdt = $('#CouponForm input[name=downStDay]').val()+$('#CouponForm select[name=downStHH]').val()+$('#CouponForm select[name=downStMM]').val()+'00';
+		if($('#CouponForm select[name=downEdHH]').val() == "24"){
+			downEddt = $('#CouponForm input[name=downEdDay]').val()+'235959';
+		}else{
+			downEddt = $('#CouponForm input[name=downEdDay]').val()+$('#CouponForm select[name=downEdHH]').val()+$('#CouponForm select[name=downEdMM]').val()+'00';
+		}
+		downStdt = downStdt.replace(/[^0-9]/g, '');
+		downEddt = downEddt.replace(/[^0-9]/g, '');
+		$('#CouponForm #downStdt').val(downStdt);
+		$('#CouponForm #downEddt').val(downEddt);
+
 		// 유효기간 세팅
+		let availStdt = "";
+		let availEddt = "";
 		if($("#CouponForm #pdGb").val() == 'P') {
-			$('#CouponForm #availStdt').val($('#CouponForm #availStDay').val() + " " + $('#CouponForm #availStHH').val() + ":" + $('#CouponForm #availStMM').val() + ":00");
-			$('#CouponForm #availEddt').val($('#CouponForm #availEdDay').val() + " " + $('#CouponForm #availEdHH').val() + ":" + $('#CouponForm #availEdMM').val() + ":59");
+			availStdt = $('#CouponForm input[name=availStDay]').val()+$('#CouponForm select[name=availStHH]').val()+$('#CouponForm select[name=availStMM]').val()+'00';
+			if($('#CouponForm select[name=availEdHH]').val() == "24"){
+				downEddt = $('#CouponForm input[name=availEdDay]').val()+'235959';
+			}else{
+				downEddt = $('#CouponForm input[name=availEdDay]').val()+$('#CouponForm select[name=availEdHH]').val()+$('#CouponForm select[name=availEdMM]').val()+'00';
+			}
+			availStdt = availStdt.replace(/[^0-9]/g, '');
+			availEddt = availEddt.replace(/[^0-9]/g, '');
+			$('#CouponForm #availStdt').val(downStdt);
+			$('#CouponForm #availEddt').val(downEddt);
 			$('#CouponForm #availDays').val('');
 		} else {
 			$('#CouponForm #availStdt').val('');
 			$('#CouponForm #availEddt').val('');
 		}
+
 		// 첫구매기간세팅
-		$('#CouponForm #buyStdt').val($('#CouponForm #buyStDay').val() + " " + $('#CouponForm #buyStHH').val() + ":" + $('#CouponForm #buyStMM').val() + ":00");
-		$('#CouponForm #buyEddt').val($('#CouponForm #buyEdDay').val() + " " + $('#CouponForm #buyEdHH').val() + ":" + $('#CouponForm #buyEdMM').val() + ":59");
+		let buyStdt = "";
+		let buyEddt = "";
+		buyStdt = $('#CouponForm input[name=buyStDay]').val()+$('#CouponForm select[name=buyStHH]').val()+$('#CouponForm select[name=buyStMM]').val()+'00';
+		if($('#CouponForm select[name=buyEdHH]').val() == "24"){
+			buyEddt = $('#CouponForm input[name=buyEdDay]').val()+'235959';
+		}else{
+			buyEddt = $('#CouponForm input[name=buyEdDay]').val()+$('#CouponForm select[name=buyEdHH]').val()+$('#CouponForm select[name=buyEdMM]').val()+'00';
+		}
+		buyStdt = buyStdt.replace(/[^0-9]/g, '');
+		buyEddt = buyEddt.replace(/[^0-9]/g, '');
+		$('#CouponForm #buyStdt').val(buyStdt);
+		$('#CouponForm #buyEddt').val(buyEddt);
+
 		// 신규회원기간 세팅
-		$('#CouponForm #custJoinStdt').val($('#CouponForm #custJoinStDay').val() + " " + $('#CouponForm #custJoinStHH').val() + ":" + $('#CouponForm #custJoinStMM').val() + ":00");
-		$('#CouponForm #custJoinEddt').val($('#CouponForm #custJoinEdDay').val() + " " + $('#CouponForm #custJoinEdHH').val() + ":" + $('#CouponForm #custJoinEdMM').val() + ":59");
+		let custJoinStdt = "";
+		let custJoinEddt = "";
+		custJoinStdt = $('#CouponForm input[name=custJoinStDay]').val()+$('#CouponForm select[name=custJoinStHH]').val()+$('#CouponForm select[name=custJoinStMM]').val()+'00';
+		if($('#CouponForm select[name=custJoinEdHH]').val() == "24"){
+			custJoinEddt = $('#CouponForm input[name=custJoinEdDay]').val()+'235959';
+		}else{
+			custJoinEddt = $('#CouponForm input[name=custJoinEdDay]').val()+$('#CouponForm select[name=custJoinEdHH]').val()+$('#CouponForm select[name=custJoinEdMM]').val()+'00';
+		}
+		custJoinStdt = custJoinStdt.replace(/[^0-9]/g, '');
+		custJoinEddt = custJoinEddt.replace(/[^0-9]/g, '');
+		$('#CouponForm #custJoinStdt').val(custJoinStdt);
+		$('#CouponForm #custJoinEddt').val(custJoinEddt);
 
 		// 할인쿠폰 유형에 따른 총 발행수량 수정 (주문서 쿠폰이고 난수쿠폰일 경우)
 		if($('#CouponForm #cpnType').val() == "G230_20" && $('#CouponForm input:radio[name="dcCdGb"]:checked').val() == "G233_20") {
@@ -1444,13 +1512,17 @@
 			$('input[name=rdoDcWay]').eq(0).attr("checked", true);
 			$('input[name=rdoApplyScope]').eq(0).attr("checked", true)
 			$('#CouponForm #availEdHH option:last').attr("selected", "selected");
-			$('#CouponForm #availEdMM option:last').attr("selected", "selected");
+			$('#CouponForm #availEdMM option').hide();
+			$('#CouponForm #availEdMM option:first').show().prop("selected", true);
 			$('#downEdHH option:last').attr("selected", "selected");
-			$('#downEdMM option:last').attr("selected", "selected");
+			$('#downEdMM option').hide();
+			$('#downEdMM option:first').show().prop("selected", true);
 			$('#custJoinEdHH option:last').attr("selected", "selected");
-			$('#custJoinEdMM option:last').attr("selected", "selected");
+			$('#custJoinEdMM option').hide();
+			$('#custJoinEdMM option:first').show().prop("selected", true);
 			$('#buyEdHH option:last').attr("selected", "selected");
-			$('#buyEdMM option:last').attr("selected", "selected");
+			$('#buyEdMM option').hide();
+			$('#buyEdMM option:first').show().prop("selected", true);
 			$("#CouponForm #afChannel option:first").attr("selected" , "selected");
 			$("#CouponForm .normalCol").attr("colspan", "5");
 			$("#CouponForm .randomCpnArea").hide();
@@ -1552,6 +1624,42 @@
 				}
 			}
 
+			// 쿠폰다운 날짜
+			let edDtArr = cpnDetail.downEddt.split(" ");
+			if(edDtArr[1] == "23:59:59") {
+				edHour = "24";
+				edMinute = "00";
+				$("#CouponForm #downEdMM option").hide();
+				$('#CouponForm #downEdMM option:first').show().prop("selected", true);
+			}
+
+			// 유효 날짜
+			let availEdDtArr = cpnDetail.availEddt.split(" ");
+			if(availEdDtArr[1] == "23:59:59") {
+				edHour = "24";
+				edMinute = "00";
+				$("#CouponForm #availEdMM option").hide();
+				$('#CouponForm #availEdMM option:first').show().prop("selected", true);
+			}
+
+			// 첫구매 날짜
+			let firstBuyEdDtArr = cpnDetail.buyEddt.split(" ");
+			if(firstBuyEdDtArr[1] == "23:59:59") {
+				edHour = "24";
+				edMinute = "00";
+				$("#CouponForm #buyEdMM option").hide();
+				$('#CouponForm #buyEdMM option:first').show().prop("selected", true);
+			}
+
+			// 신규가입 날짜
+			let custJoinEdDtArr = cpnDetail.custJoinEddt.split(" ");
+			if(custJoinEdDtArr[1] == "23:59:59") {
+				edHour = "24";
+				edMinute = "00";
+				$("#CouponForm #custJoinEdMM option").hide();
+				$('#CouponForm #custJoinEdMM option:first').show().prop("selected", true);
+			}
+
 			/*
 			$("#CouponForm input:checkbox[name='cpnCreateType']").parent("label").addClass("formControl");
 			$("#CouponForm input:checkbox[name='cpnCreateType']").parent("label").prop('disabled', true);

+ 18 - 0
src/main/webapp/ux/js/admin.popup.js

@@ -821,3 +821,21 @@ var cfnOpenSupplyVendorPopup = function(sName, oParam) {
 
 	cfnOpenModalPopup(actionUrl, 'popupSupplyVendor');
 }
+
+
+/**
+ * @type   : function
+ * @access : public
+ * @desc   : 카드목록 조회 팝업
+ * <pre>
+ *     cfnOpenCardListPopup('fnResult', 'G941_01|G941_02|');
+ * </pre>
+ * @since  : 2021/02/01
+ * @author : eskim
+ */
+var cfnOpenCardListPopup = function(callBackFun, arrCard) {
+	var actionUrl = "/marketing/card/list/popup/form?callBackFun=" + callBackFun;
+	actionUrl += "&arrCard=" + arrCard;
+
+	cfnOpenModalPopup(actionUrl, 'popupCardList');
+}