Subversion Repositories SmartDukaan

Rev

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

Rev 4394 Rev 4410
Line 328... Line 328...
328
    pass
328
    pass
329
 
329
 
330
  def markOrdersAsManifested(self, warehouseId, providerId, cod):
330
  def markOrdersAsManifested(self, warehouseId, providerId, cod):
331
    """
331
    """
332
    Depending on the third parameter, marks either all prepaid or all cod orders BILLED by the
332
    Depending on the third parameter, marks either all prepaid or all cod orders BILLED by the
-
 
333
    given warehouse and were picked up by the given provider as MANIFESTED.
-
 
334
 
-
 
335
    Parameters:
-
 
336
     - warehouseId
-
 
337
     - providerId
-
 
338
     - cod
-
 
339
    """
-
 
340
    pass
-
 
341
 
-
 
342
  def markOrdersAsShippedFromWarehouse(self, warehouseId, providerId, cod):
-
 
343
    """
-
 
344
    Depending on the third parameter, marks either all prepaid or all cod orders BILLED and marked as MANIFESTED by the
333
    given warehouse and were picked up by the given provider as SHIPPED_FROM_WH.
345
    given warehouse and were picked up by the given provider as SHIPPED_FROM_WH.
334
 
346
 
335
    Parameters:
347
    Parameters:
336
     - warehouseId
348
     - warehouseId
337
     - providerId
349
     - providerId
Line 1929... Line 1941...
1929
    raise TApplicationException(TApplicationException.MISSING_RESULT, "addBillingDetails failed: unknown result");
1941
    raise TApplicationException(TApplicationException.MISSING_RESULT, "addBillingDetails failed: unknown result");
1930
 
1942
 
1931
  def markOrdersAsManifested(self, warehouseId, providerId, cod):
1943
  def markOrdersAsManifested(self, warehouseId, providerId, cod):
1932
    """
1944
    """
1933
    Depending on the third parameter, marks either all prepaid or all cod orders BILLED by the
1945
    Depending on the third parameter, marks either all prepaid or all cod orders BILLED by the
1934
    given warehouse and were picked up by the given provider as SHIPPED_FROM_WH.
1946
    given warehouse and were picked up by the given provider as MANIFESTED.
1935
 
1947
 
1936
    Parameters:
1948
    Parameters:
1937
     - warehouseId
1949
     - warehouseId
1938
     - providerId
1950
     - providerId
1939
     - cod
1951
     - cod
Line 1965... Line 1977...
1965
      return result.success
1977
      return result.success
1966
    if result.ex is not None:
1978
    if result.ex is not None:
1967
      raise result.ex
1979
      raise result.ex
1968
    raise TApplicationException(TApplicationException.MISSING_RESULT, "markOrdersAsManifested failed: unknown result");
1980
    raise TApplicationException(TApplicationException.MISSING_RESULT, "markOrdersAsManifested failed: unknown result");
1969
 
1981
 
-
 
1982
  def markOrdersAsShippedFromWarehouse(self, warehouseId, providerId, cod):
-
 
1983
    """
-
 
1984
    Depending on the third parameter, marks either all prepaid or all cod orders BILLED and marked as MANIFESTED by the
-
 
1985
    given warehouse and were picked up by the given provider as SHIPPED_FROM_WH.
-
 
1986
 
-
 
1987
    Parameters:
-
 
1988
     - warehouseId
-
 
1989
     - providerId
-
 
1990
     - cod
-
 
1991
    """
-
 
1992
    self.send_markOrdersAsShippedFromWarehouse(warehouseId, providerId, cod)
-
 
1993
    return self.recv_markOrdersAsShippedFromWarehouse()
-
 
1994
 
-
 
1995
  def send_markOrdersAsShippedFromWarehouse(self, warehouseId, providerId, cod):
-
 
1996
    self._oprot.writeMessageBegin('markOrdersAsShippedFromWarehouse', TMessageType.CALL, self._seqid)
-
 
1997
    args = markOrdersAsShippedFromWarehouse_args()
-
 
1998
    args.warehouseId = warehouseId
-
 
1999
    args.providerId = providerId
-
 
2000
    args.cod = cod
-
 
2001
    args.write(self._oprot)
-
 
2002
    self._oprot.writeMessageEnd()
-
 
2003
    self._oprot.trans.flush()
-
 
2004
 
-
 
2005
  def recv_markOrdersAsShippedFromWarehouse(self, ):
-
 
2006
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2007
    if mtype == TMessageType.EXCEPTION:
-
 
2008
      x = TApplicationException()
-
 
2009
      x.read(self._iprot)
-
 
2010
      self._iprot.readMessageEnd()
-
 
2011
      raise x
-
 
2012
    result = markOrdersAsShippedFromWarehouse_result()
-
 
2013
    result.read(self._iprot)
-
 
2014
    self._iprot.readMessageEnd()
-
 
2015
    if result.success is not None:
-
 
2016
      return result.success
-
 
2017
    if result.ex is not None:
-
 
2018
      raise result.ex
-
 
2019
    raise TApplicationException(TApplicationException.MISSING_RESULT, "markOrdersAsShippedFromWarehouse failed: unknown result");
-
 
2020
 
1970
  def markOrdersAsPickedUp(self, providerId, pickupDetails):
2021
  def markOrdersAsPickedUp(self, providerId, pickupDetails):
1971
    """
2022
    """
1972
    Marks all SHIPPED_FROM_WH orders of the previous day for a provider as SHIPPED_TO_LOGISTICS.
2023
    Marks all SHIPPED_FROM_WH orders of the previous day for a provider as SHIPPED_TO_LOGISTICS.
1973
    Returns a list of orders that were shipped from warehouse but did not appear in the pick-up report.
2024
    Returns a list of orders that were shipped from warehouse but did not appear in the pick-up report.
1974
    Raises an exception if we encounter report for an AWB number that we did not ship.
2025
    Raises an exception if we encounter report for an AWB number that we did not ship.
Line 3399... Line 3450...
3399
    self._processMap["markOrderAsOutOfStock"] = Processor.process_markOrderAsOutOfStock
3450
    self._processMap["markOrderAsOutOfStock"] = Processor.process_markOrderAsOutOfStock
3400
    self._processMap["verifyOrder"] = Processor.process_verifyOrder
3451
    self._processMap["verifyOrder"] = Processor.process_verifyOrder
3401
    self._processMap["acceptOrder"] = Processor.process_acceptOrder
3452
    self._processMap["acceptOrder"] = Processor.process_acceptOrder
3402
    self._processMap["addBillingDetails"] = Processor.process_addBillingDetails
3453
    self._processMap["addBillingDetails"] = Processor.process_addBillingDetails
3403
    self._processMap["markOrdersAsManifested"] = Processor.process_markOrdersAsManifested
3454
    self._processMap["markOrdersAsManifested"] = Processor.process_markOrdersAsManifested
-
 
3455
    self._processMap["markOrdersAsShippedFromWarehouse"] = Processor.process_markOrdersAsShippedFromWarehouse
3404
    self._processMap["markOrdersAsPickedUp"] = Processor.process_markOrdersAsPickedUp
3456
    self._processMap["markOrdersAsPickedUp"] = Processor.process_markOrdersAsPickedUp
3405
    self._processMap["markOrdersAsDelivered"] = Processor.process_markOrdersAsDelivered
3457
    self._processMap["markOrdersAsDelivered"] = Processor.process_markOrdersAsDelivered
3406
    self._processMap["markOrdersAsFailed"] = Processor.process_markOrdersAsFailed
3458
    self._processMap["markOrdersAsFailed"] = Processor.process_markOrdersAsFailed
3407
    self._processMap["updateNonDeliveryReason"] = Processor.process_updateNonDeliveryReason
3459
    self._processMap["updateNonDeliveryReason"] = Processor.process_updateNonDeliveryReason
3408
    self._processMap["getUndeliveredOrders"] = Processor.process_getUndeliveredOrders
3460
    self._processMap["getUndeliveredOrders"] = Processor.process_getUndeliveredOrders
Line 3897... Line 3949...
3897
    oprot.writeMessageBegin("markOrdersAsManifested", TMessageType.REPLY, seqid)
3949
    oprot.writeMessageBegin("markOrdersAsManifested", TMessageType.REPLY, seqid)
3898
    result.write(oprot)
3950
    result.write(oprot)
3899
    oprot.writeMessageEnd()
3951
    oprot.writeMessageEnd()
3900
    oprot.trans.flush()
3952
    oprot.trans.flush()
3901
 
3953
 
-
 
3954
  def process_markOrdersAsShippedFromWarehouse(self, seqid, iprot, oprot):
-
 
3955
    args = markOrdersAsShippedFromWarehouse_args()
-
 
3956
    args.read(iprot)
-
 
3957
    iprot.readMessageEnd()
-
 
3958
    result = markOrdersAsShippedFromWarehouse_result()
-
 
3959
    try:
-
 
3960
      result.success = self._handler.markOrdersAsShippedFromWarehouse(args.warehouseId, args.providerId, args.cod)
-
 
3961
    except TransactionServiceException, ex:
-
 
3962
      result.ex = ex
-
 
3963
    oprot.writeMessageBegin("markOrdersAsShippedFromWarehouse", TMessageType.REPLY, seqid)
-
 
3964
    result.write(oprot)
-
 
3965
    oprot.writeMessageEnd()
-
 
3966
    oprot.trans.flush()
-
 
3967
 
3902
  def process_markOrdersAsPickedUp(self, seqid, iprot, oprot):
3968
  def process_markOrdersAsPickedUp(self, seqid, iprot, oprot):
3903
    args = markOrdersAsPickedUp_args()
3969
    args = markOrdersAsPickedUp_args()
3904
    args.read(iprot)
3970
    args.read(iprot)
3905
    iprot.readMessageEnd()
3971
    iprot.readMessageEnd()
3906
    result = markOrdersAsPickedUp_result()
3972
    result = markOrdersAsPickedUp_result()
Line 9238... Line 9304...
9238
    if self.success is not None:
9304
    if self.success is not None:
9239
      oprot.writeFieldBegin('success', TType.BOOL, 0)
9305
      oprot.writeFieldBegin('success', TType.BOOL, 0)
9240
      oprot.writeBool(self.success)
9306
      oprot.writeBool(self.success)
9241
      oprot.writeFieldEnd()
9307
      oprot.writeFieldEnd()
9242
    if self.ex is not None:
9308
    if self.ex is not None:
-
 
9309
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
-
 
9310
      self.ex.write(oprot)
-
 
9311
      oprot.writeFieldEnd()
-
 
9312
    oprot.writeFieldStop()
-
 
9313
    oprot.writeStructEnd()
-
 
9314
 
-
 
9315
  def validate(self):
-
 
9316
    return
-
 
9317
 
-
 
9318
 
-
 
9319
  def __repr__(self):
-
 
9320
    L = ['%s=%r' % (key, value)
-
 
9321
      for key, value in self.__dict__.iteritems()]
-
 
9322
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
9323
 
-
 
9324
  def __eq__(self, other):
-
 
9325
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
9326
 
-
 
9327
  def __ne__(self, other):
-
 
9328
    return not (self == other)
-
 
9329
 
-
 
9330
class markOrdersAsShippedFromWarehouse_args:
-
 
9331
  """
-
 
9332
  Attributes:
-
 
9333
   - warehouseId
-
 
9334
   - providerId
-
 
9335
   - cod
-
 
9336
  """
-
 
9337
 
-
 
9338
  thrift_spec = (
-
 
9339
    None, # 0
-
 
9340
    (1, TType.I64, 'warehouseId', None, None, ), # 1
-
 
9341
    (2, TType.I64, 'providerId', None, None, ), # 2
-
 
9342
    (3, TType.BOOL, 'cod', None, None, ), # 3
-
 
9343
  )
-
 
9344
 
-
 
9345
  def __init__(self, warehouseId=None, providerId=None, cod=None,):
-
 
9346
    self.warehouseId = warehouseId
-
 
9347
    self.providerId = providerId
-
 
9348
    self.cod = cod
-
 
9349
 
-
 
9350
  def read(self, iprot):
-
 
9351
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
9352
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
9353
      return
-
 
9354
    iprot.readStructBegin()
-
 
9355
    while True:
-
 
9356
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
9357
      if ftype == TType.STOP:
-
 
9358
        break
-
 
9359
      if fid == 1:
-
 
9360
        if ftype == TType.I64:
-
 
9361
          self.warehouseId = iprot.readI64();
-
 
9362
        else:
-
 
9363
          iprot.skip(ftype)
-
 
9364
      elif fid == 2:
-
 
9365
        if ftype == TType.I64:
-
 
9366
          self.providerId = iprot.readI64();
-
 
9367
        else:
-
 
9368
          iprot.skip(ftype)
-
 
9369
      elif fid == 3:
-
 
9370
        if ftype == TType.BOOL:
-
 
9371
          self.cod = iprot.readBool();
-
 
9372
        else:
-
 
9373
          iprot.skip(ftype)
-
 
9374
      else:
-
 
9375
        iprot.skip(ftype)
-
 
9376
      iprot.readFieldEnd()
-
 
9377
    iprot.readStructEnd()
-
 
9378
 
-
 
9379
  def write(self, oprot):
-
 
9380
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
9381
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
9382
      return
-
 
9383
    oprot.writeStructBegin('markOrdersAsShippedFromWarehouse_args')
-
 
9384
    if self.warehouseId is not None:
-
 
9385
      oprot.writeFieldBegin('warehouseId', TType.I64, 1)
-
 
9386
      oprot.writeI64(self.warehouseId)
-
 
9387
      oprot.writeFieldEnd()
-
 
9388
    if self.providerId is not None:
-
 
9389
      oprot.writeFieldBegin('providerId', TType.I64, 2)
-
 
9390
      oprot.writeI64(self.providerId)
-
 
9391
      oprot.writeFieldEnd()
-
 
9392
    if self.cod is not None:
-
 
9393
      oprot.writeFieldBegin('cod', TType.BOOL, 3)
-
 
9394
      oprot.writeBool(self.cod)
-
 
9395
      oprot.writeFieldEnd()
-
 
9396
    oprot.writeFieldStop()
-
 
9397
    oprot.writeStructEnd()
-
 
9398
 
-
 
9399
  def validate(self):
-
 
9400
    return
-
 
9401
 
-
 
9402
 
-
 
9403
  def __repr__(self):
-
 
9404
    L = ['%s=%r' % (key, value)
-
 
9405
      for key, value in self.__dict__.iteritems()]
-
 
9406
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
9407
 
-
 
9408
  def __eq__(self, other):
-
 
9409
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
9410
 
-
 
9411
  def __ne__(self, other):
-
 
9412
    return not (self == other)
-
 
9413
 
-
 
9414
class markOrdersAsShippedFromWarehouse_result:
-
 
9415
  """
-
 
9416
  Attributes:
-
 
9417
   - success
-
 
9418
   - ex
-
 
9419
  """
-
 
9420
 
-
 
9421
  thrift_spec = (
-
 
9422
    (0, TType.BOOL, 'success', None, None, ), # 0
-
 
9423
    (1, TType.STRUCT, 'ex', (TransactionServiceException, TransactionServiceException.thrift_spec), None, ), # 1
-
 
9424
  )
-
 
9425
 
-
 
9426
  def __init__(self, success=None, ex=None,):
-
 
9427
    self.success = success
-
 
9428
    self.ex = ex
-
 
9429
 
-
 
9430
  def read(self, iprot):
-
 
9431
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
9432
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
9433
      return
-
 
9434
    iprot.readStructBegin()
-
 
9435
    while True:
-
 
9436
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
9437
      if ftype == TType.STOP:
-
 
9438
        break
-
 
9439
      if fid == 0:
-
 
9440
        if ftype == TType.BOOL:
-
 
9441
          self.success = iprot.readBool();
-
 
9442
        else:
-
 
9443
          iprot.skip(ftype)
-
 
9444
      elif fid == 1:
-
 
9445
        if ftype == TType.STRUCT:
-
 
9446
          self.ex = TransactionServiceException()
-
 
9447
          self.ex.read(iprot)
-
 
9448
        else:
-
 
9449
          iprot.skip(ftype)
-
 
9450
      else:
-
 
9451
        iprot.skip(ftype)
-
 
9452
      iprot.readFieldEnd()
-
 
9453
    iprot.readStructEnd()
-
 
9454
 
-
 
9455
  def write(self, oprot):
-
 
9456
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
9457
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
9458
      return
-
 
9459
    oprot.writeStructBegin('markOrdersAsShippedFromWarehouse_result')
-
 
9460
    if self.success is not None:
-
 
9461
      oprot.writeFieldBegin('success', TType.BOOL, 0)
-
 
9462
      oprot.writeBool(self.success)
-
 
9463
      oprot.writeFieldEnd()
-
 
9464
    if self.ex is not None:
9243
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
9465
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
9244
      self.ex.write(oprot)
9466
      self.ex.write(oprot)
9245
      oprot.writeFieldEnd()
9467
      oprot.writeFieldEnd()
9246
    oprot.writeFieldStop()
9468
    oprot.writeFieldStop()
9247
    oprot.writeStructEnd()
9469
    oprot.writeStructEnd()