| Line 28... |
Line 28... |
| 28 |
import com.spice.profitmandi.common.util.Utils;
|
28 |
import com.spice.profitmandi.common.util.Utils;
|
| 29 |
import com.spice.profitmandi.common.web.client.RestClient;
|
29 |
import com.spice.profitmandi.common.web.client.RestClient;
|
| 30 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
30 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 31 |
import com.spice.profitmandi.dao.entity.dtr.SocialUser;
|
31 |
import com.spice.profitmandi.dao.entity.dtr.SocialUser;
|
| 32 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
32 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| - |
|
33 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 33 |
import com.spice.profitmandi.dao.entity.user.Promoter;
|
34 |
import com.spice.profitmandi.dao.entity.user.Promoter;
|
| 34 |
import com.spice.profitmandi.dao.enumuration.dtr.Gender;
|
35 |
import com.spice.profitmandi.dao.enumuration.dtr.Gender;
|
| 35 |
import com.spice.profitmandi.dao.enumuration.dtr.SocialType;
|
36 |
import com.spice.profitmandi.dao.enumuration.dtr.SocialType;
|
| 36 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
37 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 37 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
38 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| - |
|
39 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 38 |
import com.spice.profitmandi.dao.repository.dtr.SocialUserRepository;
|
40 |
import com.spice.profitmandi.dao.repository.dtr.SocialUserRepository;
|
| 39 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
41 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
| 40 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
42 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
| 41 |
import com.spice.profitmandi.dao.repository.dtr.UserRoleRepository;
|
43 |
import com.spice.profitmandi.dao.repository.dtr.UserRoleRepository;
|
| 42 |
import com.spice.profitmandi.dao.repository.user.PromoterRepository;
|
44 |
import com.spice.profitmandi.dao.repository.user.PromoterRepository;
|
| Line 78... |
Line 80... |
| 78 |
|
80 |
|
| 79 |
@Autowired
|
81 |
@Autowired
|
| 80 |
private UserAccountRepository userAccountRepository;
|
82 |
private UserAccountRepository userAccountRepository;
|
| 81 |
|
83 |
|
| 82 |
@Autowired
|
84 |
@Autowired
|
| - |
|
85 |
private FofoStoreRepository fofoStoreRepository;
|
| - |
|
86 |
|
| - |
|
87 |
@Autowired
|
| 83 |
private CsService csService;
|
88 |
private CsService csService;
|
| 84 |
|
89 |
|
| 85 |
@Autowired
|
90 |
@Autowired
|
| 86 |
private RestClient restClient;
|
91 |
private RestClient restClient;
|
| 87 |
@Autowired
|
92 |
@Autowired
|
| Line 173... |
Line 178... |
| 173 |
LOGGER.info("173 - Auth User Email {}, Retailer Id - {}", authUser.getName(), retailerId);
|
178 |
LOGGER.info("173 - Auth User Email {}, Retailer Id - {}", authUser.getName(), retailerId);
|
| 174 |
} catch (Exception e) {
|
179 |
} catch (Exception e) {
|
| 175 |
Set<Integer> authUserPartnerSet = csService.getAuthUserPartnerIdMapping().get(authUser.getEmailId());
|
180 |
Set<Integer> authUserPartnerSet = csService.getAuthUserPartnerIdMapping().get(authUser.getEmailId());
|
| 176 |
if(authUserPartnerSet.size() > 0) {
|
181 |
if(authUserPartnerSet.size() > 0) {
|
| 177 |
retailerId = authUserPartnerSet.stream().findFirst().get();
|
182 |
retailerId = authUserPartnerSet.stream().findFirst().get();
|
| - |
|
183 |
FofoStore fs = fofoStoreRepository.selectByRetailerId(retailerId);
|
| - |
|
184 |
retailerId = ProfitMandiConstants.WAREHOUSE_NSSPL_PARTNER_MAP.get(fs.getWarehouseId());
|
| 178 |
LOGGER.info("178 - Auth User Email {}, Retailer Id - {}", socialUser.getEmailId(), retailerId);
|
185 |
LOGGER.info("178 - Auth User Email {}, Retailer Id - {}", socialUser.getEmailId(), retailerId);
|
| 179 |
} else {
|
186 |
} else {
|
| 180 |
com.spice.profitmandi.dao.entity.user.User user = userUserRepository.selectByEmailId(Utils.SYSTEM_PARTNER);
|
187 |
com.spice.profitmandi.dao.entity.user.User user = userUserRepository.selectByEmailId(Utils.SYSTEM_PARTNER);
|
| 181 |
retailerId = user.getId();
|
188 |
retailerId = user.getId();
|
| 182 |
LOGGER.info("Auth User Email {}, Retailer Id - {}", socialUser.getEmailId(), retailerId);
|
189 |
LOGGER.info("Auth User Email {}, Retailer Id - {}", socialUser.getEmailId(), retailerId);
|