| Line 28... |
Line 28... |
| 28 |
import com.spice.profitmandi.dao.entity.dtr.Shop;
|
28 |
import com.spice.profitmandi.dao.entity.dtr.Shop;
|
| 29 |
import com.spice.profitmandi.dao.entity.dtr.ShopAddress;
|
29 |
import com.spice.profitmandi.dao.entity.dtr.ShopAddress;
|
| 30 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
30 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| 31 |
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
|
31 |
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
|
| 32 |
import com.spice.profitmandi.dao.entity.dtr.UserRole;
|
32 |
import com.spice.profitmandi.dao.entity.dtr.UserRole;
|
| - |
|
33 |
import com.spice.profitmandi.dao.entity.fofo.FofoPartnerPaymentOption;
|
| - |
|
34 |
import com.spice.profitmandi.dao.entity.fofo.PaymentOption;
|
| 33 |
import com.spice.profitmandi.dao.entity.user.Address;
|
35 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 34 |
import com.spice.profitmandi.dao.entity.user.Cart;
|
36 |
import com.spice.profitmandi.dao.entity.user.Cart;
|
| 35 |
import com.spice.profitmandi.dao.entity.user.Counter;
|
37 |
import com.spice.profitmandi.dao.entity.user.Counter;
|
| 36 |
import com.spice.profitmandi.dao.entity.user.PrivateDealUser;
|
38 |
import com.spice.profitmandi.dao.entity.user.PrivateDealUser;
|
| 37 |
import com.spice.profitmandi.dao.entity.user.PrivateDealUserAddressMapping;
|
39 |
import com.spice.profitmandi.dao.entity.user.PrivateDealUserAddressMapping;
|
| 38 |
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
|
40 |
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
|
| 39 |
import com.spice.profitmandi.dao.enumuration.dtr.RetailerType;
|
41 |
import com.spice.profitmandi.dao.enumuration.dtr.RetailerType;
|
| 40 |
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
|
42 |
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
|
| - |
|
43 |
import com.spice.profitmandi.dao.enumuration.fofo.PaymentOptionType;
|
| 41 |
import com.spice.profitmandi.dao.repository.dtr.DocumentRepository;
|
44 |
import com.spice.profitmandi.dao.repository.dtr.DocumentRepository;
|
| 42 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
45 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| 43 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRegisteredAddressRepository;
|
46 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRegisteredAddressRepository;
|
| 44 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
|
47 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
|
| 45 |
import com.spice.profitmandi.dao.repository.dtr.ShopAddressRepository;
|
48 |
import com.spice.profitmandi.dao.repository.dtr.ShopAddressRepository;
|
| 46 |
import com.spice.profitmandi.dao.repository.dtr.ShopRepository;
|
49 |
import com.spice.profitmandi.dao.repository.dtr.ShopRepository;
|
| 47 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
50 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
| 48 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
51 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
| 49 |
import com.spice.profitmandi.dao.repository.dtr.UserRoleRepository;
|
52 |
import com.spice.profitmandi.dao.repository.dtr.UserRoleRepository;
|
| - |
|
53 |
import com.spice.profitmandi.dao.repository.fofo.FofoPartnerPaymentOptionRepository;
|
| - |
|
54 |
import com.spice.profitmandi.dao.repository.fofo.PaymentOptionRepository;
|
| 50 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
55 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 51 |
import com.spice.profitmandi.dao.repository.user.CartRepository;
|
56 |
import com.spice.profitmandi.dao.repository.user.CartRepository;
|
| 52 |
import com.spice.profitmandi.dao.repository.user.CounterRepository;
|
57 |
import com.spice.profitmandi.dao.repository.user.CounterRepository;
|
| 53 |
import com.spice.profitmandi.dao.repository.user.PrivateDealUserAddressMappingRepository;
|
58 |
import com.spice.profitmandi.dao.repository.user.PrivateDealUserAddressMappingRepository;
|
| 54 |
import com.spice.profitmandi.dao.repository.user.PrivateDealUserRepository;
|
59 |
import com.spice.profitmandi.dao.repository.user.PrivateDealUserRepository;
|
| Line 99... |
Line 104... |
| 99 |
|
104 |
|
| 100 |
@Autowired
|
105 |
@Autowired
|
| 101 |
private ShopAddressRepository shopAddressRepository;
|
106 |
private ShopAddressRepository shopAddressRepository;
|
| 102 |
|
107 |
|
| 103 |
@Autowired
|
108 |
@Autowired
|
| - |
|
109 |
private FofoPartnerPaymentOptionRepository fofoPartnerPaymentOptionRepository;
|
| - |
|
110 |
|
| - |
|
111 |
@Autowired
|
| - |
|
112 |
private PaymentOptionRepository paymentOptionRepository;
|
| - |
|
113 |
|
| - |
|
114 |
@Autowired
|
| 104 |
private Mongo mongoClient;
|
115 |
private Mongo mongoClient;
|
| 105 |
|
116 |
|
| 106 |
|
117 |
|
| 107 |
private static final Logger LOGGER = LoggerFactory.getLogger(MigrationUtil.class);
|
118 |
private static final Logger LOGGER = LoggerFactory.getLogger(MigrationUtil.class);
|
| 108 |
|
119 |
|
| Line 408... |
Line 419... |
| 408 |
fofoRole.setRoleType(RoleType.FOFO);
|
419 |
fofoRole.setRoleType(RoleType.FOFO);
|
| 409 |
fofoRole.setUserId(user.getId());
|
420 |
fofoRole.setUserId(user.getId());
|
| 410 |
userRoleRepository.persist(fofoRole);
|
421 |
userRoleRepository.persist(fofoRole);
|
| 411 |
}
|
422 |
}
|
| 412 |
|
423 |
|
| - |
|
424 |
List<Integer> paymentOptionIds = fofoPartnerPaymentOptionRepository.selectPaymentOptionIdsByFofoId(retailer.getId());
|
| - |
|
425 |
if(paymentOptionIds.isEmpty()){
|
| - |
|
426 |
PaymentOption paymentOption = null;
|
| - |
|
427 |
try{
|
| - |
|
428 |
paymentOption = paymentOptionRepository.selectByName(PaymentOptionType.CASH.toString());
|
| - |
|
429 |
}catch(ProfitMandiBusinessException profitMandiBusinessException){
|
| - |
|
430 |
paymentOption = new PaymentOption();
|
| - |
|
431 |
paymentOption.setName(PaymentOptionType.CASH.toString());
|
| - |
|
432 |
paymentOptionRepository.persist(paymentOption);
|
| - |
|
433 |
}
|
| - |
|
434 |
FofoPartnerPaymentOption fofoPartnerPaymentOption = new FofoPartnerPaymentOption();
|
| - |
|
435 |
fofoPartnerPaymentOption.setFofoId(retailer.getId());
|
| - |
|
436 |
fofoPartnerPaymentOption.setPaymentOptionId(paymentOption.getId());
|
| - |
|
437 |
fofoPartnerPaymentOptionRepository.persist(fofoPartnerPaymentOption);
|
| - |
|
438 |
}
|
| - |
|
439 |
|
| 413 |
if(foundRetailer){
|
440 |
if(foundRetailer){
|
| 414 |
LOGGER.info("\n\n\n****retailer found\n\n\n");
|
441 |
LOGGER.info("\n\n\n****retailer found\n\n\n");
|
| 415 |
PrivateDealUser privateDealUser = null;
|
442 |
PrivateDealUser privateDealUser = null;
|
| 416 |
try{
|
443 |
try{
|
| 417 |
privateDealUser = privateDealUserRepository.selectById(saholicUser.getId());
|
444 |
privateDealUser = privateDealUserRepository.selectById(saholicUser.getId());
|