Ver Fonte

입점업체권한을 입점벤더권한 변경에 따른 수정

gagamel há 4 anos atrás
pai
commit
e77ef40a48

+ 12 - 4
src/main/java/com/style24/admin/biz/dao/TsaRendererDao.java

@@ -108,9 +108,7 @@ public interface TsaRendererDao {
 	 * @since 2021. 07. 12
 	 */
 	Collection<CommonCode> getDeliveryLocAllList();
-	
-	
-	
+
 //	/**
 //	 * 정보고시 목록
 //	 * @param goodsCd
@@ -235,7 +233,7 @@ public interface TsaRendererDao {
 	 * @since 2020. 11. 24
 	 */
 	Collection<CommonCode> getSupplyDeliveryFeePolicyList(String supplyCompCd);
-	
+
 	/**
 	 * 업체별 배송비정책 목록(정책명)
 	 *
@@ -307,4 +305,14 @@ public interface TsaRendererDao {
 	 * @since 2021. 07. 04
 	 */
 	Collection<CommonCode> getSupplyDeliveryLocList(String supplyCompCd);
+
+	/**
+	 * 공급업체벤더 목록
+	 * @param supplyComp - 공급업체 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 8. 25
+	 */
+	Collection<CommonCode> getSupplyVendorList(SupplyCompany supplyComp);
+
 }

+ 16 - 4
src/main/java/com/style24/admin/biz/service/TsaRendererService.java

@@ -343,9 +343,7 @@ public class TsaRendererService {
 	public Collection<CommonCode> getDeliveryLocAllList() {
 		return rendererDao.getDeliveryLocAllList();
 	}
-	
-	
-	
+
 //	/**
 //	 * 출고처 목록
 //	 * @return 출고처 목록
@@ -380,7 +378,7 @@ public class TsaRendererService {
 	public Collection<CommonCode> getSupplyDeliveryFeePolicyList(String supplyCompCd) {
 		return rendererDao.getSupplyDeliveryFeePolicyList(supplyCompCd);
 	}
-	
+
 	/**
 	 * 업체별 배송비정책 목록(정책명)
 	 * @param supplyCompCd - 공급업체코드
@@ -634,4 +632,18 @@ public class TsaRendererService {
 	public Collection<CommonCode> getSupplyDeliveryLocList(String supplyCompCd) {
 		return rendererDao.getSupplyDeliveryLocList(supplyCompCd);
 	}
+
+	/**
+	 * 공급업체벤더 목록
+	 * @param supplyComp - 공급업체 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 8. 25
+	 */
+	public Collection<CommonCode> getSupplyVendorList(String supplyVendorCd) {
+		SupplyCompany supplyComp = new SupplyCompany();
+		supplyComp.setSupplyVendorCd(supplyVendorCd);
+		return rendererDao.getSupplyVendorList(supplyComp);
+	}
+
 }

+ 5 - 2
src/main/java/com/style24/admin/biz/web/TsaSystemController.java

@@ -150,8 +150,11 @@ public class TsaSystemController extends TsaBaseController {
 			mav.addObject("roleList", rendererService.getAvailCommonCodeList("G001"));
 		}
 
-		// 공급업체 콤보박스 목록
-		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
+//		// 공급업체 콤보박스 목록
+//		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(TsaSession.getInfo().getSupplyCompCd()));
+
+		// 입점업체벤더 콤보박스 목록
+		mav.addObject("supplyVendorList", rendererService.getSupplyVendorList(TsaSession.getInfo().getSupplyVendorCd()));
 
 		// 외부몰벤더 콤보박스 목록
 		mav.addObject("vendorList", rendererService.getCommonCodeList("G003", "Y", TsaSession.getInfo().getSupplyCompCd()));

+ 2 - 0
src/main/java/com/style24/persistence/domain/User.java

@@ -31,6 +31,8 @@ public class User extends TscBaseDomain {
 	private String roleCd;			// 권한코드
 	private String roleNm;			// 권한명
 	private String roleRefVal;		// 권한관련값
+	private String supplyVendorCd;	// 공급업체벤더코드
+	private String supplyVendorNm;	// 공급업체벤더명
 	private String supplyCompCd;	// 공급업체코드
 	private String supplyCompNm;	// 공급업체명
 	private String vendorId;		// 벤더ID

+ 22 - 4
src/main/java/com/style24/persistence/mybatis/shop/TsaLogin.xml

@@ -12,13 +12,31 @@
 		     , ROLE_CD                                                     /*권한코드*/
 		     , FN_GET_CODE_NM('G001',ROLE_CD)            AS ROLE_NM        /*권한명*/
 		     , ROLE_REF_VAL                                                /*권한관련값*/
-		     , CASE WHEN SUBSTR(REPLACE(ROLE_CD,'G001_', ''),1,1) IN ('A','B','E') THEN
+		     , CASE WHEN SUBSTRING(REPLACE(ROLE_CD,'G001_', ''),1,1) = 'B' THEN
 		                ROLE_REF_VAL
-		            END                                  AS SUPPLY_COMP_CD /*공급업체코드
-		     , CASE WHEN SUBSTRING(REPLACE(ROLE_CD,'G001_', ''),1,1) IN ('A','B','E') THEN
+		            END                                  AS SUPPLY_VENDOR_CD /*공급벤더코드*/
+		     , CASE WHEN SUBSTRING(REPLACE(ROLE_CD,'G001_', ''),1,1) = 'B' THEN
+		                (SELECT SUPPLY_VENDOR_NM
+		                 FROM   TB_SUPPLY_VENDOR
+		                 WHERE  SUPPLY_VENDOR_CD = A.ROLE_REF_VAL
+		                )
+		       END                                       AS SUPPLY_VENDOR_NM /*공급벤더명*/
+		     , CASE WHEN SUBSTRING(REPLACE(ROLE_CD,'G001_', ''),1,1) = 'B' THEN
+		                (SELECT SUPPLY_COMP_CD
+		                 FROM   TB_SUPPLY_COMPANY
+		                 WHERE  SUPPLY_VENDOR_CD = A.ROLE_REF_VAL
+		                 AND    USE_YN = 'Y'
+		                 ORDER  BY SUPPLY_COMP_NM
+		                 LIMIT 1
+		                )
+		            END                                  AS SUPPLY_COMP_CD /*공급업체코드*/
+		     , CASE WHEN SUBSTRING(REPLACE(ROLE_CD,'G001_', ''),1,1) = 'B' THEN
 		                (SELECT SUPPLY_COMP_NM
 		                 FROM   TB_SUPPLY_COMPANY
-		                 WHERE  SUPPLY_COMP_CD = A.ROLE_REF_VAL
+		                 WHERE  SUPPLY_VENDOR_CD = A.ROLE_REF_VAL
+		                 AND    USE_YN = 'Y'
+		                 ORDER  BY SUPPLY_COMP_NM
+		                 LIMIT 1
 		                )
 		       END                                       AS SUPPLY_COMP_NM /*공급업체명*/
 		     , CASE WHEN SUBSTRING(REPLACE(ROLE_CD,'G001_', ''),1,1) = 'C' THEN

+ 14 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaRenderer.xml

@@ -494,4 +494,18 @@
 		AND    USE_YN = 'Y'
 		ORDER  BY DELV_LOC_CD
 	</select>
+	
+	<!-- 공급업체벤더 목록 -->
+	<select id="getSupplyVendorList" parameterType="SupplyCompany" resultType="CommonCode">
+		/* TsaRenderer.getSupplyVendorList */
+		SELECT SUPPLY_VENDOR_CD  AS CD
+		     , SUPPLY_VENDOR_NM  AS CD_NM
+		FROM   TB_SUPPLY_VENDOR
+		WHERE  USE_YN = 'Y'
+		<if test='supplyVendorCd != null and supplyVendorCd != ""'>
+		AND    SUPPLY_VENDOR_CD = #{supplyVendorCd}
+		</if>
+		ORDER  BY SUPPLY_VENDOR_NM
+	</select>
+	
 </mapper>

+ 23 - 2
src/main/java/com/style24/persistence/mybatis/shop/TsaSystem.xml

@@ -12,11 +12,29 @@
 		     , A.ROLE_REF_VAL                                                /*권한관련값*/
 		     , CASE WHEN SUBSTRING(REPLACE(A.ROLE_CD,'G001_', ''),1,1) IN ('A','B','E') THEN
 		                A.ROLE_REF_VAL
+		            END                                    AS SUPPLY_VENDOR_CD /*공급벤더코드*/
+		     , CASE WHEN SUBSTRING(REPLACE(A.ROLE_CD,'G001_', ''),1,1) IN ('A','B','E') THEN
+		                (SELECT SUPPLY_VENDOR_NM
+		                 FROM   TB_SUPPLY_VENDOR
+		                 WHERE  SUPPLY_VENDOR_CD = A.ROLE_REF_VAL
+		                )
+		       END                                         AS SUPPLY_VENDOR_NM /*공급벤더명*/
+		     , CASE WHEN SUBSTRING(REPLACE(A.ROLE_CD,'G001_', ''),1,1) IN ('A','B','E') THEN
+		                (SELECT SUPPLY_COMP_CD
+		                 FROM   TB_SUPPLY_COMPANY
+		                 WHERE  SUPPLY_VENDOR_CD = A.ROLE_REF_VAL
+		                 AND    USE_YN = 'Y'
+		                 ORDER  BY SUPPLY_COMP_NM
+		                 LIMIT 1
+		                )
 		            END                                    AS SUPPLY_COMP_CD /*공급업체코드*/
 		     , CASE WHEN SUBSTRING(REPLACE(A.ROLE_CD,'G001_', ''),1,1) IN ('A','B','E') THEN
 		                (SELECT SUPPLY_COMP_NM
 		                 FROM   TB_SUPPLY_COMPANY
-		                 WHERE  SUPPLY_COMP_CD = A.ROLE_REF_VAL
+		                 WHERE  SUPPLY_VENDOR_CD = A.ROLE_REF_VAL
+		                 AND    USE_YN = 'Y'
+		                 ORDER  BY SUPPLY_COMP_NM
+		                 LIMIT 1
 		                )
 		       END                                         AS SUPPLY_COMP_NM /*공급업체명*/
 		     , CASE WHEN SUBSTRING(REPLACE(A.ROLE_CD,'G001_', ''),1,1) = 'C' THEN
@@ -71,7 +89,10 @@
 		AND    A.USE_YN  = #{useYn}
 		</if>
 		<if test="supplyCompCd != null and supplyCompCd != ''">
-		AND    A.ROLE_REF_VAL = #{supplyCompCd}
+		AND    A.ROLE_REF_VAL = (SELECT SUPPLY_VENDOR_CD
+		                         FROM   TB_SUPPLY_COMPANY
+		                         WHERE  SUPPLY_COMP_CD = #{supplyCompCd}
+		                        )
 		</if>
 		<if test="multiSupplyComp != null and multiSupplyComp != ''">
 		AND    A.ROLE_REF_VAL IN

+ 26 - 26
src/main/webapp/WEB-INF/views/system/UserDetailForm.html

@@ -64,12 +64,12 @@
 								<option th:if="${roleList}" th:each="oneData, status : ${roleList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
 						</td>
-						<th><span id="registerRoleRefVal">업체</span></th>
+						<th><span id="registerRoleRefVal">입점벤더</span></th>
 						<td>
 							<input type="hidden" name="roleRefVal"/>
-							<select name="supplyCompCd">
-								<option th:if="${sessionInfo.supplyCompCd == null}" value="">[선택]</option>
-								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							<select name="supplyVendorCd">
+								<option th:if="${sessionInfo.supplyVendorCd == null}" value="">[선택]</option>
+								<option th:if="${supplyVendorList}" th:each="oneData, status : ${supplyVendorList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
 							<select name="vendorId" style="display: none">
 								<option th:if="${sessionInfo.vendorId == null}" value="">[선택]</option>
@@ -177,16 +177,16 @@
 							</select>
 						</td>
 						<th>
-							<span id="detailRoleRefVal" th:if="${userInfo.roleCd == 'G001_B000'}">업체</span>
+							<span id="detailRoleRefVal" th:if="${userInfo.roleCd == 'G001_B000'}">입점벤더</span>
 							<span id="detailRoleRefVal" th:if="${userInfo.roleCd == 'G001_C000'}">외부몰벤더</span>
 							<span id="detailRoleRefVal" th:if="${userInfo.roleCd == 'G001_D000'}">제휴채널</span>
 							<span id="detailRoleRefVal" th:if="${userInfo.roleCd != 'G001_B000' and userInfo.roleCd != 'G001_C000' and userInfo.roleCd != 'G001_D000'}"></span>
 						</th>
 						<td>
 							<input type="hidden" name="roleRefVal" th:value="${userInfo.roleRefVal}"/>
-							<select name="supplyCompCd" th:style="${userInfo.roleCd == 'G001_B000' ? '' : 'display: none'}">
-								<option th:if="${sessionInfo.supplyCompCd == null}" value="">[선택]</option>
-								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" th:selected="${userInfo.roleRefVal == oneData.cd}"></option>
+							<select name="supplyVendorCd" th:style="${userInfo.roleCd == 'G001_B000' ? '' : 'display: none'}">
+								<option th:if="${sessionInfo.supplyVendorCd == null}" value="">[선택]</option>
+								<option th:if="${supplyVendorList}" th:each="oneData, status : ${supplyVendorList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" th:selected="${userInfo.roleRefVal == oneData.cd}"></option>
 							</select>
 							<select name="vendorId" th:style="${userInfo.roleCd == 'G001_C000' ? '' : 'display: none'}">
 								<option th:if="${sessionInfo.vendorId == null}" value="">[선택]</option>
@@ -298,23 +298,23 @@
 	// 등록화면 권한 변경 시
 	$('#userRegisterForm select[name=roleCd]').on('change', function() {
 		var abRoleCd = $(this).val().substring(0,6);
-		if (abRoleCd == 'G001_A' || abRoleCd == 'G001_B') { // 입점업체
-			$('#userRegisterForm select[name=supplyCompCd]').show();
+		if (abRoleCd == 'G001_A' || abRoleCd == 'G001_B') { // 입점벤더
+			$('#userRegisterForm select[name=supplyVendorCd]').show();
 			$('#userRegisterForm select[name=vendorId]').hide();
 			$('#userRegisterForm select[name=afLinkCd]').hide();
-			$('#registerRoleRefVal').text('업체');
+			$('#registerRoleRefVal').text('입점벤더');
 		} else if (abRoleCd == 'G001_C') { // 외부몰벤더
-			$('#userRegisterForm select[name=supplyCompCd]').hide();
+			$('#userRegisterForm select[name=supplyVendorCd]').hide();
 			$('#userRegisterForm select[name=vendorId]').show();
 			$('#userRegisterForm select[name=afLinkCd]').hide();
 			$('#registerRoleRefVal').text('외부몰벤더');
 		} else if (abRoleCd == 'G001_D') { // 제휴채널
-			$('#userRegisterForm select[name=supplyCompCd]').hide();
+			$('#userRegisterForm select[name=supplyVendorCd]').hide();
 			$('#userRegisterForm select[name=vendorId]').hide();
 			$('#userRegisterForm select[name=afLinkCd]').show();
 			$('#registerRoleRefVal').text('제휴채널');
 		} else { // 외부몰벤더
-			$('#userRegisterForm select[name=supplyCompCd]').hide();
+			$('#userRegisterForm select[name=supplyVendorCd]').hide();
 			$('#userRegisterForm select[name=vendorId]').hide();
 			$('#userRegisterForm select[name=afLinkCd]').hide();
 			$('#registerRoleRefVal').text('');
@@ -413,23 +413,23 @@
 		}
 		
 		var abRoleCd = $(this).val().substring(0,6);
-		if (abRoleCd == 'G001_A' || abRoleCd == 'G001_B') { // 입점업체
-			$('#userDetailForm select[name=supplyCompCd]').show();
+		if (abRoleCd == 'G001_A' || abRoleCd == 'G001_B') { // 입점벤더
+			$('#userDetailForm select[name=supplyVendorCd]').show();
 			$('#userDetailForm select[name=vendorId]').hide();
 			$('#userDetailForm select[name=afLinkCd]').hide();
-			$('#detailRoleRefVal').text('업체');
+			$('#detailRoleRefVal').text('입점벤더');
 		} else if (abRoleCd == 'G001_C') { // 외부몰벤더
-			$('#userDetailForm select[name=supplyCompCd]').hide();
+			$('#userDetailForm select[name=supplyVendorCd]').hide();
 			$('#userDetailForm select[name=vendorId]').show();
 			$('#userDetailForm select[name=afLinkCd]').hide();
 			$('#detailRoleRefVal').text('외부몰벤더');
 		} else if (abRoleCd == 'G001_D') { // 제휴채널
-			$('#userDetailForm select[name=supplyCompCd]').hide();
+			$('#userDetailForm select[name=supplyVendorCd]').hide();
 			$('#userDetailForm select[name=vendorId]').hide();
 			$('#userDetailForm select[name=afLinkCd]').show();
 			$('#detailRoleRefVal').text('제휴채널');
 		} else {
-			$('#userDetailForm select[name=supplyCompCd]').hide();
+			$('#userDetailForm select[name=supplyVendorCd]').hide();
 			$('#userDetailForm select[name=vendorId]').hide();
 			$('#userDetailForm select[name=afLinkCd]').hide();
 			$('#detailRoleRefVal').text('');
@@ -471,12 +471,12 @@
 		}
 		
 		var abRoleCd = $(formId + ' select[name=roleCd]').val().substring(0,6);
-		if (abRoleCd == 'G001_B') { // 입점업체
-			if (gagajf.isNull($(formId + ' select[name=supplyCompCd]').val())) {
-				mcxDialog.alertC('업체를 선택해 주세요.', {
+		if (abRoleCd == 'G001_B') { // 입점벤더
+			if (gagajf.isNull($(formId + ' select[name=supplyVendorCd]').val())) {
+				mcxDialog.alertC('입점벤더를 선택해 주세요.', {
 					sureBtnText: "확인",
 					sureBtnClick: function() {
-						$(formId + ' select[name=supplyCompCd]').focus();
+						$(formId + ' select[name=supplyVendorCd]').focus();
 					}
 				});
 				return;
@@ -523,8 +523,8 @@
 				$(formId + ' input[name=maskingYn]').val($(formId + ' input:checkbox[name=chkMaskingYn]').is(":checked") ? 'Y' : 'N');
 				$(formId + ' input[name=useYn]').val($(formId + ' input:checkbox[name=chkUseYn]').is(":checked") ? 'Y' : 'N');
 				
-				if (abRoleCd == 'G001_A' || abRoleCd == 'G001_B' || abRoleCd == 'G001_E') { // 자사,입점,촬영업체
-					$(formId + ' input[name=roleRefVal]').val($(formId + ' select[name=supplyCompCd]').val());
+				if (abRoleCd == 'G001_A' || abRoleCd == 'G001_B' || abRoleCd == 'G001_E') { // 자사,입점벤더,촬영업체
+					$(formId + ' input[name=roleRefVal]').val($(formId + ' select[name=supplyVendorCd]').val());
 				} else if (abRoleCd == 'G001_C') { // 외부몰벤더
 					$(formId + ' input[name=roleRefVal]').val($(formId + ' select[name=vendorId]').val());
 				} else if (abRoleCd == 'G001_D') { // 제휴채널

+ 2 - 1
src/main/webapp/WEB-INF/views/system/UserForm.html

@@ -132,7 +132,8 @@
 			cellRenderer: function (params) { return gagaAgGrid.lookupValue(roleList, params.data.roleCd); }
 		},
 		{headerName: "권한관련값", field: "roleRefVal", width: 150, cellClass: 'text-center', hide: true},
-		{headerName: "업체", field: "supplyCompNm", width: 150, cellClass: 'text-center'},
+// 		{headerName: "업체", field: "supplyCompNm", width: 150, cellClass: 'text-center'},
+		{headerName: "입점벤더", field: "supplyVendorNm", width: 150, cellClass: 'text-center'},
 		{headerName: "외부몰벤더", field: "vendorNm", width: 150, cellClass: 'text-center'},
 		{
 			headerName: "제휴채널", field: "afLinkNm", width: 120, cellClass: 'text-center',