| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- <?php
- /*
- * Copyright (c) 2008-2016 vip.com, All Rights Reserved.
- *
- * Powered by com.vip.osp.osp-idlc-2.5.11.
- *
- */
- namespace vipapis\overseas;
- class BatchInfo {
-
- static $_TSPEC;
- public $vendor_id = null;
- public $po_no = null;
- public $co_mode = null;
- public $trade_mode = null;
- public $pallet = null;
- public $schedule_id = null;
- public $product_list = null;
-
- public function __construct($vals=null){
-
- if (!isset(self::$_TSPEC)){
-
- self::$_TSPEC = array(
- 1 => array(
- 'var' => 'vendor_id'
- ),
- 2 => array(
- 'var' => 'po_no'
- ),
- 3 => array(
- 'var' => 'co_mode'
- ),
- 4 => array(
- 'var' => 'trade_mode'
- ),
- 5 => array(
- 'var' => 'pallet'
- ),
- 6 => array(
- 'var' => 'schedule_id'
- ),
- 7 => array(
- 'var' => 'product_list'
- ),
-
- );
-
- }
-
- if (is_array($vals)){
-
-
- if (isset($vals['vendor_id'])){
-
- $this->vendor_id = $vals['vendor_id'];
- }
-
-
- if (isset($vals['po_no'])){
-
- $this->po_no = $vals['po_no'];
- }
-
-
- if (isset($vals['co_mode'])){
-
- $this->co_mode = $vals['co_mode'];
- }
-
-
- if (isset($vals['trade_mode'])){
-
- $this->trade_mode = $vals['trade_mode'];
- }
-
-
- if (isset($vals['pallet'])){
-
- $this->pallet = $vals['pallet'];
- }
-
-
- if (isset($vals['schedule_id'])){
-
- $this->schedule_id = $vals['schedule_id'];
- }
-
-
- if (isset($vals['product_list'])){
-
- $this->product_list = $vals['product_list'];
- }
-
-
- }
-
- }
-
-
- public function getName(){
-
- return 'BatchInfo';
- }
-
- public function read($input){
-
- $input->readStructBegin();
- while(true){
-
- $schemeField = $input->readFieldBegin();
- if ($schemeField == null) break;
- $needSkip = true;
-
-
- if ("vendor_id" == $schemeField){
-
- $needSkip = false;
- $input->readString($this->vendor_id);
-
- }
-
-
-
-
- if ("po_no" == $schemeField){
-
- $needSkip = false;
- $input->readString($this->po_no);
-
- }
-
-
-
-
- if ("co_mode" == $schemeField){
-
- $needSkip = false;
- $input->readString($this->co_mode);
-
- }
-
-
-
-
- if ("trade_mode" == $schemeField){
-
- $needSkip = false;
- $input->readString($this->trade_mode);
-
- }
-
-
-
-
- if ("pallet" == $schemeField){
-
- $needSkip = false;
- $input->readString($this->pallet);
-
- }
-
-
-
-
- if ("schedule_id" == $schemeField){
-
- $needSkip = false;
- $input->readString($this->schedule_id);
-
- }
-
-
-
-
- if ("product_list" == $schemeField){
-
- $needSkip = false;
-
- $this->product_list = array();
- $_size0 = 0;
- $input->readListBegin();
- while(true){
-
- try{
-
- $elem0 = null;
-
- $elem0 = new \vipapis\overseas\BatchDetailInfo();
- $elem0->read($input);
-
- $this->product_list[$_size0++] = $elem0;
- }
- catch(\Exception $e){
-
- break;
- }
- }
-
- $input->readListEnd();
-
- }
-
-
-
- if($needSkip){
-
- \Osp\Protocol\ProtocolUtil::skip($input);
- }
-
- $input->readFieldEnd();
- }
-
- $input->readStructEnd();
-
-
-
- }
-
- public function write($output){
-
- $xfer = 0;
- $xfer += $output->writeStructBegin();
-
- $xfer += $output->writeFieldBegin('vendor_id');
- $xfer += $output->writeString($this->vendor_id);
-
- $xfer += $output->writeFieldEnd();
-
- $xfer += $output->writeFieldBegin('po_no');
- $xfer += $output->writeString($this->po_no);
-
- $xfer += $output->writeFieldEnd();
-
- $xfer += $output->writeFieldBegin('co_mode');
- $xfer += $output->writeString($this->co_mode);
-
- $xfer += $output->writeFieldEnd();
-
- $xfer += $output->writeFieldBegin('trade_mode');
- $xfer += $output->writeString($this->trade_mode);
-
- $xfer += $output->writeFieldEnd();
-
- if($this->pallet !== null) {
-
- $xfer += $output->writeFieldBegin('pallet');
- $xfer += $output->writeString($this->pallet);
-
- $xfer += $output->writeFieldEnd();
- }
-
-
- $xfer += $output->writeFieldBegin('schedule_id');
- $xfer += $output->writeString($this->schedule_id);
-
- $xfer += $output->writeFieldEnd();
-
- $xfer += $output->writeFieldBegin('product_list');
-
- if (!is_array($this->product_list)){
-
- throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
- }
-
- $output->writeListBegin();
- foreach ($this->product_list as $iter0){
-
-
- if (!is_object($iter0)) {
-
- throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
- }
-
- $xfer += $iter0->write($output);
-
- }
-
- $output->writeListEnd();
-
- $xfer += $output->writeFieldEnd();
-
- $xfer += $output->writeFieldStop();
- $xfer += $output->writeStructEnd();
- return $xfer;
- }
-
- }
- ?>
|