Subversion Repositories SmartDukaan

Rev

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

Rev 8974 Rev 8991
Line 391... Line 391...
391
					t_order.setCustomer_pincode(pincode);
391
					t_order.setCustomer_pincode(pincode);
392
					t_order.setTotal_amount(unitSellingPrice);            
392
					t_order.setTotal_amount(unitSellingPrice);            
393
					t_order.setTotal_weight(lineItem.getTotal_weight());
393
					t_order.setTotal_weight(lineItem.getTotal_weight());
394
					t_order.setLineitems(Collections.singletonList(lineItem));            
394
					t_order.setLineitems(Collections.singletonList(lineItem));            
395
					t_order.setStatus(OrderStatus.PAYMENT_PENDING);
395
					t_order.setStatus(OrderStatus.PAYMENT_PENDING);
396
					t_order.setStatusDescription("Payment Pending");
396
					t_order.setStatusDescription("Accepted");
397
					t_order.setCreated_timestamp(new Date().getTime());
397
					t_order.setCreated_timestamp(new Date().getTime());
398
					t_order.setOrderType(OrderType.B2C);
398
					t_order.setOrderType(OrderType.B2C);
399
					t_order.setCod(false);
399
					t_order.setCod(false);
400
					try {
400
					try {
401
						Date shipDate = new Date();
401
						Date shipDate = new Date();
Line 698... Line 698...
698
		FileWriter fw = new FileWriter(tempFile);
698
		FileWriter fw = new FileWriter(tempFile);
699
		String line;	
699
		String line;	
700
		br = new BufferedReader(new FileReader(file));
700
		br = new BufferedReader(new FileReader(file));
701
		boolean replace = false;
701
		boolean replace = false;
702
		char [] lineChars; 
702
		char [] lineChars; 
-
 
703
		int counter=1;
-
 
704
		String completeorder = null;
703
		while ((line = br.readLine()) != null) {
705
		while ((line = br.readLine()) != null) {
704
 
-
 
705
			if(line.contains("Ordered On")){
-
 
706
				continue;
706
			if(counter!=1){
707
			}
-
 
708
			else{
-
 
709
				lineChars = line.toCharArray();
707
				if(line.endsWith(",,,,,,,,")){
710
 
-
 
711
				int count = 0;
-
 
712
				for(int i=0;i<lineChars.length;i++)  
708
					completeorder = completeorder.concat(line);
713
				{
-
 
714
					if(lineChars[i]=='"'){
709
					if(line.contains("Ordered On")){
715
						count++;
710
						continue;
716
					}
711
					}
-
 
712
					else{
-
 
713
						lineChars = completeorder.toCharArray();
-
 
714
						int count = 0;
-
 
715
						for(int i=0;i<lineChars.length;i++)  
-
 
716
						{
-
 
717
							if(lineChars[i]=='"'){
-
 
718
								count++;
-
 
719
							}
717
					if(count%2==1){
720
							if(count%2==1){
718
						replace=false;
721
								replace=false;
-
 
722
							}
-
 
723
							if(count%2==0){
-
 
724
								replace=true;
-
 
725
							}
-
 
726
							if(replace && lineChars[i] == ','){
-
 
727
								lineChars[i]='$';
-
 
728
							}
-
 
729
						}
719
					}
730
					}
-
 
731
					line = String.valueOf(lineChars);
-
 
732
					System.out.println(" Line and Length " + line + " " + line.length());
-
 
733
					fw.write(line+"\n");
-
 
734
					completeorder="";
-
 
735
				}
-
 
736
				else{
-
 
737
					line = line.replace("\n","");
720
					if(count%2==0){
738
					if(completeorder==null){
721
						replace=true;
739
						completeorder = line;
722
					}
740
					}
723
					if(replace && lineChars[i] == ','){
741
					else{
724
						lineChars[i]='$';
742
						completeorder = completeorder.concat(line);;
725
					}
743
					}
726
				}
744
				}
727
			}
745
			}
728
			line = String.valueOf(lineChars);
-
 
729
			fw.write(line+"\n");
746
			counter++;
730
		}
-
 
731
		if (br != null)br.close();
747
		}		if (br != null)br.close();
732
		if (fw != null)fw.close();
748
		if (fw != null)fw.close();
733
	}		
749
	}		
734
 
750
 
735
	public static void createPayment(User user, String subOrderId, double amount) throws PaymentException, TException {
751
	public static void createPayment(User user, String subOrderId, double amount) throws PaymentException, TException {
736
		in.shop2020.payments.PaymentService.Client client = new PaymentClient().getClient();
752
		in.shop2020.payments.PaymentService.Client client = new PaymentClient().getClient();