[1485] 오브젝트 복사기능 권한 설정 #468
@ -77,6 +77,14 @@ public class ObjectController {
|
|||||||
return objectService.selectParentAgentInfo(saleStoreId, storeLvl);
|
return objectService.selectParentAgentInfo(saleStoreId, storeLvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(description = "하위 판매점 목록을 조회한다.")
|
||||||
|
@GetMapping("/saleStore/{saleStoreId}/childList")
|
||||||
|
@ResponseStatus(HttpStatus.OK)
|
||||||
|
public List<SaleStoreResponse> selectChildSaleStoreList(
|
||||||
|
@PathVariable String saleStoreId, String storeLvl, String userId) throws Exception {
|
||||||
|
return objectService.selectChildSaleStoreList(saleStoreId, storeLvl, userId);
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(description = "물건정보 목록을 조회한다.")
|
@Operation(description = "물건정보 목록을 조회한다.")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@ResponseStatus(HttpStatus.OK)
|
@ResponseStatus(HttpStatus.OK)
|
||||||
|
|||||||
@ -31,6 +31,9 @@ public interface ObjectMapper {
|
|||||||
// 상위 판매점 정보 조회
|
// 상위 판매점 정보 조회
|
||||||
public SaleStoreResponse selectParentAgentInfo(String saleStoreId, String storeLvl);
|
public SaleStoreResponse selectParentAgentInfo(String saleStoreId, String storeLvl);
|
||||||
|
|
||||||
|
// 하위 판매점 목록 조회
|
||||||
|
public List<SaleStoreResponse> selectChildSaleStoreList(String saleStoreId, String storeLvl, String userId);
|
||||||
|
|
||||||
// 물건정보 메인 목록 조회
|
// 물건정보 메인 목록 조회
|
||||||
public List<ObjectResponse> selectObjectMainList(ObjectRequest objectRequest);
|
public List<ObjectResponse> selectObjectMainList(ObjectRequest objectRequest);
|
||||||
|
|
||||||
|
|||||||
@ -182,6 +182,30 @@ public class ObjectService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 하위 판매점 목록 조회
|
||||||
|
*
|
||||||
|
* @param saleStoreId 판매점 아이디 (부모)
|
||||||
|
* @param storeLvl 판매점 레벨
|
||||||
|
* @return List<SaleStoreResponse> 하위 판매점 목록
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<SaleStoreResponse> selectChildSaleStoreList(String saleStoreId, String storeLvl, String userId) throws Exception {
|
||||||
|
if (StringUtils.isEmpty(saleStoreId)) {
|
||||||
|
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||||
|
message.getMessage("common.message.required.data", "Sale Store ID"));
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(storeLvl)) {
|
||||||
|
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||||
|
message.getMessage("common.message.required.data", "Store Level"));
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(userId)) {
|
||||||
|
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||||
|
message.getMessage("common.message.required.data", "User ID"));
|
||||||
|
}
|
||||||
|
return objectMapper.selectChildSaleStoreList(saleStoreId, storeLvl, userId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 물건정보 메인 목록 조회
|
* 물건정보 메인 목록 조회
|
||||||
*
|
*
|
||||||
|
|||||||
@ -162,6 +162,54 @@
|
|||||||
AND A.DEL_FLG = '0'
|
AND A.DEL_FLG = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectChildSaleStoreList" resultType="com.interplug.qcast.biz.object.dto.SaleStoreResponse">
|
||||||
|
/* sqlid : com.interplug.qcast.biz.object.selectChildSaleStoreList */
|
||||||
|
/* 계층형 구조에 맞는 하위 SALE_STORE_ID 축출 - 재귀함수 */
|
||||||
|
WITH SALES_STORE_CTE AS (
|
||||||
|
SELECT
|
||||||
|
SALE_STORE_ID
|
||||||
|
, SALE_STORE_NAME
|
||||||
|
, SALE_STORE_LEVEL
|
||||||
|
FROM M_SALES_STORE WITH(NOLOCK)
|
||||||
|
WHERE APPROVE_FLG = '2'
|
||||||
|
AND DEL_FLG = '0'
|
||||||
|
AND SALE_STORE_ID = #{saleStoreId}
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
SELECT
|
||||||
|
A.SALE_STORE_ID
|
||||||
|
, A.SALE_STORE_NAME
|
||||||
|
, A.SALE_STORE_LEVEL
|
||||||
|
FROM M_SALES_STORE A WITH(NOLOCK)
|
||||||
|
INNER JOIN SALES_STORE_CTE B
|
||||||
|
ON A.PARENT_SALE_AGENT_ID = B.SALE_STORE_ID
|
||||||
|
WHERE A.APPROVE_FLG = '2'
|
||||||
|
AND A.DEL_FLG = '0'
|
||||||
|
)
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
TT.*
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
T.*
|
||||||
|
, CASE WHEN UFA.DISP_ORDER IS NULL THEN 'B'
|
||||||
|
ELSE 'A' + CAST(UFA.DISP_ORDER AS NVARCHAR) END AS PRIORITY
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
A.SALE_STORE_ID
|
||||||
|
, A.SALE_STORE_NAME
|
||||||
|
, A.SALE_STORE_LEVEL
|
||||||
|
FROM SALES_STORE_CTE A
|
||||||
|
WHERE A.SALE_STORE_LEVEL <![CDATA[ > ]]> ${storeLvl}
|
||||||
|
) T
|
||||||
|
LEFT OUTER JOIN M_USER_FAV_SALES_STORE UFA WITH (NOLOCK)
|
||||||
|
ON T.SALE_STORE_ID = UFA.SALE_STORE_ID
|
||||||
|
AND UFA.USER_ID = #{userId}
|
||||||
|
AND UFA.DEL_FLG = '0'
|
||||||
|
) TT
|
||||||
|
ORDER BY TT.PRIORITY ASC, TT.SALE_STORE_LEVEL ASC, TT.SALE_STORE_ID ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectObjectMainList" parameterType="com.interplug.qcast.biz.object.dto.ObjectRequest" resultType="com.interplug.qcast.biz.object.dto.ObjectResponse">
|
<select id="selectObjectMainList" parameterType="com.interplug.qcast.biz.object.dto.ObjectRequest" resultType="com.interplug.qcast.biz.object.dto.ObjectResponse">
|
||||||
/* sqlid : com.interplug.qcast.biz.object.selectObjectMainList */
|
/* sqlid : com.interplug.qcast.biz.object.selectObjectMainList */
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user