Subversion Repositories SmartDukaan

Rev

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

Rev 9925 Rev 11751
Line 289... Line 289...
289
     - id
289
     - id
290
     - poStatus
290
     - poStatus
291
    """
291
    """
292
    pass
292
    pass
293
 
293
 
-
 
294
  def getPurchaseReturn(self, id):
-
 
295
    """
-
 
296
    Get Purchase Return from Id
-
 
297
 
-
 
298
    Parameters:
-
 
299
     - id
-
 
300
    """
-
 
301
    pass
-
 
302
 
294
 
303
 
295
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
304
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
296
  def __init__(self, iprot, oprot=None):
305
  def __init__(self, iprot, oprot=None):
297
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
306
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
298
 
307
 
Line 1264... Line 1273...
1264
    self._iprot.readMessageEnd()
1273
    self._iprot.readMessageEnd()
1265
    if result.e is not None:
1274
    if result.e is not None:
1266
      raise result.e
1275
      raise result.e
1267
    return
1276
    return
1268
 
1277
 
-
 
1278
  def getPurchaseReturn(self, id):
-
 
1279
    """
-
 
1280
    Get Purchase Return from Id
-
 
1281
 
-
 
1282
    Parameters:
-
 
1283
     - id
-
 
1284
    """
-
 
1285
    self.send_getPurchaseReturn(id)
-
 
1286
    return self.recv_getPurchaseReturn()
-
 
1287
 
-
 
1288
  def send_getPurchaseReturn(self, id):
-
 
1289
    self._oprot.writeMessageBegin('getPurchaseReturn', TMessageType.CALL, self._seqid)
-
 
1290
    args = getPurchaseReturn_args()
-
 
1291
    args.id = id
-
 
1292
    args.write(self._oprot)
-
 
1293
    self._oprot.writeMessageEnd()
-
 
1294
    self._oprot.trans.flush()
-
 
1295
 
-
 
1296
  def recv_getPurchaseReturn(self, ):
-
 
1297
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
1298
    if mtype == TMessageType.EXCEPTION:
-
 
1299
      x = TApplicationException()
-
 
1300
      x.read(self._iprot)
-
 
1301
      self._iprot.readMessageEnd()
-
 
1302
      raise x
-
 
1303
    result = getPurchaseReturn_result()
-
 
1304
    result.read(self._iprot)
-
 
1305
    self._iprot.readMessageEnd()
-
 
1306
    if result.success is not None:
-
 
1307
      return result.success
-
 
1308
    if result.e is not None:
-
 
1309
      raise result.e
-
 
1310
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPurchaseReturn failed: unknown result");
-
 
1311
 
1269
 
1312
 
1270
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1313
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1271
  def __init__(self, handler):
1314
  def __init__(self, handler):
1272
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1315
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1273
    self._processMap["createPurchaseOrder"] = Processor.process_createPurchaseOrder
1316
    self._processMap["createPurchaseOrder"] = Processor.process_createPurchaseOrder
Line 1297... Line 1340...
1297
    self._processMap["fulfillPOForExtBilling"] = Processor.process_fulfillPOForExtBilling
1340
    self._processMap["fulfillPOForExtBilling"] = Processor.process_fulfillPOForExtBilling
1298
    self._processMap["closePO"] = Processor.process_closePO
1341
    self._processMap["closePO"] = Processor.process_closePO
1299
    self._processMap["isInvoiceReceived"] = Processor.process_isInvoiceReceived
1342
    self._processMap["isInvoiceReceived"] = Processor.process_isInvoiceReceived
1300
    self._processMap["changeWarehouseForPO"] = Processor.process_changeWarehouseForPO
1343
    self._processMap["changeWarehouseForPO"] = Processor.process_changeWarehouseForPO
1301
    self._processMap["changePOStatus"] = Processor.process_changePOStatus
1344
    self._processMap["changePOStatus"] = Processor.process_changePOStatus
-
 
1345
    self._processMap["getPurchaseReturn"] = Processor.process_getPurchaseReturn
1302
 
1346
 
1303
  def process(self, iprot, oprot):
1347
  def process(self, iprot, oprot):
1304
    (name, type, seqid) = iprot.readMessageBegin()
1348
    (name, type, seqid) = iprot.readMessageBegin()
1305
    if name not in self._processMap:
1349
    if name not in self._processMap:
1306
      iprot.skip(TType.STRUCT)
1350
      iprot.skip(TType.STRUCT)
Line 1683... Line 1727...
1683
    oprot.writeMessageBegin("changePOStatus", TMessageType.REPLY, seqid)
1727
    oprot.writeMessageBegin("changePOStatus", TMessageType.REPLY, seqid)
1684
    result.write(oprot)
1728
    result.write(oprot)
1685
    oprot.writeMessageEnd()
1729
    oprot.writeMessageEnd()
1686
    oprot.trans.flush()
1730
    oprot.trans.flush()
1687
 
1731
 
-
 
1732
  def process_getPurchaseReturn(self, seqid, iprot, oprot):
-
 
1733
    args = getPurchaseReturn_args()
-
 
1734
    args.read(iprot)
-
 
1735
    iprot.readMessageEnd()
-
 
1736
    result = getPurchaseReturn_result()
-
 
1737
    try:
-
 
1738
      result.success = self._handler.getPurchaseReturn(args.id)
-
 
1739
    except PurchaseServiceException, e:
-
 
1740
      result.e = e
-
 
1741
    oprot.writeMessageBegin("getPurchaseReturn", TMessageType.REPLY, seqid)
-
 
1742
    result.write(oprot)
-
 
1743
    oprot.writeMessageEnd()
-
 
1744
    oprot.trans.flush()
-
 
1745
 
1688
 
1746
 
1689
# HELPER FUNCTIONS AND STRUCTURES
1747
# HELPER FUNCTIONS AND STRUCTURES
1690
 
1748
 
1691
class createPurchaseOrder_args:
1749
class createPurchaseOrder_args:
1692
  """
1750
  """
Line 5472... Line 5530...
5472
    if self.e is not None:
5530
    if self.e is not None:
5473
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
5531
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
5474
      self.e.write(oprot)
5532
      self.e.write(oprot)
5475
      oprot.writeFieldEnd()
5533
      oprot.writeFieldEnd()
5476
    oprot.writeFieldStop()
5534
    oprot.writeFieldStop()
-
 
5535
    oprot.writeStructEnd()
-
 
5536
 
-
 
5537
  def validate(self):
-
 
5538
    return
-
 
5539
 
-
 
5540
 
-
 
5541
  def __repr__(self):
-
 
5542
    L = ['%s=%r' % (key, value)
-
 
5543
      for key, value in self.__dict__.iteritems()]
-
 
5544
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
5545
 
-
 
5546
  def __eq__(self, other):
-
 
5547
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
5548
 
-
 
5549
  def __ne__(self, other):
-
 
5550
    return not (self == other)
-
 
5551
 
-
 
5552
class getPurchaseReturn_args:
-
 
5553
  """
-
 
5554
  Attributes:
-
 
5555
   - id
-
 
5556
  """
-
 
5557
 
-
 
5558
  thrift_spec = (
-
 
5559
    None, # 0
-
 
5560
    (1, TType.I64, 'id', None, None, ), # 1
-
 
5561
  )
-
 
5562
 
-
 
5563
  def __init__(self, id=None,):
-
 
5564
    self.id = id
-
 
5565
 
-
 
5566
  def read(self, iprot):
-
 
5567
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
5568
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
5569
      return
-
 
5570
    iprot.readStructBegin()
-
 
5571
    while True:
-
 
5572
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
5573
      if ftype == TType.STOP:
-
 
5574
        break
-
 
5575
      if fid == 1:
-
 
5576
        if ftype == TType.I64:
-
 
5577
          self.id = iprot.readI64();
-
 
5578
        else:
-
 
5579
          iprot.skip(ftype)
-
 
5580
      else:
-
 
5581
        iprot.skip(ftype)
-
 
5582
      iprot.readFieldEnd()
-
 
5583
    iprot.readStructEnd()
-
 
5584
 
-
 
5585
  def write(self, oprot):
-
 
5586
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
5587
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
5588
      return
-
 
5589
    oprot.writeStructBegin('getPurchaseReturn_args')
-
 
5590
    if self.id is not None:
-
 
5591
      oprot.writeFieldBegin('id', TType.I64, 1)
-
 
5592
      oprot.writeI64(self.id)
-
 
5593
      oprot.writeFieldEnd()
-
 
5594
    oprot.writeFieldStop()
-
 
5595
    oprot.writeStructEnd()
-
 
5596
 
-
 
5597
  def validate(self):
-
 
5598
    return
-
 
5599
 
-
 
5600
 
-
 
5601
  def __repr__(self):
-
 
5602
    L = ['%s=%r' % (key, value)
-
 
5603
      for key, value in self.__dict__.iteritems()]
-
 
5604
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
5605
 
-
 
5606
  def __eq__(self, other):
-
 
5607
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
5608
 
-
 
5609
  def __ne__(self, other):
-
 
5610
    return not (self == other)
-
 
5611
 
-
 
5612
class getPurchaseReturn_result:
-
 
5613
  """
-
 
5614
  Attributes:
-
 
5615
   - success
-
 
5616
   - e
-
 
5617
  """
-
 
5618
 
-
 
5619
  thrift_spec = (
-
 
5620
    (0, TType.STRUCT, 'success', (PurchaseReturn, PurchaseReturn.thrift_spec), None, ), # 0
-
 
5621
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
-
 
5622
  )
-
 
5623
 
-
 
5624
  def __init__(self, success=None, e=None,):
-
 
5625
    self.success = success
-
 
5626
    self.e = e
-
 
5627
 
-
 
5628
  def read(self, iprot):
-
 
5629
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
5630
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
5631
      return
-
 
5632
    iprot.readStructBegin()
-
 
5633
    while True:
-
 
5634
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
5635
      if ftype == TType.STOP:
-
 
5636
        break
-
 
5637
      if fid == 0:
-
 
5638
        if ftype == TType.STRUCT:
-
 
5639
          self.success = PurchaseReturn()
-
 
5640
          self.success.read(iprot)
-
 
5641
        else:
-
 
5642
          iprot.skip(ftype)
-
 
5643
      elif fid == 1:
-
 
5644
        if ftype == TType.STRUCT:
-
 
5645
          self.e = PurchaseServiceException()
-
 
5646
          self.e.read(iprot)
-
 
5647
        else:
-
 
5648
          iprot.skip(ftype)
-
 
5649
      else:
-
 
5650
        iprot.skip(ftype)
-
 
5651
      iprot.readFieldEnd()
-
 
5652
    iprot.readStructEnd()
-
 
5653
 
-
 
5654
  def write(self, oprot):
-
 
5655
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
5656
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
5657
      return
-
 
5658
    oprot.writeStructBegin('getPurchaseReturn_result')
-
 
5659
    if self.success is not None:
-
 
5660
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
-
 
5661
      self.success.write(oprot)
-
 
5662
      oprot.writeFieldEnd()
-
 
5663
    if self.e is not None:
-
 
5664
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
-
 
5665
      self.e.write(oprot)
-
 
5666
      oprot.writeFieldEnd()
-
 
5667
    oprot.writeFieldStop()
5477
    oprot.writeStructEnd()
5668
    oprot.writeStructEnd()
5478
 
5669
 
5479
  def validate(self):
5670
  def validate(self):
5480
    return
5671
    return
5481
 
5672