물건 판매점 목록 조회 t01 조건 수정 및 로그인 response custCd 추가
This commit is contained in:
parent
c056b7efdb
commit
90930a11f1
@ -24,5 +24,5 @@ public class UserResponse {
|
||||
private String pwdInitYn; // Password Init Yn
|
||||
private String storeLvl; // Store Level
|
||||
private String groupId; // groupId
|
||||
|
||||
private String custCd; // custCd
|
||||
}
|
||||
|
||||
@ -84,41 +84,43 @@ public class ObjectService {
|
||||
|
||||
if ("T01".equals(saleStoreId)) {
|
||||
storeList = objectMapper.selectSaleStoreAllList();
|
||||
} else {
|
||||
storeList = objectMapper.selectSaleStoreList(saleStoreId);
|
||||
}
|
||||
|
||||
// [1]. 판매점 목록 조회 결과
|
||||
if (storeList.size() > 0) {
|
||||
StoreFavoriteRequest storeFavoriteReq = new StoreFavoriteRequest();
|
||||
storeFavoriteReq.setUserId(userId);
|
||||
// [1]. 판매점 목록 조회 결과
|
||||
if (storeList.size() > 0) {
|
||||
StoreFavoriteRequest storeFavoriteReq = new StoreFavoriteRequest();
|
||||
storeFavoriteReq.setUserId(userId);
|
||||
|
||||
// [2]. 사용자 판매점 즐겨찾기 목록 조회 (QSP -> QCAST)
|
||||
StoreFavoriteResponse storeFavoriteRes = new StoreFavoriteResponse();
|
||||
storeFavoriteRes = storeFavoriteService.getStoreFavoriteList(storeFavoriteReq);
|
||||
// [2]. 사용자 판매점 즐겨찾기 목록 조회 (QSP -> QCAST)
|
||||
StoreFavoriteResponse storeFavoriteRes = new StoreFavoriteResponse();
|
||||
storeFavoriteRes = storeFavoriteService.getStoreFavoriteList(storeFavoriteReq);
|
||||
|
||||
List<Map<String, Object>> data = (List<Map<String, Object>>) storeFavoriteRes.getData();
|
||||
Map<String, Object> result = (Map<String, Object>) storeFavoriteRes.getResult();
|
||||
List<Map<String, Object>> data = (List<Map<String, Object>>) storeFavoriteRes.getData();
|
||||
Map<String, Object> result = (Map<String, Object>) storeFavoriteRes.getResult();
|
||||
|
||||
// [3]. 판매점 목록 중, 즐겨찾기 판매점에 해당하는 경우 정렬 기준 셋팅
|
||||
if ("S".equals(result.get("resultCode"))) {
|
||||
if (data.size() > 0) {
|
||||
for (SaleStoreResponse saleStore : storeList) {
|
||||
String storeId = saleStore.getSaleStoreId();
|
||||
saleStore.setPriority("B");
|
||||
for (Map<String, Object> storeFavorite : data) {
|
||||
String favStoreId = (String) storeFavorite.get("storeId");
|
||||
if (storeId.equals(favStoreId)) {
|
||||
saleStore.setPriority("A" + (String) storeFavorite.get("priority"));
|
||||
// [3]. 판매점 목록 중, 즐겨찾기 판매점에 해당하는 경우 정렬 기준 셋팅
|
||||
if ("S".equals(result.get("resultCode"))) {
|
||||
if (data.size() > 0) {
|
||||
for (SaleStoreResponse saleStore : storeList) {
|
||||
String storeId = saleStore.getSaleStoreId();
|
||||
saleStore.setPriority("B");
|
||||
for (Map<String, Object> storeFavorite : data) {
|
||||
String favStoreId = (String) storeFavorite.get("storeId");
|
||||
if (storeId.equals(favStoreId)) {
|
||||
saleStore.setPriority("A" + (String) storeFavorite.get("priority"));
|
||||
}
|
||||
}
|
||||
}
|
||||
// [4]. 정렬 기준 sort (오름차순)
|
||||
storeList.sort(Comparator.comparing(SaleStoreResponse::getPriority));
|
||||
}
|
||||
// [4]. 정렬 기준 sort (오름차순)
|
||||
storeList.sort(Comparator.comparing(SaleStoreResponse::getPriority));
|
||||
} else {
|
||||
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR,
|
||||
(String) result.get("resultMsg"));
|
||||
}
|
||||
} else {
|
||||
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, (String) result.get("resultMsg"));
|
||||
}
|
||||
|
||||
} else {
|
||||
storeList = objectMapper.selectSaleStoreList(saleStoreId);
|
||||
}
|
||||
|
||||
return storeList;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user