| Line 1117... |
Line 1117... |
| 1117 |
.selectByIds(stores.stream().map(x -> x.getId()).collect(Collectors.toList())).stream()
|
1117 |
.selectByIds(stores.stream().map(x -> x.getId()).collect(Collectors.toList())).stream()
|
| 1118 |
.collect(Collectors.toMap(x -> x.getId(), x -> x));
|
1118 |
.collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| 1119 |
for (FofoStore store : stores) {
|
1119 |
for (FofoStore store : stores) {
|
| 1120 |
LOGGER.info("Store is {}", store);
|
1120 |
LOGGER.info("Store is {}", store);
|
| 1121 |
String districtShortName = store.getCode().replaceAll("\\d+", "").substring(2);
|
1121 |
String districtShortName = store.getCode().replaceAll("\\d+", "").substring(2);
|
| 1122 |
String stateShortName = store.getCode().replaceAll("\\d+", "").substring(0,2);
|
1122 |
String stateShortName = store.getCode().replaceAll("\\d+", "").substring(0, 2);
|
| 1123 |
DistrictMaster districtMaster = null;
|
1123 |
DistrictMaster districtMaster = null;
|
| 1124 |
LOGGER.info("Store shortname is {}", districtShortName);
|
1124 |
LOGGER.info("Store shortname is {}", districtShortName);
|
| 1125 |
districtMaster = districtMasterRepository.selectByShortnameNameAndStateShortName(districtShortName, stateShortName);
|
1125 |
districtMaster = districtMasterRepository.selectByShortnameNameAndStateShortName(districtShortName,
|
| - |
|
1126 |
stateShortName);
|
| 1126 |
if (districtMaster == null) {
|
1127 |
if (districtMaster == null) {
|
| 1127 |
districtMaster = districtMasterRepository.selectByShortnameNameAndStateShortName("FB", "HR");
|
1128 |
districtMaster = districtMasterRepository.selectByShortnameNameAndStateShortName("FB", "HR");
|
| 1128 |
}
|
1129 |
}
|
| 1129 |
LOGGER.info("Store id - {}", store.getId());
|
1130 |
LOGGER.info("Store id - {}", store.getId());
|
| 1130 |
com.spice.profitmandi.dao.entity.user.User user = userMap.get(store.getId());
|
1131 |
com.spice.profitmandi.dao.entity.user.User user = userMap.get(store.getId());
|
| Line 1141... |
Line 1142... |
| 1141 |
|
1142 |
|
| 1142 |
@Override
|
1143 |
@Override
|
| 1143 |
@Cacheable(value = "storeCodeRetailerMap", cacheManager = "oneDayCacheManager")
|
1144 |
@Cacheable(value = "storeCodeRetailerMap", cacheManager = "oneDayCacheManager")
|
| 1144 |
public Map<String, Integer> getStoreCodeRetailerMap() {
|
1145 |
public Map<String, Integer> getStoreCodeRetailerMap() {
|
| 1145 |
Map<Integer, String> map = this.getAllFofoRetailerIdUrlMap();
|
1146 |
Map<Integer, String> map = this.getAllFofoRetailerIdUrlMap();
|
| 1146 |
return map.entrySet().stream().collect(Collectors.toMap(x -> x.getValue().split("/")[2], x -> x.getKey()));
|
1147 |
return map.entrySet().stream().collect(Collectors.toMap(x -> {
|
| - |
|
1148 |
String[] splitString = x.getValue().split("/");
|
| - |
|
1149 |
return splitString[splitString.length-1];
|
| - |
|
1150 |
}, x -> x.getKey()));
|
| 1147 |
}
|
1151 |
}
|
| 1148 |
}
|
1152 |
}
|