Subversion Repositories SmartDukaan

Rev

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

Rev 29336 Rev 29403
Line 105... Line 105...
105
import com.spice.profitmandi.dao.entity.fofo.RazorPay;
105
import com.spice.profitmandi.dao.entity.fofo.RazorPay;
106
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
106
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
107
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
107
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
108
import com.spice.profitmandi.dao.entity.inventory.SaholicCIS;
108
import com.spice.profitmandi.dao.entity.inventory.SaholicCIS;
109
import com.spice.profitmandi.dao.entity.inventory.SaholicPOItem;
109
import com.spice.profitmandi.dao.entity.inventory.SaholicPOItem;
-
 
110
import com.spice.profitmandi.dao.entity.inventory.State;
110
import com.spice.profitmandi.dao.entity.transaction.Order;
111
import com.spice.profitmandi.dao.entity.transaction.Order;
111
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
112
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
112
import com.spice.profitmandi.dao.entity.transaction.PriceDropIMEI;
113
import com.spice.profitmandi.dao.entity.transaction.PriceDropIMEI;
113
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
114
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
114
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
115
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
Line 180... Line 181...
180
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
181
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
181
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
182
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
182
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
183
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
183
import com.spice.profitmandi.dao.repository.user.AddressRepository;
184
import com.spice.profitmandi.dao.repository.user.AddressRepository;
184
import com.spice.profitmandi.dao.repository.user.UserRepository;
185
import com.spice.profitmandi.dao.repository.user.UserRepository;
-
 
186
import com.spice.profitmandi.service.EmailService;
185
import com.spice.profitmandi.service.NotificationService;
187
import com.spice.profitmandi.service.NotificationService;
186
import com.spice.profitmandi.service.PartnerInvestmentService;
188
import com.spice.profitmandi.service.PartnerInvestmentService;
187
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
189
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
188
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
190
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
189
import com.spice.profitmandi.service.inventory.InventoryService;
191
import com.spice.profitmandi.service.inventory.InventoryService;
Line 3071... Line 3073...
3071
 
3073
 
3072
			JSONObject jsonObj = new JSONObject(response.body().string());
3074
			JSONObject jsonObj = new JSONObject(response.body().string());
3073
 
3075
 
3074
			LOGGER.info("jsonObj" + jsonObj);
3076
			LOGGER.info("jsonObj" + jsonObj);
3075
 
3077
 
3076
			JSONArray ja_data = jsonObj.getJSONArray("ShipmentData");
3078
			JSONArray shipmentData = jsonObj.getJSONArray("ShipmentData");
3077
			Set<String> airwaybillStatus = new HashSet<>();
3079
			Set<String> airwaybillStatus = new HashSet<>();
3078
			for (int i = 0; i < ja_data.length(); i++) {
3080
			for (int i = 0; i < shipmentData.length(); i++) {
3079
				JSONObject jsonObject = ja_data.getJSONObject(i);
3081
				JSONObject jsonObject = shipmentData.getJSONObject(i);
3080
				JSONObject shipment = jsonObject.getJSONObject("Shipment");
3082
				JSONObject shipment = jsonObject.getJSONObject("Shipment");
3081
 
3083
 
3082
				LOGGER.info("shipment" + shipment);
3084
				LOGGER.info("shipment" + shipment);
3083
				JSONObject statusDescription = shipment.getJSONObject("Status");
3085
				JSONObject statusDescription = shipment.getJSONObject("Status");
3084
				String awb = shipment.getString("AWB");
3086
				String awb = shipment.getString("AWB");
Line 3096... Line 3098...
3096
				for (String aws : airwaybillStatus) {
3098
				for (String aws : airwaybillStatus) {
3097
 
3099
 
3098
					List<Order> deliverdOrders = orderRepository.selectByAirwayBillNumber(aws);
3100
					List<Order> deliverdOrders = orderRepository.selectByAirwayBillNumber(aws);
3099
					for (Order dlo : deliverdOrders) {
3101
					for (Order dlo : deliverdOrders) {
3100
						dlo.setStatus(OrderStatus.DELIVERY_SUCCESS);
3102
						dlo.setStatus(OrderStatus.DELIVERY_SUCCESS);
3101
						dlo.setStatusDescription("Delivered");
3103
						dlo.setStatusDescription("Order Delivered");
3102
						dlo.setDeliveryTimestamp(LocalDateTime.now());
3104
						dlo.setDeliveryTimestamp(LocalDateTime.now());
3103
					}
3105
					}
3104
 
3106
 
3105
					SendNotificationModel sendNotificationModel = new SendNotificationModel();
3107
					SendNotificationModel sendNotificationModel = new SendNotificationModel();
3106
					sendNotificationModel.setCampaignName("Order Delivered");
3108
					sendNotificationModel.setCampaignName("Order Delivered");