| Line 405... |
Line 405... |
| 405 |
} else {
|
405 |
} else {
|
| 406 |
retailer.setType(RetailerType.GSTIN);
|
406 |
retailer.setType(RetailerType.GSTIN);
|
| 407 |
}
|
407 |
}
|
| 408 |
if (updateRetailerRequest.getDocumentId() > 0) {
|
408 |
if (updateRetailerRequest.getDocumentId() > 0) {
|
| 409 |
if (retailer.getDocumentId() != null && retailer.getDocumentId() != updateRetailerRequest.getDocumentId()) {
|
409 |
if (retailer.getDocumentId() != null && retailer.getDocumentId() != updateRetailerRequest.getDocumentId()) {
|
| - |
|
410 |
try {
|
| 410 |
documentRepository.deleteById(retailer.getDocumentId());
|
411 |
documentRepository.deleteById(retailer.getDocumentId());
|
| - |
|
412 |
} catch(Exception e) {
|
| - |
|
413 |
e.printStackTrace();
|
| - |
|
414 |
}
|
| 411 |
}
|
415 |
}
|
| 412 |
retailer.setDocumentId(updateRetailerRequest.getDocumentId());
|
416 |
retailer.setDocumentId(updateRetailerRequest.getDocumentId());
|
| 413 |
documentRepository.markDocumentAsPersisted(updateRetailerRequest.getDocumentId());
|
417 |
documentRepository.markDocumentAsPersisted(updateRetailerRequest.getDocumentId());
|
| 414 |
}
|
418 |
}
|
| 415 |
retailerRepository.persist(retailer);
|
419 |
retailerRepository.persist(retailer);
|
| Line 566... |
Line 570... |
| 566 |
Address sameAsRetailerAddressValue) throws ProfitMandiBusinessException {
|
570 |
Address sameAsRetailerAddressValue) throws ProfitMandiBusinessException {
|
| 567 |
shop.setRetailerId(retailerId);
|
571 |
shop.setRetailerId(retailerId);
|
| 568 |
shop.setName(customShop.getName());
|
572 |
shop.setName(customShop.getName());
|
| 569 |
if (customShop.getDocumentId() > 0) {
|
573 |
if (customShop.getDocumentId() > 0) {
|
| 570 |
if (shop.getDocumentId() != null && shop.getDocumentId() != customShop.getDocumentId()) {
|
574 |
if (shop.getDocumentId() != null && shop.getDocumentId() != customShop.getDocumentId()) {
|
| - |
|
575 |
try {
|
| 571 |
documentRepository.deleteById(shop.getDocumentId());
|
576 |
documentRepository.deleteById(shop.getDocumentId());
|
| - |
|
577 |
} catch(Exception e) {
|
| - |
|
578 |
e.printStackTrace();
|
| - |
|
579 |
}
|
| 572 |
}
|
580 |
}
|
| 573 |
shop.setDocumentId(customShop.getDocumentId());
|
581 |
shop.setDocumentId(customShop.getDocumentId());
|
| 574 |
documentRepository.markDocumentAsPersisted(customShop.getDocumentId());
|
582 |
documentRepository.markDocumentAsPersisted(customShop.getDocumentId());
|
| 575 |
}
|
583 |
}
|
| 576 |
if (shop.getAddressId() == null) {
|
584 |
if (shop.getAddressId() == null) {
|