فهرست منبع

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

gagamel 5 سال پیش
والد
کامیت
709860838f

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

@@ -0,0 +1,36 @@
+package com.style24.admin.biz.dao;
+
+import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.Itemkind;
+import com.style24.persistence.domain.Marketing;
+import org.springframework.stereotype.Component;
+
+import java.util.Collection;
+
+/**
+ * 마케팅 Dao
+ *
+ * @author xodud1202
+ * @since 2020. 12. 17
+ */
+@ShopDs
+@Component
+public interface TsaMarketingDao {
+	/* xodud1202 진행 */
+
+	/**
+	 * 사은품 프로모션 리스트
+	 * @param marketing
+	 * @return
+	 * @author xodud1202
+	 * @since 2020. 12. 17
+	 */
+	Collection<Marketing> getFreeGoodsPromotionList(Marketing marketing);
+
+	/* // xodud1202 진행 */
+
+	/* JSM 진행 */
+
+	/* // JSM 진행 */
+
+}

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

@@ -0,0 +1,95 @@
+package com.style24.admin.biz.service;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.gagaframework.excel.GagaExcelUtil;
+import com.gagaframework.excel.env.GagaExcelConstants;
+import com.gagaframework.web.parameter.GagaMap;
+import com.gagaframework.web.util.GagaDateUtil;
+import com.gagaframework.web.util.GagaFileUtil;
+import com.gagaframework.web.util.GagaStringUtil;
+import com.style24.admin.biz.dao.TsaGoodsDao;
+import com.style24.admin.biz.dao.TsaMarketingDao;
+import com.style24.admin.support.env.TsaConstants;
+import com.style24.admin.support.security.session.TsaSession;
+import com.style24.core.biz.thirdparty.NaverLowestPriceApi;
+import com.style24.core.biz.thirdparty.SafetyKoreaApi;
+import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.persistence.domain.*;
+import io.netty.util.internal.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+
+/**
+ *상품관리 Service
+ *
+ * @author xodud1202
+ * @since 2020. 12. 17
+ */
+@Service
+@Slf4j
+public class TsaMarketingService {
+
+	@Autowired
+	private TscMessageByLocale message;
+
+	@Autowired
+	private Environment env;
+
+	@Autowired
+	private TsaMarketingDao marketingDao;
+
+	@Autowired
+	private TsaBusinessService businessService;
+
+	@Autowired
+	private TsaCommonService commonService;
+
+	@Autowired
+	private TsaRendererService rendererService;
+
+	@Autowired
+	private TsaNoticeService noticeService;
+
+	@Autowired
+	private SafetyKoreaApi safetyKoreaApi;
+
+	@Autowired
+	private NaverLowestPriceApi naverLowestPriceApi;
+
+
+	@Autowired
+	private ObjectMapper mapper;
+
+	private static final String NUMBER_PATTERN = "^[0-9]+$";
+
+	private static final String SELF_GOOODS_AFTER = "STY";
+
+	/* xodud1202 진행 */
+
+	/**
+	 * 사은품 프로모션 리스트
+	 * @param marketing
+	 * @return
+	 * @author xodud1202
+	 * @since 2020. 12. 17
+	 */
+	public Collection<Marketing> getFreeGoodsPromotionList(Marketing marketing) {
+		return marketingDao.getFreeGoodsPromotionList(marketing);
+	}
+
+	/* // xodud1202 진행 */
+
+	/* JSM 진행 */
+
+	/* // JSM 진행 */
+
+}

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

@@ -0,0 +1,96 @@
+package com.style24.admin.biz.web;
+
+import com.gagaframework.web.parameter.GagaMap;
+import com.style24.admin.biz.service.TsaCommonService;
+import com.style24.admin.biz.service.TsaMarketingService;
+import com.style24.admin.biz.service.TsaRendererService;
+import com.style24.admin.biz.service.TsaSystemService;
+import com.style24.admin.support.controller.TsaBaseController;
+import com.style24.admin.support.security.session.TsaSession;
+import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.persistence.TsaPageRequest;
+import com.style24.persistence.domain.Marketing;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 마케팅 Controller
+ * @author xodud1202
+ * @since 2020. 12.16
+ */
+@Controller
+@RequestMapping("/marketing")
+@Slf4j
+public class TsaMarketingController extends TsaBaseController {
+
+	@Autowired
+	private TscMessageByLocale message;
+
+	@Autowired
+	private Environment env;
+
+	@Autowired
+	private TsaMarketingService marketingService;
+
+	@Autowired
+	private TsaRendererService rendererService;
+
+	@Autowired
+	private TsaCommonService commonService;
+
+	@Autowired
+	private TsaSystemService systemService;
+
+	/* xodud1202 진행 */
+	/**
+	 * 사은품 프로모션 관리 화면
+	 * @return
+	 * @author xodud1202
+	 * @since 2020. 12. 16
+	 */
+	@GetMapping("/freeGoods/promotion/form")
+	public ModelAndView freeGoodsPromotionForm() {
+		ModelAndView mav = new ModelAndView();
+		mav.setViewName("marketing/FreeGoodsPromotionForm");
+		return mav;
+	}
+
+	/**
+	 * 사은품 프로모션 목록 조회
+	 *
+	 * @return
+	 * @author xodud1202
+	 * @since 2020. 10. 17
+	 */
+	@PostMapping("/freeGoodsPromotion/list")
+	@ResponseBody
+	public GagaMap getFreeGoodsPromotionList(@RequestBody Marketing marketing) {
+		GagaMap result = new GagaMap();
+
+		List<Marketing> marketingList = (ArrayList<Marketing>) marketingService.getFreeGoodsPromotionList(marketing);
+
+		marketing.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
+		marketing.setPageable(new TsaPageRequest(marketing.getPageNo() - 1, marketing.getPageSize()));
+		marketing.getPageable().setTotalCount(marketingList.size());
+
+		result.set("pageing", marketing);
+		result.set("freeGoodsList", marketingList);
+
+		return result;
+	}
+
+
+	/* // xodud1202 진행 */
+
+	/* JSM 진행 */
+
+	/* // JSM 진행 */
+}

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

@@ -0,0 +1,38 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TsaPageRequest;
+import com.style24.persistence.TscBaseDomain;
+import lombok.Data;
+
+/**
+ * 품목 Domain
+ *
+ * @author gagamel
+ * @since 2020. 10. 7
+ */
+@SuppressWarnings("serial")
+@Data
+public class Marketing extends TscBaseDomain {
+	// 사은품 프로모션
+	private int freeGiftSq;		// 프로모션ID
+	private String freeGiftName;	// 프로모션명
+	private String freeGiftStat;	// 프로모션 상태
+	private String freeGiftStdt;	// 프로모션 시작일
+	private String freeGiftEddt;	// 프로모션 종료일
+	private String promotionGubun;	// 프로모션 조회 검색 구분
+	private String searchTxt;		// 프로모션 검색 조건
+
+	// Pagination
+	private TsaPageRequest pageable;
+	private int pageNo = 1;
+	private int pageSize = 50;
+	private int pageUnit = 10;
+
+	/* xodud1202 진행 */
+
+	/* // xodud1202 진행 */
+
+	/* JSM 진행 */
+
+	/* // JSM 진행 */
+}

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

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.style24.admin.biz.dao.TsaMarketingDao">
+
+	<!-- 품목 목록 -->
+	<select id="getFreeGoodsPromotionList" parameterType="Marketing" resultType="Marketing">
+		/* TsaMarketing.getFreeGoodsPromotionList */
+		SELECT FG.FREEGIFT_SQ
+		     , FG.FREEGIFT_NM
+		     , FG.FREEGIFT_STAT
+		     , DATE_FORMAT(FG.FREEGIFT_STDT, '%Y.%m.%d') AS FREEGIFT_STDT
+		     , DATE_FORMAT(FG.FREEGIFT_EDDT, '%Y.%m.%d') AS FREEGIFT_EDDT
+		     , (SELECT USER_NM FROM TB_USER WHERE USER_NO = FG.REG_NO) AS REG_NM
+		     , DATE_FORMAT(FG.REG_DT, '%Y.%m.%d %H:%i:%S') AS REG_DT
+		     , (SELECT USER_NM FROM TB_USER WHERE USER_NO = FG.UPD_NO) AS UPD_NM
+		     , DATE_FORMAT(FG.UPD_DT, '%Y.%m.%d %H:%i:%S') AS UPD_DT
+          FROM TB_FREEGIFT FG
+         WHERE 1=1
+		<if test="searchTxt != null and searchTxt != ''">
+			<if test="promotionGubun != null and promotionGubun == 'freeGiftSq'">
+				AND FG.FREEGIFT_SQ = #{searchTxt}
+			</if>
+			<if test="promotionGubun != null and promotionGubun == 'freeGiftName'">
+				AND FG.FREEGIFT_NAME = #{searchTxt}
+			</if>
+		</if>
+         ORDER BY REG_DT DESC
+	</select>
+
+	<!-- xodud1202 진행 -->
+
+	<!-- // xodud1202 진행 -->
+
+	<!-- JSM 진행 -->
+
+	<!-- // JSM 진행 -->
+</mapper>

+ 221 - 0
style24.admin/src/main/webapp/WEB-INF/views/marketing/FreeGoodsPromotionForm.html

@@ -0,0 +1,221 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : FreeGoodsPromotionForm.html
+ * @desc    : 사은품 프로모션 관리 페이지
+ *============================================================================
+ * SISUN
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.12.16   xodud1202   최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+		
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc">
+		</div>
+		<form id="searchForm" name="searchForm" action="#" th:action="@{'/marketing/freeGoodsPromotion/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>
+					<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="promotionGubun" id="promotionId" value="freeGiftSq"  checked/>프로모션ID</label>
+								<label class="rdoBtn"><input type="radio" name="promotionGubun" id="promotionName" value="freeGiftName"/>프로모션명</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 id="gridList" style="width: 100%; height: 700px;" class="ag-theme-balham lh60"></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: "freeGiftSq", width: 80, cellClass: 'text-center'},
+		{headerName: "프로모션명", field: "freeGiftName", width: 130, cellClass: 'text-center'},
+		{headerName: "상태", field: "freeGiftStat", width: 140, cellClass: 'text-center'},
+		{headerName: "시작일", field: "freeGiftStdt", width: 140, cellClass: 'text-center'},
+		{headerName: "종료일", field: "freeGiftEddt", 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 == "freeGiftName"){
+			// 수정 필요
+			// 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');
+		fnFreeGoodsPromotionListSearch();
+	});
+
+	// 조회
+	var fnFreeGoodsPromotionListSearch = function() {
+		if(!fnConditionCheck()) return;
+
+		gagaPaging.init('searchForm', fnSearchCallBack, 'freeGoodsListPagination', $('#searchForm').find('#pageSize').val());
+		gagaPaging.load($("#searchForm input[name=pageNo]").val());
+	}
+
+	//검색 조건 확인
+	var fnConditionCheck = function(){
+		var fromDate = $('#searchForm input[name=stDate]').val();
+		var toDate = $('#searchForm input[name=edDate]').val();
+
+		if (!gagajf.isNull(fromDate) || !gagajf.isNull(toDate)) {
+
+			if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
+				mcxDialog.alertC("기간 조회시 시작일자와 종료일자를 입력하세요.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#searchForm input[name=stDate]').focus();
+					}
+				});
+				return false;
+			}
+
+			if (fromDate > toDate) {
+				mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#searchForm input[name=stDate]').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.freeGoodsList);
+		gagaPaging.createPagination(result.pageing.pageable);
+		
+	}
+
+	//페이징
+	$('#searchForm select[name=pageSize]').on('change', function() {
+		$("#searchForm input[name=pageNo]").val('1');
+		fnFreeGoodsPromotionListSearch();
+	});
+
+	$(document).ready(function() {
+
+		cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '기간', 'X');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+	});
+
+/*]]>*/
+</script>
+	</div>
+
+</html>