Subversion Repositories SmartDukaan

Rev

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

Rev 19072 Rev 19765
Line 365... Line 365...
365
                ticket.setOrderId(Long.parseLong(orderId));
365
                ticket.setOrderId(Long.parseLong(orderId));
366
            }
366
            }
367
            
367
            
368
            if (TicketCategory.valueOf(category) == TicketCategory.DOA_RECEIVED) {
368
            if (TicketCategory.valueOf(category) == TicketCategory.DOA_RECEIVED) {
369
                transactionServiceClient = new TransactionClient().getClient();
369
                transactionServiceClient = new TransactionClient().getClient();
370
                if (!transactionServiceClient.markOrderDoaRequestReceived(Long.parseLong(orderId))) {
370
                /*if (!transactionServiceClient.markOrderDoaRequestReceived(Long.parseLong(orderId))) {
371
                    throw new Exception("Order cannot be marked as DOA Received");
371
                    throw new Exception("Order cannot be marked as DOA Received");
372
                }
372
                }*/
373
                log.info("" + userId);
373
                log.info("" + userId);
374
                
374
                try{
375
                Order order = transactionServiceClient.getOrder(Long.parseLong(orderId));
375
	                Order order = transactionServiceClient.getOrder(Long.parseLong(orderId));
376
                log.info("In order table id is : " + order.getCustomer_id());
376
	                log.info("In order table id is : " + order.getCustomer_id());
377
                if (userId == null || userId.isEmpty() || order.getCustomer_id() != Long.parseLong(userId)) {
377
	                if (userId == null || userId.isEmpty() || order.getCustomer_id() != Long.parseLong(userId)) {
378
                    throw new Exception("This order is not associated with this user Id");
378
	                    throw new Exception("This order is not associated with this user Id");
-
 
379
	                }
-
 
380
                }catch(Exception e){
-
 
381
                	throw new Exception("No Order Found for given order id");
379
                }
382
                }
380
            }
383
            }
381
            
384
            
382
            if (TicketCategory.valueOf(category) == TicketCategory.RETURN_FORM) {
385
            if (TicketCategory.valueOf(category) == TicketCategory.RETURN_FORM) {
383
                transactionServiceClient = new TransactionClient().getClient();
386
                transactionServiceClient = new TransactionClient().getClient();
384
                if (!transactionServiceClient.markOrderReturnRequestReceived(Long.parseLong(orderId))) {
387
                /*if (!transactionServiceClient.markOrderReturnRequestReceived(Long.parseLong(orderId))) {
385
                    throw new Exception("Order cannot be marked as Return Requested");
388
                    throw new Exception("Order cannot be marked as Return Requested");
386
                }
389
                }*/
387
                log.info("" + userId);
390
                log.info("" + userId);
388
                
391
                try{
389
                Order order = transactionServiceClient.getOrder(Long.parseLong(orderId));
392
	                Order order = transactionServiceClient.getOrder(Long.parseLong(orderId));
390
                log.info("In order table id is : " + order.getCustomer_id());
393
	                log.info("In order table id is : " + order.getCustomer_id());
391
                if (userId == null || userId.isEmpty() || order.getCustomer_id() != Long.parseLong(userId)) {
394
	                if (userId == null || userId.isEmpty() || order.getCustomer_id() != Long.parseLong(userId)) {
392
                    throw new Exception("This order is not associated with this user Id");
395
	                    throw new Exception("This order is not associated with this user Id");
-
 
396
	                }
-
 
397
                }catch(Exception e){
-
 
398
                	throw new Exception("No Order Found for given order id");
393
                }
399
                }
394
            }
400
            }
395
            if(body!=null && !body.isEmpty()){
401
            if(body!=null && !body.isEmpty()){
396
            	String plainTextbody = new Source(body).getTextExtractor().toString();
402
            	String plainTextbody = new Source(body).getTextExtractor().toString();
397
            	ticket.setDescription(description + " : " + plainTextbody);
403
            	ticket.setDescription(description + " : " + plainTextbody);