Subversion Repositories SmartDukaan

Rev

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

Rev 3553 Rev 3956
Line 599... Line 599...
599
     - orderId
599
     - orderId
600
     - delayReason
600
     - delayReason
601
    """
601
    """
602
    pass
602
    pass
603
 
603
 
-
 
604
  def reconcileCodCollection(self, collectedAmountMap, xferBy, xferTxnId, xferDate):
-
 
605
    """
-
 
606
    Marks the COD orders with given AWB nos. as having been processed.
-
 
607
    Updates the captured amount for the corresponding payment.
-
 
608
 
-
 
609
    Returns a map of AWBs which were not processed and the associated reason. An AWB is not processed if:
-
 
610
    1. There is no order corresponding to an AWB number.
-
 
611
    2. The captured amount for a payment exceeds the total payment.
-
 
612
    3. The order corresponding to an AWB no. is in a state prior to DELIVERY_SUCCESS.
-
 
613
 
-
 
614
    Parameters:
-
 
615
     - collectedAmountMap
-
 
616
     - xferBy
-
 
617
     - xferTxnId
-
 
618
     - xferDate
-
 
619
    """
-
 
620
    pass
-
 
621
 
604
 
622
 
605
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
623
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
606
  def __init__(self, iprot, oprot=None):
624
  def __init__(self, iprot, oprot=None):
607
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
625
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
608
 
626
 
Line 2560... Line 2578...
2560
      return result.success
2578
      return result.success
2561
    if result.ex is not None:
2579
    if result.ex is not None:
2562
      raise result.ex
2580
      raise result.ex
2563
    raise TApplicationException(TApplicationException.MISSING_RESULT, "addDelayReason failed: unknown result");
2581
    raise TApplicationException(TApplicationException.MISSING_RESULT, "addDelayReason failed: unknown result");
2564
 
2582
 
-
 
2583
  def reconcileCodCollection(self, collectedAmountMap, xferBy, xferTxnId, xferDate):
-
 
2584
    """
-
 
2585
    Marks the COD orders with given AWB nos. as having been processed.
-
 
2586
    Updates the captured amount for the corresponding payment.
-
 
2587
 
-
 
2588
    Returns a map of AWBs which were not processed and the associated reason. An AWB is not processed if:
-
 
2589
    1. There is no order corresponding to an AWB number.
-
 
2590
    2. The captured amount for a payment exceeds the total payment.
-
 
2591
    3. The order corresponding to an AWB no. is in a state prior to DELIVERY_SUCCESS.
-
 
2592
 
-
 
2593
    Parameters:
-
 
2594
     - collectedAmountMap
-
 
2595
     - xferBy
-
 
2596
     - xferTxnId
-
 
2597
     - xferDate
-
 
2598
    """
-
 
2599
    self.send_reconcileCodCollection(collectedAmountMap, xferBy, xferTxnId, xferDate)
-
 
2600
    return self.recv_reconcileCodCollection()
-
 
2601
 
-
 
2602
  def send_reconcileCodCollection(self, collectedAmountMap, xferBy, xferTxnId, xferDate):
-
 
2603
    self._oprot.writeMessageBegin('reconcileCodCollection', TMessageType.CALL, self._seqid)
-
 
2604
    args = reconcileCodCollection_args()
-
 
2605
    args.collectedAmountMap = collectedAmountMap
-
 
2606
    args.xferBy = xferBy
-
 
2607
    args.xferTxnId = xferTxnId
-
 
2608
    args.xferDate = xferDate
-
 
2609
    args.write(self._oprot)
-
 
2610
    self._oprot.writeMessageEnd()
-
 
2611
    self._oprot.trans.flush()
-
 
2612
 
-
 
2613
  def recv_reconcileCodCollection(self, ):
-
 
2614
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2615
    if mtype == TMessageType.EXCEPTION:
-
 
2616
      x = TApplicationException()
-
 
2617
      x.read(self._iprot)
-
 
2618
      self._iprot.readMessageEnd()
-
 
2619
      raise x
-
 
2620
    result = reconcileCodCollection_result()
-
 
2621
    result.read(self._iprot)
-
 
2622
    self._iprot.readMessageEnd()
-
 
2623
    if result.success is not None:
-
 
2624
      return result.success
-
 
2625
    if result.ex is not None:
-
 
2626
      raise result.ex
-
 
2627
    raise TApplicationException(TApplicationException.MISSING_RESULT, "reconcileCodCollection failed: unknown result");
-
 
2628
 
2565
 
2629
 
2566
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2630
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2567
  def __init__(self, handler):
2631
  def __init__(self, handler):
2568
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2632
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2569
    self._processMap["createTransaction"] = Processor.process_createTransaction
2633
    self._processMap["createTransaction"] = Processor.process_createTransaction
Line 2618... Line 2682...
2618
    self._processMap["createPurchaseOrder"] = Processor.process_createPurchaseOrder
2682
    self._processMap["createPurchaseOrder"] = Processor.process_createPurchaseOrder
2619
    self._processMap["updateWeight"] = Processor.process_updateWeight
2683
    self._processMap["updateWeight"] = Processor.process_updateWeight
2620
    self._processMap["changeItem"] = Processor.process_changeItem
2684
    self._processMap["changeItem"] = Processor.process_changeItem
2621
    self._processMap["shiftToWarehouse"] = Processor.process_shiftToWarehouse
2685
    self._processMap["shiftToWarehouse"] = Processor.process_shiftToWarehouse
2622
    self._processMap["addDelayReason"] = Processor.process_addDelayReason
2686
    self._processMap["addDelayReason"] = Processor.process_addDelayReason
-
 
2687
    self._processMap["reconcileCodCollection"] = Processor.process_reconcileCodCollection
2623
 
2688
 
2624
  def process(self, iprot, oprot):
2689
  def process(self, iprot, oprot):
2625
    (name, type, seqid) = iprot.readMessageBegin()
2690
    (name, type, seqid) = iprot.readMessageBegin()
2626
    if name not in self._processMap:
2691
    if name not in self._processMap:
2627
      iprot.skip(TType.STRUCT)
2692
      iprot.skip(TType.STRUCT)
Line 3363... Line 3428...
3363
    oprot.writeMessageBegin("addDelayReason", TMessageType.REPLY, seqid)
3428
    oprot.writeMessageBegin("addDelayReason", TMessageType.REPLY, seqid)
3364
    result.write(oprot)
3429
    result.write(oprot)
3365
    oprot.writeMessageEnd()
3430
    oprot.writeMessageEnd()
3366
    oprot.trans.flush()
3431
    oprot.trans.flush()
3367
 
3432
 
-
 
3433
  def process_reconcileCodCollection(self, seqid, iprot, oprot):
-
 
3434
    args = reconcileCodCollection_args()
-
 
3435
    args.read(iprot)
-
 
3436
    iprot.readMessageEnd()
-
 
3437
    result = reconcileCodCollection_result()
-
 
3438
    try:
-
 
3439
      result.success = self._handler.reconcileCodCollection(args.collectedAmountMap, args.xferBy, args.xferTxnId, args.xferDate)
-
 
3440
    except TransactionServiceException, ex:
-
 
3441
      result.ex = ex
-
 
3442
    oprot.writeMessageBegin("reconcileCodCollection", TMessageType.REPLY, seqid)
-
 
3443
    result.write(oprot)
-
 
3444
    oprot.writeMessageEnd()
-
 
3445
    oprot.trans.flush()
-
 
3446
 
3368
 
3447
 
3369
# HELPER FUNCTIONS AND STRUCTURES
3448
# HELPER FUNCTIONS AND STRUCTURES
3370
 
3449
 
3371
class createTransaction_args:
3450
class createTransaction_args:
3372
  """
3451
  """
Line 11106... Line 11185...
11106
      oprot.writeFieldEnd()
11185
      oprot.writeFieldEnd()
11107
    if self.ex is not None:
11186
    if self.ex is not None:
11108
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
11187
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
11109
      self.ex.write(oprot)
11188
      self.ex.write(oprot)
11110
      oprot.writeFieldEnd()
11189
      oprot.writeFieldEnd()
-
 
11190
    oprot.writeFieldStop()
-
 
11191
    oprot.writeStructEnd()
-
 
11192
 
-
 
11193
  def validate(self):
-
 
11194
    return
-
 
11195
 
-
 
11196
 
-
 
11197
  def __repr__(self):
-
 
11198
    L = ['%s=%r' % (key, value)
-
 
11199
      for key, value in self.__dict__.iteritems()]
-
 
11200
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
11201
 
-
 
11202
  def __eq__(self, other):
-
 
11203
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
11204
 
-
 
11205
  def __ne__(self, other):
-
 
11206
    return not (self == other)
-
 
11207
 
-
 
11208
class reconcileCodCollection_args:
-
 
11209
  """
-
 
11210
  Attributes:
-
 
11211
   - collectedAmountMap
-
 
11212
   - xferBy
-
 
11213
   - xferTxnId
-
 
11214
   - xferDate
-
 
11215
  """
-
 
11216
 
-
 
11217
  thrift_spec = (
-
 
11218
    None, # 0
-
 
11219
    (1, TType.MAP, 'collectedAmountMap', (TType.STRING,None,TType.DOUBLE,None), None, ), # 1
-
 
11220
    (2, TType.STRING, 'xferBy', None, None, ), # 2
-
 
11221
    (3, TType.STRING, 'xferTxnId', None, None, ), # 3
-
 
11222
    (4, TType.I64, 'xferDate', None, None, ), # 4
-
 
11223
  )
-
 
11224
 
-
 
11225
  def __init__(self, collectedAmountMap=None, xferBy=None, xferTxnId=None, xferDate=None,):
-
 
11226
    self.collectedAmountMap = collectedAmountMap
-
 
11227
    self.xferBy = xferBy
-
 
11228
    self.xferTxnId = xferTxnId
-
 
11229
    self.xferDate = xferDate
-
 
11230
 
-
 
11231
  def read(self, iprot):
-
 
11232
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
11233
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
11234
      return
-
 
11235
    iprot.readStructBegin()
-
 
11236
    while True:
-
 
11237
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
11238
      if ftype == TType.STOP:
-
 
11239
        break
-
 
11240
      if fid == 1:
-
 
11241
        if ftype == TType.MAP:
-
 
11242
          self.collectedAmountMap = {}
-
 
11243
          (_ktype193, _vtype194, _size192 ) = iprot.readMapBegin() 
-
 
11244
          for _i196 in xrange(_size192):
-
 
11245
            _key197 = iprot.readString();
-
 
11246
            _val198 = iprot.readDouble();
-
 
11247
            self.collectedAmountMap[_key197] = _val198
-
 
11248
          iprot.readMapEnd()
-
 
11249
        else:
-
 
11250
          iprot.skip(ftype)
-
 
11251
      elif fid == 2:
-
 
11252
        if ftype == TType.STRING:
-
 
11253
          self.xferBy = iprot.readString();
-
 
11254
        else:
-
 
11255
          iprot.skip(ftype)
-
 
11256
      elif fid == 3:
-
 
11257
        if ftype == TType.STRING:
-
 
11258
          self.xferTxnId = iprot.readString();
-
 
11259
        else:
-
 
11260
          iprot.skip(ftype)
-
 
11261
      elif fid == 4:
-
 
11262
        if ftype == TType.I64:
-
 
11263
          self.xferDate = iprot.readI64();
-
 
11264
        else:
-
 
11265
          iprot.skip(ftype)
-
 
11266
      else:
-
 
11267
        iprot.skip(ftype)
-
 
11268
      iprot.readFieldEnd()
-
 
11269
    iprot.readStructEnd()
-
 
11270
 
-
 
11271
  def write(self, oprot):
-
 
11272
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
11273
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
11274
      return
-
 
11275
    oprot.writeStructBegin('reconcileCodCollection_args')
-
 
11276
    if self.collectedAmountMap is not None:
-
 
11277
      oprot.writeFieldBegin('collectedAmountMap', TType.MAP, 1)
-
 
11278
      oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.collectedAmountMap))
-
 
11279
      for kiter199,viter200 in self.collectedAmountMap.items():
-
 
11280
        oprot.writeString(kiter199)
-
 
11281
        oprot.writeDouble(viter200)
-
 
11282
      oprot.writeMapEnd()
-
 
11283
      oprot.writeFieldEnd()
-
 
11284
    if self.xferBy is not None:
-
 
11285
      oprot.writeFieldBegin('xferBy', TType.STRING, 2)
-
 
11286
      oprot.writeString(self.xferBy)
-
 
11287
      oprot.writeFieldEnd()
-
 
11288
    if self.xferTxnId is not None:
-
 
11289
      oprot.writeFieldBegin('xferTxnId', TType.STRING, 3)
-
 
11290
      oprot.writeString(self.xferTxnId)
-
 
11291
      oprot.writeFieldEnd()
-
 
11292
    if self.xferDate is not None:
-
 
11293
      oprot.writeFieldBegin('xferDate', TType.I64, 4)
-
 
11294
      oprot.writeI64(self.xferDate)
-
 
11295
      oprot.writeFieldEnd()
-
 
11296
    oprot.writeFieldStop()
-
 
11297
    oprot.writeStructEnd()
-
 
11298
 
-
 
11299
  def validate(self):
-
 
11300
    return
-
 
11301
 
-
 
11302
 
-
 
11303
  def __repr__(self):
-
 
11304
    L = ['%s=%r' % (key, value)
-
 
11305
      for key, value in self.__dict__.iteritems()]
-
 
11306
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
11307
 
-
 
11308
  def __eq__(self, other):
-
 
11309
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
11310
 
-
 
11311
  def __ne__(self, other):
-
 
11312
    return not (self == other)
-
 
11313
 
-
 
11314
class reconcileCodCollection_result:
-
 
11315
  """
-
 
11316
  Attributes:
-
 
11317
   - success
-
 
11318
   - ex
-
 
11319
  """
-
 
11320
 
-
 
11321
  thrift_spec = (
-
 
11322
    (0, TType.MAP, 'success', (TType.STRING,None,TType.STRING,None), None, ), # 0
-
 
11323
    (1, TType.STRUCT, 'ex', (TransactionServiceException, TransactionServiceException.thrift_spec), None, ), # 1
-
 
11324
  )
-
 
11325
 
-
 
11326
  def __init__(self, success=None, ex=None,):
-
 
11327
    self.success = success
-
 
11328
    self.ex = ex
-
 
11329
 
-
 
11330
  def read(self, iprot):
-
 
11331
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
11332
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
11333
      return
-
 
11334
    iprot.readStructBegin()
-
 
11335
    while True:
-
 
11336
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
11337
      if ftype == TType.STOP:
-
 
11338
        break
-
 
11339
      if fid == 0:
-
 
11340
        if ftype == TType.MAP:
-
 
11341
          self.success = {}
-
 
11342
          (_ktype202, _vtype203, _size201 ) = iprot.readMapBegin() 
-
 
11343
          for _i205 in xrange(_size201):
-
 
11344
            _key206 = iprot.readString();
-
 
11345
            _val207 = iprot.readString();
-
 
11346
            self.success[_key206] = _val207
-
 
11347
          iprot.readMapEnd()
-
 
11348
        else:
-
 
11349
          iprot.skip(ftype)
-
 
11350
      elif fid == 1:
-
 
11351
        if ftype == TType.STRUCT:
-
 
11352
          self.ex = TransactionServiceException()
-
 
11353
          self.ex.read(iprot)
-
 
11354
        else:
-
 
11355
          iprot.skip(ftype)
-
 
11356
      else:
-
 
11357
        iprot.skip(ftype)
-
 
11358
      iprot.readFieldEnd()
-
 
11359
    iprot.readStructEnd()
-
 
11360
 
-
 
11361
  def write(self, oprot):
-
 
11362
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
11363
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
11364
      return
-
 
11365
    oprot.writeStructBegin('reconcileCodCollection_result')
-
 
11366
    if self.success is not None:
-
 
11367
      oprot.writeFieldBegin('success', TType.MAP, 0)
-
 
11368
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success))
-
 
11369
      for kiter208,viter209 in self.success.items():
-
 
11370
        oprot.writeString(kiter208)
-
 
11371
        oprot.writeString(viter209)
-
 
11372
      oprot.writeMapEnd()
-
 
11373
      oprot.writeFieldEnd()
-
 
11374
    if self.ex is not None:
-
 
11375
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
-
 
11376
      self.ex.write(oprot)
-
 
11377
      oprot.writeFieldEnd()
11111
    oprot.writeFieldStop()
11378
    oprot.writeFieldStop()
11112
    oprot.writeStructEnd()
11379
    oprot.writeStructEnd()
11113
 
11380
 
11114
  def validate(self):
11381
  def validate(self):
11115
    return
11382
    return