采购订单主表数据同步.ktr 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <transformation>
  3. <info>
  4. <name>采购订单主表数据同步</name>
  5. <description/>
  6. <extended_description/>
  7. <trans_version/>
  8. <trans_type>Normal</trans_type>
  9. <trans_status>0</trans_status>
  10. <directory>/</directory>
  11. <parameters>
  12. </parameters>
  13. <log>
  14. <trans-log-table>
  15. <connection/>
  16. <schema/>
  17. <table/>
  18. <size_limit_lines/>
  19. <interval/>
  20. <timeout_days/>
  21. <field>
  22. <id>ID_BATCH</id>
  23. <enabled>Y</enabled>
  24. <name>ID_BATCH</name>
  25. </field>
  26. <field>
  27. <id>CHANNEL_ID</id>
  28. <enabled>Y</enabled>
  29. <name>CHANNEL_ID</name>
  30. </field>
  31. <field>
  32. <id>TRANSNAME</id>
  33. <enabled>Y</enabled>
  34. <name>TRANSNAME</name>
  35. </field>
  36. <field>
  37. <id>STATUS</id>
  38. <enabled>Y</enabled>
  39. <name>STATUS</name>
  40. </field>
  41. <field>
  42. <id>LINES_READ</id>
  43. <enabled>Y</enabled>
  44. <name>LINES_READ</name>
  45. <subject/>
  46. </field>
  47. <field>
  48. <id>LINES_WRITTEN</id>
  49. <enabled>Y</enabled>
  50. <name>LINES_WRITTEN</name>
  51. <subject/>
  52. </field>
  53. <field>
  54. <id>LINES_UPDATED</id>
  55. <enabled>Y</enabled>
  56. <name>LINES_UPDATED</name>
  57. <subject/>
  58. </field>
  59. <field>
  60. <id>LINES_INPUT</id>
  61. <enabled>Y</enabled>
  62. <name>LINES_INPUT</name>
  63. <subject/>
  64. </field>
  65. <field>
  66. <id>LINES_OUTPUT</id>
  67. <enabled>Y</enabled>
  68. <name>LINES_OUTPUT</name>
  69. <subject/>
  70. </field>
  71. <field>
  72. <id>LINES_REJECTED</id>
  73. <enabled>Y</enabled>
  74. <name>LINES_REJECTED</name>
  75. <subject/>
  76. </field>
  77. <field>
  78. <id>ERRORS</id>
  79. <enabled>Y</enabled>
  80. <name>ERRORS</name>
  81. </field>
  82. <field>
  83. <id>STARTDATE</id>
  84. <enabled>Y</enabled>
  85. <name>STARTDATE</name>
  86. </field>
  87. <field>
  88. <id>ENDDATE</id>
  89. <enabled>Y</enabled>
  90. <name>ENDDATE</name>
  91. </field>
  92. <field>
  93. <id>LOGDATE</id>
  94. <enabled>Y</enabled>
  95. <name>LOGDATE</name>
  96. </field>
  97. <field>
  98. <id>DEPDATE</id>
  99. <enabled>Y</enabled>
  100. <name>DEPDATE</name>
  101. </field>
  102. <field>
  103. <id>REPLAYDATE</id>
  104. <enabled>Y</enabled>
  105. <name>REPLAYDATE</name>
  106. </field>
  107. <field>
  108. <id>LOG_FIELD</id>
  109. <enabled>Y</enabled>
  110. <name>LOG_FIELD</name>
  111. </field>
  112. <field>
  113. <id>EXECUTING_SERVER</id>
  114. <enabled>N</enabled>
  115. <name>EXECUTING_SERVER</name>
  116. </field>
  117. <field>
  118. <id>EXECUTING_USER</id>
  119. <enabled>N</enabled>
  120. <name>EXECUTING_USER</name>
  121. </field>
  122. <field>
  123. <id>CLIENT</id>
  124. <enabled>N</enabled>
  125. <name>CLIENT</name>
  126. </field>
  127. </trans-log-table>
  128. <perf-log-table>
  129. <connection/>
  130. <schema/>
  131. <table/>
  132. <interval/>
  133. <timeout_days/>
  134. <field>
  135. <id>ID_BATCH</id>
  136. <enabled>Y</enabled>
  137. <name>ID_BATCH</name>
  138. </field>
  139. <field>
  140. <id>SEQ_NR</id>
  141. <enabled>Y</enabled>
  142. <name>SEQ_NR</name>
  143. </field>
  144. <field>
  145. <id>LOGDATE</id>
  146. <enabled>Y</enabled>
  147. <name>LOGDATE</name>
  148. </field>
  149. <field>
  150. <id>TRANSNAME</id>
  151. <enabled>Y</enabled>
  152. <name>TRANSNAME</name>
  153. </field>
  154. <field>
  155. <id>STEPNAME</id>
  156. <enabled>Y</enabled>
  157. <name>STEPNAME</name>
  158. </field>
  159. <field>
  160. <id>STEP_COPY</id>
  161. <enabled>Y</enabled>
  162. <name>STEP_COPY</name>
  163. </field>
  164. <field>
  165. <id>LINES_READ</id>
  166. <enabled>Y</enabled>
  167. <name>LINES_READ</name>
  168. </field>
  169. <field>
  170. <id>LINES_WRITTEN</id>
  171. <enabled>Y</enabled>
  172. <name>LINES_WRITTEN</name>
  173. </field>
  174. <field>
  175. <id>LINES_UPDATED</id>
  176. <enabled>Y</enabled>
  177. <name>LINES_UPDATED</name>
  178. </field>
  179. <field>
  180. <id>LINES_INPUT</id>
  181. <enabled>Y</enabled>
  182. <name>LINES_INPUT</name>
  183. </field>
  184. <field>
  185. <id>LINES_OUTPUT</id>
  186. <enabled>Y</enabled>
  187. <name>LINES_OUTPUT</name>
  188. </field>
  189. <field>
  190. <id>LINES_REJECTED</id>
  191. <enabled>Y</enabled>
  192. <name>LINES_REJECTED</name>
  193. </field>
  194. <field>
  195. <id>ERRORS</id>
  196. <enabled>Y</enabled>
  197. <name>ERRORS</name>
  198. </field>
  199. <field>
  200. <id>INPUT_BUFFER_ROWS</id>
  201. <enabled>Y</enabled>
  202. <name>INPUT_BUFFER_ROWS</name>
  203. </field>
  204. <field>
  205. <id>OUTPUT_BUFFER_ROWS</id>
  206. <enabled>Y</enabled>
  207. <name>OUTPUT_BUFFER_ROWS</name>
  208. </field>
  209. </perf-log-table>
  210. <channel-log-table>
  211. <connection/>
  212. <schema/>
  213. <table/>
  214. <timeout_days/>
  215. <field>
  216. <id>ID_BATCH</id>
  217. <enabled>Y</enabled>
  218. <name>ID_BATCH</name>
  219. </field>
  220. <field>
  221. <id>CHANNEL_ID</id>
  222. <enabled>Y</enabled>
  223. <name>CHANNEL_ID</name>
  224. </field>
  225. <field>
  226. <id>LOG_DATE</id>
  227. <enabled>Y</enabled>
  228. <name>LOG_DATE</name>
  229. </field>
  230. <field>
  231. <id>LOGGING_OBJECT_TYPE</id>
  232. <enabled>Y</enabled>
  233. <name>LOGGING_OBJECT_TYPE</name>
  234. </field>
  235. <field>
  236. <id>OBJECT_NAME</id>
  237. <enabled>Y</enabled>
  238. <name>OBJECT_NAME</name>
  239. </field>
  240. <field>
  241. <id>OBJECT_COPY</id>
  242. <enabled>Y</enabled>
  243. <name>OBJECT_COPY</name>
  244. </field>
  245. <field>
  246. <id>REPOSITORY_DIRECTORY</id>
  247. <enabled>Y</enabled>
  248. <name>REPOSITORY_DIRECTORY</name>
  249. </field>
  250. <field>
  251. <id>FILENAME</id>
  252. <enabled>Y</enabled>
  253. <name>FILENAME</name>
  254. </field>
  255. <field>
  256. <id>OBJECT_ID</id>
  257. <enabled>Y</enabled>
  258. <name>OBJECT_ID</name>
  259. </field>
  260. <field>
  261. <id>OBJECT_REVISION</id>
  262. <enabled>Y</enabled>
  263. <name>OBJECT_REVISION</name>
  264. </field>
  265. <field>
  266. <id>PARENT_CHANNEL_ID</id>
  267. <enabled>Y</enabled>
  268. <name>PARENT_CHANNEL_ID</name>
  269. </field>
  270. <field>
  271. <id>ROOT_CHANNEL_ID</id>
  272. <enabled>Y</enabled>
  273. <name>ROOT_CHANNEL_ID</name>
  274. </field>
  275. </channel-log-table>
  276. <step-log-table>
  277. <connection/>
  278. <schema/>
  279. <table/>
  280. <timeout_days/>
  281. <field>
  282. <id>ID_BATCH</id>
  283. <enabled>Y</enabled>
  284. <name>ID_BATCH</name>
  285. </field>
  286. <field>
  287. <id>CHANNEL_ID</id>
  288. <enabled>Y</enabled>
  289. <name>CHANNEL_ID</name>
  290. </field>
  291. <field>
  292. <id>LOG_DATE</id>
  293. <enabled>Y</enabled>
  294. <name>LOG_DATE</name>
  295. </field>
  296. <field>
  297. <id>TRANSNAME</id>
  298. <enabled>Y</enabled>
  299. <name>TRANSNAME</name>
  300. </field>
  301. <field>
  302. <id>STEPNAME</id>
  303. <enabled>Y</enabled>
  304. <name>STEPNAME</name>
  305. </field>
  306. <field>
  307. <id>STEP_COPY</id>
  308. <enabled>Y</enabled>
  309. <name>STEP_COPY</name>
  310. </field>
  311. <field>
  312. <id>LINES_READ</id>
  313. <enabled>Y</enabled>
  314. <name>LINES_READ</name>
  315. </field>
  316. <field>
  317. <id>LINES_WRITTEN</id>
  318. <enabled>Y</enabled>
  319. <name>LINES_WRITTEN</name>
  320. </field>
  321. <field>
  322. <id>LINES_UPDATED</id>
  323. <enabled>Y</enabled>
  324. <name>LINES_UPDATED</name>
  325. </field>
  326. <field>
  327. <id>LINES_INPUT</id>
  328. <enabled>Y</enabled>
  329. <name>LINES_INPUT</name>
  330. </field>
  331. <field>
  332. <id>LINES_OUTPUT</id>
  333. <enabled>Y</enabled>
  334. <name>LINES_OUTPUT</name>
  335. </field>
  336. <field>
  337. <id>LINES_REJECTED</id>
  338. <enabled>Y</enabled>
  339. <name>LINES_REJECTED</name>
  340. </field>
  341. <field>
  342. <id>ERRORS</id>
  343. <enabled>Y</enabled>
  344. <name>ERRORS</name>
  345. </field>
  346. <field>
  347. <id>LOG_FIELD</id>
  348. <enabled>N</enabled>
  349. <name>LOG_FIELD</name>
  350. </field>
  351. </step-log-table>
  352. <metrics-log-table>
  353. <connection/>
  354. <schema/>
  355. <table/>
  356. <timeout_days/>
  357. <field>
  358. <id>ID_BATCH</id>
  359. <enabled>Y</enabled>
  360. <name>ID_BATCH</name>
  361. </field>
  362. <field>
  363. <id>CHANNEL_ID</id>
  364. <enabled>Y</enabled>
  365. <name>CHANNEL_ID</name>
  366. </field>
  367. <field>
  368. <id>LOG_DATE</id>
  369. <enabled>Y</enabled>
  370. <name>LOG_DATE</name>
  371. </field>
  372. <field>
  373. <id>METRICS_DATE</id>
  374. <enabled>Y</enabled>
  375. <name>METRICS_DATE</name>
  376. </field>
  377. <field>
  378. <id>METRICS_CODE</id>
  379. <enabled>Y</enabled>
  380. <name>METRICS_CODE</name>
  381. </field>
  382. <field>
  383. <id>METRICS_DESCRIPTION</id>
  384. <enabled>Y</enabled>
  385. <name>METRICS_DESCRIPTION</name>
  386. </field>
  387. <field>
  388. <id>METRICS_SUBJECT</id>
  389. <enabled>Y</enabled>
  390. <name>METRICS_SUBJECT</name>
  391. </field>
  392. <field>
  393. <id>METRICS_TYPE</id>
  394. <enabled>Y</enabled>
  395. <name>METRICS_TYPE</name>
  396. </field>
  397. <field>
  398. <id>METRICS_VALUE</id>
  399. <enabled>Y</enabled>
  400. <name>METRICS_VALUE</name>
  401. </field>
  402. </metrics-log-table>
  403. </log>
  404. <maxdate>
  405. <connection/>
  406. <table/>
  407. <field/>
  408. <offset>0.0</offset>
  409. <maxdiff>0.0</maxdiff>
  410. </maxdate>
  411. <size_rowset>10000</size_rowset>
  412. <sleep_time_empty>50</sleep_time_empty>
  413. <sleep_time_full>50</sleep_time_full>
  414. <unique_connections>N</unique_connections>
  415. <feedback_shown>Y</feedback_shown>
  416. <feedback_size>50000</feedback_size>
  417. <using_thread_priorities>Y</using_thread_priorities>
  418. <shared_objects_file/>
  419. <capture_step_performance>N</capture_step_performance>
  420. <step_performance_capturing_delay>1000</step_performance_capturing_delay>
  421. <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
  422. <dependencies>
  423. </dependencies>
  424. <partitionschemas>
  425. </partitionschemas>
  426. <slaveservers>
  427. </slaveservers>
  428. <clusterschemas>
  429. </clusterschemas>
  430. <created_user>-</created_user>
  431. <created_date>2024/01/09 15:07:19.021</created_date>
  432. <modified_user>-</modified_user>
  433. <modified_date>2024/01/09 15:07:19.021</modified_date>
  434. <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
  435. <is_key_private>N</is_key_private>
  436. </info>
  437. <notepads>
  438. </notepads>
  439. <connection>
  440. <name>MOM</name>
  441. <server>${MOMDB_HOST}</server>
  442. <type>MYSQL</type>
  443. <access>Native</access>
  444. <database>${MOMDB_NAME}</database>
  445. <port>3306</port>
  446. <username>${MOMDB_USER}</username>
  447. <password>${MOMDB_PASSWORD}</password>
  448. <servername/>
  449. <data_tablespace/>
  450. <index_tablespace/>
  451. <attributes>
  452. <attribute>
  453. <code>EXTRA_OPTION_MYSQL.characterEncoding</code>
  454. <attribute>utf-8</attribute>
  455. </attribute>
  456. <attribute>
  457. <code>EXTRA_OPTION_MYSQL.defaultFetchSize</code>
  458. <attribute>5000</attribute>
  459. </attribute>
  460. <attribute>
  461. <code>EXTRA_OPTION_MYSQL.rewriteBatchedStatements</code>
  462. <attribute>true</attribute>
  463. </attribute>
  464. <attribute>
  465. <code>EXTRA_OPTION_MYSQL.useCompression</code>
  466. <attribute>true</attribute>
  467. </attribute>
  468. <attribute>
  469. <code>EXTRA_OPTION_MYSQL.useCursorFetch</code>
  470. <attribute>true</attribute>
  471. </attribute>
  472. <attribute>
  473. <code>EXTRA_OPTION_MYSQL.useServerPrepStmts</code>
  474. <attribute>true</attribute>
  475. </attribute>
  476. <attribute>
  477. <code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
  478. <attribute>N</attribute>
  479. </attribute>
  480. <attribute>
  481. <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
  482. <attribute>N</attribute>
  483. </attribute>
  484. <attribute>
  485. <code>IS_CLUSTERED</code>
  486. <attribute>N</attribute>
  487. </attribute>
  488. <attribute>
  489. <code>PORT_NUMBER</code>
  490. <attribute>3306</attribute>
  491. </attribute>
  492. <attribute>
  493. <code>PRESERVE_RESERVED_WORD_CASE</code>
  494. <attribute>Y</attribute>
  495. </attribute>
  496. <attribute>
  497. <code>QUOTE_ALL_FIELDS</code>
  498. <attribute>N</attribute>
  499. </attribute>
  500. <attribute>
  501. <code>STREAM_RESULTS</code>
  502. <attribute>N</attribute>
  503. </attribute>
  504. <attribute>
  505. <code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
  506. <attribute>Y</attribute>
  507. </attribute>
  508. <attribute>
  509. <code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
  510. <attribute>Y</attribute>
  511. </attribute>
  512. <attribute>
  513. <code>USE_POOLING</code>
  514. <attribute>N</attribute>
  515. </attribute>
  516. </attributes>
  517. </connection>
  518. <connection>
  519. <name>U8</name>
  520. <server>${U8DB_HOST}</server>
  521. <type>MSSQL</type>
  522. <access>Native</access>
  523. <database>${U8DB_NAME}</database>
  524. <port>1433</port>
  525. <username>${U8DB_USER}</username>
  526. <password>${U8DB_PASSWORD}</password>
  527. <servername/>
  528. <data_tablespace/>
  529. <index_tablespace/>
  530. <attributes>
  531. <attribute>
  532. <code>EXTRA_OPTION_MSSQL.instance</code>
  533. <attribute>dbo</attribute>
  534. </attribute>
  535. <attribute>
  536. <code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
  537. <attribute>N</attribute>
  538. </attribute>
  539. <attribute>
  540. <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
  541. <attribute>N</attribute>
  542. </attribute>
  543. <attribute>
  544. <code>IS_CLUSTERED</code>
  545. <attribute>N</attribute>
  546. </attribute>
  547. <attribute>
  548. <code>MSSQL_DOUBLE_DECIMAL_SEPARATOR</code>
  549. <attribute>N</attribute>
  550. </attribute>
  551. <attribute>
  552. <code>PORT_NUMBER</code>
  553. <attribute>1433</attribute>
  554. </attribute>
  555. <attribute>
  556. <code>PRESERVE_RESERVED_WORD_CASE</code>
  557. <attribute>Y</attribute>
  558. </attribute>
  559. <attribute>
  560. <code>QUOTE_ALL_FIELDS</code>
  561. <attribute>N</attribute>
  562. </attribute>
  563. <attribute>
  564. <code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
  565. <attribute>Y</attribute>
  566. </attribute>
  567. <attribute>
  568. <code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
  569. <attribute>Y</attribute>
  570. </attribute>
  571. <attribute>
  572. <code>USE_POOLING</code>
  573. <attribute>N</attribute>
  574. </attribute>
  575. </attributes>
  576. </connection>
  577. <order>
  578. <hop>
  579. <from>插入 / 更新</from>
  580. <to>复制记录到结果</to>
  581. <enabled>Y</enabled>
  582. </hop>
  583. <hop>
  584. <from>Java 代码-id</from>
  585. <to>插入 / 更新</to>
  586. <enabled>Y</enabled>
  587. </hop>
  588. <hop>
  589. <from>表输入</from>
  590. <to>Java 代码-id</to>
  591. <enabled>Y</enabled>
  592. </hop>
  593. </order>
  594. <step>
  595. <name>Java 代码-id</name>
  596. <type>UserDefinedJavaClass</type>
  597. <description/>
  598. <distribute>Y</distribute>
  599. <custom_distribution/>
  600. <copies>1</copies>
  601. <partitioning>
  602. <method>none</method>
  603. <schema_name/>
  604. </partitioning>
  605. <definitions>
  606. <definition>
  607. <class_type>TRANSFORM_CLASS</class_type>
  608. <class_name>Processor</class_name>
  609. <class_source>//import com.cath.set.util.CodeRuleUtil;
  610. import com.cath.util.SnowflakeIdWorkerUtil;
  611. SnowflakeIdWorkerUtil snowflakeIdWorkerUtil = new SnowflakeIdWorkerUtil(3, 5, 5);
  612. public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException {
  613. if (first) {
  614. first = false;
  615. }
  616. Object[] r = getRow();
  617. if (r == null) {
  618. setOutputDone();
  619. return false;
  620. }
  621. r = createOutputRow(r, data.outputRowMeta.size());
  622. //String taskCode = get(Fields.In, "interface_code").getString(r);
  623. //get(Fields.Out, "task_code").setValue(r, taskCode);
  624. String id = String.valueOf(snowflakeIdWorkerUtil.nextId());
  625. get(Fields.Out, "id").setValue(r, id);
  626. putRow(data.outputRowMeta, r);
  627. return true;
  628. }
  629. </class_source>
  630. </definition>
  631. </definitions>
  632. <fields>
  633. <field>
  634. <field_name>id</field_name>
  635. <field_type>String</field_type>
  636. <field_length>-1</field_length>
  637. <field_precision>-1</field_precision>
  638. </field>
  639. </fields>
  640. <clear_result_fields>N</clear_result_fields>
  641. <info_steps/>
  642. <target_steps/>
  643. <usage_parameters/>
  644. <attributes/>
  645. <cluster_schema/>
  646. <remotesteps>
  647. <input>
  648. </input>
  649. <output>
  650. </output>
  651. </remotesteps>
  652. <GUI>
  653. <xloc>304</xloc>
  654. <yloc>128</yloc>
  655. <draw>Y</draw>
  656. </GUI>
  657. </step>
  658. <step>
  659. <name>复制记录到结果</name>
  660. <type>RowsToResult</type>
  661. <description/>
  662. <distribute>Y</distribute>
  663. <custom_distribution/>
  664. <copies>1</copies>
  665. <partitioning>
  666. <method>none</method>
  667. <schema_name/>
  668. </partitioning>
  669. <attributes/>
  670. <cluster_schema/>
  671. <remotesteps>
  672. <input>
  673. </input>
  674. <output>
  675. </output>
  676. </remotesteps>
  677. <GUI>
  678. <xloc>608</xloc>
  679. <yloc>128</yloc>
  680. <draw>Y</draw>
  681. </GUI>
  682. </step>
  683. <step>
  684. <name>插入 / 更新</name>
  685. <type>InsertUpdate</type>
  686. <description/>
  687. <distribute>Y</distribute>
  688. <custom_distribution/>
  689. <copies>1</copies>
  690. <partitioning>
  691. <method>none</method>
  692. <schema_name/>
  693. </partitioning>
  694. <connection>MOM</connection>
  695. <commit>1000</commit>
  696. <update_bypassed>Y</update_bypassed>
  697. <lookup>
  698. <schema/>
  699. <table>wms_task_in</table>
  700. <key>
  701. <name>interface_id</name>
  702. <field>interface_id</field>
  703. <condition>=</condition>
  704. <name2/>
  705. </key>
  706. <key>
  707. <name>bill_type</name>
  708. <field>bill_type</field>
  709. <condition>=</condition>
  710. <name2/>
  711. </key>
  712. <value>
  713. <name>interface_id</name>
  714. <rename>interface_id</rename>
  715. <update>N</update>
  716. </value>
  717. <value>
  718. <name>interface_code</name>
  719. <rename>interface_code</rename>
  720. <update>N</update>
  721. </value>
  722. <value>
  723. <name>id</name>
  724. <rename>id</rename>
  725. <update>N</update>
  726. </value>
  727. <value>
  728. <name>bill_type</name>
  729. <rename>bill_type</rename>
  730. <update>N</update>
  731. </value>
  732. <value>
  733. <name>task_type</name>
  734. <rename>task_type</rename>
  735. <update>N</update>
  736. </value>
  737. <value>
  738. <name>task_date</name>
  739. <rename>task_date</rename>
  740. <update>N</update>
  741. </value>
  742. <value>
  743. <name>task_code</name>
  744. <rename>task_code</rename>
  745. <update>N</update>
  746. </value>
  747. <value>
  748. <name>dept_code</name>
  749. <rename>dept_code</rename>
  750. <update>N</update>
  751. </value>
  752. <value>
  753. <name>employee_code</name>
  754. <rename>employee_code</rename>
  755. <update>N</update>
  756. </value>
  757. <value>
  758. <name>supplier_code</name>
  759. <rename>supplier_code</rename>
  760. <update>N</update>
  761. </value>
  762. <value>
  763. <name>create_id</name>
  764. <rename>sync_id</rename>
  765. <update>N</update>
  766. </value>
  767. <value>
  768. <name>create_by</name>
  769. <rename>sync_name</rename>
  770. <update>N</update>
  771. </value>
  772. <value>
  773. <name>create_time</name>
  774. <rename>sync_time</rename>
  775. <update>N</update>
  776. </value>
  777. </lookup>
  778. <attributes/>
  779. <cluster_schema/>
  780. <remotesteps>
  781. <input>
  782. </input>
  783. <output>
  784. </output>
  785. </remotesteps>
  786. <GUI>
  787. <xloc>448</xloc>
  788. <yloc>128</yloc>
  789. <draw>Y</draw>
  790. </GUI>
  791. </step>
  792. <step>
  793. <name>表输入</name>
  794. <type>TableInput</type>
  795. <description/>
  796. <distribute>Y</distribute>
  797. <custom_distribution/>
  798. <copies>1</copies>
  799. <partitioning>
  800. <method>none</method>
  801. <schema_name/>
  802. </partitioning>
  803. <connection>U8</connection>
  804. <sql>DECLARE @USER_NAME VARCHAR(50),@USER_ID INT,@BEGIN_DATE DATE,@END_DATE DATE
  805. SET @USER_NAME = CASE '${USER_NAME}' WHEN '' THEN '管理员(kettle)' ELSE '${USER_NAME}' END
  806. SET @USER_ID = CASE 0${USER_ID} WHEN 0 THEN 1 ELSE 0${USER_ID} END
  807. SET @BEGIN_DATE = CASE '${BEGIN_DATE}' WHEN '' THEN CONVERT(VARCHAR(100), GETDATE(), 23) ELSE '${BEGIN_DATE}' END
  808. SET @END_DATE = CASE '${BEGIN_DATE}' WHEN '' THEN CONVERT(VARCHAR(100), GETDATE(), 23) ELSE '${END_DATE}' END
  809. SELECT
  810. T1.POID AS interface_id
  811. ,T1.cPOID AS interface_code
  812. ,1 AS task_type --1入库、-1入库退、-1出库、1出库退
  813. ,4 AS bill_type --1生产订单、2委外订单、3委外到货单、4采购订单、5采购到货单、6销售订单、7销售发货单
  814. ,'IT4-'+T1.cPOID AS task_code
  815. ,CONVERT(DATE,T1.dPODate) AS task_date
  816. ,T1.cDepCode AS dept_code
  817. ,T1.cPersonCode AS employee_code
  818. ,T1.cVenCode AS supplier_code
  819. ,@USER_NAME AS sync_name
  820. ,@USER_ID AS sync_id
  821. ,GETDATE() AS sync_time
  822. FROM PO_Pomain T1
  823. WHERE 1=1
  824. AND T1.cState =1 --1审核 2关闭
  825. AND NOT EXISTS(SELECT 1 FROM PO_Podetails T WHERE T.POID =T1.POID AND ISNULL(iReceivedQTY,0) &lt;&gt;0)
  826. AND CONVERT(DATE,T1.dPODate) BETWEEN @BEGIN_DATE AND @END_DATE
  827. </sql>
  828. <limit>0</limit>
  829. <lookup/>
  830. <execute_each_row>N</execute_each_row>
  831. <variables_active>Y</variables_active>
  832. <lazy_conversion_active>N</lazy_conversion_active>
  833. <cached_row_meta_active>N</cached_row_meta_active>
  834. <row-meta>
  835. <value-meta>
  836. <type>Integer</type>
  837. <storagetype>normal</storagetype>
  838. <name>interface_id</name>
  839. <length>9</length>
  840. <precision>0</precision>
  841. <origin>表输入</origin>
  842. <comments>interface_id</comments>
  843. <conversion_Mask>####0;-####0</conversion_Mask>
  844. <decimal_symbol>.</decimal_symbol>
  845. <grouping_symbol>,</grouping_symbol>
  846. <currency_symbol/>
  847. <trim_type>none</trim_type>
  848. <case_insensitive>N</case_insensitive>
  849. <collator_disabled>Y</collator_disabled>
  850. <collator_strength>0</collator_strength>
  851. <sort_descending>N</sort_descending>
  852. <output_padding>N</output_padding>
  853. <date_format_lenient>N</date_format_lenient>
  854. <date_format_locale>zh_CN</date_format_locale>
  855. <date_format_timezone>Asia/Shanghai</date_format_timezone>
  856. <lenient_string_to_number>N</lenient_string_to_number>
  857. </value-meta>
  858. <value-meta>
  859. <type>String</type>
  860. <storagetype>normal</storagetype>
  861. <name>interface_code</name>
  862. <length>30</length>
  863. <precision>-1</precision>
  864. <origin>表输入</origin>
  865. <comments>interface_code</comments>
  866. <conversion_Mask/>
  867. <decimal_symbol>.</decimal_symbol>
  868. <grouping_symbol>,</grouping_symbol>
  869. <currency_symbol/>
  870. <trim_type>none</trim_type>
  871. <case_insensitive>N</case_insensitive>
  872. <collator_disabled>Y</collator_disabled>
  873. <collator_strength>0</collator_strength>
  874. <sort_descending>N</sort_descending>
  875. <output_padding>N</output_padding>
  876. <date_format_lenient>N</date_format_lenient>
  877. <date_format_locale>zh_CN</date_format_locale>
  878. <date_format_timezone>Asia/Shanghai</date_format_timezone>
  879. <lenient_string_to_number>N</lenient_string_to_number>
  880. </value-meta>
  881. <value-meta>
  882. <type>Integer</type>
  883. <storagetype>normal</storagetype>
  884. <name>task_type</name>
  885. <length>9</length>
  886. <precision>0</precision>
  887. <origin>表输入</origin>
  888. <comments>task_type</comments>
  889. <conversion_Mask>####0;-####0</conversion_Mask>
  890. <decimal_symbol>.</decimal_symbol>
  891. <grouping_symbol>,</grouping_symbol>
  892. <currency_symbol/>
  893. <trim_type>none</trim_type>
  894. <case_insensitive>N</case_insensitive>
  895. <collator_disabled>Y</collator_disabled>
  896. <collator_strength>0</collator_strength>
  897. <sort_descending>N</sort_descending>
  898. <output_padding>N</output_padding>
  899. <date_format_lenient>N</date_format_lenient>
  900. <date_format_locale>zh_CN</date_format_locale>
  901. <date_format_timezone>Asia/Shanghai</date_format_timezone>
  902. <lenient_string_to_number>N</lenient_string_to_number>
  903. </value-meta>
  904. <value-meta>
  905. <type>Integer</type>
  906. <storagetype>normal</storagetype>
  907. <name>bill_type</name>
  908. <length>9</length>
  909. <precision>0</precision>
  910. <origin>表输入</origin>
  911. <comments>bill_type</comments>
  912. <conversion_Mask>####0;-####0</conversion_Mask>
  913. <decimal_symbol>.</decimal_symbol>
  914. <grouping_symbol>,</grouping_symbol>
  915. <currency_symbol/>
  916. <trim_type>none</trim_type>
  917. <case_insensitive>N</case_insensitive>
  918. <collator_disabled>Y</collator_disabled>
  919. <collator_strength>0</collator_strength>
  920. <sort_descending>N</sort_descending>
  921. <output_padding>N</output_padding>
  922. <date_format_lenient>N</date_format_lenient>
  923. <date_format_locale>zh_CN</date_format_locale>
  924. <date_format_timezone>Asia/Shanghai</date_format_timezone>
  925. <lenient_string_to_number>N</lenient_string_to_number>
  926. </value-meta>
  927. <value-meta>
  928. <type>String</type>
  929. <storagetype>normal</storagetype>
  930. <name>task_code</name>
  931. <length>34</length>
  932. <precision>-1</precision>
  933. <origin>表输入</origin>
  934. <comments>task_code</comments>
  935. <conversion_Mask/>
  936. <decimal_symbol>.</decimal_symbol>
  937. <grouping_symbol>,</grouping_symbol>
  938. <currency_symbol/>
  939. <trim_type>none</trim_type>
  940. <case_insensitive>N</case_insensitive>
  941. <collator_disabled>Y</collator_disabled>
  942. <collator_strength>0</collator_strength>
  943. <sort_descending>N</sort_descending>
  944. <output_padding>N</output_padding>
  945. <date_format_lenient>N</date_format_lenient>
  946. <date_format_locale>zh_CN</date_format_locale>
  947. <date_format_timezone>Asia/Shanghai</date_format_timezone>
  948. <lenient_string_to_number>N</lenient_string_to_number>
  949. </value-meta>
  950. <value-meta>
  951. <type>String</type>
  952. <storagetype>normal</storagetype>
  953. <name>task_date</name>
  954. <length>10</length>
  955. <precision>-1</precision>
  956. <origin>表输入</origin>
  957. <comments>task_date</comments>
  958. <conversion_Mask/>
  959. <decimal_symbol>.</decimal_symbol>
  960. <grouping_symbol>,</grouping_symbol>
  961. <currency_symbol/>
  962. <trim_type>none</trim_type>
  963. <case_insensitive>N</case_insensitive>
  964. <collator_disabled>Y</collator_disabled>
  965. <collator_strength>0</collator_strength>
  966. <sort_descending>N</sort_descending>
  967. <output_padding>N</output_padding>
  968. <date_format_lenient>N</date_format_lenient>
  969. <date_format_locale>zh_CN</date_format_locale>
  970. <date_format_timezone>Asia/Shanghai</date_format_timezone>
  971. <lenient_string_to_number>N</lenient_string_to_number>
  972. </value-meta>
  973. <value-meta>
  974. <type>String</type>
  975. <storagetype>normal</storagetype>
  976. <name>dept_code</name>
  977. <length>12</length>
  978. <precision>-1</precision>
  979. <origin>表输入</origin>
  980. <comments>dept_code</comments>
  981. <conversion_Mask/>
  982. <decimal_symbol>.</decimal_symbol>
  983. <grouping_symbol>,</grouping_symbol>
  984. <currency_symbol/>
  985. <trim_type>none</trim_type>
  986. <case_insensitive>N</case_insensitive>
  987. <collator_disabled>Y</collator_disabled>
  988. <collator_strength>0</collator_strength>
  989. <sort_descending>N</sort_descending>
  990. <output_padding>N</output_padding>
  991. <date_format_lenient>N</date_format_lenient>
  992. <date_format_locale>zh_CN</date_format_locale>
  993. <date_format_timezone>Asia/Shanghai</date_format_timezone>
  994. <lenient_string_to_number>N</lenient_string_to_number>
  995. </value-meta>
  996. <value-meta>
  997. <type>String</type>
  998. <storagetype>normal</storagetype>
  999. <name>employee_code</name>
  1000. <length>20</length>
  1001. <precision>-1</precision>
  1002. <origin>表输入</origin>
  1003. <comments>employee_code</comments>
  1004. <conversion_Mask/>
  1005. <decimal_symbol>.</decimal_symbol>
  1006. <grouping_symbol>,</grouping_symbol>
  1007. <currency_symbol/>
  1008. <trim_type>none</trim_type>
  1009. <case_insensitive>N</case_insensitive>
  1010. <collator_disabled>Y</collator_disabled>
  1011. <collator_strength>0</collator_strength>
  1012. <sort_descending>N</sort_descending>
  1013. <output_padding>N</output_padding>
  1014. <date_format_lenient>N</date_format_lenient>
  1015. <date_format_locale>zh_CN</date_format_locale>
  1016. <date_format_timezone>Asia/Shanghai</date_format_timezone>
  1017. <lenient_string_to_number>N</lenient_string_to_number>
  1018. </value-meta>
  1019. <value-meta>
  1020. <type>String</type>
  1021. <storagetype>normal</storagetype>
  1022. <name>supplier_code</name>
  1023. <length>20</length>
  1024. <precision>-1</precision>
  1025. <origin>表输入</origin>
  1026. <comments>supplier_code</comments>
  1027. <conversion_Mask/>
  1028. <decimal_symbol>.</decimal_symbol>
  1029. <grouping_symbol>,</grouping_symbol>
  1030. <currency_symbol/>
  1031. <trim_type>none</trim_type>
  1032. <case_insensitive>N</case_insensitive>
  1033. <collator_disabled>Y</collator_disabled>
  1034. <collator_strength>0</collator_strength>
  1035. <sort_descending>N</sort_descending>
  1036. <output_padding>N</output_padding>
  1037. <date_format_lenient>N</date_format_lenient>
  1038. <date_format_locale>zh_CN</date_format_locale>
  1039. <date_format_timezone>Asia/Shanghai</date_format_timezone>
  1040. <lenient_string_to_number>N</lenient_string_to_number>
  1041. </value-meta>
  1042. <value-meta>
  1043. <type>String</type>
  1044. <storagetype>normal</storagetype>
  1045. <name>sync_name</name>
  1046. <length>6</length>
  1047. <precision>-1</precision>
  1048. <origin>表输入</origin>
  1049. <comments>sync_name</comments>
  1050. <conversion_Mask/>
  1051. <decimal_symbol>.</decimal_symbol>
  1052. <grouping_symbol>,</grouping_symbol>
  1053. <currency_symbol/>
  1054. <trim_type>none</trim_type>
  1055. <case_insensitive>N</case_insensitive>
  1056. <collator_disabled>Y</collator_disabled>
  1057. <collator_strength>0</collator_strength>
  1058. <sort_descending>N</sort_descending>
  1059. <output_padding>N</output_padding>
  1060. <date_format_lenient>N</date_format_lenient>
  1061. <date_format_locale>zh_CN</date_format_locale>
  1062. <date_format_timezone>Asia/Shanghai</date_format_timezone>
  1063. <lenient_string_to_number>N</lenient_string_to_number>
  1064. </value-meta>
  1065. <value-meta>
  1066. <type>Integer</type>
  1067. <storagetype>normal</storagetype>
  1068. <name>sync_id</name>
  1069. <length>9</length>
  1070. <precision>0</precision>
  1071. <origin>表输入</origin>
  1072. <comments>sync_id</comments>
  1073. <conversion_Mask>####0;-####0</conversion_Mask>
  1074. <decimal_symbol>.</decimal_symbol>
  1075. <grouping_symbol>,</grouping_symbol>
  1076. <currency_symbol/>
  1077. <trim_type>none</trim_type>
  1078. <case_insensitive>N</case_insensitive>
  1079. <collator_disabled>Y</collator_disabled>
  1080. <collator_strength>0</collator_strength>
  1081. <sort_descending>N</sort_descending>
  1082. <output_padding>N</output_padding>
  1083. <date_format_lenient>N</date_format_lenient>
  1084. <date_format_locale>zh_CN</date_format_locale>
  1085. <date_format_timezone>Asia/Shanghai</date_format_timezone>
  1086. <lenient_string_to_number>N</lenient_string_to_number>
  1087. </value-meta>
  1088. <value-meta>
  1089. <type>Timestamp</type>
  1090. <storagetype>normal</storagetype>
  1091. <name>sync_time</name>
  1092. <length>3</length>
  1093. <precision>-1</precision>
  1094. <origin>表输入</origin>
  1095. <comments>sync_time</comments>
  1096. <conversion_Mask/>
  1097. <decimal_symbol>.</decimal_symbol>
  1098. <grouping_symbol>,</grouping_symbol>
  1099. <currency_symbol/>
  1100. <trim_type>none</trim_type>
  1101. <case_insensitive>N</case_insensitive>
  1102. <collator_disabled>Y</collator_disabled>
  1103. <collator_strength>0</collator_strength>
  1104. <sort_descending>N</sort_descending>
  1105. <output_padding>N</output_padding>
  1106. <date_format_lenient>N</date_format_lenient>
  1107. <date_format_locale>zh_CN</date_format_locale>
  1108. <date_format_timezone>Asia/Shanghai</date_format_timezone>
  1109. <lenient_string_to_number>N</lenient_string_to_number>
  1110. </value-meta>
  1111. </row-meta>
  1112. <attributes/>
  1113. <cluster_schema/>
  1114. <remotesteps>
  1115. <input>
  1116. </input>
  1117. <output>
  1118. </output>
  1119. </remotesteps>
  1120. <GUI>
  1121. <xloc>144</xloc>
  1122. <yloc>128</yloc>
  1123. <draw>Y</draw>
  1124. </GUI>
  1125. </step>
  1126. <step_error_handling>
  1127. </step_error_handling>
  1128. <slave-step-copy-partition-distribution>
  1129. </slave-step-copy-partition-distribution>
  1130. <slave_transformation>N</slave_transformation>
  1131. <attributes/>
  1132. </transformation>