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

최수빈-1229 다다익선 화면 중간 커밋

bin2107 5 лет назад
Родитель
Сommit
008aeee304

+ 11 - 0
style24.admin/src/main/java/com/style24/admin/biz/dao/TsaMarketingDao.java

@@ -4,6 +4,7 @@ import com.style24.core.support.annotation.ShopDs;
 import com.style24.persistence.domain.Coupon;
 import com.style24.persistence.domain.FreeGoodsPromotion;
 import com.style24.persistence.domain.Itemkind;
+import com.style24.persistence.domain.MoreBetter;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -51,4 +52,14 @@ public interface TsaMarketingDao {
 	int getCouponListCnt(Coupon param);
 	/* // JSM 진행 */
 
+	/* CSB 진행 */
+	/**
+	 * 사은품 프로모션 리스트
+	 * @param MoreBetter
+	 * @return
+	 * @author bin2107
+	 * @since 2020. 12. 28
+	 */
+	Collection<MoreBetter> getMorebetterList(MoreBetter param);
+	/* // CSB 진행 */
 }

+ 12 - 0
style24.admin/src/main/java/com/style24/admin/biz/service/TsaMarketingService.java

@@ -113,4 +113,16 @@ public class TsaMarketingService {
 	}
 	/* // JSM 진행 */
 
+	/* CSB 진행 */
+	/**
+	 * 다다익선 리스트
+	 * @param param
+	 * @return
+	 * @author bin2107
+	 * @since 2020. 12. 28
+	 */
+	public Collection<MoreBetter> getMorebetterList(MoreBetter param) {
+		return marketingDao.getMorebetterList(param);
+	}
+	/* // CSB 진행 */
 }

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

@@ -10,6 +10,7 @@ import com.style24.persistence.domain.CommonCode;
 import com.style24.persistence.domain.Coupon;
 import com.style24.persistence.domain.FreeGoodsPromotion;
 
+import com.style24.persistence.domain.MoreBetter;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
@@ -232,4 +233,40 @@ public class TsaMarketingController extends TsaBaseController {
 		return mav;
 	}
 	/* // JSM 진행 */
+
+	/* CSB 진행 */
+	/**
+	 * 다다익선 화면
+	 * @author bin2107
+	 * @since 2020. 12. 28
+	 */
+	@GetMapping("/morebetter/form")
+	public ModelAndView morebetterForm() {
+		ModelAndView mav = new ModelAndView();
+		mav.setViewName("marketing/MorebetterListForm");
+		return mav;
+	}
+
+	/**
+	 * 다다익선 리스트 조회
+	 * @author bin2107
+	 * @since 2020. 12. 28
+	 */
+	@PostMapping("/morebetter/list")
+	@ResponseBody
+	public GagaMap getMorebetterList(@RequestBody MoreBetter param) {
+		GagaMap result = new GagaMap();
+
+		List<MoreBetter> tmtbList = (ArrayList<MoreBetter>) marketingService.getMorebetterList(param);
+
+		param.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
+		param.setPageable(new TsaPageRequest(param.getPageNo() - 1, param.getPageSize()));
+		param.getPageable().setTotalCount(tmtbList.size());
+
+		result.set("pageing", param);
+		result.set("morebetterList", tmtbList);
+
+		return result;
+	}
+	/* // CSB 진행 */
 }

+ 36 - 0
style24.admin/src/main/java/com/style24/persistence/domain/MoreBetter.java

@@ -0,0 +1,36 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TsaPageRequest;
+import com.style24.persistence.TscBaseDomain;
+import lombok.Data;
+
+/**
+ * 품목 Domain
+ *
+ * @author bin2107
+ * @since 2020. 12. 28
+ */
+@SuppressWarnings("serial")
+@Data
+public class MoreBetter extends TscBaseDomain {
+	// 사은품 프로모션
+	private int tmtbSq;				// 프로모션ID
+	private String tmtbNm;			// 프로모션명
+	private String tmtbStat;		// 프로모션 상태
+	private String tmtbStdt;		// 프로모션 시작일
+	private String tmtbEddt;		// 프로모션 종료일
+	private String delYn;			// 삭제여부
+	private Integer regNo;			// 등록자
+	private String  regDt;			// 등록일시
+	private Integer udpNo;			// 수정자
+	private String  udtDt;			// 수정일시
+	private String searchGubun;		// 프로모션 조회 검색 구분
+	private String searchTxt;		// 프로모션 검색 조건
+	private String gbn;				// 팝업 구분 : C=등록, U=수정
+
+	// Pagination
+	private TsaPageRequest pageable;
+	private int pageNo = 1;
+	private int pageSize = 50;
+	private int pageUnit = 10;
+}

+ 30 - 0
style24.admin/src/main/java/com/style24/persistence/mybatis/shop/TsaMarketing.xml

@@ -134,4 +134,34 @@
 		</if>
 	</select>
 	<!-- // JSM 진행 -->
+
+	<!-- // CSB 진행 -->
+	<select id="getMorebetterList" parameterType="MoreBetter" resultType="MoreBetter">
+		SELECT TMTB_SQ
+			 , TMTB_NM
+			 , FN_GET_CODE_NM('G232',TMTB_STAT) as TMTB_STAT
+			 , DATE_FORMAT(TMTB_ST_DT, '%Y.%m.%d') AS TMTB_STDT
+			 , DATE_FORMAT(TMTB_ED_DT, '%Y.%m.%d') AS TMTB_EDDT
+			 , DEL_YN
+			 , FN_GET_USER_NM(REG_NO) AS REG_NM
+			 , DATE_FORMAT(REG_DT, '%Y.%m.%d %H:%i:%S') AS REG_DT
+			 , FN_GET_USER_NM(UDP_NO) AS UPD_NM
+			 , DATE_FORMAT(UDT_DT, '%Y.%m.%d %H:%i:%S') AS UPD_DT
+		FROM TB_TMTB
+		WHERE 1=1
+		<if test="tmtbStdt != null and tmtbStdt != '' and tmtbEddt != null and tmtbEddt != ''">
+			AND TMTB_ST_DT >= DATE_FORMAT(#{tmtbStdt} , '%Y-%m-%d')
+			AND TMTB_ED_DT <![CDATA[ <= ]]> DATE_FORMAT(#{tmtbEddt} , '%Y-%m-%d')
+		</if>
+		<if test="searchTxt != null and searchTxt != ''">
+			<if test="searchGubun != null and searchGubun == 'tmtbSq'">
+				AND TMTB_SQ = #{searchTxt}
+			</if>
+			<if test="searchGubun != null and searchGubun == 'tmtbNm'">
+				AND TMTB_NM = #{searchTxt}
+			</if>
+		</if>
+		ORDER BY REG_DT DESC
+	</select>
+	<!--// CSB 진행 -->
 </mapper>

+ 233 - 0
style24.admin/src/main/webapp/WEB-INF/views/marketing/MorebetterListForm.html

@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : MorebetterListForm.html
+ * @desc    : 다다익선 관리 페이지
+ *============================================================================
+ * SISUN
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.12.28   bin2107   최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+		
+		<!-- 메뉴 설명 -->
+		<!--<div class="infoBox menu-desc">
+		</div>-->
+		<form id="searchForm" name="searchForm" action="#" th:action="@{'/marketing/morebetter/list'}">
+			<input type="hidden" id="searchGb" name="searchGb" />
+			<input type="hidden" id="imageViewYn" name="imageViewYn" />
+			<input type="hidden" id="goodsPriceYn" name="goodsPriceYn" value="Y"/> <!-- 즉시할인판매가 조회 -->
+
+				<!-- 패널 영역1 -->
+			<div class="panelStyle" >
+				<!-- 검색조건 영역 -->
+				<!-- TITLE -->
+				<div class="panelTitle">
+					<!--<h3><i class="fa fa-info-circle"></i>아래 검색조건 중 <font color="red">업체, 키워드, 발생일</font>중 하나를 꼭 입력해 주세요.</h3>-->
+					<h3><i class="fa fa-info-circle"></i>검색조건</h3>
+					<span class="panelControl">
+						<i class="fa fa-chevron-up"></i>
+					</span>
+				</div>
+				<!-- //TITLE -->
+				<div class="panelContent">
+					<table class="frmStyle">
+						<colgroup>
+							<col style="width: 7%;"/>
+							<col/>
+						</colgroup>
+
+						<tr>
+							<th>기간</th>
+							<td id="sellTerms"></td>
+						</tr>
+
+						<tr>
+							<th>프로모션 조회</th>
+							<td>
+								<label class="rdoBtn"><input type="radio" name="searchGubun" id="promotionId" value="tmtbSq"  checked/>프로모션ID</label>
+								<label class="rdoBtn"><input type="radio" name="searchGubun" id="promotionName" value="tmtbNm"/>프로모션명</label>
+								<input type="text" class="w900" name="searchTxt" id="searchTxt" />
+							</td>
+						</tr>
+					</table>
+					<ul class="panelBar">
+						<li class="center">
+							<button type="button" class="btn btn-gray btn-lg" id="btnInit" >초기화</button>
+							<button type="button" class="btn btn-info btn-lg" id="btnSearch" >조회</button>
+						</li>
+					</ul>
+				</div>
+				<!-- //검색조건 영역 -->
+			</div>
+
+			<!-- 패널 영역1 -->
+			<div class="panelStyle">
+				<!-- 상단버튼 영역  -->
+				<ul class="panelBar">
+					<li class="right">
+						검색결과 : <strong><span id="gridRowTotalCount">0</span> 건</strong>&nbsp;
+						쪽번호 <span id="pgNo">0</span>/ <strong id="endPgNo">0</strong>&nbsp;&nbsp;
+						<select id="pageSize" name="pageSize">
+							<option value="50" selected="selected">50개씩 보기</option>
+							<option value="100">100개씩 보기</option>
+							<option value="500">500개씩 보기</option>
+							<option value="1000">1000개씩 보기</option>
+						</select>
+						<input type="hidden" name="pageNo" id="pageNo" value ="1"/>
+					</li>
+				</ul>
+				<div class="panelBar">
+					<div class="right">
+						<button type="button" class="btn btn-info btn-lg" id="btnFreeGoodsRegi" >프로모션등록</button>
+					</div>
+				</div>
+				<!-- 검색결과 영역 -->
+				<!--<div id="gridList" style="width: 100%; height: 700px;" class="ag-theme-balham lh60"></div>-->
+				<div id="gridList" style="width: 100%; height: 570px" class="ag-theme-balham"></div>
+			</div>
+		</form>
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=2019072202"></script>
+<script th:inline="javascript">
+/*<![CDATA[*/
+	var columnDefs = [];
+	columnDefs = [
+		{headerName: "프로모션ID", field: "tmtbSq", width: 80, cellClass: 'text-center'},
+		{headerName: "프로모션명", field: "tmtbNm", width: 130, cellClass: 'text-center'},
+		{headerName: "상태", field: "tmtbStat", width: 140, cellClass: 'text-center'},
+		{headerName: "시작일", field: "tmtbStdt", width: 140, cellClass: 'text-center'},
+		{headerName: "종료일", field: "tmtbEddt", width: 140, cellClass: 'text-center'},
+		{headerName: "등록자", field: "regNm", width: 200, cellClass: 'text-left'
+			,cellRenderer: function(params) {
+				return params.value + "(" + params.data.regDt + ")";
+			}
+		},
+		{headerName: "최종수정자", field: "updNm", width: 200, cellClass: 'text-left'
+			,cellRenderer: function(params) {
+				return params.value + "(" + params.data.updDt + ")";
+			}
+		}
+	];
+
+	// Get GridOptions
+	var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// Row Click
+	gridOptions.onCellClicked = function(event) {
+		var goodsCd = event.data.goodsCd;
+		if (event.colDef.field == "tmtbNm"){
+			// 수정 필요
+			// cfnOpenGoodsDetailPopup('U',goodsCd);
+		}
+	}
+
+	// 어떤건지 확인 필요
+	/* gridOptions.getRowStyle = function(params) {
+		if ("G008_00" == params.data.goodsStat  || "G008_10" == params.data.goodsStat || "G008_20" == params.data.goodsStat || "G008_30" == params.data.goodsStat) {
+			return { background: '#23c6c8' };
+		}
+	} */
+
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+
+		$('#searchForm')[0].reset();
+		//$("#searchForm input[type=radio]").removeClass("checked");
+		$("#searchForm input[type=checkbox]").removeClass("checked");
+		//$("#searchForm input[type=radio]").parent("label").removeClass("checked");
+		$("#searchForm input[type=checkbox]").parent("label").removeClass("checked");
+		$("#searchForm input[type=radio][checked]").parent("label").addClass("checked");
+	});
+
+	// 조회클릭시
+	$('#btnSearch').on('click', function() {
+		$("#searchForm input[name=pageNo]").val('1');
+		fnMorebetterListSearch();
+	});
+
+	// 조회
+	var fnMorebetterListSearch = function() {
+		if(!fnConditionCheck()) return;
+
+		gagaPaging.init('searchForm', fnSearchCallBack, 'morebetterListPagination', $('#searchForm').find('#pageSize').val());
+		gagaPaging.load($("#searchForm input[name=pageNo]").val());
+	}
+
+	//검색 조건 확인
+	var fnConditionCheck = function(){
+		var fromDate = $('#searchForm input[name=tmtbStdt]').val();
+		var toDate = $('#searchForm input[name=tmtbEddt]').val();
+
+		if (!gagajf.isNull(fromDate) || !gagajf.isNull(toDate)) {
+
+			if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
+				mcxDialog.alertC("기간 조회시 시작일자와 종료일자를 입력하세요.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#searchForm input[name=tmtbStdt]').focus();
+					}
+				});
+				return false;
+			}
+
+			if (fromDate > toDate) {
+				mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#searchForm input[name=tmtbEddt]').focus();
+					}
+				});
+				return false;
+			}
+		}
+
+		return true;
+	}
+
+	var fnSearchCallBack = function(result){
+
+		$('#searchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
+		$('#searchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
+		$('#searchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
+		$('#searchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
+		gridOptions.api.setRowData(result.morebetterList);
+		gagaPaging.createPagination(result.pageing.pageable);
+		
+	}
+
+	// 조회클릭시
+	$('#btnMorebetterRegi').on('click', function() {
+		cfnOpenMorebetterSetPopup();
+	});
+
+
+	//페이징
+	$('#searchForm select[name=pageSize]').on('change', function() {
+		$("#searchForm input[name=pageNo]").val('1');
+		fnMorebetterListSearch();
+	});
+
+	$(document).ready(function() {
+
+		cfnCreateCalendar('#sellTerms', 'tmtbStdt', 'tmtbEddt', true, '기간', 'X');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+	});
+
+/*]]>*/
+</script>
+	</div>
+
+</html>