| Line 161... |
Line 161... |
| 161 |
shop.setRetailerId(retailer.getId());
|
161 |
shop.setRetailerId(retailer.getId());
|
| 162 |
shopRepository.persist(shop);
|
162 |
shopRepository.persist(shop);
|
| 163 |
this.addBrandWithRetailer(retailer.getId(), createRetailerRequest.getCategories());
|
163 |
this.addBrandWithRetailer(retailer.getId(), createRetailerRequest.getCategories());
|
| 164 |
final Address addressRetailer = this.createAddress(createRetailerRequest.getAddress());
|
164 |
final Address addressRetailer = this.createAddress(createRetailerRequest.getAddress());
|
| 165 |
addressRetailer.setRetaierId(retailer.getId());
|
165 |
addressRetailer.setRetaierId(retailer.getId());
|
| 166 |
|
- |
|
| 167 |
if(!addressRepository.isExist(addressRetailer)){
|
- |
|
| 168 |
addressRepository.persist(addressRetailer);
|
166 |
addressRepository.persist(addressRetailer);
|
| 169 |
}
|
- |
|
| 170 |
final RetailerRegisteredAddress retailerRegisteredAddress = new RetailerRegisteredAddress();
|
167 |
final RetailerRegisteredAddress retailerRegisteredAddress = new RetailerRegisteredAddress();
|
| 171 |
retailerRegisteredAddress.setRetailerId(retailer.getId());
|
168 |
retailerRegisteredAddress.setRetailerId(retailer.getId());
|
| 172 |
retailerRegisteredAddress.setAddressId(addressRetailer.getId());
|
169 |
retailerRegisteredAddress.setAddressId(addressRetailer.getId());
|
| 173 |
retailerRegisteredAddressRepository.persist(retailerRegisteredAddress);
|
170 |
retailerRegisteredAddressRepository.persist(retailerRegisteredAddress);
|
| 174 |
if(!createRetailerRequest.isShopAddressSameAsRetailerAddress() && createRetailerRequest.getAddress() == null){
|
171 |
if(!createRetailerRequest.isShopAddressSameAsRetailerAddress() && createRetailerRequest.getAddress() == null){
|
| Line 179... |
Line 176... |
| 179 |
shopAddress.setShopId(shop.getId());
|
176 |
shopAddress.setShopId(shop.getId());
|
| 180 |
shopAddress.setAddressId(addressRetailer.getId());
|
177 |
shopAddress.setAddressId(addressRetailer.getId());
|
| 181 |
shopAddressRepository.persist(shopAddress);
|
178 |
shopAddressRepository.persist(shopAddress);
|
| 182 |
}else{
|
179 |
}else{
|
| 183 |
final Address addressShop = this.createAddress(createRetailerRequest.getShop().getAddress());
|
180 |
final Address addressShop = this.createAddress(createRetailerRequest.getShop().getAddress());
|
| 184 |
if(!addressRepository.isExist(addressShop)){
|
- |
|
| 185 |
addressRepository.persist(addressShop);
|
181 |
addressRepository.persist(addressShop);
|
| 186 |
}
|
- |
|
| 187 |
ShopAddress shopAddress = new ShopAddress();
|
182 |
ShopAddress shopAddress = new ShopAddress();
|
| 188 |
shopAddress.setShopId(shop.getId());
|
183 |
shopAddress.setShopId(shop.getId());
|
| 189 |
shopAddress.setAddressId(addressShop.getId());
|
184 |
shopAddress.setAddressId(addressShop.getId());
|
| 190 |
shopAddressRepository.persist(shopAddress);
|
185 |
shopAddressRepository.persist(shopAddress);
|
| 191 |
}
|
186 |
}
|