Subversion Repositories SmartDukaan

Rev

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

Rev 8973 Rev 8974
Line 129... Line 129...
129
			e.printStackTrace();
129
			e.printStackTrace();
130
		}
130
		}
131
		logger.info("Before Processing orders ");
131
		logger.info("Before Processing orders ");
132
		String [] nextLine;
132
		String [] nextLine;
133
		StringBuffer sb = new StringBuffer();
133
		StringBuffer sb = new StringBuffer();
-
 
134
		int orders_processed = 0;
134
		try {
135
		try {
135
			User user = null;
136
			User user = null;
136
			TransactionClient tsc = null;
137
			TransactionClient tsc = null;
137
			SourceDetail sourceDetail = null;
138
			SourceDetail sourceDetail = null;
138
			logger.info("Before Fetching sourcedetail");
139
			logger.info("Before Fetching sourcedetail");
Line 543... Line 544...
543
						attribute.setValue(buyerName);
544
						attribute.setValue(buyerName);
544
						attributeList.add(attribute);
545
						attributeList.add(attribute);
545
						try {
546
						try {
546
							transaction_client.createFlipkartOrder(flipkartOrder);
547
							transaction_client.createFlipkartOrder(flipkartOrder);
547
							transaction_client.setOrderAttributes(flipkartOrder.getOrderId(),attributeList);
548
							transaction_client.setOrderAttributes(flipkartOrder.getOrderId(),attributeList);
-
 
549
							orders_processed++;
548
						} catch (TException e) {
550
						} catch (TException e) {
549
							logger.error("Could not create flipkart order");
551
							logger.error("Could not create flipkart order");
550
							sb.append(orderId+" "+subOrderId + " Could not create flipkart order"+"\n");
552
							sb.append(orderId+" "+subOrderId + " Could not create flipkart order"+"\n");
551
							continue;
553
							continue;
552
						}
554
						}
Line 569... Line 571...
569
				sos = response.getOutputStream();
571
				sos = response.getOutputStream();
570
				if(sb!=null){
572
				if(sb!=null){
571
					sos.write(sb.toString().getBytes());
573
					sos.write(sb.toString().getBytes());
572
				}
574
				}
573
				else{
575
				else{
-
 
576
					if(orders_processed!=0){
574
					sos.write("Orders Created Successfully".toString().getBytes());
577
						sos.write("Orders Created Successfully".toString().getBytes());
-
 
578
					}
-
 
579
					else{
-
 
580
						sos.write("Zero Approved Orders".toString().getBytes());
-
 
581
					}
575
				}
582
				}
576
				sos.flush();
583
				sos.flush();
577
			} catch (IOException e) {
584
			} catch (IOException e) {
578
				System.out.println("Unable to stream the manifest file");
585
				System.out.println("Unable to stream the manifest file");
579
			}   
586
			}