| Line 28... |
Line 28... |
| 28 |
import com.spice.profitmandi.common.services.ContentPojoPopulator;
|
28 |
import com.spice.profitmandi.common.services.ContentPojoPopulator;
|
| 29 |
import com.spice.profitmandi.common.services.ContentServingService;
|
29 |
import com.spice.profitmandi.common.services.ContentServingService;
|
| 30 |
import com.spice.profitmandi.common.services.LogisticsService;
|
30 |
import com.spice.profitmandi.common.services.LogisticsService;
|
| 31 |
import com.spice.profitmandi.common.util.Utils;
|
31 |
import com.spice.profitmandi.common.util.Utils;
|
| 32 |
import com.spice.profitmandi.dao.entity.UserAccounts;
|
32 |
import com.spice.profitmandi.dao.entity.UserAccounts;
|
| 33 |
import com.spice.profitmandi.dao.enumeration.AccountType;
|
33 |
import com.spice.profitmandi.dao.enumuration.AccountType;
|
| 34 |
import com.spice.profitmandi.dao.model.ProductPojo;
|
34 |
import com.spice.profitmandi.dao.model.ProductPojo;
|
| 35 |
import com.spice.profitmandi.dao.repository.UserAccountRepository;
|
35 |
import com.spice.profitmandi.dao.repository.UserAccountRepository;
|
| 36 |
import com.spice.profitmandi.thrift.clients.UserClient;
|
36 |
import com.spice.profitmandi.thrift.clients.UserClient;
|
| 37 |
import com.spice.profitmandi.web.model.ProfitMandiResponse;
|
37 |
import com.spice.profitmandi.web.model.ProfitMandiResponse;
|
| 38 |
import com.spice.profitmandi.web.model.ResponseStatus;
|
38 |
import com.spice.profitmandi.web.model.ResponseStatus;
|
| Line 84... |
Line 84... |
| 84 |
}
|
84 |
}
|
| 85 |
Client userClient = null;
|
85 |
Client userClient = null;
|
| 86 |
try {
|
86 |
try {
|
| 87 |
userClient = new UserClient().getClient();
|
87 |
userClient = new UserClient().getClient();
|
| 88 |
userClient.addItemsToCart(Integer.valueOf(userAccount.getAccount_key()), itemQuantities, null);
|
88 |
userClient.addItemsToCart(Integer.valueOf(userAccount.getAccount_key()), itemQuantities, null);
|
| 89 |
} catch (TException e) {
|
89 |
} catch (Exception e) {
|
| 90 |
vc = new ValidateCartResponse(null, "Error","Problem occurred while updating cart");
|
90 |
vc = new ValidateCartResponse(null, "Error","Problem occurred while updating cart");
|
| 91 |
final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, vc);
|
91 |
final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, vc);
|
| 92 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
|
92 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
|
| 93 |
}
|
93 |
}
|
| 94 |
String cartString=null;
|
94 |
String cartString=null;
|
| 95 |
try {
|
95 |
try {
|
| 96 |
cartString = userClient.validateCartNew(Integer.valueOf(userAccount.getAccount_key()), "110002", -1);
|
96 |
cartString = userClient.validateCartNew(Integer.valueOf(userAccount.getAccount_key()), "110002", -1);
|
| 97 |
} catch (NumberFormatException|TException e) {
|
97 |
} catch (Exception e) {
|
| 98 |
// TODO Auto-generated catch block
|
98 |
// TODO Auto-generated catch block
|
| 99 |
e.printStackTrace();
|
99 |
e.printStackTrace();
|
| 100 |
vc = new ValidateCartResponse(null, "Error","Problem occurred while validating cart");
|
100 |
vc = new ValidateCartResponse(null, "Error","Problem occurred while validating cart");
|
| 101 |
final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, vc);
|
101 |
final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, vc);
|
| 102 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
|
102 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
|