Procházet zdrojové kódy

쿠폰 - 발급받은회원팝업

bin2107 před 5 roky
rodič
revize
c339be1945

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

@@ -264,4 +264,13 @@ public interface TsaCouponDao {
 	 * @since 2021. 02. 02
 	 */
 	ArrayList<Coupon> getCouponPayTypeList(int cpnId);
+
+	/**
+	 * 쿠폰발급받은 회원리스트 팝업
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @since 2021-02-03
+	 */
+	Collection<Coupon> getCpnPubCustList(int cpnId);
 }

+ 11 - 0
src/main/java/com/style24/admin/biz/service/TsaCouponService.java

@@ -432,4 +432,15 @@ public class TsaCouponService {
 	public ArrayList<Coupon> getCouponPayTypeList(int cpnId) {
 		return couponDao.getCouponPayTypeList(cpnId);
 	}
+
+	/**
+	 * 쿠폰발급받은 회원리스트 팝업
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @since 2021-02-03
+	 */
+	public Collection<Coupon> getCpnPubCustList(int cpnId) {
+		return couponDao.getCpnPubCustList(cpnId);
+	}
 }

+ 19 - 0
src/main/java/com/style24/admin/biz/web/TsaMarketingController.java

@@ -862,6 +862,25 @@ public class TsaMarketingController extends TsaBaseController {
 
 		return super.ok(message.getMessage("SUCC_0003"));
 	}
+
+	/**
+	 * 쿠폰발급받은 회원리스트 팝업
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @since 2021-02-03
+	 */
+	@GetMapping("/coupon/pubCust/popup/form")
+	@ResponseBody
+	public ModelAndView couponPubCustListPopup(@RequestParam(value = "cpnId", required = true)int cpnId) {
+		ModelAndView mav = new ModelAndView();
+
+		mav.addObject("cpnPubCustList", couponService.getCpnPubCustList(cpnId));
+
+		mav.setViewName("marketing/CouponPubCustListPopupForm");
+		return mav;
+	}
+
 	/* // CSB 진행 */
 
 	/**

+ 10 - 0
src/main/java/com/style24/persistence/domain/Coupon.java

@@ -60,6 +60,16 @@ public class Coupon extends TscBaseDomain {
     private String dcCdGb;                  // 할인코드유형 (공통코드G233)
     private String rdCpnNm;                 // 랜덤쿠폰 사용키 (시리얼명 or 난수)
 
+    private String custNo;
+    private String custNm;
+    private String custGbNm;
+    private String custGradeNm;
+    private String useYn;
+    private String usedDt;
+    private String pubReason;
+    private String pubReasonNm;
+    private String pubReasonDtl;
+
     // 그리드 파라미터
     /*private String supplyCompList;          // 공급업체 리스트
     private String brandList;               // 브랜드 리스트

+ 27 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaCoupon.xml

@@ -739,4 +739,31 @@
 		FROM TB_COUPON_PAYTYPE
 		WHERE CPN_ID = #{cpnId}
 	</select>
+
+	<!-- 쿠폰발급받은회원 조회-->
+	<select id="getCpnPubCustList" parameterType="int" resultType="Coupon">
+		/* TsaCoupon.getCpnPubCustList */
+		SELECT	A.CUST_NO
+			 ,B.CUST_NM
+			 ,B.CUST_GB
+			 ,FN_GET_CODE_NM('G100',B.CUST_GB) AS CUST_GB_NM
+			 ,B.CUST_GRADE
+			 ,FN_GET_CODE_NM('G110',B.CUST_GRADE) AS CUST_GRADE_NM
+			 ,A.AVAIL_STDT
+			 ,A.AVAIL_EDDT
+			 ,CASE WHEN A.USED_DT IS NOT NULL THEN 'Y'
+				   ELSE 'N' END USE_YN
+			 ,A.USED_DT
+			 ,A.PUB_REASON
+			 ,FN_GET_CODE_NM('G068',A.PUB_REASON) AS PUB_REASON_NM
+			 ,A.PUB_REASON_DTL
+			 ,A.REG_NO
+			 ,A.REG_DT
+		FROM 	TB_CUST_COUPON A
+		LEFT OUTER JOIN TB_CUSTOMER B
+		ON		A.CUST_NO = B.CUST_NO
+		WHERE 1=1
+		AND A.CPN_ID = #{cpnId}
+	</select>
+
 </mapper>

+ 4 - 3
src/main/webapp/WEB-INF/views/marketing/CouponPopupForm.html

@@ -1460,9 +1460,10 @@
 	}
 
 	// 발급받은회원 팝업
-	function fnPubCustListPopUp(){
-		var cpnId = $('#CouponForm #cpnId').val();
-		cfnCpnPubCustListPopup(cpnId);
+	var fnPubCustListPopUp = function (){
+		let cpnId = $("#CouponForm #cpnId").val();
+		var actionUrl = "/marketing/coupon/pubCust/popup/form?cpnId=" + cpnId;
+		cfnOpenModalPopup(actionUrl, 'CpnPubCustListPopup');
 	};
 
 	// 쿠폰발행팝업

+ 72 - 0
src/main/webapp/WEB-INF/views/marketing/CouponPubCustListPopupForm.html

@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CouponPubCustListPopupForm.html
+ * @desc    : 쿠폰 발급받은 회원리스트 팝업 화면
+ *============================================================================
+ * ISTYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.02.03   bin2107       최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="960" data-height="500" >
+	<div class="panelStyle" >
+		<div class="panelTitle">
+			<h2>쿠폰 발급받은 회원</h2>
+			<button type="button" class="close" onclick="uifnPopupClose('CpnPubCustListPopup')"><i class="fa fa-times"></i></button>
+		</div>
+		<div class="panelContent">
+			<div id="pubCustgridList" style="width:100%; height:420px;" class="ag-theme-balham"></div>
+		</div>
+	</div>
+</div>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	var cpnPubCustList = [[${cpnPubCustList}]]; //gagajf.convertToArray([[${cpnPubCustList}]]);
+
+	var columnDefs = [
+		{ headerName: "회원번호" , field:"custNo" , width:100, cellClass:"text-center"} ,
+		{ headerName: "회원명" , field:"custNm" , width:120, cellClass:"text-center" } ,
+		{ headerName: "회원구분" , field:"custGbNm" , width:120, cellClass:"text-center" } ,
+		{ headerName: "회원등급" , field:"custGradeNm" , width:120, cellClass:"text-center" } ,
+		{ headerName: "시작유효기간" , field:"availStdt" , width:150, cellClass:"text-center"
+			,valueGetter	: function (params) {
+				return gagaAgGrid.toDateTimeFormat(params.data.availStdt);
+			}
+		} ,
+		{ headerName: "종료유효기간" , field:"availEddt" , width:150, cellClass:"text-center"
+			,valueGetter	: function (params) {
+				return gagaAgGrid.toDateTimeFormat(params.data.availEddt);
+			}
+		} ,
+		{ headerName: "사용여부" , field:"useYn" , width:120, cellClass:"text-center" } ,
+		/*{ headerName: "사용일" , field:"usedDt" , width:150, cellClass:"text-center"
+			,valueGetter	: function (params) {
+				return gagaAgGrid.toDateTimeFormat(params.data.usedDt);
+			}
+		} ,*/
+		{ headerName: "발급사유" , field:"pubReasonNm" , width:200, cellClass:"text-center"} ,
+		{ headerName: "발급상세사유" , field:"pubReasonDtl" , width:200, cellClass:"text-center"} ,
+		{ headerName: "발급인ID" , field:"regNo" , width:100, cellClass:"text-center"} ,
+		{ headerName: "발급시간" , field:"regDt" , width:150, cellClass:"text-center"
+			,valueGetter	: function (params) {
+				return gagaAgGrid.toDateTimeFormat(params.data.regDt);
+			}
+		}
+	];
+
+	let pubCustGridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	$(document).ready(function(){
+		gagaAgGrid.createGrid('pubCustgridList', pubCustGridOptions);
+		pubCustGridOptions.api.setRowData(cpnPubCustList);
+	});
+
+	/*]]>*/
+</script>
+</html>