| Line 940... |
Line 940... |
| 940 |
}
|
940 |
}
|
| 941 |
return customRetailersMap;
|
941 |
return customRetailersMap;
|
| 942 |
}
|
942 |
}
|
| 943 |
|
943 |
|
| 944 |
@Override
|
944 |
@Override
|
| 945 |
@Cacheable(value = "getFofoRetailer", cacheManager = "oneDayCacheManager")
|
945 |
@Cacheable(value = "getFofoRetailer", cacheManager = "thirtyMinsTimeOutCacheManager")
|
| 946 |
public CustomRetailer getFofoRetailer(int fofoId) throws ProfitMandiBusinessException {
|
946 |
public CustomRetailer getFofoRetailer(int fofoId) throws ProfitMandiBusinessException {
|
| 947 |
com.spice.profitmandi.dao.entity.user.User saholicUser = userUserRepository.selectById(fofoId);
|
947 |
com.spice.profitmandi.dao.entity.user.User saholicUser = userUserRepository.selectById(fofoId);
|
| 948 |
FofoStore store = fofoStoreRepository.selectByRetailerId(fofoId);
|
948 |
FofoStore store = fofoStoreRepository.selectByRetailerId(fofoId);
|
| 949 |
Address address = null;
|
949 |
Address address = null;
|
| 950 |
try {
|
950 |
try {
|
| Line 1098... |
Line 1098... |
| 1098 |
}
|
1098 |
}
|
| 1099 |
return retailerIdNameMap;
|
1099 |
return retailerIdNameMap;
|
| 1100 |
}
|
1100 |
}
|
| 1101 |
|
1101 |
|
| 1102 |
@Override
|
1102 |
@Override
|
| 1103 |
@Cacheable(value = "FofoRetailerIdNameMap", cacheManager = "oneDayCacheManager")
|
1103 |
@Cacheable(value = "FofoRetailerIdNameMap", cacheManager = "thirtyMinsTimeOutCacheManager")
|
| 1104 |
public Map<Integer, String> getAllFofoRetailerIdNameMap() {
|
1104 |
public Map<Integer, String> getAllFofoRetailerIdNameMap() {
|
| 1105 |
List<FofoStore> stores = fofoStoreRepository.selectAll();
|
1105 |
List<FofoStore> stores = fofoStoreRepository.selectAll();
|
| 1106 |
List<Integer> storeIds = stores.stream().map(x -> x.getId()).collect(Collectors.toList());
|
1106 |
List<Integer> storeIds = stores.stream().map(x -> x.getId()).collect(Collectors.toList());
|
| 1107 |
return this.getAllFofoRetailerIdNameMap(storeIds);
|
1107 |
return this.getAllFofoRetailerIdNameMap(storeIds);
|
| 1108 |
}
|
1108 |
}
|
| Line 1120... |
Line 1120... |
| 1120 |
});
|
1120 |
});
|
| 1121 |
return mapWrappers;
|
1121 |
return mapWrappers;
|
| 1122 |
}
|
1122 |
}
|
| 1123 |
|
1123 |
|
| 1124 |
@Override
|
1124 |
@Override
|
| 1125 |
@Cacheable(value = "retailerNames", cacheManager = "oneDayCacheManager")
|
1125 |
@Cacheable(value = "retailerNames", cacheManager = "thirtyMinsTimeOutCacheManager")
|
| 1126 |
public Map<Integer, CustomRetailer> getFofoRetailers(boolean activeOnly) {
|
1126 |
public Map<Integer, CustomRetailer> getFofoRetailers(boolean activeOnly) {
|
| 1127 |
// TODO Auto-generated method stub
|
1127 |
// TODO Auto-generated method stub
|
| 1128 |
Stream<FofoStore> storeStream = fofoStoreRepository.selectAll().stream();
|
1128 |
Stream<FofoStore> storeStream = fofoStoreRepository.selectAll().stream();
|
| 1129 |
if (activeOnly) {
|
1129 |
if (activeOnly) {
|
| 1130 |
storeStream = storeStream.filter(x -> x.isActive());
|
1130 |
storeStream = storeStream.filter(x -> x.isActive());
|
| Line 1132... |
Line 1132... |
| 1132 |
List<Integer> storeIds = storeStream.map(x -> x.getId()).collect(Collectors.toList());
|
1132 |
List<Integer> storeIds = storeStream.map(x -> x.getId()).collect(Collectors.toList());
|
| 1133 |
return this.getFofoRetailers(storeIds);
|
1133 |
return this.getFofoRetailers(storeIds);
|
| 1134 |
}
|
1134 |
}
|
| 1135 |
|
1135 |
|
| 1136 |
@Override
|
1136 |
@Override
|
| 1137 |
@Cacheable(value = "allFofoRetailers", cacheManager = "oneDayCacheManager")
|
1137 |
@Cacheable(value = "allFofoRetailers", cacheManager = "thirtyMinsTimeOutCacheManager")
|
| 1138 |
public Map<Integer, CustomRetailer> getAllFofoRetailers() {
|
1138 |
public Map<Integer, CustomRetailer> getAllFofoRetailers() {
|
| 1139 |
// TODO Auto-generated method stub
|
1139 |
// TODO Auto-generated method stub
|
| 1140 |
Stream<FofoStore> storeStream = fofoStoreRepository.selectAll().stream();
|
1140 |
Stream<FofoStore> storeStream = fofoStoreRepository.selectAll().stream();
|
| 1141 |
|
1141 |
|
| 1142 |
List<Integer> storeIds = storeStream.map(x -> x.getId()).collect(Collectors.toList());
|
1142 |
List<Integer> storeIds = storeStream.map(x -> x.getId()).collect(Collectors.toList());
|
| Line 1189... |
Line 1189... |
| 1189 |
LOGGER.info("Hash String {}", hashString);
|
1189 |
LOGGER.info("Hash String {}", hashString);
|
| 1190 |
return hashString;
|
1190 |
return hashString;
|
| 1191 |
}
|
1191 |
}
|
| 1192 |
|
1192 |
|
| 1193 |
@Override
|
1193 |
@Override
|
| 1194 |
@Cacheable(value = "fofoIdUrl", cacheManager = "oneDayCacheManager")
|
1194 |
@Cacheable(value = "fofoIdUrl", cacheManager = "thirtyMinsTimeOutCacheManager")
|
| 1195 |
public Map<Integer, String> getAllFofoRetailerIdUrlMap() {
|
1195 |
public Map<Integer, String> getAllFofoRetailerIdUrlMap() {
|
| 1196 |
Map<Integer, String> fofoRetailerUrlMap = new HashMap<>();
|
1196 |
Map<Integer, String> fofoRetailerUrlMap = new HashMap<>();
|
| 1197 |
List<FofoStore> stores = fofoStoreRepository.selectAll().stream().filter(x -> x.isActive())
|
1197 |
List<FofoStore> stores = fofoStoreRepository.selectAll().stream().filter(x -> x.isActive())
|
| 1198 |
.collect(Collectors.toList());
|
1198 |
.collect(Collectors.toList());
|
| 1199 |
Map<Integer, com.spice.profitmandi.dao.entity.user.User> userMap = userUserRepository
|
1199 |
Map<Integer, com.spice.profitmandi.dao.entity.user.User> userMap = userUserRepository
|
| Line 1220... |
Line 1220... |
| 1220 |
}
|
1220 |
}
|
| 1221 |
return fofoRetailerUrlMap;
|
1221 |
return fofoRetailerUrlMap;
|
| 1222 |
}
|
1222 |
}
|
| 1223 |
|
1223 |
|
| 1224 |
@Override
|
1224 |
@Override
|
| 1225 |
@Cacheable(value = "storeCodeRetailerMap", cacheManager = "oneDayCacheManager")
|
1225 |
@Cacheable(value = "storeCodeRetailerMap", cacheManager = "thirtyMinsTimeOutCacheManager")
|
| 1226 |
public Map<String, Integer> getStoreCodeRetailerMap() {
|
1226 |
public Map<String, Integer> getStoreCodeRetailerMap() {
|
| 1227 |
Map<Integer, String> map = this.getAllFofoRetailerIdUrlMap();
|
1227 |
Map<Integer, String> map = this.getAllFofoRetailerIdUrlMap();
|
| 1228 |
Map<String, Integer> returnMap = map.entrySet().stream().collect(Collectors.toMap(x -> {
|
1228 |
Map<String, Integer> returnMap = map.entrySet().stream().collect(Collectors.toMap(x -> {
|
| 1229 |
String[] splitString = x.getValue().split("/");
|
1229 |
String[] splitString = x.getValue().split("/");
|
| 1230 |
return splitString[splitString.length - 1];
|
1230 |
return splitString[splitString.length - 1];
|