فهرست منبع

기획전 임시 커밋

sowon4187 5 سال پیش
والد
کامیت
6ea1ada0e1

+ 319 - 0
src/main/java/com/style24/persistence/domain/Plan.java

@@ -0,0 +1,319 @@
+package com.style24.persistence.domain;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TscPageRequest;
+
+import lombok.Data;
+
+/**
+ * 기획전 Domain
+ *
+ * @author sowon
+ * @since 2021. 02. 04
+ */
+
+@SuppressWarnings("serial")
+@Data
+public class Plan extends TscBaseDomain{
+	// 기획전
+		private Integer planSq;				//기획전일련번호(SeqPlan sequence)
+		private String planNm;				//기획전명
+		private String planGb;				//기획전구분(P:기획전private String  E:이벤트)
+		private String custGb;				//고객구분
+		private String custGrade;			//회원등급
+		private String planSnm;				//검색어
+		private String templateType;		//템플릿유형(H:Htmlprivate String  T:텍스트)
+		private String siteCd;				//사이트코드(공통코드g000)
+		private String frontGb;				//프론트구분(A:All, P:웹, M:모바일)
+		private String dispStdt;			//기획전 시작일시
+		private String dispEddt;			//기획전 종료일시
+		private String mainPimg;			//메인이미지(Pc)
+		private String mainMimg;			//메인이미지(모바일)
+		private String dtlPimg;				//상세이미지(Pc)
+		private String dtlMimg;				//상세이미지(모바일)
+		private String orgMainPimg;			//원본메인이미지(Pc)
+		private String orgMainMimg;			//원본메인이미지(모바일)
+		private String orgDtlPimg;			//원본상세이미지(Pc)
+		private String orgDtlMimg;			//원본상세이미지(모바일)
+		private String orgMainPimgDelYn;	//원본메인이미지(Pc) 삭제여부
+		private String orgMainMimgDelYn;	//원본메인이미지(모바일) 삭제여부
+		private String orgDtlPimgDelYn;		//원본상세이미지(Pc) 삭제여부
+		private String orgDtlMimgDelYn;		//원본상세이미지(모바일) 삭제여부
+		private String dtlTitle1;			//상세제목1
+		private String dtlTitle2;			//상세제목2
+		private String cateCd;				//카테고리코드(대/중/소/세카테고리)
+		private String cateDispYn;			//카테고리전시여부(Y:전시)
+		private String replyYn;				//댓글여부(Y:댓글)
+		private String replyLoc;			//댓글위치(U:상품리스트상단 D:상품리스트하단)
+		private String replyImg;			//댓글이미지
+		private String orgReplyImg;			//원본댓글이미지
+		private String replyTitle1;			//댓글제목1
+		private String replyTitle2;			//댓글제목2
+		private String devUrl;				//호출 URL
+		private String orgReplyImgDelYn;	//원본댓글이미지 삭제여부
+		private String cornerNmDispYn;		//코너명노출여부(Y:노출)
+		private String goodsLimitYn;		//상품등록제한여부(Y:상품등록제한)
+		private String goodsLimitQty;		//상품등록제한수(상품등록제한여부가 "Y"일 떄)
+		private String delYn;				//삭제여부(Y:삭제)
+		private String openYn;				//오픈여부(Y:오픈)
+		private String stDate;
+		private String edDate;
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private long[] dispOrdArr;			// 표시순서 배열
+		private long dispOrd;				//표시순서
+		private long readCnt;				//조회수
+		private Integer pollSq;				//투표일련번호
+		private String badgeNm;				//뱃지이름
+		private String badgeFcolor;			//뱃지글자컬러
+		private String badgeBcolor;			//뱃지배경컬러
+		private String privacyPolicy;		//개인정보수집동의정책
+		private String newCustYn;			//신규회원여부
+		private String custJoinStdt;		//회원가입시작일시
+		private String custJoinEddt;		//회원가입종료일시
+
+		// 기획전 소스
+		private Integer seq;					//일련번호
+		private String fsrcPc;				//프론트소스(pc)	/ 화면용
+		private String fsrcMob;			//프론트소스(모바일)	/ 화면용
+		private String locGb;			//위치구분(T:상단 / B:하단)
+		private String fontGb;			//위치구분(T:상단 / B:하단)
+
+		// 기획전 상세
+		private Integer planDtlSq;				//기획전상세일련번호(SEQ_PLAN_DTL sequence)
+		private Integer copyPlanDtlSq;			//복사할 상세 일련번호
+		private Integer copyPlanSq;			//복사할 일련번호
+		private String copyMode;			//복사 선택(CORNER:코너복사, PLAN:기획전복사)
+		private String cornerDispType;		//코너노출유형(공통코드G045) (2:2컷 , 3:3컷, 4:4컷)
+		private String cornerNm;			//코너 명
+		private String planDtlStat;			//기획전상세상태(공통코드G044)
+		private String copyBrandCd;	        //복사할 브랜드코드
+		private String adminPreview;	// 어드민미리보기 여부 (Y:미리보기)
+		// 기획전 브랜드
+		private String brandGroupNo;	//기획전브랜드그룹번호
+		private String DispYn;      	//표시여부           
+		private String brandGroupKnm; 	// 브랜드 그룹명(한글)
+		private String brandGroupEnm; 	// 브랜드 그룹명(영어)
+		/* Multi CheckBox 항목*/
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] multiBrand;
+		private String[] multiCate;
+		
+		// 코너
+		private String cateGb;		// 카테고리구분
+		private String cateNm;		// 카테고리명
+		private String cateNo;		// 카테고리번호
+		
+		// 기획전 응모
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] planQtitle;
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] attachYn;
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] planAnswerSq;
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] answer;
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] sysFileNm;
+
+		//private Collection<TsaPlanQuestAnswer> planQuestAnswerList; // 고시항목
+
+		// 검색
+		private String startSearchDate;		// 진행기간 시작일
+		private String startSearchTime;		// 진행기간 시작시간
+		private String endSearchDate;		// 진행기간 종료일
+		private String endSearchTime;		// 진행기간 종료시간
+		private String excelFileNm;			// 엑셀 파일 명
+		private String custJoinEdDay;
+		private String custJoinStDay;
+		//private int startRow;				// 페이징 시작
+		//private int endRow;					// 피이징 종료
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] siteCds;			// 사이트
+
+		// 코너 상품
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] goodsCdArr;		// 상품 코드 배열
+		private String goodsCd;				// 상품 코드
+		private String goodsNm;				// 상품 명
+		private String goodsStat;			// 제품상태
+		private String imgType;				// 이미지 타입
+		private String imgPath1;			// 이미지 경로1
+		private String imgPath2;			// 이미지 경로2
+		private String imgPath4;			// 이미지 경로4
+		private String imgPath5;			// 이미지 경로5
+		private String imgPath6;			// 이미지 경로6
+		private String dcRate;				// 할인율
+		private String listPrice;			// 최소 소비자가
+		private String tagPrice;			// tag 가
+		private String currPrice;			// 판매가
+		private String supplyCompCd;		// 업체코드
+		private String supplyCompNm;		// 업체명
+		private String formalGb;			// 정상/이월 여부
+		private String currStockQty;		// 재고
+		private String pageYn;				// 페이징 사용 여부
+		private String changeGb;			// 순서변경 updown 구분
+		private int stockQtySum;			// 재고
+		private String afLinkCd;			// 제휴채널
+		private String afChannel;			// 제휴채널 공통코드
+		private String afLinkNm;			// 제휴채널 명
+
+		// 기획전 팝업
+		private String callBackFun;			// 콜백함수명
+		private String popupDispStdt;		//기획전 시작일시
+		private String popupDispEddt;		//기획전 종료일시
+		
+		//기획전 템플릿
+		private Integer planContSq;			// 기획전 컨텐츠 일련번호
+		private String tmplType;			//템플릿 유형(공통코드 G082)
+		private String title;				//타이틀
+		private String linkUrl;				//링크url
+		private String dispYn;				//표시여부
+		private Integer planContItemSq;		//기획전 컨텐프 아이템 일련번호
+		private String itemVal;				//아이템값(상품코드, 이미지파일명 등)
+		private String reviewDispStdt;		//리뷰노출시작일시
+		private String reviewDispEddt;		//리뷰노툴종료일시
+		private String linkOpenGb;			// 링크 본장,새창여부
+		
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] multiPlanReview;		//리뷰상품목록
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] multiPlanReviewStartD;		//리뷰시작날짜
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] multiPlanReviewStartT;		//리뷰시작시간
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] multiPlanReviewEndD;		//리뷰종료날짜
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] multiPlanReviewEndT;		//리뷰종료시간
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] multiPlanCoupon;		//쿠폰목록
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] multiPlanFile;			//이미지목록
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] multiPlanFile2;			//이미지새장본창
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] multiPlanFile3;			//이미지연결url
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] multiChannel;			//제휴채널목록
+		
+		private Collection<Plan> attendData; // 출석체크 혜택 데이터
+		
+
+		
+		// 템플릿 저장하기 위한 임시 변수
+		private String reTitle;				//리뷰타이틀
+		private String mode;				//모드
+		private int reDispOrd;				//리뷰전시순서
+		private String reItemVal;			//리뷰아이템
+		private String reDispYn;			//리뷰전시여부
+		private String reItemNm;			//리뷰상품이름
+		private Integer rePlanContSq;		//리뷰 컨텐츠일련번호
+		
+		private String cuTitle;				//쿠폰타이틀
+		private int cuDispOrd;				//쿠폰전시순서
+		private String cuDispYn;			//쿠폰전시여부
+		private String cuItemVal;			//쿠폰 아이템
+		private String cuItemNm;			//쿠폰 아이템 이름
+		private Integer cuPlanContSq;		//쿠폰 컨텐츠일련번호
+		private String note;				//쿠폰유의사항
+		
+		private String fileItemVal;			//파일아이템
+		private String fileDispYn;			//파일전시여부
+		private int fileDispOrd;			//파일전시순서
+		private Integer filePlanContSq;		//파일 컨텐츠일련번호
+		
+		private String topFsrcDispYn;		//html상단 전시여부
+		private String BtmFsrcDispYn;		//html하단 전시여부
+		private int   topFsrcDispOrd;		//html상단 전시순서
+		private int   btmFsrcDispOrd;		//html하단 전시순서
+		private String fsrcPcTop;			//html상단 내용(pc)
+		private String fsrcMobileTop;	    //html상단 내용(mobile)
+		private String fsrcPcBtm;			//html하단 내용(pc)
+		private String fsrcMobileBtm;		//html하단 내용(pc)
+		
+		private String goodsTitle;			//상품타이틀
+		private String goodsUrl;			//상품 url
+		private String goodsDispYn;			//상품전시여부
+		private String goodsLinkOpenGb;		//상품 새창 본창 구분
+		private int goodsDispOrd;			//상품 전시순서
+		private String goodsType;			//상품노출순서
+		private String goodsItemVal;		//상품아이템
+		private String brandEnm;			//브랜드명
+		private Integer goodsPlanContSq;	//상품 컨텐츠일련번호
+		private String goodsImg;			//상품이미지
+		
+		// 이벤트 출석체크
+		private int basDays;				//혜택기준일수
+		private String benefitGb;			//혜택 구분
+		private String benefit;				// 혜택구분
+		private int pntAmt;				//포인트
+		private Integer cpnId;				//쿠폰아이디
+		private int pntUsableDay;		//포인트사용가능일
+		
+		
+		// Pagination
+		private TscPageRequest pageable;
+		private int pageNo = 1;
+		private int pageSize = 50;
+		private int pageUnit = 10;
+		
+		private String condition; // 키워드 종류
+		private String search; // 검색어
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		private String[] conditionList;
+		
+		 // 사용가능고객등급
+	    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	    private String[] usableCustGradeArr;
+		
+	    // 사용가능고객구분
+	    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	    private String[] usableCustGbArr;
+	    
+	    
+	    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContent1; 
+	    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContent2; 
+	    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContent3; 
+	    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContent4; 
+	    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContent5; 
+	    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContent6; 
+	    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContent7; 
+	    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContent8; 
+	    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContent9; 
+	    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContent10; 
+	    
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContentVal1; 
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContentVal2; 
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContentVal3; 
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContentVal4; 
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContentVal5; 
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContentVal6; 
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContentVal7; 
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContentVal8; 
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContentVal9; 
+		@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+		List<Plan> multiPlanGoodsContentVal10; 
+}

+ 134 - 0
src/main/java/com/style24/persistence/mybatis/shop/TssPlan.xml

@@ -0,0 +1,134 @@
+<?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.scm.biz.dao.TssPlanDao">
+
+	<!-- 기획전 리스트 카운트 조회-->
+	<select id="getPlanListCount" parameterType="Plan" resultType="int">
+		/* TsaPlan.getPlanListCount */
+		SELECT COUNT(1)
+		  FROM TB_PlAN
+		 WHERE 1=1
+		 <include refid="getPlanListCondition_sql"/>
+	</select>
+	
+	<!-- 기획전 목록 -->
+	<select id="getPlanList" parameterType="Plan" resultType="Plan">
+		/* TsaPlan.getPlanList */
+		 SELECT Z.*
+		 FROM(
+		      SELECT @rownum := @rownum + 1 AS RNUM
+		             ,A.*
+		       FROM (
+		              SELECT PLAN_SQ                
+		                   , PLAN_NM                
+		                   , PLAN_GB                
+		                   , SITE_CD                
+		                   , FRONT_GB               
+		                   , DISP_STDT    
+		                   , DISP_EDDT   
+		                   , MAIN_PIMG              
+		                   , MAIN_MIMG              
+		                   , DTL_PIMG               
+		                   , DTL_MIMG               
+		                   , DTL_TITLE1             
+		                   , REPLY_YN               
+		                   , REPLY_TITLE1           
+		                   , REPLY_TITLE2           
+		                   , REPLY_LOC              
+		                   , REPLY_IMG              
+		                   , POLL_SQ  
+		                   , NEW_CUST_YN
+		                            , CUST_JOIN_STDT
+		                            , CUST_JOIN_EDDT                 
+		                   , DEV_URL                
+		                   , CORNER_NM_DISP_YN      
+		                   , GOODS_LIMIT_YN         
+		                   , GOODS_LIMIT_QTY        
+		                   , DEL_YN                 
+		                   , OPEN_YN                
+		                   , DISP_ORD               
+		                   , READ_CNT               
+		                   , BADGE_NM               
+		                   , BADGE_FCOLOR           
+		                   , BADGE_BCOLOR           
+		                   , FN_GET_USER_NM(REG_NO) AS REG_NM               
+		                   , REG_DT
+		                     AS REG_DT              
+		                   , UPD_NO                 
+		                   , UPD_DT              
+		              FROM   TB_PLAN T JOIN ( SELECT @rownum := 0) R
+		              WHERE  1=1
+		              AND    DEL_YN = 'N'
+		     <include refid="getPlanListCondition_sql"/>
+		     ORDER  BY PLAN_SQ DESC
+		    <include refid="getListPagingCondition_sql"/>
+		     
+	</select>
+	
+	
+	
+
+	<sql id="getPlanListCondition_sql">
+		<if test ="siteCd != null and siteCd !=''">
+		AND    SITE_CD = #{siteCd}
+		</if>
+		<if test="planSq != null and planSq != ''">
+		AND    PLAN_SQ = #{planSq}
+		</if>
+		<if test="planNm != null and planNm != ''">
+		AND    UPPER(PLAN_NM) LIKE CONCAT('%', #{planNm},'%') 
+		</if>
+		
+		<if test="condition != null and condition != ''">
+		<choose>
+			     <when test="search != null and search == 'searchPlanNm'">
+		AND  
+		        <foreach collection="conditionList" item="item" index="index" separator="or">
+		        UPPER(PLAN_NM) LIKE CONCAT('%',UPPER(#{item}),'%') 
+		        </foreach>
+		     </when>
+		      <when test="search != null and search == 'searchPlanSq'">
+		AND 		 
+		         <foreach collection="conditionList"  item="item" index="index" separator="or">
+		          UPPER(PLAN_SQ) LIKE CONCAT('%',UPPER(#{item}),'%') 
+		         </foreach>
+			      </when>
+		</choose>
+		</if>
+		<if test="openYn != null and openYn != ''">
+		AND    OPEN_YN = #{openYn}
+		</if>
+		<if test="regNo != null and regNo != ''">
+		AND    REG_NO = #{regNo} 
+		</if>
+		<if test="frontGb != null and frontGb != ''">
+		AND    FRONT_GB LIKE CONCAT('%',#{frontGb},'%')
+		</if>
+		<if test="planGb != null and planGb != ''">
+		AND    PLAN_GB = #{planGb}
+		</if>
+		<if test="stDate != null and stDate != '' and edDate != null and edDate != ''">
+		AND    DISP_STDT <![CDATA[ >= ]]> DATE_FORMAT(#{stDate},'%Y-%m-%d %H:%i:%S')
+		AND    DISP_STDT <![CDATA[ <= ]]> DATE_FORMAT(#{edDate},'%Y-%m-%d %H:%i:%S')
+		</if>
+		<if test="popupDispStdt != null and popupDispStdt != '' and popupDispEddt != null and popupDispEddt != ''">
+		AND    DISP_STDT <![CDATA[>=]]> DATE_FORMAT(#{popupDispStdt}, '%Y-%m-%d %H:%i:%S')
+		AND    DISP_STDT <![CDATA[<=]]> DATE_FORMAT(#{popupDispEddt}, '%Y-%m-%d %H:%i:%S')
+		</if>
+	</sql>
+
+	<sql id="getListPagingCondition_sql">
+		<choose>
+			<when test="pageable != null">
+				) A
+				)Z
+				WHERE RNUM BETWEEN  #{pageable.startRow} AND #{pageable.endRow}
+			</when>
+			<otherwise>
+				) A
+				)Z
+			</otherwise>
+		</choose>
+	</sql>
+	
+</mapper>

+ 38 - 0
src/main/java/com/style24/scm/biz/dao/TssPlanDao.java

@@ -0,0 +1,38 @@
+package com.style24.scm.biz.dao;
+
+import java.util.Collection;
+
+import org.springframework.stereotype.Repository;
+
+import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.Plan;
+
+/**
+ * 기획전 Dao
+ *
+ * @author sowon
+ * @since 2021. 5. 3
+ */
+@ShopDs
+@Repository
+public interface TssPlanDao {
+	/**
+	 * 기획전 목록
+	 *
+	 * @param 검색조건
+	 * @return
+	 * @author sowon
+	 * @since 2019. 12. 27
+	 */
+	Collection<Plan> getPlanList(Plan param);
+	
+	/**
+	 * 기획전 리스트 카운트 조회
+	 * @param  param
+	 * @return int
+	 * @author sowon
+	 * @since 2021. 2. 5
+	 */
+	int getPlanListCount(Plan param);
+	
+}

+ 54 - 0
src/main/java/com/style24/scm/biz/service/TssPlanService.java

@@ -0,0 +1,54 @@
+package com.style24.scm.biz.service;
+
+import java.util.Collection;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Service;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.style24.persistence.domain.Plan;
+import com.style24.scm.biz.dao.TssPlanDao;
+
+import lombok.extern.slf4j.Slf4j;
+/**
+ * 기획전 Service
+ * 
+ * @author sowon
+ * @since 2021. 02. 04
+ */
+@Service
+@Slf4j
+public class TssPlanService {
+	@Autowired
+	private TssPlanDao planDao;
+	
+	@Autowired
+	private Environment env;
+	
+	@Autowired
+	private ObjectMapper mapper;
+	/**
+	 * 기획전 목록
+	 *
+	 * @param
+	 * @return
+	 * @author sowon
+	 * @since 2021. 2. 5
+	 */
+	public Collection<Plan> getPlanList(Plan param) {
+		return planDao.getPlanList(param);
+	}
+	
+	/**
+	 * 기획전 목록 카운트 조회
+	 * @param  param
+	 * @return int
+	 * @author sowon
+	 * @since 2021. 2. 5
+	 */
+	public int getPlanListCount(Plan param) {
+		return planDao.getPlanListCount(param);
+	}
+
+}

+ 108 - 0
src/main/java/com/style24/scm/biz/web/TssMarketingController.java

@@ -0,0 +1,108 @@
+package com.style24.scm.biz.web;
+
+
+
+import java.util.Collection;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+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.gagaframework.web.parameter.GagaMap;
+import com.style24.persistence.TscPageRequest;
+import com.style24.persistence.domain.Plan;
+import com.style24.scm.biz.service.TssPlanService;
+import com.style24.scm.biz.service.TssRendererService;
+import com.style24.scm.support.controller.TssBaseController;
+import com.style24.scm.support.security.session.TssSession;
+
+import lombok.extern.slf4j.Slf4j;
+
+
+/**
+ * 마케팅 Controller
+ * @author sowon
+ * @since 2021. 05. 03
+ */
+@Controller
+@RequestMapping("/marketing")
+@Slf4j
+public class TssMarketingController extends TssBaseController {
+
+	@Autowired
+	private TssPlanService planService;
+	
+	@Autowired
+	private TssRendererService rendererService;
+	
+	@Value("${upload.default.target.path}")
+	private String uploadTargetPath;
+
+	/**
+	 *   기획전 작업 시작 - sowon
+	 */
+
+	/**
+	 * 기획전 관리
+	 * @param
+	 * @return
+	 * @author sowon
+	 * @since 2021. 2. 3
+	 */
+	@GetMapping("/planning/form")
+	public ModelAndView planListForm() {
+		ModelAndView mav = new ModelAndView();
+		// 사이트 목록
+		String supplyCompCd = TssSession.getInfo().getSupplyCompCd();
+		String selfYn = "N";
+		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, selfYn));
+		// 사용여부
+		mav.addObject("useYnList", rendererService.getAvailCommonCodeList("G002"));
+		mav.setViewName("marketing/PlanListForm");
+		return mav;
+	}
+	
+	/**
+	 * 기획전관리 목록
+	 *
+	 * @param
+	 * @return 기획전 목록
+	 * @author sowon
+	 * @since 2021. 2. 5
+	 */
+	@PostMapping("/planning/list")
+	@ResponseBody
+	public GagaMap getPlanList(@RequestBody Plan param) {
+		GagaMap result = new GagaMap();
+
+		// 입점업체담당자는 업체코드 설정
+		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
+			param.setRegNo(TssSession.getInfo().getUserNo());
+		}
+		// multi row 검색관련 처리
+		if (!StringUtils.isBlank(param.getCondition())) {
+			param.setConditionList(param.getCondition().replaceAll("\r", "").split("\n"));
+		}
+		
+		param.setPageable(new TscPageRequest(param.getPageNo() - 1, param.getPageSize()));
+		param.getPageable().setTotalCount(planService.getPlanListCount(param));
+
+		Collection<Plan> planList = planService.getPlanList(param);
+
+		result.set("pageing", param);
+		result.set("planList", planList);
+
+		log.debug("dataList: {}", planList);
+
+		return result;
+	}
+
+
+}

+ 355 - 0
src/main/webapp/WEB-INF/views/marketing/PlanListForm.html

@@ -0,0 +1,355 @@
+<!DOCTYPE html>
+<html lang="ko" xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : PlanListForm.html
+ * @desc    : 기획전관리 Page
+ *============================================================================
+ * SISUN
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.05.03   sowon        최초 작성
+ *******************************************************************************
+ -->
+<div id="main">
+	<div class="main-title"></div>
+<form id="planListSearchForm" name="planListSearchForm" action="#"
+			th:action="@{'/marketing/planning/list'}"
+			onsubmit="$('#btnSearch').trigger('click'); return false;">
+	<div class="panelStyle">
+			<table class="frmStyle">
+				<colgroup>
+					<col style="width: 5%;" />
+					<col style="width: 20%;" />
+					<col style="width: 5%;" />
+					<col style="width: 20%;" />
+					<col style="width: 5%;" />
+					<col style="width: 10%;" />
+					<col style="width: 5%;" />
+					<col style="width: 10%;" />
+					<col />
+				</colgroup>
+				<tbody>
+					<tr>
+						<th>사이트</th>
+						<td><select name="selSupplyCompCd" id="selSupplyCompCd" disabled="disabled" class="w70p">
+								<option value="">[선택]</option>
+								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" th:selected="${sessionInfo.supplyCompCd ==  oneData.cd}"></option>
+							</select>
+						</td>
+						<th>오픈여부</th>
+						<td colspan="2"><select name="openYn">
+								<option value="">전체</option>
+								<option th:if="${useYnList}"
+									th:each="oneData, status : ${useYnList}"
+									th:value="${oneData.cd}"
+									th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
+						</select></td>
+						<th rowspan="3">키워드</th>
+						<td rowspan="3"><select name="search" id="search">
+								<option value="searchPlanNm">기획전명</option>
+								<option value="searchPlanSq">기획전번호</option>
+						</select> <textarea class="textareaR3 w90p" name="condition" id="condition"></textarea>
+						</td>
+					</tr>
+					<tr>
+						<th>PC/모바일구분</th>
+						<td><select name="frontGb">
+								<option value="">ALL</option>
+								<option value="P">웹</option>
+								<option value="M">모바일</option>
+								<option value="A">앱</option>
+						</select></td>
+
+						<th>기획전구분</th>
+						<td colspan="2"><select name="planGb">
+								<option value="">전체</option>
+								<option value="P">기획전</option>
+						</select></td>
+					</tr>
+
+					<tr>
+						<th>진행기간</th>
+						<td colspan="6" id="sellTerms"></td>
+					</tr>
+				</tbody>
+			</table>
+
+			<ul class="panelBar">
+				<li class="center"><input type="button" value="초기화" class="btn btn-gray btn-lg" id="btnInit" /> 
+				<input type="button" value="조회" class="btn btn-base btn-lg" id="btnSearch" />
+				</li>
+			</ul>
+	</div>
+
+	<div class="panelStyle">
+		<!-- 검색결과 영역 -->
+		<!-- 상단버튼 영역  -->
+		<ul class="panelBar">
+			<li>
+				<button type="button" class="btn btn-danger btn-lg"
+					onclick="fnSelectedDelete();">삭제</button>
+			</li>
+			<li class="right">
+				<button type="button" class="btn btn-primary btn-lg"
+					onclick="fnPlanRegisterPopup();">등록</button> 검색결과 : <strong><span
+					id="gridRowTotalCount">0</span> 건</strong>&nbsp; 쪽번호 <span id="pgNo">0</span>/
+				<strong id="endPgNo">0</strong>&nbsp;&nbsp; <select id="pageSize"
+				name="pageSize">
+					<option value="50" selected="selected">50개씩 보기</option>
+					<option value="100">100개씩 보기</option>
+					<option value="500">500개씩 보기</option>
+					<option value="1000">1000개씩 보기</option>
+			</select> <input type="hidden" name="pageNo" id="pageNo" value="1" />
+			</li>
+		</ul>
+
+		<div id="gridList" style="width: 100%; height: 500px;"
+			class="ag-theme-balham"></div>
+		<ul class="panelBar">
+			<li class="center">
+				<div class="tablePaging" id="planListPagination"></div>
+			</li>
+		</ul>
+	</div>
+	</form>
+</div>
+
+<!-- 컬러 피커 -->
+<!-- <script src='https://bgrins.github.io/spectrum/spectrum.js'></script> -->
+<!-- <link rel='stylesheet' href='https://bgrins.github.io/spectrum/spectrum.css' /> -->
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js"></script>
+<script th:inline="javascript">
+/*<![CDATA[*/
+	
+	var supplyCompCd = [[${supplyCompCd}]];
+	var wmGbList = {"A":"모바일APP", "P":"웹PC", "M":"모바일PC", "P|M":"웹PC|모바일PC", "P|A":"웹PC|모바일APP", "M|A":"모바일PC|모바일APP", "P|M|A":"전체"};
+	var templateTypeList = {"H":"HTML", "T":"TEXT"};
+	var planGbList = {"P":"기획전", "E":"이벤트", "S":"총알배송", "C" :"출석체크"};
+
+	var columnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{headerName: "미리보기"		, field:'plan'		, width:100, cellClass: 'text-center',
+			cellRenderer: function(params) { return '<a href="javascript:void(0);" onclick="fnPreview(\'' + params.data.planSq + '\');">' + '미리보기' + '</a>'; }
+		},
+		{headerName: "기획전구분"		, field:'planGb'	, width:100, cellClass: 'text-center',
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(planGbList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(planGbList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(planGbList, params.newValue); }
+		},
+		{headerName: "사이트"			, field:'siteCd'	, width:100, cellClass: 'text-center',
+			cellEditor: 'agRichSelectCellEditor',
+			/* cellEditorParams: { values: gagaAgGrid.extractValues(supplyCompCd) }, */
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(supplyCompCd, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(supplyCompCd, params.newValue); }
+		},
+		{headerName: "프론트구분"	, field:'frontGb'	, width:120, cellClass: 'text-center',
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(wmGbList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(wmGbList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(wmGbList, params.newValue); }
+		},
+		{headerName: "오픈여부"		, field:'openYn'	, width:80 , cellClass: 'text-center'},
+		{headerName: "기획전번호"		, field:'planSq'	, width:100, cellClass: 'text-center',
+			cellRenderer: function(params) { return '<a href="javascript:void(0);">' + params.value + '</a>'; }
+		},
+		{headerName: "기획전명"		, field:'planNm'	, width:300, cellClass: 'text-left',
+			cellRenderer: function(params) { return '<a href="javascript:void(0);">' + params.value + '</a>'; }
+		},
+		{headerName: "서브제목"		, field:'dtlTitle1'	, width:300 , cellClass: 'text-center'},
+		{headerName: "전시순서"		, field:'dispOrd'	, width:100, cellClass: 'text-right' },
+		{headerName: "진행시작일시"		, field:'dispStdt'	, width:150, cellClass: 'text-center'},
+		{headerName: "진행종료일시"		, field:'dispEddt'	, width:150, cellClass: 'text-center'},
+		{headerName: "등록자"			, field:'regNm'		, width:100, cellClass: 'text-center'},
+		{headerName: "등록일"			, field:'regDt'		, width:150, cellClass: 'text-center'}
+	];
+	
+	// Get GridOptions
+	var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// 중복 선택 가능
+	gridOptions.rowSelection = 'multiple';
+	gridOptions.suppressRowClickSelection = true;
+
+	// 셀 클릭 이벤트
+	gridOptions.onCellClicked = function(event) {
+		var field = event.colDef.field;
+		if (field != 'planSq' && field != 'planNm')
+			return;
+
+		fnBindDetail(field, event.data); // 바인딩
+	}
+	
+	// 바인딩
+	var fnBindDetail = function(field, rowData) {
+		if (field == 'planSq') { // 기획전 웹수정 팝업
+			fnEventDetailPopup(rowData.planSq);
+		}
+
+		if (field == 'planNm') { // 기획전 관리 팝업
+			fnEventCornerPopup(rowData.planSq);
+		}
+	}
+	
+
+	// 웹 등록 팝업
+	var fnPlanRegisterPopup = function() {
+		var actionUrl = "/marketing/planning/detail/form?mode=N";
+		cfnOpenModalPopup(actionUrl,'popupPlanDetail');
+	} 
+
+	// 웹 수정 팝업
+	var fnEventDetailPopup = function(planSq) {
+		var actionUrl = "/marketing/planning/detail/form?mode=U&planSq=" + planSq;
+		cfnOpenModalPopup(actionUrl,'popupPlanDetail');
+	}
+	
+	// 이벤트 코너 관리 팝업
+	var fnEventCornerPopup = function(planSq) {
+		var actionUrl = "/marketing/planning/corner/list/form?planSq=" + planSq;
+		cfnOpenModalPopup(actionUrl, 'popupCorner');
+	}
+
+	// 미리보기
+	var fnPreview = function(planSq) {
+		var _wmall = [[${@environment.getProperty('domain.pastel')}]];
+		window.open(_wmall + '/planning/detail/form?planSq=' + planSq + '&adminPreview=Y', '_blank');
+ 		//document.location.href = _PAGE_CUSTOMER_INFO;
+	}
+
+		
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+		fnInit();
+	});
+	
+	var fnInit = function(){
+		$('#planListSearchForm')[0].reset();
+	}
+	
+	// 조회클릭시
+	$('#btnSearch').on('click', function() {
+		$("#planListSearchForm input[name=pageNo]").val('1');
+		fnPlanListSearch();
+	});
+	
+	// 이벤트 코너 관리 팝업
+	var fnEventCornerPopup = function(planSq) {
+		var actionUrl = "/marketing/planning/corner/list/form?planSq=" + planSq;
+		cfnOpenModalPopup(actionUrl, 'popupCorner');
+	}
+
+	// 조회
+	var fnPlanListSearch = function() {
+		
+		if(!fnConditionCheck()) return;
+		
+		gagaPaging.init('planListSearchForm', fnSearchCallBack, 'planListPagination', $('#pageSize').val());
+		gagaPaging.load($("#planListSearchForm input[name=pageNo]").val());
+	}
+	
+	// 삭제클릭시
+	var fnSelectedDelete = function() {
+		var selectedData = gagaAgGrid.selectedRowData(gridOptions);
+
+		if (selectedData.length < 1) {
+			mcxDialog.alert('선택 된 기획전이 업습니다.');
+			return;
+		}
+
+		mcxDialog.confirm('선택된 기획전을 삭제하시겠습니까?',{
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function() {
+				var jsonData = JSON.stringify(selectedData);
+
+				gagajf.ajaxJsonSubmit('/marketing/planning/delete', jsonData, function() {
+					fnPlanListSearch();
+				});
+			}
+		});
+	}
+
+	//검색 조건 확인
+	var fnConditionCheck = function(){
+		var formId = '#planListSearchForm';
+		var form = document.planListSearchForm;
+
+		var searchFlag = false;
+		var cnt = 0;
+		
+		for (i = 0; i < form.elements.length; i++ ) {
+			var el = form.elements[i];
+			if ($(el).prop("type") == "text" || $(el).prop("type") == "textarea" || ($(el).prop("type") == "select-one" && 
+					el.name != "search" && el.name != "pageSize" && el.name != "beforSkipFlag")) {
+				if (!(el.value == null || el.value == "")) {
+					cnt++;
+				}
+			}
+		}		
+		if(cnt > 0) searchFlag = true;
+		
+		var fromDate = $('#planListSearchForm input[name=stDate]').val();
+		var toDate = $('#planListSearchForm input[name=edDate]').val();
+		
+		if (!gagajf.isNull(fromDate) || !gagajf.isNull(toDate)) {
+			
+			if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
+				mcxDialog.alertC("등록일 조회시 시작일자와 종료일자를 입력하세요.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#planListSearchForm input[name=stDate]').focus();
+					}
+				});
+				return false;
+			}
+
+			if (fromDate > toDate) {
+				mcxDialog.alert("노출기간 시작일자는 종료일자 보다 클 수 없습니다.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#planListSearchForm input[name=stDate]').focus();
+					}
+				});
+				return false;
+			} 
+		}
+
+		return true;
+	}
+	
+	var fnSearchCallBack = function(result){
+		$('#planListSearchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
+		$('#planListSearchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
+		$('#planListSearchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
+		$('#planListSearchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
+		gridOptions.api.setRowData(result.planList);
+		
+		gagaPaging.createPagination(result.pageing.pageable);
+	}
+	
+	//페이징 
+	$('#planListSearchForm select[name=pageSize]').on('change', function() {
+		$("#planListSearchForm input[name=pageNo]").val('1');
+		fnPlanListSearch($("#planListSearchForm input[name=searchGb]").val());
+	});
+
+	
+	$(document).ready(function() {
+
+		cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '기간', 'X');
+		var chkBeforSkipFlag = '&nbsp;&nbsp;<label class="chkBox"><input type="checkbox" name="beforSkipFlag" value="Y" >이전데이터 제외</label>';
+		$("#planListSearchForm").find('#sellTerms').append(chkBeforSkipFlag);
+		
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+	});
+
+/*]]>*/
+</script>
+
+</html>