Subversion Repositories SmartDukaan

Rev

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

Rev 22069 Rev 22139
Line 40... Line 40...
40
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
40
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
41
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
41
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
42
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
42
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
43
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
43
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
44
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
44
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
45
import com.spice.profitmandi.web.model.FofoDetails;
45
import com.spice.profitmandi.web.model.LoginDetails;
46
import com.spice.profitmandi.web.response.ValidateCart;
46
import com.spice.profitmandi.web.response.ValidateCart;
47
import com.spice.profitmandi.web.util.CookiesProcessor;
47
import com.spice.profitmandi.web.util.CookiesProcessor;
48
import com.spice.profitmandi.web.util.MVCResponseSender;
48
import com.spice.profitmandi.web.util.MVCResponseSender;
49
 
49
 
50
@Controller
50
@Controller
Line 82... Line 82...
82
	private String webapp;
82
	private String webapp;
83
 
83
 
84
	
84
	
85
	@RequestMapping(value = "/getCurrentInventorySnapshot")
85
	@RequestMapping(value = "/getCurrentInventorySnapshot")
86
	public String getCurrentAvailability(HttpServletRequest request,@RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit , @RequestParam(name = "searchTerm", required=false, defaultValue="") String searchTerm ,Model model) throws Exception{
86
	public String getCurrentAvailability(HttpServletRequest request,@RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit , @RequestParam(name = "searchTerm", required=false, defaultValue="") String searchTerm ,Model model) throws Exception{
87
		FofoDetails fofoDetails;
87
		LoginDetails fofoDetails;
88
		try {
88
		try {
89
			fofoDetails = cookiesProcessor.getCookiesObject(request);
89
			fofoDetails = cookiesProcessor.getCookiesObject(request);
90
		} catch (ProfitMandiBusinessException e) {
90
		} catch (ProfitMandiBusinessException e) {
91
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
91
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
92
			return "response";
92
			return "response";
Line 106... Line 106...
106
		return "inventory-snapshot";
106
		return "inventory-snapshot";
107
	}
107
	}
108
 
108
 
109
	@RequestMapping(value = "/getBadInventorySnapshot")
109
	@RequestMapping(value = "/getBadInventorySnapshot")
110
	public String getBadAvailability(HttpServletRequest request,@RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit , @RequestParam(name = "searchTerm", required=false, defaultValue="") String searchTerm ,Model model) throws Exception{
110
	public String getBadAvailability(HttpServletRequest request,@RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit , @RequestParam(name = "searchTerm", required=false, defaultValue="") String searchTerm ,Model model) throws Exception{
111
		FofoDetails fofoDetails;
111
		LoginDetails fofoDetails;
112
		try {
112
		try {
113
			fofoDetails = cookiesProcessor.getCookiesObject(request);
113
			fofoDetails = cookiesProcessor.getCookiesObject(request);
114
		} catch (ProfitMandiBusinessException e) {
114
		} catch (ProfitMandiBusinessException e) {
115
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
115
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
116
			return "response";
116
			return "response";
Line 120... Line 120...
120
		return "bad-inventory-snapshot";
120
		return "bad-inventory-snapshot";
121
	}
121
	}
122
 
122
 
123
	@RequestMapping(value = "/getPaginatedCurrentInventorySnapshot")
123
	@RequestMapping(value = "/getPaginatedCurrentInventorySnapshot")
124
	public String getCurrentAvailabilityPaginated(HttpServletRequest request,@RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit, @RequestParam(name = "searchTerm", required=false, defaultValue="") String searchTerm , Model model) throws Exception{
124
	public String getCurrentAvailabilityPaginated(HttpServletRequest request,@RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit, @RequestParam(name = "searchTerm", required=false, defaultValue="") String searchTerm , Model model) throws Exception{
125
		FofoDetails fofoDetails;
125
		LoginDetails fofoDetails;
126
		try {
126
		try {
127
			fofoDetails = cookiesProcessor.getCookiesObject(request);
127
			fofoDetails = cookiesProcessor.getCookiesObject(request);
128
		} catch (ProfitMandiBusinessException e) {
128
		} catch (ProfitMandiBusinessException e) {
129
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
129
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
130
			return "response";
130
			return "response";
Line 134... Line 134...
134
		return "inventory-snapshot-paginated";
134
		return "inventory-snapshot-paginated";
135
	}
135
	}
136
	
136
	
137
	@RequestMapping(value = "/getCatalog")
137
	@RequestMapping(value = "/getCatalog")
138
	public String getCatalog(HttpServletRequest request,@RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit , @RequestParam(name = "searchTerm", required=false, defaultValue="") String searchTerm ,Model model) throws Exception{
138
	public String getCatalog(HttpServletRequest request,@RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit , @RequestParam(name = "searchTerm", required=false, defaultValue="") String searchTerm ,Model model) throws Exception{
139
		FofoDetails fofoDetails;
139
		LoginDetails fofoDetails;
140
		try {
140
		try {
141
			fofoDetails = cookiesProcessor.getCookiesObject(request);
141
			fofoDetails = cookiesProcessor.getCookiesObject(request);
142
		} catch (ProfitMandiBusinessException e) {
142
		} catch (ProfitMandiBusinessException e) {
143
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
143
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
144
			return "response";
144
			return "response";
Line 158... Line 158...
158
		return "catalog";
158
		return "catalog";
159
	}
159
	}
160
	
160
	
161
	@RequestMapping(value = "/getPaginatedCatalog")
161
	@RequestMapping(value = "/getPaginatedCatalog")
162
	public String getCatalogPaginated(HttpServletRequest request,@RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit, @RequestParam(name = "searchTerm", required=false, defaultValue="") String searchTerm , Model model) throws Exception{
162
	public String getCatalogPaginated(HttpServletRequest request,@RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit, @RequestParam(name = "searchTerm", required=false, defaultValue="") String searchTerm , Model model) throws Exception{
163
		FofoDetails fofoDetails;
163
		LoginDetails fofoDetails;
164
		try {
164
		try {
165
			fofoDetails = cookiesProcessor.getCookiesObject(request);
165
			fofoDetails = cookiesProcessor.getCookiesObject(request);
166
		} catch (ProfitMandiBusinessException e) {
166
		} catch (ProfitMandiBusinessException e) {
167
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
167
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
168
			return "response";
168
			return "response";
Line 200... Line 200...
200
		currentInventorySnapshot.setIconUrl(Utils.getIconUrl(currentInventorySnapshot.getCatalogItemId(), host, port, webapp));
200
		currentInventorySnapshot.setIconUrl(Utils.getIconUrl(currentInventorySnapshot.getCatalogItemId(), host, port, webapp));
201
		return currentInventorySnapshot;
201
		return currentInventorySnapshot;
202
	}
202
	}
203
	@RequestMapping(value = "/checkItemAvailability")
203
	@RequestMapping(value = "/checkItemAvailability")
204
	public String getItemAvailability(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.ITEM_ID) int itemId, Model model) throws Exception{
204
	public String getItemAvailability(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.ITEM_ID) int itemId, Model model) throws Exception{
205
		FofoDetails fofoDetails;
205
		LoginDetails fofoDetails;
206
		try {
206
		try {
207
			fofoDetails = cookiesProcessor.getCookiesObject(request);
207
			fofoDetails = cookiesProcessor.getCookiesObject(request);
208
		} catch (ProfitMandiBusinessException e) {
208
		} catch (ProfitMandiBusinessException e) {
209
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
209
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
210
			return "response";
210
			return "response";
Line 222... Line 222...
222
		}
222
		}
223
	}
223
	}
224
	
224
	
225
	@RequestMapping(value = "/cart")
225
	@RequestMapping(value = "/cart")
226
	public String addToCart(HttpServletRequest request, @RequestParam(name = "cartData") String cartData, Model model) throws Exception{
226
	public String addToCart(HttpServletRequest request, @RequestParam(name = "cartData") String cartData, Model model) throws Exception{
227
		FofoDetails fofoDetails;
227
		LoginDetails fofoDetails;
228
		try {
228
		try {
229
			fofoDetails = cookiesProcessor.getCookiesObject(request);
229
			fofoDetails = cookiesProcessor.getCookiesObject(request);
230
		} catch (ProfitMandiBusinessException e) {
230
		} catch (ProfitMandiBusinessException e) {
231
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
231
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
232
			return "response";
232
			return "response";
Line 276... Line 276...
276
		return "cart";
276
		return "cart";
277
	}
277
	}
278
	
278
	
279
	@RequestMapping(value = "/validate-cart")
279
	@RequestMapping(value = "/validate-cart")
280
	public String validateCart(HttpServletRequest request, HttpServletResponse response,@RequestParam(name = "cartData") String cartData, Model model) throws Exception{
280
	public String validateCart(HttpServletRequest request, HttpServletResponse response,@RequestParam(name = "cartData") String cartData, Model model) throws Exception{
281
		FofoDetails fofoDetails = null;
281
		LoginDetails fofoDetails = null;
282
		try {
282
		try {
283
			fofoDetails = cookiesProcessor.getCookiesObject(request);
283
			fofoDetails = cookiesProcessor.getCookiesObject(request);
284
		} catch (ProfitMandiBusinessException e) {
284
		} catch (ProfitMandiBusinessException e) {
285
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
285
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
286
			return "response";
286
			return "response";
Line 335... Line 335...
335
		return "validate-cart";
335
		return "validate-cart";
336
	}
336
	}
337
 
337
 
338
	@RequestMapping(value = "/grnHistory")
338
	@RequestMapping(value = "/grnHistory")
339
	public String grnHistoryByFofoId(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.START_TIME, required = false) String startTimeString, @RequestParam(name = ProfitMandiConstants.END_TIME, required = false) String endTimeString, @RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit, @RequestParam(name = ProfitMandiConstants.PURCHASE_REFERENCE,defaultValue="") String purchaseReference, @RequestParam(name = "searchType",defaultValue="") String searchType,Model model) throws Exception{
339
	public String grnHistoryByFofoId(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.START_TIME, required = false) String startTimeString, @RequestParam(name = ProfitMandiConstants.END_TIME, required = false) String endTimeString, @RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit, @RequestParam(name = ProfitMandiConstants.PURCHASE_REFERENCE,defaultValue="") String purchaseReference, @RequestParam(name = "searchType",defaultValue="") String searchType,Model model) throws Exception{
340
		FofoDetails fofoDetails;
340
		LoginDetails fofoDetails;
341
		try {
341
		try {
342
			fofoDetails = cookiesProcessor.getCookiesObject(request);
342
			fofoDetails = cookiesProcessor.getCookiesObject(request);
343
		} catch (ProfitMandiBusinessException e) {
343
		} catch (ProfitMandiBusinessException e) {
344
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
344
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
345
			return "response";
345
			return "response";
Line 379... Line 379...
379
		return "grn-history";
379
		return "grn-history";
380
	}
380
	}
381
 
381
 
382
	@RequestMapping(value = "/getPaginatedGrnHistory")
382
	@RequestMapping(value = "/getPaginatedGrnHistory")
383
	public String getGrnHistoryPaginated(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.START_TIME, required = false) String startTimeString, @RequestParam(name = ProfitMandiConstants.END_TIME, required = false) String endTimeString, @RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit, @RequestParam(name = ProfitMandiConstants.PURCHASE_REFERENCE,defaultValue="") String purchaseReference, @RequestParam(name = "searchType",defaultValue="") String searchType,Model model) throws Exception{
383
	public String getGrnHistoryPaginated(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.START_TIME, required = false) String startTimeString, @RequestParam(name = ProfitMandiConstants.END_TIME, required = false) String endTimeString, @RequestParam(name = "offset",defaultValue="0") int offset, @RequestParam(name = "limit", defaultValue="10") int limit, @RequestParam(name = ProfitMandiConstants.PURCHASE_REFERENCE,defaultValue="") String purchaseReference, @RequestParam(name = "searchType",defaultValue="") String searchType,Model model) throws Exception{
384
		FofoDetails fofoDetails;
384
		LoginDetails fofoDetails;
385
		try {
385
		try {
386
			fofoDetails = cookiesProcessor.getCookiesObject(request);
386
			fofoDetails = cookiesProcessor.getCookiesObject(request);
387
		} catch (ProfitMandiBusinessException e) {
387
		} catch (ProfitMandiBusinessException e) {
388
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
388
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
389
			return "response";
389
			return "response";
Line 396... Line 396...
396
		return "grn-history-paginated";
396
		return "grn-history-paginated";
397
	}
397
	}
398
 
398
 
399
	@RequestMapping(value = "/grnHistoryDetailByPurchaseId")
399
	@RequestMapping(value = "/grnHistoryDetailByPurchaseId")
400
	public String grnHistoryByPurchaseId(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.PURCHASE_ID) int purchaseId, Model model) throws Exception{
400
	public String grnHistoryByPurchaseId(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.PURCHASE_ID) int purchaseId, Model model) throws Exception{
401
		FofoDetails fofoDetails;
401
		LoginDetails fofoDetails;
402
		try {
402
		try {
403
			fofoDetails = cookiesProcessor.getCookiesObject(request);
403
			fofoDetails = cookiesProcessor.getCookiesObject(request);
404
		} catch (ProfitMandiBusinessException e) {
404
		} catch (ProfitMandiBusinessException e) {
405
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
405
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
406
			return "response";
406
			return "response";
Line 417... Line 417...
417
		return "grn-details";
417
		return "grn-details";
418
	}
418
	}
419
 
419
 
420
	@RequestMapping(value = "/grnHistoryDetailByPurchaseReference")
420
	@RequestMapping(value = "/grnHistoryDetailByPurchaseReference")
421
	public String grnHistoryByPurchaseReference(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.PURCHASE_REFERENCE) String purchaseReference, Model model) throws Exception{
421
	public String grnHistoryByPurchaseReference(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.PURCHASE_REFERENCE) String purchaseReference, Model model) throws Exception{
422
		FofoDetails fofoDetails;
422
		LoginDetails fofoDetails;
423
		try {
423
		try {
424
			fofoDetails = cookiesProcessor.getCookiesObject(request);
424
			fofoDetails = cookiesProcessor.getCookiesObject(request);
425
		} catch (ProfitMandiBusinessException e) {
425
		} catch (ProfitMandiBusinessException e) {
426
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
426
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
427
			return "response";
427
			return "response";