WorkInfo.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. <?php
  2. /*
  3. * Copyright (c) 2008-2016 vip.com, All Rights Reserved.
  4. *
  5. * Powered by com.vip.osp.osp-idlc-2.5.11.
  6. *
  7. */
  8. namespace vipapis\vsl;
  9. class WorkInfo {
  10. static $_TSPEC;
  11. public $wo_no = null;
  12. public $wo_status = null;
  13. public $create_time = null;
  14. public $modify_time = null;
  15. public $expect_begin_time = null;
  16. public $expect_finish_time = null;
  17. public $current_handle_user = null;
  18. public $current_handle_group = null;
  19. public $current_step_expect_finish_time = null;
  20. public $pc1_name = null;
  21. public $pc1_id = null;
  22. public $pc2_name = null;
  23. public $pc2_id = null;
  24. public $pc3_name = null;
  25. public $pc3_id = null;
  26. public $problem_desc = null;
  27. public $state_detail = null;
  28. public $additions = null;
  29. public function __construct($vals=null){
  30. if (!isset(self::$_TSPEC)){
  31. self::$_TSPEC = array(
  32. 1 => array(
  33. 'var' => 'wo_no'
  34. ),
  35. 2 => array(
  36. 'var' => 'wo_status'
  37. ),
  38. 3 => array(
  39. 'var' => 'create_time'
  40. ),
  41. 4 => array(
  42. 'var' => 'modify_time'
  43. ),
  44. 5 => array(
  45. 'var' => 'expect_begin_time'
  46. ),
  47. 6 => array(
  48. 'var' => 'expect_finish_time'
  49. ),
  50. 7 => array(
  51. 'var' => 'current_handle_user'
  52. ),
  53. 8 => array(
  54. 'var' => 'current_handle_group'
  55. ),
  56. 9 => array(
  57. 'var' => 'current_step_expect_finish_time'
  58. ),
  59. 10 => array(
  60. 'var' => 'pc1_name'
  61. ),
  62. 11 => array(
  63. 'var' => 'pc1_id'
  64. ),
  65. 12 => array(
  66. 'var' => 'pc2_name'
  67. ),
  68. 13 => array(
  69. 'var' => 'pc2_id'
  70. ),
  71. 14 => array(
  72. 'var' => 'pc3_name'
  73. ),
  74. 15 => array(
  75. 'var' => 'pc3_id'
  76. ),
  77. 16 => array(
  78. 'var' => 'problem_desc'
  79. ),
  80. 17 => array(
  81. 'var' => 'state_detail'
  82. ),
  83. 18 => array(
  84. 'var' => 'additions'
  85. ),
  86. );
  87. }
  88. if (is_array($vals)){
  89. if (isset($vals['wo_no'])){
  90. $this->wo_no = $vals['wo_no'];
  91. }
  92. if (isset($vals['wo_status'])){
  93. $this->wo_status = $vals['wo_status'];
  94. }
  95. if (isset($vals['create_time'])){
  96. $this->create_time = $vals['create_time'];
  97. }
  98. if (isset($vals['modify_time'])){
  99. $this->modify_time = $vals['modify_time'];
  100. }
  101. if (isset($vals['expect_begin_time'])){
  102. $this->expect_begin_time = $vals['expect_begin_time'];
  103. }
  104. if (isset($vals['expect_finish_time'])){
  105. $this->expect_finish_time = $vals['expect_finish_time'];
  106. }
  107. if (isset($vals['current_handle_user'])){
  108. $this->current_handle_user = $vals['current_handle_user'];
  109. }
  110. if (isset($vals['current_handle_group'])){
  111. $this->current_handle_group = $vals['current_handle_group'];
  112. }
  113. if (isset($vals['current_step_expect_finish_time'])){
  114. $this->current_step_expect_finish_time = $vals['current_step_expect_finish_time'];
  115. }
  116. if (isset($vals['pc1_name'])){
  117. $this->pc1_name = $vals['pc1_name'];
  118. }
  119. if (isset($vals['pc1_id'])){
  120. $this->pc1_id = $vals['pc1_id'];
  121. }
  122. if (isset($vals['pc2_name'])){
  123. $this->pc2_name = $vals['pc2_name'];
  124. }
  125. if (isset($vals['pc2_id'])){
  126. $this->pc2_id = $vals['pc2_id'];
  127. }
  128. if (isset($vals['pc3_name'])){
  129. $this->pc3_name = $vals['pc3_name'];
  130. }
  131. if (isset($vals['pc3_id'])){
  132. $this->pc3_id = $vals['pc3_id'];
  133. }
  134. if (isset($vals['problem_desc'])){
  135. $this->problem_desc = $vals['problem_desc'];
  136. }
  137. if (isset($vals['state_detail'])){
  138. $this->state_detail = $vals['state_detail'];
  139. }
  140. if (isset($vals['additions'])){
  141. $this->additions = $vals['additions'];
  142. }
  143. }
  144. }
  145. public function getName(){
  146. return 'WorkInfo';
  147. }
  148. public function read($input){
  149. $input->readStructBegin();
  150. while(true){
  151. $schemeField = $input->readFieldBegin();
  152. if ($schemeField == null) break;
  153. $needSkip = true;
  154. if ("wo_no" == $schemeField){
  155. $needSkip = false;
  156. $input->readString($this->wo_no);
  157. }
  158. if ("wo_status" == $schemeField){
  159. $needSkip = false;
  160. $input->readI32($this->wo_status);
  161. }
  162. if ("create_time" == $schemeField){
  163. $needSkip = false;
  164. $input->readString($this->create_time);
  165. }
  166. if ("modify_time" == $schemeField){
  167. $needSkip = false;
  168. $input->readString($this->modify_time);
  169. }
  170. if ("expect_begin_time" == $schemeField){
  171. $needSkip = false;
  172. $input->readString($this->expect_begin_time);
  173. }
  174. if ("expect_finish_time" == $schemeField){
  175. $needSkip = false;
  176. $input->readString($this->expect_finish_time);
  177. }
  178. if ("current_handle_user" == $schemeField){
  179. $needSkip = false;
  180. $input->readString($this->current_handle_user);
  181. }
  182. if ("current_handle_group" == $schemeField){
  183. $needSkip = false;
  184. $input->readString($this->current_handle_group);
  185. }
  186. if ("current_step_expect_finish_time" == $schemeField){
  187. $needSkip = false;
  188. $input->readString($this->current_step_expect_finish_time);
  189. }
  190. if ("pc1_name" == $schemeField){
  191. $needSkip = false;
  192. $input->readString($this->pc1_name);
  193. }
  194. if ("pc1_id" == $schemeField){
  195. $needSkip = false;
  196. $input->readString($this->pc1_id);
  197. }
  198. if ("pc2_name" == $schemeField){
  199. $needSkip = false;
  200. $input->readString($this->pc2_name);
  201. }
  202. if ("pc2_id" == $schemeField){
  203. $needSkip = false;
  204. $input->readString($this->pc2_id);
  205. }
  206. if ("pc3_name" == $schemeField){
  207. $needSkip = false;
  208. $input->readString($this->pc3_name);
  209. }
  210. if ("pc3_id" == $schemeField){
  211. $needSkip = false;
  212. $input->readString($this->pc3_id);
  213. }
  214. if ("problem_desc" == $schemeField){
  215. $needSkip = false;
  216. $input->readString($this->problem_desc);
  217. }
  218. if ("state_detail" == $schemeField){
  219. $needSkip = false;
  220. $this->state_detail = new \vipapis\vsl\WorkOrderStateDetail();
  221. $this->state_detail->read($input);
  222. }
  223. if ("additions" == $schemeField){
  224. $needSkip = false;
  225. $this->additions = array();
  226. $_size0 = 0;
  227. $input->readListBegin();
  228. while(true){
  229. try{
  230. $elem0 = null;
  231. $elem0 = new \vipapis\vsl\WorkOrderAddition();
  232. $elem0->read($input);
  233. $this->additions[$_size0++] = $elem0;
  234. }
  235. catch(\Exception $e){
  236. break;
  237. }
  238. }
  239. $input->readListEnd();
  240. }
  241. if($needSkip){
  242. \Osp\Protocol\ProtocolUtil::skip($input);
  243. }
  244. $input->readFieldEnd();
  245. }
  246. $input->readStructEnd();
  247. }
  248. public function write($output){
  249. $xfer = 0;
  250. $xfer += $output->writeStructBegin();
  251. $xfer += $output->writeFieldBegin('wo_no');
  252. $xfer += $output->writeString($this->wo_no);
  253. $xfer += $output->writeFieldEnd();
  254. $xfer += $output->writeFieldBegin('wo_status');
  255. $xfer += $output->writeI32($this->wo_status);
  256. $xfer += $output->writeFieldEnd();
  257. $xfer += $output->writeFieldBegin('create_time');
  258. $xfer += $output->writeString($this->create_time);
  259. $xfer += $output->writeFieldEnd();
  260. if($this->modify_time !== null) {
  261. $xfer += $output->writeFieldBegin('modify_time');
  262. $xfer += $output->writeString($this->modify_time);
  263. $xfer += $output->writeFieldEnd();
  264. }
  265. if($this->expect_begin_time !== null) {
  266. $xfer += $output->writeFieldBegin('expect_begin_time');
  267. $xfer += $output->writeString($this->expect_begin_time);
  268. $xfer += $output->writeFieldEnd();
  269. }
  270. if($this->expect_finish_time !== null) {
  271. $xfer += $output->writeFieldBegin('expect_finish_time');
  272. $xfer += $output->writeString($this->expect_finish_time);
  273. $xfer += $output->writeFieldEnd();
  274. }
  275. if($this->current_handle_user !== null) {
  276. $xfer += $output->writeFieldBegin('current_handle_user');
  277. $xfer += $output->writeString($this->current_handle_user);
  278. $xfer += $output->writeFieldEnd();
  279. }
  280. if($this->current_handle_group !== null) {
  281. $xfer += $output->writeFieldBegin('current_handle_group');
  282. $xfer += $output->writeString($this->current_handle_group);
  283. $xfer += $output->writeFieldEnd();
  284. }
  285. if($this->current_step_expect_finish_time !== null) {
  286. $xfer += $output->writeFieldBegin('current_step_expect_finish_time');
  287. $xfer += $output->writeString($this->current_step_expect_finish_time);
  288. $xfer += $output->writeFieldEnd();
  289. }
  290. $xfer += $output->writeFieldBegin('pc1_name');
  291. $xfer += $output->writeString($this->pc1_name);
  292. $xfer += $output->writeFieldEnd();
  293. if($this->pc1_id !== null) {
  294. $xfer += $output->writeFieldBegin('pc1_id');
  295. $xfer += $output->writeString($this->pc1_id);
  296. $xfer += $output->writeFieldEnd();
  297. }
  298. $xfer += $output->writeFieldBegin('pc2_name');
  299. $xfer += $output->writeString($this->pc2_name);
  300. $xfer += $output->writeFieldEnd();
  301. if($this->pc2_id !== null) {
  302. $xfer += $output->writeFieldBegin('pc2_id');
  303. $xfer += $output->writeString($this->pc2_id);
  304. $xfer += $output->writeFieldEnd();
  305. }
  306. $xfer += $output->writeFieldBegin('pc3_name');
  307. $xfer += $output->writeString($this->pc3_name);
  308. $xfer += $output->writeFieldEnd();
  309. if($this->pc3_id !== null) {
  310. $xfer += $output->writeFieldBegin('pc3_id');
  311. $xfer += $output->writeString($this->pc3_id);
  312. $xfer += $output->writeFieldEnd();
  313. }
  314. if($this->problem_desc !== null) {
  315. $xfer += $output->writeFieldBegin('problem_desc');
  316. $xfer += $output->writeString($this->problem_desc);
  317. $xfer += $output->writeFieldEnd();
  318. }
  319. if($this->state_detail !== null) {
  320. $xfer += $output->writeFieldBegin('state_detail');
  321. if (!is_object($this->state_detail)) {
  322. throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
  323. }
  324. $xfer += $this->state_detail->write($output);
  325. $xfer += $output->writeFieldEnd();
  326. }
  327. if($this->additions !== null) {
  328. $xfer += $output->writeFieldBegin('additions');
  329. if (!is_array($this->additions)){
  330. throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
  331. }
  332. $output->writeListBegin();
  333. foreach ($this->additions as $iter0){
  334. if (!is_object($iter0)) {
  335. throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
  336. }
  337. $xfer += $iter0->write($output);
  338. }
  339. $output->writeListEnd();
  340. $xfer += $output->writeFieldEnd();
  341. }
  342. $xfer += $output->writeFieldStop();
  343. $xfer += $output->writeStructEnd();
  344. return $xfer;
  345. }
  346. }
  347. ?>