Subversion Repositories SmartDukaan

Rev

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

Rev 8565 Rev 8717
Line 449... Line 449...
449
    Parameters:
449
    Parameters:
450
     - date
450
     - date
451
    """
451
    """
452
    pass
452
    pass
453
 
453
 
454
  def scanForBadSale(self, inventoryItem, orderId, quantity, fulfilmentWarehouseId, billingWarehouseId):
454
  def scanForBadSale(self, serialNumber, itemNumber, itemId, orderId, fulfilmentWarehouseId, quantity, billingWarehouseId):
455
    """
455
    """
456
    Parameters:
456
    Parameters:
-
 
457
     - serialNumber
457
     - inventoryItem
458
     - itemNumber
-
 
459
     - itemId
458
     - orderId
460
     - orderId
459
     - quantity
-
 
460
     - fulfilmentWarehouseId
461
     - fulfilmentWarehouseId
-
 
462
     - quantity
461
     - billingWarehouseId
463
     - billingWarehouseId
462
    """
464
    """
463
    pass
465
    pass
464
 
466
 
465
 
467
 
Line 2065... Line 2067...
2065
      return result.success
2067
      return result.success
2066
    if result.wex is not None:
2068
    if result.wex is not None:
2067
      raise result.wex
2069
      raise result.wex
2068
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getHistoricBadInventoryByScans failed: unknown result");
2070
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getHistoricBadInventoryByScans failed: unknown result");
2069
 
2071
 
2070
  def scanForBadSale(self, inventoryItem, orderId, quantity, fulfilmentWarehouseId, billingWarehouseId):
2072
  def scanForBadSale(self, serialNumber, itemNumber, itemId, orderId, fulfilmentWarehouseId, quantity, billingWarehouseId):
2071
    """
2073
    """
2072
    Parameters:
2074
    Parameters:
-
 
2075
     - serialNumber
2073
     - inventoryItem
2076
     - itemNumber
-
 
2077
     - itemId
2074
     - orderId
2078
     - orderId
2075
     - quantity
-
 
2076
     - fulfilmentWarehouseId
2079
     - fulfilmentWarehouseId
-
 
2080
     - quantity
2077
     - billingWarehouseId
2081
     - billingWarehouseId
2078
    """
2082
    """
2079
    self.send_scanForBadSale(inventoryItem, orderId, quantity, fulfilmentWarehouseId, billingWarehouseId)
2083
    self.send_scanForBadSale(serialNumber, itemNumber, itemId, orderId, fulfilmentWarehouseId, quantity, billingWarehouseId)
2080
    self.recv_scanForBadSale()
2084
    return self.recv_scanForBadSale()
2081
 
2085
 
2082
  def send_scanForBadSale(self, inventoryItem, orderId, quantity, fulfilmentWarehouseId, billingWarehouseId):
2086
  def send_scanForBadSale(self, serialNumber, itemNumber, itemId, orderId, fulfilmentWarehouseId, quantity, billingWarehouseId):
2083
    self._oprot.writeMessageBegin('scanForBadSale', TMessageType.CALL, self._seqid)
2087
    self._oprot.writeMessageBegin('scanForBadSale', TMessageType.CALL, self._seqid)
2084
    args = scanForBadSale_args()
2088
    args = scanForBadSale_args()
-
 
2089
    args.serialNumber = serialNumber
2085
    args.inventoryItem = inventoryItem
2090
    args.itemNumber = itemNumber
-
 
2091
    args.itemId = itemId
2086
    args.orderId = orderId
2092
    args.orderId = orderId
2087
    args.quantity = quantity
-
 
2088
    args.fulfilmentWarehouseId = fulfilmentWarehouseId
2093
    args.fulfilmentWarehouseId = fulfilmentWarehouseId
-
 
2094
    args.quantity = quantity
2089
    args.billingWarehouseId = billingWarehouseId
2095
    args.billingWarehouseId = billingWarehouseId
2090
    args.write(self._oprot)
2096
    args.write(self._oprot)
2091
    self._oprot.writeMessageEnd()
2097
    self._oprot.writeMessageEnd()
2092
    self._oprot.trans.flush()
2098
    self._oprot.trans.flush()
2093
 
2099
 
Line 2099... Line 2105...
2099
      self._iprot.readMessageEnd()
2105
      self._iprot.readMessageEnd()
2100
      raise x
2106
      raise x
2101
    result = scanForBadSale_result()
2107
    result = scanForBadSale_result()
2102
    result.read(self._iprot)
2108
    result.read(self._iprot)
2103
    self._iprot.readMessageEnd()
2109
    self._iprot.readMessageEnd()
-
 
2110
    if result.success is not None:
2104
    return
2111
      return result.success
-
 
2112
    if result.wex is not None:
-
 
2113
      raise result.wex
-
 
2114
    raise TApplicationException(TApplicationException.MISSING_RESULT, "scanForBadSale failed: unknown result");
2105
 
2115
 
2106
 
2116
 
2107
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2117
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2108
  def __init__(self, handler):
2118
  def __init__(self, handler):
2109
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2119
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
Line 2769... Line 2779...
2769
  def process_scanForBadSale(self, seqid, iprot, oprot):
2779
  def process_scanForBadSale(self, seqid, iprot, oprot):
2770
    args = scanForBadSale_args()
2780
    args = scanForBadSale_args()
2771
    args.read(iprot)
2781
    args.read(iprot)
2772
    iprot.readMessageEnd()
2782
    iprot.readMessageEnd()
2773
    result = scanForBadSale_result()
2783
    result = scanForBadSale_result()
-
 
2784
    try:
2774
    self._handler.scanForBadSale(args.inventoryItem, args.orderId, args.quantity, args.fulfilmentWarehouseId, args.billingWarehouseId)
2785
      result.success = self._handler.scanForBadSale(args.serialNumber, args.itemNumber, args.itemId, args.orderId, args.fulfilmentWarehouseId, args.quantity, args.billingWarehouseId)
-
 
2786
    except WarehouseServiceException, wex:
-
 
2787
      result.wex = wex
2775
    oprot.writeMessageBegin("scanForBadSale", TMessageType.REPLY, seqid)
2788
    oprot.writeMessageBegin("scanForBadSale", TMessageType.REPLY, seqid)
2776
    result.write(oprot)
2789
    result.write(oprot)
2777
    oprot.writeMessageEnd()
2790
    oprot.writeMessageEnd()
2778
    oprot.trans.flush()
2791
    oprot.trans.flush()
2779
 
2792
 
Line 9491... Line 9504...
9491
    return not (self == other)
9504
    return not (self == other)
9492
 
9505
 
9493
class scanForBadSale_args:
9506
class scanForBadSale_args:
9494
  """
9507
  """
9495
  Attributes:
9508
  Attributes:
-
 
9509
   - serialNumber
9496
   - inventoryItem
9510
   - itemNumber
-
 
9511
   - itemId
9497
   - orderId
9512
   - orderId
9498
   - quantity
-
 
9499
   - fulfilmentWarehouseId
9513
   - fulfilmentWarehouseId
-
 
9514
   - quantity
9500
   - billingWarehouseId
9515
   - billingWarehouseId
9501
  """
9516
  """
9502
 
9517
 
9503
  thrift_spec = (
9518
  thrift_spec = (
9504
    None, # 0
9519
    None, # 0
9505
    (1, TType.STRUCT, 'inventoryItem', (InventoryItem, InventoryItem.thrift_spec), None, ), # 1
9520
    (1, TType.STRING, 'serialNumber', None, None, ), # 1
-
 
9521
    (2, TType.STRING, 'itemNumber', None, None, ), # 2
9506
    (2, TType.I64, 'orderId', None, None, ), # 2
9522
    (3, TType.I64, 'itemId', None, None, ), # 3
9507
    (3, TType.I64, 'quantity', None, None, ), # 3
9523
    (4, TType.I64, 'orderId', None, None, ), # 4
9508
    (4, TType.I64, 'fulfilmentWarehouseId', None, None, ), # 4
9524
    (5, TType.I64, 'fulfilmentWarehouseId', None, None, ), # 5
-
 
9525
    (6, TType.I64, 'quantity', None, None, ), # 6
9509
    (5, TType.I64, 'billingWarehouseId', None, None, ), # 5
9526
    (7, TType.I64, 'billingWarehouseId', None, None, ), # 7
9510
  )
9527
  )
9511
 
9528
 
9512
  def __init__(self, inventoryItem=None, orderId=None, quantity=None, fulfilmentWarehouseId=None, billingWarehouseId=None,):
9529
  def __init__(self, serialNumber=None, itemNumber=None, itemId=None, orderId=None, fulfilmentWarehouseId=None, quantity=None, billingWarehouseId=None,):
-
 
9530
    self.serialNumber = serialNumber
9513
    self.inventoryItem = inventoryItem
9531
    self.itemNumber = itemNumber
-
 
9532
    self.itemId = itemId
9514
    self.orderId = orderId
9533
    self.orderId = orderId
9515
    self.quantity = quantity
-
 
9516
    self.fulfilmentWarehouseId = fulfilmentWarehouseId
9534
    self.fulfilmentWarehouseId = fulfilmentWarehouseId
-
 
9535
    self.quantity = quantity
9517
    self.billingWarehouseId = billingWarehouseId
9536
    self.billingWarehouseId = billingWarehouseId
9518
 
9537
 
9519
  def read(self, iprot):
9538
  def read(self, iprot):
9520
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
9539
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
9521
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
9540
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
Line 9524... Line 9543...
9524
    while True:
9543
    while True:
9525
      (fname, ftype, fid) = iprot.readFieldBegin()
9544
      (fname, ftype, fid) = iprot.readFieldBegin()
9526
      if ftype == TType.STOP:
9545
      if ftype == TType.STOP:
9527
        break
9546
        break
9528
      if fid == 1:
9547
      if fid == 1:
9529
        if ftype == TType.STRUCT:
9548
        if ftype == TType.STRING:
9530
          self.inventoryItem = InventoryItem()
9549
          self.serialNumber = iprot.readString();
9531
          self.inventoryItem.read(iprot)
-
 
9532
        else:
9550
        else:
9533
          iprot.skip(ftype)
9551
          iprot.skip(ftype)
9534
      elif fid == 2:
9552
      elif fid == 2:
9535
        if ftype == TType.I64:
9553
        if ftype == TType.STRING:
9536
          self.orderId = iprot.readI64();
9554
          self.itemNumber = iprot.readString();
9537
        else:
9555
        else:
9538
          iprot.skip(ftype)
9556
          iprot.skip(ftype)
9539
      elif fid == 3:
9557
      elif fid == 3:
9540
        if ftype == TType.I64:
9558
        if ftype == TType.I64:
9541
          self.quantity = iprot.readI64();
9559
          self.itemId = iprot.readI64();
9542
        else:
9560
        else:
9543
          iprot.skip(ftype)
9561
          iprot.skip(ftype)
9544
      elif fid == 4:
9562
      elif fid == 4:
9545
        if ftype == TType.I64:
9563
        if ftype == TType.I64:
9546
          self.fulfilmentWarehouseId = iprot.readI64();
9564
          self.orderId = iprot.readI64();
9547
        else:
9565
        else:
9548
          iprot.skip(ftype)
9566
          iprot.skip(ftype)
9549
      elif fid == 5:
9567
      elif fid == 5:
9550
        if ftype == TType.I64:
9568
        if ftype == TType.I64:
-
 
9569
          self.fulfilmentWarehouseId = iprot.readI64();
-
 
9570
        else:
-
 
9571
          iprot.skip(ftype)
-
 
9572
      elif fid == 6:
-
 
9573
        if ftype == TType.I64:
-
 
9574
          self.quantity = iprot.readI64();
-
 
9575
        else:
-
 
9576
          iprot.skip(ftype)
-
 
9577
      elif fid == 7:
-
 
9578
        if ftype == TType.I64:
9551
          self.billingWarehouseId = iprot.readI64();
9579
          self.billingWarehouseId = iprot.readI64();
9552
        else:
9580
        else:
9553
          iprot.skip(ftype)
9581
          iprot.skip(ftype)
9554
      else:
9582
      else:
9555
        iprot.skip(ftype)
9583
        iprot.skip(ftype)
Line 9559... Line 9587...
9559
  def write(self, oprot):
9587
  def write(self, oprot):
9560
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
9588
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
9561
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
9589
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
9562
      return
9590
      return
9563
    oprot.writeStructBegin('scanForBadSale_args')
9591
    oprot.writeStructBegin('scanForBadSale_args')
-
 
9592
    if self.serialNumber is not None:
-
 
9593
      oprot.writeFieldBegin('serialNumber', TType.STRING, 1)
-
 
9594
      oprot.writeString(self.serialNumber)
-
 
9595
      oprot.writeFieldEnd()
9564
    if self.inventoryItem is not None:
9596
    if self.itemNumber is not None:
9565
      oprot.writeFieldBegin('inventoryItem', TType.STRUCT, 1)
9597
      oprot.writeFieldBegin('itemNumber', TType.STRING, 2)
-
 
9598
      oprot.writeString(self.itemNumber)
-
 
9599
      oprot.writeFieldEnd()
9566
      self.inventoryItem.write(oprot)
9600
    if self.itemId is not None:
-
 
9601
      oprot.writeFieldBegin('itemId', TType.I64, 3)
-
 
9602
      oprot.writeI64(self.itemId)
9567
      oprot.writeFieldEnd()
9603
      oprot.writeFieldEnd()
9568
    if self.orderId is not None:
9604
    if self.orderId is not None:
9569
      oprot.writeFieldBegin('orderId', TType.I64, 2)
9605
      oprot.writeFieldBegin('orderId', TType.I64, 4)
9570
      oprot.writeI64(self.orderId)
9606
      oprot.writeI64(self.orderId)
9571
      oprot.writeFieldEnd()
9607
      oprot.writeFieldEnd()
9572
    if self.quantity is not None:
-
 
9573
      oprot.writeFieldBegin('quantity', TType.I64, 3)
-
 
9574
      oprot.writeI64(self.quantity)
-
 
9575
      oprot.writeFieldEnd()
-
 
9576
    if self.fulfilmentWarehouseId is not None:
9608
    if self.fulfilmentWarehouseId is not None:
9577
      oprot.writeFieldBegin('fulfilmentWarehouseId', TType.I64, 4)
9609
      oprot.writeFieldBegin('fulfilmentWarehouseId', TType.I64, 5)
9578
      oprot.writeI64(self.fulfilmentWarehouseId)
9610
      oprot.writeI64(self.fulfilmentWarehouseId)
9579
      oprot.writeFieldEnd()
9611
      oprot.writeFieldEnd()
-
 
9612
    if self.quantity is not None:
-
 
9613
      oprot.writeFieldBegin('quantity', TType.I64, 6)
-
 
9614
      oprot.writeI64(self.quantity)
-
 
9615
      oprot.writeFieldEnd()
9580
    if self.billingWarehouseId is not None:
9616
    if self.billingWarehouseId is not None:
9581
      oprot.writeFieldBegin('billingWarehouseId', TType.I64, 5)
9617
      oprot.writeFieldBegin('billingWarehouseId', TType.I64, 7)
9582
      oprot.writeI64(self.billingWarehouseId)
9618
      oprot.writeI64(self.billingWarehouseId)
9583
      oprot.writeFieldEnd()
9619
      oprot.writeFieldEnd()
9584
    oprot.writeFieldStop()
9620
    oprot.writeFieldStop()
9585
    oprot.writeStructEnd()
9621
    oprot.writeStructEnd()
9586
 
9622
 
Line 9598... Line 9634...
9598
 
9634
 
9599
  def __ne__(self, other):
9635
  def __ne__(self, other):
9600
    return not (self == other)
9636
    return not (self == other)
9601
 
9637
 
9602
class scanForBadSale_result:
9638
class scanForBadSale_result:
-
 
9639
  """
-
 
9640
  Attributes:
-
 
9641
   - success
-
 
9642
   - wex
-
 
9643
  """
9603
 
9644
 
9604
  thrift_spec = (
9645
  thrift_spec = (
-
 
9646
    (0, TType.STRUCT, 'success', (InventoryItem, InventoryItem.thrift_spec), None, ), # 0
-
 
9647
    (1, TType.STRUCT, 'wex', (WarehouseServiceException, WarehouseServiceException.thrift_spec), None, ), # 1
9605
  )
9648
  )
9606
 
9649
 
-
 
9650
  def __init__(self, success=None, wex=None,):
-
 
9651
    self.success = success
-
 
9652
    self.wex = wex
-
 
9653
 
9607
  def read(self, iprot):
9654
  def read(self, iprot):
9608
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
9655
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
9609
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
9656
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
9610
      return
9657
      return
9611
    iprot.readStructBegin()
9658
    iprot.readStructBegin()
9612
    while True:
9659
    while True:
9613
      (fname, ftype, fid) = iprot.readFieldBegin()
9660
      (fname, ftype, fid) = iprot.readFieldBegin()
9614
      if ftype == TType.STOP:
9661
      if ftype == TType.STOP:
9615
        break
9662
        break
-
 
9663
      if fid == 0:
-
 
9664
        if ftype == TType.STRUCT:
-
 
9665
          self.success = InventoryItem()
-
 
9666
          self.success.read(iprot)
-
 
9667
        else:
-
 
9668
          iprot.skip(ftype)
-
 
9669
      elif fid == 1:
-
 
9670
        if ftype == TType.STRUCT:
-
 
9671
          self.wex = WarehouseServiceException()
-
 
9672
          self.wex.read(iprot)
-
 
9673
        else:
-
 
9674
          iprot.skip(ftype)
9616
      else:
9675
      else:
9617
        iprot.skip(ftype)
9676
        iprot.skip(ftype)
9618
      iprot.readFieldEnd()
9677
      iprot.readFieldEnd()
9619
    iprot.readStructEnd()
9678
    iprot.readStructEnd()
9620
 
9679
 
9621
  def write(self, oprot):
9680
  def write(self, oprot):
9622
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
9681
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
9623
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
9682
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
9624
      return
9683
      return
9625
    oprot.writeStructBegin('scanForBadSale_result')
9684
    oprot.writeStructBegin('scanForBadSale_result')
-
 
9685
    if self.success is not None:
-
 
9686
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
-
 
9687
      self.success.write(oprot)
-
 
9688
      oprot.writeFieldEnd()
-
 
9689
    if self.wex is not None:
-
 
9690
      oprot.writeFieldBegin('wex', TType.STRUCT, 1)
-
 
9691
      self.wex.write(oprot)
-
 
9692
      oprot.writeFieldEnd()
9626
    oprot.writeFieldStop()
9693
    oprot.writeFieldStop()
9627
    oprot.writeStructEnd()
9694
    oprot.writeStructEnd()
9628
 
9695
 
9629
  def validate(self):
9696
  def validate(self):
9630
    return
9697
    return