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

판매매장관리, 제휴채널관리 추가

gagamel 5 лет назад
Родитель
Сommit
22c130b555

+ 44 - 0
style24.admin/src/main/java/com/style24/admin/biz/dao/TsaBusinessDao.java

@@ -3,7 +3,9 @@ package com.style24.admin.biz.dao;
 import java.util.Collection;
 
 import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.Aflink;
 import com.style24.persistence.domain.DeliveryLoc;
+import com.style24.persistence.domain.SellStore;
 import com.style24.persistence.domain.SupplyCompany;
 
 /**
@@ -57,4 +59,46 @@ public interface TsaBusinessDao {
 	 */
 	void saveDeliveryLoc(DeliveryLoc delvLoc);
 
+	/**
+	 * 판매매장 목록
+	 * @param sellStore - 판매매장 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	Collection<SellStore> getSellStoreList(SellStore sellStore);
+
+	/**
+	 * 판매매장 정보 수정
+	 * @param sellStore - 판매매장 정보
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	void saveSellStore(SellStore sellStore);
+
+	/**
+	 * 제휴링크 목록
+	 * @param aflink - 제휴링크 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	Collection<Aflink> getAflinkList(Aflink aflink);
+
+	/**
+	 * 제휴링크 저장
+	 * @param aflink - 제휴링크 정보
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	void saveAflink(Aflink aflink);
+
+	/**
+	 * 제휴링크 삭제
+	 * @param aflink - 제휴링크 정보
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	void deleteAflink(Aflink aflink);
+
 }

+ 69 - 0
style24.admin/src/main/java/com/style24/admin/biz/service/TsaBusinessService.java

@@ -8,8 +8,11 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import com.style24.admin.biz.dao.TsaBusinessDao;
+import com.style24.admin.support.security.session.TsaSession;
 import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.persistence.domain.Aflink;
 import com.style24.persistence.domain.DeliveryLoc;
+import com.style24.persistence.domain.SellStore;
 import com.style24.persistence.domain.SupplyCompany;
 
 import lombok.extern.slf4j.Slf4j;
@@ -81,4 +84,70 @@ public class TsaBusinessService {
 		businessDao.saveDeliveryLoc(delvLoc);
 	}
 
+	/**
+	 * 판매매장 목록
+	 * @param sellStore - 판매매장 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	public Collection<SellStore> getSellStoreList(SellStore sellStore) {
+		return businessDao.getSellStoreList(sellStore);
+	}
+
+	/**
+	 * 판매매장 목록 저장 처리
+	 * @param sellStoreList - 판매매장 목록
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	@Transactional("shopTxnManager")
+	public void saveSellStoreList(Collection<SellStore> sellStoreList) {
+		for (SellStore sellStore : sellStoreList) {
+			sellStore.setRegNo(TsaSession.getInfo().getUserNo());
+			sellStore.setUpdNo(TsaSession.getInfo().getUserNo());
+			businessDao.saveSellStore(sellStore);
+		}
+	}
+
+	/**
+	 * 제휴링크 목록
+	 * @param aflink - 제휴링크 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	public Collection<Aflink> getAflinkList(Aflink aflink) {
+		return businessDao.getAflinkList(aflink);
+	}
+
+	/**
+	 * 제휴링크 등록/수정
+	 * @param aflink - 제휴링크 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	@Transactional("shopTxnManager")
+	public void saveAflink(Aflink aflink) {
+		aflink.setRegNo(TsaSession.getInfo().getUserNo());
+		aflink.setUpdNo(TsaSession.getInfo().getUserNo());
+		businessDao.saveAflink(aflink);
+	}
+
+	/**
+	 * 제휴링크 목록 삭제 처리
+	 * @param aflinkList - 제휴링크 목록
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	@Transactional("shopTxnManager")
+	public void deleteAflinkList(Collection<Aflink> aflinkList) {
+		for (Aflink aflink : aflinkList) {
+			aflink.setUpdNo(TsaSession.getInfo().getUserNo());
+			businessDao.deleteAflink(aflink);
+		}
+	}
+
 }

+ 118 - 0
style24.admin/src/main/java/com/style24/admin/biz/web/TsaBusinessController.java

@@ -8,6 +8,7 @@ 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.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
@@ -16,7 +17,9 @@ import com.style24.admin.biz.service.TsaRendererService;
 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.domain.Aflink;
 import com.style24.persistence.domain.DeliveryLoc;
+import com.style24.persistence.domain.SellStore;
 import com.style24.persistence.domain.SupplyCompany;
 
 import lombok.extern.slf4j.Slf4j;
@@ -150,4 +153,119 @@ public class TsaBusinessController extends TsaBaseController {
 		return super.ok(message.getMessage("SUCC_0001"));
 	}
 
+	/**
+	 * 판매매장관리 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	@GetMapping("/sellstore/form")
+	public ModelAndView sellStoreForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 공급업체
+		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
+
+		mav.setViewName("business/SellStoreForm");
+
+		return mav;
+	}
+
+	/**
+	 * 판매매장 목록
+	 * @param sellStore - 판매매장 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	@PostMapping("/sellstore/list")
+	@ResponseBody
+	public Collection<SellStore> getSellStoreList(@RequestBody SellStore sellStore) {
+		return businessService.getSellStoreList(sellStore);
+	}
+
+	/**
+	 * 판매매장 목록 저장 처리
+	 * @param sellStoreList - 판매매장 목록
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	@PostMapping("/sellstore/list/save")
+	@ResponseBody
+	public GagaResponse saveSellStoreList(@RequestBody Collection<SellStore> sellStoreList) {
+		if (sellStoreList == null || sellStoreList.isEmpty()) {
+			throw new IllegalStateException(message.getMessage("FAIL_1001"));
+		}
+
+		businessService.saveSellStoreList(sellStoreList);
+
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+
+	/**
+	 * 제휴채널관리
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	@GetMapping("/aflink/form")
+	public ModelAndView aflinkForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 제휴채널 콤보박스 목록
+		mav.addObject("afChannelList", rendererService.getCommonCodeList("G053"));
+
+		mav.setViewName("business/AflinkForm");
+
+		return mav;
+	}
+
+	/**
+	 * 제휴채널 목록
+	 * @param afChannel - 제휴채널
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	@PostMapping("/aflink/list")
+	@ResponseBody
+	public Collection<Aflink> getAflinkList(@RequestParam(value = "afChannel", required = false) String afChannel) {
+		Aflink aflink = new Aflink();
+		aflink.setAfChannel(afChannel);
+		return businessService.getAflinkList(aflink);
+	}
+
+	/**
+	 * 제휴링크 저장 처리
+	 * @param aflink - 제휴링크 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	@PostMapping("/aflink/save")
+	@ResponseBody
+	public GagaResponse saveAflink(@RequestBody Aflink aflink) {
+		businessService.saveAflink(aflink);
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+
+	/**
+	 * 제휴링크 목록 사용안함 처리
+	 * @param aflinkList - 제휴링크 목록
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 20
+	 */
+	@PostMapping("/aflink/list/delete")
+	@ResponseBody
+	public GagaResponse deleteAflinkList(@RequestBody Collection<Aflink> aflinkList) {
+		if (aflinkList == null || aflinkList.isEmpty()) {
+			throw new IllegalStateException(message.getMessage("FAIL_1001"));
+		}
+
+		businessService.deleteAflinkList(aflinkList);
+		return super.ok(message.getMessage("SUCC_0003"));
+	}
+
 }

+ 23 - 0
style24.admin/src/main/java/com/style24/persistence/domain/Aflink.java

@@ -0,0 +1,23 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TsaBaseDomain;
+
+import lombok.Data;
+
+/**
+ * 제휴채널 Domain
+ *
+ * @author gagamel
+ * @since 2020. 10. 20
+ */
+@SuppressWarnings("serial")
+@Data
+public class Aflink extends TsaBaseDomain {
+
+	private String afLinkCd;	// 제휴링크코드
+	private String afLinkNm;	// 제휴링크명
+	private String afChannel;	// 제휴채널
+	private int dispOrd;		// 표시순서
+	private String useYn;		// 사용여부
+
+}

+ 22 - 0
style24.admin/src/main/java/com/style24/persistence/domain/SellStore.java

@@ -0,0 +1,22 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TsaBaseDomain;
+
+import lombok.Data;
+
+/**
+ * 판매매장 Domain
+ *
+ * @author gagamel
+ * @since 2020. 10. 20
+ */
+@SuppressWarnings("serial")
+@Data
+public class SellStore extends TsaBaseDomain {
+
+	private String supplyCompCd;	// 공급업체코드
+	private String sellStoreCd;		// 판매매장코드
+	private String sellStoreNm;		// 판매매장명
+	private String useYn;			// 사용여부
+
+}

+ 104 - 0
style24.admin/src/main/java/com/style24/persistence/mybatis/shop/TsaBusiness.xml

@@ -301,5 +301,109 @@
 		     , UPD_NO = #{updNo}
 		     , UPD_DT = NOW()
 	</insert>
+	
+	<!-- 판매매장 목록  -->
+	<select id="getSellStoreList" parameterType="SellStore" resultType="SellStore">
+		/* TsaBusiness.getSellStoreList */
+		SELECT SELL_STORE_CD
+		     , SELL_STORE_NM
+		     , USE_YN
+		FROM   TB_SELL_STORE
+		WHERE  1 = 1
+		<if test="sellStoreNm != null and sellStoreNm != ''">
+		AND    LOWER(SELL_STORE_NM) LIKE CONCAT('%',LOWER(#{sellStoreNm}),'%')
+		</if>
+		<if test="useYn != null and useYn != ''">
+		AND    USE_YN = #{useYn}
+		</if>
+		ORDER  BY SELL_STORE_NM
+	</select>
+
+	<!-- 판매매장 등록/수정 -->
+	<insert id="saveSellStore" parameterType="SellStore">
+		/* TsaBusiness.saveSellStore */
+		INSERT INTO TB_SELL_STORE (
+		       SELL_STORE_CD
+		     , SELL_STORE_NM
+		     , USE_YN
+		     , REG_NO
+		     , REG_DT
+		     , UPD_NO
+		     , UPD_DT
+		)
+		VALUES (
+		       #{sellStoreCd}
+		     , #{sellStoreNm}
+		     , #{useYn}
+		     , #{regNo}
+		     , NOW()
+		     , #{updNo}
+		     , NOW()
+		)
+		ON DUPLICATE KEY UPDATE
+		       SELL_STORE_NM = #{sellStoreNm}
+		     , USE_YN = #{useYn}
+		     , UPD_NO = #{updNo}
+		     , UPD_DT = NOW()
+	</insert>
+	
+	<!-- 제휴링크 목록 -->
+	<select id="getAflinkList" parameterType="Aflink" resultType="Aflink">
+		/*  TsaBusiness.getAflinkList */
+		SELECT AF_LINK_CD
+		     , AF_LINK_NM
+		     , AF_CHANNEL
+		     , DISP_ORD
+		     , USE_YN
+		FROM   TB_AF_LINK
+		WHERE  1 = 1
+		<if test="afChannel != null and afChannel != ''">
+		AND    AF_CHANNEL = #{afChannel}
+		</if>
+	</select>
+
+	<!-- 제휴링크 저장 -->
+	<insert id="saveAflink" parameterType="Aflink">
+		/* TsaBusiness.saveAflink */
+		INSERT INTO TB_AF_LINK (
+		       AF_LINK_CD
+		     , AF_LINK_NM
+		     , AF_CHANNEL
+		     , DISP_ORD
+		     , USE_YN
+		     , REG_NO
+		     , REG_DT
+		     , UPD_NO
+		     , UPD_DT
+		)
+		VALUES (
+		       #{afLinkCd}
+		     , #{afLinkNm}
+		     , #{afChannel}
+		     , #{dispOrd}
+		     , #{useYn}
+		     , #{regNo}
+		     , NOW()
+		     , #{updNo}
+		     , NOW()
+		)
+		ON DUPLICATE KEY UPDATE
+		       AF_LINK_NM = #{afLinkNm}
+		     , AF_CHANNEL = #{afChannel}
+		     , DISP_ORD = #{dispOrd}
+		     , USE_YN = #{useYn}
+		     , UPD_NO = #{updNo}
+		     , UPD_DT = NOW()
+	</insert>
+
+	<!-- 제휴링크 삭제 -->
+	<update id="deleteAflink" parameterType="Aflink">
+		/* TsaBusiness.deleteAflink */
+		UPDATE TB_AF_LINK
+		SET    USE_YN = 'N'
+		     , UPD_NO = #{updNo}
+		     , UPD_DT = NOW()
+		WHERE  AF_LINK_CD = #{afLinkCd}
+	</update>
 
 </mapper>

+ 270 - 0
style24.admin/src/main/webapp/WEB-INF/views/business/AflinkForm.html

@@ -0,0 +1,270 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : AflinkForm.html
+ * @desc    : 제휴채널관리 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.10.20   gagamel     최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+		
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc">
+		</div>
+		<!-- //메뉴 설명 -->
+		
+		<!-- 검색조건 영역 -->
+		<div class="panelStyle">
+			<form id="searchForm" name="searchForm" action="#" th:action="@{'/business/aflink/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col/>
+					</colgroup>
+					<tr>
+						<th>제휴채널</th>
+						<td>
+							<select name="afChannel">
+								<option value="">[전체]</option>
+								<option th:if="${afChannelList}" th:each="oneData, status : ${afChannelList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+						</td>
+					</tr>
+				</table>
+				
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
+						<button type="button" class="btn btn-gray btn-lg" onclick="$('#searchForm')[0].reset();">초기화</button>
+					</li>
+				</ul>
+			</form>
+		</div>
+		<!-- 검색조건 영역 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelStyle">
+			<!-- 다중 TABLE 배치 -->
+			<ul class="division">
+				<li style="width: 60%">
+					<!-- 버튼 배치 영역 -->
+					<ul class="panelBar">
+						<li class="left">
+							<button type="button" class="btn btn-danger btn-lg" id="btnDelete">사용안함</button>
+						</li>
+						<li class="right">
+							<button type="button" class="btn btn-default btn-lg" id="btnExcel">엑셀다운로드</button>
+						</li>
+					</ul>
+					<!-- //버튼 배치 영역 -->
+					
+					<div id="gridList" style="width: 100%; height: 570px;" class="ag-theme-balham"></div>
+				</li>
+				<li>
+					<!-- 버튼 배치 영역 -->
+					<ul class="panelBar">
+						<li>
+							<button type="button" class="btn btn-info btn-lg" id="btnNew">신규</button>
+							<button type="button" class="btn btn-success btn-lg" id="btnSave">저장</button>
+						</li>
+					</ul>
+					<!-- //버튼 배치 영역 -->
+					
+					<form id="detailForm" name="detailForm" action="#" th:action="@{'/business/aflink/save'}">
+						<table class="frmStyle">
+							<colgroup>
+								<col style="width:30%"/>
+								<col/>
+							</colgroup>
+							<tr>
+								<th>제휴코드<i class="star"></i></th>
+								<td>
+									<input type="text" class="w100" name="afLinkCd" placeholder="" maxlength="5" required="required" data-valid-type="alphaNumeric" data-valid-name="제휴코드" onkeyup="$(this).val($(this).val().toUpperCase());"/>
+								</td>
+							</tr>
+							<tr>
+								<th>제휴명<i class="star"></i></th>
+								<td>
+									<input type="text" class="w300" name="afLinkNm" placeholder="" maxlength="100" required="required" data-valid-name="제휴명"/>
+								</td>
+							</tr>
+							<tr>
+								<th>제휴채널<i class="star"></i></th>
+								<td>
+									<select name="afChannel" required="required" data-valid-name="제휴채널">
+										<option value="">[선택]</option>
+										<option th:if="${afChannelList}" th:each="oneData, status : ${afChannelList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+									</select>
+								</td>
+							</tr>
+							<tr>
+								<th>표시순서<i class="star"></i></th>
+								<td>
+									<input type="text" class="w100 text-right" name="dispOrd" placeholder="" maxlength="5" required="required" data-valid-type="numeric" data-valid-name="표시순서" />
+								</td>
+							</tr>
+							<tr>
+								<th>사용여부<i class="star"></i></th>
+								<td>
+									<input type="hidden" name="useYn"/>
+									<label class="chkBox"><input type="checkbox" name="chkUseYn" value="Y" checked="checked" disabled="disabled"/>사용</label>
+								</td>
+							</tr>
+						</table>
+					</form>
+				</li>
+			</ul>
+			<!--//다중 TABLE 배치 -->
+		</div>
+		<!-- //리스트 영역 -->
+	</div>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let afChannelList = gagajf.convertToArray([[${afChannelList}]]);
+	let useYnList = { "Y":"Yes", "N":"No" };
+
+	let columnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-right', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{headerName: "제휴링크코드", field: "afLinkCd", width: 100, cellClass: 'text-center'},
+		{
+			headerName: "제휴링크명", field: "afLinkNm", width: 180, cellClass: 'text-center',
+			cellRenderer: function(params) {
+				return '<a href="javascript:void(0);">' + params.value + '</a>';
+			}
+		},
+		{
+			headerName: "제휴채널", field: "afChannel", width: 120, cellClass: 'text-center',
+			valueGetter: function (params) { return gagaAgGrid.lookupValue(afChannelList, params.data.afChannel); }
+		},
+		{headerName: "표시순서", field: "dispOrd", width: 100, cellClass: 'text-center'},
+		{
+			headerName: "사용여부", field: "useYn", width: 100, cellClass: 'text-center',
+			valueGetter: function (params) { return gagaAgGrid.lookupValue(useYnList, params.data.useYn); }
+		}
+	];
+
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// 다중 선택
+	gridOptions.rowSelection = 'multiple';
+	
+	// Cell click
+	gridOptions.onCellClicked = function(event) {
+		if (event.colDef.field != 'afLinkNm')
+			return;
+		
+		$('#detailForm input[name=afLinkCd]').val(event.data.afLinkCd);
+		$('#detailForm input[name=afLinkCd]').attr('readonly', true);
+		$('#detailForm input[name=afLinkNm]').val(event.data.afLinkNm);
+		$('#detailForm select[name=afChannel]').val(event.data.afChannel);
+		$('#detailForm select[name=afMedia]').val(event.data.afMedia);
+		$('#detailForm input[name=dispOrd]').val(event.data.dispOrd);
+		
+		$("#detailForm input[name=useYn]").val(event.data.useYn);
+		if (event.data.useYn == 'Y') {
+			$("#detailForm input:checkbox[name=chkUseYn]").attr('checked', true);
+		} else {
+			$("#detailForm input:checkbox[name=chkUseYn]").attr('checked', false);
+		}
+
+		$('#detailForm input[name=afLinkNm]').focus();
+	}
+	
+	// 검색
+	$('#btnSearch').on('click', function() {
+		var actionUrl = $('#searchForm').prop('action') + '?' + $('#searchForm').serialize();
+
+		// Fetch data
+		gagaAgGrid.fetch(actionUrl, gridOptions, '#searchForm');
+	});
+
+	// 신규
+	$('#btnNew').on('click', function() {
+		$('#detailForm')[0].reset();
+		$('#detailForm input[name=afLinkCd]').attr('readonly', false);
+		$('#detailForm input[name=afLinkCd]').removeClass('formControl');
+		$('#detailForm input:checkbox[name=chkUseYn]').attr('disabled', true);
+		$('#detailForm input:checkbox[name=chkUseYn]').addClass('formControl');
+		$('#detailForm input[name=afLinkCd]').focus();
+	});
+	
+	// 사용안함 버튼 클릭 시
+	$('#btnDelete').on('click', function() {
+		var removedData = gagaAgGrid.removeRowData(gridOptions);
+
+		if (removedData.length == 0) {
+			mcxDialog.alert('선택된 행이 없습니다.');
+			return;
+		}
+
+		mcxDialog.confirm('사용안함으로 처리하시겠습니까?', {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function(){
+				// delete 대신 update 처리해야 하므로 다음과 같이 useYn 값을 변환
+				var updatedData = [];
+
+				$.each(removedData, function(idx, item) {
+					item.useYn = 'N';
+					updatedData.push(item);
+				});
+
+				var jsonData = JSON.stringify(updatedData);
+				gagajf.ajaxJsonSubmit('/business/aflink/list/delete'
+						, jsonData
+						, function() {
+							$('#btnSearch').trigger('click');
+						});
+			}
+		});
+	});
+	
+	// 저장 처리
+	$('#btnSave').on('click', function() {
+		// 입력 값 체크
+		if (!gagajf.validation('#detailForm'))
+			return false;
+
+		$('#detailForm input[name=useYn]').val($('#detailForm input:checkbox[name=chkUseYn]').is(":checked") ? 'Y' : 'N');
+
+		mcxDialog.confirm('저장하시겠습니까?', {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function(){
+				gagajf.ajaxFormSubmit($('#detailForm').prop('action')
+						, $('#detailForm')
+						, function() {
+							$('#btnNew').trigger('click');
+							$('#btnSearch').trigger('click');
+						}
+				);
+			}
+		});
+	});
+	
+	// 엑셀다운로드
+	$('#btnExcel').on('click', function() {
+		gagaAgGrid.exportToExcel('제휴채널 목록', gridOptions);
+	});
+	
+	$(document).ready(function() {
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+	});
+/*]]>*/
+</script>
+
+</html>

+ 205 - 0
style24.admin/src/main/webapp/WEB-INF/views/business/SellStoreForm.html

@@ -0,0 +1,205 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : SellStoreForm.html
+ * @desc    : 판매매장관리 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.10.20   gagamel     최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+		
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc">
+		</div>
+		<!-- //메뉴 설명 -->
+		
+		<!-- 검색조건 영역 -->
+		<div class="panelStyle">
+			<form id="searchForm" name="searchForm" action="#" th:action="@{'/business/sellstore/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col style="width:30%;"/>
+						<col style="width:10%;"/>
+						<col/>
+					</colgroup>
+					<tr>
+						<th>판매매장</th>
+						<td>
+							<input type="text" class="w200" name="sellStoreNm" placeholder="판매매장명" required="required" data-valid-name="판매매장"/>
+						</td>
+						<th>사용여부</th>
+						<td>
+							<select name="useYn">
+								<option value="Y">Yes</option>
+								<option value="N">No</option>
+							</select>
+						</td>
+					</tr>
+				</table>
+				
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
+						<button type="button" class="btn btn-gray btn-lg" onclick="$('#searchForm')[0].reset();">초기화</button>
+					</li>
+				</ul>
+			</form>
+		</div>
+		<!-- 검색조건 영역 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelStyle">
+			<!-- 버튼 배치 영역 -->
+			<ul class="panelBar">
+				<li class="left">
+					<button type="button" class="btn btn-warning btn-lg" id="btnAddRow">행추가</button>
+					<button type="button" class="btn btn-danger btn-lg" id="btnDeleteRow">행삭제</button>
+				</li>
+				<li class="right">
+					<button type="button" class="btn btn-default btn-lg" id="btnExcel">엑셀다운로드</button>
+				</li>
+			</ul>
+			<!-- //버튼 배치 영역 -->
+			
+			<div id="gridList" style="width: 100%; height: 570px" class="ag-theme-balham"></div>
+			
+			<!-- 버튼 배치 영역 -->
+			<ul class="panelBar">
+				<li class="right">
+					<button type="button" class="btn btn-success btn-lg" id="btnSave">저장</button>
+				</li>
+			</ul>
+			<!-- //버튼 배치 영역 -->
+		</div>
+		<!-- //리스트 영역 -->
+	</div>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let supplyCompList = gagajf.convertToArray([[${supplyCompList}]]);
+	let useYnList = { "Y":"Yes", "N":"No" };
+
+	let columnDefs = [
+		{
+			headerName: "공급업체", field: "supplyCompCd", width: 150, cellClass: 'text-center',
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(supplyCompList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(supplyCompList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(supplyCompList, params.newValue); }
+		},
+		{
+			headerName: "판매매장코드", field: "sellStoreCd", width: 150, cellClass: 'text-center',
+			cellEditor: 'textCellEditor',
+			cellEditorParams: { maxlength: 20, required: true }
+		},
+		{
+			headerName: "판매매장명", field: "sellStoreNm", width: 300, cellClass: 'text-center',
+			cellEditor: 'textCellEditor',
+			cellEditorParams: { maxlength: 50, required: true }
+		},
+		{
+			headerName: "사용여부", field: "useYn", width: 150, cellClass: 'text-center',
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(useYnList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(useYnList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(useYnList, params.newValue); }
+		}
+	];
+
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// Grid editable
+	gridOptions.defaultColDef.editable = true;
+	
+	// 검색
+	$('#btnSearch').on('click', function() {
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
+	});
+
+	// 행추가
+	$('#btnAddRow').on('click', function() {
+		var data = { supplyCompCd: null, sellStoreCd: null, sellStoreNm: null, useYn: "Y" };
+		gagaAgGrid.addRowData(gridOptions, data, "sellStoreCd");
+	});
+	
+	// 행삭제
+	$('#btnDeleteRow').on('click', function() {
+		var removedData = gagaAgGrid.removeRowData(gridOptions);
+		
+		if (removedData.length == 0) {
+			mcxDialog.alert('선택된 행이 없습니다.');
+			return;
+		}
+		
+		mcxDialog.confirm("삭제하시겠습니까?", {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function() {
+				// delete 대신 update 처리해야 하므로 다음과 같이 useYn 값을 변환
+				var updatedData = [];
+				
+				$.each(removedData, function(idx, item) {
+					item.useYn = 'N';
+					updatedData.push(item);
+				});
+				
+				
+				var jsonData = JSON.stringify(updatedData);
+				gagajf.ajaxJsonSubmit('/business/sellstore/list/save', jsonData, function() {
+					$('#btnSearch').trigger('click');
+				});
+			}
+		});
+	});
+	
+	// 저장
+	$("#btnSave").on("click", function() {
+		var changeData = gagaAgGrid.getChangedData(gridOptions);
+
+		if (changeData.length < 1) {
+			mcxDialog.alert('변경된 데이터가 없습니다.');
+			return;
+		}
+
+		// Validation
+		if (!gagaAgGrid.validation(gridOptions, changeData))
+			return;
+
+		mcxDialog.confirm('저장하시겠습니까?', {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function(){
+				var jsonData = JSON.stringify(changeData);
+				gagajf.ajaxJsonSubmit('/business/sellstore/list/save', jsonData, function() {
+					$('#btnSearch').trigger('click');
+				});
+			}
+		});
+	});
+	
+	// 엑셀다운로드
+	$('#btnExcel').on('click', function() {
+		gagaAgGrid.exportToExcel('판매매장 목록', gridOptions);
+	});
+	
+	$(document).ready(function() {
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+	});
+/*]]>*/
+</script>
+
+</html>