fix : 관리자 구독서비스 목록

This commit is contained in:
jazz
2026-01-27 12:07:17 +09:00
parent bda09e6e4f
commit c0d7079e37
11 changed files with 929 additions and 63 deletions

View File

@@ -34,7 +34,7 @@ public class ImagePaginationRenderer extends AbstractPaginationRenderer implemen
//previousPageLabel = "<li><a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/egovframework/com/cmm/mod/icon/icon_prev.gif\" alt=\"이전\" border=\"0\"/></a></li>";
previousPageLabel = "<button class=\"pagination__item prev\" onclick=\"{0}({1});return false; \"><span class=\"visually-hidden\">이전 페이지로</span></button>";
//currentPageLabel = "<li><strong>{0}</strong></li>";
currentPageLabel = "<li><button class=\"pagination__item active\"><span>{0}</span></button></li>";
currentPageLabel = "<li><button class=\"pagination__item active\" onclick=\"return false; \"><span>{0}</span></button></li>";
//otherPageLabel = "<li><a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \">{2}</a></li>";
otherPageLabel = "<li><button class=\"pagination__item\" onclick=\"{0}({1});return false; \"><span>{2}</span></button></li>";
//nextPageLabel = "<li>&#160;<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/egovframework/com/cmm/mod/icon/icon_next.gif\" alt=\"다음\" border=\"0\"/></a></li>";

View File

@@ -1,6 +1,5 @@
package com.wb.domainserver.domain.gcone.goods.subsvc.mapper;
import com.wb.domainserver.domain.gcone.goods.banner.vo.BOBannerVO;
import com.wb.domainserver.domain.gcone.goods.subsvc.vo.BOSubsvcVO;
import com.wb.domainserver.util.dataaccess.DataMap;
import org.apache.ibatis.annotations.Mapper;
@@ -23,5 +22,6 @@ public interface BOSubsvcMapper {
List<DataMap> selectBOMngrSrchSubsvcList(BOSubsvcVO vo);
/** 관리자 구독서비스 조회조건 구독서비스별 기수*/
List<DataMap> selectBOMngrSrchSubsvcGnrList(BOSubsvcVO vo);
/** 관리자 구독서비스 선택 삭제*/
int deleteBOMngrSubsvc(BOSubsvcVO vo);
}

View File

@@ -1,5 +1,6 @@
package com.wb.domainserver.domain.gcone.goods.subsvc.service;
import com.wb.domainserver.domain.gcone.goods.goodsinfo.vo.BOGoodsInfoVO;
import com.wb.domainserver.domain.gcone.goods.subsvc.mapper.BOSubsvcMapper;
import com.wb.domainserver.domain.gcone.goods.subsvc.vo.BOSubsvcVO;
import com.wb.domainserver.util.dataaccess.DataMap;
@@ -43,4 +44,51 @@ public class BOSubsvcService {
return dataMap;
}
/**
* 관리자 구독서비스 목록 조회
* */
public List<DataMap> selectBOMngrSubsvcList(BOSubsvcVO vo) {
List<DataMap> dataList = new ArrayList<>();
dataList = mapper.selectBOMngrSubsvcList(vo);
if(dataList == null || dataList.isEmpty()){
vo.getPaginationInfo().setTotalRecordCount(0);
}else{
vo.getPaginationInfo().setTotalRecordCount(((Long)dataList.get(0).get("totCnt")).intValue());
}
return dataList;
}
/**
* 관리자 구독서비스 조회조건 구독서비스
* */
public List<DataMap> selectBOMngrSrchSubsvcList(BOSubsvcVO vo) {
List<DataMap> dataList = new ArrayList<>();
dataList = mapper.selectBOMngrSrchSubsvcList(vo);
return dataList;
}
/**
* 관리자 구독서비스 조회조건 구독서비스별 기수
* */
public List<DataMap> selectBOMngrSrchSubsvcGnrList(BOSubsvcVO vo) {
List<DataMap> dataList = new ArrayList<>();
dataList = mapper.selectBOMngrSrchSubsvcGnrList(vo);
return dataList;
}
public String deleteBOMngrSubsvc(BOSubsvcVO vo) {
String message = "fail";
int result = mapper.deleteBOMngrSubsvc(vo);
if (result > 0) {
message = "success";
}
return message;
}
}

View File

@@ -93,4 +93,6 @@ private static final long serialVersionUID = 1L;
private String srchExpsrDvCd;
/** 정렬구분 */
private String sortDv;
/** 배열 구독서비스고유번호 */
private List<String> arrSubsvcInnb;
}

View File

@@ -0,0 +1,214 @@
package com.wb.domainserver.domain.mngr.goods.subsvc.controller;
import com.wb.domainserver.common.msg.GconeMessageSource;
import com.wb.domainserver.common.mvc.tags.ui.pagination.PaginationInfo;
import com.wb.domainserver.common.prop.PaginationProperties;
import com.wb.domainserver.domain.admin.sys.comncd.service.BOMaComncdService;
import com.wb.domainserver.domain.admin.sys.comncd.vo.BOMaComncdVO;
import com.wb.domainserver.domain.gcone.goods.cmnuse.vo.BOCmnuseVO;
import com.wb.domainserver.domain.gcone.goods.goods.vo.BOGoodsVO;
import com.wb.domainserver.domain.gcone.goods.goodsinfo.vo.BOGoodsInfoVO;
import com.wb.domainserver.domain.gcone.goods.subsvc.service.BOSubsvcService;
import com.wb.domainserver.domain.gcone.goods.subsvc.vo.BOSubsvcVO;
import com.wb.domainserver.domain.gcone.setup.dlvygrp.vo.BODlvygrpVO;
import com.wb.domainserver.domain.mngr.goods.goodsinfo.vo.GoodsInfoVO;
import com.wb.domainserver.exception.WnbtRestException;
import com.wb.domainserver.response.WnbtResponse;
import com.wb.domainserver.response.WnbtResponseBody;
import com.wb.domainserver.security.authentication.AnonymousUser;
import com.wb.domainserver.security.authentication.MemberJwtContextHolder;
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
import com.wb.domainserver.security.authorization.annotation.Policy;
import com.wb.domainserver.util.communicate.SendToResrc;
import com.wb.domainserver.util.communicate.ValidateResultConverter;
import com.wb.domainserver.util.dataaccess.DataMap;
import io.micrometer.common.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* SubsvcController Controller Class
*
* @author
* @since 2026-01-23
* @version 1.0
* @see
*
* <pre>
* == (Modification Information) == 개정이력
*
* 수정일 수정자 수정내용
* ------- -------- ---------------------------
* 2026-01-23 jazz 최초 생성
*
* </pre>
*/
@Slf4j
@Controller
@RequestMapping("/mngr/goods/subsvc")
public class SubsvcController {
/** WebClient 호출을 위한 wrapper */
@Autowired
private SendToResrc sendToResrc;
/** 공통 메시지 처리를 위한 메시지 객체 */
@Autowired
private GconeMessageSource gconeMessageSource;
@Autowired
private BOSubsvcService service;
@Autowired
private BOMaComncdService boMaComncdService;
@Autowired
private PaginationProperties paginationProperties;
/**
* 구독서비스 목록 조회 폼
* @param vo
* @return SubsvcListForm.jsp
*/
@Policy(AuthPolicy.RESTRICTED)
@RequestMapping(value="/selectSubsvcListForm")
public String selectSubsvcListForm(BOSubsvcVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
vo.setSopmalCd(authSopmalCd);
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
if("01".equals(user.getSysDvCd())){
vo.setSopmalCd(user.getSopmalCd());
}
Map<String, Object> content = new HashMap<>();
content.put("paramVO", vo);
// 조회조건 구독서비스
List<?> SrchSubsvcList = service.selectBOMngrSrchSubsvcList(vo);
content.put("srchSubsvcList", SrchSubsvcList);
//조회조건 판매상태
BOMaComncdVO param = new BOMaComncdVO();
param.setGroupCd("GOODS_STTUS");
List<?> srchSubsvcSttusList = boMaComncdService.selectBOCommcdDetailList(param);
content.put("srchSubsvcSttusList", srchSubsvcSttusList);
//조회조건 노출구분
param.setGroupCd("EXPSR_DV");
List<?> srchExpsrDvList = boMaComncdService.selectBOCommcdDetailList(param);
content.put("srchExpsrDvList", srchExpsrDvList);
model.addAttribute("resultMap", content);
return "mngr/goods/subsvc/SubsvcListForm";
}
/**
* 구독서비스 목록 조회 리스트
* @param vo
* @param model
* @return SubsvcList.jsp
*/
@Policy(AuthPolicy.RESTRICTED)
@RequestMapping(value = "/selectSubsvcList")
public String selectSubsvcList(BOSubsvcVO vo,ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
vo.setSopmalCd(authSopmalCd);
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
if("01".equals(user.getSysDvCd())){
vo.setSopmalCd(user.getSopmalCd());
}
// 페이징 객체 생성 & 페이징정보 할당
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(vo.getPageIndex());
paginationInfo.setRecordCountPerPage(vo.getPageUnit());
paginationInfo.setPageSize(paginationProperties.getPageSize());
vo.setPaginationInfo(paginationInfo);
vo.setFirstIndex(paginationInfo.getFirstRecordIndex());
vo.setLastIndex(paginationInfo.getLastRecordIndex());
vo.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
if(StringUtils.isEmpty(vo.getSortDv())){
//정렬기준 초기값 셋팅
vo.setSortDv("subsvcGnrAsc");
}
// 목록 조회
List<DataMap> list = service.selectBOMngrSubsvcList(vo);
Map<String, Object> content = new HashMap<>();
content.put("paramVO", vo);
content.put("list", list);
content.put("paginationInfo", vo.getPaginationInfo());
model.addAttribute("resultMap", content);
return "mngr/goods/subsvc/SubsvcList";
}
/**
* 구독서비스 선택삭제
* @param vo
* @return ResponseEntity<WnbtResponse>
*/
@Policy(AuthPolicy.RESTRICTED)
@RequestMapping(value = "/deleteSubsvc", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<WnbtResponse> deleteSubsvc(BOSubsvcVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
vo.setSopmalCd(authSopmalCd);
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
vo.setUpdusr(user.getUserInnb()); //수정자
if("01".equals(user.getSysDvCd())){
vo.setSopmalCd(user.getSopmalCd());
}
DataMap message = new DataMap();
String result = service.deleteBOMngrSubsvc(vo);
message.put("message", result);
return ResponseEntity.ok(
WnbtResponse.builder()
.resBody(new WnbtResponseBody(message))
.build()
);
}
/**
* 구독서비스 목록 조회 리스트
* @param vo
* @return ResponseEntity<WnbtResponse>
*/
@Policy(AuthPolicy.RESTRICTED)
@RequestMapping(value = "/selectSrchSubsvcGnrListAjax", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<WnbtResponse> selectSrchSubsvcGnrListAjax(BOSubsvcVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
vo.setSopmalCd(authSopmalCd);
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
if("01".equals(user.getSysDvCd())){
vo.setSopmalCd(user.getSopmalCd());
}
Map<String, Object> content = new HashMap<>();
// 조회조건 구독서비스
List<DataMap> SrchSubsvcGnrList = service.selectBOMngrSrchSubsvcGnrList(vo);
content.put("srchSubsvcGnrList", SrchSubsvcGnrList);
return ResponseEntity.ok(
WnbtResponse.builder()
.resBody(new WnbtResponseBody(content))
.build()
);
}
}

View File

@@ -58,9 +58,9 @@ spring:
gcone:
hikari:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://172.31.16.11:3306/gcone?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&autoReconnect=true&allowMultiQueries=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=false&verifyServerCertificate=false
username: winbit
password: dnlsqlxm1!
jdbc-url: jdbc:mysql://115.68.176.232:3306/sake?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&autoReconnect=true&allowMultiQueries=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=yes&verifyServerCertificate=false
username: sakeone
password: dnlfxjtm13@$
minimumIdle: 1
maximumPoolSize: 10
idleTimeout: 30000 #30초
@@ -70,9 +70,9 @@ spring:
sure:
hikari:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://172.31.17.11:3306/nutricore
username: winbit
password: dnlsqlxm1!
jdbc-url: jdbc:mysql://115.68.176.232:3306/sake?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&autoReconnect=true&allowMultiQueries=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=yes&verifyServerCertificate=false
username: sakeone
password: dnlfxjtm13@$
minimumIdle: 1
maximumPoolSize: 10
idleTimeout: 30000 #30초

View File

@@ -58,7 +58,7 @@ spring:
gcone:
hikari:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://115.68.176.232:3306/sake?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&autoReconnect=true&allowMultiQueries=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=false&verifyServerCertificate=false
jdbc-url: jdbc:mysql://115.68.176.232:3306/sake?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&autoReconnect=true&allowMultiQueries=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=yes&verifyServerCertificate=false
username: sakeone
password: dnlfxjtm13@$
minimumIdle: 1
@@ -70,7 +70,7 @@ spring:
sure:
hikari:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://115.68.176.232:3306/sake?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&autoReconnect=true&allowMultiQueries=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=false&verifyServerCertificate=false
jdbc-url: jdbc:mysql://115.68.176.232:3306/sake?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&autoReconnect=true&allowMultiQueries=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=yes&verifyServerCertificate=false
username: sakeone
password: dnlfxjtm13@$
minimumIdle: 1

View File

@@ -58,7 +58,7 @@ spring:
gcone:
hikari:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://10.2.1.101:3306/sake?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&autoReconnect=true&allowMultiQueries=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=false&verifyServerCertificate=false
jdbc-url: jdbc:mysql://10.2.1.101:3306/sake?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&autoReconnect=true&allowMultiQueries=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=yes&verifyServerCertificate=false
username: sakeone
password: dnlfxjtm13@$
minimumIdle: 10
@@ -70,7 +70,7 @@ spring:
sure:
hikari:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://10.2.1.101:3306/sake?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&autoReconnect=true&allowMultiQueries=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=false&verifyServerCertificate=false
jdbc-url: jdbc:mysql://10.2.1.101:3306/sake?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&autoReconnect=true&allowMultiQueries=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=yes&verifyServerCertificate=false
username: sakeone
password: dnlfxjtm13@$
minimumIdle: 1

View File

@@ -61,7 +61,8 @@
SELECT TB.*
, CAST(@ROWNUM:=@ROWNUM + 1 AS UNSIGNED) AS RNUM
FROM (
SELECT GC.SUBSVC_INNB
SELECT COUNT(*) OVER() AS TOT_CNT
, GC.SUBSVC_INNB
, GC.SOPMAL_CD
, GC.SUBSVC_NM
, GC.SUBSVC_GNR
@@ -79,7 +80,8 @@
, GC.IMG /*섬네일 이미지*/
, GC.LAST_PROCS_ODR /*최종차수*/
FROM GC_SUBSVC GC
WHERE GC.SOPMAL_CD = 'SK'
WHERE GC.USE_AT = 'Y'
AND GC.SOPMAL_CD = #{sopmalCd}
<if test="srchSelSubsvcNm != null and srchSelSubsvcNm != ''">
AND GC.SUBSVC_NM = #{srchSelSubsvcNm} /*구독서비스 명*/
</if>
@@ -89,22 +91,30 @@
<if test="srchSubsvcNm != null and srchSubsvcNm != ''">
AND GC.SUBSVC_NM LIKE CONCAT('%',#{srchSubsvcNm},'%') /*구독서비스 명*/
</if>
<if test="srchSubsvcGnr != null and srchSubsvcGnr != ''">
AND GC.SUBSVC_GNR_NM LIKE CONCAT('%',#{srchSubsvcGnr},'%') /*기수명*/
<if test="srchSubsvcGnrNm != null and srchSubsvcGnrNm != ''">
AND GC.SUBSVC_GNR_NM LIKE CONCAT('%',#{srchSubsvcGnrNm},'%') /*기수명*/
</if>
<if test = "@com.wb.domainserver.util.dataaccess.MybaitsUtil@isNotEmpty(srchArrSubsvcSttusCd)">
<choose>
<when test="@com.wb.domainserver.util.dataaccess.MybaitsUtil@isNotEmpty(srchArrSubsvcSttusCd)">
/*판매상태*/
AND GC.SUBSVC_STTUS_CD IN
<foreach collection="srchArrSubsvcSttusCd" item="subsvcSttusCd" open="(" close=")" separator=",">
AND GC.SUBSVC_STTUS_CD IN ('01','02','03') /*판매상태*/
#{subsvcSttusCd}
</foreach>
</if>
</when>
</choose>
<if test="srchExpsrDvCd != null and srchExpsrDvCd != ''">
AND GC.EXPSR_DV_CD = '01' /*노출여부*/
AND GC.EXPSR_DV_CD = #{srchExpsrDvCd} /*노출여부*/
</if>
ORDER BY
</if>
<if test="sortDv != null and sortDv != ''">
CONCAT(GC.SUBSVC_NM, SUBSVC_GNR_NM) ASC,
</if>
<choose>
<when test="sortDv == 'subsvcGnrAsc'">
GC.SUBSVC_NM ASC, SUBSVC_GNR_NM ASC,
</when>
<otherwise>
GC.SUBSVC_NM DESC, SUBSVC_GNR_NM DESC,
</otherwise>
</choose>
GC.SUBSVC_INNB ASC
) TB
WHERE (@ROWNUM:=0)=0
@@ -117,6 +127,8 @@
<select id="selectBOMngrSrchSubsvcList" parameterType="com.wb.domainserver.domain.gcone.goods.subsvc.vo.BOSubsvcVO" resultType="dataMap">
SELECT GC.SUBSVC_NM, MIN(GC.SUBSVC_INNB) SUBSVC_INNB
FROM GC_SUBSVC GC
WHERE GC.SOPMAL_CD = #{sopmalCd}
AND GC.USE_AT = 'Y'
GROUP BY GC.SUBSVC_NM
ORDER BY SUBSVC_INNB ASC
</select>
@@ -127,9 +139,30 @@
SELECT GC.SUBSVC_GNR, CONCAT(GC.SUBSVC_GNR , '기 (', GC.SUBSVC_GNR_NM, ')') SUBSVC_GNR_NM
FROM GC_SUBSVC GC
WHERE GC.SUBSVC_NM = #{srchSelSubsvcNm}
AND GC.SOPMAL_CD = #{sopmalCd}
AND GC.USE_AT = 'Y'
GROUP BY GC.SUBSVC_GNR, GC.SUBSVC_GNR_NM
ORDER BY GC.SUBSVC_GNR ASC
]]>
</select>
<!--선택된 구독서비스 삭제(사용여부N처리)-->
<update id="deleteBOMngrSubsvc" parameterType="com.wb.domainserver.domain.gcone.goods.subsvc.vo.BOSubsvcVO">
UPDATE GC_SUBSVC
SET USE_AT = 'N'
,UPDUSR = #{updusr}
,UPDT_DT = NOW()
WHERE SOPMAL_CD = #{sopmalCd}
<choose>
<when test="@com.wb.domainserver.util.dataaccess.MybaitsUtil@isNotEmpty(arrSubsvcInnb)">
AND SUBSVC_INNB IN
<foreach collection="arrSubsvcInnb" item="subsvcInnb" open="(" separator="," close=")">
#{subsvcInnb}
</foreach>
</when>
<otherwise>
AND 1=2
</otherwise>
</choose>
</update>
</mapper>

View File

@@ -0,0 +1,137 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : GoodsListR.jsp
Description : 상품 목록 조회 리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-03-20 리브가 최초 생성
--%>
<section class="content-section">
<div class="form-control-container">
<div class="left">
<div class="search-number">
<span class="search-number__text">총 <strong><c:out value="${ resultMap.paginationInfo.totalRecordCount }"/></strong>건</span>
</div>
</div>
<div class="center">
</div>
<div class="right">
<div class="select-box">
<select title="정렬순" name="sortDvView" id="sortDvView" onchange="fn_select_list(1);return false;">
<option value="subsvcGnrAsc" <c:if test="${resultMap.paramVO.sortDv eq 'subsvcGnrAsc'}">selected="selected"</c:if>>구독서비스+기수명 오름차순</option>
<option value="subsvcGnrDesc" <c:if test="${resultMap.paramVO.sortDv eq 'subsvcGnrDesc'}">selected="selected"</c:if>>구독서비스+기수명 내림차순</option>
</select>
</div>
<div class="select-box">
<select id="pageUnitView" name="pageUnitView" title="페이지당 출력될 목록건수" onchange="fn_select_list(1,this.value);return false;">
<c:forEach items="${ resultMap.paginationInfo.pageUnitArr }" var="pageUnit" varStatus="pageUnitStatus">
<option value="<c:out value="${ pageUnit }"/>"
<c:if test="${ resultMap.paginationInfo.recordCountPerPage eq pageUnit}">selected="selected"</c:if>>
<c:out value="${ pageUnit }"/>개씩
</option>
</c:forEach>
</select>
</div>
</div>
</div>
<hr class="horizontal-line">
<div class="form-control-container">
<div class="left">
<button class="btn outline sm" onclick="fn_delete_check();return false;">선택 삭제</button>
</div>
<div class="center">
</div>
</div>
<hr class="spacing">
<div class="table-wrapper">
<table class="table vertical">
<caption>구독서비스 목록</caption>
<colgroup>
<col style="width: 4%;">
<col style="width: 4%;">
<col style="width: 12%;">
<col style="width: 7%;">
<col style="width: 12%;">
<col style="width: 7%;">
<col style="width: 6%;">
<col style="width: 6%;">
<col style="width: 7%;">
<col style="width: 7%;">
<col style="width: 7%;">
<col style="width: 7%;">
<col style="width: 7%;">
<col style="width: 7%;">
</colgroup>
<thead>
<tr>
<th>
<label class="b-checkbox checkbox is-medium ">
<input type="checkbox" id="checkAll" value="">
<span class="check"></span>
</label>
</th>
<th>번호</th>
<th>구독서비스</th>
<th>기수</th>
<th>기수명</th>
<th>배송횟수</th>
<th>재고</th>
<th>가용재고</th>
<th>판매상태</th>
<th>노출여부</th>
<th>구독료</th>
<th>1회배송비</th>
<th>소비자가</th>
<th>실판매가</th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${ not empty resultMap.list }">
<c:forEach items="${ resultMap.list }" var="subsvc" varStatus="status">
<tr>
<td>
<label class="b-checkbox checkbox is-medium check-all">
<input type="checkbox" name="arrSubsvcInnb" class="subsvcInnb" value="${subsvc.subsvcInnb}">
<span class="check"></span>
</label>
</td>
<td><c:out value="${ resultMap.paginationInfo.totalRecordCount - subsvc.rnum + 1 }" /></td>
<td><a onclick="fn_move_subsvc_dtl(<c:out value="${subsvc.subsvcInnb}"/>)" class="under-line"><c:out value="${subsvc.subsvcNm}"/></a></td>
<td><c:out value="${subsvc.subsvcGnr}"/>기 <button class="btn xsm outline" type="button" onclick="fn_move_subsvc_copy(<c:out value="${subsvc.subsvcInnb}"/>)"><spring:message code="button.copy"/> </button></td>
<td><c:out value="${subsvc.subsvcGnrNm}"/></td>
<td><c:out value="${subsvc.dlvyCnt}"/>회</td>
<td><fmt:formatNumber value="${subsvc.invntryQy}" pattern="#,###"/></td>
<td><fmt:formatNumber value="${subsvc.availQt}" pattern="#,###"/></td>
<td><c:out value="${subsvc.subsvcSttus}"/></td>
<td><c:out value="${subsvc.expsrDv}"/></td>
<td><fmt:formatNumber value="${subsvc.subsvcCt}" pattern="#,###"/></td>
<td><fmt:formatNumber value="${subsvc.tmeDlvyAmt}" pattern="#,###"/></td>
<td><fmt:formatNumber value="${subsvc.cnsmrpric}" pattern="#,###"/></td>
<td><fmt:formatNumber value="${subsvc.rlSlepric}" pattern="#,###"/></td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="100%"><spring:message code="common.nodata"/></td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
</section>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_list"/>
</div>

View File

@@ -0,0 +1,432 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : GoodsListRForm.jsp
Description : 상품 목록 조회 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-03-20 리브가 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>일반 관리자</title>
<%@ include file="/WEB-INF/views/comm/mngr/Include.jsp"%>
</head>
<script>
$(document).ready(function () {
let pageIndex = '<c:out value="${ resultMap.paramVO.pageIndex }"/>';
let pageUnit = '<c:out value="${ resultMap.paramVO.pageUnit }"/>';
// 목록 조회
fn_select_list(pageIndex, pageUnit);
// 엔터키 검색
$('#listForm').on('keydown', function (event) {
if (event.keyCode === 13) {
event.preventDefault();
fn_select_list(1);
}
});
// event 제어
fn_event();
});
/*********************************************************
* 목록 조회
******************************************************** */
const fn_select_list = function (pageIndex, pageUnit) {
let dataStr;
if (!pageIndex) {
$('#pageIndex').val(1);
} else {
$('#pageIndex').val(pageIndex);
}
//정렬기준 셋팅
if(typeof $('#sortDvView') !== 'undefined'){
$('#sortDv').val($('#sortDvView').val());
}
//한페이지 목록개수 셋팅
if(typeof $('#pageUnitView') !== 'undefined'){
$('#pageUnit').val($('#pageUnitView').val());
}
if (!pageUnit) {
dataStr = $('#listForm').serialize();
} else {
if ($('#pageUnit').length) {
$('#pageUnit').val(pageUnit);
dataStr = $('#listForm').serialize();
} else {
dataStr = $('#listForm').serialize() + '&pageUnit=' + pageUnit;
}
}
$.ajax({
type: "post",
url: "<c:url value="/mngr/goods/subsvc/selectSubsvcList"/>",
data: dataStr,
success: function (resultHtml) {
$('#pageDiv').html(resultHtml);
$('#sortDv').val($('#sortDvView').val());
$('#pageUnitView').niceSelect();
$('#sortDvView').niceSelect();
}
});
}
/*********************************************************
* 구독서비스 복사 조회
*********************************************************/
const fn_move_subsvc_copy = (subsvcInnb) => {
const url = '<c:url value="/mngr/goods/subsvc/selectSubsvcCopyForm"/>';
$('#subsvcInnb').val(subsvcInnb);
$('#listForm').attr('action', url);
$('#listForm').attr('method', 'post');
$('#listForm').submit();
}
/*********************************************************
* 구독서비스 상세 조회
*********************************************************/
const fn_move_subsvc_dtl = (subsvcInnb) => {
const url = '<c:url value="/mngr/goods/subsvc/selectSubsvcDtlForm"/>';
$('#subsvcInnb').val(subsvcInnb);
$('#listForm').attr('action', url);
$('#listForm').attr('method', 'post');
$('#listForm').submit();
}
/*********************************************************
* 등록폼 이동
******************************************************** */
const fn_move_regpage = function () {
const url = '<c:url value="/mngr/goods/subsvc/selectSubsvcRegistForm"/>';
$('#listForm').attr('action', url);
$('#listForm').attr('method', 'post');
$('#listForm').submit();
};
/* 현제uri에 프로토콜, 호스트, 쿼리스티링을 제외하여 history갱신 */
history.replaceState({}, null, location.pathname);
/* ****************************
* event 제어
******************************/
const fn_event = function () {
/* 검색조건 구독서비스 선택 시 회차 조회 이벤트*/
$(document).on('change', '#srchSelSubsvcNm', function(){
var srchSelSubsvcNm = $(this).val();
if(fn_is_empty(srchSelSubsvcNm)){
// 회차 초기화
$('#srchSelSubsvcGnr').empty().append('<option value="">전체</option>').niceSelect('update');
}else{
//해당구독서비스 기수조회
fn_getsubsvcGnr(srchSelSubsvcNm);
}
});
/* ****************************
* 해당구독서비스 기수조회 AJAX
******************************/
const fn_getsubsvcGnr = function (srchSelSubsvcNm) {
$.ajax({
type: 'post',
url: '<c:url value="/mngr/goods/subsvc/selectSrchSubsvcGnrListAjax"/>',
data: {
'srchSelSubsvcNm': srchSelSubsvcNm
},
success: function (data) {
if (data.resBody != null) {
const result = JSON.parse(data.resBody.result);
const srchSubsvcGnrList = result.srchSubsvcGnrList;
if (srchSubsvcGnrList.length > 0) {
$('#srchSubsvcGnr option').filter(function() {
return $(this).val() !== '';
}).remove();
for (let i = 0; i < srchSubsvcGnrList.length; i++) {
const srchSubsvcGnr = srchSubsvcGnrList[i];
$('#srchSelSubsvcGnr').append('<option value="' + srchSubsvcGnr.subsvcGnr + '">' + srchSubsvcGnr.subsvcGnrNm + '</option>');
}
$('#srchSelSubsvcGnr').niceSelect('update');
}
}
},
error: function (data) {
fn_proc_error_message(data);
}
});
}
/* 목록 > 전체선택 체인지 이벤트 */
$(document).on('change', '#checkAll', function () {
let checkbox = $(this).closest('table').find('input[name="arrSubsvcInnb"]');
$(checkbox).prop('checked', false);
$(checkbox).prop('checked', $(this).is(':checked'));
});
}
/**
* 체크박스 전체 처리
* */
const fn_change_event = function (_target, _arg) {
if (_arg === 'all') {
if ($('#' + _target + '-all').is(':checked')) {
$('[name=' + _target + ']').prop('checked', true);
} else {
$('[name=' + _target + ']').prop('checked', false);
}
} else {
let chkCnt = $('[name=' + _target + ']:checked').length;
let allCnt = $('[name=' + _target + ']').length;
if (chkCnt !== allCnt && $('#' + _target + '-all').is(':checked')) {
$('#' + _target + '-all').prop('checked', false);
} else if (chkCnt === allCnt) {
$('#' + _target + '-all').prop('checked', true);
}
}
}
/*********************************************************
* 구독서비스 선택 삭제 AJAX
*********************************************************/
const fn_delete_check = function () {
let url = '<c:url value="/mngr/goods/subsvc/deleteSubsvc"/>';
let arrSubsvcInnb = $("input[name='arrSubsvcInnb']:checked");
let subsvcInnbArr = [];
if (arrSubsvcInnb.length === 0) {
alert("선택된 상품이 없습니다.");
return false;
}else{
arrSubsvcInnb.each( function (){
subsvcInnbArr.push($(this).val());
});
}
if (confirm('상품을 <spring:message code="confirm.common.delete"/>')) {
$.ajax({
type: 'post',
url: url,
data: {
"arrSubsvcInnb": subsvcInnbArr
},
dataType: "json",
success: function (data) {
const message = JSON.parse(data.resBody.result).message;
if(message == "success"){
alert('<spring:message code="success.common.delete"/>');
fn_select_list();
}else{
alert('<spring:message code="fail.common.delete"/>');
}
}
})
}
}
/* 관리자 주문 > 상품조회 > 검색조건 > 날짜 선택 이벤트 */
$(document).on('click', '.dateRange-btn', function () {
const date = $(this).attr('id');
$('.dateRange-btn').removeClass('selected');
$('#' + date).addClass('selected');
const datepicker = $(this).closest('.td-inner').find('.datepicker');
const start = $(datepicker[0]).attr('id');
const end = $(datepicker[1]).attr('id');
if ('allDays' === date) {
$('#' + start + ', #' + end).val('');
$('#datePeriod').val(date);
return false;
}
fn_set_date(start, end, end, date);
$('#datePeriod').val(date);
});
//카테고리 선택시 카테고리 아이디 저장(검색용)
$(document).on('change', 'select[id^=ctgryDepth]', function () {
const ctgryOptn = $(this).val()
if(!fn_is_empty(ctgryOptn)){
$('#ctgryId').val(ctgryOptn)
}else{
//value가 ''인 카테고리 선택할경우
let currentCtgryDepth = parseInt($(this).attr('id').replace('ctgryDepth', ''));
//1차 카테고리가 아닐 경우 이전 카테고리 번호 가져오기
if(currentCtgryDepth !== 1){
$('#ctgryId').val($('#ctgryDepth' + (currentCtgryDepth - 1)).val())
}else{
//1차 카테고리 일경우 카테고리 번호 비우기
$('#ctgryId').val('')
}
}
})
//초기화버튼
$(document).on('click', '#resetBtn', function () {
$('#listForm')[0].reset();
$('#srchSelSubsvcNm').niceSelect('update');
$('#srchSelSubsvcNm').trigger("change");
$('#srchSelSubsvcGnr').niceSelect('update');
fn_select_list(1);
})
</script>
<body>
<%@ include file="/WEB-INF/views/comm/mngr/Header.jsp"%>
<main class="main">
<%@ include file="/WEB-INF/views/comm/mngr/Left.jsp"%>
<div class="content">
<div class="content__inner">
<button class="side-nav__fold"><span class="visually-hidden">좌측메뉴 펼치기/닫기</span></button>
<div class="page-title">
<h2 class="page-title__title">구독서비스 목록</h2>
<div class="page-title__btn-container">
<button onclick="fn_move_regpage()" class="btn primary">구독서비스 <spring:message code="button.insert"/></button>
</div>
</div>
<form id='listForm' name="listForm" method="post" action="<c:url value="/mngr/goods/subsvc/selectSubsvcList"/>">
<input type="hidden" id="pageIndex" name="pageIndex" value="${ resultMap.paramVO.pageIndex }"/>
<input type="hidden" id="sortDv" name="sortDv" value="">
<input type="hidden" id="pageUnit" name="pageUnit" value="">
<input type="hidden" id="subsvcInnb" name="subsvcInnb" value="">
<section class="content-section" id="search-section">
<div class="table-wrapper">
<table class="table">
<colgroup>
<col style="width: 12%;">
<col>
<col style="width: 12%;">
<col>
</colgroup>
<tr>
<th>구독서비스</th>
<td colspan="3">
<div class="td-inner">
<div class="select-box">
<select title="구독서비스" id="srchSelSubsvcNm" name="srchSelSubsvcNm">
<option value="" <c:if test="${ resultMap.paramVO.srchSelSubsvcNm eq ''}">selected="selected"</c:if>>전체</option>
<c:forEach items="${resultMap.srchSubsvcList}" var="srchSubsvc" varStatus="status">
<option value="${srchSubsvc.subsvcNm}" <c:if test="${ resultMap.paramVO.srchSelSubsvcNm eq srchSubsvc}">selected="selected"</c:if>>${srchSubsvc.subsvcNm}</option>
</c:forEach>
</select>
</div>
<div class="select-box">
<select title="구독서비스회차" id="srchSelSubsvcGnr" name="srchSelSubsvcGnr">
<option value="" <c:if test="${ resultMap.paramVO.srchSelSubsvcGnr eq ''}">selected="selected"</c:if>>전체</option>
</select>
</div>
</div>
</td>
</tr>
<tr>
<th>구독서비스명</th>
<td>
<div class="td-inner">
<input class="input-text xl" type="text" title="구독서비스명" id="srchSubsvcNm" name="srchSubsvcNm" value="<c:out value="${ resultMap.BOGoodsVO.srchSubsvcNm }" />">
</div>
</td>
<th>기수명</th>
<td>
<div class="td-inner">
<input class="input-text xl" type="text" title="구독서비스명" id="srchSubsvcGnrNm" name="srchSubsvcGnrNm" value="<c:out value="${ resultMap.BOGoodsVO.srchSubsvcGnrNm }" />">
</div>
</td>
</tr>
<tr>
<th>판매상태</th>
<td>
<div class="td-inner">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox check-all">
<input id="srchArrSubsvcSttusCd-all" type="checkbox" name="srchArrSubsvcSttusCd-all" value="" checked onclick="fn_change_event('srchArrSubsvcSttusCd', 'all');">
<span class="check"></span>
<span class="subsvcSttus-all">전체</span>
</label>
<c:forEach items="${resultMap.srchSubsvcSttusList}" var="srchSubsvcSttus" varStatus="status">
<label class="b-checkbox checkbox">
<input type="checkbox" name="srchArrSubsvcSttusCd" value="${srchSubsvcSttus.cd}" onclick="fn_change_event('srchArrSubsvcSttusCd', 'other');" checked>
<span class="check"></span>
<span class="control-label">${srchSubsvcSttus.cdNm}</span>
</label>
</c:forEach>
</div>
</div>
</td>
<th>노출여부</th>
<td>
<div class="td-inner">
<div class="custom-radio-container">
<div class="custom-radio">
<input type="radio" id="srchExpsrDvCd" name="srchExpsrDvCd" value="" checked>
<label for="srchExpsrDvCd">전체</label>
</div>
<c:forEach items="${resultMap.srchExpsrDvList}" var="srchExpsrDvCd" varStatus="status">
<div class="custom-radio">
<input type="radio" id="srchExpsrDvCd${status.count}" name="srchExpsrDvCd" value="${srchExpsrDvCd.cd}">
<label for="srchExpsrDvCd${status.count}">${srchExpsrDvCd.cdNm}</label>
</div>
</c:forEach>
</div>
</div>
</td>
</tr>
</table>
</div>
<div class="form-control-container">
<div class="left"></div>
<div class="center">
<button class="btn outline" id="resetBtn" type="button">초기화</button>
<button class="btn primary" id="searchBtn" type="button" onclick="fn_select_list(1);"><spring:message code="button.search"/> </button>
</div>
<div class="right">
</div>
</div>
</section>
<div id="pageDiv">
</div>
</form>
<button class="scroll-to-top"><span class="visually-hidden">위로가기</span></button>
</div>
</div>
<div id="modalDiv">
</div>
</main>
</body>
</html>