Subversion Repositories SmartDukaan

Rev

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

Rev 23433 Rev 23546
Line 48... Line 48...
48
import com.spice.profitmandi.dao.entity.catalog.Item;
48
import com.spice.profitmandi.dao.entity.catalog.Item;
49
import com.spice.profitmandi.dao.entity.dtr.GadgetCopsInsuranceCalc;
49
import com.spice.profitmandi.dao.entity.dtr.GadgetCopsInsuranceCalc;
50
import com.spice.profitmandi.dao.entity.dtr.InsurancePolicy;
50
import com.spice.profitmandi.dao.entity.dtr.InsurancePolicy;
51
import com.spice.profitmandi.dao.entity.dtr.InsuranceProvider;
51
import com.spice.profitmandi.dao.entity.dtr.InsuranceProvider;
52
import com.spice.profitmandi.dao.entity.dtr.Otp;
52
import com.spice.profitmandi.dao.entity.dtr.Otp;
-
 
53
import com.spice.profitmandi.dao.entity.dtr.PaymentOptionTransaction;
53
import com.spice.profitmandi.dao.entity.dtr.PolicyNumberGenerationSequence;
54
import com.spice.profitmandi.dao.entity.dtr.PolicyNumberGenerationSequence;
54
import com.spice.profitmandi.dao.entity.dtr.Retailer;
55
import com.spice.profitmandi.dao.entity.dtr.Retailer;
55
import com.spice.profitmandi.dao.entity.dtr.User;
56
import com.spice.profitmandi.dao.entity.dtr.User;
56
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
57
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
57
import com.spice.profitmandi.dao.entity.fofo.Customer;
58
import com.spice.profitmandi.dao.entity.fofo.Customer;
58
import com.spice.profitmandi.dao.entity.fofo.CustomerAddress;
59
import com.spice.profitmandi.dao.entity.fofo.CustomerAddress;
59
import com.spice.profitmandi.dao.entity.fofo.FofoLineItem;
60
import com.spice.profitmandi.dao.entity.fofo.FofoLineItem;
60
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
61
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
61
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
62
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
62
import com.spice.profitmandi.dao.entity.fofo.FofoOrderPaymentOption;
-
 
63
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
63
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
64
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
64
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
65
import com.spice.profitmandi.dao.entity.fofo.InvoiceNumberGenerationSequence;
65
import com.spice.profitmandi.dao.entity.fofo.InvoiceNumberGenerationSequence;
66
import com.spice.profitmandi.dao.entity.fofo.PrebookingListing;
66
import com.spice.profitmandi.dao.entity.fofo.PrebookingListing;
67
import com.spice.profitmandi.dao.entity.fofo.PrebookingOrder;
67
import com.spice.profitmandi.dao.entity.fofo.PrebookingOrder;
Line 69... Line 69...
69
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
69
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
70
import com.spice.profitmandi.dao.entity.user.Address;
70
import com.spice.profitmandi.dao.entity.user.Address;
71
import com.spice.profitmandi.dao.entity.user.Counter;
71
import com.spice.profitmandi.dao.entity.user.Counter;
72
import com.spice.profitmandi.dao.entity.user.PrivateDealUser;
72
import com.spice.profitmandi.dao.entity.user.PrivateDealUser;
73
import com.spice.profitmandi.dao.enumuration.dtr.OtpType;
73
import com.spice.profitmandi.dao.enumuration.dtr.OtpType;
-
 
74
import com.spice.profitmandi.dao.enumuration.dtr.PaymentOptionReferenceType;
74
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
75
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
75
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
76
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
-
 
77
import com.spice.profitmandi.dao.repository.dtr.PaymentOptionTransactionRepository;
76
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
78
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
77
import com.spice.profitmandi.dao.repository.dtr.InsurancePolicyRepository;
79
import com.spice.profitmandi.dao.repository.dtr.InsurancePolicyRepository;
78
import com.spice.profitmandi.dao.repository.dtr.InsuranceProviderRepository;
80
import com.spice.profitmandi.dao.repository.dtr.InsuranceProviderRepository;
79
import com.spice.profitmandi.dao.repository.dtr.OtpRepository;
81
import com.spice.profitmandi.dao.repository.dtr.OtpRepository;
80
import com.spice.profitmandi.dao.repository.dtr.PolicyNumberGenerationSequenceRepository;
82
import com.spice.profitmandi.dao.repository.dtr.PolicyNumberGenerationSequenceRepository;
Line 85... Line 87...
85
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
87
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
86
import com.spice.profitmandi.dao.repository.fofo.CustomerAddressRepository;
88
import com.spice.profitmandi.dao.repository.fofo.CustomerAddressRepository;
87
import com.spice.profitmandi.dao.repository.fofo.CustomerRepository;
89
import com.spice.profitmandi.dao.repository.fofo.CustomerRepository;
88
import com.spice.profitmandi.dao.repository.fofo.FofoLineItemRepository;
90
import com.spice.profitmandi.dao.repository.fofo.FofoLineItemRepository;
89
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
91
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
90
import com.spice.profitmandi.dao.repository.fofo.FofoOrderPaymentOptionRepository;
-
 
91
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
92
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
92
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
93
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
93
import com.spice.profitmandi.dao.repository.fofo.InvoiceNumberGenerationSequenceRepository;
94
import com.spice.profitmandi.dao.repository.fofo.InvoiceNumberGenerationSequenceRepository;
94
import com.spice.profitmandi.dao.repository.fofo.PaymentOptionRepository;
95
import com.spice.profitmandi.dao.repository.fofo.PaymentOptionRepository;
95
import com.spice.profitmandi.dao.repository.fofo.PrebookingListingRepository;
96
import com.spice.profitmandi.dao.repository.fofo.PrebookingListingRepository;
Line 183... Line 184...
183
	
184
	
184
	@Autowired
185
	@Autowired
185
	private FofoStoreRepository fofoStoreRepository;
186
	private FofoStoreRepository fofoStoreRepository;
186
	
187
	
187
	@Autowired
188
	@Autowired
188
	private FofoOrderPaymentOptionRepository fofoOrderPaymentOptionRepository;
189
	private PaymentOptionTransactionRepository paymentOptionTransactionRepository;
189
	
190
	
190
	@Autowired
191
	@Autowired
191
	private PrebookingListingRepository prebookingListingRepository;
192
	private PrebookingListingRepository prebookingListingRepository;
192
	
193
	
193
	@Autowired
194
	@Autowired
Line 1087... Line 1088...
1087
	}
1088
	}
1088
	
1089
	
1089
	private void createPaymentOptions(int fofoOrderId, Set<CustomPaymentOption> customPaymentOptions) throws ProfitMandiBusinessException{
1090
	private void createPaymentOptions(int fofoOrderId, Set<CustomPaymentOption> customPaymentOptions) throws ProfitMandiBusinessException{
1090
		for(CustomPaymentOption customPaymentOption : customPaymentOptions){
1091
		for(CustomPaymentOption customPaymentOption : customPaymentOptions){
1091
			if(customPaymentOption.getAmount() > 0) {
1092
			if(customPaymentOption.getAmount() > 0) {
1092
				FofoOrderPaymentOption fofoOrderPaymentOption = new FofoOrderPaymentOption();
1093
				PaymentOptionTransaction paymentOptionTransaction = new PaymentOptionTransaction();
1093
				fofoOrderPaymentOption.setFofoOrderId(fofoOrderId);
1094
				paymentOptionTransaction.setReferenceId(fofoOrderId);
1094
				fofoOrderPaymentOption.setPaymentOptionId(customPaymentOption.getPaymentOptionId());
1095
				paymentOptionTransaction.setPaymentOptionId(customPaymentOption.getPaymentOptionId());
-
 
1096
				paymentOptionTransaction.setReferenceType(PaymentOptionReferenceType.ORDER);
1095
				fofoOrderPaymentOption.setAmount(customPaymentOption.getAmount());
1097
				paymentOptionTransaction.setAmount(customPaymentOption.getAmount());
1096
				fofoOrderPaymentOptionRepository.persist(fofoOrderPaymentOption);
1098
				paymentOptionTransactionRepository.persist(paymentOptionTransaction);
1097
			}
1099
			}
1098
		}
1100
		}
1099
	}
1101
	}
1100
	
1102
	
1101
	private FofoOrder createAndGetFofoOrder(int customerId, String customerGstNumber, int fofoId, InvoiceNumberGenerationSequence invoiceNumberGenerationSequence, float totalAmount, int customerAddressId){
1103
	private FofoOrder createAndGetFofoOrder(int customerId, String customerGstNumber, int fofoId, InvoiceNumberGenerationSequence invoiceNumberGenerationSequence, float totalAmount, int customerAddressId){