Subversion Repositories SmartDukaan

Rev

Rev 23360 | Rev 23959 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23360 Rev 23568
Line 8... Line 8...
8
 
8
 
9
import org.apache.thrift.TException;
9
import org.apache.thrift.TException;
10
import org.json.JSONArray;
10
import org.json.JSONArray;
11
import org.json.JSONException;
11
import org.json.JSONException;
12
import org.json.JSONObject;
12
import org.json.JSONObject;
13
import org.slf4j.Logger;
13
import org.apache.logging.log4j.Logger;
14
import org.slf4j.LoggerFactory;
14
import org.apache.logging.log4j.LogManager;
15
import org.springframework.beans.factory.annotation.Autowired;
15
import org.springframework.beans.factory.annotation.Autowired;
16
import org.springframework.http.MediaType;
16
import org.springframework.http.MediaType;
17
import org.springframework.http.ResponseEntity;
17
import org.springframework.http.ResponseEntity;
18
import org.springframework.stereotype.Controller;
18
import org.springframework.stereotype.Controller;
19
import org.springframework.transaction.annotation.Transactional;
19
import org.springframework.transaction.annotation.Transactional;
Line 50... Line 50...
50
 
50
 
51
@Controller
51
@Controller
52
@Transactional(rollbackFor=Throwable.class)
52
@Transactional(rollbackFor=Throwable.class)
53
public class CartController {
53
public class CartController {
54
 
54
 
55
	private static final Logger logger=LoggerFactory.getLogger(CartController.class);
55
	private static final Logger logger=LogManager.getLogger(CartController.class);
56
	
56
	
57
	@Autowired
57
	@Autowired
58
	private ResponseSender<?> responseSender;
58
	private ResponseSender<?> responseSender;
59
 
59
 
60
	@Autowired
60
	@Autowired
Line 77... Line 77...
77
		UserAccount userAccount = null;
77
		UserAccount userAccount = null;
78
		ValidateCartResponse vc = null;
78
		ValidateCartResponse vc = null;
79
		int userId = (int)request.getAttribute("userId");
79
		int userId = (int)request.getAttribute("userId");
80
		
80
		
81
		userAccount = userAccountRepository.selectByUserIdType(userId, AccountType.cartId);
81
		userAccount = userAccountRepository.selectByUserIdType(userId, AccountType.cartId);
82
		logger.info("UserAccount "+userAccount);
82
		logger.info("UserAccount................."+userAccount);
83
 
83
 
84
		List<ItemQuantity> itemQuantities = new ArrayList<ItemQuantity>();
84
		List<ItemQuantity> itemQuantities = new ArrayList<ItemQuantity>();
85
		CartItems[] cartItems = cartRequest.getCartItems();
85
		CartItems[] cartItems = cartRequest.getCartItems();
86
		List<Integer> itemsList = new ArrayList<Integer>();
86
		List<Integer> itemsList = new ArrayList<Integer>();
87
		for (CartItems ci: cartItems){
87
		for (CartItems ci: cartItems){