Subversion Repositories SmartDukaan

Rev

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

Rev 23587 Rev 23592
Line 385... Line 385...
385
	@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_SUMMARY , method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
385
	@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_SUMMARY , method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
386
	@ApiImplicitParams({
386
	@ApiImplicitParams({
387
		@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", 
387
		@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", 
388
				required = true, dataType = "string", paramType = "header")
388
				required = true, dataType = "string", paramType = "header")
389
	})
389
	})
390
	public ResponseEntity<?>rechargeSummary (HttpServletRequest request ,@RequestParam(name = ProfitMandiConstants.RECHARGE_TYPE) String rechargeTypeString, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit)
390
	public ResponseEntity<?>rechargeSummary (HttpServletRequest request , @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit)
391
		throws ProfitMandiBusinessException{
391
		throws ProfitMandiBusinessException{
392
		int userId = (int)request.getAttribute(ProfitMandiConstants.USER_ID);
392
		int userId = (int)request.getAttribute(ProfitMandiConstants.USER_ID);
393
		int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
393
		int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
394
		RechargeType rechargeType = RechargeType.valueOf(rechargeTypeString);
394
		//RechargeType rechargeType = RechargeType.valueOf(rechargeTypeString);
395
		List<RechargeTransaction> rechargeTransactions =rechargeTransactionRepository.selectAllByRetailerIdAndType(retailerId, rechargeType, offset, limit);
395
		List<RechargeTransaction> rechargeTransactions =rechargeTransactionRepository.selectAllByRetailerId(retailerId, offset, limit);
396
		for (RechargeTransaction rechargeTransaction : rechargeTransactions) {
396
		for (RechargeTransaction rechargeTransaction : rechargeTransactions) {
397
			 String operatorName=rechargeOperatorRepository.selectById(rechargeTransaction.getOperatorId()).getName();
397
			 String operatorName=rechargeOperatorRepository.selectById(rechargeTransaction.getOperatorId()).getName();
398
			rechargeTransaction.setOperatorName(operatorName);
398
			rechargeTransaction.setOperatorName(operatorName);
399
		}
399
		}
400
		if(RechargeType.valueOf(rechargeTypeString) == RechargeType.MOBILE) {
-
 
401
			return responseSender.ok(rechargeTransactions);
-
 
402
		}else {
400
		
403
			return responseSender.ok(rechargeTransactions);
401
			return responseSender.ok(rechargeTransactions);
404
		}
402
		
405
			
403
			
406
	}
404
	}
407
		
405
		
408
	@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_COMMISSIONS , method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
406
	@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_COMMISSIONS , method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
409
	@ApiImplicitParams({
407
	@ApiImplicitParams({