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

Merge branch 'develop' into eskim

eskim 5 лет назад
Родитель
Сommit
c21204ae22

+ 26 - 4
src/main/java/com/style24/persistence/mybatis/shop/TssNotice.xml

@@ -53,14 +53,25 @@
 	</update>
 	
 	<!-- 공지사항 팝업 총건수 -->
-	<select id="getNoticePopupTotalCount" resultType="int">
+	<select id="getNoticePopupTotalCount" parameterType="String" resultType="int">
 		/* TssNotice.getNoticePopupTotalCount */
 		SELECT COUNT(*) AS CNT
 		FROM   TB_NOTICE A
 		WHERE  A.NOTICE_TYPE = 'G047_20' /*내부공지*/
 		AND    A.NOTICE_SQ IN (SELECT NOTICE_SQ
 		                       FROM   TB_NOTICE_RECEIVER
-		                       WHERE  RECEIVER_ID = 'G048_60' /*입점업체*/
+		                       WHERE  1 = 1
+		                       <choose>
+		                           <when test="roleCd == 'G001_B000'">
+		                       AND    RECEIVER_ID = 'G048_60' /*입점업체*/
+		                           </when>
+		                           <when test="roleCd == 'G001_C000'">
+		                       AND    RECEIVER_ID = 'G048_40' /*외부몰벤더*/
+		                           </when>
+		                           <when test="roleCd == 'G001_D000'">
+		                       AND    RECEIVER_ID = 'G048_50' /*제휴사이트*/
+		                           </when>
+		                       </choose>
 		                      )
 		AND    A.USE_YN = 'Y'
 		AND    A.POPUP_YN = 'Y' /*팝업*/
@@ -68,7 +79,7 @@
 	</select>
 	
 	<!-- 공지사항 팝업 목록 -->
-	<select id="getNoticePopupList" resultType="Notice">
+	<select id="getNoticePopupList" parameterType="String" resultType="Notice">
 		/* TssNotice.getNoticePopupList */
 		SELECT A.NOTICE_SQ                                           /*공지번호*/
 		     , A.NOTICE_TITLE                                        /*공지제목*/
@@ -82,7 +93,18 @@
 		WHERE  A.NOTICE_TYPE = 'G047_20' /*내부공지*/
 		AND    A.NOTICE_SQ IN (SELECT NOTICE_SQ
 		                       FROM   TB_NOTICE_RECEIVER
-		                       WHERE  RECEIVER_ID = 'G048_60' /*입점업체*/
+		                       WHERE  1 = 1
+		                       <choose>
+		                           <when test="roleCd == 'G001_B000'">
+		                       AND    RECEIVER_ID = 'G048_60' /*입점업체*/
+		                           </when>
+		                           <when test="roleCd == 'G001_C000'">
+		                       AND    RECEIVER_ID = 'G048_40' /*외부몰벤더*/
+		                           </when>
+		                           <when test="roleCd == 'G001_D000'">
+		                       AND    RECEIVER_ID = 'G048_50' /*제휴사이트*/
+		                           </when>
+		                       </choose>
 		                      )
 		AND    A.USE_YN = 'Y'
 		AND    A.POPUP_YN = 'Y' /*팝업*/

+ 16 - 13
src/main/java/com/style24/persistence/mybatis/shop/TssRenderer.xml

@@ -330,32 +330,35 @@
 	<select id="getColorGrpCdRgbList" resultType="CommonCode">
 		/* TssRenderer.getColorGrpCdRgbList */
 		SELECT CD
-			 , CD_DESC AS CD_NM
-		FROM TB_COMMON_CODE
-		WHERE 1=1
-		AND CD_GB = 'G072'
-		AND USE_YN = 'Y'
+		     , CD_DESC AS CD_NM
+		FROM   TB_COMMON_CODE
+		WHERE  1 = 1
+		AND    CD_GB = 'G072'
+		AND    USE_YN = 'Y'
 	</select>
 	
 	<!-- 업체별 배송비정책 목록 -->
 	<select id="getSupplyDeliveryFeePolicyList" parameterType="String" resultType="CommonCode">
 		/* TsaRenderer.getSupplyDeliveryFeePolicyList */
-		SELECT DELV_FEE_CD AS CD
-			 , CONCAT(MIN_ORD_AMT,'/',DELV_FEE) AS CD_NM
-		FROM TB_DELV_FEE_POLICY
-		WHERE 1=1
-		AND SUPPLY_COMP_CD = #{supplyCompCd}
-		AND USE_YN = 'Y'
-		ORDER BY DELV_FEE_CD
+		SELECT DELV_FEE_CD                      AS CD
+		     , CONCAT(MIN_ORD_AMT,'/',DELV_FEE) AS CD_NM
+		FROM   TB_DELV_FEE_POLICY
+		WHERE  1 = 1
+		AND    SUPPLY_COMP_CD = #{supplyCompCd}
+		AND    USE_YN = 'Y'
+		ORDER  BY DELV_FEE_CD
 	</select>
 	
 	<!-- 제휴채널 목록 -->
-	<select id="getAflinkList" parameterType="String" resultType="CommonCode">
+	<select id="getAflinkList" parameterType="AflinkFee" resultType="CommonCode">
 		/* TssRenderer.getAflinkList */
 		SELECT AF_LINK_CD AS CD
 		     , AF_LINK_NM AS CD_NM
 		FROM   TB_AF_LINK
 		WHERE  AF_CHANNEL = #{afChannel}
+		<if test="afLinkCd != null and afLinkCd != ''">
+		AND    AF_LINK_CD = #{afLinkCd}
+		</if>
 		AND    USE_YN = 'Y'
 	</select>
 

+ 4 - 2
src/main/java/com/style24/scm/biz/dao/TssNoticeDao.java

@@ -33,19 +33,21 @@ public interface TssNoticeDao {
 
 	/**
 	 * 공지사항 팝업 총건수
+	 * @param roleCd - 권한코드
 	 * @return
 	 * @author gagamel
 	 * @since 2020. 12. 30
 	 */
-	int getNoticePopupTotalCount();
+	int getNoticePopupTotalCount(String roleCd);
 
 	/**
 	 * 공지사항 팝업 목록
+	 * @param roleCd - 권한코드
 	 * @return
 	 * @author gagamel
 	 * @since 2020. 12. 29
 	 */
-	Collection<Notice> getNoticePopupList();
+	Collection<Notice> getNoticePopupList(String roleCd);
 
 	/**
 	 * 공지사항 팝업 파일 목록

+ 3 - 2
src/main/java/com/style24/scm/biz/dao/TssRendererDao.java

@@ -3,6 +3,7 @@ package com.style24.scm.biz.dao;
 import java.util.Collection;
 
 import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.AflinkFee;
 import com.style24.persistence.domain.Brand;
 import com.style24.persistence.domain.Color;
 import com.style24.persistence.domain.CommonCode;
@@ -216,11 +217,11 @@ public interface TssRendererDao {
 
 	/**
 	 * 제휴채널 목록
-	 * @param afChannel - 상위제휴채널
+	 * @param aflinkFee - 제휴채널 정보
 	 * @return
 	 * @author gagamel
 	 * @since 2021. 1. 20
 	 */
-	Collection<CommonCode> getAflinkList(String afChannel);
+	Collection<CommonCode> getAflinkList(AflinkFee aflinkFee);
 
 }

+ 3 - 2
src/main/java/com/style24/scm/biz/service/TssNoticeService.java

@@ -8,6 +8,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import com.style24.persistence.domain.Notice;
 import com.style24.scm.biz.dao.TssNoticeDao;
+import com.style24.scm.support.security.session.TssSession;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -55,7 +56,7 @@ public class TssNoticeService {
 	 * @since 2020. 12. 30
 	 */
 	public int getNoticePopupTotalCount() {
-		return noticeDao.getNoticePopupTotalCount();
+		return noticeDao.getNoticePopupTotalCount(TssSession.getInfo().getRoleCd());
 	}
 
 	/**
@@ -65,7 +66,7 @@ public class TssNoticeService {
 	 * @since 2020. 12. 29
 	 */
 	public Collection<Notice> getNoticePopupList() {
-		Collection<Notice> noticeList = noticeDao.getNoticePopupList();
+		Collection<Notice> noticeList = noticeDao.getNoticePopupList(TssSession.getInfo().getRoleCd());
 
 		if (noticeList != null && !noticeList.isEmpty()) {
 			for (Notice notice : noticeList) {

+ 18 - 1
src/main/java/com/style24/scm/biz/service/TssRendererService.java

@@ -6,6 +6,7 @@ import java.util.Collection;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.style24.persistence.domain.AflinkFee;
 import com.style24.persistence.domain.Brand;
 import com.style24.persistence.domain.Color;
 import com.style24.persistence.domain.CommonCode;
@@ -481,7 +482,23 @@ public class TssRendererService {
 	 * @since 2021. 1. 20
 	 */
 	public Collection<CommonCode> getAflinkList(String afChannel) {
-		return rendererDao.getAflinkList(afChannel);
+		AflinkFee aflinkFee = new AflinkFee();
+		aflinkFee.setAfChannel(afChannel);
+		return rendererDao.getAflinkList(aflinkFee);
+	}
+
+	/**
+	 * 제휴채널 목록
+	 * @param afChannel - 상위제휴채널
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	public Collection<CommonCode> getAflinkList(String afChannel, String afLinkCd) {
+		AflinkFee aflinkFee = new AflinkFee();
+		aflinkFee.setAfChannel(afChannel);
+		aflinkFee.setAfLinkCd(afLinkCd);
+		return rendererDao.getAflinkList(aflinkFee);
 	}
 
 }

+ 1 - 1
src/main/java/com/style24/scm/biz/web/TssSettleController.java

@@ -54,7 +54,7 @@ public class TssSettleController extends TssBaseController {
 		mav.addObject("afChannelList", rendererService.getCommonCodeList(commoncode));
 
 		// 제휴채널 목록
-		mav.addObject("afLinkList", rendererService.getAflinkList(TssSession.getInfo().getAfChannel()));
+		mav.addObject("afLinkList", rendererService.getAflinkList(TssSession.getInfo().getAfChannel(), TssSession.getInfo().getAfLinkCd()));
 
 		return mav;
 	}

+ 2 - 3
src/main/webapp/WEB-INF/views/settle/AfLinkSettleForm.html

@@ -41,12 +41,11 @@
 						</td>
 						<th>제휴채널</th>
 						<td>
-							<select name="afChannel" disabled="disabled">
+							<select name="afChannel">
 								<option th:if="${afChannelList}" th:each="oneData, status : ${afChannelList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
 							<select name="afLinkCd">
-								<option value="">[전체]</option>
-								<option th:if="${afLinkList}" th:each="oneData, status : ${afLinkList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+								<option th:if="${afLinkList}" th:each="oneData, status : ${afLinkList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" th:selected="${sessionInfo.afLinkCd == oneData.cd}"></option>
 							</select>
 						</td>
 					</tr>