| Line 16... |
Line 16... |
| 16 |
import org.springframework.stereotype.Component;
|
16 |
import org.springframework.stereotype.Component;
|
| 17 |
|
17 |
|
| 18 |
import com.spice.profitmandi.common.ResponseCodeHolder;
|
18 |
import com.spice.profitmandi.common.ResponseCodeHolder;
|
| 19 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
19 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 20 |
import com.spice.profitmandi.common.model.CustomAddress;
|
20 |
import com.spice.profitmandi.common.model.CustomAddress;
|
| - |
|
21 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 21 |
import com.spice.profitmandi.common.model.CustomShop;
|
22 |
import com.spice.profitmandi.common.model.CustomShop;
|
| 22 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
23 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 23 |
import com.spice.profitmandi.common.model.UpdateRetailerRequest;
|
24 |
import com.spice.profitmandi.common.model.UpdateRetailerRequest;
|
| 24 |
import com.spice.profitmandi.common.util.StringUtils;
|
25 |
import com.spice.profitmandi.common.util.StringUtils;
|
| 25 |
import com.spice.profitmandi.common.util.Utils;
|
26 |
import com.spice.profitmandi.common.util.Utils;
|
| Line 323... |
Line 324... |
| 323 |
user.setReferral_url("");
|
324 |
user.setReferral_url("");
|
| 324 |
user.setGroup_id(1);
|
325 |
user.setGroup_id(1);
|
| 325 |
user.setStatus(1);
|
326 |
user.setStatus(1);
|
| 326 |
user.setActivated(true);
|
327 |
user.setActivated(true);
|
| 327 |
user.setCreateTimestamp(LocalDateTime.now());
|
328 |
user.setCreateTimestamp(LocalDateTime.now());
|
| 328 |
user.setUpdateTimestamp(LocalDateTime.now());
|
- |
|
| 329 |
userRepository.persist(user);
|
- |
|
| 330 |
}
|
329 |
}
|
| 331 |
user.setFirstName(updateRetailerRequest.getUserFirstName());
|
330 |
user.setFirstName(updateRetailerRequest.getUserFirstName());
|
| 332 |
user.setLastName(updateRetailerRequest.getUserLastName());
|
331 |
user.setLastName(updateRetailerRequest.getUserLastName());
|
| 333 |
user.setMobileNumber(updateRetailerRequest.getUserMobileNumber());
|
332 |
user.setMobileNumber(updateRetailerRequest.getUserMobileNumber());
|
| 334 |
user.setEmailId(updateRetailerRequest.getUserEmailId());
|
333 |
user.setEmailId(updateRetailerRequest.getUserEmailId());
|
| 335 |
user.setUsername(updateRetailerRequest.getUserEmailId());
|
334 |
user.setUsername(updateRetailerRequest.getUserEmailId());
|
| - |
|
335 |
user.setUpdateTimestamp(LocalDateTime.now());
|
| - |
|
336 |
userRepository.persist(user);
|
| 336 |
return user;
|
337 |
return user;
|
| 337 |
}
|
338 |
}
|
| 338 |
|
339 |
|
| 339 |
private int createSaholicUser(User user, String retailerName){
|
340 |
private int createSaholicUser(User user, String retailerName){
|
| 340 |
com.spice.profitmandi.dao.entity.user.User saholicUser = null;
|
341 |
com.spice.profitmandi.dao.entity.user.User saholicUser = null;
|
| Line 713... |
Line 714... |
| 713 |
//throw new ProfitMandiBusinessException();
|
714 |
//throw new ProfitMandiBusinessException();
|
| 714 |
}
|
715 |
}
|
| 715 |
return districtMasterRepository.selectByStateShortName(stateInfo.getShortName());
|
716 |
return districtMasterRepository.selectByStateShortName(stateInfo.getShortName());
|
| 716 |
}
|
717 |
}
|
| 717 |
|
718 |
|
| - |
|
719 |
@Override
|
| - |
|
720 |
public Map<Integer, CustomRetailer> getFofoRetailers(List<Integer> fofoIds) {
|
| - |
|
721 |
List<com.spice.profitmandi.dao.entity.user.User> saholicUsers = userUserRepository.selectByIds(fofoIds);
|
| - |
|
722 |
List<Address> addresses = addressRepository.selectByIds(saholicUsers.stream().map(x -> x.getAddressId()).collect(Collectors.toList()));
|
| - |
|
723 |
Map<Integer, CustomRetailer> customRetailersMap = new HashMap<>();
|
| - |
|
724 |
for(Address address: addresses) {
|
| - |
|
725 |
CustomRetailer customRetailer = new CustomRetailer();
|
| - |
|
726 |
customRetailer.setBusinessName(address.getName());
|
| - |
|
727 |
customRetailer.setMobileNumber(address.getPhoneNumber());
|
| - |
|
728 |
customRetailersMap.put(address.getRetaierId(), customRetailer);
|
| - |
|
729 |
}
|
| - |
|
730 |
return customRetailersMap;
|
| - |
|
731 |
}
|
| - |
|
732 |
|
| - |
|
733 |
|
| - |
|
734 |
|
| 718 |
}
|
735 |
}
|