| Line 23... |
Line 23... |
| 23 |
|
23 |
|
| 24 |
@Autowired
|
24 |
@Autowired
|
| 25 |
StateRepository stateRepository;
|
25 |
StateRepository stateRepository;
|
| 26 |
|
26 |
|
| 27 |
@Autowired
|
27 |
@Autowired
|
| 28 |
WareHouseAddressMappingRepository wareHouseAddressMappingRepository;
|
28 |
WarehouseAddressMappingRepository warehouseAddressMappingRepository;
|
| 29 |
|
29 |
|
| 30 |
@Autowired
|
30 |
@Autowired
|
| 31 |
WareHouseAddressMasterRepository wareHouseAddressMasterRepository;
|
31 |
WarehouseAddressMasterRepository warehouseAddressMasterRepository;
|
| 32 |
|
32 |
|
| 33 |
public CustomRetailer convertToSeller(String sellerPrefix) throws ProfitMandiBusinessException {
|
33 |
public CustomRetailer convertToSeller(String sellerPrefix) throws ProfitMandiBusinessException {
|
| 34 |
SellerWarehouse sellerWarehouse = sellerWarehouseRepository.selectByPrefix(sellerPrefix);
|
34 |
SellerWarehouse sellerWarehouse = sellerWarehouseRepository.selectByPrefix(sellerPrefix);
|
| 35 |
Seller sellerInfo = sellerRepository.selectById(sellerWarehouse.getSellerId());
|
35 |
Seller sellerInfo = sellerRepository.selectById(sellerWarehouse.getSellerId());
|
| 36 |
Organisation organisation = organisationRepository.selectById(sellerInfo.getOrganisationId());
|
36 |
Organisation organisation = organisationRepository.selectById(sellerInfo.getOrganisationId());
|
| 37 |
CustomRetailer customRetailer = new CustomRetailer();
|
37 |
CustomRetailer customRetailer = new CustomRetailer();
|
| 38 |
customRetailer.setBusinessName(organisation.getName());
|
38 |
customRetailer.setBusinessName(organisation.getName());
|
| 39 |
customRetailer.setGstNumber(sellerInfo.getGstin());
|
39 |
customRetailer.setGstNumber(sellerInfo.getGstin());
|
| 40 |
WarehouseAddressMapping warehouseAddressMapping = wareHouseAddressMappingRepository.selectByWarehouseId(sellerWarehouse.getWarehouseId());
|
40 |
WarehouseAddressMapping warehouseAddressMapping = warehouseAddressMappingRepository.selectByWarehouseId(sellerWarehouse.getWarehouseId());
|
| 41 |
WarehouseAddressMaster warehouseAddressMaster = wareHouseAddressMasterRepository.selectById(warehouseAddressMapping.getAddressId());
|
41 |
WarehouseAddressMaster warehouseAddressMaster = warehouseAddressMasterRepository.selectById(warehouseAddressMapping.getAddressId());
|
| 42 |
|
42 |
|
| 43 |
CustomAddress customAddress = new CustomAddress();
|
43 |
CustomAddress customAddress = new CustomAddress();
|
| 44 |
try {
|
44 |
try {
|
| 45 |
customAddress.setState(stateRepository.selectById(warehouseAddressMaster.getStateId()).getName());
|
45 |
customAddress.setState(stateRepository.selectById(warehouseAddressMaster.getStateId()).getName());
|
| 46 |
} catch (Exception e) {
|
46 |
} catch (Exception e) {
|