Subversion Repositories SmartDukaan

Rev

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

Rev 5407 Rev 5435
Line 56... Line 56...
56
	    	System.exit(1);
56
	    	System.exit(1);
57
		}
57
		}
58
        if (userCommunications != null && !userCommunications.isEmpty()) {
58
        if (userCommunications != null && !userCommunications.isEmpty()) {
59
            log.info("Fetched " + userCommunications.size() + " UserCommunications");
59
            log.info("Fetched " + userCommunications.size() + " UserCommunications");
60
            for (UserCommunication userCommunication : userCommunications) {
60
            for (UserCommunication userCommunication : userCommunications) {
61
                newTask.processUserCommunication(userCommunication);
61
                if(newTask.processUserCommunication(userCommunication)) {
62
                try {
62
	                try {
63
                	client = new UserClient().getClient();
63
	                	client = new UserClient().getClient();
64
                	client.removeUserCommunication(userCommunication.getId());
64
	                	client.removeUserCommunication(userCommunication.getId());
65
                } catch(UserCommunicationException e) {
65
	                } catch(UserCommunicationException e) {
66
                	log.error("Not able to remove UserCommunication" + e);
66
	                	log.error("Not able to remove UserCommunication" + e);
67
                } catch(TException ex) {
67
	                } catch(TException ex) {
68
                	log.error("Not able to remove UserCommunication" + ex);
68
	                	log.error("Not able to remove UserCommunication" + ex);
-
 
69
	                }
69
                }
70
                }
70
            }
71
            }
71
        }
72
        }
72
	}
73
	}
73
	
74
	
74
	private void processUserCommunication(UserCommunication userCommunication) {
75
	private boolean processUserCommunication(UserCommunication userCommunication) {
75
		try{
76
		try{
76
			log.info("Processing userCommunication : " + userCommunication.getId());
77
			log.info("Processing userCommunication : " + userCommunication.getId());
77
 
78
 
78
	        Ticket ticket = new Ticket();
79
	        Ticket ticket = new Ticket();
79
	        ticket.setAirwayBillNo(userCommunication.getAirwaybillNo());
80
	        ticket.setAirwayBillNo(userCommunication.getAirwaybillNo());
Line 136... Line 137...
136
	        log.info("Creating ticket!");
137
	        log.info("Creating ticket!");
137
            createTicket(ticket, activity);
138
            createTicket(ticket, activity);
138
		} catch(Exception e) {
139
		} catch(Exception e) {
139
			log.error("Exception while creating ticket for commId : " +
140
			log.error("Exception while creating ticket for commId : " +
140
					userCommunication.getId() + "\n" + e);
141
					userCommunication.getId() + "\n" + e);
-
 
142
			return false;
141
		}
143
		}
-
 
144
		return true;
142
	}
145
	}
143
	
146
	
144
	@Transactional
147
	@Transactional
145
    private void createTicket(Ticket ticket, Activity activity) {
148
    private void createTicket(Ticket ticket, Activity activity) {
146
        ticketHandler.insertTicket(ticket);
149
        ticketHandler.insertTicket(ticket);