Subversion Repositories SmartDukaan

Rev

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

Rev 29419 Rev 29420
Line 24... Line 24...
24
import org.springframework.web.bind.annotation.RequestMapping;
24
import org.springframework.web.bind.annotation.RequestMapping;
25
import org.springframework.web.bind.annotation.RequestMethod;
25
import org.springframework.web.bind.annotation.RequestMethod;
26
import org.springframework.web.bind.annotation.RequestParam;
26
import org.springframework.web.bind.annotation.RequestParam;
27
 
27
 
28
import com.spice.profitmandi.common.model.CustomOrder;
28
import com.spice.profitmandi.common.model.CustomOrder;
-
 
29
import com.spice.profitmandi.common.model.TrackingModel;
29
import com.spice.profitmandi.common.web.util.ResponseSender;
30
import com.spice.profitmandi.common.web.util.ResponseSender;
30
import com.spice.profitmandi.dao.entity.logistics.Provider;
31
import com.spice.profitmandi.dao.entity.logistics.Provider;
31
import com.spice.profitmandi.dao.entity.logistics.ProviderTat;
32
import com.spice.profitmandi.dao.entity.logistics.ProviderTat;
32
import com.spice.profitmandi.dao.entity.transaction.Order;
33
import com.spice.profitmandi.dao.entity.transaction.Order;
33
import com.spice.profitmandi.dao.model.ProductPojo;
34
import com.spice.profitmandi.dao.model.ProductPojo;
Line 193... Line 194...
193
		co.setAirwayBillNo(order.getAirwayBillNumber());
194
		co.setAirwayBillNo(order.getAirwayBillNumber());
194
		co.setCancellationTimestamp(order.getRefundTimestamp());
195
		co.setCancellationTimestamp(order.getRefundTimestamp());
195
		co.setBillingTimestamp(order.getBillingTimestamp());
196
		co.setBillingTimestamp(order.getBillingTimestamp());
196
		co.setShippingTimestamp(order.getShippingTimestamp());
197
		co.setShippingTimestamp(order.getShippingTimestamp());
197
		co.setInvoiceNumber(order.getInvoiceNumber());
198
		co.setInvoiceNumber(order.getInvoiceNumber());
-
 
199
		co.setExpectedShipping(order.getExpectedShippingTime());
198
		if (order.getShippingTimestamp() != null) {
200
		if (order.getShippingTimestamp() != null) {
199
			ProviderTat pt = providerTatRepository.selectByProviderId(order.getLogisticsProviderId(),
201
			ProviderTat pt = providerTatRepository.selectByProviderId(order.getLogisticsProviderId(),
200
					order.getWarehouseId(), order.getRetailerPinCode());
202
					order.getWarehouseId(), order.getRetailerPinCode());
201
			LocalDateTime shipping = order.getShippingTimestamp();
203
			LocalDateTime shipping = order.getShippingTimestamp();
202
 
204
 
Line 208... Line 210...
208
			long noOfDaysBetween = ChronoUnit.DAYS.between(expected, deliveryTime.atStartOfDay());
210
			long noOfDaysBetween = ChronoUnit.DAYS.between(expected, deliveryTime.atStartOfDay());
209
 
211
 
210
			co.setDelayAfterShipping((int) noOfDaysBetween);
212
			co.setDelayAfterShipping((int) noOfDaysBetween);
211
 
213
 
212
		}
214
		}
-
 
215
		TrackingModel tm = new TrackingModel();
-
 
216
		if (co.getBillingTimestamp() != null) {
-
 
217
			tm.setActualBilling(co.getBillingTimestamp());
-
 
218
			tm.setInTransitBilling(false);
-
 
219
		} else {
-
 
220
			tm.setInTransitBilling(true);
-
 
221
		}
213
 
222
 
-
 
223
		if (co.getShippingTimestamp() != null) {
-
 
224
			tm.setActualShipping(co.getShippingTimestamp());
-
 
225
			tm.setInTransitShipping(false);
-
 
226
		} else {
-
 
227
			tm.setExpectedShipping(co.getExpectedShipping());
-
 
228
			tm.setInTransitShipping(true);
-
 
229
		}
-
 
230
 
-
 
231
		if (co.getDeliveryTimestamp() != null) {
-
 
232
			tm.setActualDelivered(co.getDeliveryTimestamp());
-
 
233
			tm.setInTransitDelivered(false);
-
 
234
		} else {
-
 
235
			tm.setExpectedDelivered(co.getExpectedShipping());
-
 
236
			tm.setInTransitDelivered(true);
-
 
237
		}
-
 
238
		co.setTrackingModel(tm);
214
		return co;
239
		return co;
215
	}
240
	}
216
 
241
 
217
	private String getImageUrl(Order order) throws TException {
242
	private String getImageUrl(Order order) throws TException {
218
 
243